@sabaiway/agent-workflow-engine 1.16.0 → 2.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.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,39 @@
2
2
 
3
3
  All notable changes to the methodology engine. Versions are this **package's** npm versions;
4
4
  they are distinct from the **deployment-lineage** stamp written into a project's `docs/ai/`
5
- (which tracks the shared `agent-workflow` lineage, head `2.0.0`).
5
+ (which tracks the shared `agent-workflow` lineage, head `3.0.0`).
6
+
7
+ ## 2.0.0 — strip-the-kit: the planning canon teaches the computed loop (AD-059)
8
+
9
+ > ### ⚠ BREAKING — the §9 "Computed instrument" canon is rewritten
10
+ >
11
+ > The review-ledger/fold-completeness vocabulary is gone from the methodology. The loop the canon
12
+ > now teaches: red-proof BEFORE a fix (`core-evidence red-proof`) · explicit per-backend degrade
13
+ > records · stage → reviews on the STAGED tree → `run-gates --final` (the ONE receipt) →
14
+ > `commit-guard --check` at the commit boundary — **no ledger records it**; the round
15
+ > tally/classification discipline stays dialogue-level.
16
+
17
+ - `planning.md` §9 rewritten to the D3 loop; `procedures.md` step 5 mirrors it; the
18
+ `orchestration.md` writer-economy clause reworded (the ledger-triad example died with the
19
+ machinery).
20
+ - The agent-rules LENS reworded in its canonical home; the OUTGOING pre-strip body is appended to
21
+ `agent-rules-lens-priors.md` verbatim (the AD-041 vintage contract — priors are append-only
22
+ history).
23
+
24
+ ## 1.17.0 — Prompt-economy canon gains a writer-batch clause + two sandbox-lane sentences (REPORT-FACTS train D5/D6, AD-054)
25
+
26
+ A **feature** release (ships with kit 1.47.0 / memory 2.3.0 / bridges 2.7.0+2.6.0). The cost-lanes
27
+ canon (`references/orchestration.md` §5) and the agent-rules lens gain:
28
+ - **Writer economy** — a stage's repeated WRITER commands batch into ONE invocation (the review-ledger
29
+ triad rides one batched write, other stage writers combine via one launcher per stage); never one
30
+ writer call at a time. Rendered on all three prompt-economy surfaces (orchestration §5, the lens
31
+ fragment, the kit cost-lanes advisor), the lens re-rendered into both templates, and the outgoing
32
+ lens body appended to the append-only prior store.
33
+ - **Sandbox lanes** — two sentences under the sandbox-lanes block: (i) a **pre-dispatch host-diff**
34
+ (before the first dispatch of each bridge, diff its manifest `networkHosts` against the live sandbox
35
+ allow-list — a missing host is surfaced to the maintainer, never fired into a known prompt); (ii)
36
+ **nested-sandbox honesty** (a backend CLI shipping its own OS sandbox cannot run nested inside a
37
+ harness sandbox — route it outside on the OBSERVED failure, never a preemptive blanket).
6
38
 
7
39
  ## 1.16.0 — Prompt-economy canon: the cost lanes learn autonomy-preserving dispatch (REC-UX-REWORK D7, AD-053)
8
40
 
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-engine
3
3
  description: Canonical home of the agent-workflow planning methodology — the Plan→Phase→Step→Substep vocabulary, plan lifecycle, queue.md series index, mandatory Cleanup phase, the bounded methodology slot fragment, the orchestration-recipe vocabulary (Solo / Reviewed / Council / Delegated), and the activity-procedures canon (plan-authoring / plan-execution, with typed recipe slots). A published, installable npm package (available:true) that *provides* the methodology text; it mutates nothing. The composition root (agent-workflow-kit) reads this canon LIVE from the installed engine and injects the bounded slots from it — one source of truth, no bundled mirror; `npx @sabaiway/agent-workflow-kit@latest init` installs the engine.
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '1.16.0'
6
+ version: '2.0.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-engine
package/bin/install.mjs CHANGED
@@ -14,7 +14,7 @@
14
14
  // not a project deploy and not a model-invoked skill — there is nothing to "run"
15
15
  // inside an agent.
16
16
  //
17
- // No telemetry, no phone-home. Dependency-free, Node >= 18.
17
+ // No telemetry, no phone-home. Dependency-free, Node >= 22.
18
18
 
19
19
  import { readFile, mkdir, readdir, copyFile, lstat, readlink, symlink } from 'node:fs/promises';
20
20
  import { existsSync, lstatSync, realpathSync } from 'node:fs';
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-engine",
5
5
  "kind": "methodology-engine",
6
- "version": "1.16.0",
6
+ "version": "2.0.0",
7
7
  "available": true,
8
8
  "provides": ["plan"],
9
9
  "roles": {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-engine",
3
- "version": "1.16.0",
3
+ "version": "2.0.0",
4
4
  "description": "Canonical home of the agent-workflow planning methodology — the Plan→Phase→Step vocabulary, plan lifecycle, queue.md series index, and mandatory Cleanup phase, consumed by the kit (composition root). The methodology engine of the agent-workflow family.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -40,7 +40,7 @@
40
40
  "references/"
41
41
  ],
42
42
  "engines": {
43
- "node": ">=18"
43
+ "node": ">=22"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
@@ -93,3 +93,37 @@ Apply these when authoring a plan, reviewing, folding a finding, or editing code
93
93
  - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
94
94
  - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
95
95
  - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation.
96
+
97
+
98
+ <!-- prior: 2026-07-13 (AD-054) → pre-writer-economy outgoing — the fragment as of the writer-batch clause landing (provenance intro + cost lanes + prompt-economy, no writer-economy) -->
99
+ ### 2.x. Planning, review & process-fidelity invariants
100
+ Apply these when authoring a plan, reviewing, folding a finding, or editing code — the layer read **before any code change**. (Full canon: the project's planning / workflow-methodology + orchestration canon. This section is rendered from that canon and refreshed on upgrade; a custom edit is preserved verbatim, but flagged.)
101
+ - **Fold by code, not prose.** Before folding a code-touching finding into a plan or change, read the cited `file:line` and cite it — a prose fold drifts from the code and seeds the next bug.
102
+ - **Right altitude.** Pin intent + invariants + acceptance criteria (named tests); leave fine code-mechanics to Execute, where prose cannot diverge from reality.
103
+ - **No code-mechanics in the plan.** A Step still carries its exact paths + commands (the plan-structure / self-review canon) — checked syntax: the plan's own Verification runs them against an explicit expected outcome or gate; the only other syntax a plan may carry is a literal fixture/schema fragment a named test copies or validates. Un-run, logic-bearing syntax — control-flow, a regex, a glob, a grammar, an algorithm body, a mini-DSL — never lives in plan prose, however plausible or shell-verified it looks: a fold or draft that wants one is the trigger to write the test instead.
104
+ - **Test-as-spec.** Fold a code-touching finding into a red→green TEST, not a prose paragraph — the gate is the only deterministic checker; a paragraph cannot self-check.
105
+ - **Characterize-first.** Before editing UNCOVERED code, pin its current behavior in a green test, then edit — any unintended change goes red. Never edit what has no checker; first give it one. Keep edits atomic/reversible; prefer SUBTRACTIVE folds.
106
+ - **Fold minimally — prose has no checker.** An ephemeral, gitignored plan is prose with no executable checker; fold **minimally, in ONE place** and run a **self-consistency** read across the plan before every re-review — a fold that drifts several prose spots is what turns a 2-round review into churn.
107
+ - **Heavy review at the diff.** Plan-review settles architecture only (≤2 rounds, stop at the pre-existing→fold-induced crossover); the exhaustive per-Step review runs against real compiling code + the full suite, where a regression fails a gate immediately. **Backend divergence** (one backend grounded-ships while another keeps revising mechanics) IS that crossover — resolve at altitude, don't exhaust the strictest backend; route an all-mechanics/CI or prose-only artifact to a **thin plan + diff-review**.
108
+ - **Convergence bar.** A review loop is CLEAN only when one round returns **0 blockers + 0 majors** from EVERY backend the recipe names (nits + a ship verdict is the stop). Folding ≠ convergence — re-review after folding.
109
+ - **Per-round emission.** Every review round emits **{round N · finding-origin tally · per-backend verdict}** so the crossover is a computed, visible signal, not a remembered rule.
110
+ - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
111
+ - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
112
+ - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop.
113
+
114
+
115
+ <!-- prior: 2026-07-17 (strip-the-kit) → pre-strip outgoing — the fragment as of the strip landing (the writer-economy clause still named the ledger-triad batched write) -->
116
+ ### 2.x. Planning, review & process-fidelity invariants
117
+ Apply these when authoring a plan, reviewing, folding a finding, or editing code — the layer read **before any code change**. (Full canon: the project's planning / workflow-methodology + orchestration canon. This section is rendered from that canon and refreshed on upgrade; a custom edit is preserved verbatim, but flagged.)
118
+ - **Fold by code, not prose.** Before folding a code-touching finding into a plan or change, read the cited `file:line` and cite it — a prose fold drifts from the code and seeds the next bug.
119
+ - **Right altitude.** Pin intent + invariants + acceptance criteria (named tests); leave fine code-mechanics to Execute, where prose cannot diverge from reality.
120
+ - **No code-mechanics in the plan.** A Step still carries its exact paths + commands (the plan-structure / self-review canon) — checked syntax: the plan's own Verification runs them against an explicit expected outcome or gate; the only other syntax a plan may carry is a literal fixture/schema fragment a named test copies or validates. Un-run, logic-bearing syntax — control-flow, a regex, a glob, a grammar, an algorithm body, a mini-DSL — never lives in plan prose, however plausible or shell-verified it looks: a fold or draft that wants one is the trigger to write the test instead.
121
+ - **Test-as-spec.** Fold a code-touching finding into a red→green TEST, not a prose paragraph — the gate is the only deterministic checker; a paragraph cannot self-check.
122
+ - **Characterize-first.** Before editing UNCOVERED code, pin its current behavior in a green test, then edit — any unintended change goes red. Never edit what has no checker; first give it one. Keep edits atomic/reversible; prefer SUBTRACTIVE folds.
123
+ - **Fold minimally — prose has no checker.** An ephemeral, gitignored plan is prose with no executable checker; fold **minimally, in ONE place** and run a **self-consistency** read across the plan before every re-review — a fold that drifts several prose spots is what turns a 2-round review into churn.
124
+ - **Heavy review at the diff.** Plan-review settles architecture only (≤2 rounds, stop at the pre-existing→fold-induced crossover); the exhaustive per-Step review runs against real compiling code + the full suite, where a regression fails a gate immediately. **Backend divergence** (one backend grounded-ships while another keeps revising mechanics) IS that crossover — resolve at altitude, don't exhaust the strictest backend; route an all-mechanics/CI or prose-only artifact to a **thin plan + diff-review**.
125
+ - **Convergence bar.** A review loop is CLEAN only when one round returns **0 blockers + 0 majors** from EVERY backend the recipe names (nits + a ship verdict is the stop). Folding ≠ convergence — re-review after folding.
126
+ - **Per-round emission.** Every review round emits **{round N · finding-origin tally · per-backend verdict}** so the crossover is a computed, visible signal, not a remembered rule.
127
+ - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
128
+ - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
129
+ - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop. **Writer economy:** a stage's repeated WRITER commands batch into ONE invocation — the review-ledger triad rides one batched write, other stage writers combine via one launcher per stage; never one writer call at a time (each write is its own prompt).
@@ -11,4 +11,4 @@ Apply these when authoring a plan, reviewing, folding a finding, or editing code
11
11
  - **Per-round emission.** Every review round emits **{round N · finding-origin tally · per-backend verdict}** so the crossover is a computed, visible signal, not a remembered rule.
12
12
  - **Recipe fidelity.** Council runs every backend the recipe names, **every round**; silently dropping a ready backend for quota/convenience is a forbidden downgrade — an unavailable backend is a LOUD, stated degrade, never a quiet drop.
13
13
  - **ExitPlanMode ≠ execute.** A harness "approved — start coding" prompt authorizes the PLAN only; this methodology overrides it. Continue into execution only as a DELIBERATE transition after the plan + cold-start prompt exist, never an implicit slide.
14
- - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop.
14
+ - **Cost lanes.** Route every step to the **cheapest adequate executor** — L0 deterministic script (the batched gate matrix over `gates.json`, the rotation `--check`s) · L1 cheap subagent (extraction/drafting only; the orchestrator verifies) · L2 subscription bridge · L3 frontier judgment. A step with **no named guardrail does not move down** a lane, and the **red lines never move down** (council review models · real code · ADR/handover/changelog-entry wording · persuasive copy · go/no-go · the approval asks). Own-error repair: salvage recorded state first (L0/L1, batched), never frontier re-derivation. **Prompt economy:** read-only fan-out (research/sweeps/extraction) runs ONLY on restricted-tool vehicles — a full-tool subagent for read-only work is a forbidden lane downgrade (invisible prompt-flood + blast radius), and a subagent is never told to shell out for facts obtainable read-only; the orchestrator's own shell form is ONE plain pipeline per call (a `;`/`&&` chain or env-prefixed invocation never matches a prefix allow rule); a fan-out launcher that gates per call yields to the agent-spawn lane — capability-gated: without restricted-tool vehicles (generic full-tool spawning does not count), read-only research stays in the orchestrator's own context, never a vehicle mandate a host cannot satisfy. Judgment, code, synthesis stay at the frontier lane (a task that genuinely runs/writes keeps a full-tool subagent); honest limit: no deterministic gate classifies a dispatch — canon at the point of use + placed vehicles + the retro loop. **Writer economy:** a stage's repeated WRITER commands batch — evidence declarations ride consecutive plain invocations of ONE allow-listed tool, other stage writers combine via one launcher per stage; never an unbatched writer scatter (each gated write is its own prompt).
@@ -143,19 +143,27 @@ zero-prompt bar prefer the agent-spawn lane with placed vehicles. This clause is
143
143
  **capability-gated** (route by what the host HAS): on a harness with restricted-tool subagent
144
144
  vehicles, use them; WITHOUT restricted-tool vehicles — whether or not generic full-tool spawning
145
145
  exists — read-only research stays in the orchestrator's own context —
146
- never a vehicle mandate a host cannot satisfy. The clause narrows
146
+ never a vehicle mandate a host cannot satisfy. **(d)** a stage that fires repeated WRITER commands
147
+ batches them — a stage's evidence declarations (red-proofs, degrades) ride consecutive plain
148
+ writer invocations of ONE allow-listed tool, and the remaining stage writers combine via one
149
+ launcher per stage; never an unbatched writer scatter (each gated write is its own prompt). The clause narrows
147
150
  TOOLS for read-only work only — judgment, code, and synthesis stay at the frontier lane, and a
148
151
  task that genuinely needs to run or write keeps a full-tool subagent. **Honest limit:**
149
152
  no deterministic gate classifies a dispatch — enforcement is this canon at the point of use,
150
153
  the placed vehicles, and the retro loop.
151
154
 
152
155
  **Sandbox lanes.** Under an OS sandbox the lanes split once more by **surface class**: the L0
153
- surfaces are **sandbox-safe** (gate/ledger/state/fold checks, git reads, plain no-network tests);
156
+ surfaces are **sandbox-safe** (gate/state/coverage checks, git reads, plain no-network tests);
154
157
  the bridge wrappers are **genuinely unsandboxed** (they need network); npm-cache-touching commands
155
158
  are **COMMAND-SHAPE dependent** — first try the sandbox-safe shape (cache under `$TMPDIR`,
156
159
  offline/notifier off) before moving anything out. Two driving rules: **move ONLY the failing
157
160
  command out of the sandbox, never its class**, and **BATCH consecutive unsandboxed calls** — a
158
- blanket unsandbox after one failure is the canonical over-reaction.
161
+ blanket unsandbox after one failure is the canonical over-reaction. **Pre-dispatch host-diff:**
162
+ before the FIRST dispatch of each bridge, diff its manifest `networkHosts` against the live
163
+ sandbox's allowed hosts — a missing host is surfaced to the maintainer BEFORE dispatching, never
164
+ fired into a known prompt. **Nested-sandbox honesty:** a backend CLI that ships its OWN OS sandbox
165
+ cannot run nested inside a harness sandbox — route it outside (an excluded command / a per-run
166
+ consented bypass) on the OBSERVED failure, never a preemptive blanket.
159
167
 
160
168
  **Incident repair (your own error) defaults down-lane:** salvage recorded state first (journals,
161
169
  transcripts, git), replay it deterministically (L0), hand the leftovers to L1 in one batch —
@@ -133,7 +133,7 @@ These disciplines keep a plan converging instead of churning, and keep a fold or
133
133
 
134
134
  **Convergence heuristic.** When a review round keeps finding code-mechanism issues on a stable architecture, STOP refining prose — either raise the spec to invariant + acceptance altitude, or hand the mechanics to Execute. Do not re-litigate code mechanics in the plan.
135
135
 
136
- **Computed instrument (plan-execution).** The **review-ledger** computes the crossover-stop for the plan-execution (code) loop: each round and each triage classification **fixable-bug** (a fold pinned by a red→green test) / **inherent-layer-residual** (raised to an acceptance criterion) / **escalate** (a maintainer decision) is recorded, and the stop decision is READ from the ledger, never remembered; its `--check` is the loop's gate (the exit contract lives in the tool's own header — point, don't restate). The same per-round tally + classification discipline governs plan-authoring review; the ledger itself is plan-execution-scoped.
136
+ **Computed instrument (plan-execution).** The plan-execution (code) loop's stop is READ from the four deterministic checks + the ship receipts, never remembered: declare each bugfix red BEFORE the fix (`core-evidence red-proof` an observed N/N red with content custody); an unavailable review backend gets an explicit `core-evidence degrade` record, never a silent skip; then stage everything, run the configured reviews on the STAGED tree, and mint the ONE receipt with `run-gates --final` (coverage of every changed executable line + red-proof verification ride the final run); `commit-guard --check` gates the commit against that receipt — any later edit re-stales it (the exit contracts live in each tool's own header — point, don't restate); `core-evidence summary` renders the loop state statelessly. The per-round finding-origin tally + triage classification discipline **fixable-bug** (a fold pinned by a red→green test) / **inherent-layer-residual** (raised to an acceptance criterion) / **escalate** (a maintainer decision) — stays the dialogue-level discipline for BOTH activities; no ledger records it.
137
137
 
138
138
  ## 10. Autonomy at the plan checkpoints
139
139
 
@@ -116,9 +116,10 @@ Execute an approved plan Step by Step; each Step is one logical commit.
116
116
  **{round N · finding-origin tally · per-backend verdict}**; when backends diverge, that is the
117
117
  crossover — resolve at altitude, not by exhausting the strictest backend. Classify survivors at the
118
118
  cap the same way (**fixable-bug / inherent-layer-residual / escalate**). This loop's computed
119
- instrument is the **review-ledger**: record each round + triage, read the stop from its `--status`
120
- render (it replaces the hand-composed tally), and wire `review-ledger --check` as the gate the
121
- exit contract lives in the tool's own header, never restated here.
119
+ instruments: `core-evidence red-proof` declares each bugfix red BEFORE the fix; `core-evidence
120
+ degrade` records an unavailable backend explicitly; the reviews run on the STAGED tree and
121
+ `run-gates --final` mints the ONE receipt `commit-guard --check` gates the commit against — the
122
+ exit contracts live in each tool's own header, never restated here.
122
123
  6. **Gates** — run the project's verification gate (tests + checks) to green before committing.
123
124
  7. **Commit boundary** — the orchestrator makes the single commit for the Step; a backend never
124
125
  commits. The project's commit-approval policy (e.g. ask first) lives in the project's own rules.