You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(prototype): complete injection lists for all payload arrays
Fill in missing injection entries across 4 payload arrays:
- elab-to-gate: add stage body, upstream inputs, design MCP detection
- gate-to-execute: add stage body, upstream context
- wave-to-wave: add stage body, execution override, output requirements
- preelab-to-stage1: add STAGE.md body injection
Every payload injection array now reflects the full set of artifacts
injected by the orchestrator at that FSM transition.
https://claude.ai/code/session_01WtQrEmTYmoUheaP49HAei7
{hook: "inject-state-file",target: "`.haiku/_inject.md` (transient)",what: "structured snapshot of state.json the agent can read with the Read tool"},
3638
3638
{hook: "readStudio()",target: "agent prompt prepend",what: "**Studio context injection** — `readStudio(studio).body` is injected as studio-level context when a new stage starts, providing the studio's high-level goals, principles, and behavioral framing from `STUDIO.md`."},
3639
+
{hook: "readStageDef()",target: "agent prompt",what: "**Stage definition** — STAGE.md body is injected as the stage's behavioral definition and criteria guidance."},
3639
3640
],
3640
3641
action: "start_stage",
3641
3642
summary: `kick off the first stage (${stage.name}) — sets phase=elaborate`,
{hook: "MCP tool result",target: "agent's `tool_use_result`",what: "**blocking** until user clicks; on resolve the click outcome (`approved`/`changes_requested`)"},
3662
3663
{hook: "_openReviewAndWait",target: "Review web UI",what: "the elaborated unit specs + DAG + `inputs:` declarations are rendered for human inspection"},
{hook: "readStageDef()",target: "agent prompt",what: "**Stage body** — the STAGE.md body content (criteria guidance, completion signals, overlap awareness) is injected as stage-level context for elaboration."},
3666
+
{hook: "resolveStageInputs()",target: "agent prompt",what: "**Upstream stage inputs** — artifacts produced by prior stages (discovery docs, output artifacts) are resolved and their content loaded (up to 3000 chars) as mandatory context."},
3667
+
{hook: "design MCP detection",target: "agent prompt (conditional)",what: "**Design provider MCPs** — if the stage includes design hats, instructions to use pencil/openpencil/figma MCP tools are injected."},
3664
3668
{hook: "FSM elaborate-tick instruction",target: "agent prompt (this same `haiku_run_next` call)",what: "**Discovery Fan-Out (REQUIRED)** — orchestrator enumerates the stage's `discovery/*.md` templates and instructs the agent to spawn one `Task` subagent per artifact, in parallel, for research + production. Each subagent receives its template embedded in `<discovery-template>` XML tags with explicit Content Guide and Quality Signals (per-subagent, not generic relay). Lives in `orchestrator.ts` elaborate-case `tool_use_result`."},
3665
3669
{hook: "FSM elaborate-tick instruction",target: "agent prompt (this same `haiku_run_next` call)",what: "**`<discovery-template>` per-subagent embedding** — each discovery subagent gets its own `<discovery-template>` XML block containing the template's Content Guide and Quality Signals sections, ensuring targeted instructions rather than a blanket relay of all templates."},
3666
3670
{hook: "readPhaseOverride()",target: "agent prompt prepend",what: "**Phase override injection** — `phases/ELABORATION.md` is read via `readPhaseOverride()` and injected during elaborate, providing studio-level elaboration guidance."},
{hook: "inject-state-file",target: "`.haiku/_inject.md`",what: "full state.json + active unit metadata for the agent to consult"},
3697
3701
{hook: "readPhaseOverride()",target: "agent prompt prepend",what: "**Phase override injection** — `phases/EXECUTION.md` is read via `readPhaseOverride()` and injected during `start_unit`/`continue_unit`/`start_units`, providing studio-level execution guidance."},
3698
3702
{hook: "readStageArtifactDefs()",target: "agent prompt prepend",what: "**Stage Output Requirements** — `readStageArtifactDefs()` loads output definitions from `outputs/*.md` and injects them as 'Stage Output Requirements' with name, location, format, and content guide per artifact."},
3703
+
{hook: "readStageDef()",target: "agent prompt",what: "**Stage body** — STAGE.md body injected with scope constraint ('stay within this stage's scope')."},
3704
+
{hook: "resolveStageInputs()",target: "agent prompt",what: "**Upstream context** — artifacts from prior stages not already in unit inputs are resolved and injected (up to 2000 chars each)."},
{hook: "MCP tool result",target: "agent's `tool_use_result`",what: `newly-eligible unit list (${(opts.units??[]).join(", ")}), each with worktree path + first hat`},
3754
3760
{hook: "inject-context",target: "next agent prompt prepend (per spawned unit context)",what: "the new unit's frontmatter, depends_on outputs (resolved file paths), first hat's instructions"},
3755
3761
{hook: "start_units embedding",target: "agent's `tool_use_result`",what: "**Batch unit embedding** — `start_units` embeds the hat definition once for the shared first hat, then embeds per-unit specs in `<unit-spec>` XML tags with each unit's frontmatter and resolved input content inline. Model cascade is resolved for the hat to determine subagent model."},
3762
+
{hook: "readStageDef()",target: "agent prompt",what: "**Stage body** — STAGE.md body injected with scope constraint."},
0 commit comments