ultra-builder-pro-cli 0.26.1 → 3.0.2

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 (75) hide show
  1. package/.ultra-template/contexts/TEMPLATE.md +64 -29
  2. package/.ultra-template/north-star.md +36 -30
  3. package/.ultra-template/project-brief.md +28 -0
  4. package/.ultra-template/specs/product.md +4 -0
  5. package/.ultra-template/specs/research-distillate.md +8 -0
  6. package/.ultra-template/tasks.json +1 -0
  7. package/.ultra-template/test-report.json +18 -1
  8. package/CHANGELOG.md +227 -1
  9. package/README.md +161 -59
  10. package/adapters/_shared/host-profile.cjs +68 -12
  11. package/adapters/_shared/plugin-core.cjs +4 -5
  12. package/adapters/_shared/runtime-assets.cjs +11 -2
  13. package/adapters/zcode.js +375 -0
  14. package/bin/delegate-worker.cjs +20 -0
  15. package/bin/delegate.cjs +94 -25
  16. package/bin/install.js +11 -6
  17. package/docs/ARCHITECTURE.md +109 -25
  18. package/docs/ARTIFACT-AUTHORITY.md +204 -30
  19. package/docs/DECISIONS.md +141 -10
  20. package/docs/PHILOSOPHY.md +61 -8
  21. package/docs/PLUGIN-ISOLATION-CONTRACT.md +6 -0
  22. package/docs/RUNTIME-COMPAT-MATRIX.md +106 -13
  23. package/docs/SKILL-AUTHORING.md +14 -9
  24. package/docs/WORKFLOW-LIFECYCLE.md +211 -53
  25. package/docs/evals/adversarial-review-2026-08-14.md +84 -0
  26. package/docs/evals/zcode-automation-2026-08-14.md +103 -0
  27. package/hooks/README.md +31 -3
  28. package/hooks/_common.py +1699 -33
  29. package/hooks/adapters/zcode.py +227 -0
  30. package/hooks/compact_context.py +176 -17
  31. package/hooks/mid_workflow_recall.py +27 -5
  32. package/hooks/post_edit_guard.py +133 -23
  33. package/hooks/session_context.py +722 -11
  34. package/package.json +6 -3
  35. package/skills/ultra-change/SKILL.md +84 -64
  36. package/skills/ultra-change/references/change-contract.md +130 -32
  37. package/skills/ultra-change/references/execution-grant.md +109 -0
  38. package/skills/ultra-change/references/primary-transfer.md +273 -0
  39. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +1928 -0
  40. package/skills/ultra-delegate/SKILL.md +38 -5
  41. package/skills/ultra-delegate/references/delegation-contract.md +21 -1
  42. package/skills/ultra-deliver/SKILL.md +123 -44
  43. package/skills/ultra-deliver/references/baseline-reconciliation.md +5 -3
  44. package/skills/ultra-dev/SKILL.md +173 -43
  45. package/skills/ultra-grilling/SKILL.md +19 -16
  46. package/skills/ultra-grilling/references/reframing.md +7 -3
  47. package/skills/ultra-init/SKILL.md +99 -87
  48. package/skills/ultra-init/references/brownfield-adoption.md +23 -40
  49. package/skills/ultra-init/scripts/init_project.cjs +968 -21
  50. package/skills/ultra-plan/SKILL.md +83 -46
  51. package/skills/ultra-plan/references/task-evidence-v2.md +300 -0
  52. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +859 -0
  53. package/skills/ultra-research/SKILL.md +119 -68
  54. package/skills/ultra-research/references/{03-competitive-landscape.md → 03-alternatives.md} +6 -6
  55. package/skills/ultra-research/references/04-product-strategy.md +11 -2
  56. package/skills/ultra-research/references/21-features-scope.md +8 -0
  57. package/skills/ultra-research/references/22-success-metrics.md +9 -4
  58. package/skills/ultra-research/references/99-synthesis.md +25 -1
  59. package/skills/ultra-research/references/north-star-v2.md +168 -0
  60. package/skills/ultra-research/references/wayfinding.md +50 -0
  61. package/skills/ultra-research/scripts/validate_north_star.cjs +1174 -0
  62. package/skills/ultra-review/SKILL.md +201 -24
  63. package/skills/ultra-review/references/adversarial-evaluation.md +31 -0
  64. package/skills/ultra-review/references/spec.md +5 -0
  65. package/skills/ultra-review/references/unified-schema.md +146 -11
  66. package/skills/ultra-review/references/worker-packet.md +151 -8
  67. package/skills/ultra-review/scripts/review_wait.py +2653 -63
  68. package/skills/ultra-status/SKILL.md +146 -32
  69. package/skills/ultra-tdd/SKILL.md +14 -4
  70. package/skills/ultra-tdd/references/test-execution.md +6 -1
  71. package/skills/ultra-test/SKILL.md +157 -15
  72. package/skills/ultra-test/scripts/validate_review_transport.cjs +549 -0
  73. package/skills/ultra-test/scripts/worktree_digest.cjs +551 -29
  74. package/skills/ultra-think/SKILL.md +5 -10
  75. package/skills/ultra-think/references/interaction-boundary.md +2 -1
@@ -1,38 +1,83 @@
1
1
  ---
2
2
  name: ultra-review
3
- description: Review one task diff or aggregate Change through six independent lenses, synthesize file-backed findings, and perform evidence-justified refactoring. Use when another skill needs task-level or delivery-level review without loading worker investigation into the main context.
3
+ description: Review one task diff or aggregate Change through owner-selected independent lenses, synthesize file-backed findings, and perform evidence-justified refactoring. Use when another skill needs task-level or delivery-level review without loading worker investigation into the main context.
4
4
  ---
5
5
 
6
- # Review through six lenses without polluting the main context
6
+ # Review through selected lenses without polluting the main context
7
7
 
8
8
  The parent owns scope and synthesis. Lens workers are read-only sensors. Refactoring
9
9
  happens here, after several slices make a useful structure visible, not inside TDD.
10
10
 
11
11
  ## Before you start
12
12
 
13
- 1. Read `.ultra/tasks.json`, the scoped task's `context_file` and `## Resume Note`.
13
+ 1. Resolve the review scope first. For task or active-Change review, read
14
+ `../ultra-change/references/change-contract.md` and apply its **Active Change
15
+ authority resolution** before reading any active `intent.md`, resolving the current
16
+ `change_id` or task, reading context or acceptance, or creating a packet. A stable
17
+ zero result stops with no current review scope; any typed diagnostic, including
18
+ non-unique authority, stops with its repair before any `.ultra/reviews` packet write.
19
+ After one valid authority, read its intent and `.ultra/tasks.json`, select only
20
+ matching tasks, then read the scoped task's `context_file` and `## Resume Note`.
21
+ Historical review must name its archived Change explicitly and never infer scope
22
+ from unfinished status.
14
23
  2. Read `CONTEXT.md`, relevant `.ultra/decisions/`, acceptance, evidence and exact diff.
24
+ Task-review admission comes from the ledger `in_progress` row, task context,
25
+ immutable packet, and actual pre-review evidence such as retained command output,
26
+ inspected source, owner records, and external receipts. The first task review must
27
+ not require the final `ultra-task-evidence-v2` record that it helps produce. For an
28
+ aggregate Change review, require every completed task's current v2 record. Treat any
29
+ legacy context Status, Complexity, or v1 evidence as a migration diagnostic rather
30
+ than current completion truth. The ledger remains the sole task-status authority.
31
+ Resolve the scope's `FP-*`, `NS-*`, and `HC-*` IDs against the accepted North Star
32
+ revision; pass IDs and causal evidence, never a copied North Star prose mirror.
15
33
  3. Create `.ultra/reviews/<session>/` and one immutable packet naming HEAD, scope,
16
- output path, acceptance and public seams. Follow `references/worker-packet.md`,
17
- then compute the SHA-256 of the exact packet bytes and do not edit it.
34
+ output path, acceptance and public seams. Follow `references/worker-packet.md` and
35
+ record the exact ordered v2 `subject_observations` for the validated Change,
36
+ acceptance sources, and canonical validator decision/snapshot sources. Then compute
37
+ the SHA-256 of the exact packet bytes and do not edit it.
38
+ 4. Before launching a lens, run `scripts/review_wait.py <session> packet
39
+ --packet-digest <digest>`. A typed subject or byte mismatch requires a corrected new
40
+ session; never repair the frozen packet in place. Success atomically writes the
41
+ derived packet-bound `ADMISSION.json`; do not launch from copied stdout alone. This
42
+ publication is create-once: the exact existing bytes are an idempotent success, while
43
+ different existing bytes are an `admission_conflict` requiring a fresh session.
18
44
 
19
45
  ## Definition of done
20
46
 
21
47
  - The complete six-worker roster is dispositioned; every selected lens artifact and one
22
48
  summary exist, while skipped or failed lenses are explicit.
23
- - Each selected lens reports at most 12 findings, each evidence-backed. Scores never decide
24
- whether an observable defect is included.
49
+ - Each selected lens preserves every evidence-backed finding it can establish inside
50
+ the authorized physical resource budget. A finding or file count never decides what
51
+ is included, whether quality is sufficient, or whether the review has converged.
25
52
  - Findings preserve independent `spec_fidelity` and `engineering_standards` axes.
53
+ - Every v4 finding carries `north_star_trace.first_principles`, `.serves`, and `.touches`
54
+ arrays preserving the applicable `FP-*`/`NS-*`/`HC-*` trace and identifies a stale or
55
+ contradictory trace without mechanically deciding semantic alignment.
56
+ - `SUMMARY.json` records `execution_mode: isolated | sequential-shared-context`.
57
+ - A task review's validated final summary precedes publication of its one canonical v2
58
+ evidence record; review admission never invents a second evidence or status authority.
26
59
  - Refactors are justified by observed duplication or coupling and all affected checks rerun.
27
60
 
28
61
  ## Run the lenses
29
62
 
30
63
  Use the host's native bounded subagents, in the background where available; otherwise
31
- run them sequentially. **All six lenses are selected by default.** Skipping one requires
32
- a stated reason recorded in `SUMMARY.json` — "its evidence cannot change the verdict"
33
- is a judgement made before seeing the evidence, and left as a default it becomes a way
34
- to run less work rather than a considered choice. Give each the packet path and digest,
35
- `references/unified-schema.md`, and exactly one lens:
64
+ run them sequentially. The owner chooses the review topology per stage — one reviewer
65
+ or several, which providers, which write scopes; the default is one reviewer, the
66
+ current Agent. Lens selection follows the review kind, never a fixed count:
67
+
68
+ - An **initial task review** always selects `review-spec` plus only the lenses
69
+ justified by the current risk and the touched seams; a major or high-risk task may
70
+ select the full six-lens roster only with recorded owner approval.
71
+ - A **delta review** reruns only the lenses the exact blocking repair set can affect;
72
+ it never re-audits the whole task and runs only inside the active review budget.
73
+ - An **aggregate Change review** may default to all six only when the cross-task
74
+ wiring justifies it; that is a selection reason, never a mandatory count or a
75
+ quality proxy, and it never writes non-blocking refactor findings back into a
76
+ completed task.
77
+
78
+ Skipping a lens requires a stated reason recorded in `SUMMARY.json`; the rationale is
79
+ evidence for the selection actually made, never a way to run less work. Give each
80
+ worker the packet path and digest, `references/unified-schema.md`, and exactly one lens:
36
81
 
37
82
  - `references/code.md`
38
83
  - `references/design.md`
@@ -49,33 +94,162 @@ intermediate worker output or treat background notifications as completion. The
49
94
  information path is wait script to JSON artifact. These guards prevent partial results
50
95
  from becoming a semantic verdict.
51
96
 
97
+ For v4, the waiter verifies the exact packet bytes, binds every requested stem to the
98
+ packet worker and scope, resolves each finding trace as a packet subset, reloads all
99
+ completed specialist artifacts in packet order, and rejects a summary that omits,
100
+ rewrites, reorders, or injects any finding. It also verifies axis evidence refs and
101
+ derives axis and overall verdicts from that immutable evidence. These are provenance and
102
+ transport checks, never a replacement for a specialist's semantic judgment.
103
+ Validator success therefore means only that the immutable transport and exact schemas
104
+ agree. It never supplies a specialist finding, accepts an `owner-judgment`, or decides
105
+ semantic pass.
106
+ The `packet` command is the one admission boundary that checks current Git HEAD and
107
+ reads current context, the exact active/archive/abandoned Change path already validated
108
+ from `north_star_trace.path`, acceptance-source, and North Star bytes.
109
+ It sends the already captured North Star bytes through the canonical Research
110
+ validator's native stdin seam and requires that report to receipt the identical input;
111
+ it does not implement a second Markdown grammar or interpret Change/acceptance prose.
112
+ Admission atomically records those observations in `ADMISSION.json`. Strict v4 `agents`
113
+ and `summary` require that packet-bound receipt. Every current specialist artifact and
114
+ `SUMMARY.json` records the SHA-256 of the receipt's exact bytes as `admission_digest`
115
+ plus its exact `subject_digest`; the waiters pin both values across every poll and final reload.
116
+ They then reread only the exact packet and its frozen artifacts, so later task
117
+ completion, Change archival, or North Star revision cannot erase historical review
118
+ evidence. Packet, receipt, artifact, and canonical
119
+ summary inputs are bounded stable regular-file snapshots; a fresh root rewalk verifies
120
+ every recorded path-component and file identity after reading. A special file,
121
+ replacement, oversize input, skipped admission, or invalid UTF-8/JSON returns typed
122
+ repairable `incomplete` output rather than becoming evidence. Canonical validator stdout
123
+ and stderr share one incremental byte ceiling; exceeding it terminates and reaps that
124
+ attempt immediately.
125
+ `ADMISSION.json` is derived and non-authoritative, but it is retained mechanical
126
+ evidence until the session has completed its Test and Deliver consumption. If it is
127
+ lost after any specialist artifact or `SUMMARY.json` exists, the strict session is
128
+ `INCOMPLETE`; start a fresh review session instead of reconstructing or replacing the
129
+ receipt. Before any output exists, packet mode may recreate a missing v2 receipt only
130
+ when every packet-recorded byte length and SHA-256 still matches. A retained strict v1
131
+ packet is read-compatible only with its exact existing receipt; packet mode never creates
132
+ or recreates a v1 receipt. A newly published receipt is accepted only after a fresh
133
+ canonical root rewalk confirms the session and exact receipt identity. When publication itself succeeded but
134
+ one or more durability operations did not, packet mode returns `status: complete` with
135
+ a typed `durability_warning`; multiple unresolved warnings are preserved together, and
136
+ a temporary cleanup failure resolved by the final retry is not reported.
137
+ It resolves the repository only from the canonical session path; packet paths and
138
+ artifact file scope cannot be absolute, non-normalized, symlink-escaping, or broader
139
+ than `diff_files`. Worker Packet v1 summaries use the packet-derived context digest and
140
+ an explicit `worktree_digest: null` because v1 binds no exact worktree observation.
141
+
142
+ Those commands require admission-contract v2 artifacts for every new session. Use `--legacy-v4`
143
+ immediately after the packet digest only to read an immutable v4 session created before
144
+ admission receipts and therefore lacking the current packet `admission_contract`
145
+ marker. Use `--legacy-v3` only for an immutable historical v3 session. Either legacy
146
+ flag rejects every packet marked strict v1 or v2; only truly historical unmarked
147
+ packets, or packet-absent v3 history, enter compatibility mode.
148
+ Neither flag permits new legacy artifacts, automatically falls back, or mutates history.
149
+
150
+ Record `isolated` only when selected lenses had separate native contexts; otherwise
151
+ record `sequential-shared-context`. A zero-finding artifact must cite real coverage or
152
+ an explicit limitation; without either, record the review as `INCOMPLETE`.
153
+ When an axis has no completed artifact, keep its exact evidence union as `[]` and mark it
154
+ `INCOMPLETE`; never invent a placeholder artifact merely to satisfy the summary shape.
155
+
52
156
  ## Synthesize, repair and recheck
53
157
 
54
158
  Preserve findings unchanged in `SUMMARY.json`; group duplicates by root cause only in
55
- the human summary. Fix accepted P0/P1 issues and evidence-backed refactors, then rerun
56
- the affected lenses against the delta.
159
+ the human summary.
160
+
161
+ Verdicts are terminal for the current subject. `APPROVE` ends the current task review
162
+ even when P2 or P3 findings are retained — they stay in the report and go to the
163
+ owner-selected backlog, and no fresh review of the same subject may be opened after a
164
+ current `APPROVE`. `REQUEST_CHANGES` routes only the exact current P0/P1 finding ids
165
+ (or a P2 the owner explicitly promoted); repair them as one in-scope repair set, then
166
+ run one affected-lens delta review of that exact repair set inside the active review
167
+ budget. When another `REQUEST_CHANGES` would exceed the active budget — or a delta
168
+ that returns `INCOMPLETE` on evidence the budget cannot cover — return to the owner
169
+ checkpoint: report the exact blocking set and stop instead of starting another
170
+ automatic repair. When evidence proves a P2 actually blocks
171
+ acceptance, reclassify it as P1 in the current review rather than routing a P2 label
172
+ as a blocker. A finding outside the packet's `diff_files` is a scope-change proposal:
173
+ record it, do not edit that path, and return it to the owner or Plan as a new subject.
174
+
175
+ Resource budgets — time, tools, cost, review counts — stop execution only. Budget
176
+ exhaustion returns `owner checkpoint` / `budget_exhausted` and keeps the task
177
+ `in_progress` without disposing findings.
178
+ It never yields `APPROVE`, `REQUEST_CHANGES`, `INCOMPLETE`, pass, fail, accept, or
179
+ abandon, and a round, count, or budget number never measures semantic quality.
180
+
181
+ ### Work-package convergence
57
182
 
58
- Stop when P0 + P1 does not decrease between rounds. Write a stuck report separating an
59
- over-tight constraint from an insufficient fix and give the owner three concrete paths.
60
- If one file fails three consecutive repairs, treat it as an architecture concern. If
61
- three or more files do so, write `UNRESOLVED.md` with `ARCHITECTURAL_CONCERN` and stop.
183
+ Review budget precedence is one rule: an exact current owner grant for this work
184
+ package overrides the versioned product default; the released default is one initial
185
+ review plus at most two P0/P1 delta reviews per coherent work package. Both are
186
+ finite, owner-visible budgets, never a semantic quality measure.
187
+
188
+ Only actual P0/P1 findings — or a P2 the owner explicitly promoted as a direct North
189
+ Star blocker — trigger a delta review; P2/P3 findings are reported and never
190
+ auto-repair or auto-extend any budget. Zero findings is never the completion
191
+ condition — completion is the owner accepting the real result. A finding outside the
192
+ current subject is a scope-change proposal for the owner or a future Change, never a
193
+ reason to enlarge this package.
194
+
195
+ When the same root cause survives three failed repair attempts, stop point-patching
196
+ and report an architecture boundary problem. A remaining blocker at budget
197
+ exhaustion returns the choice to the owner with the exact blocking set; never open
198
+ an automatic round beyond the active grant, and never extend a budget yourself. The
199
+ legal terminal outcomes are: owner risk acceptance, owner scope reduction or reset,
200
+ a new explicitly authorized work package, an external blocker, a budget stop, or
201
+ abandonment.
202
+
203
+ Stop repairing and return to the owner when three repairs expose three distinct
204
+ root causes, the same path keeps gaining validators, counters, mirrors, or
205
+ replays, a formal terminal verdict conflicts with Resume/Hook/Status suggestions,
206
+ the owner-visible outcome has materially drifted, the reviewer contract and the
207
+ reviewed subject are the same changing thing, or you cannot name the concrete
208
+ harm the next round would remove.
209
+
210
+ The parent model judges `stalled` from the actual repair/evidence history, not
211
+ from repair rounds, finding counts, or the number of files involved. Zero findings is
212
+ never a completion condition: a zero-finding artifact must cite real coverage or an
213
+ explicit limitation, and convergence is judged by evidence, never by an empty findings
214
+ array. When repair is no longer justified, preserve an unresolved report that
215
+ separates a possibly over-tight constraint, an insufficient fix, unavailable evidence,
216
+ and an observed shared structural root. Return the reachable repair, retry,
217
+ owner-disposition, or abandon path.
62
218
 
63
219
  Report both axes, exact scope, checks, residual findings and any refactor performed.
64
220
 
221
+ ## Self-hosting review boundary
222
+
223
+ Touching any of these paths makes the reviewed subject self-hosting:
224
+
225
+ - `skills/ultra-review/**`, including `scripts/review_wait.py`;
226
+ - review routing inside `skills/ultra-dev/**`, Review consumption inside
227
+ `skills/ultra-test/**`, or Review/Test bounce inside `skills/ultra-deliver/**`;
228
+ - the Review packet, schema, and transport tests;
229
+ - Hook route or Resume authority under `hooks/`.
230
+
231
+ A self-hosting review must pin its semantic baseline — the owner-accepted contract
232
+ digest — and use a stable external reviewer boundary instead of judging its own
233
+ changes with the changing reviewer. During the v0.27 H0 closure that boundary is one
234
+ read-only external manual review by the owner-named reviewer; never use the local
235
+ changing `ultra-review` implementation to approve itself, and treat a released tag
236
+ only as a historical behavior reference, never as the current verdict authority.
237
+
65
238
  ## Recheck across model families
66
239
 
67
240
  Six lenses are six angles from one model family, so they share blind spots: what all
68
241
  six miss, a seventh angle from the same family misses too. Independence comes from a
69
242
  different model, not from another lens.
70
243
 
71
- For a `major` Change, or one touching authorization, payments, personal data or
72
- migrations, recommend a cross-family recheck and wait for the owner's decision. Do not
244
+ When concrete effects make authorization, payments, personal data, migrations, or
245
+ another accepted risk material, recommend a cross-family recheck and wait for the
246
+ owner's decision. A profile label alone is not a semantic risk verdict. Do not
73
247
  invoke `ultra-delegate` unless the owner has explicitly asked for another model or host
74
- for this review. Once that authority exists, follow `../ultra-delegate/SKILL.md`. For a
75
- `quick` profile, skip the recommendation and say so in the report.
248
+ for this review. Once that authority exists, follow `../ultra-delegate/SKILL.md`.
76
249
 
77
- - Send the aggregated `SUMMARY.json` and the diff, **not** the raw lens artifacts. The
78
- worker should form its own reading rather than grade this one.
250
+ - For a **finding audit**, send `SUMMARY.json` plus the diff and ask which findings lack
251
+ support. For a **blind adversarial probe**, send the Worker Packet, North Star Trace,
252
+ and diff without `SUMMARY.json`, and ask what the local review missed.
79
253
  - Ask two things: which findings the evidence does not actually support, and what this
80
254
  diff gets wrong that no finding mentions. The second question is why the recheck is
81
255
  worth its cost.
@@ -91,8 +265,11 @@ Workers never edit source, task state or another lens artifact.
91
265
 
92
266
  ## References
93
267
 
268
+ - `../ultra-change/references/change-contract.md` — canonical Active Change authority resolution.
94
269
  - `references/unified-schema.md` — JSON contract shared by all lenses.
95
270
  - `references/worker-packet.md` — exact immutable input packet and digest procedure.
96
271
  - `references/review-modes.md` — choose task, Change, full, or delta scope.
272
+ - `references/adversarial-evaluation.md` — use before adding or removing a review lens.
273
+ - `../ultra-plan/references/task-evidence-v2.md` — current task evidence and task-review provenance.
97
274
  - `../ultra-delegate/SKILL.md` — read after the owner authorizes a cross-family recheck.
98
275
  - `../ultra-think/references/autonomy-boundary.md` — read before a fix reduces intent.
@@ -0,0 +1,31 @@
1
+ # Adversarial review evaluation
2
+
3
+ Use this protocol before changing the permanent lens roster. A plausible blind spot is
4
+ a hypothesis; admit a new lens only when a blind evaluation shows unique useful coverage.
5
+
6
+ ## Prepare a blind fixture
7
+
8
+ Create or select a small repository snapshot containing known defects across acceptance,
9
+ premise, executable behavior, tests, recovery, design, and maintained documentation.
10
+ Keep the seed manifest outside every Worker Packet. Record the snapshot revision,
11
+ accepted intent, North Star Trace, public seams, and commands available to workers.
12
+
13
+ ## Compare equal runs
14
+
15
+ Run the current six-lens roster first. Then run the candidate lens with the same packet,
16
+ tool authority, model family, and bounded effort. Use isolated contexts where the host
17
+ supports them and record the actual execution mode. Do not reveal seed ids, expected
18
+ findings, earlier outputs, or the admission decision to either run.
19
+
20
+ After artifacts are stable, map evidence-backed findings to the hidden seeds. Preserve
21
+ misses, false positives, unavailable evidence, and disagreements; a vote or score does
22
+ not decide truth. Repeat any claimed unique catch against a fresh context so leaked
23
+ context or sampling noise is not mistaken for a durable capability.
24
+
25
+ ## Admission decision
26
+
27
+ Add a permanent lens only when it repeatedly finds a consequential, reproducible defect
28
+ class the current roster misses and its question cannot be folded into an existing lens
29
+ without losing independence. Otherwise strengthen the narrowest existing lens or keep
30
+ the candidate as an occasional blind cross-family probe. Record the fixture revision,
31
+ raw artifact paths, mapping rationale, decision, and cheapest future retest.
@@ -5,6 +5,11 @@ criterion to current executable or source evidence. Check for omitted behavior,
5
5
  unintended scope, stale specification or operational documentation, and incompatible
6
6
  public contracts.
7
7
 
8
+ Read the packet's `North Star Trace`. Verify that its ids and recorded revision resolve,
9
+ then challenge whether the Change's claimed causal contribution has supporting evidence
10
+ and survives the diff. A stale revision is a freshness limitation, not automatic proof
11
+ of semantic misalignment.
12
+
8
13
  Report only a concrete mismatch between accepted intent and delivered behavior. Style,
9
14
  generic maintainability and a preferred architecture do not belong on this axis.
10
15
  Calibrate severity to user-visible or delivery impact. Use `axis: spec_fidelity` and
@@ -7,12 +7,14 @@ return only a one-line acknowledgement to the parent.
7
7
 
8
8
  ```json
9
9
  {
10
- "$schema": "ultra-review-findings-v2",
10
+ "$schema": "ultra-review-findings-v4",
11
11
  "agent": "review-code",
12
12
  "axis": "engineering_standards",
13
13
  "packet_digest": "<sha256-of-exact-worker-packet>",
14
+ "admission_digest": "<sha256-of-exact-admission-receipt>",
15
+ "subject_digest": "<subject-digest-from-admission-receipt>",
14
16
  "session": "<session-id>",
15
- "timestamp": "<ISO-8601>",
17
+ "timestamp": "<RFC-3339-instant>",
16
18
  "scope": {
17
19
  "head": "<full-git-head>",
18
20
  "range": "<diff-range>",
@@ -33,9 +35,15 @@ return only a one-line acknowledgement to the parent.
33
35
  "trigger": "The provider times out after committing the first request.",
34
36
  "impact": "A retry can create a duplicate charge.",
35
37
  "evidence": "retryPayment calls charge() again without an idempotency key.",
36
- "suggestion": "Persist and reuse one idempotency key for the operation."
38
+ "suggestion": "Persist and reuse one idempotency key for the operation.",
39
+ "north_star_trace": {
40
+ "first_principles": ["FP-1"],
41
+ "serves": ["NS-01"],
42
+ "touches": ["HC-2"]
43
+ }
37
44
  }
38
45
  ],
46
+ "coverage_refs": ["src/payments/retry.ts:42"],
39
47
  "positive_observations": [],
40
48
  "limitations": []
41
49
  }
@@ -44,11 +52,25 @@ return only a one-line acknowledgement to the parent.
44
52
  Use `axis: "spec_fidelity"` for the independent acceptance review and
45
53
  `axis: "engineering_standards"` for engineering specialists.
46
54
 
55
+ For packet-bound v4 artifacts, `agent`, `axis`, `session`, `scope.head`,
56
+ `scope.range`, and `packet_digest` exactly match the immutable packet and its canonical
57
+ worker record. `admission_digest` equals SHA-256 over the exact retained
58
+ `ADMISSION.json` bytes and `subject_digest` equals that receipt's field; both are
59
+ required and exact for current strict v4. `scope.diff_only` is `true`. Every
60
+ `scope.files_analyzed` entry and every
61
+ finding `file` is a normalized repository-relative path contained in the packet's
62
+ `diff_files`; a broader investigation requires a new packet rather than an expanded
63
+ artifact. `timestamp` is a valid RFC 3339 instant with `Z` or an explicit numeric UTC
64
+ offset; nonempty prose, impossible dates, and timezone-free local times are invalid.
65
+
47
66
  ## Required finding fields
48
67
 
49
68
  Every finding needs a stable id, axis, severity, category, concise title, repository-
50
69
  relative file, tight line range, triggering condition, observable impact, source
51
- evidence, and smallest complete remediation.
70
+ evidence, smallest complete remediation, and one `north_star_trace` object. Its
71
+ `first_principles`, `serves`, and `touches` arrays contain only the applicable resolving
72
+ IDs from the immutable Worker Packet; an array may be empty when that finding does not
73
+ touch that ID kind. Never copy North Star prose into a finding.
52
74
 
53
75
  Severity is impact-based:
54
76
 
@@ -61,30 +83,44 @@ Severity is impact-based:
61
83
  Do not report a concern without a plausible execution path. Do not encode a style
62
84
  preference as a defect. Preserve the source specialist's severity during coordination.
63
85
 
86
+ Severity routes findings; it never decides convergence:
87
+
88
+ - P0 and P1 are blocking. `REQUEST_CHANGES` routes only the exact current P0/P1
89
+ finding ids, or a P2 the owner explicitly promoted after the current review
90
+ reclassified it as P1 on evidence.
91
+ - P2 and P3 findings are non-blocking. An `APPROVE` verdict is terminal for the
92
+ current task review even when P2 or P3 findings are retained: they stay in the
93
+ report and the owner-selected backlog, and there is no fresh review of the same
94
+ subject after a current `APPROVE`. Repairing a P2 inside the same task requires an
95
+ explicit owner selection, never an implicit promotion.
96
+
64
97
  ## Coordinator summary
65
98
 
66
99
  `SUMMARY.json` contains:
67
100
 
68
101
  ```json
69
102
  {
70
- "$schema": "ultra-review-summary-v2",
103
+ "$schema": "ultra-review-summary-v4",
71
104
  "mode": "change",
105
+ "execution_mode": "isolated",
72
106
  "session": "<session-id>",
73
107
  "change_id": "<change-id>",
74
108
  "task_ids": ["<task-id>"],
75
109
  "head": "<full-git-head>",
76
- "worktree_digest": "<sha256-of-current-worktree>",
110
+ "worktree_digest": null,
77
111
  "context_digest": "<sha256-of-recorded-review-context>",
78
112
  "packet_digest": "<sha256-of-coordinator-worker-packet>",
113
+ "admission_digest": "<sha256-of-exact-admission-receipt>",
114
+ "subject_digest": "<subject-digest-from-admission-receipt>",
79
115
  "status": "complete",
80
- "verdict": "REQUEST_CHANGES",
116
+ "verdict": "APPROVE",
81
117
  "axes": {
82
118
  "spec_fidelity": {
83
119
  "verdict": "PASS",
84
- "evidence_refs": ["spec-fidelity.json"]
120
+ "evidence_refs": ["review-spec.json"]
85
121
  },
86
122
  "engineering_standards": {
87
- "verdict": "FAIL",
123
+ "verdict": "PASS",
88
124
  "evidence_refs": ["review-code.json", "review-tests.json"]
89
125
  }
90
126
  },
@@ -126,18 +162,65 @@ preference as a defect. Preserve the source specialist's severity during coordin
126
162
  }
127
163
  ],
128
164
  "findings": [],
165
+ "coverage_refs": ["review-spec.json", "review-code.json", "review-tests.json"],
129
166
  "positive_observations": [],
130
167
  "limitations": []
131
168
  }
132
169
  ```
133
170
 
134
- `findings` must contain every specialist finding unchanged. Group duplicates only in
171
+ `findings` must contain every specialist v4 finding unchanged, including its
172
+ `north_star_trace`. Group duplicates only in
135
173
  the human-readable summary; never delete or merge machine-readable records.
136
174
 
175
+ For v4, `review_wait.py` treats this as an exact transport invariant. It verifies the
176
+ session's immutable Worker Packet bytes, reloads and revalidates every artifact named in
177
+ `workers.completed`, and requires `findings` to equal their packet-ordered union one
178
+ object at a time. Omitted, edited, reordered, or coordinator-injected objects are
179
+ invalid. Axis evidence refs are the corresponding packet outputs; each axis verdict and
180
+ the overall verdict are derived from that verified union and the completed/failed roster.
181
+ Human grouping never changes these machine records.
182
+
183
+ For current strict v4, `admission_digest` and `subject_digest` are required and exactly
184
+ match the retained receipt just as they do in each specialist artifact. The waiter pins
185
+ the pair from its first receipt read through polling, specialist-union validation, and
186
+ its final reload. A missing or changed receipt makes the session `INCOMPLETE`; recovery
187
+ after any specialist artifact or `SUMMARY.json` exists is a fresh session, not receipt
188
+ reconstruction. Before any output exists, packet mode may recreate a missing v2 receipt
189
+ only when the exact packet-recorded subjects remain unchanged. It never creates or
190
+ recreates a retained strict v1 receipt. The receipt remains derived, non-authoritative evidence, but must be retained
191
+ through Test and Deliver. Its subject digest also binds the canonical validator's exact
192
+ decision and snapshot `source_observations` (`role`, repository-relative `path`,
193
+ lowercase SHA-256, and byte length).
194
+
195
+ An axis `evidence_refs` array is exactly the packet-ordered completed specialist output
196
+ union for that axis. It may be empty only when that union is empty and the derived axis
197
+ verdict is `INCOMPLETE`, such as a spec-only packet or when every selected engineering
198
+ worker failed. An empty array can never support `PASS` or `FAIL`; do not invent a
199
+ placeholder reference.
200
+
201
+ `context_digest` is packet-derived, not coordinator-authored. With one
202
+ `context_files` item it equals that item's `sha256`. With zero or multiple items it is
203
+ SHA-256 over compact UTF-8 JSON for the `{path,sha256}` items sorted by UTF-8 `path`
204
+ bytes, with object keys sorted. `worktree_digest` is present and `null` in Worker Packet
205
+ v1 reviews because that packet schema does not bind an exact worktree digest. A future
206
+ packet schema may add such a fact; an unbound coordinator observation must not claim
207
+ provenance now.
208
+
209
+ `coverage_refs` names inspected source, commands, or stable artifacts supporting the
210
+ coverage claim. Zero findings with neither a coverage reference nor an explicit
211
+ limitation is incomplete, not an approval.
212
+
137
213
  `mode` is `task`, `change`, or `plan`. `worker_selection` contains each member of the
138
214
  six-worker roster exactly once with a scope-specific selected or skipped rationale.
139
215
  Its selected set equals `workers.completed` plus `workers.failed`; its skipped set
140
- equals `workers.skipped`. `review-spec` is always selected and completed.
216
+ equals `workers.skipped`. `review-spec` is always selected. If it fails, the
217
+ `spec_fidelity` evidence union is `[]`, that axis and the overall verdict are
218
+ `INCOMPLETE`, and the historical failure remains a valid summary rather than a fabricated
219
+ completed artifact.
220
+
221
+ `execution_mode` is exactly `isolated` when every selected lens ran in a fresh native
222
+ subagent context, or `sequential-shared-context` when the host reused one context. It
223
+ reports independence; it does not change a finding's truth.
141
224
 
142
225
  The overall verdict is `APPROVE` only when both axes pass, artifacts are complete and
143
226
  current, and no P0 or P1 finding remains. Use `REQUEST_CHANGES` for a failed axis or
@@ -145,5 +228,57 @@ blocking finding, and `INCOMPLETE` when required evidence or workers are missing
145
228
  Each axis verdict is `PASS`, `FAIL`, or `INCOMPLETE`; the overall verdict is `APPROVE`,
146
229
  `REQUEST_CHANGES`, or `INCOMPLETE`.
147
230
 
231
+ The ordinary summary command reads one stable canonical `SUMMARY.json` snapshot and
232
+ returns its SHA-256 as `summary_digest`. The Review-to-Test consumer first captures the
233
+ canonical `.ultra/test-report.json` and its repository-relative `SUMMARY.json` using one
234
+ shared bounded stable raw-byte rule. Every managed path component below the real
235
+ repository root is non-symlink, each final entry is a regular file inside that root, and
236
+ each snapshot is limited to 8 MiB. An 8 MiB + 1 byte observation returns a typed
237
+ oversize diagnostic before JSON parsing or hashing. The exact report bytes own parsing
238
+ and subject comparisons; the exact summary bytes own parsing, SHA-256, comparisons, and
239
+ waiter validation. A direct consumer that already owns that summary snapshot passes
240
+ those exact bytes on stdin and invokes:
241
+
242
+ ```bash
243
+ python3 scripts/review_wait.py <session> summary \
244
+ --packet-digest <packet-sha256> \
245
+ --summary-snapshot-digest <summary-sha256>
246
+ ```
247
+
248
+ The waiter parses and validates only those stdin bytes, checks their supplied digest,
249
+ requires the session's stable packet-bound `ADMISSION.json`, and returns the same digest.
250
+ This seam prevents Review-to-Test from validating, parsing, hashing, and comparing
251
+ different filesystem observations. The receipt proves the strict v4 packet preflight
252
+ ran; it does not cause summary validation to reread mutable subjects.
253
+
254
+ Summary validation consumes the packet's frozen subject claims. It does not reread the
255
+ current context, Change, acceptance source, or North Star, so a task-close update or a
256
+ later accepted revision cannot make an already completed review unreadable.
257
+
258
+ Review admission and Review-to-Test are cooperative-workspace sensors. They detect
259
+ observable path, component, identity, byte, and digest drift and never claim to defeat a
260
+ malicious process that can exchange and restore directory entries between individual
261
+ system calls. Use Host sandboxing or an isolated worktree for adversarial operating-
262
+ system writers; do not add a second semantic authority or platform-specific filesystem
263
+ engine to this portable Skill.
264
+
148
265
  Validate JSON before acknowledgement. Never paste full JSON or worker transcripts into
149
266
  the parent conversation.
267
+
268
+ ## Historical compatibility
269
+
270
+ New sessions always write `ultra-review-findings-v4` and
271
+ `ultra-review-summary-v4` from a packet carrying
272
+ `admission_contract: ultra-review-admission-required-v2` with exact ordered
273
+ `subject_observations`, after packet mode atomically publishes and freshly rewalks a v2
274
+ `ADMISSION.json`.
275
+ Immutable v4 sessions created before that receipt remain readable only by adding
276
+ `--legacy-v4` immediately after `--packet-digest <digest>` and only when the historical
277
+ packet lacks the admission marker.
278
+ Immutable v3 sessions use
279
+ `--legacy-v3` in the same position. Both flags reject packets marked strict v1 or v2;
280
+ only truly historical unmarked packets, or packet-absent v3 sessions, use them. Retained
281
+ strict v1 remains readable only with its exact existing receipt and cannot be admitted
282
+ or re-admitted. These are explicit read compatibility paths, not
283
+ automatic fallback or permission to create or rewrite legacy findings. `--legacy-v4`
284
+ is not a recovery path for a current session whose retained receipt was lost.