@sabaiway/agent-workflow-kit 21.0.0 → 22.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
@@ -4,6 +4,52 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
4
4
  is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
5
5
  every `migrations/<version>-<slug>.md` newer than it, in semver order.
6
6
 
7
+ ## 22.0.0 — a red unit-test gate prints only its failures, through one gate form the upgrade moves you to (AD-221)
8
+
9
+ **A failing unit-test gate now prints a few lines per failing test instead of the whole test log.** The kit's
10
+ unit-test gate runs through the stable command, `node scripts/agent-workflow/run.mjs unit-tests <your test paths>`,
11
+ and its new test reporter prints, for each failing test only, the file and line, the test's names, why it failed,
12
+ the expected and actual values and the code line, then one totals line. Your next `/agent-workflow-kit upgrade` moves
13
+ a gate an earlier kit wrote with no question; the one thing that step asks is whether to add the coverage check.
14
+
15
+ - **The kit test reporter.** `scripts/agent-workflow/test-reporter/reporter.mjs` reads only the Node test runner's
16
+ events: a passing test, a suite heading and the coverage table print nothing; a file that failed to load prints its
17
+ error line; on a red run, each diagnostic prints one line, so a red run never reads green; a part it cannot render
18
+ prints one line and the run goes on. It never throws, and the gate's exit code stays the runner's. The upgrade's
19
+ `configs` step places it with `run.mjs` on every deployment with Node evidence, even after a no to the enforcement
20
+ scripts.
21
+ - **One gate form.** The command's sixth name, `unit-tests`, runs `node --test` with the lcov reporter under
22
+ `AW_GIT_DIR` and the kit reporter on stdout, every argument handed to the runner; it refuses an unset or empty
23
+ `AW_GIT_DIR` by name. It is the one form that reads as a coverage producer, bare or behind the verified per-PM
24
+ `exec` wrapper; `lcovProducer: true` is still the other way.
25
+ - **The move, with no question.** The upgrade's `gates-migration` step now runs the migration with `--apply`: it
26
+ switches every gate an earlier kit wrote (`node --test` with its reporter flags, under any id, marked or not) to the
27
+ command with the same test paths, and extends the unmarked `unit-tests` gate written as `node --test <paths>`, the
28
+ kit's or your own, to it; every gate it moves or removes prints with its `was:`, and a second run writes nothing. A gate whose
29
+ tail carries a flag is reported CUSTOMIZED with the command's line as its recovery; a gate the kit never wrote is
30
+ never touched. The extended gate writes an lcov, so a coverage checker you declared over no producer reads it: a
31
+ plain run that read green can read red after the move.
32
+ - **The coverage check stays optional.** Where a gate produces the lcov and no checker is declared, the step adds
33
+ nothing and prints one `OFFER coverage-check` line with its own `--apply --add-checker` command, which the agent runs
34
+ only on your explicit yes; the offer comes back on each upgrade until then. A row of yours already holding the id
35
+ `coverage-check` withholds only that add, with one line, and stops no move.
36
+ - **A retired check leaves only when its file is gone.** A `review-ledger` or `fold-completeness` gate is removed only
37
+ when its target is proven absent; a target that is a file, a directory or a link, or a `~` or `$` token, keeps the
38
+ gate CUSTOMIZED.
39
+ - **One guard on every write.** The fill and the migration write the form only while
40
+ `scripts/agent-workflow/run.mjs` is byte-equal to the running kit's and the reporter is a regular file; otherwise the
41
+ fill withholds its `node --test` script and the migration keeps the gate, each with one line naming the path and the
42
+ upgrade (a directory or a link there is cleared by hand first).
43
+ - **A kept earlier gate is named, not silent.** It still runs, with the full runner log, but no longer reads as a
44
+ producer. Every coverage-checker line, in the migration, the fill, the `no-producer` defect and the advisor's
45
+ `gates-inert` item, states one fact (`no gate before it is a producer this kit reads`; the lines that withhold the
46
+ checker: `no declared gate is a producer this kit reads`) and one remedy; why a gate was
47
+ kept rides that gate's own line, and the line of a gate the guard keeps ends that once its cause is resolved, the
48
+ upgrade moves it with no question.
49
+ Where an earlier kit's gate the upgrade can move stands, the defect and the advisor name `/agent-workflow-kit upgrade`.
50
+ - **Breaking, for tools reading the kit's exports.** `coverage-producer.mjs` drops `UNIT_TESTS_COVERAGE_FLAGS` and
51
+ `KNOWN_COVERAGE_FLAG_SETS`; `COVERAGE_PRODUCER_BODY` is now the command body.
52
+
7
53
  ## 21.0.0 — the kit's scripts live in one folder, `scripts/agent-workflow/`, run through one stable command (AD-220)
8
54
 
9
55
  **Your project's `scripts/` stops being a pile of kit files.** Every kit script now lives in one folder the kit alone
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-kit
3
3
  description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '21.0.0'
6
+ version: '22.0.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-kit
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-kit",
5
5
  "kind": "composition-root",
6
- "version": "21.0.0",
6
+ "version": "22.0.0",
7
7
  "provides": [],
8
8
  "roles": {},
9
9
  "detect": {
@@ -14,12 +14,13 @@ loudly, never silently.
14
14
  ## Steps
15
15
 
16
16
  1. **Node floor:** ensure Node **>= 22** (the built-in lcov reporter the loop consumes).
17
- 2. **Gates declaration:** preview the consented migration —
18
- `node <installed-kit>/references/scripts/migrate-gates.mjs --kit-tools <installed-kit>/tools --cwd <project>`
19
- — then re-run with `--apply` on an explicit yes. It removes retired ledger/fold gates,
20
- wires the lcov reporters into the canonical `unit-tests` cmd, appends the canonical
21
- `coverage-check` gate LAST, and cleans retired git-dir stores. CUSTOMIZED entries are
22
- reported with a paste-ready recovery — resolve them by hand.
17
+ 2. **Gates declaration:** the upgrade's `gates-migration` step runs the migration with no question —
18
+ `node <installed-kit>/references/scripts/gates/migrate-gates.mjs --kit-tools <installed-kit>/tools --cwd <project> --apply`.
19
+ It removes a retired ledger/fold gate whose target is proven absent, moves the canonical
20
+ `unit-tests` cmd onto the stable kit command, moves a declared `coverage-check` gate LAST, and
21
+ cleans retired git-dir stores; it adds the canonical checker only on the user's yes, through
22
+ its printed `--apply --add-checker` line. CUSTOMIZED entries are reported with a paste-ready
23
+ recovery — resolve them by hand.
23
24
  3. **Review receipts:** receipts minted by pre-3.0.0/4.0.0 bridge wrappers carry no `posture`
24
25
  field and STOP satisfying the review-state gate (fail-closed, the probe-marker precedent).
25
26
  Refresh the placed bridges (init/upgrade does this), then re-run the required reviews.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-kit",
3
- "version": "21.0.0",
3
+ "version": "22.0.0",
4
4
  "description": "Portable, cross-agent memory & workflow for AI coding agents — Claude Code, Codex, Cursor, Devin Desktop. One command deploys an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement into any repo.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -13,7 +13,7 @@
13
13
  | sandbox-provision.installable | user | user step |
14
14
  | review-recipe | user | user step |
15
15
  | gates-declaration | chat | gates-init.mjs |
16
- | gates-inert | chat | gates-init.mjs |
16
+ | gates-inert | chat | gates-init.mjs, upgrade |
17
17
  | gates-inert.unfillable | user | user step |
18
18
  | gates-inert.no-verification | chat | gates-init.mjs |
19
19
  | gates-inert.producer-unrecognized | user | user step |
@@ -110,7 +110,8 @@ Also the kit's: the onboarding note of `docs/ai/orchestration.json`, its `_READM
110
110
  upgrade with no question and no copy kept, every recipe kept; a note of your own goes in AGENTS.md, outside the kit
111
111
  block's two workflow:kit comment lines.
112
112
  A declaration seeded once from a template and never
113
- replaced by the upgrade's ensures (a migration rewrites one only on the user's explicit yes) is the
113
+ replaced by the upgrade's ensures (the gates migration moves an earlier kit's gates with no
114
+ question and adds the coverage checker only on the user's yes) is the
114
115
  user's own file. A customization goes into one of nine channels instead:
115
116
 
116
117
  - **Your own commit checks** go in the local hook file `scripts/pre-commit.local`: the managed
@@ -25,9 +25,9 @@ Declared gates can also be **auto-approved** (no permission prompt on a byte-exa
25
25
 
26
26
  **Candidate lines — the kit's own checkers (opt-in, one consented verb).** `control-bytes`, `plan-shape`, `spec-check`, `spec-coverage` and `project-rules` can each be declared as a gate of your project: `node ${CLAUDE_SKILL_DIR}/tools/checker-gates.mjs --cwd <project>` previews them and writes nothing. Each is offered only over a state where its checker runs by design: `control-bytes` over a `.git` directory or gitfile at the project root, `plan-shape` and `project-rules` on any deployment, `spec-check` over a regular `docs/ai/specs/index.md`, `spec-coverage` over a regular `docs/ai/spec-coverage.json` beside that store root. An offered checker prints its paste-ready entry line; the upgrade's `tier` ask writes the offered entries on your explicit yes — add-only, placed by the rule below, not stamp-gated, after the preview printed the disclosure below. An entry it wrote is removed by hand from `docs/ai/gates.json`: the verb never un-declares. `epic-shape` and `queue-audit` take a project operand and `doc-parity` checks only the kit's own package, so none of them is offered.
27
27
 
28
- **Consent-gated filling — the init preview, not part of the runner (D9).** The template `gates.json` is seeded EMPTY; FILLING it is a consented preview at init (`node ${CLAUDE_SKILL_DIR}/tools/gates-init.mjs --cwd <project>`, dry-run by default — prints the derived entries and **writes NOTHING**; `--apply [--only <id>]…` writes exactly the consented entries on your explicit yes; add-only, id collisions refused). **Placement, not blind appending:** a consented entry lands at the END, except that a non-checker entry goes **BEFORE** a trailing canonical coverage checker — that checker must stay last, so appending after it would write a declaration the validator refuses, leaving a hand edit as the only lane on any final-capable declaration. Existing entries are never modified, removed or reordered. The offer derivation is **closed-world** (AD-052): only a terminating-class script NAME (test / lint / type-check / build — never dev/watch/serve, never a write-mode or release/publish/deploy variant) whose BODY is a member of the literal runner allowlist is offered — membership, never blocklist screening: the worst case is a legit command not offered, never a dangerous one offered. The offered cmd is the uniform hook-free **`COREPACK_ENABLE_NETWORK=0 <pm> exec -- <allowlisted-body>`** — `exec` runs a command, not a named script, so no pre/post hook can fire (npm/pnpm/yarn alike; never `<pm> run <name>`, which re-exposes hooks), and the Corepack env prefix blocks a hostile `packageManager` pin from fetching the PM binary before exec. npm is pinned `--offline --script-shell /bin/sh`; pnpm/yarn refuse an absent runner without network (a user-installed cache/global/PATH runner executing is user machine state — part of the disclosed residual); a family without a verified fail-closed exec contract is WITHHELD loudly. A screened-out body is always named — and when nothing but kit checkers remains, the preview says so in plain words: the offer carries **no project-verification gate at all**. **Disclose before the yes** (the preview prints it): gates.json is a PRIVILEGED file — the wired hook auto-approves byte-exact declared commands — and a script gate runs project-controlled tooling the preview does not sandbox (safe-by-construction = the OFFER DERIVATION). At upgrade, step 3's run-list changes an existing gates.json only through the consented legacy migration and, under the `tier` ask, `tools/checker-gates.mjs` (`${CLAUDE_SKILL_DIR}/references/modes/upgrade.md`).
28
+ **Consent-gated filling — the init preview, not part of the runner (D9).** The template `gates.json` is seeded EMPTY; FILLING it is a consented preview at init (`node ${CLAUDE_SKILL_DIR}/tools/gates-init.mjs --cwd <project>`, dry-run by default — prints the derived entries and **writes NOTHING**; `--apply [--only <id>]…` writes exactly the consented entries on your explicit yes; add-only, id collisions refused). **Placement, not blind appending:** a consented entry lands at the END, except that a non-checker entry goes **BEFORE** a trailing canonical coverage checker — that checker must stay last, so appending after it would write a declaration the validator refuses, leaving a hand edit as the only lane on any final-capable declaration. Existing entries are never modified, removed or reordered. The offer derivation is **closed-world** (AD-052): only a terminating-class script NAME (test / lint / type-check / build — never dev/watch/serve, never a write-mode or release/publish/deploy variant) whose BODY is a member of the literal runner allowlist is offered — membership, never blocklist screening: the worst case is a legit command not offered, never a dangerous one offered. The offered cmd is the uniform hook-free **`COREPACK_ENABLE_NETWORK=0 <pm> exec -- <allowlisted-body>`** — `exec` runs a command, not a named script, so no pre/post hook can fire (npm/pnpm/yarn alike; never `<pm> run <name>`, which re-exposes hooks), and the Corepack env prefix blocks a hostile `packageManager` pin from fetching the PM binary before exec. npm is pinned `--offline --script-shell /bin/sh`; pnpm/yarn refuse an absent runner without network (a user-installed cache/global/PATH runner executing is user machine state — part of the disclosed residual); a family without a verified fail-closed exec contract is WITHHELD loudly. A screened-out body is always named — and when nothing but kit checkers remains, the preview says so in plain words: the offer carries **no project-verification gate at all**. **Disclose before the yes** (the preview prints it): gates.json is a PRIVILEGED file — the wired hook auto-approves byte-exact declared commands — and a script gate runs project-controlled tooling the preview does not sandbox (safe-by-construction = the OFFER DERIVATION). At upgrade, step 3's run-list changes an existing gates.json only through the legacy migration, which moves an earlier kit's gates with no question, and, under the `tier` ask, `tools/checker-gates.mjs` (`${CLAUDE_SKILL_DIR}/references/modes/upgrade.md`).
29
29
 
30
- **The coverage PRODUCER and the canonical checker are declared together or not at all.** `coverage-check` READS an lcov; something must WRITE it, and a checker with no producer PASSES (`skipped-no-lcov`) certifying nothing. A **producer** is a CLOSED set of full command forms, never a substring probe: the suite body `node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination="${AW_GIT_DIR:?exported by run-gates}/agent-workflow-lcov.info" --test-reporter=spec --test-reporter-destination=stdout` (optionally + the project's own test paths), bare or behind ONE verified per-PM `exec` wrapper. A cmd that merely MENTIONS the destination (in an `echo`, as a bare substring) or carries a PARTIAL flag set is **not** one. The tail must be path-shaped — path/glob/quoting bytes only, nothing that could sequence, redirect or substitute a command, no plain leading `-`. **Residual:** the screen judges SOURCE bytes — brace *sequence* expansion can produce others (`{Y..a}`), though bash never re-scans an expansion result as syntax, so such a byte is literal argument data, not an operator; the leading-`-` rule is first-order only (`'--flag'`, `{path,--flag}` pass); neither proves the lcov SURVIVES — "producer" means *configured with the reporters*, and a run producing none is caught at runtime as `skipped-no-lcov`. The destination rides `AW_GIT_DIR`, exported to every gate child on plain and `--final` runs alike (`AW_LCOV_FILE` is `--final`-only), so one cmd survives the unmet-producer preflight in both modes; the `:?` is the required-parameter form, so a hand-run with `AW_GIT_DIR` unset or empty fails naming it instead of writing the lcov to the filesystem ROOT (a STALE exported value is not caught), and the preflight counts it as a reference (a `${VAR:-…}` fallback stays unmatched). Recognition is APPEND-ONLY — every destination form the kit has emitted stays a producer, so an earlier kit's declaration never re-reads as customized; emission uses the newest alone. Recognition never WIDENS: a suite the closed set cannot express declares itself with **`"lcovProducer": true`** — the ONE other way to be a producer. Only the literal `true` claims (a string is a loud refusal); the claim binds the DECLARATION, never the run (a marked gate producing no lcov still ends `skipped-no-lcov` / `attested=no`); and it is FORWARD-ONLY — an older kit rejects a marker-carrying declaration by name (exit 5) instead of reading a claim it cannot honor. On BOTH declaration paths: the fill preview WIRES those reporters onto a `node --test` body — the one allowlist member producing lcov unaided, every other body is emitted unchanged — WITHHOLDS the `coverage-check` candidate, with a named note, when neither the offer nor the declaration carries a producer; and `--apply` REFUSES a checker with no producer, a checker that is not LAST (an ORDERING refusal about entries that are ALREADY declared — reorder by hand; the fill places new entries before a trailing checker but never reorders what it did not write), or a SECOND canonical checker. The legacy migration likewise never ADDS the checker into a producer-less declaration, and reports an already-declared one as INERT. A producer declared AFTER the checker leaves it just as inert (it reads nothing, or stale bytes) — ORDER is the rule. An already-declared inert pair, and a matrix of nothing but kit checkers, are surfaced by the advisor's `gates-inert` item (`${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`); its cause-A remedy is the fill preview when the checker is LAST and the project's own scripts yield an offerable producer (the placement rule lands it before the checker), and the user's own step otherwise.
30
+ **The coverage PRODUCER and the canonical checker are declared together or not at all.** `coverage-check` READS an lcov; something must WRITE it, and a checker with no producer PASSES (`skipped-no-lcov`) certifying nothing. A **producer** is ONE full command form, never a substring probe: the suite body `node scripts/agent-workflow/run.mjs unit-tests` (optionally + the project's own test paths), bare or behind ONE verified per-PM `exec` wrapper. That is the stable kit command's `unit-tests` name: `node --test` with the lcov reporter under `AW_GIT_DIR` and the kit test reporter on stdout (a red run prints only its failures and the totals line). A cmd that merely MENTIONS the body (in an `echo`, inside quotes, after `true &&`), another name of the command, or `node --test` with a reporter flag set is **not** one. The tail must be path-shaped — path/glob/quoting bytes only, nothing that could sequence, redirect or substitute a command, no plain leading `-`, so no flag: the command hands every argument to the runner, and `--test-reporter=dot` would add a reporter. **Residual:** the screen judges SOURCE bytes — brace *sequence* expansion can produce others (`{Y..a}`), though bash never re-scans an expansion result as syntax, so such a byte is literal argument data, not an operator; the leading-`-` rule is first-order only (`'--flag'`, `{path,--flag}` pass); neither proves the lcov SURVIVES — "producer" means *configured with the reporters*, and a run producing none is caught at runtime as `skipped-no-lcov`. The destination rides `AW_GIT_DIR`, exported to every gate child on plain and `--final` runs alike (`AW_LCOV_FILE` is `--final`-only); the command refuses an unset or empty `AW_GIT_DIR` by name, exit 1, instead of writing the lcov to the filesystem ROOT (a STALE exported value is not caught). **One guard on every write of the form:** the fill and the migration write the body only while the project's `scripts/agent-workflow/run.mjs` is a regular file byte-equal to the running kit's own and `scripts/agent-workflow/test-reporter/reporter.mjs` is a regular file; otherwise the fill withholds its `node --test` script and the migration keeps the gate, each with one line naming the first failing path and its remedy. **Every form an earlier kit wrote is moved, with no question:** `node --test` with a reporter flag set an earlier kit wrote is no producer; the upgrade's migration SWITCHES such a gate (any id, marked or not) to the same exec prefix, the body and its path tail (printed `SWITCH` with its `was:`), and reports one whose tail carries a flag as CUSTOMIZED with the command's suite line. Until moved, such a gate still runs, but no producer precedes the checker: the fill refuses the write and the advisor names `/agent-workflow-kit upgrade`. Recognition never WIDENS: a suite the closed set cannot express declares itself with **`"lcovProducer": true`** — the ONE other way to be a producer. Only the literal `true` claims (a string is a loud refusal); the claim binds the DECLARATION, never the run (a marked gate producing no lcov still ends `skipped-no-lcov` / `attested=no`); and it is FORWARD-ONLY — an older kit rejects a marker-carrying declaration by name (exit 5) instead of reading a claim it cannot honor. On BOTH declaration paths: the fill preview offers a `node --test` body as the command body under the guard — the one allowlist member producing lcov unaided, every other body is emitted unchanged — WITHHOLDS the `coverage-check` candidate, with a named note, when neither the offer nor the declaration carries a producer; and `--apply` REFUSES a checker with no producer, a checker that is not LAST (an ORDERING refusal about entries that are ALREADY declared — reorder by hand; the fill places new entries before a trailing checker but never reorders what it did not write), or a SECOND canonical checker. The legacy migration adds the checker only with `--apply --add-checker`, on the user's yes, never into a producer-less declaration. A producer declared AFTER the checker leaves it just as inert (it reads nothing, or stale bytes) — ORDER is the rule. An already-declared inert pair, and a matrix of nothing but kit checkers, are surfaced by the advisor's `gates-inert` item (`${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`); its cause-A remedy is the fill preview when the checker is LAST and the project's own scripts yield an offerable producer (the placement rule lands it before the checker), and the user's own step otherwise.
31
31
 
32
32
  **The marker as it appears in a declaration** — the three required keys plus the boolean, nothing else:
33
33
 
@@ -35,7 +35,7 @@ A variant's posture note, where its key has one, is printed by `init` from this
35
35
  - `read-lane` — enabling the opt-in read-only compound lane auto-approves *compounds* (and singles) of the seeded read-only core that carry ZERO shell metaprogramming: an UNATTENDED trust extension, bounded by the audited read-only core (never a command outside it; prompt-bypass only, never a sandbox bypass) and applied regardless of which of those core commands you seeded as individual settings rules. It is a PROJECT-PERSISTENT declaration in `docs/ai/lanes.json` — every future session, subagents' Bash too where the host fires hooks on subagent Bash, and (committed) every checkout. The item renders while the hook is wired and the lane is off, whatever the placed hook's bytes; its apply is the `gate-hook --read-lane` preview, whose own currency check refuses a stale hook (a pre-1.48 hook never reads `lanes.json`). A stale or absent hook under it is a planned file of the kit item `gate-hook.not-current`, applied before the offers. The agent applies the enable offer on the chat yes, and the kit item with no question after the check; `init` applies that kit item on its one y as the route the user may take instead. Risk profile: a bounded read-only trust-posture extension — no write/exec exposure beyond the audited core.
36
36
  - `worktrees-dir` — the agent applies the item on the chat yes after the check: one `sandbox.filesystem.allowWrite` entry naming the worktrees parent itself, written to this copy's `.claude/settings.local.json` only, never the committed project settings, the parent created when missing. `init` applies it on the batch terminal yes as the route the user may take instead. Where the host honors the key, the entry widens the OS-sandbox WRITE surface to the whole parent dir: every sibling path under it (other repositories included) becomes agent-writable, for every later session and every worktree provisioned afterwards. Narrow it BEFORE the first apply: point `docs/ai/worktrees.json` `parentDir` at a dedicated dir — no apply removes an entry, so an earlier one stays until the user deletes it. A parent that is the home or holds it renders `worktrees-dir.home` instead, the user's own step. **Convergence** is two-path: a declared `sandbox.filesystem.allowWrite` entry covering the probed dir (either settings scope — `~` and `~/…` resolve against home, and coverage is path-segment-aware, so a grant on a sibling or on a child never counts), or the dir-bound acknowledgement `worktreesDirAck` in the family-owned `docs/ai/acks.json`, recorded by the `ack-write --lane worktrees-dir` line the `recipe:` line carries — the ack fallback for a host that ignores the key, run only on the user's word, instead of the grant; against a trusted host NO no ack renders. Neither is proof of write CAPABILITY: the provision preflight's real create+delete probe stays the runtime truth, and the ack is bound to the **resolved probe dir**, so the item re-fires only when that resolved dir changes. Risk profile: a real write-surface widening where honored — scope it deliberately.
37
37
 
38
- - `gates-inert` — the gate matrix is DECLARED but verifies nothing, and the two causes have different remedies, so the item renders a different apply for each. **Cause A** — a canonical `coverage-check` gate with no producer gate declared BEFORE it (none at all, or one declared after it, which writes the lcov too late): the run certifies no coverage of its own — `coverage=not-run` when nothing wrote an lcov, or a verdict over STALE bytes an earlier run left in the git dir, which is worse because it reads as `coverage=certified`. The remedy needs the producer to run BEFORE the checker — declared or MOVED there. When the checker is the LAST declared gate and the project's own scripts yield an offerable producer, the fill PLACES that producer before it, so the apply is the ordinary `gates-init` dry-run preview. Otherwise — no offerable producer, or a checker that is not last — it is the user item `gates-inert.unfillable`: the user's own step is to edit `docs/ai/gates.json` (the exact producer form lives in `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), because the fill never reorders entries it did not write. **Cause B** — every declared gate is one of the kit's own canonical checkers, so the matrix runs no project-verification command at all: the apply is the `gates-init` dry-run preview, the same consent-gated seeder the `gates-declaration` item renders, and after the SAME confirmation you run the `--apply` line it prints. Neither cause changes any gate result, exit code or receipt — the item adds no enforcement, only the offer. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file (a declared gate is auto-approvable by the wired hook), so both causes land in the same place — where the fill can help, it declares a project-controlled command on your explicit yes; where it cannot, the edit is the user's own step.
38
+ - `gates-inert` — the gate matrix is DECLARED but verifies nothing, and the two causes have different remedies, so the item renders a different apply for each. **Cause A** — a canonical `coverage-check` gate with no producer gate declared BEFORE it (none at all, or one declared after it, which writes the lcov too late): the run certifies no coverage of its own — `coverage=not-run` when nothing wrote an lcov, or a verdict over STALE bytes an earlier run left in the git dir, which is worse because it reads as `coverage=certified`. The remedy needs the producer to run BEFORE the checker — declared or MOVED there. When the checker is the LAST declared gate and the project's own scripts yield an offerable producer, the fill PLACES that producer before it, so the apply is the ordinary `gates-init` dry-run preview. Otherwise — no offerable producer, or a checker that is not last — it is the user item `gates-inert.unfillable`: the user's own step is to edit `docs/ai/gates.json` (the exact producer form lives in `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), because the fill never reorders entries it did not write. When the declaration carries, anywhere, a gate in a form an earlier kit wrote that the upgrade moves (one whose tail holds only test paths), or the fill withheld its `node --test` script because the kit folder does not hold this kit's command and reporter, the apply is `/agent-workflow-kit upgrade` in place of both: it moves an earlier kit's gate with no question, or a line of its report names what stops it. **Cause B** — every declared gate is one of the kit's own canonical checkers, so the matrix runs no project-verification command at all: the apply is the `gates-init` dry-run preview, the same consent-gated seeder the `gates-declaration` item renders, and after the SAME confirmation you run the `--apply` line it prints. Neither cause changes any gate result, exit code or receipt — the item adds no enforcement, only the offer. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file (a declared gate is auto-approvable by the wired hook), so both causes land in the same place — where the fill can help, it declares a project-controlled command on your explicit yes; where it cannot, the edit is the user's own step.
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: it claims the practice while nothing measures module size, 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 or incomplete 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`). **`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 you relay it), 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.
@@ -13,7 +13,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
13
13
  1. `entry-block` — `node ${CLAUDE_SKILL_DIR}/tools/inject-methodology.mjs reconcile <project>/AGENTS.md` → the kit block between its two workflow:kit comment lines, its table one row per theme, written current with no question and no copy kept, its line naming the route (text of your own goes outside the two workflow:kit comment lines; a change to a kit rule goes in its theme's file under docs/ai/rules/local/): added · already current · written · refused · a hard STOP.
14
14
  2. `footprint` — `node ${CLAUDE_SKILL_DIR}/tools/hide-footprint.mjs --dir <project> --reconcile --dry-run` → visibility: visible · ambiguous · hidden — consent (conditional): ambiguous → ask which it is BEFORE anything; hidden → the conditional re-run without `--dry-run` (its surfaced paths ask per bootstrap step 9).
15
15
  3. `configs` — `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --cwd <project>` → one line per ensure: `seeded` / `note-refreshed` / `refreshed` / `regenerated` / `pending` / `already-current` / `customized-preserved` / `malformed-preserved` / `already-present` / `not-placed` / `skipped-no-node-evidence` / `failed`.
16
- 4. `gates-migration` — `node ${CLAUDE_SKILL_DIR}/references/scripts/gates/migrate-gates.mjs --kit-tools ${CLAUDE_SKILL_DIR}/tools --cwd <project>` → the preview plan · INERT checker · CUSTOMIZED entries, each named — consent: apply only on an explicit yes, re-run with `--apply`.
16
+ 4. `gates-migration` — `node ${CLAUDE_SKILL_DIR}/references/scripts/gates/migrate-gates.mjs --kit-tools ${CLAUDE_SKILL_DIR}/tools --cwd <project> --apply` → every move written with no question, each acted row with its `was:`: SWITCH · EXTEND · REMOVE · KEPT · CUSTOMIZED · OFFER — consent (conditional): the coverage-check add alone, on an explicit yes run its printed OFFER line, the same command with `--apply --add-checker`.
17
17
  5. `bridges` — `node ${CLAUDE_SKILL_DIR}/tools/setup-backends.mjs --refresh-placed` → per-bridge lines: refreshed · already current · skipped — with its stated reason (not placed / newer than the bundle / unsupported host) · `skipped-readonly` · could not refresh.
18
18
  6. `tier` — `node ${CLAUDE_SKILL_DIR}/tools/tier-preview.mjs --cwd <project>` → per gap: present · offered · declined · undecidable · applied · recorded · refused — consent: one ask, only when offered.
19
19
  7. `bridge-settings` — `node ${CLAUDE_SKILL_DIR}/tools/bridge-settings.mjs --reconcile` → outcome line(s), pasted verbatim: ok · absent · flagged · duplicates · unusable.
@@ -42,15 +42,15 @@ 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 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 no on the gates apply leaves those gates failing; 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. 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.
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
 
49
- **What the spec-layer ensure does.** A deployment older than the feature-spec layer lacks the kit folder's spec reader and `docs/ai/specs/index.md`, and its deployed `check-docs-size.mjs` predates the store collapse. The spec layer's files in `scripts/agent-workflow/` — the three it deploys, `spec-schema/spec-schema.mjs`, `spec-schema/index.mjs` and `docs-size/check-docs-size.mjs`, no suite among them — the files they import and the stable kit command `scripts/agent-workflow/run.mjs` follow the enforcement-script rule, with no question and no copy kept: a shipped prior is refreshed (an append-only digest catalog), an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left. This ensure runs before the enforcement-script ensure, so those files and `run.mjs` stand before that ensure judges the kit folder and removes the old flat files. In ONE order: the reader, then the checker, then `run.mjs`, then the store root, seeded create-only from the bundled template, date rendered — an older checker renders the store row by row and reds the hook's `--check-index`, so the checker is written first, and a write that fails stops every later one. A closing line says a commit hook that runs the files written may stop the next commit. One token by precedence: `seeded` > `refreshed` > `already-present`; 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 (the same Node-evidence probe the enforcement-script ensure uses; an unreadable probe is `failed` / `node-evidence-unverifiable`). **The adoption state this seed leaves behind is reported, never assumed:** the Recommendations section (step 4 / 8) carries the `spec-adoption` item — `not adopted` (the store is absent: the seed offered, the decline the agent records), `adopting` (a store with no live contract: the decline offered), silenced by a recorded decline (`ack-write --lane spec-adoption`), and a store the probe cannot read is a stated skip — and `status` prints the same state on its own line.
49
+ **What the spec-layer ensure does.** A deployment older than the feature-spec layer lacks the kit folder's spec reader and `docs/ai/specs/index.md`, and its deployed `check-docs-size.mjs` predates the store collapse. The spec layer's files in `scripts/agent-workflow/` — the three it deploys, `spec-schema/spec-schema.mjs`, `spec-schema/index.mjs` and `docs-size/check-docs-size.mjs`, no suite among them — the files they import, the test reporter `scripts/agent-workflow/test-reporter/reporter.mjs` and the stable kit command `scripts/agent-workflow/run.mjs`, which runs it, follow the enforcement-script rule, with no question and no copy kept: a shipped prior is refreshed (an append-only digest catalog), an edited body replaced (its line names where a lasting edit goes), an absent file placed, the current body left. This ensure runs before the enforcement-script ensure, so those files, the reporter and `run.mjs` stand before that ensure judges the kit folder and removes the old flat files. In ONE order: the reader, then the checker, then the test reporter, then `run.mjs`, then the store root, seeded create-only from the bundled template, date rendered — an older checker renders the store row by row and reds the hook's `--check-index`, so the checker is written first, and a write that fails stops every later one. A closing line says a commit hook that runs the files written may stop the next commit. One token by precedence: `seeded` > `refreshed` > `already-present`; 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 (the same Node-evidence probe the enforcement-script ensure uses; an unreadable probe is `failed` / `node-evidence-unverifiable`). **The adoption state this seed leaves behind is reported, never assumed:** the Recommendations section (step 4 / 8) carries the `spec-adoption` item — `not adopted` (the store is absent: the seed offered, the decline the agent records), `adopting` (a store with no live contract: the decline offered), silenced by a recorded decline (`ack-write --lane spec-adoption`), and a store the probe cannot read is a stated skip — and `status` prints the same state on its own line.
50
50
 
51
51
  **What the project-rules ensure does.** Each theme's kit file `docs/ai/rules/<theme>.md` is seeded, refreshed from a body a release shipped, and any other body replaced by the template with no question and no copy kept, its line naming the local rules file `docs/ai/rules/local/<theme>.md` for a rule meant to last; with no local file its effective copy and record are rebuilt. With a local file it writes neither: `pending` prints the merge to do and its record command — do the merge, show the user what changed, then run that command.
52
52
 
53
- **`gates-migration` — legacy gates.json migration (consented preview — D8).** An EXISTING declaration may still carry the retired review-ledger / fold-completeness checks. Run the preview (dry-run — writes NOTHING), show the user the exact plan, and only on an explicit yes re-run it with `--apply`: canonical legacy entries (matched by their documented single-invocation cmd forms) are REMOVED, the canonical `unit-tests` cmd gains the built-in lcov reporters, and the coverage-check gate is ADDED last — atomic and COMPLETE, so the migrated declaration satisfies `run-gates --final`. **The checker rides a PRODUCER or is not declared at all** (`${CLAUDE_SKILL_DIR}/references/modes/gates.md`): with no gate producing the lcov it reads, the migration does NOT add it, an already-declared one is reported INERT, the result is not called final-run-capable, and the preview prints the paste-ready suite cmd to declare by hand — nothing is ever removed for you. CUSTOMIZED entries are NEVER auto-touched: the preview names each with a paste-ready recovery, and the commit guard must NOT be installed until they are resolved. Of step 3's run-list, only this migration and `tools/checker-gates.mjs` under the `tier` ask change an existing gates.json (the FILL preview runs at init).
53
+ **`gates-migration` — legacy gates.json migration (the mandatory move — D8).** An EXISTING declaration may still carry the retired review-ledger / fold-completeness checks or a gate an earlier kit wrote. The step runs the migration with `--apply`, writing every move with no question, atomically, each acted row printed with its `was:`: a canonical legacy entry (matched by its documented single-invocation cmd form) is REMOVED when its target is proven absent, else named CUSTOMIZED; the canonical `unit-tests` cmd gains the stable kit command (`node scripts/agent-workflow/run.mjs unit-tests`, which adds the lcov reporter and the kit test reporter), a hand-written `node --test <paths>` included, and a gate an earlier kit wrote (`node --test` with its reporter flag set, under any id) is SWITCHED to it — both only while the kit folder holds this kit's command and reporter, which the `configs` step above places, else the gate is KEPT with one line naming the path and its remedy; a declared coverage-check gate is moved last. The new lcov can turn a declared checker that read no producer live, so a plain run that read green may read red after the move. **The coverage check is optional and rides a PRODUCER**: over a producer with no checker the step prints one OFFER line, and only on the user's explicit yes run it (`--apply --add-checker`, the checker added last); with no producer it is withheld, and an already-declared one with none before it is named with the fact and the remedy (`${CLAUDE_SKILL_DIR}/references/modes/gates.md`) — nothing is ever removed for you. CUSTOMIZED entries are NEVER auto-touched: each is named with a paste-ready recovery, and the commit guard must NOT be installed until they are resolved. Of step 3's run-list, only this migration and `tools/checker-gates.mjs` under the `tier` ask change an existing gates.json (the FILL preview runs at init).
54
54
 
55
55
  **`bridges` — placed-bridge refresh — stamp-independent, same gate, BEFORE the equal-head short-circuit.** Run
56
56
  `node ${CLAUDE_SKILL_DIR}/tools/setup-backends.mjs --refresh-placed` and **paste its per-bridge
@@ -88,7 +88,7 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
88
88
  **The LATE navigator finalizer — the AUTHORITATIVE run, after the last `docs/ai` mutation.** The `tier` offer above may write `docs/ai`, so the step-3 index ensure may be behind by the time the run-list ends. Re-run that ONE op here, before the step-4 report: `node ${CLAUDE_SKILL_DIR}/tools/ensure-configs.mjs --reconcile --only index --cwd <project>`. Relay **this** line in the report (it supersedes the early one; an untouched tree changes nothing, a failure STOPs the upgrade like any other ensure). On the migrated path the same rung runs again at the END of step 7 — after the migrations, before the step-8 re-stamp.
89
89
  4. **Equal-head exit — a real successful-exit report, not a bare stop.** If the stamp **equals** the head, the lineage is up to date — but step 3 (the stamp-independent reconciles) ran first and may have changed things, so this is a proper exit report, not a no-op:
90
90
  - **A skip line that contradicts the observed tree is a FINDING, never pasted as neutral.** Every ensure skip names the fact it proved (the probes that answered absent); if the tree you can see disproves that reason — a "no Node" skip beside deployed Node scripts, a "not deployed" skip beside a stamped `docs/ai` — do not relay the line as an outcome: raise it in the report as a defect of the tool, with the contradicting fact named, and stop short of any step that would build on the skip.
91
- - **Report step 3's outcome in plain language** — the kit block (`entry-block`): whether it was *added* at the start of the file, was *already current* (nothing changed) or was *written* with the current kit text (its route: text of your own goes outside the two workflow:kit comment lines; a change to a kit rule goes in its theme's file under docs/ai/rules/local/), with each `note:` line about a text the engine does not supply; the **nine project-configuration ensure** (`configs`) lines exactly as the one ensure run composed them (the ensures and their outcome tokens are enumerated in step 3), each rendered in plain language: what was created, what was left exactly as the user wrote it, and — for a `failed` line — what stopped it; for the navigator, relay the **late** `--only index` line, not the early one; the **`gates-migration`** result — *nothing to migrate*, the shown plan *applied* on your explicit yes, or the plan *left unapplied* (consent not given), with any INERT checker or CUSTOMIZED entries named; the **placed-bridge refresh** (`bridges`) outcome — paste the tool's per-bridge lines verbatim (they are already plain: *refreshed* / *already current* / *skipped — not placed* / `skipped-readonly` with its re-scan verdict / *could not refresh* + recovery); the **full-flow offer** (`tier`) lines; the **bridge-settings reconcile** (`bridge-settings`) outcome (paste the tool's line(s) verbatim); and, for a hidden deployment, whether the hidden-mode footprint (`footprint`) was *moved to project-local*, was *already project-local* (nothing changed), or needed a question (ambiguous visibility). Plain wording only — never the reconcile/slot/anchor/marker terms (the never-leak-kit-internals Gotcha — `${CLAUDE_SKILL_DIR}/references/shared/deploy-tail.md`).
91
+ - **Report step 3's outcome in plain language** — the kit block (`entry-block`): whether it was *added* at the start of the file, was *already current* (nothing changed) or was *written* with the current kit text (its route: text of your own goes outside the two workflow:kit comment lines; a change to a kit rule goes in its theme's file under docs/ai/rules/local/), with each `note:` line about a text the engine does not supply; the **nine project-configuration ensure** (`configs`) lines exactly as the one ensure run composed them (the ensures and their outcome tokens are enumerated in step 3), each rendered in plain language: what was created, what was left exactly as the user wrote it, and — for a `failed` line — what stopped it; for the navigator, relay the **late** `--only index` line, not the early one; the **`gates-migration`** result — *nothing to migrate*, or the moves *written*, each with its `was:`, with any KEPT gate, CUSTOMIZED entry, checker fact or the OFFER of the coverage check named; the **placed-bridge refresh** (`bridges`) outcome — paste the tool's per-bridge lines verbatim (they are already plain: *refreshed* / *already current* / *skipped — not placed* / `skipped-readonly` with its re-scan verdict / *could not refresh* + recovery); the **full-flow offer** (`tier`) lines; the **bridge-settings reconcile** (`bridge-settings`) outcome (paste the tool's line(s) verbatim); and, for a hidden deployment, whether the hidden-mode footprint (`footprint`) was *moved to project-local*, was *already project-local* (nothing changed), or needed a question (ambiguous visibility). Plain wording only — never the reconcile/slot/anchor/marker terms (the never-leak-kit-internals Gotcha — `${CLAUDE_SKILL_DIR}/references/shared/deploy-tail.md`).
92
92
  - **Never surface the structure number on this exit.** Whatever step 3 did, do **not** recite the `docs/ai` structure version, the internal versioning vocabulary, or the two-axes note here — the number is inert on an equal-head exit; it belongs to *Version disclosure* in `${CLAUDE_SKILL_DIR}/references/shared/report-footer.md` (shown at the never-downgrade STOP, the explicit status view, or on an explicit ask). Frame the success itself per the final bullet: if step 3 changed anything, say **what changed** in plain human terms; only a pure zero-diff no-op is *settings already current — no update needed*.
93
93
  - **Render the mandatory Recommendations section — on this exit too, BEFORE the footer.** Run `node ${CLAUDE_SKILL_DIR}/tools/recommendations.mjs --cwd <project-root>` and PRESENT its output — from the `## Recommendations (agent-workflow)` header — in the user's conversational language: every fact, count and item from the tool, nothing added or dropped; commands, paths, hosts and rule strings byte-exact; show the raw tool block on request. The section is present-even-when-empty (with everything optimal the body is exactly `no recommendations — flow optimal.`) and VERDICT-FIRST — the composed verdict line renders from the frozen templates `{K} item(s) need attention` / `nothing is broken` / `{N} optional recommendation(s), apply any you want` / `optimality NOT attested — {M} probe check(s) skipped`. Then apply each kit item by the kit route, with no question: its check line in the sandbox, then at once its apply line once outside it. Then OFFER the consent route: the user picks items in plain language; surface each picked item's posture note and get the explicit confirm; run its lane's rendered lines — chat: the one-liner; harness: the check line, then on the yes to its result the apply line; user: the user's own step — per the full consent route in `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`. Pinned order on this exit: Recommendations block → optional applies → report footer → the commit ask (the advisor/apply lane never lands after the commit ask).
94
94
  - **Recommendations lanes — both exits.** The four lanes (`chat`, `harness`, `kit`, `user`), the consent route and the kit route live in `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`; `init` stays a route the user may take.
@@ -37,6 +37,8 @@
37
37
  { "path": "shared/index.mjs", "role": "deployed", "seed": true },
38
38
  { "path": "shared/markdown-blocks.test.mjs", "role": "suite" },
39
39
  { "path": "shared/project-root.test.mjs", "role": "suite" },
40
+ { "path": "test-reporter/reporter.mjs", "role": "deployed", "seed": false },
41
+ { "path": "test-reporter/reporter.test.mjs", "role": "suite" },
40
42
  { "path": "test-support/_expect-shim.mjs", "role": "support" },
41
43
  { "path": "test-support/index.mjs", "role": "support" }
42
44
  ]
@@ -19,12 +19,12 @@ const SCHEMA = 1;
19
19
  const TOP_KEYS = ['schema', 'entries'];
20
20
  const ENTRY_KEYS = ['path', 'role', 'seed'];
21
21
  const TOP_FILES = new Set(['family.mjs', 'family.test.mjs', 'run.mjs', 'run.test.mjs']);
22
- const MODULES = new Set(['docs-size', 'spec-schema', 'archives', 'git-hooks', 'gates', 'shared', 'test-support']);
22
+ const MODULES = new Set(['docs-size', 'spec-schema', 'archives', 'git-hooks', 'gates', 'shared', 'test-support', 'test-reporter']);
23
23
  const FILE_NAME = /^[A-Za-z0-9_][A-Za-z0-9._-]*$/;
24
24
 
25
25
  const isObject = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
26
26
 
27
- // A path is one of the top-level files, or <module>/<file> with the module one of the seven.
27
+ // A path is one of the top-level files, or <module>/<file> with the module one of the eight.
28
28
  const inGrammar = (path) => {
29
29
  const parts = path.split('/');
30
30
  if (parts.length === 1) return TOP_FILES.has(path);