@punks/cli 3.1.10 → 3.1.12

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 (76) hide show
  1. package/dist/BASELINE_CHANGELOG.md +61 -0
  2. package/dist/CHANGELOG.md +57 -0
  3. package/dist/data/subagents/manifest.mjs +11 -6
  4. package/dist/index.js +28 -28
  5. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -0
  6. package/dist/skills/agnostic/docs/writing-beats/LICENSE +21 -0
  7. package/dist/skills/agnostic/docs/writing-beats/UPSTREAM.md +11 -0
  8. package/dist/skills/agnostic/docs/writing-fragments/LICENSE +21 -0
  9. package/dist/skills/agnostic/docs/writing-fragments/UPSTREAM.md +11 -0
  10. package/dist/skills/agnostic/docs/writing-shape/LICENSE +21 -0
  11. package/dist/skills/agnostic/docs/writing-shape/UPSTREAM.md +11 -0
  12. package/dist/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +24 -42
  13. package/dist/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +1 -1
  14. package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +51 -78
  15. package/dist/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +89 -212
  16. package/dist/skills/agnostic/generic/handoff/LICENSE +21 -0
  17. package/dist/skills/agnostic/generic/handoff/UPSTREAM.md +11 -0
  18. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +1 -1
  19. package/dist/skills/agnostic/planning/create-plan/SKILL.md +19 -7
  20. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +19 -0
  21. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +27 -10
  22. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -2
  23. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +22 -6
  24. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +12 -0
  25. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +10 -2
  26. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +10 -1
  27. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +2 -0
  28. package/dist/skills/agnostic/quality/autoreview/SKILL.md +11 -2
  29. package/dist/skills/agnostic/quality/codebase-design/LICENSE +21 -0
  30. package/dist/skills/agnostic/quality/codebase-design/UPSTREAM.md +11 -0
  31. package/dist/skills/agnostic/quality/review/LICENSE +21 -0
  32. package/dist/skills/agnostic/quality/review/SKILL.md +16 -11
  33. package/dist/skills/agnostic/quality/review/UPSTREAM.md +11 -0
  34. package/dist/skills/agnostic/quality/tdd/LICENSE +21 -0
  35. package/dist/skills/agnostic/quality/tdd/UPSTREAM.md +11 -0
  36. package/dist/skills/agnostic/research/improve-codebase-architecture/LICENSE +21 -0
  37. package/dist/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +11 -0
  38. package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
  39. package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
  40. package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
  41. package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
  42. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
  43. package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
  44. package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
  45. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +199 -0
  46. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +31 -0
  47. package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +4 -0
  48. package/dist/skills/languages/python/python-backend-structure/SKILL.md +91 -0
  49. package/dist/skills/languages/python/python-backend-structure/agents/openai.yaml +4 -0
  50. package/dist/skills/languages/python/python-design-patterns/SKILL.md +93 -69
  51. package/dist/skills/languages/python/python-project-structure/SKILL.md +4 -247
  52. package/dist/skills/phases/delivery-phase/SKILL.md +13 -4
  53. package/dist/skills/phases/delivery-phase/phases/closeout.md +3 -0
  54. package/dist/skills/phases/delivery-phase/phases/debug.md +8 -1
  55. package/dist/skills/phases/delivery-phase/phases/implement.md +11 -2
  56. package/dist/skills/phases/delivery-phase/phases/review.md +50 -29
  57. package/dist/skills/phases/delivery-phase/phases/router.md +56 -36
  58. package/dist/skills/phases/delivery-phase/references/artifact-state.md +8 -2
  59. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +60 -10
  60. package/dist/skills/phases/finder-phase/references/root-routing.md +6 -1
  61. package/dist/skills/phases/prototype-phase/agents/openai.yaml +2 -0
  62. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +622 -0
  63. package/dist/skills/phases/review-phase/SKILL.md +11 -42
  64. package/dist/skills/phases/review-phase/agents/openai.yaml +2 -0
  65. package/dist/skills/phases/review-phase/phases/prepare-review.md +105 -0
  66. package/dist/skills/phases/review-phase/phases/retain-report.md +113 -0
  67. package/dist/skills/phases/review-phase/phases/return-route.md +95 -0
  68. package/dist/skills/phases/review-phase/phases/router.md +78 -0
  69. package/dist/skills/phases/review-phase/phases/run-review.md +128 -0
  70. package/dist/skills/phases/review-phase/references/durable-report.md +153 -0
  71. package/dist/skills/phases/review-phase/references/runtime-handoff.md +138 -0
  72. package/dist/skills/phases/review-phase/references/state-graph.md +69 -0
  73. package/dist/skills/phases/review-phase/references/targets.md +156 -0
  74. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +819 -0
  75. package/package.json +56 -2
  76. package/dist/skills/phases/review-phase/REFERENCE.md +0 -147
@@ -0,0 +1,622 @@
1
+ # Review Phase Graph Authoring Handoff
2
+
3
+ This is the graph-authoring record. It is separate from review runtime
4
+ handoffs, retained reports, and delivery handoffs.
5
+
6
+ ## Router Selection
7
+
8
+ Phase: router
9
+
10
+ Status: complete
11
+
12
+ Scope: Convert the canonical `review-phase` runtime skill to a graph without
13
+ changing its explicit-only invocation or readonly review boundary.
14
+
15
+ Artifacts:
16
+
17
+ - Existing `SKILL.md`, `REFERENCE.md`, `references/state-graph.md`,
18
+ `references/targets.md`, `references/durable-report.md`, and
19
+ `scripts/review-contract.mjs` inspected.
20
+ - Existing delivery and standalone states, authority, retention, and terminal
21
+ behavior supply complete router inputs.
22
+
23
+ Validation:
24
+
25
+ - Bounds and obligations are already fixed by the accepted review graph.
26
+ - State and authority references cover review entry, running, retention,
27
+ routing, terminal failure, terminal exhaustion, cold resume, and downstream
28
+ delivery ownership.
29
+ - The old root contained executable review steps and the target router was
30
+ absent, so `write-router.md` was the single selected authoring phase.
31
+
32
+ Domain state: `write-router` selected from current artifacts. No earlier
33
+ qualification, state-model, or authority repair is required.
34
+
35
+ Next suggested route: `write-router.md`
36
+
37
+ Blockers: none
38
+
39
+ Resume identity: none; current target artifacts reconstruct the selection.
40
+
41
+ ## Write Router Outcome
42
+
43
+ Phase: write-router
44
+
45
+ Status: complete
46
+
47
+ Scope: Replace the executable root with bootstrap-only guidance and add the
48
+ deterministic cold-resume router.
49
+
50
+ Artifacts:
51
+
52
+ - `SKILL.md`: explicit-only bootstrap with one router pointer.
53
+ - `phases/router.md`: evidence authority, conflict tie-breaks, complete legal
54
+ state coverage, and single-valued route precedence.
55
+ - `AUTHORING-HANDOFF.md`: durable graph-authoring outcome.
56
+
57
+ Validation:
58
+
59
+ - Root contains invocation policy and bootstrap only; executable review work is
60
+ absent.
61
+ - Router precedence returns one gate filename or one terminal, checkpoint, or
62
+ blocked outcome.
63
+ - Every selected gate filename is flat under `phases/`.
64
+ - Cold resume derives from current evidence and committed artifacts rather than
65
+ transcript continuity.
66
+
67
+ Domain state:
68
+
69
+ - Pending gate files: `prepare-review.md`, `run-review.md`, `retain-report.md`,
70
+ and `return-route.md`. These filenames are intentional future targets and are
71
+ not links until write-phases creates them.
72
+ - Pending runtime handoff obligation: define every gate exit and the discoverable
73
+ review-owned durable handoff contract in `define-handoffs.md`.
74
+ - Pending disclosure obligation: prove bootstrap -> router -> one selected gate
75
+ reachability and sibling isolation in `verify-disclosure.md`.
76
+ - Pending test obligation: exercise the nine authoring route scenarios and the
77
+ runtime legal-state matrix in `test-routes.md`.
78
+ - Pending audit obligation: verify every mandatory obligation, route, pointer,
79
+ handoff, validator, and terminal guard in `audit.md`.
80
+
81
+ Next suggested route: `write-phases.md`
82
+
83
+ Blockers: none
84
+
85
+ Resume identity: none; current target artifacts reconstruct the outcome.
86
+
87
+ ## Router Re-entry After Gate Authoring
88
+
89
+ Phase: router
90
+
91
+ Status: complete
92
+
93
+ Scope: Recompute the graph-authoring route after all router-selected runtime
94
+ gate files were written.
95
+
96
+ Artifacts:
97
+
98
+ - `phases/prepare-review.md`, `phases/run-review.md`,
99
+ `phases/retain-report.md`, and `phases/return-route.md` exist as flat gate
100
+ files selected by `phases/router.md`.
101
+ - The obsolete root review reference still contained executable lens,
102
+ validation, evidence, and route-output steps already owned by the gates.
103
+
104
+ Validation:
105
+
106
+ - Every router-selected gate filename exists exactly once under `phases/`.
107
+ - Every gate has the normalized guard, inputs, actor boundary, bounded action,
108
+ invariants, completion evidence, exits, durable handoff, and stop or re-entry
109
+ categories.
110
+ - Executable work remained duplicated in a target reference, so the
111
+ `write-phases.md` completion guard had not passed.
112
+
113
+ Domain state: `write-phases` remained the single selected authoring phase until
114
+ the obsolete executable reference was deleted.
115
+
116
+ Next suggested route: `write-phases.md`
117
+
118
+ Blockers: none
119
+
120
+ Resume identity: none; current gate and reference artifacts reconstruct the
121
+ selection.
122
+
123
+ ## Write Phases Outcome
124
+
125
+ Phase: write-phases
126
+
127
+ Status: complete
128
+
129
+ Scope: Finish the flat runtime gate layer and leave executable review work only
130
+ inside router-selected gate files.
131
+
132
+ Artifacts:
133
+
134
+ - `phases/prepare-review.md`: entry validation, normalization, identity,
135
+ delivery-budget recovery, and frozen predecessor evidence.
136
+ - `phases/run-review.md`: one frozen all-lens review, adversarial skill evidence,
137
+ readonly validation, findings, and local immutable report assembly.
138
+ - `phases/retain-report.md`: report validation, freshness, uniqueness, envelope
139
+ retention, retained authority, and pass projection.
140
+ - `phases/return-route.md`: retained-pass revalidation and deterministic readonly
141
+ route output.
142
+ - The obsolete root review reference was deleted after its executable material
143
+ moved into the four gates. Shared operational references under `references/`
144
+ remain evidence and schema authority only.
145
+
146
+ Validation:
147
+
148
+ - The router selects exactly the four flat gate filenames listed above, and
149
+ every selected file exists.
150
+ - Each gate contains exactly one normalized category set: Entry Guard, Inputs,
151
+ Actor-Like Gate Boundary, Bounded Action, Invariants, Completion Evidence,
152
+ Declared Exits, Durable Handoff, and Stop Or Router Re-entry.
153
+ - Gate ownership is bounded: preparation freezes evidence, review creates the
154
+ local report, retention establishes durable authority, and return emits
155
+ routing evidence.
156
+ - Root bootstrap and target references contain no executable gate body.
157
+ - No gate directly loads a sibling gate; nonterminal exits stop or re-enter the
158
+ router.
159
+
160
+ Domain state:
161
+
162
+ - Gate authoring is complete.
163
+ - Pending runtime handoff obligation: define shared storage, latest-applicable
164
+ record discovery, gate exit coverage, and the zero-write exhaustion exception
165
+ in `define-handoffs.md`.
166
+ - Pending disclosure obligation: prove bootstrap -> router -> one gate context
167
+ reachability and sibling isolation in `verify-disclosure.md`.
168
+ - Pending test obligation: exercise all nine authoring scenarios and the full
169
+ runtime route matrix in `test-routes.md`.
170
+ - Pending audit obligation: verify every obligation, route, pointer, handoff,
171
+ validator, and terminal guard in `audit.md`.
172
+
173
+ Next suggested route: `define-handoffs.md`
174
+
175
+ Blockers: none
176
+
177
+ Resume identity: none; current target artifacts reconstruct the outcome.
178
+
179
+ ## Router Re-entry After Gate Completion
180
+
181
+ Phase: router
182
+
183
+ Status: complete
184
+
185
+ Scope: Recompute the graph-authoring route after the root, router, and four
186
+ runtime gates became complete.
187
+
188
+ Artifacts:
189
+
190
+ - The four gates declared durable outcomes but deferred shared storage and
191
+ latest-applicable discovery.
192
+ - Delivery already exposes a caller-owned phase handoff; standalone review had
193
+ no deterministic repository-local runtime handoff path.
194
+
195
+ Validation:
196
+
197
+ - Gate files and router coverage are complete.
198
+ - Stateful exit coverage, shared categories, storage, discovery, reconciliation,
199
+ and no-write exceptions were incomplete.
200
+ - `define-handoffs.md` was therefore the single selected authoring phase.
201
+
202
+ Domain state: `define-handoffs` selected from current gate and delivery-handoff
203
+ evidence.
204
+
205
+ Next suggested route: `define-handoffs.md`
206
+
207
+ Blockers: none
208
+
209
+ Resume identity: none; current artifacts reconstruct the selection.
210
+
211
+ ## Define Handoffs Outcome
212
+
213
+ Phase: define-handoffs
214
+
215
+ Status: complete
216
+
217
+ Scope: Define one exact, cold-resumable runtime handoff contract for delivery
218
+ and standalone review modes.
219
+
220
+ Artifacts:
221
+
222
+ - `references/runtime-handoff.md`: mode-specific storage, exact
223
+ `review-handoff-v1` categories and fields, append/reconciliation rules,
224
+ cold-resume discovery, evidence authority, and no-write outcomes.
225
+ - `phases/router.md`: discovers the applicable runtime record before route
226
+ precedence and persists router-owned stateful outcomes.
227
+ - All four gate Durable Handoff sections point to the shared contract rather
228
+ than restating storage or schema.
229
+
230
+ Validation:
231
+
232
+ - Delivery mode reuses the validated caller-provided delivery handoff and
233
+ creates no second delivery authority.
234
+ - Standalone mode derives one repository-local path from canonical lineage and
235
+ run identities.
236
+ - Every stateful gate exit and retained-ref checkpoint writes the exact shared
237
+ category shape when storage is valid.
238
+ - Explicit no-write outcomes are limited to already-authoritative exhaustion,
239
+ not-due delivery state, pre-storage terminal or blocker evidence, conflict,
240
+ and identical rediscovery.
241
+ - Cold resume selects the highest valid attempt only after mode, lineage, run,
242
+ scope, schema, and current freshness checks; direct evidence and fresh
243
+ artifacts outrank handoff state and suggestions.
244
+
245
+ Domain state:
246
+
247
+ - Runtime handoff authoring is complete; no irreducible state remains.
248
+ - Pending disclosure obligation: prove bootstrap -> router -> selected gate ->
249
+ runtime handoff reachability and sibling isolation in `verify-disclosure.md`.
250
+ - Pending test obligation: exercise all nine authoring scenarios, both storage
251
+ modes, no-write exceptions, conflicts, and the runtime route matrix in
252
+ `test-routes.md`.
253
+ - Pending audit obligation: verify every obligation, route, pointer, handoff,
254
+ validator, and terminal guard in `audit.md`.
255
+
256
+ Next suggested route: `verify-disclosure.md`
257
+
258
+ Blockers: none
259
+
260
+ Resume identity: none; current target artifacts reconstruct the outcome.
261
+
262
+ ## Router Re-entry After Handoff Completion
263
+
264
+ Phase: router
265
+
266
+ Status: complete
267
+
268
+ Scope: Recompute the graph-authoring route after the shared runtime handoff
269
+ contract became complete.
270
+
271
+ Artifacts:
272
+
273
+ - `SKILL.md`, `phases/router.md`, all four flat gates, and
274
+ `references/runtime-handoff.md` exist and agree on stop, re-entry, storage,
275
+ and cold-resume ownership.
276
+ - Evidence and schema references remained reachable only through runtime
277
+ branches that need them.
278
+
279
+ Validation:
280
+
281
+ - Root bootstrap, router selection, gate files, and runtime handoff exist.
282
+ - Handoff storage and discovery are complete, while context traces, pointer
283
+ reachability, and sibling isolation had no durable verification outcome.
284
+ - `verify-disclosure.md` was therefore the single selected authoring phase.
285
+
286
+ Domain state: `verify-disclosure` selected from current bootstrap, router,
287
+ gate, reference, and runtime-handoff evidence.
288
+
289
+ Next suggested route: `verify-disclosure.md`
290
+
291
+ Blockers: none
292
+
293
+ Resume identity: none; current artifacts reconstruct the selection.
294
+
295
+ ## Verify Disclosure Outcome
296
+
297
+ Phase: verify-disclosure
298
+
299
+ Status: complete
300
+
301
+ Scope: Prove explicit invocation reaches the bootstrap, router, exactly one
302
+ selected gate, and only the conditional evidence needed by that gate.
303
+
304
+ Artifacts:
305
+
306
+ - `phases/router.md`: every gate output is a resolvable link, sibling isolation
307
+ is explicit, and the state model has a conditional evidence trigger.
308
+ - `phases/retain-report.md` and `phases/return-route.md`: nonterminal re-entry
309
+ resolves back to the router.
310
+ - `references/durable-report.md`: schema and retained-pass evidence no longer
311
+ point forward into a sibling gate.
312
+
313
+ Validation:
314
+
315
+ - Explicit `$review-phase` invocation loads `SKILL.md`, then
316
+ `phases/router.md`. Terminal, checkpoint, and blocked rows return directly;
317
+ each executable row loads exactly one of `prepare-review.md`,
318
+ `run-review.md`, `retain-report.md`, or `return-route.md`.
319
+ - Prepare conditionally reaches target/identity evidence and the runtime
320
+ handoff; run reaches report schema and the runtime handoff; retain and return
321
+ reach report validity, the executable validator, and the runtime handoff.
322
+ - All four gates re-enter only the router. No gate or selected-gate reference
323
+ links to a sibling gate.
324
+ - Every Markdown pointer in bootstrap, router, gates, and references resolves.
325
+ `references/state-graph.md`, `targets.md`, `durable-report.md`, and
326
+ `runtime-handoff.md` are reachable from the router or their consuming gate.
327
+ - References contain state evidence, identity/report schemas, validation
328
+ predicates, and shared handoff storage/discovery only. Gate-local guards,
329
+ bounded actions, exits, and stop behavior remain in flat phase files.
330
+
331
+ Domain state:
332
+
333
+ - Progressive disclosure and sibling isolation are complete.
334
+ - Pending test obligation: exercise all nine authoring scenarios, both runtime
335
+ storage modes, no-write outcomes, conflicts, and every router class in
336
+ `test-routes.md`.
337
+ - Pending audit obligation: verify every obligation, route, pointer, handoff,
338
+ validator, and terminal guard in `audit.md`.
339
+
340
+ Next suggested route: `test-routes.md`
341
+
342
+ Blockers: none
343
+
344
+ Resume identity: none; current artifacts reconstruct the outcome.
345
+
346
+ ## Router Re-entry After Disclosure Completion
347
+
348
+ Phase: router
349
+
350
+ Status: complete
351
+
352
+ Scope: Recompute the graph-authoring route after progressive-disclosure and
353
+ sibling-isolation evidence became complete.
354
+
355
+ Artifacts:
356
+
357
+ - Bootstrap, router, four flat gates, conditional references, and the runtime
358
+ handoff were complete and reachable.
359
+ - `tests/review-phase-graph.contract.test.mjs` still targeted the deleted root
360
+ `REFERENCE.md` and stale pre-graph wording.
361
+
362
+ Validation:
363
+
364
+ - Disclosure completion was durable.
365
+ - The focused route contract was observed RED at 16/23: seven assertions still
366
+ addressed deleted or relocated authority.
367
+ - The nine authoring route predictions and runtime storage/no-write cases were
368
+ not yet executable or recorded, so `test-routes.md` was the single route.
369
+
370
+ Domain state: `test-routes` selected from current graph artifacts and observed
371
+ RED contract evidence.
372
+
373
+ Next suggested route: `test-routes.md`
374
+
375
+ Blockers: none
376
+
377
+ Resume identity: none; current artifacts and test output reconstruct the
378
+ selection.
379
+
380
+ ## Test Routes Outcome
381
+
382
+ Phase: test-routes
383
+
384
+ Status: complete
385
+
386
+ Scope: Exercise every runtime router class, both handoff storage modes,
387
+ authoritative no-write outcomes, conflicts, and the nine authoring scenarios.
388
+
389
+ Artifacts:
390
+
391
+ - `tests/review-phase-graph.contract.test.mjs`: graph-owned gate assertions,
392
+ ordered router-output coverage, and runtime handoff storage/reconciliation
393
+ coverage.
394
+ - Route predictions were frozen before contract derivation:
395
+
396
+ | Scenario | Predicted route | Derived route | Match | Repair if mismatch |
397
+ | --- | --- | --- | --- | --- |
398
+ | Baseline path | Fresh valid `review_due` -> `prepare-review.md` | Priorities 1-11 do not match; priority 12 selects `prepare-review.md` | Yes | none |
399
+ | Branch path | Complete fresh local report without retained authority -> `retain-report.md` | Priority 10 selects `retain-report.md` | Yes | none |
400
+ | Repair cycle | Delivery repair changes the target and persists new `review_due` -> `prepare-review.md` | Fresh mutation invalidates later review evidence; priority 12 selects `prepare-review.md` and review opens no repair | Yes | none |
401
+ | Human checkpoint | Fresh report requires an unapproved retained ref -> checkpoint `retained_ref_approval_required` | Priority 3 wins before retention mutation | Yes | none |
402
+ | Cold resume | Highest valid same-run attempt is fresh `review_running`, with no complete report -> `run-review.md` | Discovery selects that attempt; priority 11 selects `run-review.md` | Yes | none |
403
+ | Stale, out-of-scope, or invalid artifact | Stale local report -> `prepare-review.md`; out-of-scope handoff with no valid current context -> blocked `review_context_blocked`; invalid active retained candidate -> terminal `review_failed` | Freshness rejects stale evidence at priority 12; scope rejection leaves priority 5; invalid candidate matches priority 1 | Yes | none |
404
+ | Contradictory suggested route loses to evidence | Suggestion says `retain-report.md`, but one fresh retained pass lacks returned routing -> `return-route.md` | Fresh artifact authority outranks suggestion; priority 9 selects `return-route.md` | Yes | none |
405
+ | Nested executor substitution with an actor-like gate boundary | Fresh `review_running` remains `run-review.md` while a narrower readonly executor returns advisory evidence | Parent gate validates executor output and retains exit ownership; priority 11 remains `run-review.md` until a complete report exists | Yes | none |
406
+ | Premature completion rejected by terminal guard | Fresh retained standalone report without durable returned routing -> `return-route.md`, not `review_complete` | Terminal priority 7 requires both retained report and returned output; priority 9 selects `return-route.md` | Yes | none |
407
+
408
+ Validation:
409
+
410
+ - All nine predictions matched derivation; no runtime contract mismatch required
411
+ repair.
412
+ - Stale, out-of-scope, and invalid artifact subcases resolve separately.
413
+ - The focused suite moved from observed RED 16/23 to GREEN 25/25 after replacing
414
+ deleted-root assertions and adding two runtime graph contracts.
415
+ - Router priorities 1-12 cover terminal, checkpoint, blocked, and all four gate
416
+ outputs. Delivery and standalone storage, conflict, and every declared
417
+ authoritative no-write class are executable assertions.
418
+
419
+ Domain state:
420
+
421
+ - Route testing is complete with zero prediction mismatch and zero target graph
422
+ repair.
423
+ - Pending audit obligation: verify every mandatory obligation, route, pointer,
424
+ handoff, validator, and terminal guard in `audit.md`.
425
+
426
+ Next suggested route: `audit.md`
427
+
428
+ Blockers: none
429
+
430
+ Resume identity: none; current tests, matrix, and graph artifacts reconstruct
431
+ the outcome.
432
+
433
+ ## Router Re-entry After Route Testing
434
+
435
+ Phase: router
436
+
437
+ Status: complete
438
+
439
+ Scope: Recompute the graph-authoring route after route predictions, runtime
440
+ storage modes, no-write outcomes, conflicts, and router classes were tested.
441
+
442
+ Artifacts:
443
+
444
+ - `tests/review-phase-graph.contract.test.mjs`: 25 focused graph contracts.
445
+ - `Test Routes Outcome`: nine frozen predictions with nine matching derived
446
+ routes and zero graph repairs.
447
+
448
+ Validation:
449
+
450
+ - Every earlier authoring phase had fresh completion evidence.
451
+ - Focused route contracts and the nine-scenario matrix were green.
452
+ - Terminal readiness, the no-op test, and the external skill validator still
453
+ lacked an audit outcome, so `audit.md` was the single selected phase.
454
+
455
+ Domain state: `audit` selected from current graph artifacts and route-test
456
+ evidence.
457
+
458
+ Next suggested route: `audit.md`
459
+
460
+ Blockers: none
461
+
462
+ Resume identity: none; current artifacts and tests reconstruct the selection.
463
+
464
+ ## Audit Outcome
465
+
466
+ Phase: audit
467
+
468
+ Status: blocked
469
+
470
+ Scope: Apply the terminal graph audit across obligations, authority, resume,
471
+ exits, handoffs, disclosure, tests, syntax, and the available skill validator.
472
+
473
+ Artifacts:
474
+
475
+ - `SKILL.md`, `agents/openai.yaml`, `phases/router.md`, four flat gate files,
476
+ four references, and `scripts/review-contract.mjs`.
477
+ - `tests/review-phase-graph.contract.test.mjs` and all eight shared
478
+ `tests/*.test.mjs` files.
479
+
480
+ Validation:
481
+
482
+ - Four gates each contain all nine required gate sections. The router has 12
483
+ ordered rows: four gate routes and eight terminal, checkpoint, or blocked
484
+ routes.
485
+ - The runtime handoff accounts for eight stateful classes and five
486
+ authoritative no-write classes. Every write-capable exit commits a durable
487
+ handoff; all no-write exceptions are named.
488
+ - Target and bounds precede delivery budget. Invalid evidence precedes budget,
489
+ checkpoint, conflict, context, not-due, terminal, and executable routes.
490
+ Direct invocation outranks fresh artifacts, which outrank handoff state,
491
+ which outranks suggestions.
492
+ - Cold resume discovers current evidence, reconciles same-authority conflicts,
493
+ and derives one route. Transition meanings remain single-owned by the router,
494
+ one selected gate, or a schema/evidence reference.
495
+ - All 23 operational Markdown pointers resolve; there are zero dead pointers
496
+ and zero sibling-gate links. The disclosure trace loads bootstrap, router,
497
+ and exactly one selected gate, with references loaded conditionally.
498
+ - The no-op test required zero deletions: each remaining instruction changes
499
+ invocation, routing, evidence, validation, persistence, or stop behavior.
500
+ - `SKILL.md` and `agents/openai.yaml` consistently disable implicit invocation.
501
+ - Focused tests pass 25/25; all eight shared test files pass 94/94. Both Node
502
+ files pass syntax checks, and the scoped diff passes `git diff --check`.
503
+ - The requested literal `python` command is unavailable. The same validator
504
+ executed through `uv run --with pyyaml python` and failed because
505
+ `quick_validate.py` rejects the intentional `disable-model-invocation`
506
+ frontmatter key.
507
+
508
+ Domain state:
509
+
510
+ - Graph obligations, routes, handoffs, disclosure, tests, and syntax pass.
511
+ - Terminal completion is withheld because the available validator does not
512
+ pass the required explicit-only frontmatter contract.
513
+ - Earliest responsible authoring phase: `write-router.md`, which owns the root
514
+ bootstrap and invocation policy. Re-entry must preserve explicit-only
515
+ behavior; removing `disable-model-invocation: true` is not a valid repair.
516
+
517
+ Terminal decision: not audit-complete; re-enter root for `write-router.md`.
518
+
519
+ Next suggested route: `write-router.md`
520
+
521
+ Blockers: validator schema does not admit the required explicit-only
522
+ `disable-model-invocation` key.
523
+
524
+ Resume identity: none; the graph, tests, and validator output reconstruct the
525
+ outcome.
526
+
527
+ ## Router Re-entry After Validator Classification
528
+
529
+ Phase: router
530
+
531
+ Status: complete
532
+
533
+ Scope: Recompute the graph-authoring route after classifying the validator
534
+ failure recorded by the preceding audit.
535
+
536
+ Artifacts:
537
+
538
+ - `/Users/stefan/.codex/skills/.system/skill-creator/scripts/quick_validate.py`:
539
+ OpenAI-only validator with a hardcoded frontmatter allowlist.
540
+ - `SKILL.md`, `agents/openai.yaml`, and focused source contracts: intentional
541
+ cross-agent explicit-only invocation evidence.
542
+ - `npx --yes skills add /Users/stefan/.codex/worktrees/review-phase-graph-skills
543
+ --list`: applicable packaging validation evidence.
544
+
545
+ Validation:
546
+
547
+ - `quick_validate.py` permits only `name`, `description`, `license`,
548
+ `allowed-tools`, and `metadata`; it cannot classify this cross-agent skill
549
+ dialect.
550
+ - The applicable packaging validator exits zero, reports `Local path
551
+ validated`, discovers 106 skills, and lists `review-phase` with its exact
552
+ description while preserving `disable-model-invocation: true`.
553
+ - Source contracts require the frontmatter key and
554
+ `agents/openai.yaml` independently disables implicit invocation. Removing the
555
+ key would create a target defect; retaining it is not a `write-router.md`
556
+ defect.
557
+ - The preceding blocked audit remains historical evidence. Its blocker is
558
+ reclassified as an inapplicable-validator result, so `audit.md` is the single
559
+ selected phase.
560
+
561
+ Domain state: no target graph repair is required; `audit` reselected with an
562
+ applicable validator result.
563
+
564
+ Next suggested route: `audit.md`
565
+
566
+ Blockers: none
567
+
568
+ Resume identity: none; the graph, validator source, and packaging output
569
+ reconstruct the selection.
570
+
571
+ ## Audit Outcome
572
+
573
+ Phase: audit
574
+
575
+ Status: complete
576
+
577
+ Scope: Close the terminal audit using the applicable cross-agent packaging
578
+ validator and the preceding complete graph, route, disclosure, and test
579
+ evidence.
580
+
581
+ Artifacts:
582
+
583
+ - `SKILL.md`, `agents/openai.yaml`, `phases/router.md`, four flat gate files,
584
+ four references, and `scripts/review-contract.mjs`.
585
+ - `tests/review-phase-graph.contract.test.mjs`, all eight shared test files,
586
+ and the applicable `skills` packaging validator output.
587
+
588
+ Validation:
589
+
590
+ - Four gates each contain all nine required gate sections. The router has 12
591
+ ordered rows: four gate routes and eight terminal, checkpoint, or blocked
592
+ routes.
593
+ - The runtime handoff accounts for eight stateful classes and five
594
+ authoritative no-write classes. Every write-capable exit commits a durable
595
+ handoff; all no-write exceptions are named.
596
+ - Authority and precedence are deterministic. Cold resume reconstructs one
597
+ route from current evidence and discoverable handoffs. Transition meanings
598
+ have one owner.
599
+ - All 23 operational Markdown pointers resolve; there are zero dead pointers
600
+ and zero sibling-gate links. Bootstrap, router, and exactly one selected gate
601
+ form the progressive-disclosure trace.
602
+ - The no-op test required zero deletions. Root frontmatter and
603
+ `agents/openai.yaml` consistently enforce explicit-only invocation.
604
+ - Focused tests pass 25/25; all eight shared test files pass 94/94. Both Node
605
+ files pass syntax checks, and the scoped diff passes `git diff --check`.
606
+ - The applicable packaging validator exits zero, validates the local path,
607
+ discovers 106 skills, and lists `review-phase` with the exact source
608
+ description while preserving its required frontmatter dialect.
609
+ - The rejected `quick_validate.py` result is retained as evidence of an
610
+ inapplicable OpenAI-only schema, not a target validation failure.
611
+
612
+ Domain state: every terminal audit obligation passes; no target repair or
613
+ additional authoring phase remains.
614
+
615
+ Terminal decision: `audit-complete`.
616
+
617
+ Next suggested route: terminal `audit-complete`
618
+
619
+ Blockers: none
620
+
621
+ Resume identity: none; the graph, tests, handoff history, validator
622
+ classification, and packaging evidence reconstruct terminal completion.
@@ -1,53 +1,22 @@
1
1
  ---
2
2
  name: review-phase
3
3
  description: >-
4
- Findings-first readonly review with explicit entry gates, delegated lenses,
5
- artifacts, and validation.
4
+ Explicit readonly review of one frozen delivery diff or standalone artifact
5
+ bundle, ending with one retained all-lens report and routing output.
6
6
  disable-model-invocation: true
7
7
  ---
8
8
 
9
9
  # Review Phase
10
10
 
11
- Readonly findings-first review. Standalone mode reports findings only; delivery
12
- mode hands findings back to the owning phase for fixes.
11
+ Review is explicit-only and readonly relative to its frozen target. It retains
12
+ one all-lens report and returns routing evidence; it never enters a repair.
13
13
 
14
- Load [REFERENCE.md](REFERENCE.md) before running review tools. Start with
15
- `review` to frame fixed-point diff, Standards axis, and Spec axis.
14
+ ## Bootstrap
16
15
 
17
- ## Contract
16
+ 1. Load [the review router](phases/router.md) on every invocation and resume.
17
+ 2. Recompute the current route from durable evidence, including on cold resume.
18
+ 3. Load exactly the one gate selected by the router, or return its single
19
+ terminal, checkpoint, or blocked outcome.
20
+ 4. After a gate writes its durable outcome, stop or re-enter this bootstrap.
18
21
 
19
- - Target must be a diff, PR, branch range, files, spec, plan, docs, or runtime
20
- evidence.
21
- - Default scope is PR changes, highlighted diffs, supplied code portions, or
22
- certain paths/domains. Full-codebase scan only when no PR is open and no
23
- certain scope exists, or when the user explicitly asks.
24
- - Pass bounded scope to inner `autoreview`, ClawPatch-backed review, and
25
- delegated readonly checks.
26
- - Apply relevant `AGENTS.md` guidance and scoped skills for reviewed paths.
27
- - Use `review` as the review-flow wrapper; keep axes separate.
28
- - Use `autoreview` as the core structured review runtime.
29
- - If target claims `requirements-grill` or design-phase grill, inspect shared
30
- interview behavior against `$grilling` and durable-artifact evidence against
31
- the `requirements-grill` inner flow.
32
-
33
- ## Steps
34
-
35
- 1. Identify target, scope, base/head when relevant, and readonly posture.
36
- 2. If scope is ambiguous, ask one clarifying question.
37
- 3. Gather evidence: status, diff/range/PR metadata, tests, docs, local guidance,
38
- and exact files/commands consulted.
39
- 4. Apply `review`: pin fixed point, find Spec and Standards sources,
40
- and prepare separate Standards/Spec review prompts.
41
- 5. Run `autoreview` on the bounded target and manually verify accepted findings.
42
- 6. Apply mandatory lenses: `simplify`, `improve-codebase-architecture`, and
43
- applicable scoped skills, claimed grill-wrapper checks.
44
- 7. Run safe readonly validation that matches the target.
45
- 8. Report findings-first; standalone mode stops, delivery mode returns findings
46
- to the owning phase.
47
-
48
- ## Output
49
-
50
- Lead with findings by severity. Include references, impact, evidence,
51
- recommended action, validation, exact review command, fixed point, Spec source
52
- or skipped reason, Standards sources, scoped guidance checked, residual risk,
53
- and mode.
22
+ The router is the sole runtime route authority. Gate files own executable work.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false