@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.
- package/dist/BASELINE_CHANGELOG.md +14 -1
- package/dist/CHANGELOG.md +15 -0
- package/dist/baseline/scaffold-baseline/baseline.json +5 -5
- package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +48 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +1 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +17 -14
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +98 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +9 -34
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +10 -16
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +1 -19
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +2 -9
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +8 -6
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +5 -8
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +14 -29
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +32 -45
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +1 -2
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +12 -86
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/index.js +5 -5
- package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +1 -6
- package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
- package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -14
- package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +98 -0
- package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
- package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
- package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
- package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
- package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +1 -1
- package/dist/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
- package/dist/skills/phases/delivery-phase/phases/review.md +9 -34
- package/dist/skills/phases/delivery-phase/phases/router.md +8 -14
- package/dist/skills/phases/delivery-phase/references/phase-handoff.md +1 -19
- package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
- package/dist/skills/phases/review-phase/phases/retain-report.md +2 -9
- package/dist/skills/phases/review-phase/phases/return-route.md +8 -6
- package/dist/skills/phases/review-phase/phases/run-review.md +5 -8
- package/dist/skills/phases/review-phase/references/durable-report.md +14 -29
- package/dist/skills/phases/review-phase/references/state-graph.md +5 -18
- package/dist/skills/phases/review-phase/references/targets.md +1 -2
- package/dist/skills/phases/review-phase/scripts/review-contract.mjs +11 -91
- package/package.json +1 -1
package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md
CHANGED
|
@@ -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
|
|
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
|
|
79
|
-
`action
|
|
80
|
-
`
|
|
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.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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.
|
|
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
|
-
|
|
122
|
+
5. the report commit changed the report path and only repository-approved
|
|
137
123
|
report, navigation, and wiki-log envelope paths;
|
|
138
|
-
|
|
139
|
-
|
|
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,
|
package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md
CHANGED
|
@@ -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
|
|
8
|
-
| --------------------------------- | ------------------------------------------------ |
|
|
9
|
-
| Current delivery state | Review considered | Unsupported target
|
|
10
|
-
| Current delivery state | Review considered | Invalid accepted bounds
|
|
11
|
-
| `review_due` | Explicit review invocation | Delivery; accepted bounds and target valid; recovered `review_count < 3`
|
|
12
|
-
| `review_due` | Explicit review invocation | Standalone; accepted bounds and target valid
|
|
13
|
-
| Current delivery state | Review considered | Delivery; in-memory accepted bounds and target valid; recovered `review_count >= 3`
|
|
14
|
-
| `review_running` | All lenses and parent verification complete | One frozen snapshot; complete local report exists
|
|
15
|
-
| `review_running` | Validation mutation detected | Frozen-target hash differs after validation
|
|
16
|
-
| `review_running` | Retryable infrastructure failure or partial run | No immutable report
|
|
17
|
-
| `review_running` | Non-retryable contract or infrastructure failure | No immutable report
|
|
18
|
-
| `report_retention_pending` | Retention verified | Delivery; valid retained-pass predicate; ordinal at most 3; hashes fresh
|
|
19
|
-
| `report_retention_pending` | Retention rejected | Delivery; ordinal is greater than 3
|
|
20
|
-
| `report_retention_pending` | Retention verified | Standalone; valid retained-pass predicate; hashes fresh
|
|
21
|
-
| `report_retention_pending` | Idempotent retention recovery | Same lineage/run has identical valid path, report blob SHA-256, and commit
|
|
22
|
-
| `report_retention_pending` | Same-run conflict | Same lineage/run has two valid candidates with different path, blob, or commit
|
|
23
|
-
| `report_retention_pending` | Retained-pass validation rejected | Active candidate is malformed or has wrong derived identity, hash, paths, containment, or ordinal
|
|
24
|
-
| `report_retention_pending` | Retryable retention failure | Hashes fresh
|
|
25
|
-
| `report_retention_pending` | Non-retryable retention failure | Retry cannot succeed
|
|
26
|
-
| `report_retention_pending` | Freshness changed | Target or source hash changed
|
|
27
|
-
| `review_routed` | Readonly return | Standalone
|
|
28
|
-
| `review_routed` | Resume debug route | Handoff already records run id, debug route, and `debug_active`
|
|
29
|
-
| `review_routed` | Resume implementation route | Handoff already records run id, implementation route, and `repair_active`
|
|
30
|
-
| `review_routed` |
|
|
31
|
-
| `review_routed` | Mixed finding route
|
|
32
|
-
| `review_routed` |
|
|
33
|
-
| `review_routed` |
|
|
34
|
-
| `review_routed` |
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
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
|
|
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.
|
package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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.
|
|
5
|
-
"tag": "baseline/stable/2026.08.
|
|
6
|
-
"commit": "
|
|
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": "
|
|
8
|
+
"archiveSha256": "730ad1d63cbe14610c9f689fa9a038b93ff5469bdb8e13c8f1a030fcd6c30b54",
|
|
9
9
|
"compatibility": {
|
|
10
|
-
"cliVersionRange": ">=3.2.
|
|
10
|
+
"cliVersionRange": ">=3.2.1 <3.3.0"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
Binary file
|