ultra-builder-pro-cli 0.18.0 → 0.20.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 (44) hide show
  1. package/CHANGELOG.md +54 -1
  2. package/README.md +16 -27
  3. package/adapters/_shared/interaction-contract.cjs +26 -4
  4. package/adapters/claude.js +3 -1
  5. package/adapters/kimi.js +4 -30
  6. package/adapters/opencode.js +50 -14
  7. package/commands/ultra-research.md +1 -1
  8. package/docs/AGENT-CONTEXT.md +23 -34
  9. package/docs/ARCHITECTURE.md +26 -12
  10. package/docs/DECISIONS.md +12 -8
  11. package/docs/LEGACY-CLI-CROSSWALK.md +9 -7
  12. package/docs/PLUGIN-ISOLATION-CONTRACT.md +54 -0
  13. package/docs/ROADMAP.md +5 -5
  14. package/docs/RUNTIME-COMPAT-MATRIX.md +26 -25
  15. package/docs/STATE-DB-ACCESS-POLICY.md +1 -1
  16. package/docs/WORKFLOW-LIFECYCLE.md +45 -25
  17. package/hooks/active_task_context.py +1 -1
  18. package/hooks/context_spine.py +1 -1
  19. package/hooks/health_check.py +19 -0
  20. package/hooks/pre_stop_check.py +1 -1
  21. package/hooks/workflow_checkpoint.py +1 -1
  22. package/hooks/workflow_context.py +1 -1
  23. package/hooks/workflow_resume.py +1 -1
  24. package/mcp-server/lib/decision-dialogue.cjs +84 -11
  25. package/mcp-server/lib/doctor.cjs +2 -1
  26. package/mcp-server/lib/state-db.cjs +143 -13
  27. package/mcp-server/lib/workflow-state.cjs +4 -4
  28. package/mcp-server/server.cjs +24 -8
  29. package/package.json +3 -4
  30. package/skills/ultra-change/SKILL.md +16 -8
  31. package/skills/ultra-init/SKILL.md +2 -1
  32. package/skills/ultra-plan/SKILL.md +20 -3
  33. package/skills/ultra-research/SKILL.md +25 -15
  34. package/skills/ultra-test/SKILL.md +5 -2
  35. package/skills/ultra-think/SKILL.md +2 -0
  36. package/skills/ultra-think/references/decision-dialogue.md +47 -11
  37. package/spec/cli-protocol.md +1 -0
  38. package/spec/mcp-tools.yaml +30 -3
  39. package/spec/schemas/state-db.sql +7 -4
  40. package/ultra-tools/cli.cjs +1 -1
  41. package/ultra-tools/commands/status.cjs +2 -1
  42. package/adapters/_shared/handbook.cjs +0 -569
  43. package/bin/handbook.js +0 -107
  44. package/docs/USER-HANDBOOK-CONTRACT.md +0 -120
@@ -51,7 +51,7 @@ the supported hosts share.
51
51
  | Layer | Role | Form |
52
52
  |--------------|----------------------------------------------|-------------------------------------------------------|
53
53
  | **skill** | knowledge carrier; tells the runtime *what to do* | `skills/<name>/SKILL.md` discovered natively by all supported runtimes |
54
- | **MCP** | authoritative workflow-state, decision, and Context Spine API | stdio MCP server exposing 50 live tools across task/session/baseline/change/decision/workflow/system/plan families in [`spec/mcp-tools.yaml`](../spec/mcp-tools.yaml) |
54
+ | **MCP** | authoritative workflow-state, decision, and Context Spine API | stdio MCP server exposing 51 live tools across task/session/baseline/change/decision/workflow/system/plan families in [`spec/mcp-tools.yaml`](../spec/mcp-tools.yaml) |
55
55
  | **CLI** | explicit initialization, recovery, diagnostics, and orchestration | `ultra-tools` / `ubp-orchestrator`; only commands listed by `--help` are executable (see [`spec/cli-protocol.md`](../spec/cli-protocol.md)) |
56
56
 
57
57
  Why three: skills give us behavior portability across runtimes; MCP gives
@@ -91,7 +91,7 @@ covers twenty-one tables:
91
91
  | `event_consumers` | durable monotonic consumer cursors | 8C |
92
92
  | `workflow_runs` | init/research/plan/change/dev/test/review/deliver run authority, position, blockers, approval, and derived summary | 13 |
93
93
  | `workflow_steps` | ordered step state, evidence, decisions, immutable output paths, and recorded SHA-256 digests | 13 |
94
- | `decision_threads` | baseline/change/workflow-bound owner-agent alignment, interaction mode, normalized summary, and checkpoint authority | 16 |
94
+ | `decision_threads` | baseline/change/workflow-bound owner-agent alignment, interaction mode, normalized completion, and optional checkpoint authority | 16/19 |
95
95
  | `decision_items` | one-at-a-time owner choices, evidence, recommendations, durable effects, resolutions, delegation, deferral, and supersession history | 16 |
96
96
 
97
97
  Two rules make this work:
@@ -141,9 +141,13 @@ same authoritative state shape without rewriting application code.
141
141
 
142
142
  Initialization completes after local authority, classification, Git/scaffold setup,
143
143
  and read-back verification. It does not start or complete research. An explicit
144
- `ultra-research` invocation then records the model-selected semantic coverage and
145
- executes, verifies, or reuses only the evidence needed to converge the baseline.
146
- Omitted catalog areas create no workflow row.
144
+ `ultra-research` invocation lets the model inspect evidence and recommend a semantic
145
+ route. The owner selects, modifies, delegates, or defers through the host-native
146
+ question surface unless current intent already resolves the route. The normalized
147
+ accepted coverage is then recorded, and research executes, verifies, or reuses only
148
+ the evidence needed to converge the baseline. Omitted catalog areas create no
149
+ workflow row. MCP validates the stored state and evidence, not the preceding user
150
+ interaction.
147
151
 
148
152
  Auto initialization preserves an existing Git repository and HEAD. When Git is absent,
149
153
  it initializes `main`, adds the symlink-safe `.ultra` rule to `.gitignore`, and persists
@@ -193,12 +197,13 @@ alternatives, evidence refs, and durable effects; a partial unique index guarant
193
197
  current question per thread. The host ends that turn and waits.
194
198
 
195
199
  The next response becomes a normalized owner decision, explicit reversible delegation,
196
- or consequence-bearing deferral. Prompts and transcripts are never persisted. A coherent
197
- cluster moves through prepare/confirm checkpointing, which binds an owner-approved
198
- decision digest to the current specification, Change Contract, alignment, or plan artifact.
199
- Matching workflow steps and completion fail closed until the checkpoint is confirmed.
200
- Supersession preserves prior history and reopens alignment instead of silently editing an
201
- old decision. The shared procedure lives in
200
+ or consequence-bearing deferral. Prompts and transcripts are never persisted. Routine
201
+ settled state closes through `decision.complete`, which is lifecycle completion rather
202
+ than another approval. Only a coherent cluster that needs an artifact-bound recovery
203
+ boundary moves through prepare/confirm checkpointing. Matching workflow steps fail
204
+ closed while a blocking question, blocking deferral, prepared checkpoint, or stale
205
+ checkpoint artifact remains. Supersession preserves prior history and reopens alignment
206
+ instead of silently editing an old decision. The shared procedure lives in
202
207
  `skills/ultra-think/references/decision-dialogue.md`; status, breadcrumb, and doctor expose
203
208
  only the current recovery surface.
204
209
 
@@ -246,7 +251,8 @@ snapshot as an output; test, review, and delivery reports carry its digest forwa
246
251
 
247
252
  `change.breadcrumb` derives the compact current position from state.db. Session,
248
253
  edit, resume, and OpenCode lifecycle hooks invoke one bundled read-only reader
249
- and inject only this breadcrumb, never the intent body,
254
+ and inject it only while state.db proves an active, blocked, or ready workflow,
255
+ never the intent body,
250
256
  provider content, or a conversation summary. A changed Git HEAD, task contract, or
251
257
  Change semantic authority marks the snapshot stale and permits recompilation through
252
258
  `change.context`.
@@ -257,6 +263,14 @@ baseline/change ownership, and transaction boundaries, then persists them. It
257
263
  does not call Anthropic, OpenAI, or another model provider and needs no separate
258
264
  model API credential.
259
265
 
266
+ Plugin installation does not activate a semantic workflow and never edits the
267
+ user's `CLAUDE.md`, `AGENTS.md`, or equivalent durable instructions. Public
268
+ workflows require explicit user invocation. A completed workflow returns
269
+ mechanically allowed transitions and a host-owned recommendation, then stops;
270
+ it never launches the next public workflow. OpenCode realizes this boundary
271
+ with explicit commands backed by private plugin workflow assets, while Claude,
272
+ Codex, and Kimi use their native implicit-invocation controls.
273
+
260
274
  File count, token estimate, and context-share overflow produce warnings, never a
261
275
  refusal. The agent may narrow reads, load files lazily, or split a slice when that
262
276
  preserves correctness; it must not raise a threshold merely to clear a gate or
package/docs/DECISIONS.md CHANGED
@@ -9,8 +9,8 @@ release-version authority.
9
9
 
10
10
  | Layer | Owns | Must not own |
11
11
  |---|---|---|
12
- | User intent | Goals, acceptance, non-goals, material product trade-offs, risk acceptance, and authorization for irreversible or external effects | Facts that the current checkout or runtime can establish directly |
13
- | Host model | Classification, investigation, research coverage, solution design, task decomposition, context, test and review strategy, documentation impact, and next-action recommendations | Fabricated evidence, bypassed authorization, or durable lifecycle state |
12
+ | User intent | Goals, acceptance, non-goals, semantic route selection, material product trade-offs, risk acceptance, and authorization for irreversible or external effects | Facts that the current checkout or runtime can establish directly |
13
+ | Host model | Classification and route recommendations, investigation, solution design, task decomposition, context, test and review strategy, documentation impact, intent normalization, and next-action recommendations | Fabricated evidence, bypassed authorization, or durable lifecycle state |
14
14
  | Ultra MCP | IDs, state, digests, provenance, freshness, locks, leases, transactions, recovery, and legal state transitions | Product direction, a fixed research route, technology selection, or business decisions |
15
15
  | Host adapter | Native Skill discovery, user-question surfaces, tool invocation, installation, and runtime wiring | A second project-state authority |
16
16
  | Hook | Lifecycle observation, compact DB-derived context, recovery hints, and generated-projection protection | Ordinary development blocking or semantic route selection |
@@ -22,15 +22,19 @@ external memory, and code-graph payloads are not Ultra authority.
22
22
  ## Research coverage
23
23
 
24
24
  The research references form an optional semantic catalog. The host model
25
- selects only the areas justified by the current goal and evidence, records an
26
- evidence-based selection reason, and always includes synthesis. Omitted catalog
27
- areas create no workflow rows. An explicit `not_applicable` or accepted
28
- `deferred` entry is recorded only when preserving that exclusion is useful.
25
+ inspects current evidence and recommends the smallest sufficient route. The
26
+ owner selects, modifies, delegates, or defers that route through the current
27
+ host's native question surface unless current intent already resolves it. The
28
+ host then normalizes and records the accepted coverage with an evidence-based
29
+ rationale and synthesis. Omitted catalog areas create no workflow rows. An
30
+ explicit `not_applicable` or accepted `deferred` entry is recorded only when
31
+ preserving that exclusion is useful.
29
32
 
30
33
  MCP validates generic invariants: selected identifiers must exist, dispositions
31
34
  must be legal, reused or excluded evidence must be referenced, synthesis must be
32
35
  active, and at least one non-synthesis area must be applicable. MCP does not
33
- choose the coverage set.
36
+ choose the coverage set or prove how the owner answered. Once normalized intent
37
+ is written, `.ultra/state.db` treats it as current cross-session authority.
34
38
 
35
39
  ## Lifecycle boundaries
36
40
 
@@ -70,6 +74,6 @@ release, deployment, or destructive effect.
70
74
  - Runtime architecture: [`ARCHITECTURE.md`](./ARCHITECTURE.md)
71
75
  - Workflow state and invalidation: [`WORKFLOW-LIFECYCLE.md`](./WORKFLOW-LIFECYCLE.md)
72
76
  - Host compatibility: [`RUNTIME-COMPAT-MATRIX.md`](./RUNTIME-COMPAT-MATRIX.md)
73
- - User handbook projection: [`USER-HANDBOOK-CONTRACT.md`](./USER-HANDBOOK-CONTRACT.md)
77
+ - Plugin and user-instruction boundary: [`PLUGIN-ISOLATION-CONTRACT.md`](./PLUGIN-ISOLATION-CONTRACT.md)
74
78
  - MCP interface: [`../spec/mcp-tools.yaml`](../spec/mcp-tools.yaml)
75
79
  - Database contract: [`../spec/schemas/state-db.sql`](../spec/schemas/state-db.sql)
@@ -24,14 +24,14 @@ contract and adds stronger authority, recovery, or portability.
24
24
  | Original capability | Current implementation | Compatibility result |
25
25
  |---|---|---|
26
26
  | Init gathers project facts, creates Ultra files, and establishes Git | `task.init_project` performs deterministic classification, scaffold, schema, Git bootstrap, read-back verification, and then stops | Preserved and strengthened. Init has its own completion boundary and never starts research implicitly. |
27
- | Complete product and architecture research | `ultra-research` retains the semantic reference catalog while the model selects only applicable areas and records execute/verify/reuse/not-applicable/deferred dispositions as needed | Preserved without questionnaire overload. Necessary reports, typed semantic records, source digests, and material decision checkpoints add durable evidence. |
27
+ | Complete product and architecture research | `ultra-research` retains the semantic reference catalog while the model recommends evidence-relevant coverage and the owner selects, modifies, delegates, or defers the route | Preserved without questionnaire overload. Accepted dispositions, necessary reports, typed semantic records, source digests, and optional material decision checkpoints add durable evidence. |
28
28
  | Planning converts accepted research into executable work with dependencies | `ultra-plan` persists complete change-owned task contracts and an exact dependency graph | Preserved and strengthened with topology, acceptance coverage, public seams, verification commands, and plan digests. |
29
29
  | Development uses isolated Git work, TDD, verification, review, commit, and integration | `ultra-dev`, `session.*`, and the session runner create real worktrees and retain task/review/commit evidence | Preserved and strengthened. Process exit cannot complete a task; uncommitted or unintegrated worktrees cannot be deleted. |
30
30
  | Test checks wiring, acceptance, regression, build, performance, security, and failures | `ultra-test` emits a change-bound immutable report covering each applicable dimension | Preserved and strengthened with HEAD, context, task-set, and report-digest validation. |
31
31
  | Review challenges specification fidelity and engineering quality | `ultra-review` is a first-class stage with independent specification and engineering axes | Strengthened. A coordinated summary cannot replace either complete axis. |
32
32
  | Delivery verifies clean readiness, documentation, build, and evidence | `ultra-deliver` requires current tasks, test, review, learning resolution, reconciliation, a local archive, and an immutable report | Preserved and strengthened. Publish, deploy, push, and other external effects remain separate explicitly authorized operations. |
33
33
  | Status restores the current workflow position | `ultra-status` reads DB authority, Git, sessions, artifacts, decisions, allowed transitions, and any hard recovery requirement | Strengthened. The host recommends the semantic route; projections and Prompt prose cannot override state. |
34
- | Thinking synchronizes owner and Agent intent | `ultra-think` plus `decision.*` persists one-question dialogue and artifact checkpoints | Strengthened. Observable facts are resolved first; only load-bearing owner choices block. |
34
+ | Thinking synchronizes owner and Agent intent | `ultra-think` plus `decision.*` persists one-question dialogue, non-ceremonial completion, and optional artifact checkpoints | Strengthened. Observable facts are resolved first; only load-bearing owner choices block. |
35
35
 
36
36
  ## CLI-original capabilities
37
37
 
@@ -73,8 +73,9 @@ metadata references.
73
73
  ## Reference capability paths and gates
74
74
 
75
75
  These paths show common capability order and hard prerequisites. They are not a
76
- single mandatory pipeline: the host selects among MCP-reported allowed transitions,
77
- while MCP requires one route only for a unique mechanical recovery invariant.
76
+ single mandatory pipeline: the model recommends among MCP-reported allowed
77
+ transitions, while the owner selects or delegates the semantic route. MCP requires one
78
+ route only for a unique mechanical recovery invariant.
78
79
 
79
80
  ### New repository
80
81
 
@@ -83,7 +84,7 @@ task.init_project
83
84
  -> greenfield classification
84
85
  -> Git bootstrap when absent
85
86
  -> init read-back and completion
86
- -> explicit full research with model-selected coverage
87
+ -> explicit full research with a model-recommended, owner-selected route
87
88
  -> selected execute/verify/reuse work and synthesis
88
89
  -> owner-authorized local checkpoint commit when Git is unborn
89
90
  -> baseline.record
@@ -99,7 +100,7 @@ task.init_project
99
100
  -> brownfield classification and selected scope
100
101
  -> preserve current Git HEAD and dirty-state evidence
101
102
  -> init read-back and completion
102
- -> explicit adoption research with model-selected coverage
103
+ -> explicit adoption research with a model-recommended, owner-selected route
103
104
  -> characterization verification + known-red/gap ledger
104
105
  -> baseline.record + owner approval
105
106
  -> baseline.converge
@@ -122,7 +123,8 @@ doctor/migrate with backup
122
123
  status
123
124
  -> change intent capture
124
125
  -> material alignment only when unresolved
125
- -> host-selected bounded research, plan, current dev work, think, or status
126
+ -> model-recommended, owner-selected or delegated bounded research, plan,
127
+ current dev work, think, or status
126
128
  -> session.spawn creates the real task worktree
127
129
  -> red/green/verify/review
128
130
  -> local task commit and verified integration
@@ -0,0 +1,54 @@
1
+ # Plugin Isolation Contract
2
+
3
+ Ultra Builder Pro is an explicitly invoked, removable workflow plugin. Installation
4
+ must not change a user's durable engineering policy or initialize any repository.
5
+
6
+ ## Owned surfaces
7
+
8
+ An adapter may write only:
9
+
10
+ - the host's plugin-owned command, skill, worker, hook, and runtime directories;
11
+ - the host registry or manifest entries required to load those assets;
12
+ - the plugin's own provenance and managed-file markers.
13
+
14
+ The first command allowed to create project authority is `ultra-init`. Once invoked,
15
+ Ultra owns only the repository-local `.ultra/` authority and its generated projections.
16
+
17
+ ## Surfaces Ultra does not own
18
+
19
+ Install, update, doctor, and uninstall must not create, rewrite, trim, merge, or delete:
20
+
21
+ - user-level `CLAUDE.md`, `AGENTS.md`, or equivalent instruction files;
22
+ - repository-level instruction files;
23
+ - project source, Git history, remotes, or `.ultra/` data;
24
+ - memory or code-graph provider data.
25
+
26
+ Existing Ultra marker blocks in a user handbook are legacy user content after this
27
+ contract takes effect. They are not silently removed because the plugin cannot prove
28
+ ownership or preserve unrelated edits. The owner may review and remove them separately.
29
+
30
+ ## Activation
31
+
32
+ Public Ultra workflows run only after an explicit user command or skill invocation.
33
+ Completion of one workflow may return allowed transitions and a recommendation, but it
34
+ must not start another public workflow.
35
+
36
+ Host adapters prevent implicit model activation with the strongest native mechanism:
37
+
38
+ - Claude Code and Kimi Code mark public workflow skills as model-disabled;
39
+ - Codex marks workflow metadata as implicit-invocation-disabled;
40
+ - OpenCode exposes public workflows through commands backed by private plugin assets,
41
+ not through the model-discoverable skill catalog.
42
+
43
+ Internal review-rule skills remain available only to their bounded workers.
44
+
45
+ ## Idle behavior
46
+
47
+ Outside a repository containing `.ultra/state.db`, all Ultra hooks are silent. Inside
48
+ an initialized repository they remain silent unless a DB-authoritative workflow is
49
+ active, blocked, or ready. The sole idle-time enforcement is protection against direct
50
+ writes to generated Ultra projections; the DB remains authoritative.
51
+
52
+ Installation tests preserve byte-for-byte snapshots of all supported user handbook
53
+ paths. Runtime tests cover explicit activation, idle silence, active recovery, and
54
+ projection protection.
package/docs/ROADMAP.md CHANGED
@@ -49,25 +49,26 @@ sharing one authoritative workflow store.
49
49
  | 12 | Repository evidence snapshots + gap ledger + migration re-adoption + incident governance | ✅ done |
50
50
  | 13 | Durable init-to-delivery workflows + task execution contracts + immutable stage evidence | ✅ done |
51
51
  | 16 | Resumable one-question owner-agent decisions + artifact checkpoints + workflow gates | ✅ done |
52
+ | 19 | Non-ceremonial decision completion + four-host semantic-selection contract | ✅ done |
52
53
  | 9 | Release pipeline | npm tag publishing live; Homebrew / pip not implemented |
53
54
 
54
55
  ## What is in the repo today
55
56
 
56
57
  ```
57
58
  spec/ ← Phase 1 single source of truth
58
- ├── mcp-tools.yaml (50 live tools across 8 families)
59
+ ├── mcp-tools.yaml (51 live tools across 8 families)
59
60
  ├── cli-protocol.md (CLI ↔ MCP mapping table)
60
61
  ├── schemas/ (state-db.sql + 4 JSON schemas)
61
62
  ├── fixtures/{valid,invalid}/ (+ v4.4-project for migration)
62
63
  └── scripts/test-all.cjs (npm run test:spec — 7 validation stages)
63
64
 
64
65
  mcp-server/ ← Phase 2 authoritative state layer
65
- ├── server.cjs (stdio MCP server, 50 task/session/baseline/change/decision/workflow/system/plan tools)
66
+ ├── server.cjs (stdio MCP server, 51 task/session/baseline/change/decision/workflow/system/plan tools)
66
67
  ├── lib/
67
68
  │ ├── state-db.cjs (SQLite + WAL + pragmas)
68
69
  │ ├── state-ops.cjs (full write API, status state machine)
69
70
  │ ├── baseline-workflow.cjs (project adoption + approval + reconciliation)
70
- │ ├── decision-dialogue.cjs (one-question authority + checkpoint gates)
71
+ │ ├── decision-dialogue.cjs (one-question authority + completion/checkpoint gates)
71
72
  │ ├── workflow-state.cjs (ordered stage runs, evidence, output digests, and gates)
72
73
  │ └── projector.cjs (state.db → tasks.json + context md)
73
74
  └── tests/ (npm run test:state)
@@ -80,7 +81,6 @@ ultra-tools/ ← CLI fallback, migration, and diagnostics
80
81
  └── legacy-memory.cjs (explicit inspect/archive/confirmed prune)
81
82
 
82
83
  bin/install.js ← multi-runtime installer
83
- bin/handbook.js ← explicit bounded or full host-native handbook sync
84
84
  adapters/ ← native Claude/OpenCode/Codex plugin builders
85
85
  skills/ ← allowlisted Ultra workflows, internal rules, and collab companions
86
86
  hooks/ ← 7 executable workflow hooks + shared Context Spine helper; OpenCode uses native JavaScript hooks
@@ -89,7 +89,7 @@ docs/
89
89
  ├── ARCHITECTURE.md Phase 1 single-page entry point
90
90
  ├── WORKFLOW-LIFECYCLE.md baseline classification + DB transition contract
91
91
  ├── AGENT-CONTEXT.md Phase 3 canonical runtime context contract
92
- ├── USER-HANDBOOK-CONTRACT.md bounded/full CLAUDE.md / AGENTS.md contract
92
+ ├── PLUGIN-ISOLATION-CONTRACT.md install, activation, idle, and ownership contract
93
93
  ├── RUNTIME-COMPAT-MATRIX.md Phase 4 runtime capability matrix
94
94
  ├── STATE-DB-ACCESS-POLICY.md Phase 2 multi-process write contract
95
95
  ├── COMMIT-HASH-BACKFILL.md Phase 2.8 two-commit completion flow
@@ -15,10 +15,10 @@ not installed.
15
15
  |---|---|---|---|---|
16
16
  | Package form | `.claude-plugin` native plugin | native config bundle + JS plugin | personal `.codex-plugin` | managed `kimi.plugin.json` plugin |
17
17
  | Public entry | `/ultra-*`, `/learn` | `/ultra-*`, `/learn` | `$ultra-builder-pro:<skill>` | `/ultra-builder-pro:<command>` |
18
- | Public Ultra workflows | 12 | 12 | 12 | 12 |
18
+ | Public Ultra workflows | 12, model invocation disabled | 12 commands backed by private workflow assets | 12, implicit invocation disabled | 12, model invocation disabled |
19
19
  | Internal agent-rule skills | 4, non-user-facing | 4, non-user-facing | 4 with implicit invocation disabled | 4, consumed by review workers |
20
20
  | Collaboration companions | `codex-collab`, `ultra-verify` | `cc-collab`, `codex-collab`, `ultra-verify` | `cc-collab`, `ultra-verify` | `cc-collab`, `codex-collab`, `ultra-verify` |
21
- | Host bootstrap | native plugin context | native plugin context | native plugin context | `using-ultra-builder-pro` session-start skill |
21
+ | Automatic workflow bootstrap | N/A | N/A | N/A | N/A |
22
22
  | External browser/deploy/framework skills | N/A | N/A | N/A | N/A |
23
23
 
24
24
  Codex converts workflows into namespaced skills and records eleven legacy
@@ -46,21 +46,17 @@ not presented as nonexistent custom agents.
46
46
 
47
47
  | Lifecycle | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
48
48
  |---|---|---|---|---|
49
- | Session context/health | FULL, DB-derived Context Spine breadcrumb on native `SessionStart` | FULL, the native JS plugin invokes the same bundled DB breadcrumb reader; health via `system.doctor` | FULL, DB-derived breadcrumb on native `SessionStart` | FULL, DB-derived breadcrumb via session-start skill + hooks |
49
+ | Session context/health | FULL, active-workflow breadcrumb on native `SessionStart` | FULL, native JS plugin injects only an active-workflow breadcrumb; health via `system.doctor` | FULL, active-workflow breadcrumb on native `SessionStart` | FULL, active-workflow breadcrumb via native hooks |
50
50
  | Active edit boundary | FULL, `PreToolUse Edit|Write` | FULL, `tool.execute.before` rejects projection writes | FULL, `PreToolUse Edit|Write|apply_patch` | FULL, native `PreToolUse Edit|Write` deny contract |
51
51
  | Pre-compact checkpoint | FULL | FULL | FULL | FULL, native `PreCompact` |
52
52
  | Post-compact context injection | FULL | FULL, native compacting context | FULL, native `PostCompact` restore | DEGRADED; checkpoint restoration runs, but Kimi 0.26/0.27 does not reinject fire-and-forget hook text |
53
53
  | Stop lifecycle advisory | FULL, native non-blocking `Stop` | N/A, no equivalent stop event needed | FULL, native non-blocking `Stop` | FULL, native non-blocking `Stop` |
54
54
  | Subagent lifecycle evidence | FULL | DEGRADED, no equivalent packaged event | FULL | FULL, native `SubagentStart` / `SubagentStop` |
55
55
 
56
- Kimi's session bootstrap therefore also instructs recovery to inspect
57
- `.ultra/runtime/checkpoint.json` and call Ultra status/doctor after compaction.
58
- This keeps durable recovery intact without claiming dynamic context injection
59
- that the host does not guarantee.
60
-
61
- Health/context hooks inspect initialized projects; projection protection also
62
- applies at baseline, while compact/stop/subagent enforcement remains
63
- active-workflow scoped. No host receives prompt capture, transcript capture,
56
+ Health/context, compact, stop, and subagent hooks remain silent unless
57
+ `.ultra/state.db` proves an active, blocked, or ready workflow. Projection
58
+ protection applies to every initialized project because generated projections
59
+ must never become a second authority. No host receives prompt capture, transcript capture,
64
60
  observation journaling, session-summary memory, generic command blocking, or
65
61
  generic post-edit policy.
66
62
  Baseline-adoption and context-budget warnings are injected as advisory context;
@@ -71,7 +67,8 @@ they do not deny edits or stop active incident work.
71
67
  | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
72
68
  |---|---|---|---|---|
73
69
  | stdio MCP registration | plugin `.mcp.json` | `opencode.json` local MCP entry | plugin `.mcp.json` | plugin `mcpServers` entry |
74
- | Live/declared contracts | 50 | 50 | 50 | 50 |
70
+ | Live/declared contracts | 51 | 51 | 51 | 51 |
71
+ | Structured user alignment | `AskUserQuestion` in interactive sessions | `question` when permission is not denied | `request_user_input` when the current mode exposes it | `AskUserQuestion` outside auto mode |
75
72
  | Greenfield/brownfield baseline adoption | FULL | FULL | FULL | FULL |
76
73
  | Context Manifest v3 / breadcrumb | FULL | FULL, same bundled read-only DB reader as every hook | FULL | FULL |
77
74
  | Approval-gated spec learning | FULL | FULL | FULL | FULL |
@@ -79,30 +76,34 @@ they do not deny edits or stop active incident work.
79
76
  | Durable authority | project `.ultra/state.db` | project `.ultra/state.db` | project `.ultra/state.db` | project `.ultra/state.db` |
80
77
  | Ultra memory API | N/A | N/A | N/A | N/A |
81
78
 
82
- All 50 `task.*`, `session.*`, `baseline.*`, `change.*`, `decision.*`, `workflow.*`, `system.*`, and `plan.*` operations
79
+ All 51 `task.*`, `session.*`, `baseline.*`, `change.*`, `decision.*`, `workflow.*`, `system.*`, and `plan.*` operations
83
80
  registered by `mcp-server/server.cjs` are live. Review, impact discovery, skill
84
81
  loading, and user interaction remain host-native surfaces.
85
82
 
83
+ When a native structured question surface is unavailable, the shared interaction
84
+ contract permits one concise direct question only if ordinary conversation is still
85
+ available. A host mode that forbids interaction leaves the choice unanswered; Ultra
86
+ does not infer consent or silently delegate the semantic route.
87
+
86
88
  Kimi starts plugin MCP processes with the managed plugin root as `cwd`. The
87
89
  generated launcher recovers the project from the inherited `PWD`, sets
88
90
  `UBP_ROOT_DIR` and `UBP_DB_PATH`, and refuses to start if that project boundary
89
91
  cannot be established. On POSIX it intentionally uses `env node` because Kimi
90
92
  0.26/0.27's embedded Node ABI differs from the ABI used to install `better-sqlite3`.
91
93
 
92
- ## 5. User handbook presentation
94
+ ## 5. User instruction isolation
93
95
 
94
96
  | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
95
97
  |---|---|---|---|---|
96
98
  | Durable user file | `~/.claude/CLAUDE.md` | `~/.config/opencode/AGENTS.md` | `~/.codex/AGENTS.md` | `~/.kimi-code/AGENTS.md` |
97
99
  | Automatic overwrite by plugin install | no | no | no | no |
98
- | Explicit managed-block sync | `ubp-handbook apply --runtime claude` | `ubp-handbook apply --runtime opencode` | `ubp-handbook apply --runtime codex` | `ubp-handbook apply --runtime kimi` |
99
- | Explicit complete-handbook convergence | `--full --confirm TOKEN` | `--full --confirm TOKEN` | `--full --confirm TOKEN` | `--full --confirm TOKEN` |
100
- | Backup before change | FULL | FULL | FULL | FULL |
100
+ | Writer shipped by Ultra | N/A | N/A | N/A | N/A |
101
+ | Uninstall removes user instructions | no | no | no | no |
101
102
 
102
- The Kimi plugin installer does not edit `~/.kimi-code/config.toml`. Handbook
103
- sync remains a separate, previewable action so user policy and plugin mechanics
104
- do not become one irreversible mutation. Full mode is a semantic host rendering,
105
- not a product-name or path substitution.
103
+ The Kimi plugin installer also does not edit `~/.kimi-code/config.toml`. Durable
104
+ user preferences belong to each host and remain outside Ultra's ownership.
105
+ Legacy Ultra handbook text is not proof of plugin ownership and is never
106
+ silently rewritten or removed.
106
107
 
107
108
  ## 6. Install, update, and uninstall
108
109
 
@@ -134,9 +135,9 @@ records. Uninstall refuses an unmanaged or conflicting root.
134
135
 
135
136
  | Capability | Contract |
136
137
  |---|---|
137
- | Current state schema | `18.0` |
138
+ | Current state schema | `19.0` |
138
139
  | Runtime values | `claude`, `opencode`, `codex`, `kimi` |
139
- | Upgrade from earlier schema | preserves runtime rows, adds Context Spine state through 10.0, authoritative baseline adoption in 11.0, repository evidence in 12.0, durable workflows in 13.0, continuous baseline revalidation in 14.0, typed research semantics and verified reconciliation in 15.0, resumable owner-agent decision threads and workflow alignment gates in 16.0, explicit unborn-Git authority in 17.0, then adaptive transitions and legacy workflow normalization in 18.0 |
140
+ | Upgrade from earlier schema | preserves runtime rows, adds Context Spine state through 10.0, authoritative baseline adoption in 11.0, repository evidence in 12.0, durable workflows in 13.0, continuous baseline revalidation in 14.0, typed research semantics and verified reconciliation in 15.0, resumable owner-agent decision threads and workflow alignment gates in 16.0, explicit unborn-Git authority in 17.0, adaptive transitions and legacy workflow normalization in 18.0, then non-ceremonial decision completion in 19.0 |
140
141
  | Preservation gate | rows, IDs, indexes, foreign keys, telemetry, incidents, and migration history remain intact |
141
142
  | Failure behavior | rollback; no partially upgraded authority database |
142
143
 
@@ -151,8 +152,8 @@ records. Uninstall refuses an unmanaged or conflicting root.
151
152
  skills and generic/memory hooks from re-entering a package.
152
153
  - `tests/retired-runtime.test.cjs` prevents retired runtime code or prompt text
153
154
  from re-entering active product surfaces.
154
- - `adapters/_shared/tests/handbook.test.cjs` verifies bounded and full host
155
- rendering, external-provider block preservation, backup, migration, and idempotency.
155
+ - `adapters/_shared/tests/plugin-isolation.test.cjs` and `tests/install.test.cjs`
156
+ verify the absence of a handbook writer and byte-preservation of all user instruction files.
156
157
  - `adapters/_shared/tests/provenance.test.cjs` verifies normalized manifests,
157
158
  content hashes, source attribution, corruption handling, and contract drift.
158
159
  - `tests/install.test.cjs` verifies healthy four-host doctor output and
@@ -74,7 +74,7 @@ resolve the mount/runtime constraint before retrying.
74
74
  | `baselines` | MCP server (`baseline.start` / `baseline.record` / `baseline.converge`); initialization and legacy-projection migration may create only the first draft or compatibility row |
75
75
  | `tasks` | MCP server (`task.create` / `task.update` / `task.delete`) |
76
76
  | `changes` | MCP server (`change.create` / `change.update` / `change.converge` / `change.archive`) |
77
- | `decision_threads`, `decision_items` | MCP server (`decision.thread_start` / `decision.open` / `decision.resolve` / `decision.delegate` / `decision.defer` / `decision.supersede` / `decision.checkpoint`); only normalized choices and checkpoints are stored, never prompts or transcripts |
77
+ | `decision_threads`, `decision_items` | MCP server (`decision.thread_start` / `decision.open` / `decision.resolve` / `decision.delegate` / `decision.defer` / `decision.supersede` / `decision.complete` / `decision.checkpoint`); only pending questions needed for recovery, normalized choices, lifecycle completion, and optional artifact checkpoints are stored, never prompts or transcripts |
78
78
  | `workflow_runs`, `workflow_steps` | MCP server (`workflow.start` / `workflow.step` / `workflow.complete`); skills provide evidence inputs but never write rows directly |
79
79
  | `artifacts`, `context_snapshots`, `spec_learning_candidates`, `trace_links` | MCP server through change lifecycle tools |
80
80
  | `incidents`, `projection_jobs`, `event_consumers`, `circuit_breaker` | MCP server; backup-first doctor recovery may perform only documented mechanical transitions |
@@ -25,9 +25,10 @@ as MCP authority.
25
25
 
26
26
  Load-bearing owner choices are normalized through `decision.*`; Prompt prose is not
27
27
  durable authority. The host acquires observable facts autonomously, exposes one
28
- current question, and stops. A workflow cannot advance while a matching decision
29
- thread is active, waiting for checkpoint confirmation, or carrying a blocking
30
- deferral.
28
+ current question, and stops. A workflow cannot advance while a matching decision has
29
+ an unanswered blocking question, a blocking deferral, a prepared checkpoint awaiting
30
+ confirmation, or a stale confirmed artifact. A normalized answer alone does not require
31
+ a ceremonial checkpoint.
31
32
 
32
33
  Every change-bound research, plan, dev, test, review, and deliver run inherits
33
34
  the baseline id from the owning change workflow. A Prompt cannot switch that
@@ -37,11 +38,13 @@ it does not fabricate the missing provenance.
37
38
 
38
39
  Ultra does not select product scope or material delivery posture; those remain user
39
40
  decisions. Research references form an optional catalog, not a forced questionnaire.
40
- The host model selects only evidence-relevant areas and records one coverage rationale.
41
- MCP validates identifiers, dispositions, evidence requirements, synthesis, and at
42
- least one applicable semantic area. Omitted areas create no workflow step. An explicit
43
- `not_applicable` or accepted `deferred` row is retained only when its exclusion is
44
- material.
41
+ The host model inspects evidence and recommends only relevant areas. The owner selects,
42
+ modifies, delegates, or defers that route through the native question surface unless
43
+ current intent already resolves it. The host records the normalized accepted coverage
44
+ and rationale. MCP validates identifiers, dispositions, evidence requirements,
45
+ synthesis, and at least one applicable semantic area; it does not prove the preceding
46
+ interaction. Omitted areas create no workflow step. An explicit `not_applicable` or
47
+ accepted `deferred` row is retained only when its exclusion is material.
45
48
 
46
49
  ## 2. How `ultra-init` classifies a repository
47
50
 
@@ -195,29 +198,33 @@ making it `completed`.
195
198
  ### Decision thread and item
196
199
 
197
200
  ```text
198
- thread: active -> checkpoint_ready -> confirmed
199
- ^ |
200
- |--------------+ revision/supersession
201
+ thread: active -> completed
202
+ |
203
+ +----> checkpoint_ready -> confirmed
204
+ ^ | |
205
+ |--------------+--------------+ revision/supersession
201
206
 
202
207
  item: open -> answered | delegated | deferred | superseded
203
208
  ```
204
209
 
205
210
  A thread is bound to baseline, change, or workflow authority. A partial unique index
206
211
  allows only one `open` item per thread. Resolved items remain immutable history;
207
- changed evidence or intent uses `decision.supersede` and reopens the checkpoint.
208
- `decision.checkpoint` first freezes a normalized decision digest, then binds explicit
209
- owner approval to current artifact digests or a justified standalone no-artifact
210
- case. It never stores the conversation transcript.
212
+ changed evidence or intent uses `decision.supersede` and reopens alignment.
213
+ `decision.complete` closes settled normalized state without adding an approval claim.
214
+ When an artifact-bound recovery boundary is actually needed, `decision.checkpoint`
215
+ instead freezes a normalized decision digest and binds explicit owner approval to
216
+ current artifact digests or a justified standalone no-artifact case. Neither path
217
+ stores the conversation transcript.
211
218
 
212
219
  ## 4. Write and verification lifecycle
213
220
 
214
221
  | Stage | Authoritative writes | Completion verification | Available continuation |
215
222
  |---|---|---|---|
216
223
  | `init` | Baseline classification/scope, Git bootstrap state, completed init run, initialization event, projection job | DB/schema opens, scaffold/projection and read-back succeed; existing Git is preserved or missing local Git is initialized | Explicitly chosen `research`, `status`, or `doctor`; an already-ready project may also enter `change` |
217
- | `research` | Coverage dispositions, selected step evidence, material decision checkpoints, typed semantic records with source digests, immutable reports, output paths and SHA-256 digests | Every coverage area is dispositioned; only executed/verified/reused areas require work evidence; synthesis binds current specifications and distillate; all material decisions and digests are current | Baseline record/convergence for initial research; bounded change research returns to its owning change |
224
+ | `research` | Accepted coverage dispositions, selected step evidence, normalized material decisions, optional artifact checkpoints, typed semantic records with source digests, immutable reports, output paths and SHA-256 digests | Every included coverage area is dispositioned; only executed/verified/reused areas require work evidence; synthesis binds current specifications and distillate; all material decisions and digests are current | Baseline record/convergence for initial research; bounded change research returns to its owning change |
218
225
  | baseline convergence | Spec/source/runtime refs, verification results, known failures, unknowns, gaps, branch/HEAD/worktree, approval | Full/adoption research complete; required discovery/product/architecture refs current; revision/worktree exact; blocking gaps resolved or explicitly accepted where allowed | `change` for every initial or daily outcome |
219
- | `change` | Complete Change Contract, profile/risk rationale, research disposition, intent/delta artifacts, and a completed capture run; a decision thread only when material intent remains unresolved | Intent, acceptance, recovery, classification, and research disposition are complete and bound to the baseline | Host selects among bounded `research`, `plan`, current `dev`, `think`, or `status` using allowed transitions |
220
- | `plan` | Selected planning evidence, complete change-owned task rows, acceptance coverage matrix, and change-bound `.ultra/execution-plan.json`; approval only for a material owner decision | Every Change acceptance id is owned by a task; trace targets, ownership, dependencies, topology, task contracts, and exported digest match current authority | Any dependency-ready task may enter `dev` |
226
+ | `change` | Complete Change Contract, profile/risk rationale, research disposition, intent/delta artifacts, and a completed capture run; a decision thread only when material intent remains unresolved | Intent, acceptance, recovery, classification, and research disposition are complete and bound to the baseline | Model recommends; owner selects or delegates bounded `research`, `plan`, current `dev`, `think`, or `status` from allowed transitions |
227
+ | `plan` | Accepted planning posture, selected planning evidence, complete change-owned task rows, acceptance coverage matrix, and change-bound `.ultra/execution-plan.json`; approval only for a material owner decision | Every Change acceptance id is owned by a task; trace targets, ownership, dependencies, topology, task contracts, and exported digest match current authority | Any dependency-ready task may enter `dev` |
221
228
  | `dev` | Task/session transitions, real worktree, step evidence, immutable implementation context, completion/review references | Task completed; no live session; task contract unchanged; starting context and review artifacts valid; completion commits are integrated and remain ancestors of current HEAD | Next task, then aggregate `test` |
222
229
  | `test` | Immutable checking context, an explicit risk-selected verification profile, and `.ultra/reports/tests/<workflow-id>.json` | Selected dimensions and acceptance pass; every excluded dimension has a rationale; report change/task set, HEAD, worktree, context, commands, blockers, and digests agree | `review` when passing, otherwise resume `dev`/`test` |
223
230
  | `review` | Immutable review context, `task`/`change`/`plan` mode, risk-selected worker provenance, two mandatory specialist axes, and coordinated summary | Current diff/HEAD and context match; the complete worker roster is selected or skipped with rationale; completed workers match specialist artifacts; both axes complete; findings and axis verdicts derive the final verdict | `deliver` only from a passing `change` review, otherwise resume implementation or checking |
@@ -249,8 +256,19 @@ thread only for a new material decision cluster. Before asking, it must:
249
256
  6. normalize the owner response with `decision.resolve`, explicit reversible
250
257
  delegation with `decision.delegate`, or a consequence-bearing deferral with
251
258
  `decision.defer`;
252
- 7. prepare a compact checkpoint only when a material decision cluster changes a
253
- durable contract and interruption recovery needs an artifact-bound boundary.
259
+ 7. call `decision.complete` when normalized state is settled, or prepare a compact
260
+ checkpoint only when a material decision cluster changes a durable contract and
261
+ interruption recovery needs an artifact-bound boundary.
262
+
263
+ The shared semantic flow is `inspect -> suggest -> ask if unresolved -> normalize ->
264
+ persist`. Claude Code and Kimi Code use `AskUserQuestion`, Codex uses
265
+ `request_user_input` when its current mode exposes it, and OpenCode uses `question`
266
+ when permitted. Every host falls back to one concise direct question when normal
267
+ conversation is still allowed. If the current host mode forbids interaction entirely,
268
+ the choice remains unanswered and route-dependent writes stop. A dismissed question
269
+ also remains unanswered. The DB trusts a normalized persisted result as current
270
+ authority across sessions; it does not store or verify a UI receipt, raw prompt, or
271
+ transcript.
254
272
 
255
273
  `ultra-think` owns this interaction protocol. `ultra-research`, `ultra-change`, and
256
274
  `ultra-plan` invoke it at their decision boundaries. `ultra-dev`, `ultra-test`,
@@ -326,7 +344,8 @@ current gate evidence do block.
326
344
 
327
345
  ```text
328
346
  ultra-init -> Git/scaffold/authority verification -> init completed
329
- -> explicit ultra-research -> model-selected coverage -> selected evidence work
347
+ -> explicit ultra-research -> suggested route -> owner-selected accepted coverage
348
+ -> selected evidence work
330
349
  -> local checkpoint when Git is unborn -> baseline approval
331
350
  -> ultra-change -> optional bounded research/plan -> dev -> risk-selected test/review
332
351
  -> local deliver/archive
@@ -336,7 +355,7 @@ ultra-init -> Git/scaffold/authority verification -> init completed
336
355
 
337
356
  ```text
338
357
  ultra-init -> preserve Git/classify brownfield -> init completed
339
- -> explicit adoption research -> model-selected coverage
358
+ -> explicit adoption research -> suggested route -> owner-selected accepted coverage
340
359
  -> selected characterization/known-red evidence -> gap ledger -> owner approval
341
360
  -> first ultra-change -> optional bounded research/plan -> dev -> test/review -> deliver
342
361
  ```
@@ -358,7 +377,8 @@ Migration preserves prior files and rows but never carries old approval forward.
358
377
 
359
378
  ```text
360
379
  ultra-status -> ultra-change intent capture
361
- -> host chooses bounded research, plan, current task, think, or status
380
+ -> model recommends; owner selects or delegates bounded research, plan, current task,
381
+ think, or status
362
382
  -> dev -> risk-selected test -> review -> deliver -> reconciled baseline
363
383
  ```
364
384
 
@@ -374,13 +394,13 @@ evidence rather than bypassing them.
374
394
  | `ultra-init` | classification, scope, Git/scaffold bootstrap, and init verification | stops completed; exposes research/status/doctor and any already-valid change capability |
375
395
  | `ultra-research` | coverage disposition, selected evidence acquisition, synthesis, and material research decisions | baseline convergence or return to the owning change |
376
396
  | `ultra-think` | one material owner decision or read-only diagnosis | returns to the invoking capability after any needed checkpoint |
377
- | `ultra-change` | outcome capture, Change Contract, risk/research routing | host selects research, plan, current dev work, think, or status |
397
+ | `ultra-change` | outcome capture, Change Contract, risk/research routing | model recommends; owner selects or delegates research, plan, current dev work, think, or status |
378
398
  | `ultra-plan` | task contracts, dependencies, acceptance coverage, optional material approval | any dependency-ready task through `ultra-dev` |
379
399
  | `ultra-dev` | one task/session vertical slice and focused review | next `ultra-dev` task or aggregate `ultra-test` |
380
400
  | `ultra-test` | risk-selected change acceptance and verification profile | `ultra-review` on pass, `ultra-dev`/`ultra-test` on failure |
381
401
  | `ultra-review` | independent specification and engineering axes plus risk-selected workers | `ultra-deliver` on approval; otherwise implementation or checking |
382
402
  | `ultra-deliver` | convergence, reconciliation, local archive, and delivery evidence | `ultra-status` or the next `ultra-change`; external release is separate |
383
- | `ultra-status` | read-only authority and transition set | host recommendation among allowed transitions |
403
+ | `ultra-status` | read-only authority and transition set | model recommendation; owner selection or delegation among allowed transitions |
384
404
  | `ultra-doctor` | read-only diagnosis and authorized mechanical recovery | required recovery only when unique; otherwise safe alternatives |
385
405
 
386
406
  Every row permits `ultra-think` when material owner authority is missing and permits
@@ -52,7 +52,7 @@ def main() -> None:
52
52
  except ContextSpineError as exc:
53
53
  print(f"[active_task_context] cannot inspect Context Spine: {exc}", file=sys.stderr)
54
54
  breadcrumb = None
55
- if breadcrumb and breadcrumb.get("change_id"):
55
+ if breadcrumb and breadcrumb.get("workflow"):
56
56
  print(json.dumps({"hookSpecificOutput": {
57
57
  "hookEventName": "PreToolUse",
58
58
  "additionalContext": render_breadcrumb(root, breadcrumb),
@@ -22,7 +22,7 @@ class Breadcrumb(dict):
22
22
 
23
23
  def find_root(start: Path):
24
24
  for root in (start, *start.parents):
25
- if (root / ".ultra").is_dir():
25
+ if (root / ".ultra" / "state.db").is_file():
26
26
  return root
27
27
  return None
28
28