ultra-builder-pro-cli 0.26.2 → 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 (67) hide show
  1. package/.ultra-template/contexts/TEMPLATE.md +64 -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 +163 -1
  6. package/README.md +108 -38
  7. package/adapters/_shared/host-profile.cjs +68 -12
  8. package/adapters/_shared/plugin-core.cjs +4 -5
  9. package/adapters/_shared/runtime-assets.cjs +11 -2
  10. package/adapters/zcode.js +375 -0
  11. package/bin/delegate-worker.cjs +20 -0
  12. package/bin/delegate.cjs +94 -25
  13. package/bin/install.js +11 -6
  14. package/docs/ARCHITECTURE.md +84 -23
  15. package/docs/ARTIFACT-AUTHORITY.md +167 -22
  16. package/docs/DECISIONS.md +131 -17
  17. package/docs/PHILOSOPHY.md +58 -7
  18. package/docs/PLUGIN-ISOLATION-CONTRACT.md +6 -0
  19. package/docs/RUNTIME-COMPAT-MATRIX.md +106 -13
  20. package/docs/SKILL-AUTHORING.md +4 -3
  21. package/docs/WORKFLOW-LIFECYCLE.md +126 -28
  22. package/docs/evals/adversarial-review-2026-08-14.md +84 -0
  23. package/docs/evals/zcode-automation-2026-08-14.md +103 -0
  24. package/hooks/README.md +27 -4
  25. package/hooks/_common.py +1678 -61
  26. package/hooks/adapters/zcode.py +227 -0
  27. package/hooks/compact_context.py +176 -17
  28. package/hooks/mid_workflow_recall.py +27 -5
  29. package/hooks/post_edit_guard.py +133 -23
  30. package/hooks/session_context.py +707 -22
  31. package/package.json +6 -3
  32. package/skills/ultra-change/SKILL.md +40 -9
  33. package/skills/ultra-change/references/change-contract.md +93 -27
  34. package/skills/ultra-change/references/execution-grant.md +109 -0
  35. package/skills/ultra-change/references/primary-transfer.md +273 -0
  36. package/skills/ultra-change/scripts/validate_primary_transfer.cjs +1928 -0
  37. package/skills/ultra-delegate/SKILL.md +24 -2
  38. package/skills/ultra-delegate/references/delegation-contract.md +21 -1
  39. package/skills/ultra-deliver/SKILL.md +85 -11
  40. package/skills/ultra-dev/SKILL.md +171 -41
  41. package/skills/ultra-grilling/SKILL.md +10 -7
  42. package/skills/ultra-grilling/references/reframing.md +7 -3
  43. package/skills/ultra-init/SKILL.md +44 -7
  44. package/skills/ultra-init/scripts/init_project.cjs +968 -21
  45. package/skills/ultra-plan/SKILL.md +70 -44
  46. package/skills/ultra-plan/references/task-evidence-v2.md +300 -0
  47. package/skills/ultra-plan/scripts/validate_task_evidence.cjs +859 -0
  48. package/skills/ultra-research/SKILL.md +38 -10
  49. package/skills/ultra-research/references/04-product-strategy.md +11 -2
  50. package/skills/ultra-research/references/21-features-scope.md +8 -0
  51. package/skills/ultra-research/references/22-success-metrics.md +4 -3
  52. package/skills/ultra-research/references/99-synthesis.md +19 -2
  53. package/skills/ultra-research/references/north-star-v2.md +168 -0
  54. package/skills/ultra-research/references/wayfinding.md +8 -0
  55. package/skills/ultra-research/scripts/validate_north_star.cjs +1174 -0
  56. package/skills/ultra-review/SKILL.md +201 -27
  57. package/skills/ultra-review/references/adversarial-evaluation.md +31 -0
  58. package/skills/ultra-review/references/spec.md +5 -0
  59. package/skills/ultra-review/references/unified-schema.md +146 -11
  60. package/skills/ultra-review/references/worker-packet.md +151 -8
  61. package/skills/ultra-review/scripts/review_wait.py +2653 -63
  62. package/skills/ultra-status/SKILL.md +95 -11
  63. package/skills/ultra-tdd/SKILL.md +11 -4
  64. package/skills/ultra-tdd/references/test-execution.md +6 -1
  65. package/skills/ultra-test/SKILL.md +145 -17
  66. package/skills/ultra-test/scripts/validate_review_transport.cjs +549 -0
  67. package/skills/ultra-test/scripts/worktree_digest.cjs +518 -30
package/bin/install.js CHANGED
@@ -4,13 +4,13 @@
4
4
  * ultra-builder-pro-cli — multi-runtime installer.
5
5
  *
6
6
  * Distributes fourteen Skills and five hooks to Claude Code, OpenCode, Codex CLI,
7
- * Kimi Code, and Grok Build through runtime-specific adapters under adapters/.
7
+ * Kimi Code, Grok Build, and ZCode through runtime-specific adapters under adapters/.
8
8
  * Install is idempotent and atomic; uninstall removes only managed assets.
9
9
  *
10
10
  * Usage:
11
11
  * npx ultra-builder-pro-cli [options]
12
12
  *
13
- * --claude / --opencode / --codex / --kimi / --grok select runtime(s)
13
+ * --claude / --opencode / --codex / --kimi / --grok / --zcode select runtime(s)
14
14
  * --all install to all supported runtimes
15
15
  * -g, --global install to runtime's global config dir
16
16
  * -l, --local project scope where the host supports it
@@ -57,7 +57,7 @@ function printBanner() {
57
57
  paint('cyan', ' ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝╚══════╝╚═╝'),
58
58
  '',
59
59
  ` ${paint('bold', 'Ultra Builder Pro CLI')} ${paint('dim', 'v' + pkg.version)}`,
60
- ` ${paint('dim', 'Multi-runtime installer for Claude Code, OpenCode, Codex, Kimi Code, and Grok Build')}`,
60
+ ` ${paint('dim', 'Multi-runtime installer for Claude Code, OpenCode, Codex, Kimi Code, Grok Build, and ZCode')}`,
61
61
  '',
62
62
  ];
63
63
  console.log(banner.join('\n'));
@@ -72,6 +72,7 @@ function printHelp() {
72
72
  ${paint('cyan', '--codex')} Codex CLI (OpenAI)
73
73
  ${paint('cyan', '--kimi')} Kimi Code (Moonshot AI)
74
74
  ${paint('cyan', '--grok')} Grok Build (xAI)
75
+ ${paint('cyan', '--zcode')} ZCode (Z.AI)
75
76
  ${paint('cyan', '--all')} all supported runtimes
76
77
 
77
78
  ${paint('yellow', 'Scope:')}
@@ -90,7 +91,7 @@ function printHelp() {
90
91
  ${paint('dim', '# Install to Claude Code globally')}
91
92
  npx ultra-builder-pro-cli --claude --global
92
93
 
93
- ${paint('dim', '# Install all five native plugins in their user scopes')}
94
+ ${paint('dim', '# Install all six native plugins in their user scopes')}
94
95
  npx ultra-builder-pro-cli --all --global
95
96
 
96
97
  ${paint('dim', '# Uninstall from OpenCode')}
@@ -102,6 +103,9 @@ function printHelp() {
102
103
  ${paint('dim', '# Install to Grok Build globally')}
103
104
  npx ultra-builder-pro-cli --grok --global
104
105
 
106
+ ${paint('dim', '# Install to ZCode globally')}
107
+ npx ultra-builder-pro-cli --zcode --global
108
+
105
109
  ${paint('dim', '# Verify all host installations without changing them')}
106
110
  npx ultra-builder-pro-cli --all --global --doctor
107
111
  `);
@@ -129,6 +133,7 @@ function parseArgs(argv) {
129
133
  case '--codex': runtimes.add('codex'); break;
130
134
  case '--kimi': runtimes.add('kimi'); break;
131
135
  case '--grok': runtimes.add('grok'); break;
136
+ case '--zcode': runtimes.add('zcode'); break;
132
137
  case '--all':
133
138
  SUPPORTED_RUNTIMES.forEach(r => runtimes.add(r));
134
139
  break;
@@ -213,13 +218,13 @@ async function main() {
213
218
  if (flags.json && !flags.doctor) bail('--json is available only with --doctor');
214
219
 
215
220
  if (runtimes.length === 0) {
216
- bail('no runtime selected; use --claude / --opencode / --codex / --kimi / --grok / --all');
221
+ bail('no runtime selected; use --claude / --opencode / --codex / --kimi / --grok / --zcode / --all');
217
222
  }
218
223
 
219
224
  const scope = resolveScope(flags);
220
225
  const repoRoot = path.resolve(__dirname, '..');
221
226
  const configDir = flags.configDir ? expandTilde(flags.configDir) : null;
222
- const userScopedOnly = runtimes.filter((runtime) => ['kimi', 'grok'].includes(runtime));
227
+ const userScopedOnly = runtimes.filter((runtime) => ['kimi', 'grok', 'zcode'].includes(runtime));
223
228
  if (scope === 'local' && !configDir && userScopedOnly.length) {
224
229
  bail(`${userScopedOnly.join(', ')} plugins are user-scoped by their hosts; use --global or an isolated --config-dir`);
225
230
  }
@@ -1,17 +1,20 @@
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
+ User-invoked Skill ──────── stops at the next owner boundary
15
18
  │
16
19
  ├── model-invoked disciplines (reasoning methods)
17
20
  ├── source / tests / runtime / primary documentation
@@ -35,8 +38,14 @@ Fourteen `skills/*/SKILL.md` files carry the workflow:
35
38
  - one read-only router.
36
39
 
37
40
  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.
41
+ are explicit by default. The narrow exception is an accepted Change-scoped `Execution
42
+ Grant` in one of two modes. `session-local`: Research, Plan, Dev, Test, and Deliver
43
+ reconciliation may be selected by the model only while the same session still contains
44
+ the owner's activation and approved task ledger; once that conversation activation is
45
+ lost, the work stops. `durable work-package`: a fresh Agent or host may continue one
46
+ exact work package, but only after stably verifying the recorded grant. Stored text
47
+ alone grants nothing, and neither mode grants finalization or archive; owner
48
+ checkpoints, final delivery effects, and every external effect still stop.
40
49
 
41
50
  Research's seventeen references are workflow-owned semantic lenses. Its optional
42
51
  `wayfinding.md` maps a multi-lens question without becoming a new Skill or authority.
@@ -51,21 +60,44 @@ Canonical semantic authority consists of:
51
60
  - `.ultra/north-star.md` for the accepted direction, outcome or metric decision, hard
52
61
  constraints, and exclusions established by Research;
53
62
  - `.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;
63
+ - `.ultra/changes/{active,archive,abandoned}/<id>/intent.md` for bounded outcomes, North
64
+ Star Trace, and a required Execution Grant (`session-local` and inert without current-
65
+ session activation by default) with one stable id across directory moves;
66
+ - append-only `.ultra/tasks.json` v2 rows carrying `change_id` and the sole task status,
67
+ plus each task's status-free `context_file`;
68
+ - `.ultra/decisions/*.md`, typed `.ultra/evidence/`, `.ultra/test-report.json`, and research;
58
69
  - repository-root `CONTEXT.md` for ubiquitous language;
59
70
  - Git for revision identity, history, moves, diff, and rollback.
60
71
 
61
72
  Each semantic fact has one canonical representation. A summary can point to authority,
62
73
  but cannot become a second authority merely because it is convenient to read.
74
+ Task status therefore lives only in `.ultra/tasks.json`. Legacy context Status and
75
+ Complexity fields are migration observations; readers report them and the ledger wins.
76
+ Current task evidence uses `ultra-task-evidence-v2`, whose typed command, inspection,
77
+ owner-judgment, and external-observation entries retain distinct authorities. Only the
78
+ owner can supply an owner-judgment result. Structural validators report exact facts and
79
+ never decide semantic acceptance. Command and external evidence store a safe
80
+ repository-relative raw ref plus `raw_evidence_sha256`; structural validation does not
81
+ open that ref. Dev binds bounded stable ordinary non-symlink receipt bytes before record
82
+ publication, while Test, Status, and Deliver recheck the raw digest and then the exact
83
+ record `evidence_digest`. The product-worktree digest excludes `.ultra/evidence/**`, so
84
+ evidence publication cannot invalidate the freshness value it records.
63
85
 
64
86
  One primary host model writes this authority in a worktree. Native subagents are
65
87
  read-only sensors; delegated CLIs write isolated non-`.ultra` roots and return receipts.
66
88
  Sequential Changes share the ledger by stable id, while current readers filter by the
67
89
  one unique active Change. This keeps concurrency explicit in Git instead of adding a
68
- semantic lock service or workflow engine.
90
+ semantic lock service or workflow engine. When the canonical writer itself changes
91
+ Agent, an owner-granted primary transfer moves the role exclusively — a derived
92
+ OFFER binding canonical refs/hashes, HEAD, and worktree digest; a receiver ACK that
93
+ is ready only on full stable-read match; sole-writer execution; a frozen terminal
94
+ RESULT — with receipts under `.ultra/.runtime/handoffs/` kept as rebuildable
95
+ observations and delegated workers never acquiring canonical write authority
96
+ (`skills/ultra-change/references/primary-transfer.md`).
97
+
98
+ Autonomous coding uses the host's existing model-tool loop, one canonical writer, and
99
+ the same task/evidence/review files. Ultra adds no persisted route position: budgets are
100
+ hard ceilings, while the model interprets whether acceptance and stop conditions hold.
69
101
 
70
102
  ### Adaptation plane
71
103
 
@@ -77,14 +109,14 @@ semantic lock service or workflow engine.
77
109
  - atomic managed installation, provenance, doctor, and uninstall behavior.
78
110
 
79
111
  `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.
112
+ mechanics. `host-profile.cjs` owns the six non-interactive delegation argv contracts.
81
113
  Adapters never rewrite workflow meaning.
82
114
 
83
115
  ### Why the old Agents are Skill assets now
84
116
 
85
117
  The retired custom-agent files did not own product authority. They contained reusable
86
118
  review lenses, debugging, test execution, and review coordination. v0.26 keeps those
87
- methods on the common surface all five hosts actually share:
119
+ methods on the common surface all six hosts actually share:
88
120
 
89
121
  - six review workers map to `ultra-review/references/{code,design,errors,tests,spec,comments}.md`;
90
122
  - review coordination and the former general code reviewer map to the parent
@@ -99,9 +131,14 @@ the parent model runs the same references sequentially.
99
131
  ### Observation plane
100
132
 
101
133
  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.
134
+ under `.ultra/.runtime/` and `.ultra/progress/`, and review artifacts under
135
+ `.ultra/reviews/`, are derived rather than semantic authority. A current strict review
136
+ session contains `WORKER-PACKET.json`, `ADMISSION.json`, every selected specialist
137
+ artifact, and `SUMMARY.json`; retain it until aggregate Test and Deliver have both consumed it
138
+ successfully, then it may be garbage-collected. Premature loss requires a fresh Review
139
+ and Test; never reconstruct the old receipt. The dangerous-command hook is the only
140
+ hard effect guard; it classifies a small named destructive set and provides an
141
+ exact-command authorization repair.
105
142
  Additive protected-branch publication remains advisory when portable host wiring cannot
106
143
  project a trusted owner-approval receipt; history rewrites and branch deletion remain
107
144
  guarded.
@@ -109,16 +146,20 @@ guarded.
109
146
  ## Completion and recovery
110
147
 
111
148
  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.
149
+ public seam. Route/schema/UI shells, local unit green, or an edited ledger status are not
150
+ end-to-end evidence by themselves. A task remains `in_progress` through its task review;
151
+ only after blocking findings are resolved or authoritatively dispositioned and affected
152
+ v2 evidence is refreshed may the primary model write `completed` to the ledger.
114
153
 
115
154
  Every user Skill starts by reading:
116
155
 
117
156
  1. zero or one active `change_id`, diagnosing more than one;
118
- 2. `.ultra/tasks.json` tasks whose `change_id` matches it;
157
+ 2. `.ultra/tasks.json` tasks whose `change_id` matches it, treating that ledger as the
158
+ sole task-status authority;
119
159
  3. the matching frontier task's `context_file` and closing `## Resume Note`;
120
160
  4. `CONTEXT.md` and relevant decisions;
121
- 5. the active Change, specifications, evidence, and current Git state.
161
+ 5. the active Change, specifications, current v2 task evidence and retained task-review
162
+ provenance, and current Git state.
122
163
 
123
164
  That same sequence works after compaction, a fresh process, disabled hooks, or a host
124
165
  change. Compact snapshots can accelerate recovery but never outrank the source files.
@@ -132,7 +173,8 @@ Three independent Skills protect the vertical path:
132
173
  2. `ultra-dev` records six separate evidence dimensions, including real persistence,
133
174
  default-on behavior, vertical execution, and spec trace.
134
175
  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.
176
+ binds the result to Change id, task ids, intent, HEAD, product-worktree digest, exact
177
+ raw receipt SHA-256 values, and the containing task-evidence digests.
136
178
 
137
179
  These are independent sensors. None rewrites a finding into product truth.
138
180
 
@@ -157,6 +199,25 @@ to make delegation reachable.
157
199
  Delegation does not grant authority or copy semantic state into another store. The
158
200
  worker reads and writes the same repository files in the specified worktree.
159
201
 
202
+ ## Optional Graph/Loop control plane
203
+
204
+ Long-running, multi-Agent, cross-Host work can justify an external coordination
205
+ layer (for example a LoopX-style kernel) that owns goal/todo identity, claims and
206
+ leases, attention queues, quotas, human-gate records, handoff receipts, and
207
+ append-only run/effect observations. Such a layer is **optional and currently not
208
+ integrated**: no adapter, dependency, daemon, or scaffold for one ships in this
209
+ package, and the Ultra Core Protocol remains fully usable on files plus Git with
210
+ every optional layer absent.
211
+
212
+ The boundary is fixed regardless of future integration: the control plane may
213
+ observe and coordinate — it may never own the North Star, product meaning,
214
+ acceptance, semantic severity, architecture or scope decisions, a "quality is
215
+ sufficient" verdict, or the authority to start an unauthorized Agent. Enabling it
216
+ requires a real coordination problem the owner accepts (multi-session parallel
217
+ frontiers, claim/write conflicts, long external waits, explicit quotas, cross-Host
218
+ handoff) plus an adapter with a live consumer; deleting or disabling it must always
219
+ leave canonical project truth and human recovery intact.
220
+
160
221
  ## Deliberate absences
161
222
 
162
223
  The architecture does not include:
@@ -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,82 @@ 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 scope, budget, and allowed workflows;
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
+ A formal terminal outcome — an accepted result, an owner decision, an external
46
+ blocker, a review-budget stop, or an abandonment — outranks every Resume, Hook, or
47
+ Status suggestion that appears to continue the same work. Review stays inside the
48
+ budget accepted for the work package, under one precedence rule: an exact current
49
+ owner grant overrides the versioned product default — the released default is one
50
+ initial Review plus two P0/P1 delta Reviews. Budget exhaustion with a remaining
51
+ blocker returns the choice to the owner instead of another round; no Agent,
52
+ reviewer, Hook, or control plane extends a budget itself, and the same root
53
+ surviving three failed fixes stops point-patching and reports an architecture
54
+ problem.
55
+
56
+ ## Effect classes
57
+
58
+ Every action belongs to exactly one class, and the class fixes who may perform it:
59
+
60
+ | Effect class | Examples | Default rule |
61
+ |---|---|---|
62
+ | `observation` | read-only source inspection, search, test listing | an Agent may act freely inside its task scope |
63
+ | `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 |
64
+ | `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 |
65
+ | `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 |
66
+
67
+ A durable work-package grant may cover exact `local-reversible` execution and the
68
+ canonical status writes it names explicitly. It never inherits
69
+ `external-or-irreversible` effects by default; those require the owner to list each
70
+ one in the grant and the consuming Agent to verify the listing is current.
71
+
72
+ ## Owner checkpoint semantics
73
+
74
+ Every owner-facing checkpoint — the WIP at a stop, a task's closing Resume Note, a
75
+ delivery report, or a review's owner handoff — answers eight fixed semantics, in
76
+ whatever length keeps the owner able to judge:
77
+
78
+ 1. **Why** — the real problem being solved.
79
+ 2. **Outcome** — what difference the owner will see.
80
+ 3. **Accepted boundary** — what is accepted, and what explicitly is not.
81
+ 4. **Delta** — what materially changed since the last checkpoint.
82
+ 5. **Reality** — how far the live path actually works; what is still fake, unknown,
83
+ or unverified.
84
+ 6. **Decision needed** — what the owner must decide now; omit the section when
85
+ nothing is genuinely blocking.
86
+ 7. **Next bounded action** — the smallest authorized next step.
87
+ 8. **Not done** — what remains owed when stopping or pausing.
88
+
89
+ A checkpoint is a cognitive interface, not a mechanical stage marker: no line count,
90
+ token budget, or coverage percentage gates it, and alignment failure ("I don't know
91
+ what you are doing", or the same concept re-explained repeatedly) stops execution and
92
+ review until the owner re-accepts an outcome.
93
+
15
94
  ## Canonical artifacts
16
95
 
17
96
  | Artifact | Canonical content | Primary writer | Required readers | Staleness or conflict signal |
@@ -24,11 +103,12 @@ them, how staleness is detected, and how recovery works in Ultra Builder Pro v0.
24
103
  | `.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
104
  | `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
105
  | `.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 |
106
+ | `.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 |
107
+ | 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
108
  | `.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 |
109
+ | 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 |
110
+ | `.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 |
111
+ | `.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
112
  | `.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
113
  | `.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
114
 
@@ -43,19 +123,47 @@ never becomes current merely because of its status. Before an abandoned move,
43
123
  evidence, and recovery or successor. Future Change reconciliation and Status consume
44
124
  that record as history, not as accepted current intent.
45
125
 
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.
126
+ Every current completed task has exactly one final
127
+ `.ultra/evidence/<task-id>/evidence.json` with schema `ultra-task-evidence-v2`. The
128
+ canonical field and type contract lives in
129
+ `skills/ultra-plan/references/task-evidence-v2.md`; this document does not duplicate it.
130
+ The record binds the task and Change, context acceptance bytes, typed acceptance
131
+ evidence and dispositions, all six evidence dimensions,
132
+ task-review provenance, artifacts, limitations, and timestamp. `command`, `inspection`,
133
+ `owner-judgment`, and `external-observation` retain separate evidence authorities. The
134
+ owner alone supplies an owner-judgment result. The CLI establishes only JSON shape,
135
+ token syntax, and authority designation; it does not prove current identity, provenance,
136
+ freshness, or semantic acceptance. Test takes stable bytes independently, recomputes the
137
+ Acceptance-section SHA-256, aligns exact criterion IDs and verification types with the
138
+ 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
139
+ evidence publication. Its `task_review` separately binds the retained strict summary.
140
+ Worker Packet v1 and its summary's null `worktree_digest` do not prove or
141
+ cryptographically bind the completion subject. Test separately binds its report to the
142
+ current whole Change, then rechecks the current Acceptance, criterion IDs and verification
143
+ types, owner record, review summary, and cited affected artifacts instead of demanding
144
+ digest equality with the earlier task observation.
145
+ For `owner-judgment`, the durable owner record must exist and its cited statement and
146
+ disposition must remain readable. Any mismatch is an evidence gap returned to Dev or,
147
+ for missing owner judgment, to the owner. Optional raw logs live beside the record and
148
+ do not create another summary. Historical v1 records stay readable evidence but produce
149
+ a migration diagnostic and cannot satisfy a current Change's Test or Deliver input.
150
+
151
+ Task-review provenance has two discriminated branches with one authority rule: a
152
+ strict-v4 record binds its retained strict session artifacts, while an
153
+ `external-manual` record binds a real external-reviewer receipt under
154
+ `.ultra/evidence/<task-id>/` by exact stable bytes and SHA-256 through the task
155
+ evidence sensor's verify mode. The external receipt is a reconstructable observation
156
+ of reviewer identity, reviewed subject, verdict, and exact findings — never semantic
157
+ authority, never owner acceptance, and never a substitute strict
158
+ SUMMARY/ADMISSION/session. Consumers recheck whichever branch a record declares and
159
+ never rewrite one into the other.
52
160
 
53
161
  ## Mutable workflow state
54
162
 
55
163
  Pure file state uses three mechanisms:
56
164
 
57
165
  - directory position, such as `changes/active/` versus `changes/archive/`;
58
- - an explicit field, such as a task or context status;
166
+ - an explicit field, such as task status in `.ultra/tasks.json`;
59
167
  - an on-the-spot model judgment that is not persisted as state.
60
168
 
61
169
  A state field records a mechanically checkable fact. Route selection remains a model
@@ -66,9 +174,22 @@ request and after delivery; completed current tasks may remain active while awai
66
174
  Test or Deliver. More than one active directory is a conflict for owner/model repair,
67
175
  not a reason for code to select the first entry.
68
176
 
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.
177
+ Task status has one writer and one authority: `.ultra/tasks.json`. New contexts carry no
178
+ Status field. A legacy context Status or Complexity header is preserved as a migration
179
+ diagnostic, but the ledger wins. During implementation the row remains `in_progress`.
180
+ Task-review admission uses that row, task context, an immutable review packet, and
181
+ actual pre-review evidence; it does not require the final record it is helping create.
182
+ After the final summary validates, Dev writes the one canonical evidence record with
183
+ every blocking finding, resolution or authoritative disposition, and affected evidence
184
+ refresh. Only after that record and the context review facts are current may the primary
185
+ model write `completed` to the ledger and read the row back. A validator may check this
186
+ ordering and its references; it cannot decide that a finding is semantically resolved.
187
+
188
+ Later invalidation uses one explicit recovery edge. The ledger-authoritative row changes
189
+ from `completed` to `in_progress`; Dev must never silently demote it. Before the write,
190
+ Dev records the affected criterion IDs and reason in the task context Change Log and Resume Note.
191
+ It preserves the old frozen review as history, then writes and reads back the ledger
192
+ transition. New evidence and review close the task again through the same path.
72
193
 
73
194
  ## Single-writer boundary
74
195
 
@@ -79,6 +200,14 @@ Parallel implementation uses separate worktrees and explicit Git integration. Ul
79
200
  does not add a lock service or semantic state machine to make concurrent canonical
80
201
  writes appear safe.
81
202
 
203
+ The primary writer of a work package changes only through an owner-granted primary
204
+ transfer (`skills/ultra-change/references/primary-transfer.md`): a derived OFFER
205
+ binding canonical refs/hashes, HEAD, and worktree digest; a receiver ACK that is
206
+ ready only on full stable-read match; sole-writer execution; and a frozen terminal
207
+ RESULT. A delegated worker never becomes the canonical writer, and a delegation
208
+ receipt never serves as an ACK or RESULT. While an ACK-ready transfer is open, at
209
+ most that one receiver may write canonical files.
210
+
82
211
  ## Decisions and reductions
83
212
 
84
213
  Write a durable decision only when it is difficult to reverse, surprising without
@@ -105,9 +234,17 @@ into a second semantic ledger.
105
234
 
106
235
  A test result is current only for the code and environment it exercised. A report must
107
236
  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
237
+ SHA-256, Git commit, product-worktree digest, ordered v2 task-evidence identities, and
238
+ strict aggregate-review packet, admission, subject, and summary bindings. Delivery
239
+ metadata and moving the same Change between active and archive do not alter the product
240
+ digest. The product-worktree digest has one fixed boundary: it excludes
241
+ `.ultra/evidence/**`, whose command and external-observation entries bind exact raw bytes
242
+ as `raw_evidence_sha256` before stable record bytes are bound as `evidence_digest`
243
+ through the ordered task-evidence projection. Test, Status, and Deliver independently
244
+ recompute both bindings from bounded stable repository-contained regular non-symlink
245
+ files; exact review receipts retain their own digest and consumer checks. No writer may
246
+ add a caller-selected exclusion. Changing intent bytes does alter `intent_digest`.
247
+ Missing or stale evidence remains
111
248
  `not_run`, `unknown`, or `stale`; it is never inferred as passing.
112
249
 
113
250
  ## Derived artifacts
@@ -119,13 +256,19 @@ These paths are intentionally non-authoritative:
119
256
  | `.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
257
  | `.ultra/.runtime/compact-snapshot.md` | compaction acceleration | rebuild from files and Git |
121
258
  | `.ultra/.runtime/delegations/` | delegated process receipts and logs | inspect result or rerun with new id |
259
+ | `.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
260
  | `.ultra/.runtime/worktrees/` | delegated checkout locations | inspect Git worktrees and remove safely |
123
261
  | `.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 |
262
+ | `.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
263
 
126
264
  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.
265
+ and `reviews/` without rewriting the owner's repository-level ignore rules. A current
266
+ strict review session contains `WORKER-PACKET.json`, `ADMISSION.json`, every selected
267
+ specialist artifact, and `SUMMARY.json`; it may be garbage-collected only after aggregate Test and
268
+ Deliver have both consumed it successfully. Premature loss requires a fresh Review and
269
+ Test, never reconstruction of the old receipt. Subject to that retention window,
270
+ deleting derived paths cannot delete accepted product intent, task contracts, or
271
+ decisions.
129
272
 
130
273
  ## Recovery order
131
274
 
@@ -137,7 +280,9 @@ After interruption or host change:
137
280
  4. read the Project Brief, accepted North Star, `CONTEXT.md`, relevant decisions, active
138
281
  Change, specifications, and evidence;
139
282
  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;
283
+ 6. rely only on ledger task status; preserve any legacy context Status or Complexity as
284
+ a migration diagnostic, and use the explicit recorded reopen before repairing an
285
+ invalid completed task's current v2 evidence or task-review bindings;
141
286
  7. continue through the next observable acceptance boundary.
142
287
 
143
288
  Hooks and the `ubp` executable may be unavailable. Recovery must still work through