ultra-builder-pro-cli 5.0.1 → 6.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.
Files changed (159) hide show
  1. package/CHANGELOG.md +103 -3
  2. package/README.md +67 -478
  3. package/README.zh-CN.md +49 -422
  4. package/adapters/_shared/frontmatter.cjs +1 -18
  5. package/adapters/_shared/plugin-core.cjs +17 -83
  6. package/adapters/_shared/runtime-assets.cjs +6 -120
  7. package/adapters/claude.js +8 -24
  8. package/adapters/codex.js +13 -32
  9. package/bin/install.js +35 -57
  10. package/docs/PLUGIN-ISOLATION-CONTRACT.md +13 -101
  11. package/docs/examples/drive/claude-reviewer.sh +53 -0
  12. package/docs/examples/drive/claude-writer.sh +43 -0
  13. package/engine/FORMATS.md +1051 -0
  14. package/engine/checks.cjs +139 -0
  15. package/engine/cli.cjs +148 -0
  16. package/engine/completion.cjs +48 -0
  17. package/engine/context.cjs +94 -0
  18. package/engine/drive.cjs +220 -0
  19. package/engine/expect-worker.cjs +5 -0
  20. package/engine/expect.cjs +33 -0
  21. package/engine/formats.cjs +189 -0
  22. package/engine/git-state.cjs +112 -0
  23. package/engine/ledger.cjs +205 -0
  24. package/engine/loading.cjs +28 -0
  25. package/engine/merge.cjs +273 -0
  26. package/engine/milestone.cjs +89 -0
  27. package/engine/plan.cjs +232 -0
  28. package/engine/project.cjs +5 -0
  29. package/engine/signals.cjs +3 -0
  30. package/engine/states.cjs +175 -0
  31. package/hooks/session-start.cjs +54 -0
  32. package/package.json +17 -52
  33. package/skills/ultra/SKILL.md +395 -0
  34. package/.ultra-template/changes/abandoned/.gitkeep +0 -0
  35. package/.ultra-template/changes/active/.gitkeep +0 -1
  36. package/.ultra-template/changes/archive/.gitkeep +0 -1
  37. package/.ultra-template/contexts/TEMPLATE.md +0 -135
  38. package/.ultra-template/decisions/.gitkeep +0 -1
  39. package/.ultra-template/evidence/.gitkeep +0 -1
  40. package/.ultra-template/north-star.md +0 -52
  41. package/.ultra-template/project-brief.md +0 -28
  42. package/.ultra-template/research/.gitkeep +0 -1
  43. package/.ultra-template/specs/architecture.md +0 -81
  44. package/.ultra-template/specs/discovery.md +0 -74
  45. package/.ultra-template/specs/product.md +0 -80
  46. package/.ultra-template/specs/research-distillate.md +0 -57
  47. package/.ultra-template/tasks.json +0 -4
  48. package/.ultra-template/test-report.json +0 -44
  49. package/adapters/_shared/host-profile.cjs +0 -5
  50. package/adapters/grok.js +0 -242
  51. package/adapters/kimi.js +0 -232
  52. package/adapters/opencode.js +0 -408
  53. package/adapters/zcode.js +0 -375
  54. package/bin/delegate-worker.cjs +0 -5
  55. package/bin/delegate.cjs +0 -5
  56. package/docs/ARCHITECTURE.md +0 -274
  57. package/docs/ARTIFACT-AUTHORITY.md +0 -305
  58. package/docs/DECISIONS.md +0 -229
  59. package/docs/PHILOSOPHY.md +0 -261
  60. package/docs/RUNTIME-COMPAT-MATRIX.md +0 -316
  61. package/docs/SKILL-AUTHORING.md +0 -113
  62. package/docs/WORKFLOW-LIFECYCLE.md +0 -350
  63. package/docs/evals/adversarial-review-2026-08-14.md +0 -84
  64. package/docs/evals/ultra-5-0-journey-results.md +0 -62
  65. package/docs/evals/ultra-5-0-live-acp-conformance.md +0 -93
  66. package/docs/evals/ultra-5-0-route-journeys.md +0 -145
  67. package/docs/evals/zcode-automation-2026-08-14.md +0 -103
  68. package/hooks/README.md +0 -52
  69. package/hooks/_common.py +0 -1779
  70. package/hooks/adapters/codex.py +0 -295
  71. package/hooks/adapters/grok.py +0 -134
  72. package/hooks/adapters/kimi.py +0 -156
  73. package/hooks/adapters/zcode.py +0 -227
  74. package/hooks/block_dangerous_commands.py +0 -201
  75. package/hooks/compact_context.py +0 -224
  76. package/hooks/mid_workflow_recall.py +0 -47
  77. package/hooks/post_edit_guard.py +0 -215
  78. package/hooks/session_context.py +0 -741
  79. package/skills/ultra-change/SKILL.md +0 -165
  80. package/skills/ultra-change/references/change-contract.md +0 -199
  81. package/skills/ultra-change/references/execution-grant.md +0 -109
  82. package/skills/ultra-change/references/primary-transfer.md +0 -273
  83. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +0 -1928
  84. package/skills/ultra-delegate/SKILL.md +0 -195
  85. package/skills/ultra-delegate/patches/zcode-acp-0.1.0-zcode-0.16.5.patch +0 -184
  86. package/skills/ultra-delegate/references/delegation-contract.md +0 -138
  87. package/skills/ultra-delegate/scripts/acp-conformance.cjs +0 -287
  88. package/skills/ultra-delegate/scripts/acp-driver.cjs +0 -762
  89. package/skills/ultra-delegate/scripts/agent-execution-driver.cjs +0 -320
  90. package/skills/ultra-delegate/scripts/cli-driver.cjs +0 -61
  91. package/skills/ultra-delegate/scripts/delegate-profiles/kimi-read-only.md +0 -15
  92. package/skills/ultra-delegate/scripts/delegate-profiles/kimi-write.md +0 -17
  93. package/skills/ultra-delegate/scripts/delegate-worker.cjs +0 -328
  94. package/skills/ultra-delegate/scripts/delegate.cjs +0 -690
  95. package/skills/ultra-delegate/scripts/delegate_wait.py +0 -86
  96. package/skills/ultra-delegate/scripts/host-profile.cjs +0 -267
  97. package/skills/ultra-deliver/SKILL.md +0 -194
  98. package/skills/ultra-deliver/references/baseline-reconciliation.md +0 -41
  99. package/skills/ultra-dev/SKILL.md +0 -265
  100. package/skills/ultra-dev/references/debugging.md +0 -22
  101. package/skills/ultra-domain-modeling/SKILL.md +0 -79
  102. package/skills/ultra-grilling/SKILL.md +0 -121
  103. package/skills/ultra-grilling/references/reframing.md +0 -76
  104. package/skills/ultra-init/SKILL.md +0 -143
  105. package/skills/ultra-init/references/brownfield-adoption.md +0 -32
  106. package/skills/ultra-init/scripts/init_project.cjs +0 -1031
  107. package/skills/ultra-plan/SKILL.md +0 -160
  108. package/skills/ultra-plan/references/task-evidence-v2.md +0 -300
  109. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +0 -859
  110. package/skills/ultra-research/SKILL.md +0 -167
  111. package/skills/ultra-research/references/00-problem-validation.md +0 -36
  112. package/skills/ultra-research/references/01-opportunity-discovery.md +0 -33
  113. package/skills/ultra-research/references/02-market-assessment.md +0 -31
  114. package/skills/ultra-research/references/03-alternatives.md +0 -31
  115. package/skills/ultra-research/references/04-product-strategy.md +0 -41
  116. package/skills/ultra-research/references/05-assumptions-validation.md +0 -31
  117. package/skills/ultra-research/references/10-user-personas.md +0 -30
  118. package/skills/ultra-research/references/11-user-scenarios.md +0 -28
  119. package/skills/ultra-research/references/20-user-stories.md +0 -31
  120. package/skills/ultra-research/references/21-features-scope.md +0 -38
  121. package/skills/ultra-research/references/22-success-metrics.md +0 -33
  122. package/skills/ultra-research/references/30-architecture-context.md +0 -30
  123. package/skills/ultra-research/references/31-solution-strategy.md +0 -28
  124. package/skills/ultra-research/references/32-building-blocks.md +0 -28
  125. package/skills/ultra-research/references/40-deployment.md +0 -29
  126. package/skills/ultra-research/references/41-quality-risks.md +0 -28
  127. package/skills/ultra-research/references/99-synthesis.md +0 -59
  128. package/skills/ultra-research/references/north-star-v2.md +0 -168
  129. package/skills/ultra-research/references/wayfinding.md +0 -50
  130. package/skills/ultra-research/scripts/validate_north_star.cjs +0 -1174
  131. package/skills/ultra-review/SKILL.md +0 -275
  132. package/skills/ultra-review/references/adversarial-evaluation.md +0 -31
  133. package/skills/ultra-review/references/code.md +0 -17
  134. package/skills/ultra-review/references/comments.md +0 -12
  135. package/skills/ultra-review/references/design.md +0 -12
  136. package/skills/ultra-review/references/errors.md +0 -13
  137. package/skills/ultra-review/references/review-modes.md +0 -29
  138. package/skills/ultra-review/references/spec.md +0 -18
  139. package/skills/ultra-review/references/tests.md +0 -12
  140. package/skills/ultra-review/references/unified-schema.md +0 -284
  141. package/skills/ultra-review/references/worker-packet.md +0 -183
  142. package/skills/ultra-review/scripts/review_wait.py +0 -2943
  143. package/skills/ultra-status/SKILL.md +0 -209
  144. package/skills/ultra-status/references/route-contract.md +0 -100
  145. package/skills/ultra-tdd/SKILL.md +0 -91
  146. package/skills/ultra-tdd/references/templates/README.md +0 -20
  147. package/skills/ultra-tdd/references/templates/feature-flag-default-audit.sh +0 -79
  148. package/skills/ultra-tdd/references/templates/persistence-real.ts +0 -78
  149. package/skills/ultra-tdd/references/templates/testcontainer-postgres.py +0 -78
  150. package/skills/ultra-tdd/references/templates/testcontainer-postgres.ts +0 -73
  151. package/skills/ultra-tdd/references/templates/vertical-slice.ts +0 -66
  152. package/skills/ultra-tdd/references/test-execution.md +0 -23
  153. package/skills/ultra-test/SKILL.md +0 -244
  154. package/skills/ultra-test/references/export-syntax.md +0 -18
  155. package/skills/ultra-test/scripts/validate_review_transport.cjs +0 -549
  156. package/skills/ultra-test/scripts/worktree_digest.cjs +0 -576
  157. package/skills/ultra-think/SKILL.md +0 -56
  158. package/skills/ultra-think/references/autonomy-boundary.md +0 -48
  159. package/skills/ultra-think/references/interaction-boundary.md +0 -42
@@ -1,284 +0,0 @@
1
- # Review artifact contract
2
-
3
- Use this contract for every specialist artifact. Write JSON to the assigned file and
4
- return only a one-line acknowledgement to the parent.
5
-
6
- ## Specialist artifact
7
-
8
- ```json
9
- {
10
- "$schema": "ultra-review-findings-v4",
11
- "agent": "review-code",
12
- "axis": "engineering_standards",
13
- "packet_digest": "<sha256-of-exact-worker-packet>",
14
- "admission_digest": "<sha256-of-exact-admission-receipt>",
15
- "subject_digest": "<subject-digest-from-admission-receipt>",
16
- "session": "<session-id>",
17
- "timestamp": "<RFC-3339-instant>",
18
- "scope": {
19
- "head": "<full-git-head>",
20
- "range": "<diff-range>",
21
- "files_analyzed": ["src/example.ts"],
22
- "diff_only": true
23
- },
24
- "status": "complete",
25
- "findings": [
26
- {
27
- "id": "review-code-001",
28
- "axis": "engineering_standards",
29
- "severity": "P1",
30
- "category": "correctness",
31
- "title": "Retry path commits the same payment twice",
32
- "file": "src/payments/retry.ts",
33
- "line": 42,
34
- "line_end": 47,
35
- "trigger": "The provider times out after committing the first request.",
36
- "impact": "A retry can create a duplicate charge.",
37
- "evidence": "retryPayment calls charge() again without an idempotency key.",
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
- }
44
- }
45
- ],
46
- "coverage_refs": ["src/payments/retry.ts:42"],
47
- "positive_observations": [],
48
- "limitations": []
49
- }
50
- ```
51
-
52
- Use `axis: "spec_fidelity"` for the independent acceptance review and
53
- `axis: "engineering_standards"` for engineering specialists.
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
-
66
- ## Required finding fields
67
-
68
- Every finding needs a stable id, axis, severity, category, concise title, repository-
69
- relative file, tight line range, triggering condition, observable impact, source
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.
74
-
75
- Severity is impact-based:
76
-
77
- - P0: exploitable critical security issue, destructive data loss, or deterministic
78
- critical outage;
79
- - P1: material correctness, authorization, reliability, or delivery failure;
80
- - P2: bounded defect or maintainability risk with a concrete cost;
81
- - P3: optional improvement that does not block the accepted outcome.
82
-
83
- Do not report a concern without a plausible execution path. Do not encode a style
84
- preference as a defect. Preserve the source specialist's severity during coordination.
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
-
97
- ## Coordinator summary
98
-
99
- `SUMMARY.json` contains:
100
-
101
- ```json
102
- {
103
- "$schema": "ultra-review-summary-v4",
104
- "mode": "change",
105
- "execution_mode": "isolated",
106
- "session": "<session-id>",
107
- "change_id": "<change-id>",
108
- "task_ids": ["<task-id>"],
109
- "head": "<full-git-head>",
110
- "worktree_digest": null,
111
- "context_digest": "<sha256-of-recorded-review-context>",
112
- "packet_digest": "<sha256-of-coordinator-worker-packet>",
113
- "admission_digest": "<sha256-of-exact-admission-receipt>",
114
- "subject_digest": "<subject-digest-from-admission-receipt>",
115
- "status": "complete",
116
- "verdict": "APPROVE",
117
- "axes": {
118
- "spec_fidelity": {
119
- "verdict": "PASS",
120
- "evidence_refs": ["review-spec.json"]
121
- },
122
- "engineering_standards": {
123
- "verdict": "PASS",
124
- "evidence_refs": ["review-code.json", "review-tests.json"]
125
- }
126
- },
127
- "workers": {
128
- "completed": ["review-spec", "review-code", "review-tests"],
129
- "failed": [],
130
- "skipped": ["review-errors", "review-design", "review-comments"]
131
- },
132
- "worker_selection": [
133
- {
134
- "worker": "review-spec",
135
- "status": "selected",
136
- "rationale": "The specification axis is required for every review mode."
137
- },
138
- {
139
- "worker": "review-code",
140
- "status": "selected",
141
- "rationale": "The runtime diff changes executable behavior."
142
- },
143
- {
144
- "worker": "review-tests",
145
- "status": "selected",
146
- "rationale": "The accepted behavior depends on changed test evidence."
147
- },
148
- {
149
- "worker": "review-errors",
150
- "status": "skipped",
151
- "rationale": "The diff does not change an error, fallback, or recovery path."
152
- },
153
- {
154
- "worker": "review-design",
155
- "status": "skipped",
156
- "rationale": "The bounded change does not alter module or data-flow boundaries."
157
- },
158
- {
159
- "worker": "review-comments",
160
- "status": "skipped",
161
- "rationale": "The current diff does not change maintained comments or API documentation."
162
- }
163
- ],
164
- "findings": [],
165
- "coverage_refs": ["review-spec.json", "review-code.json", "review-tests.json"],
166
- "positive_observations": [],
167
- "limitations": []
168
- }
169
- ```
170
-
171
- `findings` must contain every specialist v4 finding unchanged, including its
172
- `north_star_trace`. Group duplicates only in
173
- the human-readable summary; never delete or merge machine-readable records.
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
-
213
- `mode` is `task`, `change`, or `plan`. `worker_selection` contains each member of the
214
- six-worker roster exactly once with a scope-specific selected or skipped rationale.
215
- Its selected set equals `workers.completed` plus `workers.failed`; its skipped set
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.
224
-
225
- The overall verdict is `APPROVE` only when both axes pass, artifacts are complete and
226
- current, and no P0 or P1 finding remains. Use `REQUEST_CHANGES` for a failed axis or
227
- blocking finding, and `INCOMPLETE` when required evidence or workers are missing.
228
- Each axis verdict is `PASS`, `FAIL`, or `INCOMPLETE`; the overall verdict is `APPROVE`,
229
- `REQUEST_CHANGES`, or `INCOMPLETE`.
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
-
265
- Validate JSON before acknowledgement. Never paste full JSON or worker transcripts into
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.
@@ -1,183 +0,0 @@
1
- # Immutable Worker Packet
2
-
3
- Create `.ultra/reviews/<session>/WORKER-PACKET.json` once, before starting any lens.
4
- Serialize it as UTF-8 JSON with a trailing newline, compute SHA-256 over those exact
5
- bytes, and never edit the file. A changed scope requires a new session and packet.
6
- Before serialization, read each context, the canonical `.ultra/north-star.md`, the exact
7
- Change trace path, and every acceptance source from stable repository-contained
8
- regular-file snapshots. Send the captured North Star bytes to the canonical validator,
9
- then stable-read its reported decision and accepted-snapshot paths and verify their byte
10
- lengths and SHA-256 values. Compute the recorded context SHA-256, capture the trace
11
- fields, preserve each acceptance claim with its source path and heading, and write the
12
- exact ordered v2 `subject_observations`. After writing the packet, run:
13
-
14
- ```bash
15
- python3 scripts/review_wait.py <session> packet --packet-digest <sha256>
16
- ```
17
-
18
- Do not launch a worker unless that producer-side preflight returns `status: complete`.
19
- On success it atomically writes the derived
20
- `.ultra/reviews/<session>/ADMISSION.json` receipt. That receipt binds admission version,
21
- packet digest, observed Git HEAD, stable subject byte observations, and the exact
22
- canonical North Star report input plus that report's exact decision and snapshot
23
- `source_observations`. The subject digest binds all of those observations. It is
24
- evidence of the mechanical ingress check, not semantic authority. Publication is atomic and create-once: exact existing bytes are an
25
- idempotent success, while different existing bytes return `admission_conflict` and
26
- require a fresh session without replacing the first receipt. If the receipt was
27
- published, a fresh canonical root rewalk must confirm the session and exact receipt
28
- identity. Unresolved cleanup and directory durability failures are returned together
29
- as `status: complete` with `durability_warning`; a cleanup retry that succeeds is not a
30
- warning. Retain this derived evidence through Test and Deliver. If it is lost after any
31
- specialist artifact or `SUMMARY.json` exists, the session is `INCOMPLETE` and must be
32
- replaced by a fresh review session; do not claim the old receipt is reconstructable.
33
- Before any output exists, packet mode may recreate a missing v2 receipt only from the
34
- same packet-recorded bytes. A retained strict v1 packet remains readable with its exact
35
- existing receipt, but packet mode never creates or recreates a v1 receipt.
36
-
37
- ```json
38
- {
39
- "$schema": "ultra-review-worker-packet-v1",
40
- "admission_contract": "ultra-review-admission-required-v2",
41
- "session": "<session-id>",
42
- "mode": "task | change | plan",
43
- "created_at": "<RFC-3339-instant>",
44
- "head": "<full-git-head>",
45
- "range": "<exact-diff-range>",
46
- "change_id": "<active-change-id>",
47
- "task_ids": ["<task-id>"],
48
- "acceptance": ["<criterion with source path and heading>"],
49
- "public_seams": ["<entry point or behavior>"],
50
- "north_star_trace": {
51
- "path": ".ultra/changes/active/<change-id>/intent.md#north-star-trace",
52
- "first_principles": ["FP-1"],
53
- "serves": ["NS-01"],
54
- "touches": ["HC-2"],
55
- "north_star_revision": "north-star-v2-r1",
56
- "north_star_digest": "<git-blob-hash>"
57
- },
58
- "context_files": [
59
- {"path": ".ultra/contexts/task-<task-id>.md", "sha256": "<digest>"}
60
- ],
61
- "subject_observations": [
62
- {"role": "change", "path": ".ultra/changes/active/<change-id>/intent.md", "sha256": "<digest>", "byte_length": 123},
63
- {"role": "acceptance_source", "path": ".ultra/changes/active/<change-id>/intent.md", "sha256": "<digest>", "byte_length": 123},
64
- {"role": "decision", "path": ".ultra/decisions/<decision>.md", "sha256": "<digest>", "byte_length": 456},
65
- {"role": "snapshot", "path": ".ultra/research/<run>/north-star-v2-r1.accepted.md", "sha256": "<digest>", "byte_length": 789}
66
- ],
67
- "workers": [
68
- {
69
- "agent": "review-spec",
70
- "axis": "spec_fidelity",
71
- "lens": "skills/ultra-review/references/spec.md",
72
- "output": ".ultra/reviews/<session>/review-spec.json"
73
- }
74
- ],
75
- "diff_files": ["src/example.ts"],
76
- "output_directory": ".ultra/reviews/<session>"
77
- }
78
- ```
79
-
80
- Every displayed top-level field is required for a current strict packet.
81
- `admission_contract` has the exact value `ultra-review-admission-required-v2` for every
82
- new packet.
83
- `created_at` is RFC 3339; `head` is the
84
- lowercase 40-hex Git commit digest; `acceptance`, `public_seams`, and `diff_files` are
85
- non-empty; `task_ids` is non-empty in task mode.
86
- `north_star_trace` contains exactly the six displayed fields. Its three ID arrays are
87
- unique resolving IDs, `north_star_revision` is the accepted North Star `Revision`, and
88
- `north_star_digest` is the lowercase 40-hex result of
89
- `git hash-object .ultra/north-star.md`. Each `context_files` item contains exactly
90
- `path` plus a lowercase SHA-256 `sha256`. `subject_observations` is exact and ordered:
91
- the Change named by `north_star_trace.path`, each unique acceptance source sorted by
92
- UTF-8 path bytes, then the canonical validator's `decision` and `snapshot`. Every item
93
- contains exactly `role`, normalized repository-relative `path`, lowercase SHA-256, and
94
- non-negative integer `byte_length`; each worker contains exactly the four fields shown.
95
- Top-level extension fields may carry read-only review questions or historical
96
- references, but they are not provenance and cannot replace a required core field.
97
-
98
- In task mode, `context_files` is the exact ordered projection of `task_ids`: task
99
- `<task-id>` maps to `.ultra/contexts/task-<task-id>.md`. Each recorded digest must equal
100
- the exact current bytes. `north_star_trace.path` binds `change_id` to
101
- `.ultra/changes/<active|archive|abandoned>/<change-id>/intent.md#north-star-trace`.
102
- The packet producer captures the trace arrays, revision, digest, and owner-readable
103
- acceptance claims from those sources. Each `acceptance` item is
104
- `<repository-path>#<heading>: <captured owner-readable claim>`. Packet admission checks
105
- that `head` is the current `git rev-parse HEAD`, reads the exact validated Change path,
106
- every acceptance source, and both canonical validator sources as stable
107
- repository-contained regular-file bytes, and compares each byte length and SHA-256 with
108
- the packet. It checks the current context SHA-256 and passes the already captured North
109
- Star bytes to the one canonical Research validator through its native stdin seam. The
110
- report must receipt that exact path, byte count, and SHA-256, and its decision/snapshot
111
- observations must equal the packet's final two observations. Admission then freshly
112
- rewalks every captured subject before publication. These observations bind only paths
113
- and bytes; they do not add a second Markdown parser or reinterpret meaning.
114
-
115
- That current-subject validation occurs only in `packet` mode. Strict v4 `agents`,
116
- `summary`, and Review-to-Test require the stable packet-bound `ADMISSION.json`, then
117
- never reread mutable context, Change, acceptance, or North Star prose. Later task
118
- completion or authority revision does not invalidate the old review; reviewing the new
119
- subject requires a new session and packet. An immutable v4 session created before
120
- admission receipts and lacking `admission_contract` is readable only with explicit
121
- `--legacy-v4`; packet-absent or unmarked v3 history uses explicit `--legacy-v3`.
122
- Either legacy flag rejects every strict v1 or v2 marker, and there is no automatic
123
- fallback. A retained strict v1 packet instead consumes only its exact existing receipt.
124
-
125
- The session argument must resolve to `<repo>/.ultra/reviews/<session>`, and `session`
126
- must equal that directory name. Every designated repository path uses normalized
127
- repository-relative POSIX syntax: no absolute path, backslash, empty segment, `.`,
128
- `..`, or symlink escape. `output_directory` is exactly
129
- `.ultra/reviews/<session>`. Worker records appear in canonical roster order and use
130
- these exact bindings (a scope may select a subset, but `review-spec` is permanent and
131
- always present):
132
-
133
- | Agent | Axis | Lens | Output basename |
134
- |---|---|---|---|
135
- | `review-spec` | `spec_fidelity` | `skills/ultra-review/references/spec.md` | `review-spec.json` |
136
- | `review-code` | `engineering_standards` | `skills/ultra-review/references/code.md` | `review-code.json` |
137
- | `review-tests` | `engineering_standards` | `skills/ultra-review/references/tests.md` | `review-tests.json` |
138
- | `review-errors` | `engineering_standards` | `skills/ultra-review/references/errors.md` | `review-errors.json` |
139
- | `review-design` | `engineering_standards` | `skills/ultra-review/references/design.md` | `review-design.json` |
140
- | `review-comments` | `engineering_standards` | `skills/ultra-review/references/comments.md` | `review-comments.json` |
141
-
142
- The context observation used by `SUMMARY.json` is deterministic. For one context it is
143
- that item's `sha256`. For zero or multiple contexts, sort items bytewise by `path`,
144
- serialize the array as UTF-8 JSON with sorted object keys and no insignificant
145
- whitespace, then SHA-256 those bytes.
146
-
147
- Give a selected worker only:
148
-
149
- 1. this packet path and exact digest;
150
- 2. `unified-schema.md`;
151
- 3. its one lens reference.
152
-
153
- The worker writes only its assigned JSON artifact. During artifact and summary polling,
154
- `review_wait.py` rereads the exact `WORKER-PACKET.json` bytes and requires their SHA-256
155
- to remain unchanged. It binds the requested output stem to the declared worker and scope, requires
156
- `scope.diff_only: true`, and rejects any `scope.files_analyzed` or finding `file`
157
- outside `diff_files`. Packet, specialist, and summary inputs must be stable
158
- repository-contained regular files no larger than 8 MiB; a symlink in any managed path
159
- component, FIFO, other special file, replacement during a read, oversized file, invalid UTF-8, or invalid JSON
160
- return typed `incomplete` diagnostics. JSON parsing and SHA-256 always consume the same
161
- captured bytes. Finding trace IDs outside the packet arrays are invalid.
162
- The artifact's `packet_digest` must equal the expected digest passed to the waiter; a
163
- merely well-formed digest is insufficient.
164
- Every strict current artifact and `SUMMARY.json` also carries `admission_digest`, the
165
- SHA-256 of the exact retained `ADMISSION.json` bytes, and `subject_digest`, copied from
166
- that receipt. Both must exactly match the receipt loaded at waiter start. The waiter
167
- pins that pair across every polling and final reload, so a changed or missing receipt
168
- makes the session `INCOMPLETE` and requires a fresh session. Pre-admission historical
169
- v4 artifacts may omit the pair only when read with explicit `--legacy-v4`.
170
- The coordinator owns worker selection, synthesis, repair, and the summary.
171
-
172
- ## Review history: one direct parent only
173
-
174
- A task review packet may carry at most one direct parent. The sanctioned channel is
175
- the optional top-level `review_history` object with exactly `parent_summary_ref`
176
- (one prior session's `SUMMARY.json` path), `parent_summary_digest`, and
177
- `unresolved_blocking_ids` — only the parent's still-unresolved current P0/P1 finding
178
- ids. Packet admission rejects any packet whose fields or extensions reference more
179
- than one foreign review session. Transitive summary chains, complete historical
180
- findings, and whole-history disposition requests must not enter a new packet: a delta
181
- review consumes the current subject, its one direct parent, and the exact evidence
182
- refs the delta touches. The full archive stays readable under `.ultra/reviews/**` and
183
- is read only for a dedicated incident or owner audit.