fix(workflow,kernel): split plan stage 'produces' (slot name) from 'kind' (artifact kind)

ExecutionPlanCompiler treated the plan's single 'produces' string as a
registry kind id, while the architect prompt described it as a unique
artifact id referenced by needs/edges — the model followed the prompt,
invented descriptive ids (files_created), and every freestyle plan
failed to compile. Collapsing both onto one string is also unsound:
two stages producing the same kind would collide on slot name and make
artifact_validated edge conditions ambiguous.

Plan stages now carry an optional 'kind' selecting the registered kind
(mirroring TOML's produces = { name, kind }); 'produces' stays the
unique slot name. Missing 'kind' falls back to the old produces-as-kind
reading so existing plans still compile. Vocabulary entry, architect
prompt, and execution_plan schemas updated to match.
This commit is contained in:
2026-06-12 12:44:22 +04:00
parent 4107a595db
commit c25ba27e57
6 changed files with 60 additions and 6 deletions
@@ -54,7 +54,9 @@ fun buildArtifactKindVocabularyEntry(kinds: Collection<ArtifactKind>): ContextEn
if (k.llmEmitted) "${k.id} (llm-emitted)" else k.id
}
val content = "## Available artifact kinds\n" +
"Every stage's \"produces\" MUST be exactly one of: $listing\n" +
"Every stage's \"kind\" MUST be exactly one of: $listing\n" +
"Stages that write or edit files use \"file_written\"; stages that run commands use " +
"\"process_result\".\n" +
"Do not invent kinds — a plan referencing an unknown kind fails to compile."
return ContextEntry(
id = ContextEntryId(UUID.randomUUID().toString()),