@sabaiway/agent-workflow-engine 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@ All notable changes to the methodology engine. Versions are this **package's** n
4
4
  they are distinct from the **deployment-lineage** stamp written into a project's `docs/ai/`
5
5
  (which tracks the shared `agent-workflow` lineage, head `3.0.0`).
6
6
 
7
+ ## 4.3.0 — the fifth recipe, the third activity, and a carrier that is never the one who commits (AD-124)
8
+
9
+ `references/orchestration.md` admits the CARRIER wherever it said backend: the orchestrator, a bridge
10
+ backend, or a full-tool frontier subagent dispatched from the placed executor vehicle; §2 lists
11
+ **Subagent** as the fifth recipe (a bounded, file-disjoint slice; degrades to Solo when the vehicle is
12
+ missing or unusable); §5 states the honest limit (a Claude Code lane — readiness is the vehicle FILE,
13
+ never the host; it spends no bridge quota but the host model's); §6 now reads "no recipe lets a
14
+ carrier commit or perform a git write … the orchestrator alone stages and commits".
15
+ `references/procedures.md`: `Slots: author, review` (the author carrier drafts from the orchestrator's
16
+ brief), the Subagent branch beside Delegated, and a new `## routine` activity (`Slots: carrier,
17
+ parallel`; a read-only slice rides a placed read-only vehicle, a write-capable one the executor; a
18
+ read-only chore has no commit boundary). Both injected pointer fragments name the fifth recipe and the
19
+ third activity; the prior texts are appended to the kit's known-prior stores, so a deployed slot
20
+ refreshes on the next reconcile.
21
+
22
+ ## 4.2.0 — a zero governing-spec citation names the adoption state it relies on (AD-123)
23
+
24
+ `references/agent-rules-lens.md`'s **Spec-first** bullet, `references/planning.md`'s *Goal and boundary*
25
+ and `references/specs.md`'s *Governing specs are plural* said a plan may cite ZERO governing specs
26
+ "during adoption" — and nothing defined adoption, so "zero, every plan, forever" read exactly like
27
+ adopting. Each now says the same thing at its own point of use: a ZERO names the state it relies on —
28
+ `not adopted` (no store, or a recorded decline), `adopting` (a store with no live contract) or
29
+ `nothing spec-covered touched` (a store with live contracts) — and a bare zero is never a licence; the
30
+ store's own state is what the kit's `status` and upgrade advisor report.
31
+
32
+ The outgoing lens body is appended to `agent-rules-lens-priors.md` (append-only), so every deployed
33
+ `agent_rules.md` on the previous wording refreshes on the next upgrade instead of reading as a custom
34
+ edit; `test/lens-fragment.test.mjs` computes the outgoing body by swapping the Spec-first line back and
35
+ pins the tokens `adoption state` and `never a licence`.
36
+
7
37
  ## 4.1.0 — the queue is a named surface with a checker, not a prose promise
8
38
 
9
39
  `references/planning.md` gains **`## The queue`**: `docs/plans/queue.md` NAMES work and never holds
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  methodology *text* — the capped plan shape (goal and boundary, module ledger, verification), the plan-file lifecycle
5
5
  (`docs/plans/*.md`, ephemeral, never committed), the `queue.md` series index, the mandatory
6
6
  final **Phase: Cleanup**, the **orchestration-recipe** vocabulary (Solo / Reviewed / Council /
7
- Delegated), the bounded slot fragments the family kit injects into a deployed project's
7
+ Delegated / Subagent), the bounded slot fragments the family kit injects into a deployed project's
8
8
  `AGENTS.md`, and the canonical agent-rules lens block the kit renders into a deployed
9
9
  `docs/ai/agent_rules.md`.
10
10
 
@@ -52,8 +52,9 @@ the canonical methodology reference on disk:
52
52
  methodology fragment the composition root injects into a deployed `AGENTS.md` (a short summary +
53
53
  pointer, kept under the entry point's line cap).
54
54
  - [`references/orchestration.md`](references/orchestration.md) — the canonical **orchestration-recipe**
55
- reference: the four recipes (Solo / Reviewed / Council / Delegated) over the bridges' role
56
- vocabulary, the when/why, the graceful-degradation lattice, and the quota/health guard.
55
+ reference: the five recipes (Solo / Reviewed / Council / Delegated / Subagent) over the bridges'
56
+ role vocabulary and the executor vehicle's `carry` role, the when/why, the graceful-degradation
57
+ lattice, and the quota/health guard.
57
58
  - [`references/orchestration-slot.md`](references/orchestration-slot.md) — the **bounded** one-line
58
59
  orchestration fragment the composition root injects into a deployed `AGENTS.md`, routing to the
59
60
  in-project recipes surface.
@@ -62,7 +63,7 @@ the canonical methodology reference on disk:
62
63
  for `docs/ai/autonomy.json` (read at session start; the canonical default floor when absent; STOP
63
64
  on malformed), routing to the in-project `set-autonomy` / `autonomy-doctor` surfaces.
64
65
  - [`references/procedures.md`](references/procedures.md) — the canonical **activity-procedures** canon:
65
- the named activities (`plan-authoring`, `plan-execution`) as ordered steps with typed recipe slots,
66
+ the named activities (`plan-authoring`, `plan-execution`, `routine`) as ordered steps with typed recipe slots,
66
67
  read live and rendered by the read-only `/agent-workflow-kit procedures <activity>`.
67
68
  - [`references/agent-rules-lens.md`](references/agent-rules-lens.md) — the canonical **agent-rules
68
69
  lens** block (the planning/review/process-fidelity invariants) the kit renders into a deployed
package/SKILL.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: agent-workflow-engine
3
- description: Canonical home of the agent-workflow planning methodology — the capped plan shape (goal and boundary, module ledger, verification), plan lifecycle, queue.md series index, mandatory Cleanup phase, the feature-spec canon (the durable per-feature contract layer with its frozen schema and Out-of-scope discipline), the bounded methodology slot fragment, the orchestration-recipe vocabulary (Solo / Reviewed / Council / Delegated), and the activity-procedures canon (plan-authoring / plan-execution, with typed recipe slots). A published, installable npm package (available:true) that *provides* the methodology text; it mutates nothing. The composition root (agent-workflow-kit) reads this canon LIVE from the installed engine and injects the bounded slots from it — one source of truth, no bundled mirror; `npx @sabaiway/agent-workflow-kit@latest init` installs the engine.
3
+ description: Canonical home of the agent-workflow planning methodology — the capped plan shape (goal and boundary, module ledger, verification), plan lifecycle, queue.md series index, mandatory Cleanup phase, the feature-spec canon (the durable per-feature contract layer with its frozen schema and Out-of-scope discipline), the bounded methodology slot fragment, the orchestration-recipe vocabulary (Solo / Reviewed / Council / Delegated / Subagent), and the activity-procedures canon (plan-authoring / plan-execution / routine, with typed recipe slots). A published, installable npm package (available:true) that *provides* the methodology text; it mutates nothing. The composition root (agent-workflow-kit) reads this canon LIVE from the installed engine and injects the bounded slots from it — one source of truth, no bundled mirror; `npx @sabaiway/agent-workflow-kit@latest init` installs the engine.
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '4.1.0'
6
+ version: '4.3.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-engine
@@ -34,13 +34,13 @@ slot fill is needed but the engine is absent, the kit's reconcile **fails loudly
34
34
  `<!-- workflow:methodology:start -->` / `<!-- workflow:methodology:end -->` markers. A short
35
35
  summary + pointer, not the full reference, so the entry point stays under its line cap.
36
36
  - [`references/orchestration.md`](references/orchestration.md) — the canonical **orchestration-recipe**
37
- reference: the four recipes (Solo / Reviewed / Council / Delegated) defined over the bridges' role
38
- vocabulary, the when/why decision guidance, the graceful-degradation lattice, and the quota/health
39
- guard. The kit owns the executable dispatch and surfaces it as `/agent-workflow-kit recipes`.
37
+ reference: the five recipes (Solo / Reviewed / Council / Delegated / Subagent) defined over the
38
+ bridges' role vocabulary and the executor vehicle's `carry` role, the when/why decision guidance,
39
+ the graceful-degradation lattice, and the quota/health guard. The kit owns the executable dispatch and surfaces it as `/agent-workflow-kit recipes`.
40
40
  - [`references/orchestration-slot.md`](references/orchestration-slot.md) — the **bounded** one-line
41
41
  orchestration fragment the composition root injects into a deployed `AGENTS.md`, between the
42
42
  `<!-- workflow:orchestration:start -->` / `<!-- workflow:orchestration:end -->` markers. It names the
43
- four recipes and routes to `/agent-workflow-kit recipes`, never to this engine-internal reference.
43
+ five recipes and routes to `/agent-workflow-kit recipes`, never to this engine-internal reference.
44
44
  - [`references/autonomy-slot.md`](references/autonomy-slot.md) — the **bounded** one-line autonomy
45
45
  fragment the composition root injects into a deployed `AGENTS.md`, between the
46
46
  `<!-- workflow:autonomy:start -->` / `<!-- workflow:autonomy:end -->` markers. It carries the
@@ -50,7 +50,7 @@ slot fill is needed but the engine is absent, the kit's reconcile **fails loudly
50
50
  sandbox + the orchestrator). It routes to the kit's `set-autonomy` / `autonomy-doctor` surfaces,
51
51
  never to any engine-internal reference.
52
52
  - [`references/procedures.md`](references/procedures.md) — the canonical **activity-procedures** canon:
53
- the ordered steps of the named activities (`plan-authoring`, `plan-execution`) with **typed recipe
53
+ the ordered steps of the named activities (`plan-authoring`, `plan-execution`, `routine`) with **typed recipe
54
54
  slots** that bind to the orchestration recipes, composing with `planning.md` without restating it. It
55
55
  stays generic (no project-specific stages baked in). The kit reads it live and renders the steps +
56
56
  the resolved effective recipe per slot via the read-only `/agent-workflow-kit procedures <activity>`.
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-engine",
5
5
  "kind": "methodology-engine",
6
- "version": "4.1.0",
6
+ "version": "4.3.0",
7
7
  "available": true,
8
8
  "provides": ["plan"],
9
9
  "roles": {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-engine",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "Canonical home of the agent-workflow planning methodology — the capped plan shape (goal and boundary, module ledger, verification), plan lifecycle, queue.md series index, and mandatory Cleanup phase, consumed by the kit (composition root). The methodology engine of the agent-workflow family.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -194,3 +194,22 @@ Apply these when authoring a plan, reviewing, folding a finding, or editing code
194
194
  - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
195
195
  - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
196
196
  - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop. **Writer economy:** a stage's repeated WRITER commands batch — evidence declarations ride consecutive plain invocations of ONE allow-listed tool, other stage writers combine via one launcher per stage; never an unbatched writer scatter (each gated write is its own prompt).
197
+
198
+ <!-- prior: 2026-08-27 (AD-123) — before the adoption-state clause in the Spec-first bullet -->
199
+ ### 2.x. Planning, review & process-fidelity invariants
200
+ Apply these when authoring a plan, reviewing, folding a finding, or editing code — the layer read **before any code change**. (Full canon: the project's planning / workflow-methodology + orchestration canon. This section is rendered from that canon and refreshed on upgrade; a custom edit is preserved verbatim, but flagged.)
201
+ - **Fold by code, not prose.** Before folding a code-touching finding into a plan or change, read the cited `file:line` and cite it — a prose fold drifts from the code and seeds the next bug.
202
+ - **Finding scope (plan-execution) — name the invariant BEFORE the edit.** During EXECUTION only — a plan under authoring has no shipped behaviour to call a live defect in, so plan-review carries none of this. Every finding names the invariant its fix would enforce, and where that invariant already lives decides the disposition: already an acceptance criterion of the phase → **fold here**; it would have to be ADDED → ship the **narrow fix** for the found site (red first, then green) and queue ONLY the generalization — a deferral row carries the invariant, the origin `file:line`, the narrow fix, its proof and a residual exposure declared NOT live; no correct narrow fix → **blocking**: the phase does not close, and it is **never queued**. Two bars declared before each round: a finding counts only if it changes a **WRITE/REMOVE decision** or is a false statement in shipped text; a repeat finding in one subarea **routes to SUBTRACTION**, not a fourth patch.
203
+ - **Right altitude.** Pin intent + invariants + acceptance criteria (named tests); leave fine code-mechanics to Execute, where prose cannot diverge from reality.
204
+ - **Spec-first.** A plan names its GOVERNING spec(s) — zero, one or many, one per touched spec-covered slice (the feature spec under `docs/ai/specs/`; page-only coverage governs as an ADOPTION SHIM, with Out of scope + Revision stated inline in the plan). Each cited spec's Out of scope bounds that slice's work and the plan's non-goals restate it per slice — no global union; a cross-spec conflict is resolved by a spec revision BEFORE approval, never by silent precedence. A NEW feature's draft spec exists AT plan review (a `create` row); a change to a governed contract rides the plan as its proposed revision (a `modify` row); approval confirms plan and contract atomically, and the revision lands with the code. Scenario bindings are per scenario: a new scenario is `unbound` until its test lands in the same plan, and a status never regresses for an extension.
205
+ - **No code-mechanics in the plan.** A ledger row carries its path and anchor, and Verification carries the exact commands (the plan-shape canon) — checked syntax: the plan's own Verification runs them against an explicit expected outcome or gate; the only other syntax a plan may carry is a literal fixture/schema fragment a named test copies or validates. Un-run, logic-bearing syntax — control-flow, a regex, a glob, a grammar, an algorithm body, a mini-DSL — never lives in plan prose, however plausible or shell-verified it looks: a fold or draft that wants one is the trigger to write the test instead.
206
+ - **Test-as-spec.** Fold a code-touching finding into a red→green TEST, not a prose paragraph — the gate is the only deterministic checker; a paragraph cannot self-check.
207
+ - **Characterize-first.** Before editing UNCOVERED code, pin its current behavior in a green test, then edit — any unintended change goes red. Never edit what has no checker; first give it one. Keep edits atomic/reversible; prefer SUBTRACTIVE folds.
208
+ - **State table BEFORE the guard — enumerate by PROOF, never by exclusion.** The subtraction rule above fires on a repeat finding, which is a LATE signal: by then the review has paid for each miss. The EARLY signal is structural — a decision whose input has **several independent state dimensions** (is it tracked? do the bytes still match the source? does the neighbouring file exist?). Write the table first, admit the write with **ONE conjunction of proven facts**, and funnel every other cell into a single refusal; the table is then the table-driven test. An exclusion list (`if (bad1) return; if (bad2) return;`) fails **OPEN** on the first state nobody enumerated — and "unreadable" is a state, distinct from "absent". A reviewer cannot save you here: it judges the patch in front of it and can only name the NEXT missing state, one round at a time.
209
+ - **Fold minimally — prose has no checker.** An ephemeral, gitignored plan is prose with no executable checker; fold **minimally, in ONE place** and run a **self-consistency** read across the plan before every re-review — a fold that drifts several prose spots is what turns a 2-round review into churn.
210
+ - **Heavy review at the diff.** Plan-review settles architecture only (≤2 rounds, stop at the pre-existing→fold-induced crossover); the exhaustive per-row review runs against real compiling code + the full suite, where a regression fails a gate immediately. **Backend divergence** (one backend grounded-ships while another keeps revising mechanics) IS that crossover — resolve at altitude, don't exhaust the strictest backend; route an all-mechanics/CI or prose-only artifact to a **thin plan + diff-review**.
211
+ - **Convergence bar.** A review loop is CLEAN only when one round returns **0 blockers + 0 majors** from EVERY backend the recipe names (nits + a ship verdict is the stop). Folding ≠ convergence — re-review after folding.
212
+ - **Per-round emission.** Every review round emits **{round N · finding-origin tally · per-backend verdict}** so the crossover is a computed, visible signal, not a remembered rule.
213
+ - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
214
+ - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
215
+ - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop. **Writer economy:** a stage's repeated WRITER commands batch — evidence declarations ride consecutive plain invocations of ONE allow-listed tool, other stage writers combine via one launcher per stage; never an unbatched writer scatter (each gated write is its own prompt).
@@ -3,7 +3,7 @@ Apply these when authoring a plan, reviewing, folding a finding, or editing code
3
3
  - **Fold by code, not prose.** Before folding a code-touching finding into a plan or change, read the cited `file:line` and cite it — a prose fold drifts from the code and seeds the next bug.
4
4
  - **Finding scope (plan-execution) — name the invariant BEFORE the edit.** During EXECUTION only — a plan under authoring has no shipped behaviour to call a live defect in, so plan-review carries none of this. Every finding names the invariant its fix would enforce, and where that invariant already lives decides the disposition: already an acceptance criterion of the phase → **fold here**; it would have to be ADDED → ship the **narrow fix** for the found site (red first, then green) and queue ONLY the generalization — a deferral row carries the invariant, the origin `file:line`, the narrow fix, its proof and a residual exposure declared NOT live; no correct narrow fix → **blocking**: the phase does not close, and it is **never queued**. Two bars declared before each round: a finding counts only if it changes a **WRITE/REMOVE decision** or is a false statement in shipped text; a repeat finding in one subarea **routes to SUBTRACTION**, not a fourth patch.
5
5
  - **Right altitude.** Pin intent + invariants + acceptance criteria (named tests); leave fine code-mechanics to Execute, where prose cannot diverge from reality.
6
- - **Spec-first.** A plan names its GOVERNING spec(s) — zero, one or many, one per touched spec-covered slice (the feature spec under `docs/ai/specs/`; page-only coverage governs as an ADOPTION SHIM, with Out of scope + Revision stated inline in the plan). Each cited spec's Out of scope bounds that slice's work and the plan's non-goals restate it per slice — no global union; a cross-spec conflict is resolved by a spec revision BEFORE approval, never by silent precedence. A NEW feature's draft spec exists AT plan review (a `create` row); a change to a governed contract rides the plan as its proposed revision (a `modify` row); approval confirms plan and contract atomically, and the revision lands with the code. Scenario bindings are per scenario: a new scenario is `unbound` until its test lands in the same plan, and a status never regresses for an extension.
6
+ - **Spec-first.** A plan names its GOVERNING spec(s) — zero, one or many, one per touched spec-covered slice (the feature spec under `docs/ai/specs/`; page-only coverage governs as an ADOPTION SHIM, with Out of scope + Revision stated inline in the plan). A ZERO names the adoption state it relies on — `not adopted` (no store) or `adopting` (a store with no live contract), either with a recorded decline, or `nothing spec-covered touched` (a store with live contracts) — a bare zero is never a licence; the store's own state is what `status` and the upgrade advisor report. Each cited spec's Out of scope bounds that slice's work and the plan's non-goals restate it per slice — no global union; a cross-spec conflict is resolved by a spec revision BEFORE approval, never by silent precedence. A NEW feature's draft spec exists AT plan review (a `create` row); a change to a governed contract rides the plan as its proposed revision (a `modify` row); approval confirms plan and contract atomically, and the revision lands with the code. Scenario bindings are per scenario: a new scenario is `unbound` until its test lands in the same plan, and a status never regresses for an extension.
7
7
  - **No code-mechanics in the plan.** A ledger row carries its path and anchor, and Verification carries the exact commands (the plan-shape canon) — checked syntax: the plan's own Verification runs them against an explicit expected outcome or gate; the only other syntax a plan may carry is a literal fixture/schema fragment a named test copies or validates. Un-run, logic-bearing syntax — control-flow, a regex, a glob, a grammar, an algorithm body, a mini-DSL — never lives in plan prose, however plausible or shell-verified it looks: a fold or draft that wants one is the trigger to write the test instead.
8
8
  - **Test-as-spec.** Fold a code-touching finding into a red→green TEST, not a prose paragraph — the gate is the only deterministic checker; a paragraph cannot self-check.
9
9
  - **Characterize-first.** Before editing UNCOVERED code, pin its current behavior in a green test, then edit — any unintended change goes red. Never edit what has no checker; first give it one. Keep edits atomic/reversible; prefer SUBTRACTIVE folds.
@@ -1 +1 @@
1
- > **Workflow methodology** — plan → execute → review. Plans are ephemeral `docs/plans/*.md` (gitignored, **never committed**); every Plan ends with a mandatory **Phase: Cleanup**; series order lives in `docs/plans/queue.md`. The plan shape, its caps and lifecycle live in the project's **planning skill** (it overrides the generic `writing-plans`); summary in `docs/ai/agent_rules.md` §5. Named activities (plan-authoring, plan-execution) have procedures — see `/agent-workflow-kit procedures <activity>` for the steps + resolved recipe. **Communication:** user-facing messages deliver the artifact inline (paste the prompt / diff / command — never "see §X" as a substitute), lead with the result, show exactly what was asked, and never read as mockery (a large artifact: a real summary inline + a link).
1
+ > **Workflow methodology** — plan → execute → review. Plans are ephemeral `docs/plans/*.md` (gitignored, **never committed**); every Plan ends with a mandatory **Phase: Cleanup**; series order lives in `docs/plans/queue.md`. The plan shape, its caps and lifecycle live in the project's **planning skill** (it overrides the generic `writing-plans`); summary in `docs/ai/agent_rules.md` §5. Named activities (plan-authoring, plan-execution, routine) have procedures — see `/agent-workflow-kit procedures <activity>` for the steps + resolved recipe. **Communication:** user-facing messages deliver the artifact inline (paste the prompt / diff / command — never "see §X" as a substitute), lead with the result, show exactly what was asked, and never read as mockery (a large artifact: a real summary inline + a link).
@@ -1 +1 @@
1
- > **Orchestration recipes** — compose plan → execute → review with a named recipe: **Solo** (no backend), **Reviewed** (one backend reviews), **Council** (both review, you synthesize), **Delegated** (a backend executes a bounded sub-task); the orchestrator always commits, a backend is never autonomous. Pick + plan one for this environment with `/agent-workflow-kit recipes` (read-only); the deployed how/why lives in your `docs/ai/` workflow docs. At the start of a planning/execution session, read your standing recipe preference in `docs/ai/orchestration.json` — set it in plain language with `/agent-workflow-kit set-recipe` (previews first; hand-edit stays supported).
1
+ > **Orchestration recipes** — compose plan → execute → review with a named recipe: **Solo** (no backend), **Reviewed** (one backend reviews), **Council** (both review, you synthesize), **Delegated** (a backend executes a bounded sub-task), **Subagent** (a full-tool frontier subagent carries a bounded slice); the orchestrator always commits, a carrier is never autonomous. Pick + plan one for this environment with `/agent-workflow-kit recipes` (read-only); the deployed how/why lives in your `docs/ai/` workflow docs. At the start of a planning/execution session, read your standing recipe preference in `docs/ai/orchestration.json` — set it in plain language with `/agent-workflow-kit set-recipe` (previews first; hand-edit stays supported).
@@ -1,9 +1,10 @@
1
1
  # Orchestration Recipes
2
2
 
3
- Canonical, on-demand reference for **how an orchestrating agent composes the optional
4
- execution-backends** (the family's subscription-CLI bridges) into the `plan → execute → review`
3
+ Canonical, on-demand reference for **how an orchestrating agent composes the carriers of a step** —
4
+ itself, the optional execution-backends (the family's subscription-CLI bridges) and a full-tool
5
+ frontier subagent — into the `plan → execute → review`
5
6
  flow. This is the *narrative* source of truth — the **vocabulary** (what each recipe is), the
6
- **when/why** (which to reach for), the **graceful-degradation lattice** (what happens when a backend
7
+ **when/why** (which to reach for), the **graceful-degradation lattice** (what happens when a carrier
7
8
  is unavailable), and the **quota/health guard**. The kit (`agent-workflow-kit`) owns the *executable*
8
9
  dispatch (`tools/recipes.mjs` — `planRecipe` / `recommendRecipe`) and surfaces it read-only as
9
10
  `/agent-workflow-kit recipes`; the two representations are kept in lockstep by a recipe-name parity
@@ -13,9 +14,12 @@ guard. For the plan lifecycle this composes with, see [`planning.md`](planning.m
13
14
 
14
15
  ## 1. The role vocabulary recipes are built over
15
16
 
16
- A recipe is an **orchestration pattern**, not a runnable script. The **orchestrator** (the main
17
- agent) always owns the decisions, the edits it accepts, verification, and the **single commit** a
18
- backend is **advisory or delegated, never autonomous, and never commits**.
17
+ A recipe is an **orchestration pattern**, not a runnable script. It names **who carries a step**
18
+ the **orchestrator** itself (Solo), a **bridge backend** (Reviewed / Council / Delegated), or a
19
+ **full-tool frontier subagent** dispatched from the placed executor vehicle (Subagent). The
20
+ orchestrator (the main agent) always owns the decisions, the edits it accepts, verification, and the
21
+ **single commit** — every other carrier is **advisory or delegated, never autonomous, and never
22
+ commits**.
19
23
 
20
24
  Each backend declares what it can do in its `capability.json` `provides` / `roles`:
21
25
 
@@ -27,14 +31,26 @@ Each backend declares what it can do in its `capability.json` `provides` / `role
27
31
 
28
32
  Both are **subscription** backends with a **finite quota** — spend deliberately.
29
33
 
30
- ## 2. The four recipes
34
+ The third carrier is neither: the **executor vehicle** — a full-tool frontier subagent the
35
+ orchestrator dispatches from the placed `.claude/agents/executor.md`. It declares no
36
+ `capability.json` and spends no bridge quota (it runs on the host's own model and consumes that
37
+ model's quota and cost); it carries the `carry` role only — never
38
+ `review`, never `probe` — and its availability is the vehicle FILE, not a detector (§4, §5).
31
39
 
32
- | Recipe (id) | Pattern | Roles needed | Backends that satisfy it |
40
+ ## 2. The five recipes
41
+
42
+ | Recipe (id) | Pattern | Roles needed | Carriers that satisfy it |
33
43
  |-------------|---------|--------------|--------------------------|
34
44
  | **Solo** (`solo`) | The orchestrator plans, executes, and self-reviews. No backend. | none | — (always available; the floor) |
35
45
  | **Reviewed** (`reviewed`) | The orchestrator executes; **one** backend reviews the result (advisory). | ≥1 backend providing `review` | `codex` and/or `agy` |
36
46
  | **Council** (`council`) | **Both** backends review independently; the orchestrator synthesizes the two opinions. | ≥2 backends providing `review` | `codex` **and** `agy` |
37
47
  | **Delegated** (`delegated`) | The orchestrator hands a **bounded** execution sub-task to a backend, then reviews the returned diff and commits. | ≥1 backend providing `execute` | `codex` only |
48
+ | **Subagent** (`subagent`) | The orchestrator hands a **bounded, file-disjoint** slice — of execution, of plan/contract authoring, or of routine work — to a **full-tool frontier subagent**, then verifies the returned slice by running its suites. A routine slice is classified first: a read-only one rides a placed read-only vehicle (or is carried Solo with a stated reason when that vehicle is absent); a write-capable one rides the executor. | the `carry` role | the placed executor vehicle |
49
+
50
+ The orchestrator keeps the folds, the gates, the release documents, the asks and the **one commit**
51
+ whatever the recipe resolves to. A subagent is **never a review backend**, **never a bridge
52
+ substitute**, and is **never told to commit**; it **degrades to Solo** when the executor vehicle is
53
+ missing or unusable.
38
54
 
39
55
  ## 3. When / why to reach for each (the decision vocabulary)
40
56
 
@@ -51,6 +67,12 @@ Both are **subscription** backends with a **finite quota** — spend deliberatel
51
67
  - **Delegated** — when a bounded, well-specified sub-task can be handed off (parallelism, or to keep
52
68
  the orchestrator's own context focused). Only `codex` provides `execute`. The orchestrator still
53
69
  reviews the returned diff and owns the commit — delegation never bypasses the review or the gate.
70
+ - **Subagent** — when the work is **bounded and file-disjoint** and the orchestrator's own context is
71
+ the scarce resource: execution slices, a plan or a contract drafted from a brief the orchestrator
72
+ writes, or routine chores (gate triage, sweeps, doc regeneration, fixture builds). It spends no
73
+ bridge quota; it runs on the host's own model and consumes that model's quota and cost. The orchestrator still writes the brief, verifies every returned slice by running
74
+ its suites itself, and owns the commit — a subagent never stands in for the bridge a `review`
75
+ recipe names.
54
76
 
55
77
  ## 4. Graceful degradation (never silent)
56
78
 
@@ -61,6 +83,12 @@ Availability is **pure file-presence**: a backend is dispatchable **iff its dete
61
83
  the wrapper is not on `PATH`). This is a claim about **set-up state only** — never about whether a
62
84
  backend's *service* is actually responsive.
63
85
 
86
+ The subagent carrier makes the same kind of claim from a different file: its availability is the
87
+ **executor vehicle** at `.claude/agents/executor.md` — `placed` or `customized` is dispatchable,
88
+ `unusable` or `missing` is not, and the state is the human reason (the writer's apply command
89
+ places a missing vehicle; a customized file is kept; an unusable path must be fixed or removed
90
+ first, then placed). Never a claim about the host that would run it (§5).
91
+
64
92
  When a recipe's roles can't be satisfied, it **degrades to a weaker recipe with a stated reason** —
65
93
  always reported, never silently dropped:
66
94
 
@@ -68,6 +96,7 @@ always reported, never silently dropped:
68
96
  neither is `ready` → Solo.
69
97
  - **Delegated → Solo.** No backend provides `execute` and is `ready` → Solo, with the reason.
70
98
  - **Reviewed → Solo.** No backend provides `review` and is `ready` → Solo, with the reason.
99
+ - **Subagent → Solo.** The executor vehicle is `missing` or `unusable` → Solo, with the reason.
71
100
 
72
101
  **Recipe fidelity — the converse: every ready backend, every round.** Degradation is the *only*
73
102
  licence to run fewer backends than the recipe names. When the resolved recipe is `council` and BOTH
@@ -152,6 +181,11 @@ task that genuinely needs to run or write keeps a full-tool subagent. **Honest l
152
181
  no deterministic gate classifies a dispatch — enforcement is this canon at the point of use,
153
182
  the placed vehicles, and the retro loop.
154
183
 
184
+ **The Subagent carrier is a Claude Code lane**, exactly like the placed vehicles above: its
185
+ readiness is the vehicle FILE, never the host. On a host that cannot dispatch the vehicle, the
186
+ rendered dispatch form is an **instruction the orchestrator follows by hand** and reports as such —
187
+ never reported as a subagent dispatch.
188
+
155
189
  **Sandbox lanes.** Under an OS sandbox the lanes split once more by **surface class**: the L0
156
190
  surfaces are **sandbox-safe** (gate/state/coverage checks, git reads, plain no-network tests);
157
191
  the bridge wrappers are **genuinely unsandboxed** (they need network); npm-cache-touching commands
@@ -184,10 +218,13 @@ stays read-only.
184
218
 
185
219
  ## 6. The orchestrator always commits
186
220
 
187
- No recipe makes a backend write to the repo or create a commit. The kit's `recipes` surface is
221
+ No recipe lets a carrier commit or perform a git write: a review backend reads and returns findings;
222
+ a delegated backend edits inside its own sandbox and returns a diff the orchestrator reviews; a
223
+ subagent edits only the files its brief names — and the orchestrator alone stages and commits. The kit's `recipes` surface is
188
224
  **read-only** — it lists the recipes, plans one for the current environment, and recommends a
189
225
  default; it **never executes** a recipe and **never runs a subscription CLI**. The orchestrator
190
- executes the chosen recipe through the bridge skills, accepts or rejects every edit, runs the
226
+ executes the chosen recipe through the bridge skills or the executor vehicle, accepts or rejects
227
+ every returned edit, runs the
191
228
  verification gate, and makes the **one** commit — exactly as the plan lifecycle (`planning.md`)
192
229
  requires.
193
230
 
@@ -25,7 +25,9 @@ independently verifiable boundaries, never by document size — or it is a SWEEP
25
25
 
26
26
  - **Goal and boundary** (10 lines) — the observable outcome, what behaviour is preserved, explicit
27
27
  non-goals, and the GOVERNING spec(s) ([`specs.md`](specs.md)): zero, one or many — one per touched
28
- spec-covered slice — each cited spec's Out of scope restated as a non-goal for that slice.
28
+ spec-covered slice — a ZERO names the adoption state it relies on (not adopted · adopting — either
29
+ with a recorded decline — · nothing spec-covered touched); a bare zero is never a licence. Each
30
+ cited spec's Out of scope is restated as a non-goal for that slice.
29
31
  - **Module ledger** (60 lines) — the single list of paths, and the plan's execution order.
30
32
  - **Verification** (20 lines) — the acceptance check, plus one command that validates the whole ledger.
31
33
  - **Phase: Cleanup** and **Next steps** (human-actionable only) share the 10 reserved lines.
@@ -2,15 +2,16 @@
2
2
 
3
3
  The ordered steps of each named activity, with **typed recipe slots** bound to the
4
4
  [orchestration recipes](orchestration.md). It composes with — never restates —
5
- [`planning.md`](planning.md), naming that canon's sections by *heading*. The kit reads this file
6
- LIVE and parses ONLY each section's `Slots:` line, never the steps.
5
+ [`planning.md`](planning.md), naming its sections by *heading*. The kit reads this file
6
+ live and parses only each section's `Slots:` line.
7
7
 
8
8
  A **recipe slot**: `review` accepts `solo | reviewed | council`; `execute` accepts
9
- `solo | delegated`. The per-project default lives in `docs/ai/orchestration.json`, resolved against
10
- backend readiness by the kit.
9
+ `solo | delegated | subagent`; a carrier slot (`author`, `carrier`) accepts `solo | subagent`;
10
+ `parallel` is a switch (`on | off`), not a recipe. The per-project default lives in
11
+ `docs/ai/orchestration.json`.
11
12
 
12
- **When an activity has a commit boundary, the orchestrator owns that commit; a backend is advisory
13
- or delegated, never autonomous, and never commits** (`orchestration.md` §6). `plan-authoring` ends
13
+ **When an activity has a commit boundary, the orchestrator owns that commit; every other carrier is
14
+ advisory or delegated, never autonomous, and never commits** (`orchestration.md` §6). `plan-authoring` ends
14
15
  at **approval** with no commit (plans are ephemeral, never committed); `plan-execution` commits per
15
16
  ledger row.
16
17
 
@@ -29,14 +30,17 @@ inline plus the link.
29
30
 
30
31
  ## plan-authoring
31
32
 
32
- Slots: review
33
+ Slots: author, review
33
34
 
34
35
  1. **Research** — the exact files, contracts and constraints touched.
35
36
  2. **Draft** — write to the shape [`planning.md`](planning.md) fixes; its *Module ledger* decides
36
37
  the layout and every budget before any file exists — a size gate is only the backstop. Name the
37
38
  governing spec(s) in *Goal and boundary* ([`specs.md`](specs.md)); a new feature's draft spec is
38
39
  a `create` row and a revision of a governed contract a `modify` row, both written here so they
39
- exist AT review.
40
+ exist AT review. The resolved `author` carrier drafts — Solo: the orchestrator writes it;
41
+ Subagent: the orchestrator writes a BRIEF (goal, governing specs, ledger
42
+ constraints, files) and the subagent drafts the plan and any `create` / `modify`
43
+ spec row from it, and the orchestrator reviews the draft as its own before step 3.
40
44
  3. **Self-review** — apply *What gets cut*; fold by code (read and cite the `file:line`); update
41
45
  `queue.md` for a series, to the shape *The queue* fixes.
42
46
  4. **review {recipe}** — Solo (self-review only) / Reviewed (one backend) / Council (both; you
@@ -58,7 +62,7 @@ Slots: review
58
62
  the plan and its cold-start prompt exist.
59
63
 
60
64
  **Definition of Done:** a plan in `docs/plans/` ending with **Phase: Cleanup** **and** a cold-start
61
- execution prompt to begin the next session — both produced without the user asking.
65
+ execution prompt to begin the next session — both without the user asking.
62
66
 
63
67
  ## plan-execution
64
68
 
@@ -67,9 +71,12 @@ Slots: execute, review
67
71
  Each ledger row is one logical commit.
68
72
 
69
73
  1. **Resolve the recipe per row** — `execute` and `review` from `docs/ai/orchestration.json` +
70
- readiness (`--override <slot>=<recipe>` per run).
74
+ readiness (`--override <slot>=<value>` per run).
71
75
  2. **If `execute` resolved to Delegated, dispatch execution FIRST** — the backend returns a diff
72
- (codex-exec) *before* you integrate; otherwise implement directly.
76
+ (codex-exec) *before* you integrate. **If `execute` resolved to Subagent**, split the ledger into
77
+ file-disjoint slices, exact wording where wording is a red line, dispatch each slice to
78
+ the executor vehicle in the background, and verify
79
+ every returned slice by running its suites yourself before step 3. Otherwise implement directly.
73
80
  3. **Implement / integrate** — your own edits or the reviewed delegated diff; a spec row lands its
74
81
  approved draft or revision WITH the code ([`specs.md`](specs.md)).
75
82
  4. **Self-review** — the change against its [`planning.md`](planning.md) ledger row and the plan's
@@ -93,8 +100,24 @@ Each ledger row is one logical commit.
93
100
  finding counts only if it changes a WRITE/REMOVE decision or is a false statement in shipped
94
101
  text; a repeat finding in one subarea routes to SUBTRACTION, not a fourth patch.
95
102
  6. **Gates** — the project's verification gate to green.
96
- 7. **Commit boundary** — the orchestrator makes the single commit; a backend never commits; the
103
+ 7. **Commit boundary** — the orchestrator makes the single commit; every other carrier never commits; the
97
104
  commit-approval policy lives in the project's own rules.
98
105
  8. **After the last row** — the project-declared release or extra stages (the `workflow:methodology`
99
106
  slot; this canon bakes in none) and then `## Phase: Cleanup` (*Cleanup, and the plan's own
100
107
  life*) run as rows of their own, each through steps 1–7.
108
+
109
+ ## routine
110
+
111
+ Slots: carrier, parallel
112
+
113
+ 1. **Name the chore and its slices** — gate triage, sweeps, regeneration, fixture builds; never
114
+ the changelog; each slice bounded and file-disjoint.
115
+ 2. **Resolve the recipe** — `carrier` and `parallel` from `docs/ai/orchestration.json` + readiness
116
+ (`--override <slot>=<value>` per run).
117
+ 3. **Carry it** — Solo: the orchestrator does it. Subagent classifies each slice: read-only (a
118
+ sweep, gate triage) rides its placed read-only vehicle, or is carried Solo with a stated reason
119
+ when that vehicle is absent; write-capable (a regeneration, a fixture build) rides the executor.
120
+ Dispatch in the background, concurrently when `parallel` is on.
121
+ 4. **Verify** — every returned slice, by running its suites yourself.
122
+ 5. **The commit boundary is unchanged** — when an accepted slice changed the tree, the orchestrator
123
+ alone commits; a read-only chore has no commit boundary; a carrier never commits.
@@ -117,9 +117,11 @@ refuse case per rule and an accept case per kind; a refuse fixture yields exactl
117
117
 
118
118
  - **One entity.** A spec is the durable contract; the ephemeral plan is the delta vehicle; the spec
119
119
  revision lands with the code. There is no change-spec entity.
120
- - **Governing specs are plural.** A plan cites ZERO (nothing spec-covered touched legal during
121
- adoption), ONE or MANY governing specs one per touched spec-covered slice; a shared-module change
122
- cites the specs of every slice whose contract it can alter.
120
+ - **Governing specs are plural.** A plan cites ZERO naming the adoption state it relies on:
121
+ `not adopted` (no store) or `adopting` (no live contract yet), either with a recorded decline, or
122
+ `nothing spec-covered touched`; a bare zero is never a licence — ONE or MANY governing specs —
123
+ one per touched spec-covered slice; a shared-module change cites the specs of every slice whose
124
+ contract it can alter.
123
125
  - **Out of scope composes PER GOVERNING SLICE — there is no global union.** Each cited spec's
124
126
  exclusions bound only the work inside that slice, and the plan's non-goals restate them per slice.
125
127
  A cross-spec conflict is resolved by a spec REVISION BEFORE plan approval — never by silent