baldart 5.0.0 → 5.0.1

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
@@ -5,6 +5,45 @@ All notable changes to BALDART will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.0.1] - 2026-07-03
9
+
10
+ **Adversarial-verification fixes on the 5.0.0 wave.** A full release verification
11
+ (distribution machine dogfooded end-to-end on 4 configs — all green; normative-loss audit
12
+ over 4 core agents; pipeline-coherence audit) found the headline mechanisms inert on the
13
+ happy path plus a handful of slot-boundary and consistency defects. All fixed; no gate
14
+ removed, no H2 moved (consumer overlays unaffected), no `baldart.config.yml` change.
15
+
16
+ - **FIXED (HIGH) — `/new` step 11b clean branch now proceeds to 11c**: previously only the
17
+ violation branch reached the review-bundle/doc-invariants build, leaving the v5.0.0
18
+ anti-re-read + PASS-fast machinery unused on every clean card (`implement.md`).
19
+ - **FIXED (HIGH) — `/codexreview` consumes the full lean contract**: Step -0.5 now parses +
20
+ forwards `review_bundle_path` (anti-re-read phrase in every Step-2 prompt) and
21
+ `specialist_dispatch` (orchestrated-mode suppression, `dispatch_deferred:<agent>`) — both
22
+ were produced by `codex-gate.md` but dead-wired on the `/new`→`/codexreview` hop. Optional
23
+ keys: pre-5.0 contracts keep working unchanged.
24
+ - **FIXED (HIGH) — coder slot boundaries**: `vercel-react-best-practices` un-slotted (no
25
+ config flag can express React-non-Next → structural normative loss); the NEVER-ad-hoc
26
+ browser-scripts rule hoisted out of `{{#e2e_playwright}}` (universal pre-5.0). Agents
27
+ CHANGELOG: coder/doc-reviewer/qa-sentinel v2.0.1.
28
+ - **FIXED (MEDIUM)** — doc-reviewer per-card cited exceptions (`topological-generation`,
29
+ `schema-drift`) restored + `doc-audit-protocol.md` Contract no longer contradicts the agent
30
+ core; qa-sentinel bundle `gate_logs` demoted to context-only (own-tier gates always re-run);
31
+ `build-review-bundle.mjs` diff scoped to `--may-edit` (multi-card batches no longer leak
32
+ prior cards into card N's bundle/docinv; `new2.js` implement brief mirrors the scoping);
33
+ `new-card-review.js` + the 2.5x delegation thread `reviewBundlePath` into every brief;
34
+ Phase 2.55 pre-5.0 fallback uses `git diff "$TRUNK...HEAD"` (bare `git diff` post-commit is
35
+ vacuous); cap-and-handoff checkpoint-missing branch defined; `/ui-implement`-delegated cards
36
+ explicitly run 7c–11c; PASS-fast Own-Doc Closure claim corrected; "rule 8" pointers
37
+ re-anchored to the renumbered Post-Intervention Coherence rule 7 (prd-card-writer, upgrade
38
+ doc, new2-resolve comment).
39
+ - **FIXED (LOW)** — `doc-invariants.mjs` evaluates `documentation_impact` and `canonical_docs`
40
+ independently; deferral KEEP list re-includes `balanced`; stale `coding-standards.md`
41
+ cross-refs to the removed coder H2 updated; `${paths.references_dir}` literals in
42
+ `doc-audit-protocol.md`.
43
+ - Skills: `new` 2.0.1, `new2` 1.4.1 (per-skill CHANGELOGs). Codex parity: portable — prose +
44
+ pure-Node scripts, no Claude-only primitive added; the `/codexreview` contract keys are
45
+ optional and ignored by pre-5.0 readers.
46
+
8
47
  ## [5.0.0] - 2026-07-03
9
48
 
10
49
  **The agent-spine major.** Measured driver (1,934 subagent runs / 191 sessions on the
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.0.0
1
+ 5.0.1
@@ -7,6 +7,29 @@ per-item agent merge, the doctor probes, and the discovery hooks — like
7
7
 
8
8
  Formato: [Keep a Changelog](https://keepachangelog.com/) · per-agent SemVer.
9
9
 
10
+ ## [coder v2.0.1] · [doc-reviewer v2.0.1] · [qa-sentinel v2.0.1] — 2026-07-03 (framework v5.0.1)
11
+
12
+ Adversarial-verification fixes on the 3-layer restructuring (no H2 moved — overlays unaffected):
13
+
14
+ - **coder**: `vercel-react-best-practices` un-slotted (it applies to ANY React stack, and no
15
+ config flag can express "React non-Next" — a structural normative loss for those consumers;
16
+ "skill absent → skip silently"). The NEVER-ad-hoc-browser-scripts rule hoisted OUT of
17
+ `{{#e2e_playwright}}` as an unconditional line (it was universal pre-5.0; a Playwright
18
+ consumer with a stale `stack.testing.e2e` silently lost it); the `playwright-skill` link
19
+ itself stays slotted.
20
+ - **doc-reviewer**: two per-card cited exceptions restored from the audit module —
21
+ `SECTION=topological-generation` (multi-file doc passes generate leaf→root; was per-card in
22
+ v4.99.0 but unreachable behind the module's "per-card NEVER" contract) and
23
+ `SECTION=schema-drift` (changed field SET on a documented payload → `SCHEMA_DRIFT`/
24
+ `ORPHAN_FIELD`, diff-driven as in v4.99.0). `doc-audit-protocol.md` Contract reworded to
25
+ name the cited exceptions instead of contradicting the agent core.
26
+ - **qa-sentinel**: review-bundle `gate_logs` demoted to CONTEXT ONLY (`files_changed` stays
27
+ authoritative for scope) — own-tier gates are always re-executed, never cited from a stale
28
+ Phase-2 log; restored the v4.99.0 one-liners "never claim a gate ran when it did not" and
29
+ "never invent your own classification".
30
+ - (pointer-only, no version bump) **prd-card-writer**: "code-reviewer rule 8" re-anchored to
31
+ the renumbered rule 7 (Post-Intervention Coherence Check), by name.
32
+
10
33
  ## [coder v2.0.0] · [code-reviewer v2.0.0] · [doc-reviewer v2.0.0] · [plan-auditor v2.0.0] · [qa-sentinel v2.0.0] · [codebase-architect v2.0.0] · [ui-expert v2.0.0] · [skill-improver v2.0.0] — 2026-07-03 (framework v5.0.0)
11
34
 
12
35
  **The 3-layer restructuring** (core inline + shared modules + install-time slots).
@@ -4,7 +4,7 @@ description: "Write, modify, or refactor production code. For features, bugs, an
4
4
  model: opus
5
5
  effort: high
6
6
  color: red
7
- version: 2.0.0
7
+ version: 2.0.1
8
8
  ---
9
9
 
10
10
  > **YOLO MODE**: All agents spawned via the Task tool MUST use `mode: "bypassPermissions"`. No exceptions.
@@ -219,17 +219,16 @@ Keep it simple. Write good code. Ask if unsure. Write it clean the first time.
219
219
 
220
220
  You MUST use these skills when applicable:
221
221
 
222
- {{#fw_nextjs}}
223
222
  ### `vercel-react-best-practices`
224
- React/Next.js performance patterns. When: writing React components, optimizing renders, async data, bundle size.
225
- {{/fw_nextjs}}
223
+ React performance patterns (any React stack, Next.js included). When: writing React components, optimizing renders, async data, bundle size. Skill not installed (non-React stack / no plugin) → skip silently.
226
224
  ### `frontend-design`
227
225
  Production-grade frontend code with high design quality. When: building new UI components or complex layouts.
228
226
  {{#deploy_vercel}}
229
227
  ### `vercel:deploy`
230
228
  Deploying to Vercel. When: the user requests deployment.
231
229
  {{/deploy_vercel}}
230
+ **Browser testing (unconditional)**: NEVER ad-hoc browser scripts or one-off `run.js` drivers — always the project's E2E test runner.
232
231
  {{#e2e_playwright}}
233
232
  ### `playwright-skill`
234
- E2E browser testing via Playwright Test CLI (`.spec.ts` in `tests/e2e/`, run via `npm run test:e2e`). When: testing new UI features, user flows, form submissions. NEVER ad-hoc scripts or `run.js` — always `npx playwright test`.
233
+ E2E browser testing via Playwright Test CLI (`.spec.ts` in `tests/e2e/`, run via `npm run test:e2e`). When: testing new UI features, user flows, form submissions — always `npx playwright test`.
235
234
  {{/e2e_playwright}}
@@ -3,7 +3,7 @@ name: doc-reviewer
3
3
  description: "Audit, review, and write project documentation. Use after feature implementation, bug-fix waves, or documentation cleanup. Owns documentation completeness and drift control."
4
4
  model: sonnet
5
5
  color: green
6
- version: 2.0.0
6
+ version: 2.0.1
7
7
  ---
8
8
  > **YOLO MODE**: All agents spawned via the Task tool MUST use `mode: "bypassPermissions"`. No exceptions.
9
9
 
@@ -163,11 +163,12 @@ When a SSOT exists, update it before any derived doc:
163
163
  - card DONE → `ssot-registry.md`
164
164
  - architecture/provider/auth/schema/contract decision → ADR
165
165
  - **changed validation constraint on a public contract** (`.max()`/`.min()`/length/regex/enum/default changed in a route handler, server action, or API schema) → the API reference **BODY** for that endpoint: verify the documented value EQUALS the code value — frontmatter freshness alone does not catch this. Mismatch = `API_BODY_CONSTRAINT_DRIFT`; you are the canonical writer, fix the body directly.
166
+ - **changed field SET on a documented payload** (field added/removed/renamed in a request/response schema whose endpoint doc exists) → update that doc's field table; a documented field gone from code = `SCHEMA_DRIFT`, a code field absent from the doc = `ORPHAN_FIELD`. Procedure: `agents/doc-audit-protocol.md SECTION=schema-drift` (per-card cited exception).
166
167
  {{#has_wiki_overlay}}
167
168
  - diff matches a synthesis page's `update_triggers` frontmatter (pages under `${paths.wiki_dir}/syntheses/`) → that synthesis page must be updated in the same change, or flagged `WIKI_SYNTH_STALE`. Pages without the field are exempt. See `agents/llm-wiki-methodology.md § Update triggers`.
168
169
  {{/has_wiki_overlay}}
169
170
  6. Check completeness of: data model docs, collection docs, API docs, UI docs, `product-scope.md` (business-scope changes only), `project-status.md`, ADRs when architecture changed, backlog notes, macro-feature SSOT cross-links.
170
- 7. **Write missing docs directly.** Prefer extending existing reference docs over new files unless the feature justifies a standalone doc. Type-specific checklists: `doc-reviewer-support/references/doc-checklists.md` **if it exists**, else the invariant table + the `doc-writing-for-rag` templates.
171
+ 7. **Write missing docs directly.** Prefer extending existing reference docs over new files unless the feature justifies a standalone doc. Type-specific checklists: `doc-reviewer-support/references/doc-checklists.md` **if it exists**, else the invariant table + the `doc-writing-for-rag` templates. Writing/updating MORE than one doc file in this pass → generate in dependency order, leaf→root (schemas/data-model before endpoints before UI/index), so no doc cites a sibling not yet updated — full procedure: `agents/doc-audit-protocol.md SECTION=topological-generation` (per-card cited exception).
171
172
  8. Update indexes when new docs are added.
172
173
  9. {{#has_wiki_overlay}}Assess wiki-overlay sync need (deliverable section H): new cross-cutting concept, renamed canonical, deprecated doc — note the need, do not dispatch any sync agent here.{{/has_wiki_overlay}} Wiki assessment is a no-op when `features.has_wiki_overlay: false` — skip section H with a one-line note.
173
174
  10. Report what was checked, added, fixed, and deferred — but see Own-Documentation Closure: an own-doc may NOT appear in the "deferred" bucket.
@@ -264,7 +264,7 @@ exception**: the LIGHT branch (b) above, a strictly UI-presentational card (`are
264
264
  logic/ui split pair (e.g. a `…-submit-ui` card whose logic lives in its `…-submit-logic`
265
265
  sibling): reviewing a pixels-only diff at Codex-`full` depth is waste, and the design-system
266
266
  safety net still fires regardless of profile (a `light` card keeps its per-card code-review —
267
- since v4.18.0 a per-card Codex finder + `code-reviewer` FP-gate — plus `code-reviewer` rule 8 /
267
+ since v4.18.0 a per-card Codex finder + `code-reviewer` FP-gate — plus `code-reviewer`'s Post-Intervention Coherence check (DS rule 7) /
268
268
  the registry-first DS cascade, and is covered by the batch-wide Final FULL gate). Any
269
269
  doubt — a hint of logic, state, data binding, a new/modified primitive, or `areas` beyond
270
270
  `[ui]` — disqualifies branch (b): the card stays `balanced`. When in doubt between `balanced`
@@ -4,7 +4,7 @@ description: "RUN the mechanical quality gates on a change set and return a PASS
4
4
  model: sonnet
5
5
  color: pink
6
6
  memory: project
7
- version: 2.0.0
7
+ version: 2.0.1
8
8
  ---
9
9
 
10
10
  > **YOLO MODE**: All agents spawned via the Task tool MUST use `mode: "bypassPermissions"`. No exceptions.
@@ -23,10 +23,10 @@ Run mechanical quality gates fast, return a PASS/FAIL verdict, and get out of th
23
23
  ## Step 0: Always Start Here
24
24
 
25
25
  0. **Resolve the working directory.** A `Worktree path` in your prompt → `cd` into it FIRST; all git/lint/test/build commands run there. Field present but empty → HALT: `QA DONE — <CARD-ID> / Verdict: FAIL / worktree path provided but empty`. No field → current directory.
26
- 1. `git diff --name-only HEAD` for the actual change set (you read uncommitted work pre-commit). When the briefing carries a review bundle, its `files_changed` + `gate_logs` are authoritative — don't re-derive.
27
- 2. Read the authoritative `QA profile` from your prompt (`balanced` | `deep`) and map it via **Operating Modes**. The profile — NOT file count — selects the tier. Only allowed adjustment: `balanced → FULL` on risk drift (below). No profile in the prompt → default SCOPED and note it.
26
+ 1. `git diff --name-only HEAD` for the actual change set (you read uncommitted work pre-commit). When the briefing carries a review bundle, its `files_changed` is authoritative for SCOPE — don't re-derive it. Its `gate_logs` are CONTEXT ONLY (Phase-2 logs, possibly stale after later mutations): the gates YOUR tier owns you always execute yourself, and you never cite a bundle log as if it were your own run.
27
+ 2. Read the authoritative `QA profile` from your prompt (`balanced` | `deep`) and map it via **Operating Modes**. The profile — NOT file count — selects the tier. Only allowed adjustment: `balanced → FULL` on risk drift (below). No profile in the prompt → default SCOPED and note it — never invent your own classification.
28
28
 
29
- Never fabricate test results. Never assume what changed — read the diff. Do NOT read changed files to "understand scope" — that's code-reviewer's job. The ONLY files you read are the backlog card YAML and the git diff output.
29
+ Never fabricate test results — and never claim a gate ran when it did not (a SKIP is reported as SKIP). Never assume what changed — read the diff. Do NOT read changed files to "understand scope" — that's code-reviewer's job. The ONLY files you read are the backlog card YAML and the git diff output.
30
30
 
31
31
  ## Gate Command Resolution
32
32
 
@@ -48,11 +48,19 @@ For the (single) card in scope, check for `/tmp/codexreview-lean-<CARD-ID>.json`
48
48
  "profile": "light" | "full",
49
49
  "arch_baseline_path": "/tmp/arch-baseline-<CARD-ID>.md",
50
50
  "diff_summary_path": "<completion-report or git-diff path>",
51
+ "review_bundle_path": "/tmp/review-bundle-<CARD-ID>.json",
51
52
  "skip_doc_reviewer": true,
52
- "skip_api_perf_auditor": true
53
+ "skip_api_perf_auditor": true,
54
+ "specialist_dispatch": {
55
+ "suppress": ["doc-reviewer", "plan-auditor", "api-perf-cost-auditor", "security-reviewer"],
56
+ "owner": "/new phases 3 / 3.5 / 3.7 + Final F.3"
57
+ }
53
58
  }
54
59
  ```
55
60
 
61
+ (`review_bundle_path` and `specialist_dispatch` since v5.0.1 — producer: `codex-gate.md` § lean
62
+ contract. Both OPTIONAL: absent on pre-5.0 contracts; unknown keys are ignored.)
63
+
56
64
  Apply:
57
65
  - `arch_baseline_path` readable → **skip Step 1** (do NOT re-spawn `codebase-architect`); load the
58
66
  baseline from that file and ALSO attach the `diff_summary_path` contents to every review agent so
@@ -77,6 +85,17 @@ For the (single) card in scope, check for `/tmp/codexreview-lean-<CARD-ID>.json`
77
85
  its own findings as before. Any high-risk diff trigger escalates the card to `full` (both finders)
78
86
  per the Review Profile Selector; the Final-review FULL gate re-runs Codex batch-wide regardless. *(B1)*
79
87
  - `profile: "full"` (or missing) → full agent set incl. Codex adversarial, minus #3 if `skip_doc_reviewer`.
88
+ - `review_bundle_path` present AND readable (since v5.0.1) → append to EVERY Step-2 reviewer prompt
89
+ the binding anti-re-read phrase: *"Review bundle: `<review_bundle_path>` — Read it FIRST. It lists
90
+ the diff, the changed files, the arch baseline and the completion report. Do NOT re-Read source
91
+ files to rebuild context you can get from those paths; for any file in `hot_files`, Read ONLY the
92
+ symbol ranges listed."* Absent/unreadable → no phrase (reviewers derive scope as before). *(A4)*
93
+ - `specialist_dispatch` present (since v5.0.1) → append its verbatim JSON to EVERY Step-2 reviewer
94
+ prompt, prefixed: *"ORCHESTRATED run — do NOT spawn any of the suppressed specialists yourself
95
+ (owner: `<owner>`); record what you would have routed as findings tagged
96
+ `dispatch_deferred: <agent>`."* (SSOT semantics: `agents/review-protocol.md § SECTION:
97
+ specialist-spawn`; the block WINS over the legacy `skip_*` flags where both are present.)
98
+ Absent → the reviewers' own spawn matrices apply (standalone behavior, unchanged). *(A5)*
80
99
 
81
100
  **Invariant**: lean mode NEVER suppresses the run itself — at minimum a **finder + the Step 3 FP-gate**
82
101
  execute on every card. At `light` the finder is **Codex** (or `code-reviewer` on the Codex-unavailable
@@ -85,8 +104,9 @@ malformed/unreadable, fall back to **full mode** and note it. **Consume-once**:
85
104
  `/tmp/codexreview-lean-<CARD-ID>.json` immediately after parsing it, so a later standalone
86
105
  `/codexreview <CARD-ID>` on the same card never inherits a stale lean contract from a prior `/new` run.
87
106
  Record the resolved mode in the Step 4 report `Method` section, e.g.
88
- `lean: profile=light, architect=reused, doc-reviewer=skipped(Phase 3), codex=finder(light), code-reviewer=fp-gate, cove=skipped`
89
- (or `codex=unavailable→code-reviewer finder(light)` when the fallback fired).
107
+ `lean: profile=light, architect=reused, doc-reviewer=skipped(Phase 3), codex=finder(light), code-reviewer=fp-gate, cove=skipped, bundle=forwarded, dispatch=suppressed`
108
+ (or `codex=unavailable→code-reviewer finder(light)` when the fallback fired; `bundle=absent` /
109
+ `dispatch=none` on pre-5.0 contracts).
90
110
 
91
111
  ---
92
112
 
@@ -175,7 +195,9 @@ Launch these agents in parallel for each card:
175
195
  > the finder instead (the Step 3 FP-gate validates its findings). At `full` with `skip_api_perf_auditor`,
176
196
  > launch #1 + #4 (Codex) (+ #3 unless `skip_doc_reviewer`). At `full` with no skips (and in full mode
177
197
  > with no contract file), launch all four. The standalone `/codexreview <CARD-ID>` invocation (no
178
- > contract) is always full with the complete set.
198
+ > contract) is always full with the complete set. When the contract carried `review_bundle_path` /
199
+ > `specialist_dispatch` (Step -0.5 A4/A5), every prompt built here carries the anti-re-read phrase
200
+ > and the suppression block respectively.
179
201
 
180
202
  **Codex invocation rules (agent #4):**
181
203
 
@@ -2,6 +2,34 @@
2
2
 
3
3
  Formato: [Keep a Changelog](https://keepachangelog.com/) · [SemVer](https://semver.org/).
4
4
 
5
+ ## 2.0.1 — 2026-07-03
6
+
7
+ Adversarial-verification fixes on the v5.0.0 pipeline wave (framework v5.0.1):
8
+
9
+ - **implement.md 11b→11c (HIGH)**: the clean branch of the file-diff gate now proceeds to 11c
10
+ (review bundle + doc-invariants) — previously it jumped straight to Phase 2.5, leaving the
11
+ bundle/PASS-fast machinery inert on the happy path. 11c now ends with an explicit "proceed
12
+ to Phase 2.5".
13
+ - **implement.md 7d**: explicit branch for `[CAP-HANDOFF]` marker present but checkpoint file
14
+ missing (rebuild `items_remaining` from the completion report, else `[CAP-EXHAUSTED]`); the
15
+ continuation briefing cites the review bundle only "when it already exists".
16
+ - **implement.md 6a**: delegated `/ui-implement` cards explicitly still run steps 7c–11c
17
+ (i18n fill, gates, ownership gate, bundle) — the delegation replaces only the build + 2.6.
18
+ - **review-cycle.md**: Phase 2.55 pre-5.0 diff fallback is now `git diff "$TRUNK...HEAD"`
19
+ (a bare `git diff` post-commit is vacuous); the 2.5x delegation passes `reviewBundlePath`
20
+ to `new-card-review.js`; the deferral KEEP list re-includes `balanced`; the PASS-fast
21
+ Own-Doc Closure claim corrected (modified-primitive obligations ride the serializer gate +
22
+ Final F.3, R1/R3 fire on new files only); the QA briefing marks bundle `gate_logs` as
23
+ CONTEXT ONLY (own-tier gates always re-run).
24
+ - **scripts/build-review-bundle.mjs**: the diff/files_changed are now SCOPED to `--may-edit`
25
+ when passed — in a sequential multi-card batch the unscoped `trunk...HEAD` accumulated
26
+ prior cards' commits into card N's bundle/docinv.
27
+ - **scripts/doc-invariants.mjs**: `card_declares_docs` evaluates `documentation_impact` and
28
+ `canonical_docs` independently (a populated `canonical_docs` with `documentation_impact: []`
29
+ no longer PASS-fasts).
30
+ - Companion consumer fix (command, not this skill): `/codexreview` Step -0.5 now parses +
31
+ forwards `review_bundle_path` and `specialist_dispatch` from the lean contract.
32
+
5
33
  ## 2.0.0 — 2026-07-03
6
34
 
7
35
  - **BALDART 5.0 pipeline wave (framework v5.0.0).** Six additive mechanisms, all with pre-5.0 graceful degradation:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: new
3
3
  effort: medium
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  description: >
6
6
  Orchestrate a team of specialized agents to implement one or more backlog cards
7
7
  end-to-end inside a dedicated worktree, with code review, doc review, QA, and
@@ -62,7 +62,10 @@
62
62
  in programmatic mode (contract: ui-implement/references/integration.md).
63
63
  Consume its COMPACT JSON (status mirrors /e2e-review — review-cycle.md Phase 2.6
64
64
  gating table). SKIP step 6b (owner_agent router), the step-7 coarse briefing,
65
- AND Phase 2.6 (the skill already ran /e2e-review). Then resume the per-card
65
+ AND Phase 2.6 (the skill already ran /e2e-review). Steps 7c–11c still run HERE
66
+ for the delegated card (i18n fill, gates 8–9, file diff gate 11b, review bundle
67
+ 11c) — the delegation replaces ONLY the build steps and Phase 2.6, never the
68
+ gates or the bundle. Then resume the per-card
66
69
  review cluster (Phase 2.55 Simplify → Phase 3 doc → 3.5 QA → 3.7 Codex) per the
67
70
  card's review_profile — for a MIXED UI+logic card /new KEEPS that cluster
68
71
  (integration.md § "What /new KEEPS"); it is fidelity-only that the skill owns.
@@ -505,8 +508,9 @@
505
508
  If > 0 new keys → spawn **`i18n-translator`** BY NAME (never `general-purpose`, never a generic agent — the context-aware fill is its exclusive domain per `agents/i18n-protocol.md`), passing: the registry path (`${paths.i18n_registry}`), the diff path, and the instruction "fill the missing target locales for the new source keys — source stays untouched". This runs AFTER the coder commit and BEFORE the step-8 gates, so locale-parity holds first-try (the fail-then-fix round-trip measured ~2M tokens on FEAT-0042). Log `i18n-fill: RAN (<n> keys)` or `i18n-fill: SKIP (no new source keys)` in the tracker. A locale-parity failure later in step 8/9 despite this pass → route back to `i18n-translator`, NEVER retry the coder on it (the coder is source-only by design).
506
509
 
507
510
  7d. **Cap-and-handoff continuation loop (v5.0.0).** If the implementer returned `partial` with a `[CAP-HANDOFF]` marker and `/tmp/checkpoint-<CARD-ID>.json` exists:
508
- - Respawn a FRESH instance of the SAME owner agent with a minimal continuation briefing: the review-bundle/arch-baseline paths + the checkpoint path + "continue from `items_remaining`; the checkpoint + baseline are your context — do NOT re-explore, do NOT re-read files already listed as done". Same card, same worktree, same ownership map.
511
+ - Respawn a FRESH instance of the SAME owner agent with a minimal continuation briefing: the arch-baseline path (+ the review-bundle path only when it already exists — it is normally built later, at 11c) + the checkpoint path + "continue from `items_remaining`; the checkpoint + baseline are your context — do NOT re-explore, do NOT re-read files already listed as done". Same card, same worktree, same ownership map.
509
512
  - **Max 2 continuations.** Still `partial` after the 2nd → do NOT keep respawning: log `[CAP-EXHAUSTED]` in `## Issues & Flags`, treat the unfinished items as `not_implemented` rows, and route through the normal gap path (AC-Closure Gate / follow-up card — the card is NOT auto-DONE). Log each continuation in the tracker: `cap-handoff: CONTINUED n=<i> (items_remaining=<k>)`.
513
+ - `[CAP-HANDOFF]` marker present but the checkpoint file MISSING → do NOT respawn blind: rebuild `items_remaining` from the completion report's `not_implemented` rows and persist it to `/tmp/checkpoint-<CARD-ID>.json` yourself, then run the continuation as above (it counts toward the max-2). If the completion report is also missing, treat as `[CAP-EXHAUSTED]` directly (gap path) — never guess what remains.
510
514
  - No `[CAP-HANDOFF]` marker → this step is a no-op.
511
515
 
512
516
  8. **Run the verification gates and CAPTURE their output to disk** (so step 9 can pass it to a fix agent) — **redirect, never `tee`/stream inline** (per § "Context economy" → Gate-output discipline). Each is its own gate:
@@ -556,7 +560,7 @@
556
560
  ```
557
561
  (`$TRUNK` is the trunk branch resolved in Phase 0; if the worktree branched from a different base, the `HEAD~1..HEAD` fallback covers the last commit.)
558
562
  Compare against this card's allowed files in `## File Ownership Map`.
559
- - **All within allowed set** → proceed to Phase 2.5.
563
+ - **All within allowed set** → proceed to 11c (the bundle build runs on EVERY card, not only after a violation).
560
564
  - **Any file outside allowed set** → log the violation in `## Issues & Flags` (`"unauthorized file: <path>"`), then run the **deterministic file-scoped revert SCRIPT** (a file-scoped revert is mechanical git plumbing, not code authoring — a script cannot fabricate or over-reach, and it runs IDENTICALLY on Claude and Codex with no dependency on a `model` param or a `general-purpose` agent Codex lacks). Resolve + run it (opt-in-with-fallback):
561
565
  ```bash
562
566
  REVERT_SH="$(ls .framework/framework/.claude/skills/new/scripts/revert-files.sh .claude/skills/new/scripts/revert-files.sh 2>/dev/null | head -1)"
@@ -577,4 +581,4 @@
577
581
  DOCINV_MJS="$(ls .framework/framework/.claude/skills/new/scripts/doc-invariants.mjs .claude/skills/new/scripts/doc-invariants.mjs 2>/dev/null | head -1)"
578
582
  [ -n "$DOCINV_MJS" ] && node "$DOCINV_MJS" --diff /tmp/diff-<CARD-ID>.txt --card <card yaml path> --config baldart.config.yml
579
583
  ```
580
- The bundle (`/tmp/review-bundle-<CARD-ID>.json`) unifies the diff dump (it writes `/tmp/diff-<CARD-ID>.txt` if missing — Phase 2.55 step 2 and the Phase 3.7 dump become consumers, not producers), the arch-baseline pointer + parsed Hot-File Map, the completion report path (backstop: if the implementer did not write `/tmp/completion-<CARD-ID>.md`, persist its returned `completion-report` block there YOURSELF before running the script), the ownership map, and the gate-log paths. **Every reviewer briefing from here on carries the binding phrase**: *"Review bundle: `/tmp/review-bundle-<CARD-ID>.json` — Read it FIRST. It lists the diff, the changed files, the arch baseline and the completion report. Do NOT re-Read source files to rebuild context you can get from those paths; for any file in `hot_files`, Read ONLY the symbol ranges listed."* Scripts missing (pre-5.0 install) → skip both, log `review-bundle: unavailable (pre-5.0 scripts)` — the reviewers derive scope themselves as before (graceful degradation, Codex-portable either way).
584
+ The bundle (`/tmp/review-bundle-<CARD-ID>.json`) unifies the diff dump (it writes `/tmp/diff-<CARD-ID>.txt` if missing — Phase 2.55 step 2 and the Phase 3.7 dump become consumers, not producers), the arch-baseline pointer + parsed Hot-File Map, the completion report path (backstop: if the implementer did not write `/tmp/completion-<CARD-ID>.md`, persist its returned `completion-report` block there YOURSELF before running the script), the ownership map, and the gate-log paths. **Every reviewer briefing from here on carries the binding phrase**: *"Review bundle: `/tmp/review-bundle-<CARD-ID>.json` — Read it FIRST. It lists the diff, the changed files, the arch baseline and the completion report. Do NOT re-Read source files to rebuild context you can get from those paths; for any file in `hot_files`, Read ONLY the symbol ranges listed."* Scripts missing (pre-5.0 install) → skip both, log `review-bundle: unavailable (pre-5.0 scripts)` — the reviewers derive scope themselves as before (graceful degradation, Codex-portable either way). Then proceed to Phase 2.5.
@@ -47,12 +47,13 @@ so it surfaces in telemetry.
47
47
  - `scopeFiles` ← this card's committed diff (`git diff --name-only "$TRUNK...HEAD"`, fallback `HEAD~1..HEAD`). **Diffs to disk (context economy, v4.43.0):** write the card's full diff to `/tmp/diff-<CARD-ID>.txt` once and derive BOTH the Step-A grep (above) and this `--name-only` list from it — never read the raw diff inline (mirrors the team-mode D.1.5 batching discipline, so the two paths stay symmetric).
48
48
  - `editableFiles` ← this card's **File Ownership Map** entries (the coder's write scope; `setup.md` step 3b).
49
49
  - `archBaselinePath` ← `/tmp/arch-baseline-<CARD-ID>.md` (persisted at `implement.md` step 5b).
50
+ - `reviewBundlePath` ← `/tmp/review-bundle-<CARD-ID>.json` when it exists (implement.md step 11c), else omit — the workflow threads it into every agent brief as the anti-re-read phrase (v5.0.1; absent → briefs unchanged, pre-5.0 behavior).
50
51
  - `hasSecurityFiles` ← any `scopeFiles` path matches `paths.high_risk_modules`.
51
52
  - `runSimplify` ← `true` (a non-trivial card always simplifies).
52
53
 
53
54
  ```
54
55
  Workflow({ name: 'new-card-review', args: {
55
- cards: [{ cardId, cardPath, scopeFiles, editableFiles, qaTier, hasSecurityFiles, runSimplify, archBaselinePath }],
56
+ cards: [{ cardId, cardPath, scopeFiles, editableFiles, qaTier, hasSecurityFiles, runSimplify, archBaselinePath, reviewBundlePath }],
56
57
  worktreePath, baseBranch, config, codexScriptPath // from Phase 0 / tracker
57
58
  }})
58
59
  ```
@@ -135,7 +136,7 @@ After completeness is verified, clean up the implementation before it reaches re
135
136
  **Step-by-step**:
136
137
 
137
138
  1. **Enter Phase 2.55 (simplify)** — **no standalone tracker write** for phase entry (§ "Context Tracking" allowlist; the tracker records only `2.55-simplify DONE` at step 6, co-emitted). Proceed directly to step 2.
138
- 2. Ensure the card diff is on disk — implement.md step 11c's review bundle already wrote `/tmp/diff-<CARD-ID>.txt` (this phase is a CONSUMER, not a producer). Only if the bundle step did not run (pre-5.0 install): `git diff > /tmp/diff-<CARD-ID>.txt` in the worktree (**redirect, not inline** — per § "Context economy" → Diffs to disk).
139
+ 2. Ensure the card diff is on disk — implement.md step 11c's review bundle already wrote `/tmp/diff-<CARD-ID>.txt` (this phase is a CONSUMER, not a producer). Only if the bundle step did not run (pre-5.0 install): `git diff "$TRUNK...HEAD" > /tmp/diff-<CARD-ID>.txt 2>/dev/null || git diff HEAD~1..HEAD > /tmp/diff-<CARD-ID>.txt` in the worktree — the coder already committed, so a bare `git diff` would be vacuous (**redirect, not inline** — per § "Context economy" → Diffs to disk).
139
140
  3. Launch **three agents in parallel** (single message). Each receives the **path** `/tmp/diff-<CARD-ID>.txt` and Reads the diff itself — do NOT paste the full diff into the prompts. When `/tmp/review-bundle-<CARD-ID>.json` exists, each briefing ALSO carries the binding anti-re-read phrase (implement.md step 11c): *"Review bundle: `/tmp/review-bundle-<CARD-ID>.json` — Read it FIRST; do NOT re-Read source files to rebuild context you can get from its paths; for `hot_files`, Read ONLY the listed symbol ranges."*
140
141
 
141
142
  - **Reuse agent** — search the codebase for existing utilities/helpers that could replace newly written code. Flag duplicated functionality, inline logic that could use existing utils.
@@ -304,9 +305,9 @@ skill's Phase 1 falls back to deriving Gherkin scenarios from
304
305
 
305
306
  > **Note**: Code review is NOT performed in this phase — it is handled by the **mandatory unconditional `/codexreview` gate in Phase 3.7**, which runs per-card BEFORE the Phase 4 commit. The post-batch `/codexreview` in the Final review remains as a final FULL-diff sweep over the entire batch (since v3.37.0 — the guaranteed full-depth merge gate). This Phase 3 focuses exclusively on documentation sync, which must happen per-card (tied to the specific commit).
306
307
 
307
- > **Deferral gate (since v4.7.0 — enumerated, `review_profile`-driven)**: SKIP per-card doc-review and defer it to the **Final Review F.3 doc-reviewer** (which runs over the entire batch) when the card is **`review_profile == light` AND its committed diff touches NO documentation file** (no `.md`, no path under `${paths.references_dir}`, no data-model/ssot/api doc). These are small code changes with no doc surface of their own; their only doc concern is drift, which the batch-wide Final doc-reviewer catches. Log `doc-review: DEFERRED to Final FULL gate (light, no doc files in diff)` and proceed to Phase 3.5. **KEEP per-card doc-review** for: `deep` cards, ANY card whose diff touches a doc file (the change IS doc-relevant), and trivial cards (doc-review is their primary gate — § "Trivial-card fast-lane", unchanged). Never defer "for time" — the only enumerated reasons are `light + non-doc diff` and the deterministic PASS-fast below.
308
+ > **Deferral gate (since v4.7.0 — enumerated, `review_profile`-driven)**: SKIP per-card doc-review and defer it to the **Final Review F.3 doc-reviewer** (which runs over the entire batch) when the card is **`review_profile == light` AND its committed diff touches NO documentation file** (no `.md`, no path under `${paths.references_dir}`, no data-model/ssot/api doc). These are small code changes with no doc surface of their own; their only doc concern is drift, which the batch-wide Final doc-reviewer catches. Log `doc-review: DEFERRED to Final FULL gate (light, no doc files in diff)` and proceed to Phase 3.5. **KEEP per-card doc-review** for: `deep` cards, `balanced` cards (they may still PASS-fast via the deterministic gate below — that gate, not this deferral, is their only skip lane), ANY card whose diff touches a doc file (the change IS doc-relevant), and trivial cards (doc-review is their primary gate — § "Trivial-card fast-lane", unchanged). Never defer "for time" — the only enumerated reasons are `light + non-doc diff` and the deterministic PASS-fast below.
308
309
  >
309
- > **Deterministic PASS-fast (v5.0.0 — measured: 84/127 per-card doc reviews returned PASS)**: when implement.md step 11c produced `/tmp/docinv-<CARD-ID>.json` AND it says `pass_fast_eligible: true` (zero non-advisory invariant rows triggered + no doc file in the diff + the card declares no `documentation_impact`/`canonical_docs`) AND the card is NOT `deep` → log `doc-review: PASS-fast (doc-invariants: 0 blocking rows) — Final doc-reviewer backstop stands` and **skip the per-card spawn** (proceed to Phase 3.5). No gate is removed: the batch-Final F.3 doc-reviewer still sees this card's diff, and the Own-Doc Closure obligations are definitionally empty when no invariant row fired and the card declared no docs. `deep` cards always spawn. Missing docinv JSON → no PASS-fast (fall through to the normal path).
310
+ > **Deterministic PASS-fast (v5.0.0 — measured: 84/127 per-card doc reviews returned PASS)**: when implement.md step 11c produced `/tmp/docinv-<CARD-ID>.json` AND it says `pass_fast_eligible: true` (zero non-advisory invariant rows triggered + no doc file in the diff + the card declares no `documentation_impact`/`canonical_docs`) AND the card is NOT `deep` → log `doc-review: PASS-fast (doc-invariants: 0 blocking rows) — Final doc-reviewer backstop stands` and **skip the per-card spawn** (proceed to Phase 3.5). No gate is removed: the batch-Final F.3 doc-reviewer still sees this card's diff. Own-Doc Closure: NEW-file obligations are definitionally empty (no invariant row fired, no docs declared); obligations on MODIFIED primitives/routes are covered by the automatic spec resync (`DS_COMPONENT_STALE` serializer gate, v4.70.0) plus the Final F.3 backstop — the invariant table's R1/R3 fire on new files only, by design. `deep` cards always spawn. Missing docinv JSON → no PASS-fast (fall through to the normal path).
310
311
 
311
312
  12. **Enter Phase 3 (doc-review)** — **no standalone tracker write** for phase entry (§ "Context Tracking" allowlist; the tracker records only `3-doc-review DONE` at step 17, co-emitted). Proceed directly to the next step.
312
313
  13. Build a **Doc Sync Context** block. The coder committed in Phase 2, so detect the card's changed files against the trunk (a bare `HEAD` diff would be empty post-commit):
@@ -396,7 +397,9 @@ skill's Phase 1 falls back to deriving Gherkin scenarios from
396
397
  - Branch: <branch-name>
397
398
  - Changed files: <list from implementation phase>
398
399
  - Review bundle: /tmp/review-bundle-<CARD-ID>.json (when present) — its `files_changed`
399
- and `gate_logs` are authoritative; do not re-derive them
400
+ is authoritative for scope (do not re-derive); its `gate_logs` are CONTEXT ONLY
401
+ (Phase-2 logs, possibly stale after Simplify/doc mutations) — the gates your tier
402
+ owns you execute yourself, never cite a bundle log as your own run
400
403
  - QA profile: [deep | balanced-escalated]
401
404
 
402
405
  Tier contract: deep → FULL suite. A BALANCED card only reaches this step when risk drift
@@ -37,16 +37,24 @@ const git = (argv) => {
37
37
  catch { return null; }
38
38
  };
39
39
 
40
+ // Ownership scope (v5.0.1): in a sequential multi-card batch the worktree's
41
+ // `trunk...HEAD` accumulates PRIOR cards' commits — an unscoped diff would make
42
+ // card N's bundle/docinv classify other cards' files. When --may-edit is passed
43
+ // (implement.md step 11c always passes it), scope the diff to this card's
44
+ // allowed files; standalone invocations without it keep the full diff.
45
+ const mayEdit = args['may-edit'] ? args['may-edit'].split(',').map((s) => s.trim()).filter(Boolean) : null;
46
+ const scopeArgs = mayEdit && mayEdit.length ? ['--', ...mayEdit] : [];
47
+
40
48
  // diff: reuse the per-card dump when present, else write it now (same command
41
49
  // as implement.md step 8 / codex-gate — this script UNIFIES the dumps).
42
50
  const diffPath = `/tmp/diff-${card}.txt`;
43
51
  if (!exists(diffPath)) {
44
- const diff = git(['diff', `${trunk}...HEAD`]) ?? git(['diff', 'HEAD~1..HEAD']);
52
+ const diff = git(['diff', `${trunk}...HEAD`, ...scopeArgs]) ?? git(['diff', 'HEAD~1..HEAD', ...scopeArgs]);
45
53
  if (diff != null) fs.writeFileSync(diffPath, diff + '\n');
46
54
  }
47
55
 
48
- // files changed (trunk-relative, uncommitted fallback)
49
- const filesChanged = (git(['diff', '--name-only', `${trunk}...HEAD`]) ?? git(['diff', '--name-only', 'HEAD~1..HEAD']) ?? '')
56
+ // files changed (trunk-relative, uncommitted fallback; card-scoped when possible)
57
+ const filesChanged = (git(['diff', '--name-only', `${trunk}...HEAD`, ...scopeArgs]) ?? git(['diff', '--name-only', 'HEAD~1..HEAD', ...scopeArgs]) ?? '')
50
58
  .split('\n').filter(Boolean);
51
59
 
52
60
  // arch baseline + Hot-File Map (deterministic parse of the architect's block:
@@ -95,9 +103,9 @@ const bundle = {
95
103
  hot_files: hotFiles,
96
104
  completion_report_path: exists(completionPath) ? completionPath : null,
97
105
  doc_invariants_path: exists(docinvPath) ? docinvPath : null,
98
- ownership_may_edit: args['may-edit'] ? args['may-edit'].split(',').map((s) => s.trim()).filter(Boolean) : null,
106
+ ownership_may_edit: mayEdit,
99
107
  gate_logs: gateLogs,
100
- generated_by: 'build-review-bundle.mjs v5.0.0',
108
+ generated_by: 'build-review-bundle.mjs v5.0.1',
101
109
  };
102
110
 
103
111
  fs.writeFileSync(out, JSON.stringify(bundle, null, 2) + '\n');
@@ -139,8 +139,11 @@ if (hasWiki) {
139
139
 
140
140
  // doc signals the PASS-fast gate also needs (computed here so the orchestrator has one source)
141
141
  const docFilesChanged = touched.filter((f) => f.endsWith('.md') || f.startsWith(refsDir) || f.startsWith(wikiDir));
142
- const cardDeclaresDocs = /documentation_impact\s*:|canonical_docs\s*:/.test(cardYaml)
143
- && !/documentation_impact\s*:\s*(\[\s*\]|null|~)\s*$/m.test(cardYaml);
142
+ // Each doc-declaration field counts independently (v5.0.1): a populated
143
+ // `canonical_docs` declares docs even when `documentation_impact: []`.
144
+ const declares = (key) => new RegExp(`${key}\\s*:`).test(cardYaml)
145
+ && !new RegExp(`${key}\\s*:\\s*(\\[\\s*\\]|null|~)\\s*$`, 'm').test(cardYaml);
146
+ const cardDeclaresDocs = declares('documentation_impact') || declares('canonical_docs');
144
147
 
145
148
  const result = {
146
149
  card: args.card ? path.basename(args.card, '.yml') : null,
@@ -150,7 +153,7 @@ const result = {
150
153
  doc_files_changed: docFilesChanged,
151
154
  card_declares_docs: cardDeclaresDocs,
152
155
  pass_fast_eligible: triggered.filter((t) => !t.advisory).length === 0 && docFilesChanged.length === 0 && !cardDeclaresDocs,
153
- generated_by: 'doc-invariants.mjs v5.0.0',
156
+ generated_by: 'doc-invariants.mjs v5.0.1',
154
157
  };
155
158
  emit(result);
156
159
 
@@ -2,6 +2,15 @@
2
2
 
3
3
  Formato: [Keep a Changelog](https://keepachangelog.com/) · [SemVer](https://semver.org/).
4
4
 
5
+ ## 1.4.1 — 2026-07-03
6
+
7
+ - **Multi-card diff scoping (framework v5.0.1)**: the implement brief now instructs the coder
8
+ to persist `/tmp/diff-<ID>.txt` SCOPED to its MAY-EDIT paths (`git diff $TRUNK...HEAD -- …`) —
9
+ the shared batch worktree accumulates prior cards' commits, and an unscoped dump leaked them
10
+ into card N's bundle/docinv. `new-card-review.js` gains the optional `reviewBundlePath` card
11
+ arg (anti-re-read phrase in every brief when present; absent → unchanged). `new2-resolve.js`
12
+ comment re-anchored to the code-reviewer DS rule renumbering (Post-Intervention = rule 7).
13
+
5
14
  ## 1.4.0 — 2026-07-03
6
15
 
7
16
  - **BALDART 5.0 mirrors (framework v5.0.0)**: `new2.js` gains the deterministic mirrors of the /new pipeline wave — impl brief builds the review bundle + doc-invariants JSON and declares the tool-call budget; cap-and-handoff continuation loop (max 2, `cap-handoff` ledger rows); explicit `i18n-translator` fill spawn (`i18n-fill` ledger row); reviewer briefs carry the bundle anti-re-read phrase + the specialist-dispatch suppression; `fixPassModel` arg (default `sonnet`, overlay kill-switch) threads to `new2-resolve`'s coder fixers (specialists never downgraded).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: new2
3
3
  effort: high
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  description: >
6
6
  Workflow-hosted batch engine for /new. Implements one or
7
7
  more backlog cards end-to-end by delegating the WHOLE batch to a background
@@ -14,12 +14,14 @@ export const meta = {
14
14
  // ───────────────────────────────────────────────────────────────────────────
15
15
  // args contract — supplied by the /new skill (it owns git + tracker + human gates):
16
16
  // cards [{ cardId, cardPath, scopeFiles[], editableFiles[], qaTier,
17
- // hasSecurityFiles, runSimplify, archBaselinePath }]
17
+ // hasSecurityFiles, runSimplify, archBaselinePath, reviewBundlePath }]
18
18
  // sequential → length 1; team-mode → the whole group/wave.
19
19
  // scopeFiles files the card's committed diff touched (review surface)
20
20
  // editableFiles ownership-map files the coder MAY write (fix scope)
21
21
  // qaTier 'light' | 'full' (qa-sentinel runs only at 'full'; else deferred to Final)
22
22
  // archBaselinePath /tmp/arch-baseline-<id>.md (or null)
23
+ // reviewBundlePath /tmp/review-bundle-<id>.json (v5.0.1, or null — briefs gain the
24
+ // anti-re-read phrase when present; absent → unchanged, fail-open)
23
25
  // worktreePath string the batch worktree (agents cd into it)
24
26
  // baseBranch string trunk the diff is taken against
25
27
  // config object resolved baldart.config.yml (paths.* … )
@@ -252,15 +254,27 @@ const FIX_SCHEMA = {
252
254
  }
253
255
 
254
256
  // ---- Shared brief fragments -------------------------------------------------
257
+ // Review bundles (v5.0.1 — anti-re-read handoff, implement.md step 11c): when the
258
+ // orchestrator passed reviewBundlePath, every brief carries the binding phrase.
259
+ // Absent → briefs unchanged (pre-5.0 orchestrator / standalone), fail-open.
260
+ const bundlePaths = dedupe(cards.map((c) => c.reviewBundlePath).filter(Boolean))
261
+ const waveBundleBrief = bundlePaths.length
262
+ ? `Review bundle(s): ${bundlePaths.join(', ')} — Read them FIRST; do NOT re-Read source files to rebuild context you can get from their paths; for hot_files, Read ONLY the listed symbol ranges.`
263
+ : null
264
+
255
265
  const waveBrief = [
256
266
  `Worktree: ${a.worktreePath || '(cwd)'}`,
257
267
  `Base branch for the diff: ${a.baseBranch || '(trunk)'}`,
258
268
  `Cards under review (Read each YAML for acceptance_criteria + entrypoints):\n${cards.map((c) => `${c.cardId} — ${c.cardPath || '(no path)'}`).join('\n')}`,
259
269
  `ALL changed files in this wave (review every one):\n${unionScope.join('\n')}`,
270
+ ...(waveBundleBrief ? [waveBundleBrief] : []),
260
271
  ].join('\n\n')
261
272
 
262
273
  function cardScopeBrief(c) {
263
- return `Card ${c.cardId} — files changed (review surface):\n${asArr(c.scopeFiles).join('\n') || '(none)'}`
274
+ const bundle = c.reviewBundlePath
275
+ ? `\nReview bundle: ${c.reviewBundlePath} — Read it FIRST; do NOT re-Read source files to rebuild context you can get from its paths; for hot_files, Read ONLY the listed symbol ranges.`
276
+ : ''
277
+ return `Card ${c.cardId} — files changed (review surface):\n${asArr(c.scopeFiles).join('\n') || '(none)'}${bundle}`
264
278
  }
265
279
 
266
280
  // ───────────────────────────────────────────────────────────────────────────
@@ -116,7 +116,7 @@ const fixerOpts = fixerAgent === 'coder' ? { model: fixPassModel } : {}
116
116
  // finding's domain: doc fixes judged by doc-reviewer (code-reviewer judging prose was
117
117
  // cross-domain), test fixes by qa-sentinel (THE test specialist). `ui` and `code` stay with
118
118
  // code-reviewer: the judge verifies a CODE change, which is code-reviewer's charter
119
- // (including DS-coherence rule 8 for UI). Fixer and judge of the same type are still two
119
+ // (including the DS Post-Intervention Coherence check — code-reviewer DS rule 7 for UI). Fixer and judge of the same type are still two
120
120
  // independent instances — the judge prompt is adversarial and greps the files itself.
121
121
  const judgeAgent = (domain === 'security' || domain === 'migration') ? 'security-reviewer'
122
122
  : domain === 'perf' ? 'api-perf-cost-auditor'
@@ -618,7 +618,7 @@ async function runCard(cardId, cardPath) {
618
618
  impl = await agentSafe(
619
619
  `Implement card ${cardId} per ${REF}/implement.md Phase 2 — you ARE the owner_agent '${ownerAgent}' — and ${REF}/completeness.md (Phase 2.5 + 2.5b AC-closure ledger). Run all gates/bash yourself.\n${bindingBit}\n${phase1Brief}\n\n${cardBrief}\n\n` +
620
620
  `TOOL-CALL BUDGET (v5.0.0 cap-and-handoff — implement.md step 7 briefing section): soft ~80 tool calls, hard 100. Crossing the soft cap (or re-reading the same files): commit WIP ([${cardId}] WIP checkpoint), write /tmp/checkpoint-${cardId}.json per coder.md § Tool-Call Budget & Checkpoint, and return partial:true + checkpointPath + the [CAP-HANDOFF] marker in note. At the hard cap STOP even mid-task — a fresh continuation finishes cheaper than 100 more calls on a bloated context.\n\n` +
621
- `POLICIES: G26 Phase-2 lint/tsc/test/build failing after the module's retry cap → buildBlocked:true + blockedGate. Build the AC Closure Ledger (one row per AC: implemented|unmet|policy-deferred). DO NOT silently defer; report unmet rows (excluding policy-deferred). Persist the diff to /tmp/diff-${cardId}.txt AND your completion-report block to /tmp/completion-${cardId}.md. LAST STEP (v5.0.0 review bundle — implement.md step 11c): run \`node "$(ls .claude/skills/new/scripts/build-review-bundle.mjs .framework/framework/.claude/skills/new/scripts/build-review-bundle.mjs 2>/dev/null | head -1)" --card ${cardId} --worktree "$(pwd)" --trunk ${JSON.stringify(TRUNK)} --may-edit "<your mayEditPaths, comma-separated>"\` then \`node "$(ls .claude/skills/new/scripts/doc-invariants.mjs .framework/framework/.claude/skills/new/scripts/doc-invariants.mjs 2>/dev/null | head -1)" --diff /tmp/diff-${cardId}.txt --card <card yaml path> --config baldart.config.yml\` (both scripts missing → skip, note 'bundle-unavailable').\n\n` +
621
+ `POLICIES: G26 Phase-2 lint/tsc/test/build failing after the module's retry cap → buildBlocked:true + blockedGate. Build the AC Closure Ledger (one row per AC: implemented|unmet|policy-deferred). DO NOT silently defer; report unmet rows (excluding policy-deferred). Persist the diff SCOPED to your MAY-EDIT paths (\`git diff ${JSON.stringify(TRUNK)}...HEAD -- <mayEditPaths>\` — the shared worktree accumulates prior cards' commits, an unscoped dump would include them; v5.0.1) to /tmp/diff-${cardId}.txt AND your completion-report block to /tmp/completion-${cardId}.md. LAST STEP (v5.0.0 review bundle — implement.md step 11c): run \`node "$(ls .claude/skills/new/scripts/build-review-bundle.mjs .framework/framework/.claude/skills/new/scripts/build-review-bundle.mjs 2>/dev/null | head -1)" --card ${cardId} --worktree "$(pwd)" --trunk ${JSON.stringify(TRUNK)} --may-edit "<your mayEditPaths, comma-separated>"\` then \`node "$(ls .claude/skills/new/scripts/doc-invariants.mjs .framework/framework/.claude/skills/new/scripts/doc-invariants.mjs 2>/dev/null | head -1)" --diff /tmp/diff-${cardId}.txt --card <card yaml path> --config baldart.config.yml\` (both scripts missing → skip, note 'bundle-unavailable').\n\n` +
622
622
  `E4 OWNERSHIP RECONCILE (implement.md §11b — do this BEFORE returning): the card's MAY-EDIT includes files_likely_touched ∪ paths NAMED EXPLICITLY in this card's acceptance_criteria/definition_of_done (e.g. an ADR the DoD says to update, the data-model / ER doc for a schema change). Editing THOSE is in-scope. For any OTHER dirty file outside MAY-EDIT (another card's file, or unrelated): \`git checkout -- <file>\` to revert it (NEVER leave it orphaned), list it in revertedOutOfOwnership. Set fileDiffViolation:true ONLY if such an edit genuinely could not be reverted (then say why in note) — it is no longer a silent label.\n\n` +
623
623
  `Return: { epic, buildBlocked, blockedGate, unmetACs:[{n,text}], scopeFiles, mayEditPaths, revertedOutOfOwnership:[paths], fileDiffViolation, note }`,
624
624
  { label: `implement:${cardId}`, phase: 'Implement', agentType: ownerAgent,
@@ -90,7 +90,7 @@ if (error) {
90
90
 
91
91
  > **SSOT.** This section is the canonical policy for reference-aliasing mutation
92
92
  > hazards. It is cited as the source of truth by `coder.md`
93
- > (§ Reference-Aliasing Mutation Hazards), `code-reviewer.md` (review checklist),
93
+ > (§ Code Standards & Author-Time Simplicity Discipline — 1-line binding since v5.0.0), `code-reviewer.md` (review checklist),
94
94
  > and `.claude/skills/new/references/{completeness,codex-gate}.md` (Phase 2.5 step 5c
95
95
  > deterministic detector + Phase 3.7 gate). When those files cite "§ Reference-Aliasing Mutation
96
96
  > Patterns", they mean this section.
@@ -163,7 +163,7 @@ the helper's JSDoc so future editors find the contract.
163
163
  ### Enforcement layers
164
164
 
165
165
  - **This section** — full policy + JSDoc contract + remediation menu.
166
- - `coder.md § Reference-Aliasing Mutation Hazards` — pre-implementation check.
166
+ - `coder.md § Code Standards & Author-Time Simplicity Discipline` (1-line binding) — pre-implementation check.
167
167
  - `code-reviewer.md` review checklist — flags un-guarded patterns at review time.
168
168
  - `.claude/skills/new/references/completeness.md § Phase 2.5 step 5c` — deterministic
169
169
  detector that flags un-guarded patterns as `[ALIAS-MUTATION] BLOCKER` in
@@ -18,8 +18,13 @@ audits), `wiki-curator` (coverage signals), the `full-sweep` routine.
18
18
  - **Dispatch**: `agents/doc-audit-protocol.md SECTION=<audit-process|drift-validators|topological-generation|epistemic-metadata|scip-refs|schema-drift|coverage-gauges>`.
19
19
  Grep for `### SECTION: <name>` and Read ONLY the sections your run needs.
20
20
  - **When**: audit mode = invoked WITHOUT card context (general audit, nightly
21
- run, cleanup) or explicitly told "full audit". A per-card invocation NEVER
22
- needs this module.
21
+ run, cleanup) or explicitly told "full audit". A per-card invocation does NOT
22
+ read this module wholesale — the ONLY exceptions are the sections the agent
23
+ core CITES explicitly (v5.0.1): `epistemic-metadata` + `scip-refs` (ADR
24
+ quantitative claims), `topological-generation` (a per-card pass writing MORE
25
+ than one doc file), `schema-drift` (a documented payload's field SET changed
26
+ in the diff). Everything else (audit-process, drift-validators,
27
+ coverage-gauges) stays audit-only.
23
28
  - **Graceful degradation (MANDATORY)**: every `npm run validate:*` /
24
29
  `scripts/*.mjs` referenced here is a project-specific example — check the
25
30
  project's `package.json` first, run only what exists, and skip each absent
@@ -147,7 +152,7 @@ model) · `external-reference` (vendor docs, public benchmark).
147
152
  4. Is `confidence` calibrated (a vendor cost quote is rarely `high`)?
148
153
 
149
154
  Run `node scripts/validate-frontmatter.mjs --evidence-only` before finalizing
150
- (advisory, exit 0). See `docs/references/frontmatter-standard.md § Optional
155
+ (advisory, exit 0). See `${paths.references_dir}/frontmatter-standard.md § Optional
151
156
  epistemic metadata`.
152
157
 
153
158
  ### SECTION: scip-refs
@@ -162,7 +167,7 @@ SCIP symbol IDs survive moves/renames as long as the index is rebuilt —
162
167
  F1=80.4% link survival vs ~66% with path-only refs (arXiv 2506.16440).
163
168
 
164
169
  **Frontmatter contract** (full spec:
165
- `docs/references/frontmatter-standard.md § Code References`):
170
+ `${paths.references_dir}/frontmatter-standard.md § Code References`):
166
171
  ```yaml
167
172
  code_refs:
168
173
  - symbol: 'src/lib/permissions/middleware.ts#checkPermission()'
@@ -258,7 +258,7 @@ After update, these files exist locally and are authoritative:
258
258
  | Numeric reference tables (type / contrast / spacing / density) | `.framework/framework/agents/design-system-protocol.md` § "Reference Tables (embed)" |
259
259
  | Token cascade primitive → semantic → component | `.framework/framework/agents/design-system-protocol.md` § "Token Cascade" |
260
260
  | Upgraded `ui-expert` (states taxonomy, red flags, gates) | `.framework/framework/.claude/agents/ui-expert.md` |
261
- | Code-reviewer rule 8 (merge gate) | `.framework/framework/.claude/agents/code-reviewer.md` § "Design System Compliance" rule 8 |
261
+ | Code-reviewer Post-Intervention Coherence (merge gate) | `.framework/framework/.claude/agents/code-reviewer.md` § "Design System Compliance" rule 7 (Post-Intervention Coherence Check) |
262
262
  | `ui-design` Step H (design-time gate) | `.framework/framework/.claude/skills/ui-design/SKILL.md` |
263
263
  | Performance Gates (CWV 2026, LCP/INP/CLS) | `.framework/framework/.claude/skills/frontend-design/SKILL.md` § "Performance Gates" |
264
264
  | Motion + reduced-motion + View Transitions | `.framework/framework/.claude/skills/motion-design/reference/accessibility-and-modern-apis.md` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baldart",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Claude Agent Framework - Reusable framework for coordinating AI agents and humans in software projects",
5
5
  "bin": {
6
6
  "baldart": "./bin/baldart.js"