@sabaiway/agent-workflow-kit 23.12.0 → 24.0.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +4 -4
  3. package/SKILL.md +1 -1
  4. package/bridges/codex-cli-bridge/SKILL.md +7 -2
  5. package/bridges/codex-cli-bridge/bin/codex-exec-jev.test.mjs +11 -6
  6. package/bridges/codex-cli-bridge/bin/codex-exec.sh +72 -33
  7. package/bridges/codex-cli-bridge/bin/codex-exec.test.mjs +111 -3
  8. package/bridges/codex-cli-bridge/bin/codex-fixtures-harness.test.mjs +16 -1
  9. package/bridges/codex-cli-bridge/bin/codex-model-posture.test.mjs +5 -3
  10. package/bridges/codex-cli-bridge/bin/codex-review.sh +1 -1
  11. package/bridges/codex-cli-bridge/capability.json +2 -2
  12. package/capability.json +1 -1
  13. package/package.json +1 -1
  14. package/references/advisor-writers.md +2 -0
  15. package/references/agents/author.md +21 -0
  16. package/references/agents/executor.md +12 -6
  17. package/references/contracts.md +4 -4
  18. package/references/hooks/gate-approve.mjs +7 -8
  19. package/references/hooks/stage-write-guard.mjs +314 -0
  20. package/references/modes/agents.md +6 -4
  21. package/references/modes/bootstrap.md +1 -1
  22. package/references/modes/flow-writer.md +10 -2
  23. package/references/modes/hook.md +4 -1
  24. package/references/modes/now.md +1 -1
  25. package/references/modes/procedures.md +49 -10
  26. package/references/modes/recipes.md +7 -7
  27. package/references/modes/recommendations.md +4 -3
  28. package/references/modes/robustness-brief.md +9 -8
  29. package/references/modes/set-recipe.md +1 -1
  30. package/references/modes/state-block-guard.md +4 -3
  31. package/references/modes/status.md +1 -1
  32. package/references/modes/upgrade.md +1 -1
  33. package/references/modes/worktrees.md +28 -5
  34. package/references/rules/story-sessions.md +2 -2
  35. package/references/scripts/archives/archive-caps.mjs +1 -1
  36. package/references/scripts/archives/archive-changelog.mjs +8 -8
  37. package/references/scripts/archives/archive-decisions.mjs +7 -7
  38. package/references/scripts/archives/archive-issues.mjs +5 -5
  39. package/references/scripts/archives/rotation-conservation.mjs +2 -1
  40. package/references/scripts/docs-size/check-docs-size.mjs +15 -15
  41. package/references/scripts/family.json +2 -0
  42. package/references/scripts/gates/kit-command-gates.mjs +7 -8
  43. package/references/scripts/gates/migrate-gates.mjs +10 -10
  44. package/references/scripts/git-hooks/install-git-hooks.mjs +13 -13
  45. package/references/scripts/run.mjs +1 -2
  46. package/references/scripts/shared/index.mjs +2 -0
  47. package/references/scripts/shared/locations.mjs +103 -0
  48. package/references/scripts/spec-schema/spec-schema.mjs +2 -1
  49. package/references/templates/orchestration.json +1 -1
  50. package/tools/ack-store.mjs +2 -1
  51. package/tools/apply-danger-check.mjs +20 -6
  52. package/tools/atomic-write.mjs +3 -2
  53. package/tools/attribution.mjs +2 -1
  54. package/tools/autonomy-config.mjs +2 -1
  55. package/tools/bridge-wiring.mjs +13 -11
  56. package/tools/carriers.mjs +54 -14
  57. package/tools/cheap-agents-read.mjs +28 -7
  58. package/tools/cheap-agents.mjs +15 -10
  59. package/tools/checker-gates-read.mjs +6 -5
  60. package/tools/commands.mjs +2 -2
  61. package/tools/coverage-declared/config.mjs +2 -1
  62. package/tools/coverage-producer.mjs +10 -9
  63. package/tools/delegation.mjs +7 -6
  64. package/tools/detect-backends.mjs +1 -1
  65. package/tools/dispatch-baseline.mjs +2 -1
  66. package/tools/distribution-files/scripts.mjs +4 -4
  67. package/tools/ensure-configs.mjs +2 -2
  68. package/tools/ensure-ops.mjs +24 -24
  69. package/tools/ensure-specs.mjs +7 -7
  70. package/tools/epic-shape-cli.mjs +2 -2
  71. package/tools/epic-shape-ledger.mjs +5 -5
  72. package/tools/epic-shape.mjs +5 -3
  73. package/tools/epic-store.mjs +2 -1
  74. package/tools/family-members.mjs +7 -5
  75. package/tools/family-registry.mjs +36 -30
  76. package/tools/feedback-record-cli.mjs +4 -5
  77. package/tools/flow-writer.mjs +26 -15
  78. package/tools/gate-hook.mjs +33 -28
  79. package/tools/gates-declaration.mjs +2 -1
  80. package/tools/gates-init.mjs +6 -5
  81. package/tools/git-hooks.mjs +64 -41
  82. package/tools/grounding.mjs +3 -2
  83. package/tools/hide-footprint.mjs +2 -1
  84. package/tools/hook-writer/index.mjs +147 -0
  85. package/tools/init-preflight.mjs +5 -4
  86. package/tools/init-project.mjs +12 -11
  87. package/tools/inject-methodology.mjs +3 -2
  88. package/tools/jev-guide.mjs +2 -2
  89. package/tools/known-footprint.mjs +27 -25
  90. package/tools/mcp-registration.mjs +6 -5
  91. package/tools/migration-blocks.mjs +2 -1
  92. package/tools/migration-notes.mjs +2 -2
  93. package/tools/node-evidence.mjs +4 -4
  94. package/tools/now-facts.mjs +5 -5
  95. package/tools/now-status.mjs +1 -5
  96. package/tools/orchestration-config.mjs +2 -1
  97. package/tools/orchestration-readme.mjs +7 -2
  98. package/tools/plan-approval/cli.mjs +45 -0
  99. package/tools/plan-approval/entries.mjs +109 -0
  100. package/tools/plan-approval/index.mjs +2 -0
  101. package/tools/plan-approval/record.mjs +198 -0
  102. package/tools/plan-files.mjs +6 -4
  103. package/tools/plan-shape-cli.mjs +10 -64
  104. package/tools/plan-shape-facts.mjs +240 -83
  105. package/tools/plan-shape.mjs +173 -160
  106. package/tools/plan-structure/cli.mjs +79 -0
  107. package/tools/plan-structure/index.mjs +67 -0
  108. package/tools/procedures.mjs +21 -17
  109. package/tools/profile-gaps.mjs +4 -6
  110. package/tools/project-rules/rules-priors.mjs +2 -0
  111. package/tools/project-rules/themes.mjs +6 -4
  112. package/tools/recipes.mjs +44 -29
  113. package/tools/recommendations.mjs +84 -33
  114. package/tools/reference-profile.mjs +2 -2
  115. package/tools/renderers.mjs +14 -8
  116. package/tools/repo-lex.mjs +84 -0
  117. package/tools/robustness-brief.mjs +14 -11
  118. package/tools/satellite-locator.mjs +3 -2
  119. package/tools/script-priors.mjs +3 -2
  120. package/tools/session-close-check.mjs +71 -15
  121. package/tools/set-flow.mjs +2 -2
  122. package/tools/set-recipe.mjs +17 -9
  123. package/tools/source-size/help.mjs +4 -4
  124. package/tools/source-size/layout.mjs +2 -1
  125. package/tools/source-size/piles.mjs +2 -2
  126. package/tools/source-size-config.mjs +3 -3
  127. package/tools/source-size-refusal.mjs +4 -3
  128. package/tools/source-size-report.mjs +41 -13
  129. package/tools/spec-check-cli.mjs +159 -21
  130. package/tools/spec-check-ops.mjs +74 -5
  131. package/tools/spec-check.mjs +54 -45
  132. package/tools/spec-coverage-cli.mjs +3 -2
  133. package/tools/stage-render/cli.mjs +231 -0
  134. package/tools/stage-render/index.mjs +340 -0
  135. package/tools/stage-render/stages.json +115 -0
  136. package/tools/stage-write-guard/cli.mjs +64 -0
  137. package/tools/stage-write-guard/index.mjs +56 -0
  138. package/tools/state-block-hook.mjs +38 -163
  139. package/tools/task-brief.mjs +8 -13
  140. package/tools/task-thread.mjs +3 -1
  141. package/tools/tier-guide-facts.mjs +23 -9
  142. package/tools/tier-preview.mjs +15 -19
  143. package/tools/transition/index.mjs +10 -9
  144. package/tools/uninstall.mjs +26 -12
  145. package/tools/vehicle-settings.mjs +2 -1
  146. package/tools/velocity-profile.mjs +5 -6
  147. package/tools/view-model.mjs +7 -4
  148. package/tools/worktree-prompt.mjs +7 -3
  149. package/tools/worktrees.mjs +235 -159
  150. package/tools/write-lanes.mjs +20 -14
@@ -26,7 +26,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
26
26
  5. **Entry-point doc.** If `AGENTS.md` / `CLAUDE.md` already exist (step-1 recon), do **not** overwrite — show the user and ask whether to merge or replace. Otherwise create `AGENTS.md` (the cross-agent standard — Codex / Cursor / Devin Desktop / Copilot read it natively) from `${CLAUDE_SKILL_DIR}/references/templates/AGENTS.md`, and symlink `CLAUDE.md -> AGENTS.md` (`ln -s AGENTS.md CLAUDE.md`) for Claude Code — single source, no duplication. For nested context, add a subdir `AGENTS.md` (+ a `CLAUDE.md` symlink beside it for Claude Code).
27
27
  6. **Deploy `docs/ai/`.** Create every `docs/ai/` file + `pages/` + the seed `adr/` store + the seed `specs/` store from `${CLAUDE_SKILL_DIR}/references/templates/` (the template loop deploys every template except `AGENTS.md`, `adr-record.md` and `SPEC_TEMPLATE.md` — the latter two are skill-home authoring references, never deployed). This deploys the HOT ADR window **`docs/ai/decisions.md`** and the seed navigator **`docs/ai/adr/log.md`** (its `adr/` subdir copies in wholesale), the spec store root **`docs/ai/specs/index.md`** (its `specs/` subdir copies in wholesale), the `.md` docs, **and** the four seeded, user-editable strict-JSON configs: **`docs/ai/orchestration.json`** (the per-project recipe defaults the `procedures` advisor reads), **`docs/ai/gates.json`** (the project's gate declaration — seeded as the no-consent EMPTY list; FILLING it is the consented `gates-init` preview, `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), **`docs/ai/autonomy.json`** (the per-project autonomy policy — seeded SPARSE with the onboarding note only, so it is exactly the computed defaults until the user declares levels via `/agent-workflow-kit set-autonomy` or by hand), and **`docs/ai/vehicles.json`** (the executor vehicle's model, effort and fallback as a setting the kit's readers resolve into one posture; the placed executor's body follows it, and the bundled review lens's model and effort, `opus` / `high` by default, follow its optional `review-lens` section — seeded once, hand-edited, never clobbered). Keep each `.md` file's frontmatter (`type / lastUpdated / scope / staleAfter / owner / maxLines`); the `.json` seeds carry no frontmatter (the docs cap-validator globs `*.md` only, so they are inherently skipped).
28
28
  7. **Fill templates** per the table below. **Then materialize the navigator, as the last `docs/ai` step:** the entry point declares `docs/ai/index.md` always-loaded and it is a GENERATED artifact with no template, so run `node ${CLAUDE_SKILL_DIR}/references/scripts/docs-size/check-docs-size.mjs --ensure-index --root=<project>` and relay its one outcome line (`ensure-index: regenerated` / `already-current`, or a `write-refused` / `probe-failed` line naming the offending path — either is a STOP: resolve it before reporting the deploy, since the navigator the entry point declares does not exist yet). The generator runs from **this skill's own directory**, so a project with **no Node runtime** is covered too: the agent host runs it, and step 8's copy is not a precondition.
29
- 8. **Offer enforcement on every project, preview-first.** Explain in one line that the dependency-free Node scripts are available because the agent host already runs their step-7 navigator; the only skip condition is that the agent host cannot run them. Run the `enforcement` item's check line, `node ${CLAUDE_SKILL_DIR}/tools/apply-danger-check.mjs --variant enforcement --cwd <project>`: its result is the preview — each script the kit places into the kit folder `scripts/agent-workflow/` with its bytes and the installer it runs with its bytes. Ask once on that result; on a yes copy them by its apply line with that digest, run by the consent route of `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`: the copy is create-only and the project's installer installs the pre-commit hook. On a no, skip the hook and say so; a check that refuses (exit 1 or 3) or an apply that exits 6 leaves no script the kit placed — say so with its output and fill the command slots as on a no. On a no the docs command slots name no project-local command — fill `env_commands.md` and the `Docs caps + index freshness` row of `AGENTS.md` with the same note: the caps + index gate run from the agent's own skill copy (the step-7 `--root=<project>` form) and the archive rotations need the scripts deployed. Never write the skill's absolute path into a deployed doc. They self-configure (project name from `package.json` or, without one, the directory basename; hierarchical/on-demand sections auto-discovered). The hook calls `node scripts/agent-workflow/run.mjs <name>` directly, so a committer without `node` on PATH gets the hook's own loud failure.
29
+ 8. **Offer enforcement on every project, preview-first.** Explain in one line that the dependency-free Node scripts are available because the agent host already runs their step-7 navigator; the only skip condition is that the agent host cannot run them. Run the `enforcement` item's check line, `node ${CLAUDE_SKILL_DIR}/tools/apply-danger-check.mjs --variant enforcement --cwd <project>`: its result is the preview — each script the kit places into the kit folder `scripts/agent-workflow/` with its own SHA-256 digest, and the installer command with one SHA-256 digest that binds every deployed path to its file bytes or its absence. Ask once on that result; on a yes copy them by its apply line with the result's closing `digest:`, run by the consent route of `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`: the copy is create-only and the project's installer installs the pre-commit hook. On a no, skip the hook and say so; a check that refuses (exit 1 or 3) or an apply that exits 6 leaves no script the kit placed — say so with its output and fill the command slots as on a no. On a no the docs command slots name no project-local command — fill `env_commands.md` and the `Docs caps + index freshness` row of `AGENTS.md` with the same note: the caps + index gate run from the agent's own skill copy (the step-7 `--root=<project>` form) and the archive rotations need the scripts deployed. Never write the skill's absolute path into a deployed doc. They self-configure (project name from `package.json` or, without one, the directory basename; hierarchical/on-demand sections auto-discovered). The hook calls `node scripts/agent-workflow/run.mjs <name>` directly, so a committer without `node` on PATH gets the hook's own loud failure.
30
30
  9. **Wire / hide** per visibility (see [Visibility contract](${CLAUDE_SKILL_DIR}/references/contracts.md#visibility-contract)). The pre-commit hook is the installer's decision at step 8's apply; over a pre-commit hook the installer did not write, that apply exits 6 with the installer's output naming the hook, and moving it aside is the user's own step. Once the gate declaration is final-run-capable, the advisor's `commit-guard` item binds commits to the green `run-gates --final` receipt; it is applied the same way, its check line first.
31
31
  - **visible** — when a `package.json` exists and step 8's apply exited 0, wire its scripts (never create one for this); add the minimal `.gitignore` either way. **Do not run the hide tool.**
32
32
  - **hidden** — run the kit's hide writer (one managed block in the **project-local** `.git/info/exclude`, covering the kit's own artifacts **and** every known AI/agent tool's footprint — never the machine-global excludes): `node ${CLAUDE_SKILL_DIR}/tools/hide-footprint.mjs --dir <project> --dry-run` **first** (changes nothing, prints the plan), then the same without `--dry-run`. Handle what it surfaces, in plain language (never the tool's internal terms):
@@ -28,7 +28,15 @@ Run **`node ${CLAUDE_SKILL_DIR}/tools/flow-writer.mjs <arm> …`** — the arm s
28
28
 
29
29
  `round-open` mints the round record BEFORE any backend runs — per `--backend` a fresh nonce + receipts watermark; stdout prints one `dispatch backend=<b> nonce=<n> watermark=<w>` line per dispatch (pass the nonce as `--nonce <n>` on the wrapper invocation — the plain-argument lane onto the `AW_REVIEW_NONCE` seam; hand the pair to `receipt-deadline`).
30
30
 
31
- Every round after the first requires an authoritative walk-carrying attestation at the preceding round's `{planId, cycle, stepId, round}` and the CURRENT tree's `{base, fingerprint}` when the adopted plan has a judgeable ledger row; `--justification` may lift that absence as an echoed input, and the ABSENCE of the attestation is its durable trail. At `cap reached` or `crossover`, every blocking item from the latest head's landed receipts must be covered by equal item digest: uncovered items print verbatim, enumeration failure is an advisory plus the existing disposition floor, and a lost manifest is covered only by `custody-lost`; this cap refusal is never lifted by `--justification`.
31
+ An adopted plan owes a walk when its structural judgment finds a valid row or `retired-size-field`.
32
+ For such a plan every round after the first requires an authoritative walk-carrying attestation at
33
+ the preceding round's `{planId, cycle, stepId, round}` and the CURRENT tree's `{base, fingerprint}`.
34
+ The missing-walk refusal names `retired-size-field` when present. `--walk` names the blocking
35
+ structural codes when it refuses the plan. `--justification` may lift a missing walk as an echoed
36
+ input, and the absence of the attestation is its durable trail. At `cap reached` or `crossover`, every
37
+ blocking item from the latest head's landed receipts must be covered by equal item digest: uncovered
38
+ items print verbatim, enumeration failure is an advisory plus the existing disposition floor, and a
39
+ lost manifest is covered only by `custody-lost`; this cap refusal is never lifted by `--justification`.
32
40
 
33
41
  Both lock-free and locked `round-open` checks run cap → walk → completeness floor. Boundary invocations need `--step`; `--new-cycle` opens the next cycle; a fingerprint move opens a new round.
34
42
 
@@ -40,7 +48,7 @@ For `round-land`, exactly one fresh code-artifact non-probe line of the dispatch
40
48
 
41
49
  Operand shapes: a positional operand may follow a literal `--` and a value flag accepts `--flag=<value>` — the lanes a leading-dash id or value rides; the checker's printed recoveries compose exactly these shapes. Every arm computes its **tree context** (owner, base, fingerprint; cycle/round from the chain walk) — you never hand-supply tree identity. Chain arms **refuse a foreign worktree's chain** (#57): move a chain only from the worktree that adopted it.
42
50
 
43
- **Round-machinery caps (enforced at the arms; the store owns transition legality):** HARD_MAX **3 rounds per {cycle, step}** and **1 post-freeze unfreeze per cycle**. The walk obligation holds when the adopted plan's ledger parses with at least one valid row; a plan with no judgeable row owes no walk. Both lock-free and locked round-open checks run cap → walk → completeness floor. The justification predicate is `overCap || walkRefusalFired`: a non-empty justification lifts only a design-cap or missing-walk refusal and is echoed; an in-cap invocation with its walk satisfied refuses it as usage. The blocking-item cap is independent and never lifted. A `custody-lost` entry is recordable whenever the carrier loss is real. One-way door: records carrying `walk`, the queued proof trio, `escalated`, or `custody-lost` require kit >= 11 to read; pre-rung records remain valid.
51
+ **Round-machinery caps (enforced at the arms; the store owns transition legality):** HARD_MAX **3 rounds per {cycle, step}** and **1 post-freeze unfreeze per cycle**. The justification predicate is `overCap || walkRefusalFired`: a non-empty justification lifts only a design-cap or missing-walk refusal and is echoed; an in-cap invocation with its walk satisfied refuses it as usage. The blocking-item cap is independent and never lifted. A `custody-lost` entry is recordable whenever the carrier loss is real. One-way door: records carrying `walk`, the queued proof trio, `escalated`, or `custody-lost` require kit >= 11 to read; pre-rung records remain valid.
44
52
 
45
53
  **Exit codes:** `0` success (incl. the `write-plan-id` idempotent no-op); `2` usage; `1` refusal (a store STOP verbatim, a derivation failure, or the missing checkpoint flag).
46
54
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  <!-- opt-in-capability: gate-hook -->
4
4
  <!-- opt-in-capability: read-lane -->
5
+ <!-- opt-in-capability: stage-guard -->
5
6
 
6
7
  The opt-in **gate-approval PreToolUse hook** — the family's third `.claude/` writer (velocity discipline), and the shipped closure of the velocity trust-posture residual (**AD-021 scope C, probe-proven in AD-037**). It places a **self-contained** hook runtime at `.claude/hooks/agent-workflow-gates.mjs` (no kit imports — it keeps working if the kit is uninstalled) and wires ONE `PreToolUse` `"Bash"` entry into `.claude/settings.json`. Per Bash call the hook then walks a decision ladder, first match wins:
7
8
 
@@ -41,4 +42,6 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/gate-hook.mjs [--dry-run | --apply] [--cwd <
41
42
 
42
43
  **Exit codes:** `0` done / dry-run; `1` a precondition STOP; `2` bad arguments.
43
44
 
44
- **The kit's other hook.** `state-block-guard` (see `${CLAUDE_SKILL_DIR}/references/modes/state-block-guard.md`) is a separate, unrelated `Stop` hook that judges the closing state block of a turn. Its writer is `tools/state-block-hook.mjs` (the advisor's `state-block` item), it never approves or denies anything, and this mode neither places nor wires it — the two hooks share only the `.claude/` directory they live in and the hardened placement discipline the state-block writer imports from `gate-hook.mjs`.
45
+ **The kit's other hook.** `state-block-guard` (see `${CLAUDE_SKILL_DIR}/references/modes/state-block-guard.md`) is a separate, unrelated `Stop` hook that judges the closing state block of a turn. Its writer is `tools/state-block-hook.mjs` (the advisor's `state-block` item), it never approves or denies anything, and this mode neither places nor wires it — the two hooks share only the `.claude/` directory they live in and the hardened placement discipline the state-block writer takes from `gate-hook.mjs` through the kit's hook writer `tools/hook-writer/index.mjs`.
46
+
47
+ **The kit's third hook.** The stage write guard (`.claude/hooks/stage-write-guard.mjs`) is a `PreToolUse` hook on the edit tools (`Write|Edit|MultiEdit|NotebookEdit`) that refuses a write outside the authoring documents while the stage last rendered writes no code — a deny, never a prompt or an approval. Its writer is `tools/stage-write-guard/cli.mjs`, running on the same hook writer (the advisor's `stage-guard` offer, and over a wired guard the kit item `stage-guard.not-current`); this mode neither places nor wires it.
@@ -15,7 +15,7 @@ The four blocks keep this order:
15
15
  3. **QUEUE** — every work-carrying row (live, parked, ambiguous) under the full line-numbered heading path it carries, with per-class counts covering every row of the bucket, terminal and record included, and names rather than ids. Only a path through `## Pending / backlog` calls its position priority; every other bucket is archive and calls it position.
16
16
  4. **CAMPAIGN** — source-size config state (`absent`, `authored`, `minted`), caps, roots and recorded over-cap files. An absent opt-in config is a rendered state.
17
17
 
18
- Evidence alone sets a ledger status: the row's path and verb, then the path fact, changed set and exclusion fact. The plan's prose never sets a status. A checked box or terminal marker is only a claim; when evidence contradicts it, print the claim beside the evidence-derived status. Keep anomaly and current red-proof annotations beside the same status too. Every status line names its evidence source.
18
+ Evidence alone sets a ledger status: the row's path and verb, then the path fact, changed set and exclusion fact. The plan's prose never sets a status. A checked box or terminal marker is only a claim; when evidence contradicts it, print the claim beside the evidence-derived status. Keep current red-proof annotations beside the same status too. Every status line names its evidence source.
19
19
 
20
20
  A block that cannot be derived is `WITHHELD` and prints its cause on one line. NOW has two halves, plans and tree, each independently a value or `WITHHELD`; NOW itself is `WITHHELD` only when both are. Render every other block normally.
21
21
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  <!-- opt-in-capability: none — an inspection surface that configures nothing -->
4
4
 
5
- Read-only **activity-procedures advisor**. Answers *"what are the steps of this named activity, and which recipe applies at each slot here?"* It composes the orchestration recipes (`${CLAUDE_SKILL_DIR}/references/modes/recipes.md`) into **named activities** with **typed recipe slots**. It **never writes, never commits, never runs a subscription CLI** — the deterministic resolution lives in the kit; the orchestrator runs the resolved recipe via the bridge skills or the executor vehicle and **owns any commit when the activity has a commit boundary** (every other carrier never commits). Not every activity commits: `plan-authoring` ends at approval and produces no commit (plans are ephemeral, never committed); `plan-execution` commits the story once, after its diff review.
5
+ Read-only **activity-procedures advisor**. Answers *"what are the steps of this named activity, and which recipe applies at each slot here?"* It composes the orchestration recipes (`${CLAUDE_SKILL_DIR}/references/modes/recipes.md`) into **named activities** with **typed recipe slots**. It **never writes, never commits, never runs a subscription CLI** — the deterministic resolution lives in the kit; the orchestrator runs the resolved recipe via the bridge skills, the executor vehicle for carry or the author vehicle for author, and **owns any commit when the activity has a commit boundary** (every other carrier never commits). Not every activity commits: `plan-authoring` ends at approval and produces no commit (plans are ephemeral, never committed); `plan-execution` commits the story once, after its diff review.
6
6
 
7
7
  The six activities (canon in the **installed engine**, `references/procedures.md`; the registry is `tools/carriers.mjs`):
8
8
 
@@ -13,17 +13,45 @@ The six activities (canon in the **installed engine**, `references/procedures.md
13
13
  - **`epic`** (slots: `author`, `review`) — brief → draft by the resolved `author` carrier → `epic-shape-cli --check` → **review {recipe}**: one review-lens read over the rendered review brief, whatever `epic.review` resolves to (no bridge wrapper, driving contract or grounding pre-step renders under it) → fold through the fold ask and `--fold`, at most two rounds → land.
14
14
  - **`task`** (slots: `author`, `execute`) — the orchestrator writes one prompt from one ledger row, whatever `author` resolves to → with the story's changes staged, the resolved `execute` carrier runs it inside its Files (Delegated: `codex-exec --nonce <n> <prompt file>`) → the read after the hand-out restores writes outside the Files from the index and the copied excluded paths from their copy, then the row's tests → return into the story's row, a fold resuming the run's session from its exec receipt; no commit boundary or review of its own.
15
15
 
16
- Value sets per slot type: `review` accepts `solo | reviewed | council`; `execute` (including `task.author` and `task.execute`) accepts `solo | delegated | subagent`; a carrier slot (`plan-authoring.author`, `plan-authoring.fold`, `routine.carrier`, `epic.author`) accepts `solo | subagent`; `parallel` is a **switch**, `on | off`, resolved outside the recipe lattice. Defaults when the config is silent: `review` → Reviewed if a review-capable backend is ready, else Solo; `author`, `fold`, `execute`, `carrier` → Solo (a placed executor never flips a default); `parallel` → on. The orchestrator owns every commit; every other carrier — a bridge or a subagent — never commits.
16
+ Value sets per slot type: `review` accepts `solo | reviewed | council`; `execute` (including `task.author` and `task.execute`) accepts `solo | delegated | subagent`; a carrier slot (`plan-authoring.author`, `plan-authoring.fold`, `routine.carrier`, `epic.author`) accepts `solo | subagent`; `parallel` is a **switch**, `on | off`, resolved outside the recipe lattice. Defaults when the config is silent: `review` → Reviewed if a review-capable backend is ready, else Solo; `author`, `fold`, `execute`, `carrier` → Solo (a placed vehicle never flips a default); `parallel` → on. The orchestrator owns every commit; every other carrier — a bridge or a subagent — never commits.
17
17
 
18
- Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slot>=<value>]… [--json]`**. It reads the activity's steps live from the engine and prints them **verbatim**, then the **resolved effective recipe per slot** from the per-project config + the read-only backend detector:
18
+ Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slot>=<value>]… [--json]`**. It reads the activity's steps live from the engine and prints them **verbatim**, then the **resolved effective recipe per slot** from the per-project config + the read-only backend detector and both vehicle surveys:
19
19
 
20
20
  1. **Config = `docs/ai/orchestration.json`** — strict JSON, **agent-writable via `/agent-workflow-kit set-recipe` (`${CLAUDE_SKILL_DIR}/references/modes/set-recipe.md`) OR hand-edited** (the kit reads + validates it; `procedures`/`recipes` stay read-only — the writer is `set-recipe`). Shape: `{ "<activity>": { "<slot>": "<value>" } }`; all slots optional (an absent slot → its computed default, stated); an optional `"_README"` string is allowed + ignored; a `"flow"` object must carry the NUMERIC `"schema": 1` (the kit's accepted flow schema version) and validates against the CLOSED structural schema-1 key set (unknown flow keys and malformed per-key shapes refuse loudly; deep environment floors stay on the `set-flow` arming path). `review` accepts `solo|reviewed|council`; `execute` (including `task.author` and `task.execute`) accepts `solo|delegated|subagent`; a carrier slot (`plan-authoring.author`, `plan-authoring.fold`, `routine.carrier`, `epic.author`) accepts `solo|subagent`; `parallel` accepts `on|off`. Seeded by `init` (a user-editable template) — see `${CLAUDE_SKILL_DIR}/references/modes/bootstrap.md`.
21
- 2. **Default resolution (config silent):** `review` → Reviewed if any review-capable backend is `ready`, else Solo (never Council by default); `execute`, `author`, `fold`, `carrier` → Solo (Delegated and Subagent are opt-in; a placed executor never flips a default); `parallel` → on. **Degradation:** a config/computed default degrades **gracefully with a stated reason** (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the executor vehicle is missing or unusable, the reason naming the apply command; a switch never degrades); a per-run **`--override <slot>=<value>`** that can't be satisfied degrades **loudly** (a flagged warning, so you tell the user) — but is **still exit 0** (a valid request that gracefully degraded).
21
+ 2. **Default resolution (config silent):** `review` → Reviewed if any review-capable backend is `ready`, else Solo (never Council by default); `execute`, `author`, `fold`, `carrier` → Solo (Delegated and Subagent are opt-in; a placed vehicle never flips a default); `parallel` → on. **Degradation:** a config/computed default degrades **gracefully with a stated reason** (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the executor vehicle is missing or unusable for a carry-role slot, or when the author vehicle is not placed for an author-role slot, the reason naming the apply command; a switch never degrades); a per-run **`--override <slot>=<value>`** that can't be satisfied degrades **loudly** (a flagged warning, so you tell the user) — but is **still exit 0** (a valid request that gracefully degraded).
22
22
  3. **Exit codes:** `0` success; `2` usage (unknown `<activity>` / bad `--override` — a bare `--override <recipe>`, an unknown slot, a value outside the slot's list, or a duplicate slot); `1` config error (malformed / schema-invalid / unreadable `orchestration.json`) **or** engine error (the installed engine is absent / invalid / **too old** to ship `references/procedures.md` — upgrade it with `npx @sabaiway/agent-workflow-engine@latest init`). A `1`/`2` failure is loud (`path: reason`), never a silent fallback. **Lagging-kit honesty:** a kit predating the `"flow"` key that reads a config carrying one fails this config load loudly (exit `1`, reddening its full gate matrix); the `set-flow` arming path now enforces the declared `kitMinVersion` floor with a null-guarded comparison (an unparseable version never passes), while tolerate-first ordering remains the only protection for readers older than the `"flow"` key itself — no in-config floor can reach a kit that dies on the unknown key.
23
23
 
24
- **The dispatch form (a slot resolved to `subagent`).** A carrier that is only NAMED is a name, not an instruction, so after such a slot's resolved-recipe line the advisor prints — indented under it, in place of the one-line vehicle mention — the form the dispatch must take, in five parts: (1) what a SLICE is for THIS slot — for `plan-execution.execute`, a set of file-disjoint ledger rows, wording copied verbatim where wording is a red line; for `plan-authoring.author`, a brief naming the goal, the governing spec(s) and the ledger constraints, whose returned draft the orchestrator reviews as its own; for `plan-authoring.fold`, the round's findings with their dispositions, whose edits the orchestrator follows with the self-consistency read; for `routine.carrier`, a bounded mechanical task, where a read-only chore (a sweep, gate triage) rides its placed read-only vehicle — or is carried solo with a stated reason when that vehicle is absent — a write-capable one (a regeneration, a fixture build) rides the executor, and the changelog stays the orchestrator's; for `epic.author`, a brief naming the intent, the value, the non-goals and the stories in order, from which the subagent drafts the epic file and the orchestrator runs the shape check on the draft as its own; for `task.author`, no slice the flow dispatches, since the orchestrator writes each row's prompt itself whatever the slot resolves to — that sentence renders alone, with none of the parts below; for `task.execute`, one prompt the orchestrator wrote from one ledger row, run inside the Files the prompt names with the changed paths reported and the row's tests run by the orchestrator; (2) the vehicle and its surveyed state — `.claude/agents/executor.md` (`placed` / `customized` / `unusable` / `missing`, from the same survey `status` and the advisor read) — dispatched **in the background**; (3) that the orchestrator **verifies every returned slice by running its suites itself**; (4) that the subagent is **never told to commit, never a review backend, never a bridge substitute**; (5) the **honest limit** — a Claude Code lane: on a host that cannot dispatch the vehicle, follow this form BY HAND and say so, never report it as a subagent dispatch. The wording is the kit's own (`tools/carriers.mjs`) and is printed, never re-worded. The dispatch-form branch is unchanged for a slot resolved to `solo` or `delegated`.
25
-
26
- **Fold lane (an execute slot the activity reads resolved to `delegated`).** `procedures plan-execution` reads `plan-execution.execute` and `task.execute`, `procedures task` reads `task.execute` alone, and `task.author` never counts; a per-run `--override` moves only the rendered activity's own slot. The lane renders once, immediately after the rendered activity's `execute` slot block (after its driving contract when that slot itself resolves to `delegated`), as one line: a fold of code a bridge wrote resumes that run's session, `codex-exec --resume <session id> --nonce <n> <prompt file>`, the session id read from the `sessionId` of the run's exec receipt, with a new prompt and a fresh nonce. No delegation ledger and no HEAD are read, so the line is the same whatever a ledger holds. The block is advisory and never changes the exit code; `foldLane` carries the identical line under `--json`, and is `[]` for every other activity and whenever no slot the activity reads resolves to `delegated`.
24
+ **The dispatch form (a slot resolved to `subagent`).** A carrier that is only NAMED is a name, not an
25
+ instruction, so after such a slot's resolved-recipe line the advisor prints — indented under it, in place of
26
+ the one-line vehicle mention — the form the dispatch must take, in five parts: (1) what a SLICE is for THIS
27
+ slot — for `plan-execution.execute`, a set of file-disjoint ledger rows, wording copied verbatim where wording
28
+ is a red line; for `plan-authoring.author`, a brief naming the goal, the governing spec(s) and the ledger
29
+ constraints, whose returned draft the orchestrator reviews as its own; for `plan-authoring.fold`, the round's
30
+ findings with their dispositions, whose edits the orchestrator follows with the self-consistency read; for
31
+ `routine.carrier`, a bounded mechanical task, where a read-only chore (a sweep, gate triage) rides its placed
32
+ read-only vehicle — or is carried solo with a stated reason when that vehicle is absent — a write-capable one
33
+ (a regeneration, a fixture build) rides the executor, and the changelog stays the orchestrator's; for
34
+ `epic.author`, a brief naming the intent, the value, the non-goals and the stories in order, from which the
35
+ subagent drafts the epic file and the orchestrator runs the shape check on the draft as its own; for
36
+ `task.author`, no slice the flow dispatches, since the orchestrator writes each row's prompt itself whatever
37
+ the slot resolves to — that sentence renders alone, with none of the parts below; for `task.execute`, one
38
+ prompt the orchestrator wrote from one ledger row, run inside the Files the prompt names with the changed
39
+ paths reported and the row's tests run by the orchestrator;
40
+ (2) the vehicle and its surveyed state — for a carry-role slot, `.claude/agents/executor.md` (`placed` /
41
+ `customized` / `unusable` / `missing`, from the same survey `status` and the advisor read); for the
42
+ author-role slots `plan-authoring.author`, `plan-authoring.fold` and `epic.author`, `.claude/agents/author.md`
43
+ (ready only when `placed`) — dispatched **in the background**;
44
+ (3) for a carry-role slot, that the orchestrator **verifies every returned slice by running its suites
45
+ itself**; for an author-role slot, that the orchestrator reviews every returned draft as its own, with no
46
+ suite-run line; (4) that the subagent is **never told to commit, never a review backend, never a bridge
47
+ substitute**; (5) the **honest limit** — for a carry-role slot, a Claude Code lane: on a host that cannot
48
+ dispatch the vehicle, follow this form BY HAND and say so, never report it as a subagent dispatch. For an
49
+ author-role slot, a Claude Code lane loaded at session start: dispatch only when this session's agent list shows author with exactly Read, Grep, Glob,
50
+ Write and Edit; otherwise, a file placed or written during this session included, carry the slice solo and say
51
+ so; never another subagent. The wording is the kit's own (`tools/carriers.mjs`) and is printed, never
52
+ re-worded. The dispatch-form branch is unchanged for a slot resolved to `solo` or `delegated`.
53
+
54
+ **Fold lane (an execute slot the activity reads resolved to `delegated`).** `procedures plan-execution` reads `plan-execution.execute` and `task.execute`, `procedures task` reads `task.execute` alone, and `task.author` never counts; a per-run `--override` moves only the rendered activity's own slot. The lane renders once, immediately after the rendered activity's `execute` slot block (after its driving contract when that slot itself resolves to `delegated`), as one line: a fold of code a bridge wrote resumes that run's session, `codex-exec --resume <session id> --nonce <n> <prompt file>`, the session id read from the `sessionId` of the run's exec receipt, with a new prompt carrying the `aw-plan-approval` block and a fresh nonce. No delegation ledger and no HEAD are read, so the line is the same whatever a ledger holds. The block is advisory and never changes the exit code; `foldLane` carries the identical line under `--json`, and is `[]` for every other activity and whenever no slot the activity reads resolves to `delegated`.
27
55
 
28
56
  **`routine`'s `parallel` switch renders against the EFFECTIVE carrier.** The flag always renders with its source (`parallel: on` / `parallel: off`); the concurrency claim — *file-disjoint slices dispatch concurrently* — renders **only** while the resolved `carrier` is `subagent`. Under a `solo` carrier the line states its own inertness instead, `(no effect while the carrier is solo)`: a switch never degrades, so the flag keeps the value you set and the render simply stops promising a concurrency nothing can perform. That makes four cells (`on`/`off` x `subagent`/`solo`), and only the `subagent`+`on` cell claims concurrency.
29
57
 
@@ -31,9 +59,20 @@ Run **`node ${CLAUDE_SKILL_DIR}/tools/procedures.mjs <activity> [--override <slo
31
59
 
32
60
  **Flow armed-halves block (session-start read side).** When the config carries a `flow` block, the advisor also renders `Flow (schema 1) — armed halves (config · chain · bookkeeping):` — the **config half** (preset · councilRounds · kitMinVersion), the **chain half** (a light read-only probe of the flow store on the checker's fixed path: ARMED at an adoption record, UNARMED for an absent or unadopted store, fail-closed BROKEN wording for a malformed one), and the **bookkeeping half** (each declared path: declared non-excluded — the tracked-file floor verifies on the `set-flow` arming path — vs loudly DECLARED-EXCLUDED). A config with no `flow` block renders byte-identically to before and pays no store probe.
33
61
 
34
- **Declared source-size practice block (upfront knowledge, D-17 U1).** When the project declares a source-size practice in `docs/ai/source-size.json`, the advisor also renders `Declared source-size practice (docs/ai/source-size.json) — known BEFORE the code is written:` — the caps, the five limits with their tolerances, whether layout is recorded, on schema 1 the `--write-baseline` move, what is recorded and the canonical WHY sentence (the plan-time layout itself is the planning canon's Module ledger). `--json` carries the SAME lines under **`declaredPractice`** (an empty array when nothing is declared), so the human and structured renders never diverge. The three config states each read as themselves: **ABSENT** renders nothing at all (a project declaring no practice is handed no invented limits), **AUTHORED** is pre-mint (no file size is recorded yet), **MINTED** carries the recorded count. A declaration that cannot be read (malformed, unknown-keyed, a dangling symlink) renders ONE loud `UNREADABLE` line and the advisor **still exits 0** — the practice's own checker owns the exit code for its config (exit 2 there) and its declared gate reds the gate matrix. Read through the practice's pure read core, so this advisor never reaches its writer half.
35
-
36
- **Readers-sweep block (`plan-authoring` only, unconditional).** Before the review-loop block the advisor renders `Readers sweep (before the first review) — …`: the search form for every config key, registry entry, exported constant, receipt field or canon sentence the plan changes, and the classification rule (a ledger row, a stated non-goal, or unchanged with its proof). The command line `run: node <kit>/tools/repo-search.mjs --pattern <the literal>` ALWAYS renders — bare wherever the `--kit-tools` tier could seed that path (the tier's own byte-form, the same predicate), and single-quoted otherwise (an unseedable path has no rule to match); `--pattern-file <f>` only for a pattern carrying a shell-significant byte; when the project's MCP registration is complete (`/agent-workflow-kit mcp`) a `use: repo_search {"pattern": "<the literal>"}` line renders ABOVE it — registration on disk, never a claim the tool is loaded in this session. `--json` carries the SAME lines under **`readersSweep`** (an empty array for the other activities).
62
+ **Declared source-size practice block (D-17 U1).** When the project declares a source-size practice
63
+ in `docs/ai/source-size.json`, the advisor also renders `Declared source-size practice (docs/ai/source-size.json):`
64
+ with the caps, the five limits with their tolerances, whether layout is recorded, the `--write-baseline`
65
+ move on schema 1, what is recorded and the canonical WHY sentence. `--json` carries the SAME lines
66
+ under **`declaredPractice`** (an empty array when nothing is declared), so the human and structured
67
+ renders never diverge. The three config states each read as themselves: **ABSENT** renders nothing at
68
+ all (a project declaring no practice is handed no invented limits), **AUTHORED** is pre-mint (no file
69
+ size is recorded yet), **MINTED** carries the recorded count. A declaration that cannot be read
70
+ (malformed, unknown-keyed, a dangling symlink) renders ONE loud `UNREADABLE` line and the advisor
71
+ **still exits 0**. The practice's own checker owns the exit code for its config (exit 2 there) and
72
+ its declared gate reds the gate matrix. Read through the practice's pure read core, so this advisor
73
+ never reaches its writer half.
74
+
75
+ **Readers-sweep block (`plan-authoring` only, unconditional).** Before the review-loop block the advisor renders `Readers sweep (before the first review) — …`: the search form for every config key, registry entry, exported constant, receipt field or canon sentence the plan changes, searching by name and by value, bounded to what the search instrument lists, and the classification rule (a ledger row, a stated non-goal, or unchanged with its proof). The command line `run: node <kit>/tools/repo-search.mjs --pattern <the literal>` ALWAYS renders — bare wherever the `--kit-tools` tier could seed that path (the tier's own byte-form, the same predicate), and single-quoted otherwise (an unseedable path has no rule to match); `--pattern-file <f>` only for a pattern carrying a shell-significant byte; when the project's MCP registration is complete (`/agent-workflow-kit mcp`) a `use: repo_search {"pattern": "<the literal>"}` line renders ABOVE it — registration on disk, never a claim the tool is loaded in this session. `--json` carries the SAME lines under **`readersSweep`** (an empty array for the other activities).
37
76
 
38
77
  **Slot-skew warning.** When the installed engine's canon `Slots:` line for the activity differs from this kit's registry, the advisor adds a `warnings` entry (a `⚠` line in the human render; exit 0; the resolved lines follow the registry) naming both lists — the engine and the kit are out of step; `/agent-workflow-kit status` names which member is behind. A section without a `Slots:` line is a customized canon and stays silent.
39
78
 
@@ -2,24 +2,24 @@
2
2
 
3
3
  <!-- opt-in-capability: none — an inspection surface that configures nothing -->
4
4
 
5
- Read-only **orchestration advisor**. Answers *"how should I compose the carriers of a step — the optional execution-backends and the full-tool executor subagent — into plan → execute → review here, and which recipe fits?"* It **never writes, never commits, never runs a subscription CLI, and never executes a recipe** — the orchestrator (you) runs the chosen recipe through the bridge skills or the executor vehicle and makes the single commit; a backend or a subagent is advisory or delegated, never autonomous.
5
+ Read-only **orchestration advisor**. Answers *"how should I compose the carriers of a step — the optional execution-backends, the full-tool executor and the no-shell author vehicle — into plan → execute → review here, and which recipe fits?"* It **never writes, never commits, never runs a subscription CLI, and never executes a recipe** — the orchestrator (you) runs the chosen recipe through the bridge skills or the vehicle of the slot's role and makes the single commit; a backend or a subagent is advisory or delegated, never autonomous.
6
6
 
7
- The five recipes (defined over each bridge's `provides` roles — `codex`: execute + review; `agy`: review + probe — plus the `carry` role the placed **executor vehicle** provides), canonical narrative in the **installed engine** (`references/orchestration.md`):
7
+ The five recipes (defined over each bridge's `provides` roles — `codex`: execute + review; `agy`: review + probe — plus the `carry` role the placed **executor vehicle** provides and the `author` role the placed **author vehicle** provides), canonical narrative in the **installed engine** (`references/orchestration.md`):
8
8
 
9
9
  - **Solo** — you plan, execute, and self-review; no backend (always available; the floor).
10
10
  - **Reviewed** — you execute; **one** backend reviews the result (advisory). Prefers `codex` when both are ready (`agy` carries a standing health caveat).
11
11
  - **Council** — **both** backends review independently; you synthesize the two opinions.
12
12
  - **Delegated** — you hand a **bounded** execution sub-task to a backend (`codex exec`), then review the returned diff and commit.
13
- - **Subagent** — a **full-tool frontier subagent**, dispatched from the placed executor vehicle (`.claude/agents/executor.md`), carries a **bounded, file-disjoint** slice — of execution, of plan/contract authoring, of an authoring fold, of routine work, of an epic brief (`epic.author`), or of one prompt the orchestrator wrote from one ledger row, run inside its Files (`task.execute`; `task.author` dispatches no slice: the orchestrator writes each row's prompt itself); you verify the returned slice by running its suites yourself and you make the commit. It is **never a review backend**, **never a bridge substitute**, and is **never told to commit**; it **degrades to Solo** when the vehicle is `missing` or `unusable`, with the reason. Readiness here is the **vehicle FILE, never the host** — a **Claude Code lane**, like the `agents` writer itself: on a host that cannot dispatch the vehicle, the rendered dispatch form is an instruction you follow by hand and report as such, never as a subagent dispatch.
13
+ - **Subagent** — a **frontier subagent** from the vehicle of the slot's role carries a bounded slice. Carry slots ride the full-tool executor (`.claude/agents/executor.md`) for a file-disjoint execution or write-capable routine slice, or one prompt the orchestrator wrote from one ledger row, run inside its Files (`task.execute`; `task.author` dispatches no slice: the orchestrator writes each row's prompt itself); you run its suites yourself. Author slots ride the no-shell author vehicle (`.claude/agents/author.md`) for a plan/contract brief, a round's fold or an epic brief; you review the draft as your own. You make the commit. Neither vehicle is a **review backend** or a **bridge substitute**, and neither is **told to commit**; a carry slot **degrades to Solo** on a `missing` or `unusable` executor, and an author slot on any author state but `placed`, each naming its vehicle and the reason. Readiness here is the **vehicle FILE, never the host** — a **Claude Code lane**, like the `agents` writer itself: on a host that cannot dispatch the vehicle, the rendered dispatch form is an instruction you follow by hand and report as such, never as a subagent dispatch.
14
14
 
15
- 1. Run **`node ${CLAUDE_SKILL_DIR}/tools/recipes.mjs`** (the read-only planner; `--json` for the structured form). It runs the backend detector, lists the five recipes, and prints — for the current environment — a **per-recipe dispatch plan that degrades with a stated reason** when a carrier isn't `ready` (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the executor vehicle is `missing`/`unusable`), plus advisory **quota/health notes** (each bridge runs the host posture the user set — a weaker model is the user's bridge setting, never a per-call choice; Council spends two backends' quota; `agy` may stall on substantive prompts — Issue-001, prefer `codex`).
16
- 2. **Offer the choice** via **`AskUserQuestion` where your agent supports it** (`AskUserQuestion` in Claude Code) — one option per recipe, the `recommendRecipe` choice listed **first** — otherwise in prose. Then print `planRecipe(chosen, detection)` (the per-stage dispatch + degradation reasons + quota/health notes) so the user sees exactly what running it entails.
15
+ 1. Run **`node ${CLAUDE_SKILL_DIR}/tools/recipes.mjs`** (the read-only planner; `--json` for the structured form). It runs the backend detector, lists the five recipes (a Subagent plan per role), and prints — for the current environment — a **per-recipe dispatch plan that degrades with a stated reason** when a carrier isn't `ready` (Council → Reviewed → Solo; Delegated → Solo; Subagent → Solo when the carry slot's executor is `missing`/`unusable` or the author slot's author vehicle is not `placed`), plus advisory **quota/health notes** (each bridge runs the host posture the user set — a weaker model is the user's bridge setting, never a per-call choice; Council spends two backends' quota; `agy` may stall on substantive prompts — Issue-001, prefer `codex`).
16
+ 2. **Offer the choice** via **`AskUserQuestion` where your agent supports it** (`AskUserQuestion` in Claude Code) — one option per recipe, the `recommendRecipe` choice listed **first** — otherwise in prose. Then, for a named slot, print `planRecipe(chosenId, detection, slotRole(activity, slot))`, where `chosenId` is the recipe id (the per-stage dispatch + degradation reasons + quota/health notes), so the user sees exactly what running it entails; when Subagent is chosen with no slot named, print both role-specific plans, as step 1 does.
17
17
  3. **Availability = `readiness === ready`, full stop.** Every other readiness supplies the human reason (needs-skill → "not installed — `/agent-workflow-kit setup`"; needs-cli → "install the CLI"; needs-credentials → "log in"; degraded → "wrapper not on PATH — `/agent-workflow-kit setup`"). This is set-up state only — **never** a claim that a backend's service is responsive (the detector cannot observe a runtime stall; `agy`'s Issue-001 is a *standing advisory*, not a readiness signal).
18
18
 
19
- **The activities and their slots.** One registry (`tools/carriers.mjs`, re-exported by `recipes.mjs`) names **six** activities and their typed slots: `plan-authoring` → `author`, `fold`, `review`; `plan-execution` → `execute`, `review`; `routine` → `carrier`, `parallel`; `feedback-triage` → `review`; `epic` → `author`, `review`; `task` → `author`, `execute`. Each slot's accepted values follow its TYPE — `review` (including `epic.review`) accepts `solo|reviewed|council`; `execute` (including `task.author` and `task.execute`) accepts `solo|delegated|subagent`; `carrier` (including `epic.author`) accepts `solo|subagent`. **`parallel` is a flag (`on|off`), not a recipe:** it resolves OUTSIDE the recipe lattice, never degrades, and never reaches the planner. A silent slot takes its **computed default** — `solo` for `author`, `fold`, `execute` and `carrier` (placing the executor vehicle never flips a default; the subagent carrier is opt-in exactly as `delegated` is), `reviewed`/`solo` by readiness for `review`, and `on` for `parallel`.
19
+ **The activities and their slots.** One registry (`tools/carriers.mjs`, re-exported by `recipes.mjs`) names **six** activities and their typed slots: `plan-authoring` → `author`, `fold`, `review`; `plan-execution` → `execute`, `review`; `routine` → `carrier`, `parallel`; `feedback-triage` → `review`; `epic` → `author`, `review`; `task` → `author`, `execute`. Each slot's accepted values follow its TYPE — `review` (including `epic.review`) accepts `solo|reviewed|council`; `execute` (including `task.author` and `task.execute`) accepts `solo|delegated|subagent`; `carrier` (including `epic.author`) accepts `solo|subagent`. **`parallel` is a flag (`on|off`), not a recipe:** it resolves OUTSIDE the recipe lattice, never degrades, and never reaches the planner. A silent slot takes its **computed default** — `solo` for `author`, `fold`, `execute` and `carrier` (placing either vehicle never flips a default; the subagent carrier is opt-in exactly as `delegated` is), `reviewed`/`solo` by readiness for `review`, and `on` for `parallel`.
20
20
 
21
21
  **The configured-recipe line (`--active-line`, read-only).** `node ${CLAUDE_SKILL_DIR}/tools/recipes.mjs --active-line` prints exactly **one** machine-composed line: the **CONFIGURED** recipe of every activity/slot, resolved from the target project's `docs/ai/orchestration.json` (read from the current directory) + live readiness — each slot with its source (configured vs computed default), its degradation stated, and its dispatched wrapper set — explicitly contrasted with the readiness **recommendation** (which is informational; the configured recipes are what runs). Paste it verbatim: it fills the session-start discovery step (the deployed `agent_rules.md` §1.1) and the handover "Active recipes:" slot; `set-recipe` echoes the same line after every successful write. A malformed config fails loud (exit 1), never a silent fallback.
22
22
 
23
23
  On the status line, `ready` for a bridge means wired where the project settings enable the sandbox: the segment ` · sandbox: <condition>` states `ready means wired` where the host honors the settings sandbox keys when they enable it, `ready means installed` where they do not, or `unchecked — <reason>` when it cannot be judged. A ready bridge whose sandbox entries are missing shows `✗ not wired — <n> sandbox entr(ies) missing` (`✗ not wired (unused) — <n> sandbox entr(ies) missing` when no slot uses it) or `✗ unchecked — <reason>`. The recommended recipe stays the readiness one, its clause naming each ready bridge whose review surfaces are not wired (`not wired: <alias> (review)`) or unchecked; a bridge missing only its execution wrapper's entries shows in its cell and its not-wired line. After the recommended line, the recipes output lists one `not wired: <alias> — missing …; <condition>; <route>` line per such bridge and one `unchecked: <alias> — <reason>` line per unchecked bridge; the route is the chat yes of `/agent-workflow-kit upgrade` (once a slot uses an unused bridge for review).
24
24
 
25
- **Invariants:** read-only · never runs a subscription CLI · never commits · the orchestrator executes the recipe via the bridge skills or the executor vehicle, not the kit.
25
+ **Invariants:** read-only · never runs a subscription CLI · never commits · the orchestrator executes the recipe via the bridge skills or the vehicle of the slot's role, not the kit.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md
6
6
 
7
- The **read-only deployment advisor** — the deterministic section every `upgrade` run ends with, also invocable on its own. It computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, sandbox unavailable, gates undeclared, a declared gate matrix that verifies nothing, bridge friction, sandbox-mask clutter, a configured `subagent` carrier whose executor vehicle cannot carry it, a difference from the reference profile the project has not declined, Jev not connected on this host, the Jev skill not installed for every agent) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · `lane: chat`, `lane: harness`, `lane: kit` or `lane: user` · an optional `recipe:` line (an item's own facts or its alternative, such as the `bridge-tier` missing-entries line or the `worktrees-dir` ack fallback) · a harness or kit item's `check:` line before its apply slot · the apply slot: a chat one-liner, a harness or kit item's apply line or a user item's own step}**. The tool computes deterministic English DATA; **you PRESENT the section in the user's conversational language** — every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings stay **byte-exact**; show the raw tool block on request (the AD-032 report-contract lane — the tool cannot know the dialogue language, so the language rendering is your presentation layer).
7
+ The **read-only deployment advisor** — the deterministic section every `upgrade` run ends with, also invocable on its own. It computes what in THIS deployment is configured sub-optimally (allowlist not seeded, autonomy render drifted, sandbox unavailable, gates undeclared, a declared gate matrix that verifies nothing, bridge friction, sandbox-mask clutter, a `subagent` slot whose vehicle is not ready, a difference from the reference profile the project has not declined, Jev not connected on this host, the Jev skill not installed for every agent) and renders **verdict-first**: one composed verdict line, then each item as **{severity · what is sub-optimal · the benefit in ONE plain line · `lane: chat`, `lane: harness`, `lane: kit` or `lane: user` · an optional `recipe:` line (an item's own facts or its alternative, such as the `bridge-tier` missing-entries line or the `worktrees-dir` ack fallback) · a harness or kit item's `check:` line before its apply slot · the apply slot: a chat one-liner, a harness or kit item's apply line or a user item's own step}**. The tool computes deterministic English DATA; **you PRESENT the section in the user's conversational language** — every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings stay **byte-exact**; show the raw tool block on request (the AD-032 report-contract lane — the tool cannot know the dialogue language, so the language rendering is your presentation layer).
8
8
 
9
9
  **Live host/session facts are tool-composed only.** Every fact this section states about the current
10
10
  host or session — prompts fired, sandbox scope, whether a bypass was needed, network reachability,
@@ -24,7 +24,7 @@ The **consent route** for a harness item: run its `check:` line in the sandbox a
24
24
 
25
25
  **The kit route** for a `lane: kit` item, which writes a kit file of a component the project already has or the host already accepted: ask no question and wait for no pick. Before offering the other items, run each kit item's `check:` line in the sandbox and show its result, then at once run its `apply:` line with that result's digest once, outside the sandbox; the harness's own dialog there is its consent, which the kit cannot remove. A changed digest (exit 5) re-runs the check once and applies with its new digest, still with no question; every other outcome leaves the item pending with its output shown, and the agent goes on; an auto-mode refusal gets the one plain step above. `init` checks and applies it on its one y, as a harness item.
26
26
 
27
- **The `executor-vehicle` item (the carrier the project already CONFIGURED — beside the `agents` offer, never the same item).** It fires on ONE pair of facts: a slot in `docs/ai/orchestration.json` names `subagent` while the executor vehicle (`.claude/agents/executor.md`) is `missing` or `unusable` — so every such slot silently degrades to solo. That is a configured declaration that is broken, hence **`attention`**, not an offer; its text names the state, its reason and how many configured slots are affected across the six activities (`plan-authoring`, `plan-execution`, `routine`, `feedback-triage`, `epic`, `task`), covering the subagent-capable slots `plan-authoring.author`, `plan-authoring.fold`, `plan-execution.execute`, `routine.carrier`, `epic.author`, `task.author` and `task.execute`. **`placed` renders NOTHING** (a working vehicle is not a recommendation); it yields to `agents.not-current`, the kit item the agent applies with no question, which writes a regular executor whose bytes differ, the check failing or not, in a placed component; a config naming no `subagent` slot renders no base item, and a config the validated reader refuses is a stated **skip**, never an item computed over a shape nothing accepted. It is deliberately DISTINCT from the `agents` offer and the review-recipe probe, neither of which can observe this state. The agent applies it on the chat yes after the check; `init` previews the agents writer's own `cheap-agents.mjs` and applies it with `--apply` on the terminal yes as a route the user may take instead. Its `recipe:` line carries each precondition the advisor observes beside the apply slot, followed by the hidden-mode reconcile follow-up (`hide-footprint --reconcile`), for a hidden deployment only. Honest limit on convergence: the apply places an ABSENT vehicle, so it clears `missing`; it STOPs on a symlink, so on `unusable` the `recipe:` line names each refusal as a precondition; an executor whose frontmatter is invalid is written by the apply itself. Risk profile: writes under `.claude/agents/` only — every kit agent file written current with no question, the executor's and the review lens's bodies derived from `docs/ai/vehicles.json` — never `settings.json`, never a commit.
27
+ **The `executor-vehicle` item (the carrier the project already CONFIGURED — beside the `agents` offer, never the same item).** It fires when a slot in `docs/ai/orchestration.json` names `subagent` and its role's vehicle is not ready: the author vehicle for author slots (`plan-authoring.author`, `plan-authoring.fold`, `epic.author`) in any state but `placed`, or the executor for carry slots in `missing` or `unusable`. Each affected slot resolves to solo. That is a broken declaration, hence **`attention`**, not an offer; its text names each unready vehicle, its state and reason, and how many slots are affected. **`placed` renders NOTHING** for that vehicle (a working vehicle is not a recommendation); the item yields to `agents.not-current`, the kit item the agent applies with no question, which places or writes kit agent files in a placed component, including a regular executor whose bytes differ, the check failing or not; a config naming no `subagent` slot renders no base item, and a config the validated reader refuses is a stated **skip**, never an item computed over a shape nothing accepted. It is deliberately DISTINCT from the `agents` offer and the review-recipe probe, neither of which can observe this state. The agent applies it on the chat yes after the check; `init` previews the agents writer's own `cheap-agents.mjs` and applies it with `--apply` on the terminal yes as a route the user may take instead. Its `recipe:` line carries each precondition the advisor observes beside the apply slot, followed by the hidden-mode reconcile follow-up (`hide-footprint --reconcile`), for a hidden deployment only. Honest limit on convergence: the apply places an ABSENT vehicle, so it clears `missing`; it STOPs on a symlink, so on `unusable` the `recipe:` line names each refusal as a precondition; a regular executor failing its check and a stale or widened author are written by the apply itself. Risk profile: writes under `.claude/agents/` only — every kit agent file written current with no question, the executor's and the review lens's bodies derived from `docs/ai/vehicles.json` — never `settings.json`, never a commit.
28
28
 
29
29
  **Per-item posture notes (the consent moment — surface BEFORE running or handing over the apply):**
30
30
 
@@ -39,7 +39,8 @@ A variant's posture note, where its key has one, is printed by `init` from this
39
39
 
40
40
  - `source-size` — the arms differ by what the declared gate IS. **`adopted-elsewhere`** — the gate runs a DIFFERENT real copy of this checker (a vendored deployment): the practice runs, the advisor cannot resolve it as its own sibling, and the realpath anchor does not widen (that stops a lookalike). So the convergence is the ack writer's preview (`--lane source-size-copy` → `sourceSizeCopyAck`), never `--adopt`, which would mint and then be refused by the fill on the declared id. The fingerprint binds the declared claims AS AUTHORED, sorted, not resolved paths, so a second external copy re-fires it. **`id-squatter`** — a gate carries the `source-size` id and is not this checker under any reading: the gate matrix reads as running the size check while it runs none, so it is the user's own step (rename the id, or repoint the cmd at this `--check`). **`unminted`**, for both copies: a gate refusing every run over an authored record (over an absent one the check judges layout alone), attention, and NO acknowledgement silences it; only the verb differs (with the gate declared elsewhere, `--write-baseline`); a line carrying the placeholder takes your own sentence, by the `recipe:` line. **`schema-1`** — the check stops on a minted schema-1 config, so this arm comes first: its `--write-baseline` line carries NO reason (a pinned one would launder a raise; a raise riding the move refuses, and the agent writes that raise's reason from what the run shows, with no question to the user), every run until the move. **`layout`** — on a config with no layout record, the record of the piles already there comes first, as its own item: a no writes nothing and the item returns every run; its `recipe:` line names the branch states, and `source-size.layout` is applied before the `hook-checks` check line runs, whose layout line follows that record. **`piles`** — each recorded pile with no queue row gets one, at the end of the queue's Later bucket; a write the queue's own declared check would refuse is not made and the stated skip says why. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file, so every arm here either records an acknowledgement or hands you an edit — the kit declares nothing on its own.
41
41
  - `gate-hook` — the offer wires the hook on the harness lane: the agent applies it on the chat yes after the check; `init` previews and applies it on the terminal yes as the route the user may take instead. Over a wired hook the key renders the kit item `gate-hook.not-current` instead: the placed hook file is absent or differs from the body the kit writes for it. An older body validates your declaration through its OWN baked copy and goes dark on a key it does not know, such as `lcovProducer` (present, whatever its value), so every gate prompts again with no error anywhere. The agent applies the kit item with no question after the check, whose result names the file with its new digest, and the old one too over a differing file; it writes only the hook file. Risk profile: the offer places a hook file and wires one settings entry; the kit item writes one hook file with the kit's body; the declaration is never touched.
42
- - `enforcement` — copies the bundled runtime files of `references/scripts/` into the kit folder `scripts/agent-workflow/`, then runs the project's own hook installer, which installs the pre-commit hook. The lane is harness: the agent applies the item on the chat yes after the check, whose result shows each script the kit places with its bytes and the installer it runs with its bytes; `init` applies it on the batch terminal yes as the route the user may take instead. The copy is create-only: an existing file stands and nothing is written through a link, and the offer renders only on no Node evidence. The hook invokes `node` directly, so a committer without it on PATH gets a loud failure. The installer refuses to overwrite a pre-commit hook it did not write: an install it refuses removes the scripts this apply copied, and the item is offered again with the installer's output shown; over a pre-commit hook the installer did not write the item is not offered — its skip names the user's own step. Risk profile: local tooling and a Git hook are added on the chat yes after the check, or on init's y.
42
+ - `stage-guard` — the offer wires the guard on the chat yes; over a wired guard, `stage-guard.not-current` writes its file.
43
+ - `enforcement` — copies the bundled runtime files of `references/scripts/` into the kit folder `scripts/agent-workflow/`, then runs the project's own hook installer, which installs the pre-commit hook. The lane is harness: the agent applies the item on the chat yes after the check, whose result shows each copy with its digest and the installer run with one digest of every deployed path; `init` applies it on the batch terminal yes as the route the user may take instead. The copy is create-only: an existing file stands and nothing is written through a link, and the offer renders only on no Node evidence. The hook invokes `node` directly, so a committer without it on PATH gets a loud failure. The installer refuses to overwrite a pre-commit hook it did not write: an install it refuses removes the scripts this apply copied, and the item is offered again with the installer's output shown; over a pre-commit hook the installer did not write the item is not offered — its skip names the user's own step. Risk profile: local tooling and a Git hook are added on the chat yes after the check, or on init's y.
43
44
  - `hook-checks` — the agent applies the item on the chat yes after the check; `init` applies it on the terminal y as the route the user may take instead. Risk profile: future commits stop on the rules check and, where judged, on the size check's findings — lines and layout; over a clone with no pre-commit hook the installer writes its whole hook, so commits also stop on its docs and archive lines.
44
45
  - `attribution` — the agent applies the item on the chat yes after the check, setting one key in the project `.claude/settings.json`; `init` applies it on the terminal y as the route the user may take instead. An existing "includeCoAuthoredBy": false already converges the item unless an "attribution" key sets a commit or PR text; a local-scope override is the user's own edit. Risk profile: one settings key, nothing widened.
45
46
  - `footprint-global` — the agent applies the item on the chat yes after the check, which prints each line it removes; `init` applies it on the terminal y as the route the user may take instead. Another of the user's repositories may rely on the same lines: a no keeps the block, and the item returns at the next run. The apply prints the removed lines as a backup. Risk profile: lines removed from the machine-global excludes file.
@@ -11,14 +11,15 @@ no-process spawn error) that nobody had written into the brief. The list is data
11
11
  renders it, so a retro extends the list instead of a reviewer re-finding a member.
12
12
 
13
13
  **What it reads.** The plan file named by `--plan`, opened as a regular file no-follow through the
14
- kit's capped descriptor read (1 MiB — a plan is capped at 100 lines) with its realpath required
15
- under the realpath of the cwd (the project root the advisor renders the command from; no git is
14
+ kit's capped descriptor read (1 MiB, a bound of its own: a plan file past it is refused at the read in both modes)
15
+ with its realpath required under the realpath of the cwd (the project root the advisor renders the command from; no git is
16
16
  asked): an absolute path outside, a `..` traversal out of it, a symlink leading out, a non-regular file and
17
17
  an over-cap plan each refuse **exit 2** by name — the generator PRINTS row text, so unlike
18
18
  plan-shape-cli's unbounded no-follow read it is bounded. The plan is judged on every rule of plan-shape's structural half (headings, section caps,
19
- row grammar, ids, bytes, lexical containment, sweep form, duplicate paths, the total line, the
20
- acceptance and governing-spec presence rules) over EMPTY facts (`{}` — never undefined); the
21
- facts-bound half — realpath containment and sweep expansion — stays `plan-shape --check`'s. A plan
19
+ row grammar with the old form refused by name, ids, bytes, lexical containment, sweep form, duplicate paths, amendments, the
20
+ acceptance and governing-spec presence rules and the robust-tag rule, which is structural) over facts
21
+ holding only the list's class ids (`{ robustClasses }`); the facts-bound half — realpath containment
22
+ and sweep expansion — stays `plan-shape --check`'s. A plan
22
23
  that fails the structural half is refused, never half-rendered. And the kit's own list through its
23
24
  reader leaf (a list that fails the closed schema is refused by name; the tag grammar is that leaf's
24
25
  `parseRobustTag`, ONE home). Nothing else: no git, no project config, no network.
@@ -46,9 +47,9 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/robustness-brief.mjs --plan <plan> [--row <i
46
47
  4. Where it belongs (procedures.md `plan-execution` step 2): the dispatch brief — delegated or
47
48
  subagent — carries the generated block for every tagged row; the procedures advisor renders the
48
49
  populated command in the plan-execution render. Tag a row by writing `robust:<class>` in its
49
- responsibility sentence; `plan-shape --check` refuses a class id the list does not carry
50
- (`robust-class`) and leaves an untagged row unjudged.
51
- 5. **`--coverage`** judges every valid `create`/`modify` row except `.md`/`.txt` documents and the shipped list itself. A class is PRESENT when the row file's bytes carry a bounded member token of kind env/flag/ref/syscall/errno/argv; `state` is never searched, `uncovered = present − tagged`, delete and absent rows are listed, and sweep rows union every path expanded by `plan-shape-facts`' one glob compiler. Reads use the same 1 MiB capped no-follow primitive. The table exits `0` when covered, `1` with each `row:class:literal` when uncovered, and `2` on a named row-read refusal. Bootstrap: for rows up to the row that lands this mode, apply the rule by hand; thereafter run coverage before every dispatch and before `flow-writer adoption`.
50
+ responsibility sentence; plan-shape's structural rules refuse, in every arm, a tag the grammar
51
+ refuses or a class id the list does not carry (`robust-class`) and leave an untagged row unjudged.
52
+ 5. **`--coverage`** judges every valid `create`/`modify` row except `.md`/`.txt` documents and the shipped list itself. A class is PRESENT when the row file's bytes carry a bounded member token of kind env/flag/ref/syscall/errno/argv; `state` is never searched, `uncovered = present − tagged`, delete and absent rows are listed, and sweep rows union every path expanded by `plan-shape-facts`' one glob compiler. Reads use the same 1 MiB capped no-follow primitive. The table exits `0` when covered, `1` with each `row:class:literal` when uncovered, and `2` on a named row-read refusal or a tag refusal on a row it judges (naming row and class); a structural `robust-class` finding is left to it, so a tag on a document row it skips is not judged here, and any other structural finding still exits `1`. Bootstrap: for rows up to the row that lands this mode, apply the rule by hand; thereafter run coverage before every dispatch and before `flow-writer adoption`.
52
53
 
53
54
  **Honest bounds (stated, accepted):** the tag is the author's claim — the tool cannot know that an
54
55
  untagged row touches git, the reviewer still can; the list names classes and carries only MEASURED
@@ -40,7 +40,7 @@ Run **`node ${CLAUDE_SKILL_DIR}/tools/set-recipe.mjs [--set <activity>.<slot>=<v
40
40
  ```
41
41
 
42
42
  `parallel` is a **flag**, not a recipe: it resolves outside the recipe lattice and is never degraded. Examples: `--set routine.carrier=subagent`, `--set routine.parallel=off`, `--set plan-authoring.author=subagent`, `--set plan-authoring.fold=subagent`. A value outside its slot's list is a **usage** error (`2`) naming the accepted values, never a coercion to a neighbour.
43
- 2. **Preview by default** — prints `current → proposed` for the **changed** slots only, plus the **effective recipe resolved against live carrier readiness** (degradation stated honestly, e.g. *council requested, 1 ready reviewer → runs reviewed until a 2nd backend is ready*; *subagent requested, the executor vehicle is `missing` → runs solo until the vehicle is placed, naming the apply command*). A `parallel` value is reported as requested — a flag has nothing to degrade against. It writes **nothing**. Re-run with **`--write`** to apply (same effective/degradation note — a direct `--write` is never quieter than the preview). `--unset` returns a slot to its computed default (reverting needs no hand-edit either). A no-op `--set` (slot already equals) writes nothing and never re-seeds the onboarding note.
43
+ 2. **Preview by default** — prints `current → proposed` for the **changed** slots only, plus the **effective recipe resolved against live carrier readiness** (degradation stated honestly, e.g. *council requested, 1 ready reviewer → runs reviewed until a 2nd backend is ready*; *subagent requested, the author vehicle for an author slot or the executor for a carry slot is `missing` → runs solo until its vehicle is placed, naming the vehicle and apply command*). A `parallel` value is reported as requested — a flag has nothing to degrade against. It writes **nothing**. Re-run with **`--write`** to apply (same effective/degradation note — a direct `--write` is never quieter than the preview). `--unset` returns a slot to its computed default (reverting needs no hand-edit either). A no-op `--set` (slot already equals) writes nothing and never re-seeds the onboarding note.
44
44
  3. **`--write`** applies via a hardened, atomic write (deployment-gated — refuses to scatter a config into a repo with no `docs/ai`; exclusive-create temp + rename; symlink/TOCTOU-safe; last-writer-wins). It preserves the onboarding note + every untouched slot, normalizing to canonical 2-space JSON.
45
45
  **Standing-consent advisory (after a successful `--write` only, and only when the written config names a `reviewed`, `council` or `delegated` recipe — a solo recipe gets NO advisory):** the upgrade's Recommendations `bridge-tier` item wires the used bridges on its chat yes — the used review wrappers' code-mode allow rules (and agy-review's quoted grounding pre-step rule), the `<wrapper> *` exclusions (`codex-exec *` where an execute slot delegates; it keeps its prompt), the hosts and the state dirs. Plan and diff review modes keep their prompt. State plainly: auto-approving a review wrapper **spends subscription quota without a per-run prompt** — that is exactly what standing consent means here, so it is the maintainer's call. The grounding pre-step writes one scratch facts file, covered by that consent; its rule matches the double-quoted path the procedures advisor renders.
46
46
  4. **Exit codes:** `0` success (an explicit recipe that gracefully degrades is still `0`); `2` usage (a bare/duplicate op, or `--write` with no ops); `1` config error (malformed/unreadable config — the file is left **untouched**, never clobbered) or a write STOP (no deployment / a symlinked config). A `1`/`2` failure is loud; on a malformed config, offer to show the parse error so you can help the user fix the JSON.
@@ -87,9 +87,10 @@ not a configuration you can set today.
87
87
  **The writer — `tools/state-block-hook.mjs`.** The `state-block` advisor item is a harness item:
88
88
  the agent applies it on the chat yes after the danger check, and `init`, run in a console from the
89
89
  project's folder, applies it on the terminal y as the route the user may take instead. Without
90
- `--apply` the writer is a preview that writes nothing; `--apply` writes. It imports the gate-approval
91
- writer's symlink, target and settings-shape checks from `tools/gate-hook.mjs`; its unsafe-mode and
92
- stamp refusals use that writer's error codes:
90
+ `--apply` the writer is a preview that writes nothing; `--apply` writes. It runs on the kit's hook writer
91
+ `tools/hook-writer/index.mjs`, which imports the gate-approval writer's symlink, target and
92
+ settings-shape checks from `tools/gate-hook.mjs`; its unsafe-mode and stamp refusals use that
93
+ writer's error codes:
93
94
 
94
95
  - the runtime goes to `.claude/hooks/state-block-guard.mjs` — created when absent, kept when
95
96
  byte-equal, replaced in place when it differs (the preview says so, and the check's result names
@@ -16,7 +16,7 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/family-registry.mjs --json [--dir <project>]
16
16
  - **recipes** — the effective recipe per slot, **one line per slot** over the six activities (`plan-authoring.author` / `.fold` / `.review`, `plan-execution.execute` / `.review`, `routine.carrier` / `.parallel`, `feedback-triage.review`, `epic.author` / `.review`, `task.author` / `.execute`); each line also carries **where the value came from** (`source` — the project's config, an explicit override, or a computed default) and, when the resolved recipe is not the one that was asked for, **what it degraded from** (`degradedFrom`). Say both in plain words (never the field names): an effective recipe alone cannot tell a deliberate choice from a default, nor a degrade from a config that really names the resolved recipe — and a slot showing `solo` after a degrade from `subagent` is exactly the case the **subagents** line below explains. Detail → `/agent-workflow-kit procedures` / `recipes`; a `recipes.detectError` → say the backends couldn't be checked, so bridge-backed recipes floored at solo; the executor vehicle is unaffected.
17
17
  - **attribution** — `includeCoAuthoredBy` effective; call out a **local override** only when `local` is non-null **and** differs from `project` (a `null` `local` means the key is absent there, so the project value stands — that is not an override).
18
18
  - **velocity** — the effective `permissions.defaultMode` + whether an allowlist is seeded (detail → `/agent-workflow-kit velocity`).
19
- - **subagents** — how many of the kit's subagent vehicles are placed (`agents.placed` of `agents.bundled`; zero placed → the optional `/agent-workflow-kit agents` opt-in), then the **split the line always states separately**: the **read-only vehicles** (`agents.readOnly` — four; none of them grants a shell, three ride a cheap model for mechanical work and one is a read-only review lens) and the **ONE full-tool `executor`**, whose own state is `agents.executor`: *placed* / *customized* (both dispatchable) / *unusable* (`agents.executorReason` carries the reason — say it) / *missing*. That state is what decides whether a slot configured `subagent` can ride it: on **unusable** or **missing** every such slot runs solo instead, so surface it plainly beside the recipes lines and point at `/agent-workflow-kit agents` to place it. It is a claim about the FILE, never about the host. An envelope with no executor state says the installed kit predates the field — say so rather than inventing a state.
19
+ - **subagents** — how many of the kit's subagent vehicles are placed (`agents.placed` of `agents.bundled`; zero placed → the optional `/agent-workflow-kit agents` opt-in), then the **split the line always states separately**: the **read-only vehicles** (`agents.readOnly` — four; none of them grants a shell, three ride a cheap model for mechanical work and one is a read-only review lens), the **author vehicle** (`agents.author`: `placed` / `stale` / `widened` / `unusable` / `missing`; `agents.authorReason` carries the reason — say it), and the **ONE full-tool `executor`**, whose own state is `agents.executor`: *placed* / *customized* (both dispatchable) / *unusable* (`agents.executorReason` carries the reason — say it) / *missing*. Render `<placed>/<bundled> placed — <n> read-only, author <state>[ (<reason>)], executor <state>[ (<reason>)]`. For `subagent` to resolve, author slots need the author vehicle `placed`; carry slots need the executor `placed` or `customized`. Otherwise the slot runs solo, naming its vehicle, so surface the states beside the recipes lines and point at `/agent-workflow-kit agents`. They are claims about the FILE, never the host. For an absent author or executor state render `unknown (the installed kit predates the field)` rather than inventing a state.
20
20
  - **gate hook** — wired / hook file placed / declaration present, plus **`hook.declaredGates`** (0 = absent or an empty list; `null` = present but unreadable → say *couldn't be counted*, never a number; detail → `/agent-workflow-kit hook` and the gates guide).
21
21
  - **bridge knobs** — a settings entry carrying **`retired`** is a key that is CONFIGURED but arms nothing: say so plainly (the reason is in the field) and point at `bridge-settings --unset <KEY> --apply` to clear it. Never render a retired key as an active setting.
22
22
  - Any area's **`error`** field → surface it **loudly** in plain language; the rest of `status` still renders (never a crash).
@@ -42,7 +42,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
42
42
 
43
43
  **What the executor ensure does.** It never writes: a placed `.claude/agents/executor.md` whose bytes differ from the body derived from `docs/ai/vehicles.json` is `pending` and an absent one is `not-placed` — the advisor's `agents` item writes the derived body.
44
44
 
45
- **What the enforcement-script ensure does.** It judges every kit script of the kit folder `scripts/agent-workflow/` — each deployed `*.mjs` of `${CLAUDE_SKILL_DIR}/references/scripts/` but the spec layer's pairs, the test reporter and `run.mjs`, which the spec-layer ensure places first — once the component is accepted: a kit script outside the seed names (memory's own copies) stands in the kit folder as a regular file, or a regular file stands in `scripts/` under the old flat name of the hook installer. Each file by proof, with no question and no copy kept: a shipped prior is refreshed, an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left. The hook installer goes first; a closing line says the commit hook runs the files written. On a declined enforcement offer, a project with Node evidence gets every seed file, the decisions rotator and the modules it imports, kept current (an absent one placed); the run places no other kit script (one line says so) and words that hook-run line as a condition. **The ADR store, after the writes:** where the run judged the rotator, it runs the kit folder's rotator with `--ensure-current`, with no question, which brings the store current (an older layout moved) or writes nothing; its lines are relayed under `ADR store: `. A rotator that does not bring the store current is `failed` / `adr-store-not-current`, the scripts written above staying as written: its refusal stops the upgrade. **The move from the flat layout, the run's last act.** A deployment of an earlier release holds the kit's old files flat in `scripts/` (the names of `PRIOR_FILES` in `${CLAUDE_SKILL_DIR}/tools/script-priors.mjs`). After every write landed and the store run passed, and only while `scripts/agent-workflow/run.mjs` stands, each `scripts/<name>` of those names whose bytes are a body this kit shipped is removed, `scripts/<name>: removed — the kit's scripts live in scripts/agent-workflow/`, when its replacement `scripts/agent-workflow/<path>` stands or it has none (a suite, the test-support file, the gate migration); one whose replacement is not placed yet is kept with its line and waits for the next run, and so is every old file while `run.mjs` does not stand (under `--only scripts` the spec-layer ensure does not place it). A file whose bytes differ from every body this kit shipped is the user's, named and left, never written or removed; a link, a directory, an unreadable file or a failed unlink is named and left. A removal counts as `refreshed`; `--dry-run` removes nothing and prints what would be removed. After a removal the run prints one line per regular `scripts/*.test.mjs` left that is not the kit's (a suite of the user's own, which the kit's hook does not run: wire it with `node --test scripts/<file>` in `scripts/pre-commit.local`); inside a git work tree one `git grep` line over the old names, the kit folder excluded, and its boundary line (the hooks dir and ignored files are the user's to check), outside one a line saying so; and, in a visible deployment, one line to commit `scripts/agent-workflow/`, the removed files and, as the upgrade changed them, `docs/ai/gates.json` and `package.json` as one change, merged into every branch still committed or installed on. **Edit each grep hit in this upgrade:** a `node scripts/<file>` of a kit check becomes `node scripts/agent-workflow/run.mjs <name>` with its arguments; a path of a deployed file becomes `scripts/agent-workflow/<path>`; a suite and the test-support file have no deployed path (a suite of the user's own is the suite line's, and a file of the user's importing the support file keeps a copy under a name of its own); a hit of the gate migration is row 4's registry `gates-migration` command, never a path under the kit folder; a record in `docs/ai/source-size.json` is regenerated by the size check's `--write-baseline`. Edit `package.json`'s scripts in this upgrade too (the documented wiring of `contracts.md`): a `prepare` script fails at Node's cannot-find-module until then. Row 4's migration switches the old gates and the `hook-checks` item switches the managed commit hook. **What stays open:** a no on the hook item leaves every commit stopped at Node's error naming a removed file until the item is applied or `node scripts/agent-workflow/run.mjs install-git-hooks` is run; a gate row 4 keeps is named with its own line and runs as declared until that line is acted on; the hooks dir (another hook of the user's) and ignored files are outside the printed line; a checkout without the kit folder commits under the hook's checkout line and installs through its own old installer, which refuses the clone's name-free hook (exit 1, so a `prepare` there fails) until it takes the move; in a project named `agent-workflow` the new hook carries the old installer's marker, so that installer rewrites the hook to the old paths instead, and every commit of a moved checkout stops at Node's error naming a removed file until `node scripts/agent-workflow/run.mjs install-git-hooks`, run in a moved checkout, writes it back. The suite and grep lines print once, on the run that removed: an upgrade stopped after that run and before these edits finishes them from this paragraph — wire each regular `scripts/*.test.mjs` outside the names of `PRIOR_FILES` as a suite, and search with `git grep -n -F --untracked -e <name> … -- . ':!scripts/agent-workflow'`, one `-e` per name of `PRIOR_FILES`. Where the size practice measures `scripts/`, a write may grow a root past its record: the size check names its own reasoned `--write-baseline`. **Whether Node runs here is PROVEN, never proxied:** Node evidence is a regular root `package.json`, or a regular file, every folder above it a plain directory, at one of the kit's flat script names in `scripts/` or at a deployed path in `scripts/agent-workflow/`; `skipped-no-node-evidence` only when the probe finds none, a line naming every probe it checked, while the config ensures still run; a probe that cannot be read is `failed` with the cause `node-evidence-unverifiable`, nothing written. **A `skipped-*` outcome whose stated reason this tool could itself disprove may not exist**. A deployed pre-commit hook takes a new installer body only when the installer next runs: the `enforcement` check line and apply, by the consent route, re-run it (it refuses a non-marker hook as always); until then `scripts/pre-commit.local` does not run.
45
+ **What the enforcement-script ensure does.** It judges every kit script of the kit folder `scripts/agent-workflow/` — each deployed `*.mjs` of `${CLAUDE_SKILL_DIR}/references/scripts/` but the spec layer's pairs, the test reporter and `run.mjs`, which the spec-layer ensure places first — once the component is accepted: a kit script outside the seed names (memory's own copies) stands in the kit folder as a regular file, or a regular file stands in `scripts/` under the old flat name of the hook installer. Each file by proof, with no question and no copy kept: a shipped prior is refreshed, an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left. Each file follows its imports. A closing line says the commit hook runs the files written. On a declined enforcement offer, a project with Node evidence gets every seed file, the decisions rotator and the modules it imports, kept current (an absent one placed); the run places no other kit script (one line says so) and words that hook-run line as a condition. **The ADR store, after the writes:** where the run judged the rotator, it runs the kit folder's rotator with `--ensure-current`, with no question, which brings the store current (an older layout moved) or writes nothing; its lines are relayed under `ADR store: `. A rotator that does not bring the store current is `failed` / `adr-store-not-current`, the scripts written above staying as written: its refusal stops the upgrade. **The move from the flat layout, the run's last act.** A deployment of an earlier release holds the kit's old files flat in `scripts/` (the names of `PRIOR_FILES` in `${CLAUDE_SKILL_DIR}/tools/script-priors.mjs`). After every write landed and the store run passed, and only while `scripts/agent-workflow/run.mjs` stands, each `scripts/<name>` of those names whose bytes are a body this kit shipped is removed, `scripts/<name>: removed — the kit's scripts live in scripts/agent-workflow/`, when its replacement `scripts/agent-workflow/<path>` stands or it has none (a suite, the test-support file, the gate migration); one whose replacement is not placed yet is kept with its line and waits for the next run, and so is every old file while `run.mjs` does not stand (under `--only scripts` the spec-layer ensure does not place it). A file whose bytes differ from every body this kit shipped is the user's, named and left, never written or removed; a link, a directory, an unreadable file or a failed unlink is named and left. A removal counts as `refreshed`; `--dry-run` removes nothing and prints what would be removed. After a removal the run prints one line per regular `scripts/*.test.mjs` left that is not the kit's (a suite of the user's own, which the kit's hook does not run: wire it with `node --test scripts/<file>` in `scripts/pre-commit.local`); inside a git work tree one `git grep` line over the old names, the kit folder excluded, and its boundary line (the hooks dir and ignored files are the user's to check), outside one a line saying so; and, in a visible deployment, one line to commit `scripts/agent-workflow/`, the removed files and, as the upgrade changed them, `docs/ai/gates.json` and `package.json` as one change, merged into every branch still committed or installed on. **Edit each grep hit in this upgrade:** a `node scripts/<file>` of a kit check becomes `node scripts/agent-workflow/run.mjs <name>` with its arguments; a path of a deployed file becomes `scripts/agent-workflow/<path>`; a suite and the test-support file have no deployed path (a suite of the user's own is the suite line's, and a file of the user's importing the support file keeps a copy under a name of its own); a hit of the gate migration is row 4's registry `gates-migration` command, never a path under the kit folder; a record in `docs/ai/source-size.json` is regenerated by the size check's `--write-baseline`. Edit `package.json`'s scripts in this upgrade too (the documented wiring of `contracts.md`): a `prepare` script fails at Node's cannot-find-module until then. Row 4's migration switches the old gates and the `hook-checks` item switches the managed commit hook. **What stays open:** a no on the hook item leaves every commit stopped at Node's error naming a removed file until the item is applied or `node scripts/agent-workflow/run.mjs install-git-hooks` is run; a gate row 4 keeps is named with its own line and runs as declared until that line is acted on; the hooks dir (another hook of the user's) and ignored files are outside the printed line; a checkout without the kit folder commits under the hook's checkout line and installs through its own old installer, which refuses the clone's name-free hook (exit 1, so a `prepare` there fails) until it takes the move; in a project named `agent-workflow` the new hook carries the old installer's marker, so that installer rewrites the hook to the old paths instead, and every commit of a moved checkout stops at Node's error naming a removed file until `node scripts/agent-workflow/run.mjs install-git-hooks`, run in a moved checkout, writes it back. The suite and grep lines print once, on the run that removed: an upgrade stopped after that run and before these edits finishes them from this paragraph — wire each regular `scripts/*.test.mjs` outside the names of `PRIOR_FILES` as a suite, and search with `git grep -n -F --untracked -e <name> … -- . ':!scripts/agent-workflow'`, one `-e` per name of `PRIOR_FILES`. Where the size practice measures `scripts/`, a write may grow a root past its record: the size check names its own reasoned `--write-baseline`. **Whether Node runs here is PROVEN, never proxied:** Node evidence is a regular root `package.json`, or a regular file, every folder above it a plain directory, at one of the kit's flat script names in `scripts/` or at a deployed path in `scripts/agent-workflow/`; `skipped-no-node-evidence` only when the probe finds none, a line naming every probe it checked, while the config ensures still run; a probe that cannot be read is `failed` with the cause `node-evidence-unverifiable`, nothing written. **A `skipped-*` outcome whose stated reason this tool could itself disprove may not exist**. A deployed pre-commit hook takes a new installer body only when the installer next runs: the `enforcement` check line and apply, by the consent route, re-run it (it refuses a non-marker hook as always); until then `scripts/pre-commit.local` does not run.
46
46
 
47
47
  **What the navigator ensure does.** `docs/ai/index.md` is the always-loaded navigator the entry point declares, and it is GENERATED — no template ships it, so a deployment that never ran the generator boots from a broken entry point (and a Node project's hook fails its index check). The ensure runs the bundled generator's finalizer and reports `regenerated` (it was missing or stale — it was written) or `already-current` (nothing written); under a hook module that is not the bundled one, a write the project's own checker rejects is put back → `customized-preserved`. It never skips a No-Node project: the generator runs from `${CLAUDE_SKILL_DIR}/references/scripts/` on the agent host, not from the project's `scripts/`. **Its position in the run-list is EARLY and therefore NOT authoritative** — the `tier` offer (and, on the migrated path, steps 6–7) may still change `docs/ai` afterwards — so the authoritative run is the LATE `--only index` rung documented at both exits; the early one is idempotent: an untouched tree changes nothing.
48
48
 
@@ -28,7 +28,7 @@ TOKENS — not necessarily its bytes, since `rebasePins` may still rewrite absol
28
28
  file on its own lane — and, where the settings file is readable, well-formed and actually carries
29
29
  tokens, gets a neutral line naming them; orphanhood is claimed only where it is proven.
30
30
 
31
- - `provision <slug> --plan <path> [--as <name>.md] [--dir <path>] [--branch <name>] [--include <path>]... [--install] [--resume]`
31
+ - `provision <slug> --plan <path> [--as <name>.md] [--dir <path>] [--branch <name>] [--include <path>]... [--install] [--resume] [--stage <id>]`
32
32
  — create a feature worktree (default: the visible sibling `<repoParent>/<repoName>--<slug>`,
33
33
  branch `aw/<slug>`) and populate it: the registry-derived footprint copy-if-missing (a tracked
34
34
  file is NEVER overwritten, and `/.mcp.json` is never copied or owned — see below), EXACTLY ONE seeded
@@ -52,6 +52,27 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
52
52
  `--resume <slug>` completes a half-done provision (identity fail-closed; handoff user sections,
53
53
  the seeded plan, and edited copies are preserved byte-exact; the provision-record section is
54
54
  refreshed atomically; copy-if-missing everywhere).
55
+ The record check (spec `kit/plan-approval`): fresh, with `--as` and with `--resume` alike,
56
+ provision acts on ONE plan instance — the plan placed in the worktree when one is placed, else the
57
+ `--plan` source — and proceeds only when that instance matches the worktree's own approval record
58
+ or matches in MAIN (`plan-approval/cli.mjs check`'s match, structure verdict included); a fresh
59
+ provision makes the MAIN match before `git worktree add`, a resume before any provision write.
60
+ When the match is MAIN's, its entry is appended to the worktree's own record as `from:
61
+ provision` once the plan is seeded. With `AW_REVIEW_RECEIPTS` non-empty, fresh provision and
62
+ `--resume` alike refuse at the record check before the first write, naming the variable and
63
+ asking that it be unset. Every other state refuses naming the record command
64
+ (`node <kit>/tools/plan-approval/cli.mjs record <plan> --essence-file <file>`).
65
+ `--stage <id>` (one of the record-gated stages `tests`, `code`, `diff-review`, `split-edits`;
66
+ `tests` when absent; any other id is a usage STOP) names the stage the worktree's slot file
67
+ `docs/plans/next-session.json` carries (spec `kit/stage-render`). Provision composes it with the
68
+ stage renderer's `composeSlotText` and writes it through its own journaled write after the plan is
69
+ seeded and its record carried, before the post-provision verify; it is the journaled surface `slot-file`, a path
70
+ an `--include` may not overlap, and a plans-chain path: tracked, it refuses in both lanes as the
71
+ handoff and the seeded plan do (below). A link or any other non-regular node at its path refuses
72
+ before the first provision write. With `--stage`, `--resume` rewrites the slot
73
+ file; without it, `--resume` writes the `tests` slot file when none is there, keeps one that
74
+ validates, names the placed plan and names a record-gated stage, and refuses any other naming it.
75
+ Every composed retry and fallback command keeps an explicitly given `--stage`.
55
76
  Resume identity also binds the EXISTING handoff: at most one `handoff-<slug>.md` may exist and
56
77
  its recorded slug AND branch must match the live invocation — a second handoff, a name/record
57
78
  mismatch, or a handoff that is not a regular file is a typed STOP before anything is written
@@ -67,7 +88,7 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
67
88
  The post-provision verify is lane-specific:
68
89
  the resume verify proves only what THIS run placed or kept: every journaled leaf must be tracked or ignored in the worktree, an untracked owned leaf or any probe error stops the run naming the exact leaf, and every other path — the session's own work — is never probed and never a stop cause; a first provision keeps the blanket clean-tree verify.
69
90
  The proof list is THIS run's live placement journal — the closed-world placement registry (the
70
- handoff stub, the seeded plan, copy-set leaves, include leaves, the `node_modules` link,
91
+ handoff stub, the seeded plan, the slot file, copy-set leaves, include leaves, the `node_modules` link,
71
92
  `.vscode/settings.json`, the pin-rebase targets, and the record refresh at its already-journaled
72
93
  path), leaf-only (files and symlinks; directories are containers, never proof obligations) and
73
94
  kind-gated: membership requires the live node's kind to match what that lane's SOURCE places, so
@@ -98,7 +119,7 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
98
119
  inode, and kind of the canonical node) BEFORE `git worktree add`, and a root that is neither a
99
120
  regular file nor a directory — or whose identity probe fails — is refused before any mutation.
100
121
  An include that overlaps a path provision itself populates (the frozen registry footprint, the
101
- seeded plan, the handoff) or another include root is refused pre-mutation too — an overlapped
122
+ seeded plan, the handoff, the slot file) or another include root is refused pre-mutation too — an overlapped
102
123
  destination would meet the copy-if-missing kept-exit and skip the identity door. On a FRESH
103
124
  (non-resume) provision an include destination that already exists at walk time is a fail-closed
104
125
  STOP (nothing legitimate pre-populates it — filesystem aliasing the overlap compare missed is
@@ -131,8 +152,10 @@ tokens, gets a neutral line naming them; orphanhood is claimed only where it is
131
152
  NAMED as a divergence beside the live one, with the cause its own source makes likely (a moved MAIN
132
153
  or a hand edit for the MAIN-derived pair; a changed dependency declaration for the install
133
154
  posture), and a field an earlier kit never wrote is no divergence at all. Every command the prompt
134
- offers is a marked line naming WHO runs it: `MAIN $ …` for the landing, `HERE $ …` for this
135
- checkout's own install — including the removal of a provisioned `node_modules` symlink, which is
155
+ offers is a marked line naming WHO runs it: `MAIN $ …` for the landing, `HERE $ …` for the render
156
+ command of this checkout's slot file (`node <kit>/tools/stage-render/cli.mjs
157
+ docs/plans/next-session.json` with `<kit>` resolved, the command the satellite session runs first)
158
+ and for this checkout's own install — including the removal of a provisioned `node_modules` symlink, which is
136
159
  runnable even where the install command itself is not derivable. A posture with nothing to run
137
160
  stays prose, and the recorded posture string is never printed loose: it IS a command in the
138
161
  ordinary case, and an unattributed one reads as an instruction. A `node_modules` symlink is
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  type: rules
3
- lastUpdated: 2026-10-28
3
+ lastUpdated: 2026-11-25
4
4
  scope: permanent
5
5
  staleAfter: never
6
6
  owner: kit
@@ -11,4 +11,4 @@ maxLines: 30
11
11
 
12
12
  The kit block of AGENTS.md is the kit's and is rewritten on every upgrade; it and docs/ai/rules/effective/ govern over any copy of kit text elsewhere in this project's files; text of your own goes outside the block, and a change to a kit rule goes in its theme's file under docs/ai/rules/local/.
13
13
 
14
- A story — one row of an epic's ledger, carried by one plan — runs as four sessions, each step in them giving one checked result: **spec and plan** (every contract the story creates or revises and the plan's ledger beside them, checked by the spec gate, the plan-shape gate and one review of at most two rounds that reads both, then the plan's approval), **tests** (only tests, each new one failing for the reason its scenario or acceptance bullet states, or on the absence of a name the plan adds, imported inside the test; no code and no prototype), **code** (code until the tests and the pre-review gates pass; a wrong test is changed only back to what its scenario states), and **diff review, release and record** (every committable output, tracked records included, staged first, the review of the staged diff in at most two rounds, the final gates and the release where the story ships one, then the plan's Phase: Cleanup). Tests and code never share a session. A storyless plan runs the same four. **Exception — a split:** moving code and its existing cases into modules, with no new logic and no new case, is one session: a short spec (the Module list), the split, the diff review, the release, Cleanup. A bridge executor gets a task only when it writes new tests or code, from one prompt of the orchestrator; a file the orchestrator already wrote is laid down by the orchestrator, never relayed through a bridge.
14
+ A story — one row of an epic's ledger, carried by one plan — runs as four sessions, each step in them giving one checked result: **spec and plan** (every contract the story creates or revises and the plan's ledger beside them, checked by the spec gate, the plan-shape gate and one review of at most two rounds that reads both, then the plan's approval, recorded on the yes; no code, no test, no copy of the tree and no trial suite), **tests** (only tests, each new one failing for the reason its scenario or acceptance bullet states, or on the absence of a name the plan adds, imported inside the test; no code and no prototype), **code** (code until the tests and the pre-review gates pass; a wrong test is changed only back to what its scenario states), and **diff review, release and record** (every committable output, tracked records included, staged first, the review of the staged diff in at most two rounds, the final gates and the release where the story ships one, then the plan's Phase: Cleanup). Each session starts from its stage's kit template, rendered by the one line under the handover's Next session, or in a linked work tree by its start prompt's command; an epic session and a design consult, like the spec and plan session, write no code and no test, copy no tree and run no trial suite. Tests and code never share a session. A storyless plan runs the same four. **Exception — a split:** moving code and its existing cases into modules, with no new logic and no new case, is one session in two parts: its Module list, approved and recorded like any plan, with no code and no test, then the split, the diff review, the release, Cleanup. A bridge executor gets a task only when it writes new tests or code, from one prompt of the orchestrator; a file the orchestrator already wrote is laid down by the orchestrator, never relayed through a bridge.
@@ -36,7 +36,7 @@ export const CAP_TABLE = Object.freeze({
36
36
  // grows again, so its stamp is a fact about that month, not a forecast.
37
37
  cold: Object.freeze({
38
38
  floor: 1500,
39
- ceiling: 3000,
39
+ ceiling: 4000,
40
40
  remedy: 'compress that month harder — it is already one file per month, and sub-month sharding is NOT implemented (discovery matches YYYY-MM.md only, so a hand-split file would drop out of the corpus)',
41
41
  }),
42
42
  // WARM — docs/ai/history/recent.md: a rolling window of full-text entries, the widest tier.