@nklisch/pi-agile-workflow 0.16.1 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/docs/ARCHITECTURE.md +42 -21
  4. package/docs/PRINCIPLES.md +108 -38
  5. package/docs/SPEC.md +19 -2
  6. package/docs/VISION.md +17 -10
  7. package/hooks/scripts/prompt-context.py +8 -1
  8. package/hooks/scripts/test_prompt_context.py +16 -0
  9. package/package.json +1 -1
  10. package/scripts/work-view.sh +1 -1
  11. package/skills/autopilot/SKILL.md +54 -37
  12. package/skills/convert/SKILL.md +30 -4
  13. package/skills/epic-design/SKILL.md +21 -3
  14. package/skills/feature-design/SKILL.md +34 -11
  15. package/skills/gate-cruft/SKILL.md +69 -24
  16. package/skills/gate-docs/SKILL.md +56 -30
  17. package/skills/gate-patterns/SKILL.md +7 -3
  18. package/skills/gate-refactor/SKILL.md +18 -6
  19. package/skills/gate-security/SKILL.md +16 -7
  20. package/skills/gate-tests/SKILL.md +86 -71
  21. package/skills/implement/SKILL.md +18 -8
  22. package/skills/principles/SKILL.md +76 -21
  23. package/skills/principles/references/advisory-review.md +8 -1
  24. package/skills/principles/references/code-design.md +62 -5
  25. package/skills/principles/references/models.md +69 -57
  26. package/skills/refactor-design/SKILL.md +23 -13
  27. package/skills/review/SKILL.md +39 -19
  28. package/skills/review/references/review-lenses.md +14 -4
  29. package/skills/review/references/substrate-side-effects.md +17 -10
  30. package/skills/review/references/target-resolution.md +2 -1
  31. package/skills/scope/SKILL.md +20 -7
  32. package/work-view/crates/cli/.work-view-version +1 -1
  33. package/work-view/dist/aarch64-apple-darwin/work-view +0 -0
  34. package/work-view/dist/aarch64-unknown-linux-musl/work-view +0 -0
  35. package/work-view/dist/x86_64-apple-darwin/work-view +0 -0
  36. package/work-view/dist/x86_64-unknown-linux-musl/work-view +0 -0
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  name: gate-tests
3
3
  description: >
4
- Test-quality gate that scans items bound to a release for test coverage gaps. Delegates the full
5
- analysis to a deep test scanner agent which derives expected coverage from each bound item's
6
- acceptance criteria (NOT from implementation code), maps existing test coverage, identifies gaps,
7
- and returns findings. The orchestrator converts findings into gate_origin:tests items in
4
+ Test-quality gate focused on release-bound items that may follow relevant evidence into adjacent
5
+ interfaces and test systems. Derives useful coverage from contracts, risk, and bug history—not
6
+ line coverage—and identifies both valuable gaps and low-value tests worth removing. Delegates the
7
+ analysis to a deep test scanner agent, which maps existing coverage and
8
+ returns findings. The orchestrator converts findings into gate_origin:tests items in
8
9
  .work/active/. Auto-triggers during /agile-workflow:release-deploy.
9
10
  ---
10
11
 
@@ -24,16 +25,18 @@ in the release body.
24
25
 
25
26
  ## Core principle
26
27
 
27
- The gate's principle: **tests derive from specs, not implementations**. Each
28
- bound item's acceptance criteria IS the spec. The scanner verifies those
29
- criteria are covered, finds gaps, and returns them. It also checks the seams
30
- BETWEEN bound items integration coverage where one item's output feeds
31
- another.
28
+ The gate's principle: **tests must earn their upkeep**. Tests derive from
29
+ stable contracts, meaningful risks, and regressions learned from real bugs—not
30
+ from implementation shape or a demand to cover every line. Prefer important
31
+ public interfaces and cross-item seams. Unit tests belong around genuinely
32
+ complex isolated logic, not every wrapper or branch. The gate identifies both
33
+ high-value gaps and duplicate, tautological, brittle, obsolete, or
34
+ implementation-bound tests that should be removed.
32
35
 
33
- Tests derived from reading implementation code are tautological they verify
34
- that the code does what the code does. Tests derived from specs verify what
35
- the code *should* do. That's where bugs live. The scanner brief enforces this
36
- discipline.
36
+ Bound items are the focus, not a hard scan boundary. Follow concrete evidence
37
+ into adjacent interfaces, shared test infrastructure, dependencies, or a whole
38
+ test/check system when needed. Bind findings to the release only when materially
39
+ relevant; route ambient discoveries to the unbound backlog.
37
40
 
38
41
  ## Trigger
39
42
 
@@ -90,8 +93,10 @@ test-design techniques to find gaps, and returns structured findings.
90
93
  **Brief template**:
91
94
 
92
95
  > You are conducting a test-quality gate for release `<version>`. Core
93
- > principle: **tests derive from specs, not implementations**. Each bound
94
- > item's acceptance criteria IS the spec.
96
+ > principle: **tests must earn their upkeep**. Derive tests from stable
97
+ > contracts, meaningful risk, and bug regressions—not implementation shape or
98
+ > universal coverage. Acceptance criteria are evidence of intent, not a mandate
99
+ > for one automated test per statement.
95
100
  >
96
101
  > Use read/search/shell tools as needed. Do not spawn nested sub-agents or implement
97
102
  > fixes.
@@ -143,32 +148,35 @@ test-design techniques to find gaps, and returns structured findings.
143
148
  > - Implementation units / unit names
144
149
  > - Public interface surface (functions, types, endpoints exposed)
145
150
  >
146
- > These four axes plus the explicit acceptance criteria form the spec.
151
+ > These axes and acceptance criteria describe candidate behavior. Rank them
152
+ > by consequence, stability, complexity, and demonstrated failure history
153
+ > before deciding that automated coverage is worthwhile.
147
154
  >
148
- > 2. **Map existing test coverage.** For each bound item, find tests that
155
+ > 2. **Map existing test value and coverage.** For each bound item, find tests that
149
156
  > reference its implementation. For files changed by item `<id>`, list all
150
157
  > tests covering those files. For each test, identify which acceptance
151
- > criterion or behavioral contract it verifies. Cite file:line. Note any
152
- > tests that appear to mirror implementation step-by-step (tautological —
153
- > should be reworked or deleted). Do NOT read implementation bodies; only
154
- > test files and types. Read 2-3 key test files yourself to verify the map.
158
+ > criterion, interface, regression, or complex unit it protects. Cite
159
+ > file:line. Flag tests that mirror implementation step-by-step, duplicate
160
+ > stronger interface coverage, exercise trivial wrappers, or protect obsolete
161
+ > behavior; recommend deletion when removal preserves useful confidence.
162
+ > Read implementation only to establish complexity, interfaces, or whether a
163
+ > test is coupled to internals—not to invent an assertion target. Read 2-3
164
+ > key test files yourself to verify the map.
155
165
  >
156
- > 3. **Apply test-design techniques** for each acceptance criterion not
157
- > covered by tests:
158
- > - **Equivalence partitioning** — one test per valid partition, one per
159
- > invalid
160
- > - **Boundary value analysis** — for ranges: just-below, at, just-above
161
- > - **Decision table** — for criteria with multiple conditions, enumerate
162
- > combinations
163
- > - **State transition** for state changes, test valid transitions and
164
- > verify invalid ones are rejected
166
+ > 3. **Apply test-design techniques selectively** to high-value contracts not
167
+ > already covered. Use only the techniques justified by actual risk:
168
+ > - **Equivalence partitioning** — choose representative partitions where
169
+ > distinctions matter
170
+ > - **Boundary value analysis** — sample consequential range boundaries
171
+ > - **Decision table** — cover combinations with materially different outcomes
172
+ > - **State transition** — cover important valid transitions and invalid ones
173
+ > the contract promises to reject
165
174
  > - **Error guessing (spec-driven)** — anything described as "should
166
175
  > not", "must not", "invalid", "error", "reject"
167
176
  >
168
- > 4. **Adversarial coverage** — for each bound item, surface failure
169
- > expectations along these axes. If the item body or design doesn't
170
- > state the answer, the gap itself is a finding (`stage: drafting`,
171
- > `tags: [testing]`):
177
+ > 4. **Risk review** — for each bound item, consider failure expectations along
178
+ > these axes only where the project's scope and consequences make them
179
+ > meaningful. Silence in the spec is not automatically a testing finding:
172
180
  > 1. Invalid input — when a caller passes invalid data, what should
173
181
  > happen? (Reject? Fall back? Log and continue?)
174
182
  > 2. Missing config — when required configuration is absent, what's the
@@ -182,9 +190,8 @@ test-design techniques to find gaps, and returns structured findings.
182
190
  > 6. Interrupted operations — if a multi-step operation is interrupted,
183
191
  > what's the expected end state?
184
192
  >
185
- > Where the spec is silent, produce either: (a) a `[testing]` story to
186
- > write the test once the spec is settled, or (b) a `[documentation]`
187
- > story to extend the spec with the missing assertion target.
193
+ > Where the spec is silent, emit a finding only when the missing contract is
194
+ > consequential for this project. Otherwise record that no test is warranted.
188
195
  >
189
196
  > 5. **Map e2e seams.** For items with `depends_on` chains, check whether
190
197
  > the seam between them is tested:
@@ -197,16 +204,17 @@ test-design techniques to find gaps, and returns structured findings.
197
204
  > feature's overall acceptance criteria are e2e-covered, not just
198
205
  > per-story unit-covered.
199
206
  >
200
- > 6. **Classify gaps**:
207
+ > 6. **Classify findings**:
201
208
  > | Priority | Definition |
202
209
  > |---|---|
203
- > | Critical | Acceptance criterion with no test |
204
- > | High | Boundary or error case from spec, no test |
205
- > | Medium | Valid partition or rule combination, no test |
206
- > | Low | Complementary coverage |
210
+ > | Critical | High-consequence public contract or known regression lacks protection |
211
+ > | High | Important interface, seam, or complex behavior lacks useful coverage |
212
+ > | Medium | Material confidence gain, but not release-critical |
213
+ > | Low | Ambient improvement or low-value test removal proposal |
207
214
  >
208
- > Also flag tautological tests found during step 2 they need rework or
209
- > deletion.
215
+ > No finding is created merely because a line, branch, unit, edge, or
216
+ > acceptance statement lacks its own test. Also classify relevance as
217
+ > `Release-relevant` or `Ambient`, and flag low-value tests for deletion.
210
218
  >
211
219
  > **Output format** — return a single markdown document with:
212
220
  >
@@ -216,10 +224,12 @@ test-design techniques to find gaps, and returns structured findings.
216
224
  > ### Finding 1
217
225
  > - **Title**: <one-line: spec condition not covered>
218
226
  > - **Priority**: Critical | High | Medium | Low
219
- > - **Bound item**: `<item-id>`
220
- > - **Acceptance criterion**: <quote the criterion>
221
- > - **Gap type**: missing test for valid partition / boundary / error case /
222
- > adversarial-spec-silent / e2e-seam / tautological-rework
227
+ > - **Bound item**: `<item-id>` | none
228
+ > - **Relevance**: Release-relevant | Ambient
229
+ > - **Value protected**: public interface | seam | complex unit | bug regression | test removal
230
+ > - **Contract / risk / regression evidence**: <quote or concrete evidence>
231
+ > - **Gap type**: important-interface / complex-unit / bug-regression /
232
+ > e2e-seam / low-value-test-removal
223
233
  > - **Suggested test**:
224
234
  > ```<lang>
225
235
  > // Sketch of the test — name, scenario, assertion target.
@@ -241,14 +251,14 @@ test-design techniques to find gaps, and returns structured findings.
241
251
  > ```
242
252
  >
243
253
  > **Rules**:
244
- > - Derive tests from specs, NOT from implementation code. If you find
245
- > yourself reading a function body to decide what to verify, stop — go
246
- > back to the spec.
247
- > - Test the public interface, not internal implementation.
248
- > - Cite spec references in every finding. A finding without a spec
249
- > reference is testing an assumption, not a contract.
250
- > - Prioritize invalid input, error cases, boundary conditions.
251
- > - Audit only the bundle's items, not the whole repo.
254
+ > - Derive assertion targets from contracts, risk, and bug history—not
255
+ > implementation steps. Implementation may establish complexity or coupling.
256
+ > - Prefer public interfaces and meaningful seams over internal implementation.
257
+ > - Cite a contract, demonstrated risk, bug regression, or concrete maintenance
258
+ > cost for every finding. No evidence means no test work.
259
+ > - Do not chase universal edge, branch, line, or surface coverage.
260
+ > - Bound items are the focus, not a hard boundary. Follow concrete evidence and
261
+ > record why out-of-bundle test systems were inspected.
252
262
  > - Skip already-tracked.
253
263
  >
254
264
  > **Test integrity findings** (additional pass — flag and surface as
@@ -259,8 +269,9 @@ test-design techniques to find gaps, and returns structured findings.
259
269
  > assertions.
260
270
  > - Tests that were silenced rather than diagnosed: broad `skip` /
261
271
  > `xfail` / `it.todo` with no linked backlog id or written reason.
262
- > - Tests deleted in the bundle's commits with no replacement coverage
263
- > for the same acceptance criterion. (Check `git log` of the bundle.)
272
+ > - Tests deleted in the bundle's commits when the removal leaves an important
273
+ > interface, complex behavior, or known regression without useful protection.
274
+ > (Check `git log` of the bundle.)
264
275
  > - Tests whose assertion was rewritten to match new-but-undocumented
265
276
  > behavior — i.e. the test was made to follow the code instead of the
266
277
  > code being made to follow the spec.
@@ -289,7 +300,7 @@ stage: implementing # critical/high
289
300
  tags: [testing]
290
301
  parent: null
291
302
  depends_on: []
292
- release_binding: <version>
303
+ release_binding: <version> | null # null for ambient findings
293
304
  gate_origin: tests
294
305
  created: YYYY-MM-DD
295
306
  updated: YYYY-MM-DD
@@ -300,9 +311,9 @@ updated: YYYY-MM-DD
300
311
  ## Priority
301
312
  Critical | High | Medium | Low
302
313
 
303
- ## Spec reference
304
- Item: `<bound-item-id>`
305
- Acceptance criterion: <quote the criterion>
314
+ ## Value evidence
315
+ Item: `<bound-item-id>` (or `none` for ambient findings)
316
+ Contract / risk / regression / maintenance cost: <concrete evidence>
306
317
 
307
318
  ## Gap type
308
319
  <missing test for valid partition / boundary / error case / etc.>
@@ -316,6 +327,10 @@ Acceptance criterion: <quote the criterion>
316
327
  `<test-file-path>` (following project conventions)
317
328
  ```
318
329
 
330
+ Release-relevant findings use the normal priority mapping and bind to the
331
+ release. Ambient findings—including repository-wide low-value test systems
332
+ merely discovered by the scan—go to the unbound backlog regardless of priority.
333
+
319
334
  Default priority -> placement mapping:
320
335
  - **Critical** / **High** → `stage: implementing` in `.work/active/stories/`
321
336
  - **Medium** → `stage: drafting` in `.work/active/stories/`
@@ -327,8 +342,8 @@ Tautological tests get items too:
327
342
  # id: gate-tests-rework-<original-test-slug>
328
343
  # kind: story
329
344
  # tags: [testing, refactor]
330
- # Body describes which test is tautological and what spec behavior it should be
331
- # rewritten to verify (or marked for deletion).
345
+ # Body describes why the test adds too little confidence for its upkeep and
346
+ # whether it should be rewritten around a valuable contract or deleted.
332
347
  ```
333
348
 
334
349
  ### Phase 5: Commit
@@ -343,7 +358,8 @@ git commit -m "gate-tests: <N> coverage gaps for <version>"
343
358
  In conversation:
344
359
  - **Bundle**: `<version>` — `<N>` items audited
345
360
  - **Coverage gaps**: count by priority
346
- - **Tautological tests flagged**: count
361
+ - **Low-value tests flagged for removal**: count
362
+ - **Ambient findings**: count routed to unbound backlog
347
363
  - **Items created**: count, with new ids
348
364
  - **Already-tracked**: count of duplicates skipped
349
365
 
@@ -352,12 +368,11 @@ In conversation:
352
368
  - **The analysis happens in the scanner agent, not here.** Your job is bundle
353
369
  prep, dispatch, and item-writing. Don't replicate the scanner's contract
354
370
  extraction or coverage mapping.
355
- - The scanner brief enforces "specs not implementations". Don't substitute
356
- your own judgment for findings.
357
- - Cite spec references in every item body. The scanner provides them.
358
- - Prioritize invalid input, error cases, boundary conditions — that's where
359
- bugs hide and specs are most often undertested.
360
- - Audit only the bundle's items, not the whole repo.
371
+ - The scanner brief enforces contract/risk/regression value over implementation
372
+ shape or coverage metrics. Don't substitute line-coverage pressure.
373
+ - Cite the contract, risk, regression, or maintenance cost in every item body.
374
+ - Release-bound items define focus, not a hard boundary. Follow concrete
375
+ evidence, but route ambient discoveries to the unbound backlog.
361
376
  - A failing test that exposes a real spec violation is the most valuable
362
377
  output. Don't sand it down — surface it as a Critical finding so the
363
378
  implementation gets fixed before shipping.
@@ -169,7 +169,8 @@ In land mode:
169
169
  as-built reality (paths, interfaces, signatures).
170
170
  2. Validate — typecheck, lint, tests scoped to touched packages
171
171
  (`pnpm --filter`, `cargo -p`, `pytest <path>`).
172
- 3. Fill test gaps for any meaningful behavior that lacks coverage.
172
+ 3. Fill high-value test gaps at stable interfaces, for complex logic, or for
173
+ demonstrated regressions; remove obsolete or low-value tests exposed by the work.
173
174
  4. Skip Phase 6 (no new code) and go straight to Phase 7 (notes — log
174
175
  "Land mode" explicitly), Phase 8 (verify), Phase 9 (commit + advance).
175
176
 
@@ -196,13 +197,19 @@ For code items:
196
197
  For each unit/file in the item's design:
197
198
  1. Write the code following the design's specifications — exact types, signatures,
198
199
  contracts
199
- 2. Apply established patterns from the codebase
200
- 3. Handle every error path the design specifies
201
- 4. Write tests that verify behavior, not implementation
200
+ 2. Apply established patterns from the codebase without adding speculative layers
201
+ 3. Handle the error paths and guarantees the design actually requires
202
+ 4. Write tests only where they protect an important interface, complex unit, or
203
+ demonstrated regression; remove low-value tests the change makes obsolete
202
204
  5. Update module exports (index files) so new code integrates cleanly
205
+ 6. Run an elimination pass over the touched area: delete, inline, or consolidate
206
+ code, checks, abstractions, compatibility paths, and test machinery made
207
+ unnecessary by the implementation
203
208
 
204
- Take pride in the details: clean variable names, idiomatic control flow, meaningful
205
- error messages. Code that a future developer would read with appreciation.
209
+ Safe behavior-preserving cleanup that is cohesive with the touched code is part
210
+ of the task. Park larger or unrelated cleanup, and stop for a design decision
211
+ before weakening behavior, guarantees, validation, compatibility, or safety.
212
+ Prefer short, direct, readable code over a generalized framework.
206
213
 
207
214
  ### Phase 7: Update item body with implementation notes
208
215
 
@@ -213,7 +220,8 @@ Append (or update) an "Implementation notes" section in the item's body:
213
220
  - Execution capability: <choice and brief risk/scope rationale>
214
221
  - Review weight: <effective value and source: caller, project, or default>
215
222
  - Files changed: <list>
216
- - Tests added: <list>
223
+ - Tests added/removed: <list and the interface, complexity, or regression value>
224
+ - Simplification: <code, checks, abstractions, or compatibility paths removed/consolidated>
217
225
  - Discrepancies from design: <list with one-line explanation each, or "none">
218
226
  - Adjacent issues parked: <list of backlog ids if any, or "none">
219
227
  ```
@@ -294,6 +302,8 @@ In conversation:
294
302
  - If you discover a genuine design flaw, don't muscle through. Append a
295
303
  `## Implementation discovery` section, set stage back to `drafting`, and
296
304
  return. The design family will pick it up on the next pass.
297
- - Adjacent issues you notice get parked via `/agile-workflow:park`, not bundled.
305
+ - Safe, cohesive simplification in the touched area belongs in the task. Park
306
+ larger, unrelated, or behavior-changing opportunities instead of silently
307
+ expanding scope.
298
308
  - Test integrity is non-negotiable: follow the project rules and worker posture;
299
309
  fix bad tests, park real production bugs, and never game tests.
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: principles
3
3
  description: >
4
- agile-workflow principles — code-design (Ports & Adapters, Single Source of Truth, Generated
5
- Contracts, Fail Fast) and substrate-execution (Item-IS-the-Work, Rolling-Foundation, Late-Binding).
4
+ agile-workflow principles — code-design (clear boundaries, proportional rigor, code economy,
5
+ useful tests, and continuous simplification) and substrate-execution (Item-IS-the-Work,
6
+ Rolling-Foundation, Late-Binding).
6
7
  Auto-loads when designing modules, defining interfaces, writing or implementing code, scoping work
7
8
  in the substrate, advancing stages, scoping releases, or any time the agile-workflow
8
9
  design/implement/review skills are active.
@@ -23,7 +24,7 @@ Each principle has guidance for design time and implementation time.
23
24
 
24
25
  # Part I — Code-Design Principles
25
26
 
26
- These four invariants stay active during design and implementation. Load
27
+ These principles stay active during design and implementation. Load
27
28
  [references/code-design.md](references/code-design.md) when concrete mechanics,
28
29
  checklists, or examples are needed.
29
30
 
@@ -44,11 +45,35 @@ Boundary types derive from the schema, router, database model, or a generation
44
45
  step. Consumers import or infer that contract instead of maintaining hand-written
45
46
  copies.
46
47
 
47
- ## 4. Fail Fast
48
+ ## 4. Fail Fast—Where It Matters
48
49
 
49
- Validate unknown input at system boundaries and assert internal preconditions at
50
- function entry. Reject invalid state early with specific errors instead of
51
- letting it fail deep in the call chain.
50
+ Validate untrusted input and required external contracts at system boundaries.
51
+ Add internal checks only when the project's actual risks justify them. Do not
52
+ manufacture exhaustive invariants, edge handling, determinism, or defensive
53
+ layers that the product's scope and consequences do not need.
54
+
55
+ ## 5. Code Economy
56
+
57
+ Short, direct code is a virtue when it stays clear. Prefer fewer concepts,
58
+ layers, branches, options, and lines over speculative generality. Match rigor to
59
+ the project's context rather than engineering every codebase as critical
60
+ infrastructure.
61
+
62
+ ## 6. Tests Earn Their Keep
63
+
64
+ Test stable interfaces, important behavior, and regressions learned from real
65
+ bugs. Unit-test genuinely complex units, not every wrapper, branch, or line.
66
+ Tests are maintained code: remove duplicate, tautological, implementation-bound,
67
+ or otherwise low-value tests when their upkeep exceeds the confidence they add.
68
+
69
+ ## 7. Leave It Simpler
70
+
71
+ Exploration, design, and implementation include an elimination pass. In the
72
+ area being touched, look for code, tests, checks, abstractions, compatibility
73
+ paths, and complexity that the feature can make unnecessary. Fold safe,
74
+ cohesive cleanup into the work or create explicit cleanup/refactor stories;
75
+ park broader opportunities. Question whole systems when warranted, but ask the
76
+ user before removing behavior, guarantees, validation, compatibility, or safety.
52
77
 
53
78
  ---
54
79
 
@@ -60,7 +85,7 @@ dispatch. The agent applies these whenever operating on `.work/` or `docs/`,
60
85
  and whenever choosing discovery or implementation dispatch during substrate
61
86
  work.
62
87
 
63
- ## 5. Item-IS-the-Work
88
+ ## 8. Item-IS-the-Work
64
89
 
65
90
  The unit of work is its file. The brief, the design, the implementation notes, and the review findings all accumulate in the item's body as stages advance. Reading the file IS reading the state of the work.
66
91
 
@@ -100,9 +125,9 @@ The unit of work is its file. The brief, the design, the implementation notes, a
100
125
 
101
126
  ---
102
127
 
103
- ## 6. Rolling-Foundation
128
+ ## 9. Rolling-Foundation
104
129
 
105
- Foundation docs (`docs/VISION.md`, `docs/SPEC.md`, `docs/ARCHITECTURE.md`, and any others) describe the project's vision (future-looking) and current intent what is true now, OR what will be true once in-flight design lands. They roll forward in place as either evolves. No legacy comments. Git carries history; the doc carries truth.
130
+ Foundation docs (`docs/VISION.md`, `docs/SPEC.md`, `docs/ARCHITECTURE.md`, and any others) describe what is true now or the future state the project intends to reach. A future-state claim remains valid before implementation exists. Foundation docs are selective standing context, not an exhaustive inventory: silence about a capability is allowed. They roll forward when an assertion becomes false, stale, or contradictory. Git carries history; the doc carries truth.
106
131
 
107
132
  ### Two timing styles
108
133
 
@@ -111,7 +136,7 @@ Both are legitimate; the project picks one or mixes per change size:
111
136
  - **Code-first (default for routine features):** docs update at implementation merge, in the same commit set as the code that lands the change.
112
137
  - **Design-first (for large scope, initial ideation, architectural shifts):** docs preflight-update at scope time, leading the code through the implementation window. The doc temporarily describes an intended near-future state. The agile-workflow `scope` skill operates this way for large scope; `ideate` operates this way at project bootstrap.
113
138
 
114
- The discipline is identical in both styles: replace stale assertions in place, never accumulate "previously" / "in v1.x" / migration prose. `gate-docs` at release-deploy time is the backstop it catches drift between intent and reality regardless of which timing style was used.
139
+ The discipline is identical in both styles: replace stale assertions in place, never accumulate "previously" / "in v1.x" / migration prose. `gate-docs` is an assertion-consistency backstop: it catches false, stale, or contradictory claims, but never treats missing coverage or merely unimplemented future intent as drift.
115
140
 
116
141
  ### What this forbids
117
142
 
@@ -123,16 +148,16 @@ The discipline is identical in both styles: replace stale assertions in place, n
123
148
 
124
149
  ### What this enables
125
150
 
126
- - A new contributor reads the doc and learns the system as it IS or as it is meant to imminently become — not as it was
151
+ - A new contributor reads the doc and learns the system as it is or as it is intended to become — not as it was
127
152
  - Foundation docs stay short and current rather than growing with every change
128
153
  - `git log docs/<file>.md` shows every rolling-forward edit — perfect audit trail
129
- - Discrepancies between intent (what the doc asserts) and reality (what code does) become bugs that gate-docs surfaces, not historical artifacts
154
+ - False, stale, or contradictory assertions become bugs that gate-docs surfaces; omissions and not-yet-implemented future claims do not
130
155
 
131
156
  ### At design time
132
157
 
133
158
  - When scoping a feature that changes a foundation-doc assertion, decide the timing: code-first (defer the doc update) or design-first (preflight the update as part of scope)
134
159
  - For large-scope `scope` operations, design-first is the default — `scope` rolls foundation docs forward as part of the same operation
135
- - Identify which foundation doc(s) need rolling forward; reading them at design time prevents stale assumptions
160
+ - Identify any existing foundation assertions the design changes or contradicts; do not add coverage merely because the docs omit the capability
136
161
  - If a feature's design contradicts a foundation doc, EITHER the design is wrong OR the doc is. Resolve before designing the implementation.
137
162
 
138
163
  ### At implementation time
@@ -140,19 +165,20 @@ The discipline is identical in both styles: replace stale assertions in place, n
140
165
  - If working code-first: after implementing a change, ask "what does a foundation doc now say that's no longer true?" — update assertions in place, commit with the implementation
141
166
  - If working design-first: the doc was preflight-updated at scope time. Verify the implementation matches the doc's assertion; if it deviates, adjust whichever was wrong (implementation or assertion).
142
167
  - Replace stale assertions in place. Delete the old text. Never append.
143
- - The `gate-docs` skill runs at release-deploy time and produces items for any remaining drift but the goal is to leave it nothing to find.
168
+ - The `gate-docs` skill produces items only for remaining false, stale, or contradictory assertions—not missing coverage or unimplemented future intent.
144
169
 
145
170
  ### Design checklist
146
171
 
147
- - [ ] Every assertion in SPEC and ARCHITECTURE reflects current code OR imminent in-flight design (no stale assertions from cancelled work)
172
+ - [ ] Every assertion in SPEC and ARCHITECTURE is true for the current or intended-future state it claims (no stale assertions from superseded intent)
148
173
  - [ ] VISION.md reflects the project's current direction, not past direction
149
174
  - [ ] No "previously" / "originally" / "in v1.x" prose anywhere in `docs/`
150
- - [ ] When a feature changes behavior or direction, foundation docs update in the same commit set as the change (code-first) or were preflight-updated and are still accurate (design-first)
175
+ - [ ] When a feature invalidates an existing foundation assertion, that assertion updates in the same commit set (code-first) or was preflight-updated and remains accurate (design-first)
176
+ - [ ] No finding or edit was created solely because foundation docs omit a capability or describe future intent not yet implemented
151
177
  - [ ] `git log docs/<file>.md` shows the audit trail; the doc shows the present
152
178
 
153
179
  ---
154
180
 
155
- ## 7. Late-Binding
181
+ ## 10. Late-Binding
156
182
 
157
183
  Items advance stages when work actually completes. Releases bind items only when the user cuts a version. Foundation docs are not pre-decided into a phase plan. Work happens, then commitments crystallize — not the other way around.
158
184
 
@@ -192,7 +218,7 @@ Items advance stages when work actually completes. Releases bind items only when
192
218
 
193
219
  ---
194
220
 
195
- ## 8. Agent Dispatch Economy
221
+ ## 11. Agent Dispatch Economy
196
222
 
197
223
  Sub-agents are for breadth, isolation, independent judgment, or parallel
198
224
  implementation with clear write ownership. They are not a replacement for
@@ -363,12 +389,36 @@ for their owning stories.
363
389
  reason. A slow top-tier reviewer is not a failure until its appropriately
364
390
  sized timeout or mechanism reports failure.
365
391
  - **Strict completion:** final autopilot completion must clear a successful
366
- review path and resolve or file accepted findings. At weights `light` through
392
+ review path and adjudicate every proposed finding. At weights `light` through
367
393
  `maximum`, that path must use a supported fresh-context reviewer; if it fails,
368
394
  the run is blocked rather than complete. At explicit weight `none`, documented
369
395
  implementation verification and acceptance evidence satisfy the path without
370
396
  independent review.
371
397
 
398
+ ## Recipient-owned finding disposition
399
+
400
+ Reviewer output is evidence, not authority. The receiving agent orchestrating the
401
+ run independently verifies each claim and assigns its disposition against the
402
+ repository's actual context: acceptance criteria, supported users and deployment
403
+ shape, likelihood, blast radius, recoverability, existing safeguards, and the
404
+ cost of delaying the current work. A reviewer's `blocker` label never binds the
405
+ receiver by itself, and disagreement is resolved by evidence rather than
406
+ seniority or model strength.
407
+
408
+ A finding blocks the current cycle only when the receiver judges it a credible,
409
+ material risk to required correctness, security, data integrity, public
410
+ contracts, acceptance criteria, release safety, or trustworthy verification.
411
+ Fix those findings now or keep an active item that prevents completion. Park a
412
+ valid concern below that bar in the unbound backlog with its risk rationale and
413
+ continue; leave nits in review notes, and reject unsupported findings with a
414
+ brief reason. Rarity alone does not make a case irrelevant, but a corner case's
415
+ likelihood and consequence must justify its delivery cost. Repetition across
416
+ review passes does not elevate severity by itself.
417
+
418
+ A successful review path therefore means independent scrutiny ran when required
419
+ and the receiving agent adjudicated the results. It does not mean every reviewer
420
+ suggestion was implemented or promoted into the active queue.
421
+
372
422
  User instructions and project-level review/egress rules override defaults. Do
373
423
  not invoke an external peer mechanism when policy prohibits it. `--only-questions`
374
424
  is user alignment and therefore skips advisory review.
@@ -398,12 +448,17 @@ family (`gate-cruft`, `gate-security`, `gate-tests`, `gate-docs`,
398
448
 
399
449
  | Arg | Behavior |
400
450
  |---|---|
401
- | no arg / `--all` | Sweep the relevant scope (whole codebase, or release bundle for gates) |
451
+ | no arg / `--all` | Sweep the relevant scope; release-bound items are a gate's focus, not a hard scan boundary |
402
452
  | `<path>` | Scope to that subtree |
403
453
  | `<NL scope>` | Interpret free text against the codebase; log the interpretation |
404
454
  | `<feature-id>` (where applicable) | Per-feature design mode (refactor-design, perf-design) |
405
455
 
406
456
  These skills *emit substrate items as findings* rather than gating pass/fail.
457
+ For release gates, follow relevant evidence into adjacent dependencies, shared
458
+ infrastructure, or system-wide mechanisms. Bind findings to the release only
459
+ when they are caused by, exposed by, or materially relevant to it; route merely
460
+ ambient discoveries to unbound backlog proposals so a gate does not silently
461
+ expand release scope.
407
462
 
408
463
  ## Per-item design verbs
409
464
 
@@ -44,6 +44,12 @@ Always run completeness before attack:
44
44
  attack pass; completed artifacts may use the same bounded convergence shape.
45
45
  Verify concrete claims before accepting them.
46
46
 
47
+ The receiving/orchestrating agent owns the verdict on every returned finding.
48
+ Apply Part IV's material-risk threshold in repository context; do not inherit a
49
+ reviewer's severity label. Fix or activate only current-cycle blockers, park
50
+ valid lower-priority concerns in the unbound backlog, and reject unsupported
51
+ claims with a reason.
52
+
47
53
  For deep or complex work, use a different model class for Phase 2 than Phase 1
48
54
  when two classes are available. Their disagreement is evidence to investigate,
49
55
  not a vote. For routine design, do not turn a focused advisory pass into a
@@ -58,7 +64,8 @@ Summarize evidence and decisions in the item body; never paste transcripts:
58
64
  - Invoked because: <risk or uncertainty>
59
65
  - Phase 1 — advisory/completeness: <reviewer class and useful gaps>
60
66
  - Phase 2 — adversarial: <reviewer class and failure modes>
61
- - Accepted: <adjustments with phase>
67
+ - Fixed/active blockers: <material current-cycle risks and disposition>
68
+ - Parked: <valid lower-priority concerns and risk rationale>
62
69
  - Rejected: <points and reasons with phase>
63
70
  - Skipped/degraded: <phase and reason, if any>
64
71
  ```