Skip to content

Commit d5de52d

Browse files
committed
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
1 parent d7be661 commit d5de52d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

website/public/prototype-stage-flow.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,6 +3636,7 @@ <h2>Operations <span style="font-size:10px; font-weight:500; color: var(--muted)
36363636
{ hook: "inject-context", target: "next agent prompt prepend", what: "intent.md frontmatter (slug, title, studio, mode), `active_stage`, `phase=elaborate`" },
36373637
{ hook: "inject-state-file", target: "`.haiku/_inject.md` (transient)", what: "structured snapshot of state.json the agent can read with the Read tool" },
36383638
{ 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." },
36393640
],
36403641
action: "start_stage",
36413642
summary: `kick off the first stage (${stage.name}) — sets phase=elaborate`,
@@ -3661,6 +3662,9 @@ <h2>Operations <span style="font-size:10px; font-weight:500; color: var(--muted)
36613662
{ hook: "MCP tool result", target: "agent's `tool_use_result`", what: "**blocking** until user clicks; on resolve the click outcome (`approved`/`changes_requested`)" },
36623663
{ hook: "_openReviewAndWait", target: "Review web UI", what: "the elaborated unit specs + DAG + `inputs:` declarations are rendered for human inspection" },
36633664
{ hook: "inject-context", target: "next agent prompt prepend (after click)", what: "if approved: `phase=execute`, first wave's units. if rejected: revision instructions + previous attempt's content" },
3665+
{ 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." },
36643668
{ 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`." },
36653669
{ 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." },
36663670
{ 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." },
@@ -3696,6 +3700,8 @@ <h2>Operations <span style="font-size:10px; font-weight:500; color: var(--muted)
36963700
{ hook: "inject-state-file", target: "`.haiku/_inject.md`", what: "full state.json + active unit metadata for the agent to consult" },
36973701
{ 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." },
36983702
{ 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)." },
36993705
],
37003706
action: "advance_phase",
37013707
summary: "user approved specs — start wave 1",
@@ -3753,6 +3759,9 @@ <h2>Operations <span style="font-size:10px; font-weight:500; color: var(--muted)
37533759
{ hook: "MCP tool result", target: "agent's `tool_use_result`", what: `newly-eligible unit list (${(opts.units ?? []).join(", ")}), each with worktree path + first hat` },
37543760
{ 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" },
37553761
{ 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." },
3763+
{ hook: "readPhaseOverride()", target: "agent prompt", what: "**Execution override** — `phases/EXECUTION.md` injected for stage-specific execution guidance." },
3764+
{ hook: "readStageArtifactDefs()", target: "agent prompt", what: "**Output requirements** — output definitions from `outputs/*.md` injected as 'Stage Output Requirements'." },
37563765
],
37573766
action: opts.units && opts.units.length > 1 ? "start_units" : "start_unit",
37583767
summary: `wave ${opts.from} complete → start wave ${opts.to} (${(opts.units ?? []).join(", ")})`,

0 commit comments

Comments
 (0)