@punks/cli 3.2.2 → 3.3.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 (105) hide show
  1. package/AGENTS.md +4 -2
  2. package/README.md +1 -1
  3. package/dist/BASELINE_CHANGELOG.md +56 -0
  4. package/dist/CHANGELOG.md +32 -0
  5. package/dist/baseline/scaffold-baseline/baseline.json +5 -5
  6. package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +4 -1
  7. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +6 -2
  8. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +32 -0
  9. package/dist/baseline/scaffold-baseline/data/subagents/manifest.mjs +1 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +6 -1
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/LICENSE +21 -0
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/RECIPES.md +333 -0
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/SKILL.md +203 -0
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/UPSTREAM.md +9 -0
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/improve-mobile-frontend/SKILL.md +109 -0
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/improve-mobile-frontend/UPSTREAM.md +5 -0
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/LICENSE +21 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/SKILL.md +112 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/STANDARDS.md +229 -0
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/UPSTREAM.md +9 -0
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +5 -1
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +8 -6
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +12 -7
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +6 -4
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +36 -3
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +18 -1
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +1 -1
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +4 -3
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +2 -2
  30. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +6 -6
  31. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +7 -7
  32. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +12 -12
  33. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +9 -9
  34. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +10 -10
  35. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/LICENSE +21 -0
  36. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/RECIPES.md +435 -0
  37. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/SKILL.md +255 -0
  38. package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/UPSTREAM.md +9 -0
  39. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +34 -9
  40. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +18 -11
  41. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +19 -1
  42. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +14 -11
  43. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +9 -2
  44. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +6 -8
  45. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +8 -5
  46. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +29 -14
  47. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +45 -32
  48. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +2 -1
  49. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +86 -12
  50. package/dist/baseline/scaffold-baseline.json +5 -5
  51. package/dist/baseline/scaffold-baseline.tgz +0 -0
  52. package/dist/data/AGENTS.md +1 -1
  53. package/dist/data/subagents/manifest.mjs +1 -0
  54. package/dist/index.js +27 -27
  55. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +6 -1
  56. package/dist/skills/agnostic/frontend/animate/LICENSE +21 -0
  57. package/dist/skills/agnostic/frontend/animate/RECIPES.md +324 -0
  58. package/dist/skills/agnostic/frontend/animate/SKILL.md +199 -0
  59. package/dist/skills/agnostic/frontend/animate/UPSTREAM.md +9 -0
  60. package/dist/skills/agnostic/frontend/improve-mobile-frontend/SKILL.md +109 -0
  61. package/dist/skills/agnostic/frontend/improve-mobile-frontend/UPSTREAM.md +5 -0
  62. package/dist/skills/agnostic/frontend/review-animations/LICENSE +21 -0
  63. package/dist/skills/agnostic/frontend/review-animations/SKILL.md +112 -0
  64. package/dist/skills/agnostic/frontend/review-animations/STANDARDS.md +187 -0
  65. package/dist/skills/agnostic/frontend/review-animations/UPSTREAM.md +9 -0
  66. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +5 -1
  67. package/dist/skills/agnostic/planning/create-plan/SKILL.md +8 -6
  68. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +12 -7
  69. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +6 -4
  70. package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +33 -3
  71. package/dist/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +18 -1
  72. package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +1 -1
  73. package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +4 -3
  74. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +2 -2
  75. package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +6 -6
  76. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +7 -7
  77. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +12 -12
  78. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +9 -9
  79. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +10 -10
  80. package/dist/skills/frameworks/expo/animate-expo/LICENSE +21 -0
  81. package/dist/skills/frameworks/expo/animate-expo/RECIPES.md +385 -0
  82. package/dist/skills/frameworks/expo/animate-expo/SKILL.md +255 -0
  83. package/dist/skills/frameworks/expo/animate-expo/UPSTREAM.md +9 -0
  84. package/dist/skills/phases/delivery-phase/phases/review.md +34 -9
  85. package/dist/skills/phases/delivery-phase/phases/router.md +16 -9
  86. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +19 -1
  87. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +14 -11
  88. package/dist/skills/phases/review-phase/phases/retain-report.md +9 -2
  89. package/dist/skills/phases/review-phase/phases/return-route.md +6 -8
  90. package/dist/skills/phases/review-phase/phases/run-review.md +8 -5
  91. package/dist/skills/phases/review-phase/references/durable-report.md +29 -14
  92. package/dist/skills/phases/review-phase/references/state-graph.md +18 -5
  93. package/dist/skills/phases/review-phase/references/targets.md +2 -1
  94. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +91 -11
  95. package/package.json +52 -9
  96. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.test.ts +0 -130
  97. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.test.ts +0 -135
  98. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.test.ts +0 -138
  99. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.test.ts +0 -135
  100. package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/contract.test.ts +0 -875
  101. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.lifecycle.test.ts +0 -205
  102. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.native.test.ts +0 -2765
  103. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.test.ts +0 -2108
  104. package/dist/baseline/scaffold-baseline/data/subagents/manifest.test.ts +0 -116
  105. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +0 -29
@@ -45,9 +45,14 @@ 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.
48
52
 
49
53
  The parsed JSON object is report authority. Detached objects, sidecars, and
50
- caller-supplied derived identities are never trusted. It contains exactly these fields:
54
+ caller-supplied derived identities are never trusted. It contains exactly these
55
+ fields:
51
56
 
52
57
  - `review_lineage_id`
53
58
  - `review_run_id`
@@ -60,8 +65,8 @@ caller-supplied derived identities are never trusted. It contains exactly these
60
65
  - canonical `source_set_hash`
61
66
  - an explicit outcome for Standards, skill adherence and scoped skills,
62
67
  architecture, simplify, and Spec
63
- - stable finding identifiers with severity, location, impact, evidence, and
64
- action
68
+ - stable finding identifiers with severity, location, impact, evidence,
69
+ action, and one `return_route`
65
70
  - routing and validation
66
71
 
67
72
  Delivery mode also records delivery-goal identity, review ordinal, and preceding
@@ -70,16 +75,23 @@ as null or not applicable.
70
75
 
71
76
  `lens_outcomes` has exactly `standards`, `skill_adherence`, `architecture`,
72
77
  `simplify`, and `spec`; each value is `clean` or `findings`. Every finding has
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.
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`.
76
83
 
77
84
  `routing` has exactly `primary` and `secondary_architecture_follow_up`.
78
85
  `primary` is `debugging`, `implementation`, `debt_follow_up`, `docs_ingest`, or
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.
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.
83
95
 
84
96
  Delivery ordinals are 1 through 3. Review 1 has null preceding-repair ordinal;
85
97
  review 2 or 3 records respectively 1 or 2. Standalone delivery-goal identity,
@@ -117,12 +129,15 @@ evidence. A candidate is a valid retained pass only when every predicate holds:
117
129
  snapshot hash, source-set hash, and deterministic report path equal values
118
130
  recomputed from the canonical identity algorithm;
119
131
  3. the outside-envelope report SHA-256 equals the exact retained report blob;
120
- 4. current accepted-bounds, normalized-target, and governing-source hashes still
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
121
135
  equal the report values;
122
- 5. the report commit changed the report path and only repository-approved
136
+ 6. the report commit changed the report path and only repository-approved
123
137
  report, navigation, and wiki-log envelope paths;
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
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
126
141
  fields are null.
127
142
 
128
143
  A malformed report, wrong lineage or run id, wrong blob or freshness hash,
@@ -4,38 +4,44 @@ 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` | Authorized 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 |
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` | Authorized 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 |
39
45
 
40
46
  ## Durable Budget
41
47
 
@@ -52,6 +58,13 @@ already-consumed ordinals. Complete the transition only after the write. An
52
58
  already recorded run ID resumes its active state without another increment and
53
59
  cannot fall through to an unrecorded guard.
54
60
 
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
+
55
68
  Review 1 may open fix 1, review 2 fix 2, and review 3 fix 3. Fix 3 never opens
56
69
  review 4. A failed focused validation stays in repair epoch 3 until that same
57
70
  validation passes.
@@ -6,7 +6,8 @@ composition, report, routing, and freshness contracts.
6
6
 
7
7
  ## Scope
8
8
 
9
- Record the smallest certain inclusive scope. Full-repository expansion requires
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
10
11
  an explicit caller request. Unsupported targets or invalid accepted bounds enter
11
12
  `review_failed` with exact evidence, no report, and no counter change, including
12
13
  when a delivery counter is already 3.
@@ -36,8 +36,12 @@ 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
- hashRecord("delivery-lineage", [deliveryGoalIdentity]);
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
+ };
41
45
 
42
46
  export const standaloneLineageId = (locator, boundsHash) =>
43
47
  hashRecord("standalone-lineage", [locator, boundsHash]);
@@ -118,10 +122,21 @@ export const sourceSetHash = (sources) =>
118
122
  .flatMap(({ path, hash }) => [path, hash]),
119
123
  );
120
124
 
121
- export const reviewReportPath = ({ lineageId, reviewedAt, snapshotHash }) => {
122
- if (!/^\d{8}T\d{6}Z$/u.test(reviewedAt)) {
123
- throw new TypeError("reviewedAt must use YYYYMMDDTHHMMSSZ UTC format");
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`);
124
135
  }
136
+ };
137
+
138
+ export const reviewReportPath = ({ lineageId, reviewedAt, snapshotHash }) => {
139
+ assertReviewedAt(reviewedAt, "reviewedAt");
125
140
  return `apps/wiki/content/docs/project/reviews/${reviewScopeSlug(lineageId)}-${reviewedAt}-${snapshot12(snapshotHash)}-review-report.md`;
126
141
  };
127
142
 
@@ -147,6 +162,29 @@ const FRONTMATTER_KEYS = [
147
162
  const HEX_64 = /^[0-9a-f]{64}$/u;
148
163
  const COMMIT_SHA = /^[0-9a-f]{40}(?:[0-9a-f]{24})?$/u;
149
164
  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
+ };
150
188
 
151
189
  const exactKeys = (value, keys) =>
152
190
  value !== null &&
@@ -163,9 +201,7 @@ const sortedUniqueStrings = (values) =>
163
201
  isDeepStrictEqual(values, sortUtf8(values));
164
202
 
165
203
  const reportDate = (reviewedAt) => {
166
- if (!/^\d{8}T\d{6}Z$/u.test(reviewedAt)) {
167
- throw new TypeError("reviewed_at must use YYYYMMDDTHHMMSSZ");
168
- }
204
+ assertReviewedAt(reviewedAt, "reviewed_at");
169
205
  return `${reviewedAt.slice(0, 4)}-${reviewedAt.slice(4, 6)}-${reviewedAt.slice(6, 8)}`;
170
206
  };
171
207
 
@@ -218,11 +254,14 @@ const parseFrontmatter = (text) => {
218
254
  if (!text.startsWith("---\n")) throw new TypeError("missing frontmatter");
219
255
  const close = text.indexOf("\n---\n", 4);
220
256
  if (close < 0) throw new TypeError("unclosed frontmatter");
221
- const frontmatter = {};
257
+ const frontmatter = Object.create(null);
222
258
  for (const line of text.slice(4, close).split("\n")) {
223
259
  const separator = line.indexOf(": ");
224
260
  if (separator < 1) throw new TypeError("malformed frontmatter line");
225
261
  const key = line.slice(0, separator);
262
+ if (PROTOTYPE_KEYS.has(key)) {
263
+ throw new TypeError("prototype-sensitive frontmatter key");
264
+ }
226
265
  if (Object.hasOwn(frontmatter, key)) throw new TypeError("duplicate frontmatter key");
227
266
  const raw = line.slice(separator + 2);
228
267
  frontmatter[key] = raw === "[]" ? [] : JSON.parse(raw);
@@ -264,6 +303,8 @@ export const normalizeReviewTarget = (mode, evidence) => {
264
303
  !nonemptyString(evidence.actualBaseRef) ||
265
304
  !COMMIT_SHA.test(evidence.fixedPointSha) ||
266
305
  !nonemptyString(evidence.headIdentity) ||
306
+ !Array.isArray(evidence.scopeEntries) ||
307
+ evidence.scopeEntries.length === 0 ||
267
308
  !sortedUniqueStrings(sortUtf8(evidence.scopeEntries)) ||
268
309
  !Buffer.isBuffer(evidence.canonicalPatchBytes)
269
310
  ) {
@@ -280,11 +321,15 @@ export const normalizeReviewTarget = (mode, evidence) => {
280
321
  };
281
322
  }
282
323
  if (mode === "standalone") {
324
+ if (!Array.isArray(evidence.scopeEntries) || evidence.scopeEntries.length === 0) {
325
+ throw new TypeError("invalid standalone target evidence");
326
+ }
283
327
  const files = orderedFiles(evidence.files);
284
328
  const identities = files.map(({ identity }) => identity);
285
329
  const scope = sortUtf8(evidence.scopeEntries);
286
330
  if (
287
331
  !nonemptyString(evidence.locator) ||
332
+ identities.length === 0 ||
288
333
  !sortedUniqueStrings(identities) ||
289
334
  !files.every(({ bytes }) => Buffer.isBuffer(bytes)) ||
290
335
  !isDeepStrictEqual(scope, identities)
@@ -306,6 +351,7 @@ export const normalizeReviewTarget = (mode, evidence) => {
306
351
  export const normalizeReviewSources = (sources) => {
307
352
  if (
308
353
  !Array.isArray(sources) ||
354
+ sources.length === 0 ||
309
355
  sources.some(({ path, bytes }) => !nonemptyString(path) || !Buffer.isBuffer(bytes)) ||
310
356
  new Set(sources.map(({ path }) => path)).size !== sources.length
311
357
  ) {
@@ -393,7 +439,12 @@ const validateTargetSchema = (target, mode, errors) => {
393
439
  errors.push("malformed:normalized_target_schema");
394
440
  return;
395
441
  }
396
- if (!nonemptyString(target.locator) || !sortedUniqueStrings(target.inclusive_scope)) {
442
+ if (
443
+ !nonemptyString(target.locator) ||
444
+ !Array.isArray(target.inclusive_scope) ||
445
+ target.inclusive_scope.length === 0 ||
446
+ !sortedUniqueStrings(target.inclusive_scope)
447
+ ) {
397
448
  errors.push("malformed:normalized_target_common_fields");
398
449
  }
399
450
  if (mode === "delivery") {
@@ -435,7 +486,16 @@ const validateReportSemantics = (report, errors) => {
435
486
  if (!Array.isArray(report.findings)) {
436
487
  errors.push("malformed:findings");
437
488
  } else {
438
- const findingKeys = ["id", "lens", "severity", "location", "impact", "evidence", "action"];
489
+ const findingKeys = [
490
+ "id",
491
+ "lens",
492
+ "severity",
493
+ "location",
494
+ "impact",
495
+ "evidence",
496
+ "action",
497
+ "return_route",
498
+ ];
439
499
  const ids = new Set();
440
500
  const findingLenses = new Set();
441
501
  for (const finding of report.findings) {
@@ -471,6 +531,14 @@ const validateReportSemantics = (report, errors) => {
471
531
  typeof report.routing?.secondary_architecture_follow_up !== "boolean"
472
532
  ) {
473
533
  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
+ }
474
542
  }
475
543
 
476
544
  const validationKeys = [
@@ -655,7 +723,13 @@ const inspectRetainedPass = (candidate, expected) => {
655
723
  ) {
656
724
  errors.push("mismatch:report_sha256");
657
725
  }
658
- if (!candidate.refContainsCommit) errors.push("ref_missing_commit");
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");
659
733
  if (!COMMIT_SHA.test(candidate.reportCommitSha)) {
660
734
  errors.push("invalid:report_commit_sha");
661
735
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "channel": "stable",
4
- "version": "2026.08.17-5ef3e434",
5
- "tag": "baseline/stable/2026.08.17-5ef3e434",
6
- "commit": "5ef3e434d5b8afc9b38d803870003ae016a7b558",
4
+ "version": "2026.08.20-7fe58cdb",
5
+ "tag": "baseline/stable/2026.08.20-7fe58cdb",
6
+ "commit": "7fe58cdbd877c3f8706a83f88b7ad41447a9cc1f",
7
7
  "archive": "scaffold-baseline.tgz",
8
- "archiveSha256": "d834c7bebc13161f1a092bf59bc6e5fd891b21d34fbea69524796840e703796b",
8
+ "archiveSha256": "42f230823fc6a34581127569333150269d52125dc7b49e6b79cf22a1663817de",
9
9
  "compatibility": {
10
- "cliVersionRange": ">=3.2.2 <3.3.0"
10
+ "cliVersionRange": ">=3.3.1 <3.4.0"
11
11
  }
12
12
  }
Binary file
@@ -4,6 +4,6 @@ Primary skills here: `autoreview`, `codebase-design`, `improve-codebase-architec
4
4
 
5
5
  This scope owns packaged CLI assets: skill and pack catalogs, hooks, prompt content, subagent manifests, harness-projection scripts, and generated declarations. Keep runtime behavior in `apps/cli/src`; keep shared scaffold model contracts in `packages/scaffold`. Changes to embedded or generated assets must preserve their content hashes and public-output contracts.
6
6
 
7
- When reusable skills change, complete the root source-first flow before treating these distributed assets as current: canonical edit, commit, push, `bun run sync:skills`, exact receipt-SHA verification, then baseline publication when requested.
7
+ When reusable skills change, complete the root source-first flow before treating these distributed assets as current: before editing, verify `git -C /Users/stefan/Desktop/repos/wearedevpunks-skills branch --show-current` returns exactly `main`; stop otherwise. Edit and commit the canonical source only on that checked-out `main` branch; alternate branches or worktrees are out of scope for this flow. Then push, run `bun run sync:skills`, verify the exact receipt SHA, and publish the baseline when requested.
8
8
 
9
9
  If work here changes scaffolding behavior, generated guidance, release assets, or validation procedures, update `docs/README.md` and `docs/runbooks/hi-cli-scaffolding.md` in the same task.
@@ -108,6 +108,7 @@ const skillActivationInstructions = [
108
108
  "In each final docs/workspace AGENTS.md, read its `## Skills` table. When assigned work matches a row's trigger, treat that row's skill as mandatory.",
109
109
  "Activate a selected skill by opening its installed `.agents/skills/<skill-id>/SKILL.md`, reading the workflow/checklist needed for the assigned task, and applying it before edits.",
110
110
  "When the task writes or edits root/scoped AGENTS.md, prompt specs or handoffs, or subagent templates/instructions, activate `writing-for-agents` from `.agents/skills/writing-for-agents/SKILL.md` before that authoring branch.",
111
+ "Before completing release-bearing work, run the repository's semantic release classification. Baseline changes require a reviewed non-empty `BASELINE_CHANGELOG.md`; npm changes require a version bump and matching reviewed non-empty `CHANGELOG.md`; mixed changes require both.",
111
112
  "When a skill listed in scoped guidance is also present in this role's `skills`, explicitly mention in the worker's reasoning or handoff that it was used.",
112
113
  "If the task touches multiple owned or related scopes, inspect each scope's nearest AGENTS.md and activate the union of relevant skills.",
113
114
  "Do not rely on role name or inherited context alone; scoped AGENTS.md skill routing is part of the task contract.",