@punks/cli 4.0.3 → 5.0.0
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 +25 -1
- package/dist/CHANGELOG.md +41 -0
- package/dist/baseline/scaffold-baseline/baseline.json +563 -5
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/authoring.d.mts +23 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/authoring.mjs +84 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/authoring.test.ts +79 -0
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/lint-feedback.test.ts +60 -28
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents-validator.test.ts +59 -0
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.d.mts +1 -0
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.mjs +192 -16
- package/dist/baseline/scaffold-baseline/data/shared-agents.md +55 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +12 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handoff/SKILL.md +18 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +10 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +28 -8
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +7 -3
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-verification-skill/SKILL.md +66 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-verification-skill/references/upstream.md +20 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +16 -41
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +14 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +47 -7
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +102 -134
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +77 -67
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +19 -39
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/runtime-product-validation.md +27 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/swarm-planner/SKILL.md +27 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/update-verification-skill/SKILL.md +81 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/verify-behavior/SKILL.md +105 -65
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/SKILL.md +17 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/scripts/autoreview +102 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +11 -5
- package/dist/baseline/scaffold-baseline/skills/agnostic/subagents/swarm-planner/SKILL.md +27 -2
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +12 -14
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/backlog.md +4 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/closeout.md +12 -4
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/debug.md +11 -5
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/docs-ingest.md +4 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/handback.md +6 -2
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +12 -7
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +7 -1
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +61 -22
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +45 -91
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +4 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +21 -9
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/context-continuity.md +109 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/failure-continuity.md +27 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +32 -20
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/SKILL.md +4 -0
- package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/wiki-ingest.md +4 -0
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +41 -8
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +13 -4
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/router.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +24 -18
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +40 -6
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/review-packet.md +72 -0
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/runtime-handoff.md +3 -0
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +51 -42
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +239 -4
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/data/scripts/harness-projection/authoring.d.mts +23 -0
- package/dist/data/scripts/harness-projection/authoring.mjs +84 -0
- package/dist/data/scripts/sync-subagents.d.mts +1 -0
- package/dist/data/scripts/sync-subagents.mjs +158 -15
- package/dist/data/shared-agents.md +2 -60
- package/dist/index.js +1417 -1407
- package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +12 -0
- package/dist/skills/agnostic/generic/handoff/SKILL.md +18 -5
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +10 -2
- package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +28 -8
- package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +7 -3
- package/dist/skills/agnostic/planning/create-verification-skill/SKILL.md +66 -0
- package/dist/skills/agnostic/planning/create-verification-skill/references/upstream.md +20 -0
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +16 -41
- package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +14 -0
- package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +47 -7
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +102 -134
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +77 -67
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +19 -39
- package/dist/skills/agnostic/planning/implement-spec/references/runtime-product-validation.md +27 -0
- package/dist/skills/agnostic/planning/swarm-planner/SKILL.md +27 -2
- package/dist/skills/agnostic/planning/update-verification-skill/SKILL.md +81 -0
- package/dist/skills/agnostic/planning/verify-behavior/SKILL.md +105 -65
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +17 -4
- package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +102 -5
- package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +11 -5
- package/dist/skills/agnostic/subagents/swarm-planner/SKILL.md +27 -2
- package/dist/skills/phases/delivery-phase/SKILL.md +12 -14
- package/dist/skills/phases/delivery-phase/phases/backlog.md +4 -0
- package/dist/skills/phases/delivery-phase/phases/closeout.md +12 -4
- package/dist/skills/phases/delivery-phase/phases/debug.md +11 -5
- package/dist/skills/phases/delivery-phase/phases/docs-ingest.md +4 -0
- package/dist/skills/phases/delivery-phase/phases/handback.md +6 -2
- package/dist/skills/phases/delivery-phase/phases/implement.md +12 -7
- package/dist/skills/phases/delivery-phase/phases/plan.md +7 -1
- package/dist/skills/phases/delivery-phase/phases/review.md +61 -22
- package/dist/skills/phases/delivery-phase/phases/router.md +45 -91
- package/dist/skills/phases/delivery-phase/phases/spec.md +4 -0
- package/dist/skills/phases/delivery-phase/references/artifact-state.md +21 -9
- package/dist/skills/phases/delivery-phase/references/context-continuity.md +109 -0
- package/dist/skills/phases/delivery-phase/references/failure-continuity.md +27 -0
- package/dist/skills/phases/delivery-phase/references/phase-handoff.md +32 -20
- package/dist/skills/phases/docs-ingest-phase/SKILL.md +4 -0
- package/dist/skills/phases/docs-ingest-phase/references/wiki-ingest.md +4 -0
- package/dist/skills/phases/review-phase/phases/prepare-review.md +40 -8
- package/dist/skills/phases/review-phase/phases/retain-report.md +13 -4
- package/dist/skills/phases/review-phase/phases/router.md +1 -1
- package/dist/skills/phases/review-phase/phases/run-review.md +24 -18
- package/dist/skills/phases/review-phase/references/durable-report.md +40 -6
- package/dist/skills/phases/review-phase/references/review-packet.md +72 -0
- package/dist/skills/phases/review-phase/references/runtime-handoff.md +3 -0
- package/dist/skills/phases/review-phase/references/state-graph.md +21 -12
- package/dist/skills/phases/review-phase/scripts/review-contract.mjs +137 -4
- package/package.json +4 -1
package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md
CHANGED
|
@@ -2,23 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Each phase leaves enough durable state for resume without guessing.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Phase exit and Delivery Handoff
|
|
6
|
+
|
|
7
|
+
Every phase emits the [common Phase Result](context-continuity.md#common-phase-result).
|
|
8
|
+
Keep its phase-specific evidence in the owning durable artifact. A cross-task
|
|
9
|
+
Delivery Handoff contains only:
|
|
6
10
|
|
|
7
11
|
```text
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
delivery_goal_identity:
|
|
13
|
+
accepted_bounds_identity:
|
|
14
|
+
git_identity: branch, base, target
|
|
15
|
+
phase:
|
|
16
|
+
next_action:
|
|
17
|
+
context_pointers: typed stable pointers with identity and freshness rule
|
|
18
|
+
provider_identities: relevant identities or explicit none
|
|
19
|
+
blocker: exact blocker or explicit none
|
|
20
|
+
unknowns: explicit unknowns or none
|
|
21
|
+
boundary_rationale: at most one sentence plus rationale pointer, when unusual
|
|
17
22
|
```
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
Validate this envelope before handing off. Resolve fields from durable authority;
|
|
25
|
+
missing required proof remains explicit and blocks the dependent action. Exclude
|
|
26
|
+
full bodies, logs, unbounded narrative and the disposable Delivery Context Packet.
|
|
27
|
+
The receiving task always cold-routes under
|
|
28
|
+
[context continuity](context-continuity.md), checking current authority and prior
|
|
29
|
+
mutation receipts. Detailed review/repair state below lives in a pointed durable
|
|
30
|
+
state artifact, not embedded into the Delivery Handoff. This is distinct from a
|
|
31
|
+
scaffold CLI Post-Command Handoff, whose owning CLI contract remains unchanged.
|
|
22
32
|
|
|
23
33
|
## Review And Repair Projection
|
|
24
34
|
|
|
@@ -83,17 +93,19 @@ normalized_target:
|
|
|
83
93
|
|
|
84
94
|
The `review_due` handoff leaves `review_run_id` unset. Full delivery consumes the
|
|
85
95
|
context immediately; other modes return it for explicit operator invocation.
|
|
86
|
-
Consumption
|
|
87
|
-
`review_running
|
|
96
|
+
Consumption fixes the attempt run id and proposed next completed ordinal and
|
|
97
|
+
enters `review_running`; only valid completed retained coverage advances the count.
|
|
88
98
|
|
|
89
99
|
For `report_retention_pending`, the explicit resume context additionally carries
|
|
90
100
|
the existing `review_run_id`, ordinal, local report path and SHA-256, target hash,
|
|
91
101
|
source hashes, and intended retained ref. Full delivery resumes `$review-phase`;
|
|
92
102
|
other modes return the context for explicit retry without rerunning lenses.
|
|
93
103
|
|
|
94
|
-
After
|
|
95
|
-
|
|
104
|
+
After accepted repair, retain Focused Repair Validation and affected Verification
|
|
105
|
+
evidence under the transition rules in [review.md](../phases/review.md). A clean
|
|
106
|
+
handoff links the retained review, final changes and passing required checks.
|
|
107
|
+
Historical ordinals remain unchanged during legacy read-time normalization.
|
|
96
108
|
|
|
97
|
-
For `human_steering_required`, store the complete `$handback` outcome
|
|
98
|
-
|
|
99
|
-
passes.
|
|
109
|
+
For `human_steering_required`, store the complete `$handback` outcome in the
|
|
110
|
+
pointed durable state artifact. Keep only its pointer and exact blocker in the
|
|
111
|
+
Delivery Handoff. The state remains terminal until the authority guard passes.
|
|
@@ -42,6 +42,10 @@ Completion of one path does not imply loading the other path.
|
|
|
42
42
|
- Public docs work that runs the writer flow must include the fragment sufficiency checkpoint from [phases/public-docs.md](phases/public-docs.md).
|
|
43
43
|
- After a path completes, report enough state for future resume: selected path, inputs processed, docs written or skipped, validation, blockers, and next path if any.
|
|
44
44
|
|
|
45
|
+
## Project Verifier boundary
|
|
46
|
+
|
|
47
|
+
Treat Feature Maps as read-only navigation inputs to ordinary product and domain documentation. Preserve all Project Verifier references; docs ingest never creates, edits, regenerates, or maintains Feature Maps, invokes either verification lifecycle skill, or performs a verifier audit. Record observed coverage gaps for `implement-spec` to handle in its selected scenario.
|
|
48
|
+
|
|
45
49
|
## Stop Conditions
|
|
46
50
|
|
|
47
51
|
- Selected path completed and its resumable outcome was reported.
|
package/dist/baseline/scaffold-baseline/skills/phases/docs-ingest-phase/references/wiki-ingest.md
CHANGED
|
@@ -22,6 +22,10 @@ Resolve routed `content/docs/project/specs` folders first, then legacy root `spe
|
|
|
22
22
|
- Use existing `<wiki-root>/content/docs/project/` sections for concise projections and links.
|
|
23
23
|
- If no clear project route home exists, stop and report the missing route policy. Do not scaffold a second routed docs surface to satisfy this phase.
|
|
24
24
|
|
|
25
|
+
## Feature Map navigation
|
|
26
|
+
|
|
27
|
+
When a Feature Map links to applicable product or domain authority, follow only the needed links as read-only navigation. Apply the [Project Verifier boundary](../SKILL.md#project-verifier-boundary) even when the ingested source describes changed behavior. Write ordinary routed docs and record any observed coverage gap; preserve the verifier tree and its expected behavior.
|
|
28
|
+
|
|
25
29
|
## Source Read
|
|
26
30
|
|
|
27
31
|
Read in order:
|
|
@@ -28,7 +28,7 @@ reconciles retained-pass recovery, and owns the exit evidence.
|
|
|
28
28
|
|
|
29
29
|
1. Validate accepted bounds and normalize the smallest-certain supported target
|
|
30
30
|
before reading or evaluating any delivery review counter. Unsupported target
|
|
31
|
-
or invalid bounds evidence is terminal even when a delivery counter is 3.
|
|
31
|
+
or invalid bounds evidence is terminal even when a delivery counter is 2 or a preserved legacy 3.
|
|
32
32
|
2. Recompute the accepted-bounds hash, normalized target, inclusive scope,
|
|
33
33
|
snapshot hash, governing source paths and blob hashes, and source-set hash
|
|
34
34
|
from primitive current evidence.
|
|
@@ -37,21 +37,49 @@ reconciles retained-pass recovery, and owns the exit evidence.
|
|
|
37
37
|
mode reads and writes no delivery review or repair counter.
|
|
38
38
|
4. For delivery mode only, recover `review_count` from unique valid retained
|
|
39
39
|
ordinals for this lineage and reconcile contradictory projections from that
|
|
40
|
-
authority.
|
|
41
|
-
|
|
40
|
+
authority. Call `planDeliveryReviewGate` in
|
|
41
|
+
[`review-contract.mjs`](../scripts/review-contract.mjs) with `currentState`,
|
|
42
|
+
`acceptedBoundsValid`, `targetSupported`, and `recoveredReviewCount`.
|
|
43
|
+
At count one, pass `acceptedRiskTrigger: { kind, evidence }` only for a
|
|
44
|
+
parent-accepted repair; `evidence` points to its accepted change and the kind
|
|
45
|
+
uses this exact mapping:
|
|
46
|
+
|
|
47
|
+
| Accepted change | `kind` |
|
|
48
|
+
| ---------------------------------- | ------------------ |
|
|
49
|
+
| Architecture or ownership boundary | `architecture` |
|
|
50
|
+
| Security or authorization | `security` |
|
|
51
|
+
| Public contract | `public_contract` |
|
|
52
|
+
| Runtime or deployment topology | `runtime_topology` |
|
|
53
|
+
| Accepted scope | `accepted_scope` |
|
|
54
|
+
|
|
55
|
+
At count two or higher, an additional pass requires the parent-verified
|
|
56
|
+
`humanReviewDirection: { evidence, authorized_ordinal }` described in
|
|
57
|
+
[Review Packet](../references/review-packet.md). Its ordinal must equal
|
|
58
|
+
`recoveredReviewCount + 1`; pass the identical verified object to retention
|
|
59
|
+
and retain it as `review_epoch.human_direction`. It never resets lineage or
|
|
60
|
+
counters. Reusing direction for a different ordinal fails the guard.
|
|
61
|
+
Continue preparation only when the helper returns `review_due`. Return its
|
|
62
|
+
`focused_validation` outcome to delivery for ordinary after-pass repair, or
|
|
63
|
+
its terminal zero-write `review_budget_exhausted` outcome when allowance is
|
|
64
|
+
exhausted. Both preserve the current route, retained evidence and counters.
|
|
65
|
+
|
|
42
66
|
5. After admissibility and the delivery budget guard pass, freeze the normalized
|
|
43
67
|
target bytes and governing source bytes. In delivery mode preallocate ordinal
|
|
44
68
|
`recovered review_count + 1` and derive `review_run_id` from lineage and that
|
|
45
69
|
ordinal. In standalone mode derive `review_run_id` from lineage and
|
|
46
70
|
`snapshot12`.
|
|
47
|
-
6.
|
|
71
|
+
6. Freeze the [Review Packet](../references/review-packet.md), including Spec,
|
|
72
|
+
plan, skill guidance, Verification evidence and relevant dependency pointers.
|
|
73
|
+
Assemble complete `review_running` predecessor evidence. Preparation ends
|
|
48
74
|
before any review lens, validation command, report write, retention action,
|
|
49
75
|
counter projection, or repair routing.
|
|
50
76
|
|
|
51
77
|
## Invariants
|
|
52
78
|
|
|
53
79
|
- Target and bounds validity precede every delivery-budget decision.
|
|
54
|
-
- A delivery ordinal is preallocated only after
|
|
80
|
+
- A delivery ordinal is preallocated only after `planDeliveryReviewGate` returns
|
|
81
|
+
`review_due`: first pass, accepted-risk second pass, or the exact
|
|
82
|
+
human-authorized additional ordinal.
|
|
55
83
|
- Preallocation changes no completed-pass counter.
|
|
56
84
|
- One run identity names exactly one frozen target and governing source set.
|
|
57
85
|
- Full-repository scope exists only when the caller explicitly requested it.
|
|
@@ -75,10 +103,14 @@ Preparation is complete only when the gate can return all of:
|
|
|
75
103
|
|
|
76
104
|
## Declared Exits
|
|
77
105
|
|
|
106
|
+
- `focused_validation`: ordinary accepted repair after a completed pass; return
|
|
107
|
+
the helper result to the delivery caller without opening a review run or
|
|
108
|
+
changing report, handoff or counter authority.
|
|
109
|
+
|
|
78
110
|
- `review_running`: admissibility passed, delivery budget remains, and the frozen
|
|
79
111
|
target/source predecessor evidence is complete. Re-enter the router.
|
|
80
|
-
- terminal `review_budget_exhausted`: valid delivery context recovered count
|
|
81
|
-
or greater. Return exact current-route evidence with no report, counter,
|
|
112
|
+
- terminal `review_budget_exhausted`: valid delivery context recovered count 2
|
|
113
|
+
or greater without verified direction for the next ordinal. Return exact current-route evidence with no report, counter,
|
|
82
114
|
handoff, or status write.
|
|
83
115
|
- terminal `review_failed`: unsupported target, invalid accepted bounds, or a
|
|
84
116
|
non-retryable normalization, identity, or recovery contract failure. Return
|
|
@@ -95,7 +127,8 @@ every stateful exit with its exact schema and mode-specific storage. Use its
|
|
|
95
127
|
pre-storage failure or blocker exception only when lineage, run identity, or a
|
|
96
128
|
safe handoff path cannot be established.
|
|
97
129
|
|
|
98
|
-
`review_budget_exhausted`
|
|
130
|
+
`focused_validation` and `review_budget_exhausted` are declared pre-run
|
|
131
|
+
zero-write returns: preserve the
|
|
99
132
|
caller-provided delivery handoff and retained-count authority unchanged, then
|
|
100
133
|
return the required identity, count, and current-route evidence directly.
|
|
101
134
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Enter only when the router selected this gate from a complete immutable local
|
|
6
6
|
report in `report_retention_pending`. Parse the report and prove its exact schema
|
|
7
7
|
before any repository write. Delivery reports must carry an ordinal from 1
|
|
8
|
-
through 3. A malformed report routes to `review_failed`; an ordinal above
|
|
8
|
+
through 2 for current epochs (legacy readback preserves 3). A malformed report routes to `review_failed`; an ordinal above 2 for a current epoch without verified matching human direction
|
|
9
9
|
returns the zero-write `review_budget_exhausted` terminal.
|
|
10
10
|
|
|
11
11
|
## Inputs
|
|
@@ -18,6 +18,9 @@ returns the zero-write `review_budget_exhausted` terminal.
|
|
|
18
18
|
- expected report SHA-256 and allowed navigation/wiki-log envelope paths
|
|
19
19
|
- current retained candidates for the same lineage and run
|
|
20
20
|
- repository-approved retained refs, or the evidence needed for approval
|
|
21
|
+
- parent-verified pre-protocol report commit SHAs for legacy readback
|
|
22
|
+
- parent-verified preceding-repair ordinal and evidence, or `null` when no repair
|
|
23
|
+
opened the pass
|
|
21
24
|
|
|
22
25
|
Load [the report evidence contract](../references/durable-report.md) for the
|
|
23
26
|
schema, canonical validity predicates, and same-run identity rules. Use
|
|
@@ -36,7 +39,13 @@ accepting an exit.
|
|
|
36
39
|
|
|
37
40
|
1. Parse the immutable local bytes. Recompute report path, report SHA-256,
|
|
38
41
|
lineage, run ID, snapshot, source-set hash, and delivery ordinal relations
|
|
39
|
-
from primitive evidence.
|
|
42
|
+
from primitive evidence. For an epoch-less report, require its exact
|
|
43
|
+
`reportCommitSha` in the parent-verified `approvedLegacyReportCommitShas`
|
|
44
|
+
allowlist. Otherwise require the primary/challenger protocol. Reject a
|
|
45
|
+
delivery ordinal above 2 in the current epoch without verified matching
|
|
46
|
+
human direction before any write. Bind `preceding_repair_ordinal` to
|
|
47
|
+
parent-verified `precedingRepairEvidence`; allow both values to be `null`
|
|
48
|
+
when human direction opens the pass without a repair.
|
|
40
49
|
2. Recompute accepted-bounds, normalized-target, and governing-source hashes.
|
|
41
50
|
When any value changed, mark the local report stale and route to
|
|
42
51
|
`review_due` without committing it.
|
|
@@ -75,7 +84,7 @@ review_run_id)` independently. Reuse one unique valid candidate, including
|
|
|
75
84
|
review lenses.
|
|
76
85
|
- Stale, malformed, conflicting, or non-retained evidence changes no pass or
|
|
77
86
|
counter.
|
|
78
|
-
-
|
|
87
|
+
- Default current epochs stop at 2. Legacy ordinals remain immutable. Retention never opens a
|
|
79
88
|
repair.
|
|
80
89
|
|
|
81
90
|
## Completion Evidence
|
|
@@ -101,7 +110,7 @@ review_run_id)` independently. Reuse one unique valid candidate, including
|
|
|
101
110
|
the local report is stale.
|
|
102
111
|
- `review_failed`: schema or identity validation failed, a malformed active
|
|
103
112
|
candidate or `same_run_conflict` exists, or retention failed non-retryably.
|
|
104
|
-
- `review_budget_exhausted`: a delivery ordinal above
|
|
113
|
+
- `review_budget_exhausted`: a delivery ordinal above 2 for a current epoch without verified matching human direction was rejected before any
|
|
105
114
|
write, pass, counter, or status mutation.
|
|
106
115
|
|
|
107
116
|
## Durable Handoff
|
|
@@ -45,7 +45,7 @@ output.
|
|
|
45
45
|
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
|
|
46
46
|
| 1 | Durable `human_steering_required` while the `$handback` authority guard fails | terminal `human_steering_required` |
|
|
47
47
|
| 2 | Unsupported target, invalid accepted bounds, non-retryable contract or infrastructure failure, malformed active retention candidate, or `same_run_conflict` | terminal `review_failed` |
|
|
48
|
-
| 3 | Delivery entry is otherwise valid, recovered `review_count >=
|
|
48
|
+
| 3 | Delivery entry is otherwise valid, recovered `review_count >= 2`, no verified human direction authorizes the next ordinal, and no already-started run has valid predecessor evidence | terminal `review_budget_exhausted` |
|
|
49
49
|
| 4 | A repository-approved retained ref is required but cannot be derived and requires an operator decision | checkpoint `retained_ref_approval_required` |
|
|
50
50
|
| 5 | Same-authority admissible evidence conflicts and no declared tie-break resolves it | blocked `review_state_conflict` |
|
|
51
51
|
| 6 | Required explicit invocation context, accepted bounds, target evidence, or reconstructible lineage inputs are missing | blocked `review_context_blocked` |
|
|
@@ -29,27 +29,32 @@ scope; the parent rejects stale, expanded, duplicated, or unverified output.
|
|
|
29
29
|
|
|
30
30
|
1. Recompute the frozen target and source hashes before dispatch. A mismatch
|
|
31
31
|
makes the prepared evidence stale and returns to `review_due`.
|
|
32
|
-
2.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
4.
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
2. Run `autoreview` once as the comprehensive primary reviewer using the
|
|
33
|
+
prepared-packet invocation in [Review Packet](../references/review-packet.md).
|
|
34
|
+
It consumes the frozen facts directly and emits one result for each of
|
|
35
|
+
Standards (including security), skill adherence, architecture, simplify,
|
|
36
|
+
and Spec. Keep Standards and Spec as distinct coverage obligations.
|
|
37
|
+
3. Assign one independent risk-focused challenger the same prepared facts and
|
|
38
|
+
packet identity, without primary conclusions. Run both roles in parallel
|
|
39
|
+
when native capacity permits; capacity one runs them sequentially in fresh
|
|
40
|
+
independent contexts. Larger changes may split independent risk areas into
|
|
41
|
+
bounded challenger assignments. Every assigned challenger must finish.
|
|
42
|
+
4. Validate each compact Lens Result using the packet contract. `clean` and
|
|
43
|
+
`findings` require completed assigned coverage; `incomplete` retains any
|
|
44
|
+
candidates and names unavailable coverage, cause, and follow-up. Account for
|
|
45
|
+
completed results on interruption; an incomplete role never completes a pass.
|
|
45
46
|
5. For skill adherence, prove every implementation-applicable
|
|
46
47
|
`assigned_skills` item maps to exactly one guidance entry and every guidance
|
|
47
48
|
entry maps to exactly one implementation-note evidence record. Verify every
|
|
48
49
|
`loaded`, `applied`, and `not_applicable` claim, including its how/where or
|
|
49
50
|
why/where evidence, against frozen changed artifacts. Missing, extra, or
|
|
50
51
|
contradicted evidence becomes a finding.
|
|
51
|
-
6.
|
|
52
|
-
|
|
52
|
+
6. Group duplicate primary/challenger candidates before investigation. Verify
|
|
53
|
+
every distinct underlying claim against the frozen target and adjacent
|
|
54
|
+
evidence, recording accepted or rejected disposition and all originating
|
|
55
|
+
candidate references. Parent owns final severity, route, stable IDs and report;
|
|
56
|
+
this adjudication does not open an automatic third discovery review.
|
|
57
|
+
Only verified candidates become findings. Give each
|
|
53
58
|
accepted finding a stable identifier, lens, severity, location, impact,
|
|
54
59
|
evidence, action, and one explicit `return_route`: `human_steering_required`,
|
|
55
60
|
`debugging`, `implementation`, `debt_follow_up`, or `docs_ingest`. Use
|
|
@@ -76,9 +81,9 @@ scope; the parent rejects stale, expanded, duplicated, or unverified output.
|
|
|
76
81
|
## Invariants
|
|
77
82
|
|
|
78
83
|
- One gate run inspects exactly one frozen bounded snapshot.
|
|
79
|
-
- `autoreview`
|
|
80
|
-
|
|
81
|
-
-
|
|
84
|
+
- `autoreview` is the single comprehensive primary; the independent challenger
|
|
85
|
+
receives the same frozen facts. Five primary outcomes retain coverage authority.
|
|
86
|
+
- Candidate output never bypasses parent verification.
|
|
82
87
|
- Standards and Spec remain distinct report sections.
|
|
83
88
|
- Validation is readonly relative to the frozen target and remains within
|
|
84
89
|
accepted bounds.
|
|
@@ -97,6 +102,7 @@ The run is complete only when one local report contains:
|
|
|
97
102
|
- the prepared lineage, run, bounds, normalized-target, snapshot, source-set,
|
|
98
103
|
and mode-specific delivery identities
|
|
99
104
|
- explicit Standards, skill-adherence, architecture, simplify, and Spec outcomes
|
|
105
|
+
- complete primary/challenger Lens Results and parent adjudications in `review_epoch`
|
|
100
106
|
- every verified stable finding and no unverified advisory candidate
|
|
101
107
|
- one validated `return_route` on each accepted finding
|
|
102
108
|
- evidence-cardinality results for all applicable skill guidance and notes
|
package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md
CHANGED
|
@@ -52,7 +52,7 @@ governing-source normalization requires a non-empty source set.
|
|
|
52
52
|
|
|
53
53
|
The parsed JSON object is report authority. Detached objects, sidecars, and
|
|
54
54
|
caller-supplied derived identities are never trusted. It contains exactly these
|
|
55
|
-
fields:
|
|
55
|
+
fields, plus `review_epoch` for new primary/challenger runs:
|
|
56
56
|
|
|
57
57
|
- `review_lineage_id`
|
|
58
58
|
- `review_run_id`
|
|
@@ -76,7 +76,8 @@ as null or not applicable.
|
|
|
76
76
|
`lens_outcomes` has exactly `standards`, `skill_adherence`, `architecture`,
|
|
77
77
|
`simplify`, and `spec`; each value is `clean` or `findings`. Every finding has
|
|
78
78
|
exactly the fields `id`, `lens`, `severity`, `location`, `impact`, `evidence`,
|
|
79
|
-
`action`, and `return_route`. Finding IDs are unique
|
|
79
|
+
`action`, and `return_route`. Finding IDs are unique and match the lowercase ASCII
|
|
80
|
+
pattern `^[a-z0-9][a-z0-9._-]*$` (for example, `f001`). Severity is `critical`,
|
|
80
81
|
`high`, `medium`, or `low`, and each lens outcome agrees with whether that lens
|
|
81
82
|
has a finding. Each finding's `return_route` is exactly
|
|
82
83
|
`human_steering_required`, `debugging`, `implementation`, `debt_follow_up`, or
|
|
@@ -165,7 +166,40 @@ Recovery uses only unique or identical-reuse valid passes. Any same-run conflict
|
|
|
165
166
|
blocks recovery from that run rather than choosing one candidate. Delivery
|
|
166
167
|
projects the highest uniquely authoritative recovered ordinal.
|
|
167
168
|
|
|
168
|
-
The review report is
|
|
169
|
-
|
|
170
|
-
focused validation, and clean status.
|
|
171
|
-
evidence
|
|
169
|
+
The review report is immutable evidence for its frozen snapshot. After an
|
|
170
|
+
accepted repair, the delivery handoff links the relevant retained report,
|
|
171
|
+
final changes, focused validation, affected Verification and clean status.
|
|
172
|
+
A legacy report with ordinal three remains unchanged historical evidence;
|
|
173
|
+
its number does not prescribe a current third pass or a special final-authority
|
|
174
|
+
transition.
|
|
175
|
+
|
|
176
|
+
## Current epoch and legacy readback
|
|
177
|
+
|
|
178
|
+
New reports include a `review_epoch` derived from the
|
|
179
|
+
[Review Packet](review-packet.md). Call `validateRetainedPass` with
|
|
180
|
+
`reviewProtocol: "primary-challenger-v1"` for current run retention. All
|
|
181
|
+
completed primary outcomes, mandatory independent challenger results,
|
|
182
|
+
candidate accounting, and accepted-finding provenance must validate before the
|
|
183
|
+
pass can count. The helper checks the mechanical evidence; the parent still
|
|
184
|
+
verifies each claim against the target.
|
|
185
|
+
|
|
186
|
+
When recovering historical reports, omit the current-protocol expectation only
|
|
187
|
+
when the parent has verified that the retained report commit predates the
|
|
188
|
+
primary/challenger protocol. Supply that exact commit SHA through
|
|
189
|
+
`approvedLegacyReportCommitShas`. The validator rejects every epoch-less report
|
|
190
|
+
whose `reportCommitSha` is absent from that immutable allowlist. All other
|
|
191
|
+
reports require `reviewProtocol: "primary-challenger-v1"` and a complete
|
|
192
|
+
`review_epoch`.
|
|
193
|
+
|
|
194
|
+
Preserve a legacy report's exact retained bytes, report identity, lineage and
|
|
195
|
+
ordinals, including ordinal three. Legacy recovery supplies no permission for
|
|
196
|
+
another default pass. New default epochs admit ordinals one and two. For an
|
|
197
|
+
additional human-directed pass, retain `review_epoch.human_direction` and
|
|
198
|
+
validate the exact instruction pointer and authorized ordinal against
|
|
199
|
+
parent-verified `humanReviewDirection`.
|
|
200
|
+
|
|
201
|
+
Supply `precedingRepairEvidence: { ordinal, evidence }` only after the parent
|
|
202
|
+
verifies the repair that opened the pass. Its ordinal must immediately precede
|
|
203
|
+
the review ordinal. Supply `precedingRepairEvidence: null` and record
|
|
204
|
+
`preceding_repair_ordinal: null` when human direction opens a pass without an
|
|
205
|
+
intervening repair.
|
package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/review-packet.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Review Packet and Lens Results
|
|
2
|
+
|
|
3
|
+
Preparation freezes one disposable Review Packet for one epoch. Its facts contain
|
|
4
|
+
accepted bounds, normalized target and snapshot, governing source identities,
|
|
5
|
+
delivery lineage/run, and source-attributed Spec, plan, skill guidance,
|
|
6
|
+
Verification evidence and relevant dependency pointers. Each pointer gives exact
|
|
7
|
+
scope, source identity and freshness rule. Bounded source excerpts support lookup;
|
|
8
|
+
source authority stays at the pointer. Primary conclusions and persuasion prose
|
|
9
|
+
have no place in the shared facts.
|
|
10
|
+
|
|
11
|
+
Prepare the helper input as JSON with exactly `packet_identity`, `review_run_id`,
|
|
12
|
+
`accepted_bounds_hash`, `snapshot_hash`, `source_set_hash`, `facts` and
|
|
13
|
+
`facts_sha256`. Derive `packet_identity` using `reviewPacketIdentity` in the
|
|
14
|
+
existing review helper; `facts_sha256` hashes the UTF-8 facts bytes. Freeze the
|
|
15
|
+
packet bytes and retain their digest in task evidence. Parent verifies that facts
|
|
16
|
+
and pointers correspond to the normalized target and governing sources before
|
|
17
|
+
both roles receive those same bytes. The digest checks transport consistency;
|
|
18
|
+
it does not establish authority for unsourced prose.
|
|
19
|
+
|
|
20
|
+
Invoke the existing autoreview helper with `--review-packet <path>` and a unique
|
|
21
|
+
`--reviewer-identity`. The default prepared role is primary. A separate invocation
|
|
22
|
+
uses `--review-role challenger --risk-area <bounded assignment>`. The primary
|
|
23
|
+
receives all five obligations; challengers receive only their assignments and the
|
|
24
|
+
same facts. Capacity one uses sequential calls with independent fresh contexts.
|
|
25
|
+
Calls retain native handles and evidence through observation timeout; inspect the
|
|
26
|
+
same live process before retrying an actual failed call.
|
|
27
|
+
|
|
28
|
+
Each Lens Result has exactly:
|
|
29
|
+
|
|
30
|
+
- `reviewer_identity`, `role` (`primary` or `challenger`), `coverage` and `packet_identity`;
|
|
31
|
+
- `outcome`: `clean`, `findings`, or `incomplete`;
|
|
32
|
+
- `candidates`, each with only `location`, `evidence_pointer`, `impact`,
|
|
33
|
+
`proposed_severity`, `proposed_return_route` and `uncertainty`;
|
|
34
|
+
- `unavailable_coverage`, `cause`, `follow_up`.
|
|
35
|
+
|
|
36
|
+
Complete clean coverage has zero candidates; complete findings coverage has at
|
|
37
|
+
least one. Both use an empty unavailable list and null cause/follow-up.
|
|
38
|
+
Incomplete results name missing coverage, cause and required follow-up and may
|
|
39
|
+
retain already-found candidates. Preserve completed matching results during a
|
|
40
|
+
partial attempt, identify what remains, and complete all newly applicable roles
|
|
41
|
+
before assembling a report. Semantic changes invalidate the epoch rather than
|
|
42
|
+
turning partial coverage into a clean result.
|
|
43
|
+
|
|
44
|
+
The report's `review_epoch` has exactly `protocol: "primary-challenger-v1"`,
|
|
45
|
+
`packet_identity`, `results` and `adjudications`. Results include each of the five
|
|
46
|
+
primary obligations once, from one primary identity, plus every assigned
|
|
47
|
+
independent challenger. A candidate reference is the JSON-serialized triple
|
|
48
|
+
`[reviewer_identity, coverage, candidate_index]` (zero-based). Parent groups
|
|
49
|
+
duplicates and investigates every distinct claim. Each adjudication contains
|
|
50
|
+
`candidate_refs`, `finding_id` (accepted stable ID or null for rejection), and
|
|
51
|
+
`evidence` explaining verification/disposition. Account for each candidate exactly
|
|
52
|
+
once; accepted finding IDs must match retained findings. These references retain
|
|
53
|
+
primary/challenger provenance even when duplicates become one finding.
|
|
54
|
+
|
|
55
|
+
Use `validateRetainedPass` with `reviewProtocol: "primary-challenger-v1"` and
|
|
56
|
+
parent-frozen `assignedCoverage` entries (`reviewer_identity`, `role`, `coverage`)
|
|
57
|
+
for every assignment before retention
|
|
58
|
+
can consume an ordinal. Completeness includes actual assigned coverage and parent
|
|
59
|
+
verification, beyond mechanical schema checks. Required role failure, unavailable
|
|
60
|
+
coverage or stale target/bounds/source evidence consumes no completed pass.
|
|
61
|
+
Retention-only failure reuses the same complete fresh immutable report. An
|
|
62
|
+
accepted after-pass repair follows the focused/risk policy in the state graph;
|
|
63
|
+
changing a reviewed artifact after completion does not automatically open another
|
|
64
|
+
full review.
|
|
65
|
+
|
|
66
|
+
For an explicitly human-directed additional delivery pass, retain optional
|
|
67
|
+
`review_epoch.human_direction` with exactly `evidence` (the verified human
|
|
68
|
+
instruction pointer) and `authorized_ordinal`. Pass the same parent-verified
|
|
69
|
+
object as `humanReviewDirection` to entry and retention helpers. It authorizes
|
|
70
|
+
only that next ordinal; other ordinals still hit the default ceiling. Parent
|
|
71
|
+
verifies the human instruction itself; candidate or reviewer assertions cannot
|
|
72
|
+
supply this authority. Normal epochs omit this field.
|
package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/runtime-handoff.md
CHANGED
|
@@ -122,6 +122,9 @@ The following already-authoritative outcomes write no new runtime record:
|
|
|
122
122
|
|
|
123
123
|
- `review_budget_exhausted`, which preserves the caller's valid delivery
|
|
124
124
|
handoff and retained-count authority unchanged;
|
|
125
|
+
- pre-run `focused_validation` from the preparation helper, which returns an
|
|
126
|
+
ordinary accepted repair to its existing delivery handoff without opening a
|
|
127
|
+
review run or changing retained-count authority;
|
|
125
128
|
- `review_not_due`, whose caller-provided delivery handoff already proves a
|
|
126
129
|
delivery-owned state;
|
|
127
130
|
- pre-run `review_failed` from an unsupported target, invalid bounds, or
|