@punks/cli 3.2.0 → 3.2.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.
Files changed (62) hide show
  1. package/dist/BASELINE_CHANGELOG.md +14 -1
  2. package/dist/CHANGELOG.md +15 -0
  3. package/dist/baseline/scaffold-baseline/baseline.json +5 -5
  4. package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +48 -0
  5. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +1 -6
  6. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
  7. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
  8. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +17 -14
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +98 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
  20. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
  21. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +9 -34
  22. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +10 -16
  23. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +1 -19
  24. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
  25. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +2 -9
  26. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +8 -6
  27. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +5 -8
  28. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +14 -29
  29. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +32 -45
  30. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +1 -2
  31. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +12 -86
  32. package/dist/baseline/scaffold-baseline.json +5 -5
  33. package/dist/baseline/scaffold-baseline.tgz +0 -0
  34. package/dist/index.js +5 -5
  35. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +1 -6
  36. package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
  37. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
  38. package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -14
  39. package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +98 -0
  40. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
  41. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
  42. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
  43. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
  44. package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
  45. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
  46. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
  47. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
  48. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
  49. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
  50. package/dist/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
  51. package/dist/skills/phases/delivery-phase/phases/review.md +9 -34
  52. package/dist/skills/phases/delivery-phase/phases/router.md +8 -14
  53. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +1 -19
  54. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
  55. package/dist/skills/phases/review-phase/phases/retain-report.md +2 -9
  56. package/dist/skills/phases/review-phase/phases/return-route.md +8 -6
  57. package/dist/skills/phases/review-phase/phases/run-review.md +5 -8
  58. package/dist/skills/phases/review-phase/references/durable-report.md +14 -29
  59. package/dist/skills/phases/review-phase/references/state-graph.md +5 -18
  60. package/dist/skills/phases/review-phase/references/targets.md +1 -2
  61. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +11 -91
  62. package/package.json +1 -1
@@ -45,14 +45,9 @@ the fixed wiki values are `review-report`, `project`, and `internal`. Its title
45
45
  uses the derived filename slug; created and updated equal the date in
46
46
  `reviewed_at`. Its lineage, run, mode, timestamp, accepted-bounds identity/hash,
47
47
  and snapshot hash must agree with the JSON authority and recomputed evidence.
48
- Prototype-sensitive frontmatter keys are malformed and are rejected before any
49
- assignment. `reviewed_at` must name a real UTC calendar instant. Delivery
50
- normalization requires a non-empty inclusive scope and delivery-goal identity;
51
- governing-source normalization requires a non-empty source set.
52
48
 
53
49
  The parsed JSON object is report authority. Detached objects, sidecars, and
54
- caller-supplied derived identities are never trusted. It contains exactly these
55
- fields:
50
+ caller-supplied derived identities are never trusted. It contains exactly these fields:
56
51
 
57
52
  - `review_lineage_id`
58
53
  - `review_run_id`
@@ -65,8 +60,8 @@ fields:
65
60
  - canonical `source_set_hash`
66
61
  - an explicit outcome for Standards, skill adherence and scoped skills,
67
62
  architecture, simplify, and Spec
68
- - stable finding identifiers with severity, location, impact, evidence,
69
- action, and one `return_route`
63
+ - stable finding identifiers with severity, location, impact, evidence, and
64
+ action
70
65
  - routing and validation
71
66
 
72
67
  Delivery mode also records delivery-goal identity, review ordinal, and preceding
@@ -75,23 +70,16 @@ as null or not applicable.
75
70
 
76
71
  `lens_outcomes` has exactly `standards`, `skill_adherence`, `architecture`,
77
72
  `simplify`, and `spec`; each value is `clean` or `findings`. Every finding has
78
- exactly the fields `id`, `lens`, `severity`, `location`, `impact`, `evidence`,
79
- `action`, and `return_route`. Finding IDs are unique, severity is `critical`,
80
- `high`, `medium`, or `low`, and each lens outcome agrees with whether that lens
81
- has a finding. Each finding's `return_route` is exactly `debugging`,
82
- `implementation`, `debt_follow_up`, or `docs_ingest`.
73
+ exactly stable `id`, `lens`, `severity`, `location`, `impact`, `evidence`, and
74
+ `action`. Finding IDs are unique, severity is `critical`, `high`, `medium`, or
75
+ `low`, and each lens outcome agrees with whether that lens has a finding.
83
76
 
84
77
  `routing` has exactly `primary` and `secondary_architecture_follow_up`.
85
78
  `primary` is `debugging`, `implementation`, `debt_follow_up`, `docs_ingest`, or
86
- `closeout`; the secondary flag is boolean. Aggregate routing is derived by the
87
- public `deriveReviewRouting` helper from the complete finding set. Precedence is
88
- `debugging` > `implementation` > `debt_follow_up` > `docs_ingest`; an empty set
89
- derives `closeout`, and debt is secondary only beside debugging or
90
- implementation. A supplied aggregate mismatch is invalid. `validation` is an
91
- array of records with exactly command, isolation mode, before/after frozen
92
- hashes, outcome, and evidence. Isolation is proven no-write, disposable
93
- checkout, or disposable snapshot. Retained validation records require equal
94
- before/after hashes.
79
+ `closeout`; the secondary flag is boolean. `validation` is an array of records
80
+ with exactly command, isolation mode, before/after frozen hashes, outcome, and
81
+ evidence. Isolation is proven no-write, disposable checkout, or disposable
82
+ snapshot. Retained validation records require equal before/after hashes.
95
83
 
96
84
  Delivery ordinals are 1 through 3. Review 1 has null preceding-repair ordinal;
97
85
  review 2 or 3 records respectively 1 or 2. Standalone delivery-goal identity,
@@ -129,15 +117,12 @@ evidence. A candidate is a valid retained pass only when every predicate holds:
129
117
  snapshot hash, source-set hash, and deterministic report path equal values
130
118
  recomputed from the canonical identity algorithm;
131
119
  3. the outside-envelope report SHA-256 equals the exact retained report blob;
132
- 4. bytes resolved from `reportCommitSha:reportPath` are exactly equal to the
133
- local report bytes; the caller supplies them as `resolvedReportBytes`;
134
- 5. current accepted-bounds, normalized-target, and governing-source hashes still
120
+ 4. current accepted-bounds, normalized-target, and governing-source hashes still
135
121
  equal the report values;
136
- 6. the report commit changed the report path and only repository-approved
122
+ 5. the report commit changed the report path and only repository-approved
137
123
  report, navigation, and wiki-log envelope paths;
138
- 7. the approved retained ref contains that exact report commit with boolean
139
- `true` containment evidence;
140
- 8. delivery ordinal is an integer from 1 through 3; standalone delivery-only
124
+ 6. the approved retained ref contains that exact report commit;
125
+ 7. delivery ordinal is an integer from 1 through 3; standalone delivery-only
141
126
  fields are null.
142
127
 
143
128
  A malformed report, wrong lineage or run id, wrong blob or freshness hash,
@@ -4,44 +4,38 @@ Review owns normalization, frozen inspection, report retention, routing output,
4
4
  and termination. Delivery owns debugging, implementation, debt, docs, closeout,
5
5
  and clean handoff.
6
6
 
7
- | State | Event | Guard | Owner | Next state | Counter effect | Required evidence |
8
- | --------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | --------------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
9
- | Current delivery state | Review considered | Unsupported target | Delivery caller | Return `review_failed` | None; zero handoff or status writes | Exact target failure; no report |
10
- | Current delivery state | Review considered | Invalid accepted bounds | Delivery caller | Return `review_failed` | None; zero handoff or status writes | Exact bounds failure; no report |
11
- | `review_due` | Explicit review invocation | Delivery; accepted bounds and target valid; recovered `review_count < 3` | Delivery caller | `review_running` | Preallocate ordinal `review_count + 1`; no completed-pass change | Lineage, run id, ordinal, bounds identity/hash, normalized target |
12
- | `review_due` | Explicit review invocation | Standalone; accepted bounds and target valid | Standalone caller | `review_running` | None | Lineage, run id, bounds identity/hash, normalized target |
13
- | Current delivery state | Review considered | Delivery; in-memory accepted bounds and target valid; recovered `review_count >= 3` | Delivery caller | Return `review_budget_exhausted` | None; zero handoff or status writes | Exact current route, lineage, counters; no report or status mutation |
14
- | `review_running` | All lenses and parent verification complete | One frozen snapshot; complete local report exists | `review-phase` | `report_retention_pending` | None; no completed-pass change | Complete report and fresh target/source hashes |
15
- | `review_running` | Validation mutation detected | Frozen-target hash differs after validation | `review-phase` | `review_due` | None | Before/after hashes, command, mutation evidence; no report or pass |
16
- | `review_running` | Retryable infrastructure failure or partial run | No immutable report | `review-phase` | `review_due` | None | Exact retryable evidence; unchanged counters |
17
- | `review_running` | Non-retryable contract or infrastructure failure | No immutable report | `review-phase` | `review_failed` | None | Exact terminal evidence; no report; unchanged counters |
18
- | `report_retention_pending` | Retention verified | Delivery; valid retained-pass predicate; ordinal at most 3; hashes fresh | Report writer | `review_routed` | Unique retained commit establishes authoritative ordinal; reconcile projection | Path, SHA-256, commit, retained ref, ordinal, run id |
19
- | `report_retention_pending` | Retention rejected | Delivery; ordinal is greater than 3 | Report writer | `review_budget_exhausted` | None | Exact ordinal rejection/current route; no authoritative pass |
20
- | `report_retention_pending` | Retention verified | Standalone; valid retained-pass predicate; hashes fresh | Report writer | `review_routed` | None | Path, SHA-256, commit, retained ref |
21
- | `report_retention_pending` | Idempotent retention recovery | Same lineage/run has identical valid path, report blob SHA-256, and commit | Report writer | `review_routed` | Reuse existing pass; project its ordinal at most once | Existing unique authority and containment evidence |
22
- | `report_retention_pending` | Same-run conflict | Same lineage/run has two valid candidates with different path, blob, or commit | Report writer | `review_failed` | None | `same_run_conflict`, both authorities; no pass or counter change |
23
- | `report_retention_pending` | Retained-pass validation rejected | Active candidate is malformed or has wrong derived identity, hash, paths, containment, or ordinal | Report writer | `review_failed` | None | Exact failed predicate; no pass or counter change |
24
- | `report_retention_pending` | Retryable retention failure | Hashes fresh | Report writer | `report_retention_pending` | None | Exact retryable evidence; no authoritative pass |
25
- | `report_retention_pending` | Non-retryable retention failure | Retry cannot succeed | Report writer | `review_failed` | None | Exact terminal evidence; no authoritative pass |
26
- | `report_retention_pending` | Freshness changed | Target or source hash changed | `review-phase` | `review_due` | None | Stale local report; unchanged counters |
27
- | `review_routed` | Readonly return | Standalone | Standalone caller | `review_complete` | None | Retained report output and route |
28
- | `review_routed` | Resume debug route | Handoff already records run id, debug route, and `debug_active` | `delivery-phase` | `debug_active` | None | Existing atomic handoff; no guard fallthrough |
29
- | `review_routed` | Resume implementation route | Handoff already records run id, implementation route, and `repair_active` | `delivery-phase` | `repair_active` | None | Existing atomic handoff; no guard fallthrough |
30
- | `review_routed` | Resume debt follow-up | Handoff already records run id, retained report, stable finding IDs, and `debt_follow_up` | Delivery review handoff | `debt_follow_up` | None | Existing debt keys and artifact; no duplicate capture |
31
- | `review_routed` | Mixed finding route | Runtime evidence exists; derived primary route is `debugging`; secondary architecture follow-up is true; run id unrecorded | `delivery-phase` | `debt_follow_up` | None | Explicit finding routes, stable findings, post-debt route `debugging` |
32
- | `review_routed` | Mixed finding route | No runtime evidence; derived primary route is `implementation`; secondary architecture follow-up is true; run id unrecorded | `delivery-phase` | `debt_follow_up` | None | Explicit finding routes, stable findings, post-debt route `implementation` |
33
- | `review_routed` | Single repair route | Runtime evidence exists; derived primary route is `debugging`; no debt follow-up; run id unrecorded | `delivery-phase` | `debug_active` | Atomic handoff opens corresponding repair | Explicit finding routes, stable findings, atomic handoff |
34
- | `review_routed` | Single repair route | No runtime evidence; in-scope non-runtime blocker exists; derived primary route is `implementation`; no debt follow-up; run id unrecorded | `delivery-phase` | `repair_active` | Atomic handoff opens corresponding repair | Explicit finding routes, stable findings, atomic handoff |
35
- | `review_routed` | Finding route | Derived primary route is `debt_follow_up` | `delivery-phase` | `debt_follow_up` | None | Explicit debt routes, stable findings, post-debt route `docs_ingest` or `closeout` |
36
- | `debt_follow_up` | Debt captured | Every debt key is present; `post_debt_route` is `debugging` | Delivery review handoff | `debug_active` | Open repair after capture exactly once | Retained report commit/path, stable finding IDs, artifact path, captured keys |
37
- | `debt_follow_up` | Debt captured | Every debt key is present; `post_debt_route` is `implementation` | Delivery review handoff | `repair_active` | Open repair after capture exactly once | Retained report commit/path, stable finding IDs, artifact path, captured keys |
38
- | `debt_follow_up` | Debt captured | Every debt key is present; `post_debt_route` is `docs_ingest` or `closeout` | Delivery review handoff | `docs_ingest` or `closeout` | None | Retained report commit/path, stable finding IDs, artifact path, captured keys |
39
- | `review_routed` | Documentation-only findings | Derived primary route is `docs_ingest` | `delivery-phase` | `docs_ingest` | None | Explicit docs routes and stable findings |
40
- | `review_routed` | Finding-free route | Finding set is empty | `delivery-phase` | `closeout` | None | Report and derived closeout route |
41
- | `repair_active` or `debug_active` | Ordinary repair completes | `review_count < 3` | `delivery-phase` | `review_due` | None | Stale prior report, changed target identity, preserved counters |
42
- | `repair_active` or `debug_active` | Fix 3 completes | `review_count = 3` and `repair_count = 3` | `delivery-phase` | `focused_validation` | None | Fix-3 changes and required focused validation |
43
- | `focused_validation` | Focused validation fails | Repair epoch 3 remains open | `delivery-phase` | `repair_active` or `debug_active` | None; unchanged counters | Failed validation and recorded owning route |
44
- | `focused_validation` | Focused validation passes | Repair epoch 3 complete | `delivery-phase` | `clean_handoff` | None | Passing validation, final changes, report-3 link, clean status |
7
+ | State | Event | Guard | Owner | Next state | Counter effect | Required evidence |
8
+ | --------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------- | ----------------- | --------------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
9
+ | Current delivery state | Review considered | Unsupported target | Delivery caller | Return `review_failed` | None; zero handoff or status writes | Exact target failure; no report |
10
+ | Current delivery state | Review considered | Invalid accepted bounds | Delivery caller | Return `review_failed` | None; zero handoff or status writes | Exact bounds failure; no report |
11
+ | `review_due` | Explicit review invocation | Delivery; accepted bounds and target valid; recovered `review_count < 3` | Delivery caller | `review_running` | Preallocate ordinal `review_count + 1`; no completed-pass change | Lineage, run id, ordinal, bounds identity/hash, normalized target |
12
+ | `review_due` | Explicit review invocation | Standalone; accepted bounds and target valid | Standalone caller | `review_running` | None | Lineage, run id, bounds identity/hash, normalized target |
13
+ | Current delivery state | Review considered | Delivery; in-memory accepted bounds and target valid; recovered `review_count >= 3` | Delivery caller | Return `review_budget_exhausted` | None; zero handoff or status writes | Exact current route, lineage, counters; no report or status mutation |
14
+ | `review_running` | All lenses and parent verification complete | One frozen snapshot; complete local report exists | `review-phase` | `report_retention_pending` | None; no completed-pass change | Complete report and fresh target/source hashes |
15
+ | `review_running` | Validation mutation detected | Frozen-target hash differs after validation | `review-phase` | `review_due` | None | Before/after hashes, command, mutation evidence; no report or pass |
16
+ | `review_running` | Retryable infrastructure failure or partial run | No immutable report | `review-phase` | `review_due` | None | Exact retryable evidence; unchanged counters |
17
+ | `review_running` | Non-retryable contract or infrastructure failure | No immutable report | `review-phase` | `review_failed` | None | Exact terminal evidence; no report; unchanged counters |
18
+ | `report_retention_pending` | Retention verified | Delivery; valid retained-pass predicate; ordinal at most 3; hashes fresh | Report writer | `review_routed` | Unique retained commit establishes authoritative ordinal; reconcile projection | Path, SHA-256, commit, retained ref, ordinal, run id |
19
+ | `report_retention_pending` | Retention rejected | Delivery; ordinal is greater than 3 | Report writer | `review_budget_exhausted` | None | Exact ordinal rejection/current route; no authoritative pass |
20
+ | `report_retention_pending` | Retention verified | Standalone; valid retained-pass predicate; hashes fresh | Report writer | `review_routed` | None | Path, SHA-256, commit, retained ref |
21
+ | `report_retention_pending` | Idempotent retention recovery | Same lineage/run has identical valid path, report blob SHA-256, and commit | Report writer | `review_routed` | Reuse existing pass; project its ordinal at most once | Existing unique authority and containment evidence |
22
+ | `report_retention_pending` | Same-run conflict | Same lineage/run has two valid candidates with different path, blob, or commit | Report writer | `review_failed` | None | `same_run_conflict`, both authorities; no pass or counter change |
23
+ | `report_retention_pending` | Retained-pass validation rejected | Active candidate is malformed or has wrong derived identity, hash, paths, containment, or ordinal | Report writer | `review_failed` | None | Exact failed predicate; no pass or counter change |
24
+ | `report_retention_pending` | Retryable retention failure | Hashes fresh | Report writer | `report_retention_pending` | None | Exact retryable evidence; no authoritative pass |
25
+ | `report_retention_pending` | Non-retryable retention failure | Retry cannot succeed | Report writer | `review_failed` | None | Exact terminal evidence; no authoritative pass |
26
+ | `report_retention_pending` | Freshness changed | Target or source hash changed | `review-phase` | `review_due` | None | Stale local report; unchanged counters |
27
+ | `review_routed` | Readonly return | Standalone | Standalone caller | `review_complete` | None | Retained report output and route |
28
+ | `review_routed` | Resume debug route | Handoff already records run id, debug route, and `debug_active` | `delivery-phase` | `debug_active` | None | Existing atomic handoff; no guard fallthrough |
29
+ | `review_routed` | Resume implementation route | Handoff already records run id, implementation route, and `repair_active` | `delivery-phase` | `repair_active` | None | Existing atomic handoff; no guard fallthrough |
30
+ | `review_routed` | Mixed or single finding route | Runtime evidence exists; run id unrecorded | `delivery-phase` | `debug_active` | Atomic handoff opens corresponding repair | Primary debug route, stable findings, atomic handoff, optional architecture follow-up |
31
+ | `review_routed` | Mixed or single finding route | No runtime evidence; in-scope non-runtime blocker exists; run id unrecorded | `delivery-phase` | `repair_active` | Atomic handoff opens corresponding repair | Primary implementation route, stable findings, atomic handoff, optional architecture follow-up |
32
+ | `review_routed` | Finding route | No higher blocker; broad architecture debt exists | `delivery-phase` | `debt_follow_up` | None | Debt route and stable findings |
33
+ | `review_routed` | No-blocker route | Required documentation remains | `delivery-phase` | `docs_ingest` | None | Report and docs route |
34
+ | `review_routed` | No-blocker route | Documentation complete | `delivery-phase` | `closeout` | None | Report and closeout route |
35
+ | `repair_active` or `debug_active` | Ordinary repair completes | `review_count < 3` | `delivery-phase` | `review_due` | None | Stale prior report, changed target identity, preserved counters |
36
+ | `repair_active` or `debug_active` | Fix 3 completes | `review_count = 3` and `repair_count = 3` | `delivery-phase` | `focused_validation` | None | Fix-3 changes and required focused validation |
37
+ | `focused_validation` | Focused validation fails | Repair epoch 3 remains open | `delivery-phase` | `repair_active` or `debug_active` | None; unchanged counters | Failed validation and recorded owning route |
38
+ | `focused_validation` | Focused validation passes | Repair epoch 3 complete | `delivery-phase` | `clean_handoff` | None | Passing validation, final changes, report-3 link, clean status |
45
39
 
46
40
  ## Durable Budget
47
41
 
@@ -58,13 +52,6 @@ already-consumed ordinals. Complete the transition only after the write. An
58
52
  already recorded run ID resumes its active state without another increment and
59
53
  cannot fall through to an unrecorded guard.
60
54
 
61
- Debt capture is also idempotent. The retained report commit, report path, and
62
- stable finding ID form one key in the goal/spec-linked debt artifact. Resume
63
- reuses recorded keys, adds only missing keys, and follows durable
64
- `post_debt_route` without implementing unaccepted debt. Secondary debt records
65
- `debugging` or `implementation`; primary debt records `docs_ingest` or
66
- `closeout`. Capture completes before the recorded route opens.
67
-
68
55
  Review 1 may open fix 1, review 2 fix 2, and review 3 fix 3. Fix 3 never opens
69
56
  review 4. A failed focused validation stays in repair epoch 3 until that same
70
57
  validation passes.
@@ -6,8 +6,7 @@ composition, report, routing, and freshness contracts.
6
6
 
7
7
  ## Scope
8
8
 
9
- Record a non-empty, smallest certain inclusive scope in every review mode. A
10
- zero-artifact bundle is not a review target. Full-repository expansion requires
9
+ Record the smallest certain inclusive scope. Full-repository expansion requires
11
10
  an explicit caller request. Unsupported targets or invalid accepted bounds enter
12
11
  `review_failed` with exact evidence, no report, and no counter change, including
13
12
  when a delivery counter is already 3.
@@ -36,12 +36,8 @@ export const inclusiveScopeHash = (entries) => hashRecord("inclusive-scope", sor
36
36
  export const acceptedBoundsHash = (identity, scopeEntries) =>
37
37
  hashRecord("accepted-bounds", [identity, inclusiveScopeHash(scopeEntries)]);
38
38
 
39
- export const deliveryLineageId = (deliveryGoalIdentity) => {
40
- if (typeof deliveryGoalIdentity !== "string" || deliveryGoalIdentity.length === 0) {
41
- throw new TypeError("delivery goal identity must be a non-empty string");
42
- }
43
- return hashRecord("delivery-lineage", [deliveryGoalIdentity]);
44
- };
39
+ export const deliveryLineageId = (deliveryGoalIdentity) =>
40
+ hashRecord("delivery-lineage", [deliveryGoalIdentity]);
45
41
 
46
42
  export const standaloneLineageId = (locator, boundsHash) =>
47
43
  hashRecord("standalone-lineage", [locator, boundsHash]);
@@ -122,21 +118,10 @@ export const sourceSetHash = (sources) =>
122
118
  .flatMap(({ path, hash }) => [path, hash]),
123
119
  );
124
120
 
125
- const assertReviewedAt = (reviewedAt, field) => {
126
- const match = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u.exec(reviewedAt);
127
- if (!match) {
128
- throw new TypeError(`${field} must use YYYYMMDDTHHMMSSZ UTC format`);
129
- }
130
- const [, year, month, day, hour, minute, second] = match;
131
- const iso = `${year}-${month}-${day}T${hour}:${minute}:${second}.000Z`;
132
- const instant = new Date(iso);
133
- if (Number.isNaN(instant.valueOf()) || instant.toISOString() !== iso) {
134
- throw new TypeError(`${field} must name a real UTC instant`);
135
- }
136
- };
137
-
138
121
  export const reviewReportPath = ({ lineageId, reviewedAt, snapshotHash }) => {
139
- assertReviewedAt(reviewedAt, "reviewedAt");
122
+ if (!/^\d{8}T\d{6}Z$/u.test(reviewedAt)) {
123
+ throw new TypeError("reviewedAt must use YYYYMMDDTHHMMSSZ UTC format");
124
+ }
140
125
  return `apps/wiki/content/docs/project/reviews/${reviewScopeSlug(lineageId)}-${reviewedAt}-${snapshot12(snapshotHash)}-review-report.md`;
141
126
  };
142
127
 
@@ -162,29 +147,6 @@ const FRONTMATTER_KEYS = [
162
147
  const HEX_64 = /^[0-9a-f]{64}$/u;
163
148
  const COMMIT_SHA = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/u;
164
149
  const LENS_KEYS = ["standards", "skill_adherence", "architecture", "simplify", "spec"];
165
- const PROTOTYPE_KEYS = new Set(["__proto__", "constructor", "prototype"]);
166
- const FINDING_ROUTES = ["debugging", "implementation", "debt_follow_up", "docs_ingest"];
167
-
168
- export const deriveReviewRouting = (findings) => {
169
- if (
170
- !Array.isArray(findings) ||
171
- findings.some(
172
- (finding) =>
173
- finding === null ||
174
- typeof finding !== "object" ||
175
- !FINDING_ROUTES.includes(finding.return_route),
176
- )
177
- ) {
178
- throw new TypeError("invalid finding return route");
179
- }
180
- const routes = new Set(findings.map(({ return_route: route }) => route));
181
- const primary = FINDING_ROUTES.find((route) => routes.has(route)) ?? "closeout";
182
- return {
183
- primary,
184
- secondary_architecture_follow_up:
185
- routes.has("debt_follow_up") && (primary === "debugging" || primary === "implementation"),
186
- };
187
- };
188
150
 
189
151
  const exactKeys = (value, keys) =>
190
152
  value !== null &&
@@ -201,7 +163,9 @@ const sortedUniqueStrings = (values) =>
201
163
  isDeepStrictEqual(values, sortUtf8(values));
202
164
 
203
165
  const reportDate = (reviewedAt) => {
204
- assertReviewedAt(reviewedAt, "reviewed_at");
166
+ if (!/^\d{8}T\d{6}Z$/u.test(reviewedAt)) {
167
+ throw new TypeError("reviewed_at must use YYYYMMDDTHHMMSSZ");
168
+ }
205
169
  return `${reviewedAt.slice(0, 4)}-${reviewedAt.slice(4, 6)}-${reviewedAt.slice(6, 8)}`;
206
170
  };
207
171
 
@@ -254,14 +218,11 @@ const parseFrontmatter = (text) => {
254
218
  if (!text.startsWith("---\n")) throw new TypeError("missing frontmatter");
255
219
  const close = text.indexOf("\n---\n", 4);
256
220
  if (close < 0) throw new TypeError("unclosed frontmatter");
257
- const frontmatter = Object.create(null);
221
+ const frontmatter = {};
258
222
  for (const line of text.slice(4, close).split("\n")) {
259
223
  const separator = line.indexOf(": ");
260
224
  if (separator < 1) throw new TypeError("malformed frontmatter line");
261
225
  const key = line.slice(0, separator);
262
- if (PROTOTYPE_KEYS.has(key)) {
263
- throw new TypeError("prototype-sensitive frontmatter key");
264
- }
265
226
  if (Object.hasOwn(frontmatter, key)) throw new TypeError("duplicate frontmatter key");
266
227
  const raw = line.slice(separator + 2);
267
228
  frontmatter[key] = raw === "[]" ? [] : JSON.parse(raw);
@@ -303,8 +264,6 @@ export const normalizeReviewTarget = (mode, evidence) => {
303
264
  !nonemptyString(evidence.actualBaseRef) ||
304
265
  !COMMIT_SHA.test(evidence.fixedPointSha) ||
305
266
  !nonemptyString(evidence.headIdentity) ||
306
- !Array.isArray(evidence.scopeEntries) ||
307
- evidence.scopeEntries.length === 0 ||
308
267
  !sortedUniqueStrings(sortUtf8(evidence.scopeEntries)) ||
309
268
  !Buffer.isBuffer(evidence.canonicalPatchBytes)
310
269
  ) {
@@ -321,15 +280,11 @@ export const normalizeReviewTarget = (mode, evidence) => {
321
280
  };
322
281
  }
323
282
  if (mode === "standalone") {
324
- if (!Array.isArray(evidence.scopeEntries) || evidence.scopeEntries.length === 0) {
325
- throw new TypeError("invalid standalone target evidence");
326
- }
327
283
  const files = orderedFiles(evidence.files);
328
284
  const identities = files.map(({ identity }) => identity);
329
285
  const scope = sortUtf8(evidence.scopeEntries);
330
286
  if (
331
287
  !nonemptyString(evidence.locator) ||
332
- identities.length === 0 ||
333
288
  !sortedUniqueStrings(identities) ||
334
289
  !files.every(({ bytes }) => Buffer.isBuffer(bytes)) ||
335
290
  !isDeepStrictEqual(scope, identities)
@@ -351,7 +306,6 @@ export const normalizeReviewTarget = (mode, evidence) => {
351
306
  export const normalizeReviewSources = (sources) => {
352
307
  if (
353
308
  !Array.isArray(sources) ||
354
- sources.length === 0 ||
355
309
  sources.some(({ path, bytes }) => !nonemptyString(path) || !Buffer.isBuffer(bytes)) ||
356
310
  new Set(sources.map(({ path }) => path)).size !== sources.length
357
311
  ) {
@@ -439,12 +393,7 @@ const validateTargetSchema = (target, mode, errors) => {
439
393
  errors.push("malformed:normalized_target_schema");
440
394
  return;
441
395
  }
442
- if (
443
- !nonemptyString(target.locator) ||
444
- !Array.isArray(target.inclusive_scope) ||
445
- target.inclusive_scope.length === 0 ||
446
- !sortedUniqueStrings(target.inclusive_scope)
447
- ) {
396
+ if (!nonemptyString(target.locator) || !sortedUniqueStrings(target.inclusive_scope)) {
448
397
  errors.push("malformed:normalized_target_common_fields");
449
398
  }
450
399
  if (mode === "delivery") {
@@ -486,16 +435,7 @@ const validateReportSemantics = (report, errors) => {
486
435
  if (!Array.isArray(report.findings)) {
487
436
  errors.push("malformed:findings");
488
437
  } else {
489
- const findingKeys = [
490
- "id",
491
- "lens",
492
- "severity",
493
- "location",
494
- "impact",
495
- "evidence",
496
- "action",
497
- "return_route",
498
- ];
438
+ const findingKeys = ["id", "lens", "severity", "location", "impact", "evidence", "action"];
499
439
  const ids = new Set();
500
440
  const findingLenses = new Set();
501
441
  for (const finding of report.findings) {
@@ -531,14 +471,6 @@ const validateReportSemantics = (report, errors) => {
531
471
  typeof report.routing?.secondary_architecture_follow_up !== "boolean"
532
472
  ) {
533
473
  errors.push("malformed:routing");
534
- } else {
535
- try {
536
- if (!isDeepStrictEqual(report.routing, deriveReviewRouting(report.findings))) {
537
- errors.push("mismatch:routing");
538
- }
539
- } catch {
540
- errors.push("malformed:finding_return_route");
541
- }
542
474
  }
543
475
 
544
476
  const validationKeys = [
@@ -723,13 +655,7 @@ const inspectRetainedPass = (candidate, expected) => {
723
655
  ) {
724
656
  errors.push("mismatch:report_sha256");
725
657
  }
726
- if (
727
- !Buffer.isBuffer(candidate.resolvedReportBytes) ||
728
- !candidate.reportBytes.equals(candidate.resolvedReportBytes)
729
- ) {
730
- errors.push("mismatch:resolved_report_bytes");
731
- }
732
- if (candidate.refContainsCommit !== true) errors.push("ref_missing_commit");
658
+ if (!candidate.refContainsCommit) errors.push("ref_missing_commit");
733
659
  if (!COMMIT_SHA.test(candidate.reportCommitSha)) {
734
660
  errors.push("invalid:report_commit_sha");
735
661
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.08.13-33a55cb6",
5
- "tag": "baseline/stable/2026.08.13-33a55cb6",
6
- "commit": "33a55cb61cf9c26a7e8480968ec3bc597c416678",
4
+ "version": "2026.08.14-4ddd7101",
5
+ "tag": "baseline/stable/2026.08.14-4ddd7101",
6
+ "commit": "4ddd71013dcf8c1a41d57c403f62f4b394962209",
7
7
  "archive": "scaffold-baseline.tgz",
8
- "archiveSha256": "c8a6c0fe7d3a48b211b9b3cf49493e5fb995595697f78802b227391835ecd8f4",
8
+ "archiveSha256": "730ad1d63cbe14610c9f689fa9a038b93ff5469bdb8e13c8f1a030fcd6c30b54",
9
9
  "compatibility": {
10
- "cliVersionRange": ">=3.2.0 <3.3.0"
10
+ "cliVersionRange": ">=3.2.1 <3.3.0"
11
11
  }
12
12
  }
Binary file