ultra-builder-pro-cli 0.26.2 → 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.
Files changed (82) hide show
  1. package/.ultra-template/contexts/TEMPLATE.md +70 -29
  2. package/.ultra-template/north-star.md +35 -18
  3. package/.ultra-template/tasks.json +1 -0
  4. package/.ultra-template/test-report.json +17 -1
  5. package/CHANGELOG.md +235 -1
  6. package/README.md +210 -50
  7. package/README.zh-CN.md +440 -0
  8. package/adapters/_shared/host-profile.cjs +3 -95
  9. package/adapters/_shared/plugin-core.cjs +61 -5
  10. package/adapters/_shared/runtime-assets.cjs +66 -5
  11. package/adapters/zcode.js +375 -0
  12. package/bin/delegate-worker.cjs +2 -325
  13. package/bin/delegate.cjs +3 -461
  14. package/bin/install.js +11 -6
  15. package/docs/ARCHITECTURE.md +133 -31
  16. package/docs/ARTIFACT-AUTHORITY.md +185 -24
  17. package/docs/DECISIONS.md +153 -18
  18. package/docs/PHILOSOPHY.md +58 -7
  19. package/docs/PLUGIN-ISOLATION-CONTRACT.md +34 -12
  20. package/docs/RUNTIME-COMPAT-MATRIX.md +195 -23
  21. package/docs/SKILL-AUTHORING.md +19 -6
  22. package/docs/WORKFLOW-LIFECYCLE.md +196 -44
  23. package/docs/evals/adversarial-review-2026-08-14.md +84 -0
  24. package/docs/evals/ultra-5-0-journey-results.md +62 -0
  25. package/docs/evals/ultra-5-0-live-acp-conformance.md +93 -0
  26. package/docs/evals/ultra-5-0-route-journeys.md +145 -0
  27. package/docs/evals/zcode-automation-2026-08-14.md +103 -0
  28. package/hooks/README.md +27 -4
  29. package/hooks/_common.py +1678 -61
  30. package/hooks/adapters/zcode.py +227 -0
  31. package/hooks/compact_context.py +176 -17
  32. package/hooks/mid_workflow_recall.py +27 -5
  33. package/hooks/post_edit_guard.py +133 -23
  34. package/hooks/session_context.py +707 -22
  35. package/package.json +7 -3
  36. package/skills/ultra-change/SKILL.md +69 -12
  37. package/skills/ultra-change/references/change-contract.md +93 -27
  38. package/skills/ultra-change/references/execution-grant.md +109 -0
  39. package/skills/ultra-change/references/primary-transfer.md +273 -0
  40. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +1928 -0
  41. package/skills/ultra-delegate/SKILL.md +103 -8
  42. package/skills/ultra-delegate/patches/zcode-acp-0.1.0-zcode-0.16.5.patch +184 -0
  43. package/skills/ultra-delegate/references/delegation-contract.md +80 -1
  44. package/skills/ultra-delegate/scripts/acp-conformance.cjs +287 -0
  45. package/skills/ultra-delegate/scripts/acp-driver.cjs +762 -0
  46. package/skills/ultra-delegate/scripts/agent-execution-driver.cjs +320 -0
  47. package/skills/ultra-delegate/scripts/cli-driver.cjs +61 -0
  48. package/skills/ultra-delegate/scripts/delegate-worker.cjs +328 -0
  49. package/skills/ultra-delegate/scripts/delegate.cjs +690 -0
  50. package/skills/ultra-delegate/scripts/host-profile.cjs +267 -0
  51. package/skills/ultra-deliver/SKILL.md +98 -11
  52. package/skills/ultra-dev/SKILL.md +188 -42
  53. package/skills/ultra-grilling/SKILL.md +10 -7
  54. package/skills/ultra-grilling/references/reframing.md +7 -3
  55. package/skills/ultra-init/SKILL.md +56 -7
  56. package/skills/ultra-init/scripts/init_project.cjs +968 -21
  57. package/skills/ultra-plan/SKILL.md +91 -47
  58. package/skills/ultra-plan/references/task-evidence-v2.md +300 -0
  59. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +859 -0
  60. package/skills/ultra-research/SKILL.md +70 -14
  61. package/skills/ultra-research/references/04-product-strategy.md +11 -2
  62. package/skills/ultra-research/references/21-features-scope.md +8 -0
  63. package/skills/ultra-research/references/22-success-metrics.md +4 -3
  64. package/skills/ultra-research/references/99-synthesis.md +19 -2
  65. package/skills/ultra-research/references/north-star-v2.md +168 -0
  66. package/skills/ultra-research/references/wayfinding.md +8 -0
  67. package/skills/ultra-research/scripts/validate_north_star.cjs +1174 -0
  68. package/skills/ultra-review/SKILL.md +201 -27
  69. package/skills/ultra-review/references/adversarial-evaluation.md +31 -0
  70. package/skills/ultra-review/references/spec.md +5 -0
  71. package/skills/ultra-review/references/unified-schema.md +146 -11
  72. package/skills/ultra-review/references/worker-packet.md +151 -8
  73. package/skills/ultra-review/scripts/review_wait.py +2653 -63
  74. package/skills/ultra-status/SKILL.md +129 -15
  75. package/skills/ultra-status/references/route-contract.md +100 -0
  76. package/skills/ultra-tdd/SKILL.md +11 -4
  77. package/skills/ultra-tdd/references/test-execution.md +6 -1
  78. package/skills/ultra-test/SKILL.md +161 -18
  79. package/skills/ultra-test/scripts/validate_review_transport.cjs +549 -0
  80. package/skills/ultra-test/scripts/worktree_digest.cjs +518 -30
  81. /package/{adapters/_shared → skills/ultra-delegate/scripts}/delegate-profiles/kimi-read-only.md +0 -0
  82. /package/{adapters/_shared → skills/ultra-delegate/scripts}/delegate-profiles/kimi-write.md +0 -0
@@ -1,24 +1,27 @@
1
1
  # Ultra Builder Pro architecture
2
2
 
3
- Ultra Builder Pro v0.26 is a file-first workflow asset package for five coding-agent
4
- hosts. Its architecture is deliberately asymmetric: the host model owns meaning and
5
- strategy; Ultra mechanizes only portable prompts, observable files, bounded effects,
6
- and recovery.
3
+ Ultra Builder Pro is a file-first workflow asset package for six coding-agent hosts,
4
+ implementing the provider-neutral **Ultra Core Protocol**: cognitive alignment,
5
+ per-fact authority, explicit work-package grants, typed evidence, bounded effects,
6
+ checkpoints, and terminal review convergence — carried entirely by Skills,
7
+ owner-readable files, Git, host adapters, and optional Hooks. The host model owns
8
+ meaning and strategy; Ultra mechanizes only portable prompts, observable files,
9
+ bounded effects, and recovery.
7
10
 
8
11
  ## System boundary
9
12
 
10
13
  ```text
11
14
  Owner request
12
- │ explicit selection
15
+ │ explicit selection or verified execution grant (session-local / durable)
13
16
  ▼
14
- User-invoked Skill ──────── recommends next public route and stops
17
+ Public Skill mode ───────── stops at the next owner boundary
15
18
  │
16
19
  ├── model-invoked disciplines (reasoning methods)
17
20
  ├── source / tests / runtime / primary documentation
18
21
  └── canonical project files + Git
19
22
  │
20
23
  ├── optional five hooks (derived context and effect guard)
21
- └── optional delegate CLI (bounded external host process)
24
+ └── optional delegation (ACP-first driver or CLI fallback)
22
25
  ```
23
26
 
24
27
  Ultra has no semantic runtime supervisor. Reading the files is the recovery protocol;
@@ -34,9 +37,20 @@ Fourteen `skills/*/SKILL.md` files carry the workflow:
34
37
  - five model-invoked reusable disciplines;
35
38
  - one read-only router.
36
39
 
37
- The exact allowlists live in `adapters/_shared/runtime-assets.cjs`. Public workflows
38
- never invoke another public workflow. They may use model-invoked disciplines and then
39
- recommend the next owner route.
40
+ The exact allowlists and per-mode invocation map live in
41
+ `adapters/_shared/runtime-assets.cjs`. Public modes are `explicit-entry`,
42
+ `grant-continuable`, or read-only `router`. Under an accepted Change-scoped Execution
43
+ Grant, change-scoped Research, same-Change reconciliation, Plan, Dev, Test, and Deliver
44
+ reconciliation may be selected by the model only while `session-local` activation is
45
+ live or a fresh Agent has stably verified a `durable work-package` grant. Host metadata
46
+ does not preserve session activation: a fresh session, Host switch, or compaction stops
47
+ `session-local` continuation until the Owner activates it again. Host metadata
48
+ is a coarse discovery bit; each loaded Skill rechecks its mode, Change, effects, and
49
+ material checkpoints. Stored text alone grants nothing, and neither mode grants Change
50
+ intake/acceptance, primary transfer, Deliver finalization or archive; every external
51
+ effect still stops. The derived Route Card makes each boundary owner-visible without
52
+ becoming workflow state or authority. The router itself remains owner-invoked; public
53
+ Skills derive their own cards from the shared Route Contract instead of invoking it.
40
54
 
41
55
  Research's seventeen references are workflow-owned semantic lenses. Its optional
42
56
  `wayfinding.md` maps a multi-lens question without becoming a new Skill or authority.
@@ -51,21 +65,44 @@ Canonical semantic authority consists of:
51
65
  - `.ultra/north-star.md` for the accepted direction, outcome or metric decision, hard
52
66
  constraints, and exclusions established by Research;
53
67
  - `.ultra/specs/*.md` for product, architecture, discovery, and research distillate;
54
- - `.ultra/changes/{active,archive,abandoned}/<id>/intent.md` for bounded outcomes with
55
- one stable id across directory moves;
56
- - append-only `.ultra/tasks.json` rows carrying `change_id`, plus each task's `context_file`;
57
- - `.ultra/decisions/*.md`, `.ultra/evidence/`, `.ultra/test-report.json`, and research;
68
+ - `.ultra/changes/{active,archive,abandoned}/<id>/intent.md` for bounded outcomes, North
69
+ Star Trace, and a required Execution Grant (`session-local` and inert without current-
70
+ session activation by default) with one stable id across directory moves;
71
+ - append-only `.ultra/tasks.json` v2 rows carrying `change_id` and the sole task status,
72
+ plus each task's status-free `context_file`;
73
+ - `.ultra/decisions/*.md`, typed `.ultra/evidence/`, `.ultra/test-report.json`, and research;
58
74
  - repository-root `CONTEXT.md` for ubiquitous language;
59
75
  - Git for revision identity, history, moves, diff, and rollback.
60
76
 
61
77
  Each semantic fact has one canonical representation. A summary can point to authority,
62
78
  but cannot become a second authority merely because it is convenient to read.
79
+ Task status therefore lives only in `.ultra/tasks.json`. Legacy context Status and
80
+ Complexity fields are migration observations; readers report them and the ledger wins.
81
+ Current task evidence uses `ultra-task-evidence-v2`, whose typed command, inspection,
82
+ owner-judgment, and external-observation entries retain distinct authorities. Only the
83
+ owner can supply an owner-judgment result. Structural validators report exact facts and
84
+ never decide semantic acceptance. Command and external evidence store a safe
85
+ repository-relative raw ref plus `raw_evidence_sha256`; structural validation does not
86
+ open that ref. Dev binds bounded stable ordinary non-symlink receipt bytes before record
87
+ publication, while Test, Status, and Deliver recheck the raw digest and then the exact
88
+ record `evidence_digest`. The product-worktree digest excludes `.ultra/evidence/**`, so
89
+ evidence publication cannot invalidate the freshness value it records.
63
90
 
64
91
  One primary host model writes this authority in a worktree. Native subagents are
65
92
  read-only sensors; delegated CLIs write isolated non-`.ultra` roots and return receipts.
66
93
  Sequential Changes share the ledger by stable id, while current readers filter by the
67
94
  one unique active Change. This keeps concurrency explicit in Git instead of adding a
68
- semantic lock service or workflow engine.
95
+ semantic lock service or workflow engine. When the canonical writer itself changes
96
+ Agent, an owner-granted primary transfer moves the role exclusively — a derived
97
+ OFFER binding canonical refs/hashes, HEAD, and worktree digest; a receiver ACK that
98
+ is ready only on full stable-read match; sole-writer execution; a frozen terminal
99
+ RESULT — with receipts under `.ultra/.runtime/handoffs/` kept as rebuildable
100
+ observations and delegated workers never acquiring canonical write authority
101
+ (`skills/ultra-change/references/primary-transfer.md`).
102
+
103
+ Autonomous coding uses the host's existing model-tool loop, one canonical writer, and
104
+ the same task/evidence/review files. Ultra adds no persisted route position: budgets are
105
+ hard ceilings, while the model interprets whether acceptance and stop conditions hold.
69
106
 
70
107
  ### Adaptation plane
71
108
 
@@ -76,15 +113,18 @@ semantic lock service or workflow engine.
76
113
  - hook command paths and wire normalization;
77
114
  - atomic managed installation, provenance, doctor, and uninstall behavior.
78
115
 
79
- `adapters/_shared/plugin-core.cjs` owns the common copy and managed-publication
80
- mechanics. `host-profile.cjs` owns the five non-interactive delegation argv contracts.
81
- Adapters never rewrite workflow meaning.
116
+ `adapters/_shared/plugin-core.cjs` owns the common copy, managed publication, and
117
+ delegation-runner inventory and driver-reporting checks. The canonical six-host
118
+ non-interactive profile lives
119
+ beside the installed launcher at `skills/ultra-delegate/scripts/host-profile.cjs`;
120
+ `adapters/_shared/host-profile.cjs` is a one-release compatibility re-export. Adapters
121
+ never rewrite workflow meaning.
82
122
 
83
123
  ### Why the old Agents are Skill assets now
84
124
 
85
125
  The retired custom-agent files did not own product authority. They contained reusable
86
126
  review lenses, debugging, test execution, and review coordination. v0.26 keeps those
87
- methods on the common surface all five hosts actually share:
127
+ methods on the common surface all six hosts actually share:
88
128
 
89
129
  - six review workers map to `ultra-review/references/{code,design,errors,tests,spec,comments}.md`;
90
130
  - review coordination and the former general code reviewer map to the parent
@@ -99,9 +139,20 @@ the parent model runs the same references sequentially.
99
139
  ### Observation plane
100
140
 
101
141
  Five hooks read canonical files and emit bounded context or observations. Their output
102
- under `.ultra/.runtime/`, `.ultra/progress/`, or `.ultra/reviews/` is derived and
103
- disposable. The dangerous-command hook is the only hard effect guard; it classifies a
104
- small named destructive set and provides an exact-command authorization repair.
142
+ under `.ultra/.runtime/` and `.ultra/progress/`, and review artifacts under
143
+ `.ultra/reviews/`, are derived rather than semantic authority. A current strict review
144
+ session contains `WORKER-PACKET.json`, `ADMISSION.json`, every selected specialist
145
+ artifact, and `SUMMARY.json`; retain it until aggregate Test and Deliver have both consumed it
146
+ successfully, then it may be garbage-collected. Premature loss requires a fresh Review
147
+ and Test; never reconstruct the old receipt. The dangerous-command hook is the only
148
+ hard effect guard; it classifies a small named destructive set and provides an
149
+ exact-command authorization repair.
150
+
151
+ ACP `session/update` telemetry follows the same rule. The Skill-local driver stores only
152
+ bounded redacted event metadata under the delegation directory, drops hidden thought
153
+ chunks and raw tool payloads, and exposes the latest safe observation through status.
154
+ The journal, session id, capability report, permission decision, and stop reason are all
155
+ disposable execution observations; none can select a route or establish completion.
105
156
  Additive protected-branch publication remains advisory when portable host wiring cannot
106
157
  project a trusted owner-approval receipt; history rewrites and branch deletion remain
107
158
  guarded.
@@ -109,16 +160,20 @@ guarded.
109
160
  ## Completion and recovery
110
161
 
111
162
  An operation is complete only when its accepted user outcome works through the real
112
- public seam. Route/schema/UI shells, local unit green, or an edited task status are not
113
- end-to-end evidence by themselves.
163
+ public seam. Route/schema/UI shells, local unit green, or an edited ledger status are not
164
+ end-to-end evidence by themselves. A task remains `in_progress` through its task review;
165
+ only after blocking findings are resolved or authoritatively dispositioned and affected
166
+ v2 evidence is refreshed may the primary model write `completed` to the ledger.
114
167
 
115
168
  Every user Skill starts by reading:
116
169
 
117
170
  1. zero or one active `change_id`, diagnosing more than one;
118
- 2. `.ultra/tasks.json` tasks whose `change_id` matches it;
171
+ 2. `.ultra/tasks.json` tasks whose `change_id` matches it, treating that ledger as the
172
+ sole task-status authority;
119
173
  3. the matching frontier task's `context_file` and closing `## Resume Note`;
120
174
  4. `CONTEXT.md` and relevant decisions;
121
- 5. the active Change, specifications, evidence, and current Git state.
175
+ 5. the active Change, specifications, current v2 task evidence and retained task-review
176
+ provenance, and current Git state.
122
177
 
123
178
  That same sequence works after compaction, a fresh process, disabled hooks, or a host
124
179
  change. Compact snapshots can accelerate recovery but never outrank the source files.
@@ -132,22 +187,49 @@ Three independent Skills protect the vertical path:
132
187
  2. `ultra-dev` records six separate evidence dimensions, including real persistence,
133
188
  default-on behavior, vertical execution, and spec trace.
134
189
  3. `ultra-test` searches exports for real consumers, exercises the primary flow, and
135
- binds the result to Change id, task ids, intent, HEAD, and product-worktree digest.
190
+ binds the result to Change id, task ids, intent, HEAD, product-worktree digest, exact
191
+ raw receipt SHA-256 values, and the containing task-evidence digests.
136
192
 
137
193
  These are independent sensors. None rewrites a finding into product truth.
138
194
 
139
195
  ## Delegation
140
196
 
141
- `ubp delegate run` validates all paths inside the selected project, reads a bounded
142
- instruction and permission JSON, builds argv from one host profile, and starts a
143
- background worker. Declared writable roots must already exist inside the delegated
197
+ The canonical installed `ultra-delegate/scripts/delegate.cjs` validates all paths inside
198
+ the selected project, reads a bounded instruction and permission JSON, probes the
199
+ Skill-local Host profile, and starts the Skill-local background worker. One
200
+ `AgentExecutionDriver` boundary selects stable ACP v1 stdio only after the exact Host's
201
+ versioned conformance row passes with a non-empty evidence reference and the declared
202
+ executable and bounded candidate-identity probes succeed; otherwise the same packet
203
+ runs through `CliDriver` and records the fallback reason. Capability inspection uses
204
+ local version commands only and does not start a provider task. The
205
+ one-release `ubp delegate` surface imports those same functions and owns no forked
206
+ behavior. Declared writable roots must already exist inside the delegated
144
207
  worktree; no readable-root or external-effect grant can widen the host's native
145
208
  sandbox. Empty writable roots select native read-only mode. The model returns a
146
- schema-constrained final response; the Node worker validates `finished`, `blocked`, or
209
+ schema-constrained final response; `AcpDriver` reconstructs only agent-message text as
210
+ that same validator input, while ACP stop reasons remain observations. It accepts a
211
+ bounded set of creation-time session metadata that some agents emit before
212
+ `session/new` resolves, then validates every buffered session identity before exposing
213
+ derived events; early message/tool content and unbounded startup traffic fail closed.
214
+ The Node worker validates `finished`, `blocked`, or
147
215
  `failed` and atomically publishes `result.json` beside the instruction. The model never
148
216
  writes its own receipt; stdout, stderr, native final output, and the launch receipt
149
217
  remain diagnostic files.
150
218
 
219
+ `ULTRA_DELEGATE_FORCE_CLI=1` is a per-run recovery seam that selects the same bounded
220
+ CLI validator path and records `acp_forced_cli`; it does not erase conformance evidence.
221
+ An `acp_auth_required` error from `session/new` before `session/prompt` also selects that
222
+ already-bound CLI path once. The terminal result retains redacted ACP fallback metadata;
223
+ no post-prompt or other ACP failure is automatically retried.
224
+ ZCode uses the independently installed, source-pinned `zcode-acp` bridge plus the
225
+ digest-bound 0.16.5 runtime-preferences patch to translate stable ACP v1 to the installed
226
+ Desktop runtime. Ultra ships only the patch, neither the bridge binary nor App bytes.
227
+ The profile verifies an Ultra build marker on that bridge plus the exact installed
228
+ runtime version before ACP selection.
229
+ The Host/runtime is ZCode Desktop while provider identity remains owner-controlled; the
230
+ verified local receipt uses domestic BigModel rather than international Z.AI OAuth. The
231
+ headless ZCode transport remains explicitly experimental even after conformance.
232
+
151
233
  The instruction binds the active `change_id` and one of three semantic scopes: task
152
234
  execution/continuation, scoped Research evidence, or aggregate Change
153
235
  review/verification. Only task execution requires a task row. The read-only Research
@@ -157,6 +239,25 @@ to make delegation reachable.
157
239
  Delegation does not grant authority or copy semantic state into another store. The
158
240
  worker reads and writes the same repository files in the specified worktree.
159
241
 
242
+ ## Optional Graph/Loop control plane
243
+
244
+ Long-running, multi-Agent, cross-Host work can justify an external coordination
245
+ layer (for example a LoopX-style kernel) that owns goal/todo identity, claims and
246
+ leases, attention queues, quotas, human-gate records, handoff receipts, and
247
+ append-only run/effect observations. Such a layer is **optional and currently not
248
+ integrated**: no adapter, dependency, daemon, or scaffold for one ships in this
249
+ package, and the Ultra Core Protocol remains fully usable on files plus Git with
250
+ every optional layer absent.
251
+
252
+ The boundary is fixed regardless of future integration: the control plane may
253
+ observe and coordinate — it may never own the North Star, product meaning,
254
+ acceptance, semantic severity, architecture or scope decisions, a "quality is
255
+ sufficient" verdict, or the authority to start an unauthorized Agent. Enabling it
256
+ requires a real coordination problem the owner accepts (multi-session parallel
257
+ frontiers, claim/write conflicts, long external waits, explicit quotas, cross-Host
258
+ handoff) plus an adapter with a live consumer; deleting or disabling it must always
259
+ leave canonical project truth and human recovery intact.
260
+
160
261
  ## Deliberate absences
161
262
 
162
263
  The architecture does not include:
@@ -165,6 +266,7 @@ The architecture does not include:
165
266
  - an MCP server or tool protocol;
166
267
  - a workflow state machine or semantic validator;
167
268
  - a background orchestration daemon;
269
+ - a resident ACP service, ACP session store, or semantic route ledger;
168
270
  - command or custom-agent prompt projections;
169
271
  - general memory, code graph, browser, deployment, or framework packages.
170
272
 
@@ -1,7 +1,10 @@
1
1
  # Ultra artifact authority
2
2
 
3
3
  This document defines which project artifacts carry semantic authority, who may change
4
- them, how staleness is detected, and how recovery works in Ultra Builder Pro v0.26.
4
+ them, how staleness is detected, and how recovery works in Ultra Builder Pro. Since the
5
+ accepted 3.0 design it is the per-fact expression of the Ultra Core Protocol: one
6
+ canonical representation per semantic fact, explicit authorization, bounded effects,
7
+ and reachable recovery, on files plus Git alone.
5
8
 
6
9
  ## Rules
7
10
 
@@ -12,6 +15,94 @@ them, how staleness is detected, and how recovery works in Ultra Builder Pro v0.
12
15
  5. Git supplies revision identity, history, archive moves, comparison, and rollback.
13
16
  6. A Change keeps one stable `change_id`; directory position records lifecycle, not identity.
14
17
 
18
+ ## Routing precedence
19
+
20
+ When workflow-route signals conflict, consumers resolve them in this order:
21
+
22
+ 1. the current explicit owner instruction, accepted decisions, and external-effect
23
+ authorization;
24
+ 2. the current accepted North Star and the active Change intent;
25
+ 3. the current owner-issued Execution Grant — `session-local` while its conversation
26
+ activation is live, or a `durable work-package` grant a fresh Agent has stably
27
+ verified — its exact Change, modes, effects, topology, budget, and stop conditions;
28
+ 4. the task ledger, task acceptance, planned paths, and dependencies;
29
+ 5. the current validated Review SUMMARY verdict;
30
+ 6. current evidence and Test observations;
31
+ 7. the Resume Note;
32
+ 8. Hooks, progress records, compact snapshots, historical reviews, and other
33
+ derived observations.
34
+
35
+ A lower layer never overrides a higher one. A conflict produces a typed diagnostic,
36
+ preserves the original bytes, and routes to the nearest repair or owner checkpoint;
37
+ nothing silently selects the "safer" semantic result. The Resume Note is
38
+ navigational context — the current checkpoint, the next action a higher authority
39
+ has already allowed, unresolved prerequisites, and the cheapest safe resume command
40
+ or path — and never route authority: it cannot rewrite acceptance, a Review verdict,
41
+ scope, or budget, and it cannot promote P2/P3 findings into blockers or reopen a
42
+ review that returned a current verdict. Historical reviews, progress records, and
43
+ Hook observations are provenance only.
44
+
45
+ The Route Card is a projection of this precedence, not another layer in it. Its Route,
46
+ Mode, Position, Exit condition, Delta, and Next fields are recalculated from the same
47
+ authorities and current observations whenever a public Skill enters, pauses, exits, or
48
+ transitions.
49
+
50
+ A formal terminal outcome — an accepted result, an owner decision, an external
51
+ blocker, a review-budget stop, or an abandonment — outranks every Resume, Hook, or
52
+ Status suggestion that appears to continue the same work. Review stays inside the
53
+ budget accepted for the work package, under one precedence rule: an exact current
54
+ owner grant overrides the versioned product default — the released default is one
55
+ initial Review plus two P0/P1 delta Reviews. Budget exhaustion with a remaining
56
+ blocker returns the choice to the owner instead of another round; no Agent,
57
+ reviewer, Hook, or control plane extends a budget itself, and the same root
58
+ surviving three failed fixes stops point-patching and reports an architecture
59
+ problem.
60
+
61
+ ## Effect classes
62
+
63
+ Every action belongs to exactly one class, and the class fixes who may perform it:
64
+
65
+ | Effect class | Examples | Default rule |
66
+ |---|---|---|
67
+ | `observation` | read-only source inspection, search, test listing | an Agent may act freely inside its task scope |
68
+ | `local-reversible` | editing files inside the authorized worktree, running local tests, creating deletable temporary files | allowed inside an accepted work package with a recovery point |
69
+ | `canonical-authority` | modifying the North Star, an active intent, task status, or an evidence verdict | one designated writer per fact; material semantic deltas return to the owner |
70
+ | `external-or-irreversible` | commit, push, tag, publish, deploy, real installation, provider spend, credential or production mutation | one separate owner authorization per effect; capability or readiness never implies permission |
71
+
72
+ A durable work-package grant may cover exact `local-reversible` execution and the
73
+ canonical status writes it names explicitly. It never inherits
74
+ `external-or-irreversible` effects by default; those require the owner to list each
75
+ one in the grant and the consuming Agent to verify the listing is current.
76
+
77
+ ## Owner checkpoint semantics
78
+
79
+ Every owner-facing checkpoint — the WIP at a stop, a task's closing Resume Note, a
80
+ delivery report, or a review's owner handoff — answers eight fixed semantics, in
81
+ whatever length keeps the owner able to judge:
82
+
83
+ 1. **Why** — the real problem being solved.
84
+ 2. **Outcome** — what difference the owner will see.
85
+ 3. **Accepted boundary** — what is accepted, and what explicitly is not.
86
+ 4. **Delta** — what materially changed since the last checkpoint.
87
+ 5. **Reality** — how far the live path actually works; what is still fake, unknown,
88
+ or unverified.
89
+ 6. **Decision needed** — what the owner must decide now; a Route Card says `none` when
90
+ nothing is genuinely blocking, while a free-form handoff may omit the section.
91
+ 7. **Next bounded action** — the smallest authorized next step.
92
+ 8. **Not done** — what remains owed when stopping or pausing.
93
+
94
+ The canonical
95
+ [`UBP Route Card`](../skills/ultra-status/references/route-contract.md#route-card) adds
96
+ four navigation fields — Route, Mode, Position, and Exit condition — around these eight
97
+ semantics. It is emitted output only: it has no canonical project path, never becomes a
98
+ route ledger, and cannot grant continuation. Counts and transport events may explain
99
+ Position or Reality but cannot produce a semantic completion verdict.
100
+
101
+ A checkpoint is a cognitive interface, not a mechanical stage marker: no line count,
102
+ token budget, or coverage percentage gates it, and alignment failure ("I don't know
103
+ what you are doing", or the same concept re-explained repeatedly) stops execution and
104
+ review until the owner re-accepts an outcome.
105
+
15
106
  ## Canonical artifacts
16
107
 
17
108
  | Artifact | Canonical content | Primary writer | Required readers | Staleness or conflict signal |
@@ -24,11 +115,12 @@ them, how staleness is detected, and how recovery works in Ultra Builder Pro v0.
24
115
  | `.ultra/specs/research-distillate.md` | bounded synthesis of specification state | `ultra-research` | change, plan, delivery | stored source blob hash differs from Git blob hash |
25
116
  | `CONTEXT.md` | ubiquitous language and relationships | `ultra-domain-modeling`, first called by research and later by any qualifying workflow | every workflow and test naming | source/product use reveals ambiguity |
26
117
  | `.ultra/changes/{active,archive,abandoned}/<id>/intent.md` | one bounded requested outcome, reconciliation, Research Disposition, stable identity, and exact Abandonment closure when abandoned | `ultra-change`; Planning Posture by `ultra-plan` | active: research through delivery; all states: status and future Change history | more than one active Change, duplicate id across positions, missing Abandonment closure, or acceptance/scope change |
27
- | `.ultra/tasks.json` | append-only task ledger: globally unique identity, stable `change_id`, same-Change graph, status, trace, and context path | `ultra-plan` / `ultra-dev` | every user workflow and context Hook | dependency crosses Change, or ledger/context status disagrees |
28
- | task `context_file` | acceptance, seams, implementation, evidence pointers, Completion, Resume Note | plan/dev | dev, test, review, status, delivery, resume | differs from ledger or current implementation |
118
+ | `.ultra/tasks.json` | `ultra-task-ledger-v2`: append-only task identity, stable `change_id`, same-Change graph, sole task status, trace, and context path | `ultra-plan` / `ultra-dev` | every user workflow and context Hook | dependency crosses Change, row shape is invalid, or a named context cannot be resolved |
119
+ | task `context_file` | typed acceptance, seams, implementation, evidence pointers, Completion, Task Review, Resume Note; no v2 task status | plan/dev | dev, test, review, status, delivery, resume | acceptance identity, evidence pointer, or implementation differs from current source; a legacy Status or Complexity field is a migration diagnostic |
29
120
  | `.ultra/decisions/<id>.md` | durable consequential owner decision | `ultra-think` after acceptance | every workflow in scope | superseded by a newer decision file |
30
- | `.ultra/evidence/<task-id>/...` | command output and bounded task evidence | `ultra-dev` | review, test, delivery | evidence revision differs from affected code |
31
- | `.ultra/test-report.json` | whole-system audit, findings, and owner disposition for one Change/task/intent/product snapshot | `ultra-test`; `ultra-deliver` may add owner disposition without changing findings or `passed` | status and delivery | `change_id`, `task_ids`, `intent_digest`, `git_commit`, or worktree digest differs |
121
+ | active Change `## Execution Grant` | the current work package's execution authorization: mode (`session-local` default or `durable work-package`), scope, Agent topology, allowed local effects, budgets/expiry, invalidation, and revoke; the exact durable grant bytes live in the cited owner decision, never in a second prose mirror | owner issues; `ultra-change` records the exact reference and fields; no workflow may widen it | executor, handoff, Status | a new Change, a recorded owner revocation, or a fired invalidation condition; stored grant text alone never activates |
122
+ | `.ultra/evidence/<task-id>/...` | one final `ultra-task-evidence-v2` record: typed acceptance evidence, six dimensions, independent completion-snapshot freshness observation, separate task-review provenance, raw-output refs, and limitations | `ultra-dev` after validated task review | test, delivery; review consumes actual pre-review evidence instead | context acceptance, completion observation, cited artifacts, or review binding differs, or a legacy record has not been migrated |
123
+ | `.ultra/test-report.json` | whole-system audit, ordered task-evidence identities, strict aggregate-review provenance, findings, and owner disposition for one Change/task/intent/product snapshot | `ultra-test`; `ultra-deliver` may add owner disposition without changing findings or `passed` | status and delivery | root identity, ordered task-evidence projection, or packet/admission/subject/summary review binding differs |
32
124
  | `.ultra/changes/active/<id>/delivery.md` | outcome, docs, verification, review, debt, risk, recovery, effects | `ultra-deliver` | owner and archived Change history | active evidence or accepted scope changes |
33
125
  | `.ultra/research/<run-id>/<step-id>.md` | cited investigation report for one selected lens | `ultra-research` | specs, change, plan, delivery | newer sources or later superseding run |
34
126
 
@@ -43,32 +135,74 @@ never becomes current merely because of its status. Before an abandoned move,
43
135
  evidence, and recovery or successor. Future Change reconciliation and Status consume
44
136
  that record as history, not as accepted current intent.
45
137
 
46
- Every completed task has exactly one `.ultra/evidence/<task-id>/evidence.json` with
47
- schema `ultra-task-evidence-v1`. It records `task_id`, forty-character `git_head`, exact
48
- commands (`command`, `exit_code`, `evidence_ref`), all six evidence dimensions,
49
- artifact paths, limitations, and timestamp. Each dimension uses `status` of
50
- `satisfied`, `gap`, or `not_applicable`, plus `evidence_refs` and a non-empty rationale.
51
- Optional raw logs live beside that record; they do not create another summary.
138
+ Every current completed task has exactly one final
139
+ `.ultra/evidence/<task-id>/evidence.json` with schema `ultra-task-evidence-v2`. The
140
+ canonical field and type contract lives in
141
+ `skills/ultra-plan/references/task-evidence-v2.md`; this document does not duplicate it.
142
+ The record binds the task and Change, context acceptance bytes, typed acceptance
143
+ evidence and dispositions, all six evidence dimensions,
144
+ task-review provenance, artifacts, limitations, and timestamp. `command`, `inspection`,
145
+ `owner-judgment`, and `external-observation` retain separate evidence authorities. The
146
+ owner alone supplies an owner-judgment result. The CLI establishes only JSON shape,
147
+ token syntax, and authority designation; it does not prove current identity, provenance,
148
+ freshness, or semantic acceptance. Test takes stable bytes independently, recomputes the
149
+ Acceptance-section SHA-256, aligns exact criterion IDs and verification types with the
150
+ current context, and aligns task-review session and summary digest with the retained strict summary. The `subject` is an independently captured completion-snapshot freshness observation made after the final strict task Review validates and immediately before
151
+ evidence publication. Its `task_review` separately binds the retained strict summary.
152
+ Worker Packet v1 and its summary's null `worktree_digest` do not prove or
153
+ cryptographically bind the completion subject. Test separately binds its report to the
154
+ current whole Change, then rechecks the current Acceptance, criterion IDs and verification
155
+ types, owner record, review summary, and cited affected artifacts instead of demanding
156
+ digest equality with the earlier task observation.
157
+ For `owner-judgment`, the durable owner record must exist and its cited statement and
158
+ disposition must remain readable. Any mismatch is an evidence gap returned to Dev or,
159
+ for missing owner judgment, to the owner. Optional raw logs live beside the record and
160
+ do not create another summary. Historical v1 records stay readable evidence but produce
161
+ a migration diagnostic and cannot satisfy a current Change's Test or Deliver input.
162
+
163
+ Task-review provenance has two discriminated branches with one authority rule: a
164
+ strict-v4 record binds its retained strict session artifacts, while an
165
+ `external-manual` record binds a real external-reviewer receipt under
166
+ `.ultra/evidence/<task-id>/` by exact stable bytes and SHA-256 through the task
167
+ evidence sensor's verify mode. The external receipt is a reconstructable observation
168
+ of reviewer identity, reviewed subject, verdict, and exact findings — never semantic
169
+ authority, never owner acceptance, and never a substitute strict
170
+ SUMMARY/ADMISSION/session. Consumers recheck whichever branch a record declares and
171
+ never rewrite one into the other.
52
172
 
53
173
  ## Mutable workflow state
54
174
 
55
175
  Pure file state uses three mechanisms:
56
176
 
57
177
  - directory position, such as `changes/active/` versus `changes/archive/`;
58
- - an explicit field, such as a task or context status;
178
+ - an explicit field, such as task status in `.ultra/tasks.json`;
59
179
  - an on-the-spot model judgment that is not persisted as state.
60
180
 
61
181
  A state field records a mechanically checkable fact. Route selection remains a model
62
182
  judgment. Do not add a workflow-position field merely to decide which Skill should run.
183
+ The Route Card is derived each time and is disposable in exactly this sense.
63
184
 
64
185
  At most one Change is active in one worktree. Zero active Changes is valid before a new
65
186
  request and after delivery; completed current tasks may remain active while awaiting
66
187
  Test or Deliver. More than one active directory is a conflict for owner/model repair,
67
188
  not a reason for code to select the first entry.
68
189
 
69
- Task completion uses a dual write: `.ultra/tasks.json` and the task context header must
70
- agree. The writer reads both back. A mismatch is a visible recovery diagnostic; neither
71
- side silently wins.
190
+ Task status has one writer and one authority: `.ultra/tasks.json`. New contexts carry no
191
+ Status field. A legacy context Status or Complexity header is preserved as a migration
192
+ diagnostic, but the ledger wins. During implementation the row remains `in_progress`.
193
+ Task-review admission uses that row, task context, an immutable review packet, and
194
+ actual pre-review evidence; it does not require the final record it is helping create.
195
+ After the final summary validates, Dev writes the one canonical evidence record with
196
+ every blocking finding, resolution or authoritative disposition, and affected evidence
197
+ refresh. Only after that record and the context review facts are current may the primary
198
+ model write `completed` to the ledger and read the row back. A validator may check this
199
+ ordering and its references; it cannot decide that a finding is semantically resolved.
200
+
201
+ Later invalidation uses one explicit recovery edge. The ledger-authoritative row changes
202
+ from `completed` to `in_progress`; Dev must never silently demote it. Before the write,
203
+ Dev records the affected criterion IDs and reason in the task context Change Log and Resume Note.
204
+ It preserves the old frozen review as history, then writes and reads back the ledger
205
+ transition. New evidence and review close the task again through the same path.
72
206
 
73
207
  ## Single-writer boundary
74
208
 
@@ -79,6 +213,14 @@ Parallel implementation uses separate worktrees and explicit Git integration. Ul
79
213
  does not add a lock service or semantic state machine to make concurrent canonical
80
214
  writes appear safe.
81
215
 
216
+ The primary writer of a work package changes only through an owner-granted primary
217
+ transfer (`skills/ultra-change/references/primary-transfer.md`): a derived OFFER
218
+ binding canonical refs/hashes, HEAD, and worktree digest; a receiver ACK that is
219
+ ready only on full stable-read match; sole-writer execution; and a frozen terminal
220
+ RESULT. A delegated worker never becomes the canonical writer, and a delegation
221
+ receipt never serves as an ACK or RESULT. While an ACK-ready transfer is open, at
222
+ most that one receiver may write canonical files.
223
+
82
224
  ## Decisions and reductions
83
225
 
84
226
  Write a durable decision only when it is difficult to reverse, surprising without
@@ -105,9 +247,17 @@ into a second semantic ledger.
105
247
 
106
248
  A test result is current only for the code and environment it exercised. A report must
107
249
  carry the exact command, exit code, stable Change id, exact current task ids, intent
108
- SHA-256, Git commit, and product-worktree digest. Delivery metadata and moving the same
109
- Change between active and archive do not alter the product digest; changing intent
110
- bytes does alter `intent_digest`. Missing or stale evidence remains
250
+ SHA-256, Git commit, product-worktree digest, ordered v2 task-evidence identities, and
251
+ strict aggregate-review packet, admission, subject, and summary bindings. Delivery
252
+ metadata and moving the same Change between active and archive do not alter the product
253
+ digest. The product-worktree digest has one fixed boundary: it excludes
254
+ `.ultra/evidence/**`, whose command and external-observation entries bind exact raw bytes
255
+ as `raw_evidence_sha256` before stable record bytes are bound as `evidence_digest`
256
+ through the ordered task-evidence projection. Test, Status, and Deliver independently
257
+ recompute both bindings from bounded stable repository-contained regular non-symlink
258
+ files; exact review receipts retain their own digest and consumer checks. No writer may
259
+ add a caller-selected exclusion. Changing intent bytes does alter `intent_digest`.
260
+ Missing or stale evidence remains
111
261
  `not_run`, `unknown`, or `stale`; it is never inferred as passing.
112
262
 
113
263
  ## Derived artifacts
@@ -119,26 +269,37 @@ These paths are intentionally non-authoritative:
119
269
  | `.ultra/research/<run-id>/brief.md` | optional Wayfinding question map for a multi-lens Research run | rebuild from Project Brief, accepted authority, evidence needs, and owner checkpoints |
120
270
  | `.ultra/.runtime/compact-snapshot.md` | compaction acceleration | rebuild from files and Git |
121
271
  | `.ultra/.runtime/delegations/` | delegated process receipts and logs | inspect result or rerun with new id |
272
+ | `.ultra/.runtime/handoffs/` | primary-transfer OFFER/ACK/RESULT receipts, plus the optional CLOSEOUT receipt of the one prescribed post-review closeout | create a fresh handoff id from canonical authority; never reconstruct an old ACK or RESULT; close out a newest completed v2 RESULT by publishing its CLOSEOUT receipt, never by refreshing the RESULT or opening a handoff for the closeout |
122
273
  | `.ultra/.runtime/worktrees/` | delegated checkout locations | inspect Git worktrees and remove safely |
123
274
  | `.ultra/progress/<task-id>.json` | mechanical evidence observations | rerun sensors or inspect current diff |
124
- | `.ultra/reviews/<session>/` | bounded lens packets and findings | rerun review at a named revision |
275
+ | `.ultra/reviews/<session>/` | `WORKER-PACKET.json`, `ADMISSION.json`, selected specialist artifacts, and `SUMMARY.json` | retain a current strict session through successful aggregate Test and Deliver consumption; after premature loss, run a fresh Review and Test and never reconstruct the old receipt |
125
276
 
126
277
  The canonical template's nested `.ultra/.gitignore` ignores `.runtime/`, `progress/`,
127
- and `reviews/` without rewriting the owner's repository-level ignore rules. Deleting
128
- those paths cannot delete accepted product intent, task contracts, or decisions.
278
+ and `reviews/` without rewriting the owner's repository-level ignore rules. A current
279
+ strict review session contains `WORKER-PACKET.json`, `ADMISSION.json`, every selected
280
+ specialist artifact, and `SUMMARY.json`; it may be garbage-collected only after aggregate Test and
281
+ Deliver have both consumed it successfully. Premature loss requires a fresh Review and
282
+ Test, never reconstruction of the old receipt. Subject to that retention window,
283
+ deleting derived paths cannot delete accepted product intent, task contracts, or
284
+ decisions.
129
285
 
130
286
  ## Recovery order
131
287
 
132
288
  After interruption or host change:
133
289
 
134
290
  1. identify the repository root and current `HEAD`;
135
- 2. resolve zero or one active `change_id`, then read `.ultra/tasks.json`;
291
+ 2. resolve zero or one active `change_id`, then read `.ultra/tasks.json`; if authority
292
+ resolution returns a typed conflict or unavailable observation, stop semantic writes
293
+ but keep Status recovery diagnosis reachable without selecting an ambiguous intent;
136
294
  3. select only matching tasks and read the frontier task's full context and closing Resume Note;
137
295
  4. read the Project Brief, accepted North Star, `CONTEXT.md`, relevant decisions, active
138
296
  Change, specifications, and evidence;
139
297
  5. inspect the working tree and compare it with Completion and evidence claims;
140
- 6. repair any ledger/context mismatch explicitly before relying on status;
141
- 7. continue through the next observable acceptance boundary.
298
+ 6. rely only on ledger task status; preserve any legacy context Status or Complexity as
299
+ a migration diagnostic, and use the explicit recorded reopen before repairing an
300
+ invalid completed task's current v2 evidence or task-review bindings;
301
+ 7. derive a fresh Route Card and continue only through the next observable acceptance
302
+ boundary covered by the current owner instruction or valid Execution Grant.
142
303
 
143
304
  Hooks and the `ubp` executable may be unavailable. Recovery must still work through
144
305
  these files and Git alone.