Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/core/src/plugin/command/dag-flow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ failure, state that it did not start and report the real error; do not invent a
replacement run.

A final synthesis block must contain the requested result rather than a plan or
placeholder. The parent verifies that artifact, disposes of any non-ACCEPT
review verdict, and gives the user one final report.
placeholder. If its wake message says `truncated=true`, the parent reads every
page with `workflow(action="result")` before verification. The parent verifies
that complete artifact, disposes of any non-ACCEPT review verdict, and gives the
user one final report.
35 changes: 22 additions & 13 deletions packages/core/src/plugin/command/workflow-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,47 @@ or existing durable node IDs during **extend** and replan.
- `explore`: read-only repository mapping and evidence collection.
- `plan`: implementation-ready decomposition, seams, checks, and risks.
- `prototype`: the smallest throwaway experiment that resolves a runnable
uncertainty; it does not silently become production code.
uncertainty; it does not silently become production code. It still publishes
its changed-file list and fingerprint so later verification or review cannot
bind to stale experiment evidence.
- `debug`: expands to reproduce/evidence followed by root-cause diagnosis.
- `coding`: bounded production implementation plus focused tests and checks.
- `verify`: deterministic acceptance checks with explicit PASS/FAIL evidence.
- `review`: expands to independent standards and intent reviews, then one
structured arbiter returning `ACCEPT | REVISE | REJECT | BLOCKED`.
- `review`: design/content inputs expand to independent standards and intent
reviews plus a general arbiter. An implementation input must follow a
`coding → verify(PASS) → review` route; the compiler binds the implementation
fingerprint through both reviews into an `ACCEPT | REJECT` decision.
- `synthesize`: resolves dependency outputs into the parent-facing result.

Every compiled block is required by default. `review` and `synthesize` report
to the parent by default; other blocks stay quiet. A block immediately after a
review gate is conditioned on `ACCEPT`. Because the condition language handles
one verdict reference, fan multiple review lanes into one review block before
continuing.
Judgment and acceptance gates (`plan`, debug diagnosis, `verify`, review
decision, and `synthesize`) are required by default. Volume lanes (`explore`,
`prototype`, `coding`, debug evidence, and independent review lanes) are
optional by default; an explicit `required` value on a block overrides its
default. `review` and `synthesize` report to the parent by default; other blocks
stay quiet. A block immediately after a review gate is conditioned on its
accepted verdict. Because the condition language handles one verdict reference,
fan multiple review lanes into one review block before continuing.

## Composition routes

Choose only blocks justified by current evidence:

- Product or architecture decision: parallel `explore` lanes → `plan` options
→ `review` or `synthesize`.
- Project feature: optional `explore` → `plan` → parallel `coding` packages
`verify` → `review`.
- Project feature: optional parallel `explore` or proposal lanes → `plan`
ordered `coding`/assembly → `verify` → `review`.
- Hard bug: `debug` → `coding` → `verify` → `review`.
- Runnable design uncertainty: `prototype` → `plan`; keep the prototype
disposable unless the confirmed scope explicitly promotes it.
- Existing implementation review: `explore` scope lanes → `review`; add a
separate verification block first when test evidence is required.

Do not add a phase merely because it exists. Skip exploration when repository
facts are already known, skip a prototype when ordinary inspection resolves
the question, and keep independent work parallel. Use `synthesize` only when
multiple outputs need reconciliation.
facts are already known and skip a prototype when ordinary inspection resolves
the question. All block workers share one workspace: the compiler serializes
otherwise-unordered `coding` and `prototype` writers, while read-only discovery
and proposal lanes remain parallel. Use `synthesize` only when multiple outputs
need reconciliation.

## Parent decision checkpoint

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/plugin/command/workflow-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Load details only when needed:
- **extend** adds nodes or blocks to the same objective.
- **status** reads durable state when the user asks or before a control
decision; it is not a waiting mechanism.
- **result** reads one node's complete durable output in bounded pages when a
wake preview reports `truncated=true`.
- **control** pauses, resumes, cancels, replans, steps, or completes a workflow.
- **list** shows saved workflow specs and their resolution scope.
- **read** returns one saved spec so the parent can retarget it before start.
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/plugin/command/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,15 @@ then call `{ action: "extend", workflow_id: "dag_...", spec: { nodes: [...] } }`

**status** — Read the durable state of one workflow and all of its nodes. Pass `workflow_id`. Use it when the user explicitly asks for current state or once before a decision that requires fresh state, such as replan/control. Do not poll a running workflow merely to wait: node reports and terminal outcomes wake the parent session automatically.

**result** — Read one node's complete durable output in bounded pages. Pass
`workflow_id` and `node_id`; when the response is truncated, pass its
`next_cursor` unchanged until no cursor remains. Wake messages contain only a
bounded preview plus the exact workflow/node reference, so use `result` before
verifying or synthesizing any output marked `truncated=true`. Never infer the
omitted content from its preview.

**control** — Control a running workflow:

- `pause` — let running nodes finish, don't spawn new ones (pause does NOT stop nodes that are already running). On a cancel/replan intent, always pause FIRST: it needs no fragment and freezes scheduling while you compose the replan, so the graph cannot terminalize under you.
- `resume` — resume scheduling
- `cancel` — cancel the entire workflow
Expand Down
Loading
Loading