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/docs/DECISIONS.md CHANGED
@@ -1,8 +1,53 @@
1
- # Ultra Builder Pro v0.26 decisions
1
+ # Ultra Builder Pro decisions
2
2
 
3
3
  This file records durable product-level decisions that explain the current source tree.
4
4
  Project decisions created by Ultra belong in each project's `.ultra/decisions/`.
5
5
 
6
+ ## Ultra Core Protocol (3.0, accepted 2026-08-17; r3 revision same day)
7
+
8
+ The owner accepted `docs/ULTRA-BUILDER-PRO-3.0.zh-CN.md` and projected it as North
9
+ Star revision `north-star-v2-r2`
10
+ (`.ultra/decisions/2026-08-17-ultra-3-0-north-star-r2.md`), then converged the
11
+ constitution with the owner-directed r3 design
12
+ (`docs/ULTRA-BUILDER-PRO-3.0-NORTH-STAR-R3.zh-CN.md`) as revision
13
+ `north-star-v2-r3`
14
+ (`.ultra/decisions/2026-08-17-ultra-3-0-north-star-r3.md`). Ultra Builder Pro is
15
+ the file-first, provider-neutral Ultra Core Protocol: cognitive alignment through
16
+ checkpoints, per-fact canonical authority, explicit dual-mode authorization, typed
17
+ evidence with recovery, exclusive verified Agent handover, and review convergence
18
+ bounded by an owner-visible budget. The constitution itself stays count-free —
19
+ agent counts and topology detail, Host and Skill counts, provider names, and
20
+ exact review-round numbers live in the versioned product contract and exact
21
+ work-package grants. Authorization has two
22
+ modes — `session-local` by default, `durable work-package` when the owner issues an
23
+ exact grant (see `.ultra/decisions/2026-08-17-ultra-builder-pro-3.0-mode-b.md`); no
24
+ file, status, Hook, or Resume note ever implies activation. Optional Graph/Loop
25
+ coordination layers own observations only and none is integrated.
26
+
27
+ ## Primary transfer between Agents (r3, accepted 2026-08-17)
28
+
29
+ A work package's canonical writer moves to another Agent only through an
30
+ owner-granted primary transfer: the sender writes current reality into the task
31
+ context and Resume Note, derives an OFFER binding canonical refs/hashes, HEAD,
32
+ and the worktree digest, and stops writing after the receiver's ready ACK; the
33
+ receiver stable-reads, verifies every digest, becomes the sole canonical writer,
34
+ and freezes a terminal RESULT. Receipts under `.ultra/.runtime/handoffs/` are
35
+ derived and rebuildable, never authority; mismatches block instead of
36
+ auto-repairing; delegated workers stay mutually exclusive with this path and
37
+ never write canonical `.ultra`
38
+ (`.ultra/decisions/2026-08-17-ultra-3-0-r3-primary-handoff.md`,
39
+ `skills/ultra-change/references/primary-transfer.md`).
40
+
41
+ ## ZCode headless transport stays experimental (r3, accepted 2026-08-17)
42
+
43
+ The ZCode app-bundled CLI is a verified-local surface — it exists, launches, and
44
+ passed local drills — but the provider publishes no headless CLI, SDK, or
45
+ protocol stability contract. Its transport maturity is recorded `experimental`
46
+ in the shared host profile and compatibility matrix; promotion to `supported`
47
+ requires both official documentation and a full recovery drill. Interactive
48
+ Desktop use and the documented plugin surface are unaffected, and no adapter may
49
+ pass an app-internal binary off as an official stable interface.
50
+
6
51
  ## File-first authority
7
52
 
8
53
  Owner-readable repository files and Git are the complete semantic authority. Ultra
@@ -13,14 +58,58 @@ ownership of route and meaning.
13
58
 
14
59
  ## Three Skill roles
15
60
 
16
- The product exposes eight owner-invoked workflows, five model-invoked disciplines, and
17
- one router. Public workflows require explicit owner selection. A public workflow may
18
- recommend but never launch another public workflow. A model discipline needs at least
19
- two canonical callers or it is inlined.
61
+ The product exposes eight user workflows, five model-invoked disciplines, and one
62
+ router. Public workflows require explicit owner selection by default. Research, Plan,
63
+ Dev, Test, and Deliver reconciliation have one narrow exception: an activated
64
+ Change-scoped execution grant may let the model select the next covered workflow —
65
+ session-local activation in the current conversation, or a stably verified durable
66
+ work-package grant. A model discipline needs at least two canonical callers or it is
67
+ inlined.
20
68
 
21
69
  This keeps reusable reasoning in one place without turning it into another user-facing
22
70
  route or custom-agent registry.
23
71
 
72
+ ## Bounded same-session continuation
73
+
74
+ The stored grant text is descriptive authority, not an executable grant. Session-local
75
+ activation is a current owner utterance approving the exact grant and current task
76
+ ledger; a durable work-package grant is executable only after a fresh Agent stably
77
+ verifies its recorded subject, scope, topology, effects, budgets, expiry, revocation,
78
+ and invalidation. A fresh session without a durable grant, host change, lost
79
+ activation context, semantic stop, or budget ceiling pauses
80
+ the loop. Plan, task, and aggregate reviews remain mandatory. Delivery continuation is
81
+ reconcile-only; finalization, archive, authenticated providers, install, commit, push,
82
+ publish, and deploy remain separately authorized.
83
+
84
+ The native host model-tool loop performs the work. Existing files and Git carry
85
+ recovery; no route position, daemon, or extra semantic store is introduced.
86
+
87
+ ## Review topology is owner-selected
88
+
89
+ The owner chooses reviewer and provider count for each stage. The default is one reviewer:
90
+ the current Agent. An initial task review selects `review-spec` plus the
91
+ lenses justified by risk and touched seams; a delta review reruns only affected
92
+ lenses; an aggregate Change review may default to the full roster only when cross-task
93
+ wiring justifies it — never as a mandatory count or a quality proxy. Specification
94
+ fidelity owns both accepted-behavior mapping and the challenge to a Change's claimed
95
+ North Star contribution, with actual execution mode and coverage recorded. When
96
+ another model family is available, a blind premise challenger is an additional probe
97
+ rather than a voting lens.
98
+
99
+ The seeded 2026-08-14 evaluation found no consequential defect class uniquely caught
100
+ by a permanent premise lens: the strengthened specification lens, the six-concern Kimi
101
+ probe, and the ZCode specification probe each found all five hidden classes. Grok's
102
+ malformed terminal output was rejected and was not counted as semantic evidence. See
103
+ `docs/evals/adversarial-review-2026-08-14.md`.
104
+
105
+ ## ZCode activation uses documented plugin directories
106
+
107
+ ZCode receives a managed local marketplace for importability and a documented
108
+ `plugins.dirs` entry for immediate native discovery. Ultra owns only the entry it adds,
109
+ so reinstall is idempotent and uninstall preserves unrelated user configuration. It
110
+ does not write ZCode's private plugin cache or copy desktop provider credentials into
111
+ headless CLI configuration.
112
+
24
113
  ## Intake, baseline, and delta
25
114
 
26
115
  Init preserves raw owner intake in the Project Brief; Research establishes the accepted North Star, domain language, and specification baseline; Change reconciles only the sections touched by one requested delta.
@@ -47,14 +136,36 @@ Directory position and explicit fields record mechanically checkable facts. The
47
136
  model reads those facts and chooses the next route. There is no persisted “current
48
137
  workflow stage” whose value can override the actual files.
49
138
 
50
- Task status is written to both the ledger and context, then read back. Tasks retain a
51
- stable `change_id` in an append-only ledger; current readers select only rows matching
52
- the one active Change. Archive or abandonment is a `git mv`. Test-report freshness
53
- compares Change id, current task ids, intent digest, `git_commit`, and product-worktree
54
- digest with the current checkout. Deliver reconciles first and finalizes only while
55
- that complete snapshot remains current. A separate request cannot create a second
56
- active Change; it waits, exits the current Change, or is explicitly reconciled into the
57
- same id.
139
+ Task status lives only in the `ultra-task-ledger-v2` row and is read back there. New task
140
+ contexts do not duplicate it; legacy context Status and Complexity fields remain
141
+ migration diagnostics and the ledger wins. Tasks retain a stable `change_id` in the
142
+ append-only ledger; current readers select only rows matching the one active Change.
143
+ Archive or abandonment is a `git mv`. Test-report freshness is governed normatively by the complete v2 rule in [Artifact Authority](ARTIFACT-AUTHORITY.md#evidence-promotion).
144
+ That authority binds the current Change snapshot, ordered v2 task-evidence identities,
145
+ and strict aggregate-review packet, admission, subject, and summary bindings. This
146
+ decision intentionally does not maintain a second field mirror. Deliver reconciles
147
+ first and finalizes only while that complete snapshot remains current. A separate
148
+ request cannot create a second active Change; it waits, exits the current Change, or is
149
+ explicitly reconciled into the same id.
150
+
151
+ ## Typed task evidence and completion ordering
152
+
153
+ Current work uses `ultra-task-evidence-v2`. Command, inspection, owner-judgment, and
154
+ external-observation evidence retain distinct authorities; the owner alone can supply
155
+ an owner-judgment result. Structural validators report exact fields, identities,
156
+ digests, provenance, and freshness, never semantic acceptance. A task remains
157
+ `in_progress` through its task review. Blocking findings and their dispositions are
158
+ recorded and affected evidence is refreshed before the primary model writes
159
+ `completed` to the ledger. Historical v1 evidence remains readable but cannot satisfy a
160
+ current Change's Test or Deliver input without migration.
161
+
162
+ ## Counts are observations, not semantic gates
163
+
164
+ Task, file, line, context, question, finding, repair-round, and complexity counts do not
165
+ decide plan quality, review convergence, staleness, or completion. The model interprets
166
+ concrete coupling, evidence, risk, and recovery facts. Explicit physical ceilings such
167
+ as time, bytes, cost, provider spend, or bounded process resources still stop resource
168
+ consumption and return a typed recovery path; exhaustion never dispositions a finding.
58
169
 
59
170
  ## Three independent integration defences
60
171
 
@@ -76,10 +187,13 @@ their repair is authorization scoped to the exact command digest.
76
187
  ## Delegation is a process boundary
77
188
 
78
189
  `ubp delegate run` starts a supported CLI with an immutable instruction, explicit
79
- permission JSON, and named worktree. Files are the cross-host state. The parent reads a
80
- stable terminal result instead of worker chatter. Delegation adds no semantic store and
81
- no authority. The instruction selects task execution, scoped Research evidence, or
82
- aggregate Change review/verification; only task execution requires a task row.
190
+ permission JSON, and named worktree. Their exact digest-bound sources are embedded in
191
+ the worker prompt because some native sandboxes correctly deny reads outside the
192
+ worktree. Files remain the cross-host state; the embedded copy is transport, not another
193
+ authority. The parent reads a stable terminal result instead of worker chatter.
194
+ Delegation adds no semantic store and no authority. The instruction selects task
195
+ execution, scoped Research evidence, or aggregate Change review/verification; only task
196
+ execution requires a task row.
83
197
 
84
198
  ## Installation isolation
85
199
 
@@ -45,10 +45,36 @@ one or more.
45
45
 
46
46
  The agent never stops seeing the current steering contract. Before Research accepts a
47
47
  baseline, the session Hook injects the raw Project Brief fallback. After Research, it
48
- injects the accepted North Star: Project Direction, any settled North Star Outcome, and
49
- Hard Constraints. Current task acceptance is appended in both cases. The cost of
48
+ requires the exact field ``- Status: `accepted``` and injects the accepted North Star v2 `## Problem Reality`,
49
+ `## First-Principle Propositions`, `## North Star Outcomes`, and `## Hard Constraints`.
50
+ The complete selected sections have a 32 KiB SessionStart ceiling. Above it, the Hook
51
+ uses a reference-only fallback containing the canonical path, immutable accepted snapshot
52
+ path, revision, status, exact validated SHA-256 and byte length, and a direct-read
53
+ instruction that rejects different bytes as authority; semantic truncation is forbidden.
54
+ Brownfield fallback still reads the actual v0.26 `## Project Direction`, `## North Star
55
+ Outcome`, and `## Hard Constraints` shape, or the older `## One-line` shape, without
56
+ misreporting either as v2. Current task acceptance is appended in every case. The cost of
50
57
  repetition is always less than the cost of drift.
51
58
 
59
+ The publication choice is exact: inject a mechanically bound accepted North Star, otherwise use the Project Brief fallback or a recognized legacy shape.
60
+ When selected accepted sections exceed 32 KiB, use the reference-only path instead of
61
+ semantic truncation. A v2 file whose decision, digest, or immutable snapshot binding is
62
+ invalid is never labelled accepted session authority.
63
+ The Hook does not maintain a second accepted-publication grammar. It safely locates the
64
+ installed sibling Research validator and invokes that one JavaScript report through a
65
+ bounded argv-only subprocess. Missing Node.js, a missing validator, timeout, malformed or
66
+ oversized output, invalid UTF-8, and repository path escape all produce a typed repair
67
+ fallback rather than accepted authority. The report checks the complete mechanical
68
+ structure; it does not decide whether the accepted semantics are true or valuable.
69
+ North Star and Project Brief ingress share one bounded 8 MiB regular-file snapshot:
70
+ repository root, parent components, and file identity are recorded, symlink components
71
+ are rejected, and the canonical root-to-file chain is freshly reopened after the read.
72
+ Every accepted, reference-only, legacy, or Project Brief publication consumes only those
73
+ captured bytes. An unavailable Project Brief produces a typed repair note and is never
74
+ reread through an unbounded path API. This detects ordinary cooperative-workspace drift;
75
+ it is not a claim that a process can prevent malicious operating-system-level replacement.
76
+ The v0.26 legacy branch recognizes headings `## Project Direction`, `## North Star Outcome`, `## Hard Constraints` exactly.
77
+
52
78
  > **Test**: pick a random in-progress task, ask the agent "what's the acceptance criteria?" — if
53
79
  > it cannot answer in one sentence, this commandment is broken.
54
80
 
@@ -90,6 +116,30 @@ The agent always knows "how far from done." Each edit updates `.ultra/progress/<
90
116
  with evidence completeness across six dimensions. Final-gate audits are forbidden — if a gap
91
117
  matters at the end, it matters mid-flight.
92
118
 
119
+ Canonical task evidence uses `ultra-task-evidence-v2`: command, inspection,
120
+ owner-judgment, and external-observation retain distinct authorities, while the six
121
+ dimensions remain independent observations. The owner alone supplies an
122
+ owner-judgment result. Validators may check structure, identity, provenance, freshness,
123
+ and exact references; they never decide semantic acceptance. `.ultra/tasks.json` is the
124
+ sole task-status authority. A task remains `in_progress` through task review and becomes
125
+ `completed` only after blocking findings are resolved or authoritatively dispositioned
126
+ and affected evidence is refreshed. First-review admission uses the ledger, task
127
+ context, immutable packet, and actual pre-review evidence; the one final v2 record is
128
+ published only after its final review summary validates. Its `subject` is an independently
129
+ captured completion-snapshot freshness observation made after that validation and
130
+ immediately before evidence publication. Its `task_review` separately binds the retained strict summary; the summary does not prove the subject worktree digest. Aggregate Test
131
+ recomputes each command or external receipt's bounded stable bytes against
132
+ `raw_evidence_sha256`, then recomputes the exact record `evidence_digest`. The
133
+ product-worktree digest excludes `.ultra/evidence/**`; these separate raw and record
134
+ bindings make publication non-self-referential without making it invisible.
135
+ Aggregate Test
136
+ separately binds the current whole Change and rechecks current Acceptance, criterion and
137
+ verification type, review summary, owner record, and cited-artifact evidence. If later work
138
+ invalidates a completed task, Dev records affected criteria and reason in Change Log
139
+ and Resume Note before the explicit ledger `completed` to `in_progress` transition;
140
+ there is no silent demotion. Legacy context Status/Complexity and v1 evidence remain
141
+ honest migration diagnostics, not alternative truth.
142
+
93
143
  > **Scoped exception**: whole-system wiring audit (`ultra-test`) is necessarily terminal, because
94
144
  > "this export has no non-test importer" cannot be evaluated while later tasks are still pending.
95
145
  > It is a terminal **sensor**, never a gate: it reports and hands the trade-off to the owner.
@@ -187,15 +237,16 @@ Skill instruction. Do not touch it casually.
187
237
 
188
238
  | Consumer | Reads | Source of truth | Failure mode if drifted |
189
239
  |---|---|---|---|
190
- | `session_context` | North Star headings `## Project Direction`, `## North Star Outcome`, `## Hard Constraints`; Project Brief `## One-line`, or legacy North Star `## One-line` | `.ultra-template/north-star.md`, `.ultra-template/project-brief.md`, and the Hook's legacy-read branch | SessionStart shows no accepted North Star or Project Brief fallback; C1 dies |
191
- | `session_context` | unique active `change_id` → one matching `in_progress` task, else first dependency-ready `pending` task → its context | active Change directory plus `tasks.json[].change_id`, dependencies, status, and `context_file` | abandoned or blocked acceptance is injected, or current acceptance never surfaces |
240
+ | `session_context` | the canonical JavaScript North Star validation report; bound accepted v2 sections or the 32 KiB immutable-snapshot reference with exact validated SHA-256 and byte length, without semantic truncation; Project Brief `## One-line`; actual v0.26 `## Project Direction` / `## North Star Outcome` / `## Hard Constraints`; or older North Star `## One-line` | `skills/ultra-research/scripts/validate_north_star.cjs`, `.ultra-template/north-star.md`, `.ultra-template/project-brief.md`, accepted `.ultra/north-star.md`, its owner decision and immutable snapshot, and the validator's two legacy-read shapes | Python and JavaScript publication grammars diverge, SessionStart labels unbound or different bytes accepted, truncates steering semantics, or shows no honest Project Brief/legacy fallback; C1 dies |
241
+ | `session_context` | unique active `change_id` → one matching ledger `in_progress` task, else first dependency-ready ledger `pending` task → its context; legacy context Status/Complexity are diagnostics only | active Change directory plus `tasks.json[].change_id`, dependencies, sole status, and `context_file` | abandoned or blocked acceptance is injected, a legacy context overrides the ledger, or current acceptance never surfaces |
192
242
  | `mid_workflow_recall` | heading `## Acceptance Criteria` | `.ultra-template/contexts/TEMPLATE.md` | hook injects nothing; C1 dies silently |
193
243
  | `ultra-tdd` | path `references/templates/*` | `skills/ultra-tdd/references/templates/` | guidance points at a missing runnable alternative; C2 dies |
194
- | `post_edit_guard` | writes `.ultra/progress/<task-id>.json` for the active Change's current task | active Change directory plus `tasks.json[].change_id` and `id`, created on demand | historical work receives current observations; C4 weakens |
195
- | `ultra-dev` and `post_edit_guard` | 6 keys: `tests_written`, `tests_passed`, `persistence_real`, `feature_flags_audit`, `vertical_slice`, `spec_trace` | the six-dimension table in `skills/ultra-dev/SKILL.md` | sensor and workflow report different evidence |
244
+ | `post_edit_guard` | writes `.ultra/progress/<task-id>.json` for the active Change's current ledger task | active Change directory plus `tasks.json[].change_id`, `id`, and sole `status`, created on demand | historical work receives current observations or a Hook invents completion; C4 weakens |
245
+ | `ultra-dev` and `post_edit_guard` | 6 keys: `tests_written`, `tests_passed`, `persistence_real`, `feature_flags_audit`, `vertical_slice`, `spec_trace` | the six-dimension table in `skills/ultra-dev/SKILL.md` and typed evidence contract in `skills/ultra-plan/references/task-evidence-v2.md` | sensor and workflow report different evidence or a progress observation becomes semantic acceptance |
246
+ | plan/dev/review/test/deliver | ledger status; actual pre-review inputs; one final `ultra-task-evidence-v2` carrying an independent completion-snapshot freshness observation and separate task-review provenance; aggregate Test identity | `.ultra/tasks.json`, task context, immutable Review artifacts, and `skills/ultra-plan/references/task-evidence-v2.md` | first review requires its own final output, context becomes a second status authority, review provenance is claimed to prove the independent subject, task subject is rebound to a later aggregate worktree, or invalid evidence is silently demoted |
196
247
  | planning and status | marker `[NEEDS CLARIFICATION]` | `.ultra-template/specs/*.md` | unresolved product truth is hidden |
197
248
  | `ultra-plan` / `ultra-dev` / hooks | `trace_to` form `.ultra/specs/file.md#anchor` | `tasks.json[].trace_to` + GFM heading slugify | traces appear resolved when their heading is absent |
198
- | `ultra-deliver` / `ultra-status` | fields `change_id`, `task_ids`, `intent_digest`, `git_commit`, and `worktree.diff_digest` | `.ultra/test-report.json` plus `worktree_digest.cjs` | stale Change, intent, task set, or product results pass as current |
249
+ | `ultra-deliver` / `ultra-status` | root Change identity, ordered v2 task-evidence/review identities, and strict aggregate Review packet/admission/subject/summary bindings | `.ultra/test-report.json`, retained task evidence and Review artifacts, `worktree_digest.cjs`, and existing structural validators | stale Change, intent, task set, task evidence, Review transport, or product results pass as current |
199
250
  | `compact_context` | `.ultra/.runtime/compact-snapshot.md` | derived from canonical files and Git | compact recovery loses acceleration, not authority |
200
251
  | every hook | existence of `.ultra/` | the project directory | Ultra taxes projects that never opted in (see `docs/PLUGIN-ISOLATION-CONTRACT.md`) |
201
252
  | `ultra-init` | the project data skeleton | `.ultra-template/` and the exact file list in its Skill | later Skills read missing authority paths; C1 dies |
@@ -55,6 +55,12 @@ non-empty, modified, symlinked, or unowned path. Codex marketplace and Kimi regi
55
55
  files additionally remember whether Ultra created the registry itself, so an empty
56
56
  registry that existed before installation is retained.
57
57
 
58
+ ZCode publishes one managed local marketplace whose nested plugin is activated through
59
+ the host's documented `plugins.dirs` configuration. Install preserves unrelated ZCode
60
+ configuration, and uninstall removes only Ultra's exact directory entry and restores
61
+ the pre-install `plugins.enabled` value when that value has not since been changed by
62
+ the owner.
63
+
58
64
  ## Activation
59
65
 
60
66
  Owner-invoked Skills activate only through the host's explicit Skill surface.
@@ -1,6 +1,6 @@
1
1
  # Runtime compatibility matrix
2
2
 
3
- Ultra Builder Pro adapts one fourteen-Skill, five-hook contract to five native hosts.
3
+ Ultra Builder Pro adapts one fourteen-Skill, five-hook contract to six native hosts.
4
4
  This document records the differences that belong in adapters rather than shared
5
5
  Skills.
6
6
 
@@ -13,6 +13,7 @@ Skills.
13
13
  | OpenCode | `<config>/.ultra-builder-pro` plus `<config>/plugins/ultra-builder-pro.js` | managed `<config>/skills/<name>` | native JS events call shared Python scripts |
14
14
  | Kimi Code | `<config>/plugins/managed/ultra-builder-pro` plus `installed.json` | nested `skills/<name>` | `hooks/adapters/kimi.py` |
15
15
  | Grok Build | `<GROK_HOME>/.ubp/plugin-sources/ultra-builder-pro` | nested `skills/<name>` | `hooks/adapters/grok.py` |
16
+ | ZCode | `~/.zcode/cli/plugins/marketplaces/ultra-builder-pro/plugin` plus managed local marketplace and `plugins.dirs` entry | nested `skills/<name>` | `hooks/adapters/zcode.py` |
16
17
 
17
18
  Every host receives the same eight owner workflows, five model disciplines, and one
18
19
  router. Codex alone needs generated `agents/openai.yaml` files to express display data
@@ -27,12 +28,13 @@ and implicit-invocation policy; those are host metadata, not custom agents.
27
28
  | OpenCode | `${XDG_CONFIG_HOME:-~/.config}/opencode` | `<cwd>/.opencode` | `OPENCODE_CONFIG_DIR` or `OPENCODE_CONFIG` |
28
29
  | Kimi Code | `~/.kimi-code` | no project plugin scope | `KIMI_CODE_HOME` |
29
30
  | Grok Build | `~/.grok` | no project plugin scope | `GROK_HOME` |
31
+ | ZCode | `~/.zcode` | no project plugin scope | adapter `ZCODE_HOME` override |
30
32
 
31
33
  An explicit `--config-dir` wins over all defaults and becomes the home for any
32
34
  host-owned sidecar as well. This rule makes isolated installation tests trustworthy.
33
35
  With multiple selected runtimes, the CLI passes `<config-dir>/<runtime>` to each adapter
34
36
  instead of merging incompatible host layouts.
35
- Kimi and Grok currently expose user-scoped plugin installation only. `--local` rejects
37
+ Kimi, Grok, and ZCode currently expose user-scoped plugin installation only. `--local` rejects
36
38
  them before mutating another host; an explicit `--config-dir` remains available for an
37
39
  isolated user-scope installation test.
38
40
 
@@ -50,17 +52,19 @@ Kimi receives its native equivalent. Codex receives
50
52
  source frontmatter and native discovery, but its current Skill schema has no equivalent
51
53
  owner/model routing bit: all fourteen Skills remain discoverable and their descriptions
52
54
  guide model selection. Ultra does not add a semantic interception hook to imitate a
53
- host feature OpenCode does not expose.
55
+ host feature OpenCode does not expose. ZCode likewise discovers all plugin Skills and
56
+ relies on their portable descriptions plus the Change-scoped execution grant rather
57
+ than a fabricated routing flag.
54
58
 
55
59
  ## Hook compatibility
56
60
 
57
- | Hook | Claude | Codex | OpenCode | Kimi | Grok |
58
- |---|---:|---:|---:|---:|---:|
59
- | session context | yes | normalized | native bridge | normalized to message | executed; host stdout limits apply |
60
- | mid-workflow recall | yes | handles `apply_patch` | native bridge | normalized | executed |
61
- | compact context | pre/start | pre/post | native compact event | pre/post | pre-compact |
62
- | post-edit observation | Write/Edit | Write/Edit/`apply_patch` | write/edit/patch | Write/Edit | Write/Edit/patch |
63
- | dangerous command guard | Bash advisory/deny | Bash advisory/deny | bash advisory/deny | Bash advisory/deny | Bash allow/deny mapping |
61
+ | Hook | Claude | Codex | OpenCode | Kimi | Grok | ZCode |
62
+ |---|---:|---:|---:|---:|---:|---:|
63
+ | session context | yes | normalized | native bridge | normalized to message | executed; host stdout limits apply | normalized |
64
+ | mid-workflow recall | yes | handles `apply_patch` | native bridge | normalized | executed | handles `ApplyPatch` aliases |
65
+ | compact context | pre/start | pre/post | native compact event | pre/post | pre-compact | `SessionStart: compact` |
66
+ | post-edit observation | Write/Edit | Write/Edit/`apply_patch` | write/edit/patch | Write/Edit | Write/Edit/patch | Write/Edit/ApplyPatch |
67
+ | dangerous command guard | Bash advisory/deny | Bash advisory/deny | bash advisory/deny | Bash advisory/deny | Bash allow/deny mapping | Bash advisory/deny |
64
68
 
65
69
  All hooks share the same `.ultra/` idle guard. Wire adapters normalize payload and
66
70
  output fields only; they do not change semantic policy. Codex installation health and
@@ -81,14 +85,101 @@ until the user reviews and trusts the current definition, so Doctor reports
81
85
  - Kimi prompt mode with a launch-only read or write agent profile that exposes only
82
86
  file tools and no Bash, web, MCP, Skills or subagents;
83
87
  - Grok single-turn mode with `read-only` or `workspace` OS sandbox, structured output,
84
- no memory, web search or subagents.
88
+ no memory, web search or subagents, and a twelve-turn ceiling;
89
+ - ZCode headless prompt mode with native `plan` or `edit`; the current CLI accepts the
90
+ camel-case `--disallowedTools` surface used to deny Bash, web, subagents, and (in
91
+ read-only mode) write tools. The launcher's timeout remains the execution bound.
92
+
93
+ ZCode 0.16.3 advertises `--max-turns`, `--allowed-tools`, and `--settings` in help but
94
+ rejects them at the live root parser. Ultra therefore does not pass those flags. ZCode
95
+ headless delegation also requires an explicit CLI model provider; desktop provider
96
+ state is not silently copied into `~/.zcode/cli/config.json` because provider choice and
97
+ credentials remain owner-controlled.
98
+
99
+ On macOS, the shared host profile uses
100
+ `/Applications/ZCode.app/Contents/Resources/glm/zcode.cjs` when that App-bundled CLI
101
+ exists, then falls back to `zcode` on `PATH`. `UBP_DELEGATE_ZCODE_BIN` remains an explicit
102
+ test or operator override; the normal source-to-ZCode path does not require it.
103
+
104
+ **ZCode transport maturity is `experimental`** (recorded in
105
+ `adapters/_shared/host-profile.cjs`): the App-bundled CLI is a verified-local
106
+ surface — it exists, launches, and passed the 2026-08-14 conformance drills — but
107
+ the provider publishes no headless CLI, SDK, A2A, or ZCode Protocol stability
108
+ contract. Promotion to `supported` requires both official documentation and a
109
+ full recovery drill; a binary's existence, working help, or zero exit status is
110
+ never sufficient. The other five delegate transports are documented and locally
111
+ verified through the same launcher. The maturity is live-enforced, not just
112
+ recorded: `delegate run --to zcode` refuses to launch without the explicit
113
+ `--ack-experimental` flag, prints a stderr warning, and stamps
114
+ `transport_maturity`, the exact `transport_surface` wording, and
115
+ `experimental_ack: true` onto the receipt, worker spec, and every terminal
116
+ result (including failure, cancellation, and timeout), so no delegation record
117
+ can present an internal CLI run as the documented ZCode Desktop interactive
118
+ surface. The documented interactive primary path for ZCode is the Desktop task
119
+ surface itself, not this headless transport.
120
+
121
+ ### ZCode Desktop Workspace Memory (post-turn host effect)
122
+
123
+ ZCode Desktop ships an optional Workspace Memory feature that extracts project
124
+ memory after a completed turn into provider-local files under
125
+ `~/.zcode/cli/memories/projects/<project>/memory`. Corrected facts
126
+ (2026-08-17):
127
+
128
+ - the feature is operator-controlled through the documented Workspace Memory
129
+ setting (`memoryEnabled` in `~/.zcode/v2/setting.json`); it is not always
130
+ default-off — it was observed enabled on this machine, and a fresh task
131
+ inherits the operator's current selection;
132
+ - `memoryEnabled=false` is the single effective master gate: the App runtime
133
+ injects `memory:{enabled:false}`, and every recall, root access, and
134
+ post-turn extraction path resolves through one enabled-root resolver that
135
+ returns no root while it is false. The logged `memoryExtractionEnabled` and
136
+ `memoryUse` values are absent-key, disable-only defaults, not independent
137
+ owner-facing gates;
138
+ - the extracted files are ordinary local files outside the repository that the
139
+ operator can browse and clear directly; they are non-authoritative and
140
+ non-portable — never Git content, never shared authority, never Ultra
141
+ evidence;
142
+ - when the feature is enabled, the post-turn extraction is a Host external
143
+ effect: an owner-authorized transfer must allow it in the OFFER `effects`
144
+ and disclose it in the RESULT `external_effects`
145
+ (`skills/ultra-change/references/primary-transfer.md`); a strict
146
+ zero-external-effect pass requires a fresh task with the master setting off
147
+ plus an independent reviewer postflight;
148
+ - Ultra never parses or mutates the provider setting.
149
+
150
+ The accepted r3 design document's section 7.1 local-memory snapshot
151
+ ("local-only, default-off, cannot be browsed or cleared") is superseded by the
152
+ current documented UI and the observed runtime behavior above; the frozen
153
+ design bytes stay unedited.
85
154
 
86
155
  The launcher accepts no external-effect authority. It binds instruction, permission and
87
156
  output-schema digests, a clean Git worktree, allowed write roots, actual changed paths,
88
157
  strict result schema, timeout and cancellation. Empty roots select read-only mode. The
89
158
  model returns structured output and never authors the receipt. Host-native permissions
90
159
  are the execution boundary; the primary host still inspects and integrates the isolated
91
- diff.
160
+ diff. The launcher embeds the digest-bound packet in the prompt because OpenCode's
161
+ correct `external_directory: deny` policy prevents reading packet paths beside the
162
+ worktree. Codex receives a native-schema-compatible projection; the launcher separately
163
+ enforces non-empty strings, normalized unique paths, exact fields, and the observed diff.
164
+
165
+ ### Authenticated delegation conformance — 2026-08-14
166
+
167
+ One clean, read-only seeded repository was used to exercise the current launcher against
168
+ all six installed CLIs. Claude Code, Codex, OpenCode, Kimi Code, and ZCode each produced
169
+ a validated `finished` result with an empty diff and found the seeded consequential
170
+ defect. Grok Build 1.0.3 exited zero but repeatedly emitted truncated or malformed
171
+ structured output; the launcher correctly published `failed/missing_result` and did not
172
+ count partial text as evidence. This is a current host-result conformance ceiling, not a
173
+ permission bypass or a semantic review result.
174
+
175
+ ZCode was also exercised as the source host: one ZCode session invoked
176
+ `ubp delegate run --to claude`, waited for the terminal artifact, and reported Claude's
177
+ digest-bound read-only result without changing the worktree. Separately, one bounded
178
+ ZCode Autonomy Envelope completed Plan, Plan review, TDD, task review, Test, and aggregate
179
+ review for one task, then stopped before ungranted delivery and Git effects. Exact
180
+ fixtures, session boundaries, checks, and residual risks are recorded in
181
+ `docs/evals/adversarial-review-2026-08-14.md` and
182
+ `docs/evals/zcode-automation-2026-08-14.md`.
92
183
 
93
184
  ## Lifecycle verification
94
185
 
@@ -96,7 +187,9 @@ Each adapter must pass isolated install, doctor, reinstall, and uninstall tests.
96
187
  global doctor additionally asks the native host where supported, but never repairs or
97
188
  installs. Codex still performs native registration under `--config-dir`; its host process
98
189
  inherits the same isolated `HOME` and `CODEX_HOME`. Grok native registration is skipped
99
- only in explicit isolated test mode. Lifecycle tests also require the isolated config
190
+ only in explicit isolated test mode. ZCode uses its documented inline-plugin directory
191
+ configuration for immediate activation while also publishing an importable local
192
+ marketplace; real global Doctor verifies the native plugin inventory. Lifecycle tests also require the isolated config
100
193
  and fake HOME to contain zero children after uninstall, while separate ownership tests
101
194
  prove that pre-existing empty Codex and Kimi registries survive.
102
195
 
@@ -25,7 +25,8 @@ description: What this produces and the concrete situations that trigger it.
25
25
  ---
26
26
  ```
27
27
 
28
- Adapters generate Claude/Grok/Kimi invocation flags and Codex `agents/openai.yaml`.
28
+ Adapters generate Claude/Grok/Kimi invocation flags, Codex `agents/openai.yaml`, and
29
+ ZCode-native plugin metadata.
29
30
  Do not put host paths, dependency declarations, plugin policy, or release history in
30
31
  source frontmatter.
31
32
 
@@ -72,7 +73,7 @@ wholesale into project authority.
72
73
  ## Language and host neutrality
73
74
 
74
75
  Model-facing Skills, references, scripts, comments, and identifiers are English.
75
- Shared Skills never mention `.claude`, `.codex`, `.opencode`, `.kimi`, `.grok`, or a
76
+ Shared Skills never mention `.claude`, `.codex`, `.opencode`, `.kimi`, `.grok`, `.zcode`, or a
76
77
  host-only question surface. Use “host-native question surface” and put the translation
77
78
  in the adapter.
78
79
 
@@ -92,7 +93,7 @@ For every changed Skill:
92
93
 
93
94
  1. run the Skill Creator validator;
94
95
  2. resolve every relative reference in the source and installed artifact;
95
- 3. verify its role metadata on all five hosts;
96
+ 3. verify its role metadata on all six hosts;
96
97
  4. test the accepted workflow with representative valid and adversarial inputs;
97
98
  5. confirm no retired runtime vocabulary or host-specific path entered portable text.
98
99