ultra-builder-pro-cli 0.15.0 → 0.16.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 (42) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/README.md +18 -11
  3. package/adapters/_shared/handbook.cjs +2 -1
  4. package/commands/ultra-change.md +1 -1
  5. package/commands/ultra-plan.md +1 -1
  6. package/commands/ultra-research.md +1 -1
  7. package/commands/ultra-think.md +2 -2
  8. package/docs/AGENT-CONTEXT.md +30 -13
  9. package/docs/ARCHITECTURE.md +24 -4
  10. package/docs/PLAN.zh-CN.md +3 -2
  11. package/docs/ROADMAP.md +5 -3
  12. package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
  13. package/docs/STATE-DB-ACCESS-POLICY.md +8 -6
  14. package/docs/USER-HANDBOOK-CONTRACT.md +8 -2
  15. package/docs/WORKFLOW-LIFECYCLE.md +89 -13
  16. package/mcp-server/lib/change-workflow.cjs +52 -4
  17. package/mcp-server/lib/context-spine.cjs +65 -3
  18. package/mcp-server/lib/decision-dialogue.cjs +713 -0
  19. package/mcp-server/lib/doctor.cjs +9 -0
  20. package/mcp-server/lib/project-breadcrumb.cjs +9 -0
  21. package/mcp-server/lib/state-db.cjs +29 -6
  22. package/mcp-server/lib/workflow-state.cjs +13 -0
  23. package/mcp-server/server.cjs +54 -0
  24. package/package.json +1 -1
  25. package/skills/ultra-change/SKILL.md +41 -12
  26. package/skills/ultra-deliver/SKILL.md +10 -3
  27. package/skills/ultra-dev/SKILL.md +11 -3
  28. package/skills/ultra-doctor/SKILL.md +10 -0
  29. package/skills/ultra-init/SKILL.md +6 -1
  30. package/skills/ultra-plan/SKILL.md +25 -5
  31. package/skills/ultra-research/SKILL.md +38 -23
  32. package/skills/ultra-review/SKILL.md +9 -3
  33. package/skills/ultra-status/SKILL.md +8 -4
  34. package/skills/ultra-test/SKILL.md +9 -3
  35. package/skills/ultra-think/SKILL.md +26 -12
  36. package/skills/ultra-think/references/decision-dialogue.md +130 -0
  37. package/spec/cli-protocol.md +11 -2
  38. package/spec/mcp-tools.yaml +299 -1
  39. package/spec/schemas/mcp-tools.schema.json +1 -1
  40. package/spec/schemas/state-db.sql +58 -0
  41. package/ultra-tools/cli.cjs +1 -1
  42. package/ultra-tools/commands/status.cjs +15 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.16.0] — 2026-07-23
11
+
12
+ ### Added
13
+
14
+ - Added schema 16 durable decision threads and items with exactly one current
15
+ question, normalized owner answers, explicit reversible delegation, consequence-
16
+ bearing deferral, supersession history, and artifact-bound checkpoints.
17
+ - Added nine `decision.*` MCP contracts, CLI mappings, events, valid/invalid contract
18
+ fixtures, status/breadcrumb recovery, doctor health checks, and workflow gates.
19
+ - Added one canonical progressive-disclosure decision protocol shared by init,
20
+ research, thinking, change, and planning without copying questionnaires into each
21
+ Skill.
22
+
23
+ ### Changed
24
+
25
+ - Changed research to preserve all seventeen semantic steps as an internal coverage
26
+ contract while exposing only the current owner decision or compact checkpoint.
27
+ - Changed change and plan formation to inspect facts autonomously, present one
28
+ evidence-backed choice at a time, stop for the owner, and reuse one approved
29
+ checkpoint instead of requesting equivalent confirmations.
30
+ - Changed dev, test, review, deliver, status, doctor, user handbooks, and lifecycle
31
+ documentation to recover through the same decision authority and exact next route.
32
+
33
+ ### Fixed
34
+
35
+ - Prevented a decision thread for one change from blocking unrelated changes on the
36
+ same baseline while preserving baseline-only and matching workflow gates.
37
+ - Prevented workflow steps or completion from advancing on an open, blocking-deferred,
38
+ checkpoint-ready, stale, or superseded owner decision.
39
+ - Prevented prompt transcripts, static question queues, large research dumps, and
40
+ repeated owner approvals from becoming project authority.
41
+
10
42
  ## [0.15.0] — 2026-07-22
11
43
 
12
44
  ### Added
@@ -624,7 +656,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
624
656
  skill manifest, CLI protocol + mapping table; 5 spec validators.
625
657
  - **Phase 0 — skeleton**: multi-runtime installer scaffolding.
626
658
 
627
- [Unreleased]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.15.0...HEAD
659
+ [Unreleased]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.16.0...HEAD
660
+ [0.16.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.15.0...v0.16.0
628
661
  [0.15.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.14.0...v0.15.0
629
662
  [0.14.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.13.0...v0.14.0
630
663
  [0.13.0]: https://github.com/rocky2431/ultra-builder-pro-cli/compare/v0.12.1...v0.13.0
package/README.md CHANGED
@@ -8,7 +8,7 @@ authoritative `.ultra/state.db`.
8
8
 
9
9
  <div align="center">
10
10
 
11
- [![Version](https://img.shields.io/badge/version-0.15.0-blue)](./CHANGELOG.md)
11
+ [![Version](https://img.shields.io/badge/version-0.16.0-blue)](./CHANGELOG.md)
12
12
  [![Tests](https://img.shields.io/badge/tests-passing-brightgreen)](#verification)
13
13
  [![License: MIT](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
14
14
  [![Node](https://img.shields.io/badge/node-%E2%89%A522-informational)](./package.json)
@@ -25,9 +25,14 @@ authoritative `.ultra/state.db`.
25
25
  Install and uninstall are symmetric on every supported host; `ubp --doctor`
26
26
  verifies the installed asset hashes and host entry points without mutation.
27
27
  - **Shares state across runtimes.** `.ultra/state.db` (SQLite + WAL) is the
28
- authoritative source for baselines, changes, tasks, sessions, events, incidents,
29
- projection jobs, and telemetry. `tasks.json` and context markdown are
28
+ authoritative source for baselines, changes, decision threads, workflows, tasks,
29
+ sessions, events, incidents, projection jobs, and telemetry. `tasks.json` and context markdown are
30
30
  generated projections, not handwritten.
31
+ - **Aligns the owner and agent without questionnaire overload.** The host resolves
32
+ observable facts first, then presents exactly one load-bearing decision with
33
+ evidence, a recommendation, credible alternatives, and the durable effect. The
34
+ normalized answer and owner-approved artifact checkpoint live in the DB; prompts
35
+ and transcripts do not. Matching workflows stop until that authority is current.
31
36
  - **Keeps memory ownership explicit.** Ultra Builder Pro does not collect
32
37
  prompts, transcripts, observations, summaries, or cross-session memory.
33
38
  Install cloud-mem/claude-mem separately if persistent memory is wanted.
@@ -117,10 +122,11 @@ transition, invalidation, and recovery semantics.
117
122
  The layers share one `.ultra/state.db`, but the CLI is not a mirror of every MCP
118
123
  tool: continuous change mutations are MCP-only and fail closed. See
119
124
  [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md) for the full contract and
120
- [`spec/cli-protocol.md`](./spec/cli-protocol.md) for the 41 live contracts.
121
- Review, impact discovery, skill resolution, and user interaction stay on each
122
- Host's native surfaces; the generated Codex capability map documents those
123
- replacements without advertising non-existent MCP tools.
125
+ [`spec/cli-protocol.md`](./spec/cli-protocol.md) for the 50 live contracts.
126
+ Review, impact discovery, skill resolution, and decision presentation stay on each
127
+ host's native surfaces; MCP stores normalized decision authority but never generates
128
+ questions. The generated Codex capability map documents those replacements without
129
+ advertising non-existent MCP tools.
124
130
 
125
131
  The package boundary is deliberate: twelve public Ultra workflow skills, four
126
132
  internal review-rule skills, host-specific collaboration companions, and the
@@ -150,11 +156,12 @@ ultra-tools task init-project --project-name myapp --mode auto
150
156
 
151
157
  # Projection-only projects from prior releases use one backup-first import:
152
158
  ultra-tools migrate --from=4.4 --to=4.5 --source-dir .
153
- ultra-tools migrate --from=4.5 --to=15.0 --source-dir .
159
+ ultra-tools migrate --from=4.5 --to=16.0 --source-dir .
154
160
 
155
- # 2. Complete all 17 research steps, record current evidence, and obtain explicit
156
- # baseline approval. Then open an initial change and persist its task contracts
157
- # (normally driven by ultra-research/change/plan).
161
+ # 2. Complete all 17 research steps. When owner judgment is required, the host asks
162
+ # one evidence-backed decision at a time and checkpoints the accepted artifacts.
163
+ # Record current evidence, obtain explicit baseline approval, then open and align
164
+ # an initial change before persisting its task contracts.
158
165
 
159
166
  # 3. Run the plan — parallel sessions, auto-merge back to main on success
160
167
  ubp-orchestrator run
@@ -59,8 +59,9 @@ function renderHandbook(runtime) {
59
59
  `- Workflow entry points: ${value.invocation}.`,
60
60
  `- Collaboration boundary: ${value.collaboration}. The current host remains primary and owns final verification.`,
61
61
  `- Coordination boundary: ${value.coordination}.`,
62
- '- Authority: `.ultra/state.db` is the only durable Ultra authority for baselines, changes, tasks, sessions, events, incidents, projection state, telemetry, and review evidence. Generated JSON and Markdown are projections or workflow artifacts.',
62
+ '- Authority: `.ultra/state.db` is the only durable Ultra authority for baselines, changes, decision threads, tasks, sessions, events, incidents, projection state, telemetry, and review evidence. Generated JSON and Markdown are projections or workflow artifacts.',
63
63
  '- Baseline boundary: `task.init_project` classifies greenfield or brownfield work and records repository scope. Projection-only prior state uses the exact supported backup-first import returned by the authority check; migrated compatibility rows require explicit brownfield re-adoption. `baseline.record` owns evidence, verification, repository snapshot, and the gap ledger; `baseline.converge` requires explicit owner approval. New ordinary changes require a healthy ready baseline. Existing active work may continue with warnings, but baseline readiness blocks change convergence; normal drift reconciliation is health-checked atomically at archive. Only an explicitly approved incident break-glass may start without baseline readiness, and its archive creates a blocking reconciliation gap.',
64
+ '- Decision boundary: project-bound owner choices use one resumable DB-backed decision thread. The host resolves observable facts autonomously, presents only the earliest unresolved decision with evidence and a recommendation, waits for the owner, and records the normalized decision rather than prompts or transcripts. A linked workflow cannot advance until blocking decisions are resolved and its owner-approved checkpoint is current.',
64
65
  '- Context Spine boundary: `change.context` compiles role/gate readiness, required references, a fresh-context budget, public seam, verification command, and one next action. File, token, and context-share budgets are advisory attention signals, not refusal gates. Hooks inject only the DB-derived `change.breadcrumb`; missing required evidence or stale execution context must be recompiled.',
65
66
  '- Specification learning boundary: stable implementation discoveries use approval-gated propose/approve-or-reject/apply transitions. Unresolved learning blocks convergence; review requires independent specification-fidelity and engineering-standards evidence.',
66
67
  '- Memory and graph boundary: Ultra Builder Pro does not capture prompts, transcripts, observations, summaries, cross-session memory, or code-graph content. Separately installed providers own that data; Ultra may store only their metadata references in a change context manifest.',
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Open or resume a bounded continuous change with linked authoritative tasks and context
2
+ description: Align, open, and route one bounded continuous change through research, plan, and delivery
3
3
  argument-hint: "[change-id-or-title] [quick|standard|major|incident]"
4
4
  workflow-ref: "@skills/ultra-change/SKILL.md"
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Convert validated requirements into dependency-valid Ultra tasks with bounded context and exact verification
2
+ description: Interactively review and persist dependency-valid tasks with bounded context and exact verification
3
3
  argument-hint: "[scope]"
4
4
  workflow-ref: "@skills/ultra-plan/SKILL.md"
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Research unresolved product or architecture decisions and update the authoritative baseline specifications
2
+ description: Build complete research evidence while presenting only one load-bearing owner decision at a time
3
3
  argument-hint: "[scope-or-question]"
4
4
  workflow-ref: "@skills/ultra-research/SKILL.md"
5
5
  ---
@@ -1,10 +1,10 @@
1
1
  ---
2
- description: Analyze a consequential question with evidence, uncertainty, and proportionate stress testing
2
+ description: Resolve a consequential question through evidence or one-decision-at-a-time alignment
3
3
  argument-hint: "[question]"
4
4
  workflow-ref: "@skills/ultra-think/SKILL.md"
5
5
  ---
6
6
 
7
- # Analyze a consequential question
7
+ # Align on a consequential question
8
8
 
9
9
  Read and follow `@skills/ultra-think/SKILL.md`, treating `$ARGUMENTS` as the question to resolve.
10
10
  Treat the referenced skill as the only workflow definition.
@@ -37,15 +37,15 @@ native command or skill -> MCP workflow-state operation -> .ultra/state.db
37
37
  | MCP | `mcp-server/server.cjs` | Authoritative typed operations over `.ultra/state.db` |
38
38
  | CLI | `ultra-tools`, `ubp-orchestrator` | Selected initialization, backup-first recovery, automation, and diagnostics; not a change-state mirror |
39
39
 
40
- `.ultra/state.db` is the only durable Ultra authority for baselines, changes, tasks,
40
+ `.ultra/state.db` is the only durable Ultra authority for baselines, changes, decisions, tasks,
41
41
  workflow runs/steps, sessions, events, incidents, projection jobs/cursors, telemetry, review evidence,
42
42
  and circuit-breaker state. `tasks.json`, context Markdown, execution plans, and
43
43
  reports are projections or workflow artifacts.
44
44
 
45
45
  ## 3. Live MCP and declared contracts
46
46
 
47
- `spec/mcp-tools.yaml` declares and the bundled server registers 41 tools across
48
- seven families:
47
+ `spec/mcp-tools.yaml` declares and the bundled server registers 50 tools across
48
+ eight families:
49
49
 
50
50
  | Family | Live tools |
51
51
  |---|---|
@@ -53,13 +53,15 @@ seven families:
53
53
  | `task.*` | create, update, list, get, switch_tag, delete, init_project, expand, parse_prd, dependency_topo, append_event, subscribe_events |
54
54
  | `session.*` | spawn, close, get, list, admission_check, heartbeat, subscribe_events |
55
55
  | `change.*` | create, update, get, list, context, breadcrumb, learning_propose, learning_resolve, converge, archive |
56
+ | `decision.*` | thread_start, get, list, open, resolve, delegate, defer, supersede, checkpoint |
56
57
  | `workflow.*` | start, get, list, step, complete |
57
58
  | `system.*` | doctor |
58
59
  | `plan.*` | export, get |
59
60
 
60
- Review, repository impact discovery, skill loading, and user interaction remain
61
- host-native capabilities rather than fake MCP contracts. The generated Codex
62
- capability map documents those replacements.
61
+ Review, repository impact discovery, skill loading, and decision presentation remain
62
+ host-native capabilities rather than fake MCP contracts. MCP stores only normalized
63
+ decision authority and checkpoints; it never generates questions or retains prompts
64
+ and transcripts. The generated Codex capability map documents host replacements.
63
65
 
64
66
  The complete write, transition, invalidation, and recovery contract lives in
65
67
  [`WORKFLOW-LIFECYCLE.md`](./WORKFLOW-LIFECYCLE.md).
@@ -67,7 +69,22 @@ The complete write, transition, invalidation, and recovery contract lives in
67
69
  Any new MCP contract starts in `spec/mcp-tools.yaml` with valid and invalid
68
70
  fixtures. Do not add an ad-hoc server handler first.
69
71
 
70
- ## 4. Context Spine contract
72
+ ## 4. Human-agent alignment contract
73
+
74
+ `skills/ultra-think/references/decision-dialogue.md` is the single reusable prompt
75
+ contract for load-bearing owner choices. Research, change, and plan read it at their
76
+ decision boundaries. They inspect evidence first, expose only the earliest unresolved
77
+ choice, include a recommendation and durable effects, and stop the turn. Dev, test,
78
+ review, and deliver route back to the same thread instead of deciding for the owner.
79
+
80
+ One partial unique index permits only one open item per thread. `decision.resolve`,
81
+ `decision.delegate`, and `decision.defer` preserve the source of authority;
82
+ `decision.supersede` preserves history when evidence or intent changes. Prepare and
83
+ confirm checkpointing bind the accepted cluster to current artifact digests before a
84
+ matching workflow may advance. Status and breadcrumb return only the current question
85
+ and one route, so recovery does not require replaying conversation history.
86
+
87
+ ## 5. Context Spine contract
71
88
 
72
89
  Context Manifest v2 is an immutable DB-backed role handoff, not a static codebase summary.
73
90
  `change.context` compiles required references, digests, readiness, context budget,
@@ -92,7 +109,7 @@ through approve/reject/apply transitions in `change.learning_resolve`. Unresolve
92
109
  learning blocks convergence. Review contributes two independent axes,
93
110
  `spec_fidelity` and `engineering_standards`; neither can replace the other.
94
111
 
95
- ## 5. Native host presentation
112
+ ## 6. Native host presentation
96
113
 
97
114
  | Host | Plugin form | Workflow entry | Hook form | Collaboration companions |
98
115
  |---|---|---|---|---|
@@ -105,7 +122,7 @@ The current host remains primary. Collaboration skills call another runtime
105
122
  only when explicitly requested, use it as a read-only advisor, and return the
106
123
  evidence to the primary host for final verification.
107
124
 
108
- ## 6. Hook boundary
125
+ ## 7. Hook boundary
109
126
 
110
127
  The canonical Python hook bundle contains seven executable workflow hooks plus
111
128
  the shared read-only `context_spine.py` breadcrumb helper:
@@ -133,7 +150,7 @@ reject an edit, stop, or tool call.
133
150
  Generic command blocking, post-edit governance, and unrelated user hooks are not
134
151
  copied into Ultra Builder Pro.
135
152
 
136
- ## 7. Memory boundary
153
+ ## 8. Memory boundary
137
154
 
138
155
  Ultra Builder Pro has no memory MCP family, recall skill, prompt capture,
139
156
  transcript capture, observation journal, or session-summary hook. Persistent
@@ -151,7 +168,7 @@ ultra-tools legacy-memory prune --confirm DELETE_ULTRA_LEGACY_MEMORY
151
168
 
152
169
  Archive before prune; the confirmation token is intentionally required.
153
170
 
154
- ## 8. Project state layout
171
+ ## 9. Project state layout
155
172
 
156
173
  ```text
157
174
  .ultra/
@@ -171,7 +188,7 @@ Archive before prune; the confirmation token is intentionally required.
171
188
  └── delivery/<workflow-id>.json
172
189
  ```
173
190
 
174
- ## 9. User handbook integration
191
+ ## 10. User handbook integration
175
192
 
176
193
  General engineering doctrine remains user-owned in `CLAUDE.md` or `AGENTS.md`.
177
194
  Ultra Builder Pro contributes one managed section only. Preview or apply it with:
@@ -186,7 +203,7 @@ timestamped backup, replaces only the marked block, and can migrate the old
186
203
  Codex `## Ultra Builder Pro Runtime Contract` section without touching the next
187
204
  user section. Plugin adapters themselves do not silently overwrite handbooks.
188
205
 
189
- ## 10. Verification
206
+ ## 11. Verification
190
207
 
191
208
  Run `npm run test:all`, `python3 -m pytest hooks/tests -q`, and `npm audit`.
192
209
  Adapter tests assert the allowlisted assets, native manifests, hook boundary,
@@ -53,7 +53,7 @@ the supported hosts share.
53
53
  | Layer | Role | Form |
54
54
  |--------------|----------------------------------------------|-------------------------------------------------------|
55
55
  | **skill** | knowledge carrier; tells the runtime *what to do* | `skills/<name>/SKILL.md` discovered natively by all supported runtimes |
56
- | **MCP** | authoritative workflow-state and Context Spine API | stdio MCP server exposing 41 live tools across task/session/baseline/change/workflow/system/plan families in [`spec/mcp-tools.yaml`](../spec/mcp-tools.yaml) |
56
+ | **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) |
57
57
  | **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)) |
58
58
 
59
59
  Why three: skills give us behavior portability across runtimes; MCP gives
@@ -70,7 +70,7 @@ RPC, and host-native loaders own resolution and invocation.
70
70
 
71
71
  All durable Ultra workflow state lives in one SQLite file with WAL enabled. Schema is
72
72
  fixed in [`spec/schemas/state-db.sql`](../spec/schemas/state-db.sql) and
73
- covers nineteen tables:
73
+ covers twenty-one tables:
74
74
 
75
75
  | Table | Holds | Phase |
76
76
  |--------------------|---------------------------------------------------|-------|
@@ -83,7 +83,7 @@ covers nineteen tables:
83
83
  | `telemetry` | per-session token / cost / tool-call counters | 6 |
84
84
  | `specs_refs` | spec change tracking → staleness propagation | 5 |
85
85
  | `circuit_breaker` | bounded retry and halt state for failed tasks | 5 |
86
- | `changes` | continuous feature/fix/incident lifecycle and incident baseline bypass | 12 |
86
+ | `changes` | continuous feature/fix/incident lifecycle, alignment-thread link, and incident baseline bypass | 12→16 |
87
87
  | `artifacts` | intent/context/verification artifact registry | 8C |
88
88
  | `context_snapshots`| role/gate context, readiness, budget, execution seam, hashes, git head, provider refs | 10 |
89
89
  | `spec_learning_candidates` | approval-gated implementation discoveries for baseline convergence | 10 |
@@ -93,6 +93,8 @@ covers nineteen tables:
93
93
  | `event_consumers` | durable monotonic consumer cursors | 8C |
94
94
  | `workflow_runs` | init/research/plan/change/dev/test/review/deliver run authority, position, blockers, approval, and derived summary | 13 |
95
95
  | `workflow_steps` | ordered step state, evidence, decisions, immutable output paths, and recorded SHA-256 digests | 13 |
96
+ | `decision_threads` | baseline/change/workflow-bound owner-agent alignment, interaction mode, normalized summary, and checkpoint authority | 16 |
97
+ | `decision_items` | one-at-a-time owner choices, evidence, recommendations, durable effects, resolutions, delegation, deferral, and supersession history | 16 |
96
98
 
97
99
  Two rules make this work:
98
100
 
@@ -105,7 +107,7 @@ Two rules make this work:
105
107
  2. **Single writer for mutable tables, multi-writer for `events`.**
106
108
  `.ultra/state.db` opens in WAL with `busy_timeout=5000`. The MCP
107
109
  server holds the single writer connection for `baselines`, `tasks`, `sessions`,
108
- `changes`, `workflow_runs`, `workflow_steps`, `artifacts`, `context_snapshots`,
110
+ `changes`, `decision_threads`, `decision_items`, `workflow_runs`, `workflow_steps`, `artifacts`, `context_snapshots`,
109
111
  `spec_learning_candidates`, `incidents`, `projection_jobs`, `telemetry`,
110
112
  `specs_refs`, and `migration_history`; the CLI calls
111
113
  those tools over stdio rather than opening its own writer. The
@@ -171,6 +173,24 @@ and tracked-spec drift atomically. Break-glass incident archive creates an open
171
173
  blocking reconciliation gap, so incident recovery can finish without falsely marking
172
174
  the project baseline healthy.
173
175
 
176
+ ### Human-agent decision authority
177
+
178
+ Ultra separates autonomous evidence work from owner decision authority. The host reads
179
+ the repository, runtime, tests, and primary sources first, then exposes only the earliest
180
+ unresolved load-bearing choice. `decision.open` stores the recommendation, credible
181
+ alternatives, evidence refs, and durable effects; a partial unique index guarantees one
182
+ current question per thread. The host ends that turn and waits.
183
+
184
+ The next response becomes a normalized owner decision, explicit reversible delegation,
185
+ or consequence-bearing deferral. Prompts and transcripts are never persisted. A coherent
186
+ cluster moves through prepare/confirm checkpointing, which binds an owner-approved
187
+ decision digest to the current specification, Change Contract, alignment, or plan artifact.
188
+ Matching workflow steps and completion fail closed until the checkpoint is confirmed.
189
+ Supersession preserves prior history and reopens alignment instead of silently editing an
190
+ old decision. The shared procedure lives in
191
+ `skills/ultra-think/references/decision-dialogue.md`; status, breadcrumb, and doctor expose
192
+ only the current recovery surface.
193
+
174
194
  ## 4. Continuous changes — the daily unit of convergence
175
195
 
176
196
  After the initial baseline delivery, every fix, feature, redesign, or incident
@@ -10,8 +10,9 @@
10
10
  > Kimi Code 采用各自 native plugin 呈现,其他旧 runtime adapter 已退役。下文所有与此冲突的
11
11
  > memory/hindsight 章节仅作为历史实施记录,不再是当前需求或运行时契约。
12
12
 
13
- **当前状态**:v0.15.0;四宿主 native plugin、41 个 live MCP tool、
14
- schema 15.0(19 表)、typed research semantics、complete Change Contract、
13
+ **当前状态**:v0.16.0;四宿主 native plugin、50 个 live MCP tool、
14
+ schema 16.0(21 表)、one-question owner-agent decision dialogue、artifact checkpoint、
15
+ workflow alignment gate、typed research semantics、complete Change Contract、
15
16
  acceptance coverage、mode-bound 双轴 review、verified learning/reconciliation provenance、
16
17
  Context Spine v2 / breadcrumb / spec-learning、持续 change/context/convergence/doctor、incident debug lane、
17
18
  checkpoint 恢复消费与跨宿主安装 provenance/doctor 已落地;npm 发布由
package/docs/ROADMAP.md CHANGED
@@ -13,7 +13,7 @@ sharing one authoritative workflow store.
13
13
 
14
14
  **Distribution channels (v1.0)**: npm · Homebrew · pip.
15
15
 
16
- **Release line**: `0.14.x`; every release is gated by `npm run verify:release`.
16
+ **Release line**: `0.16.x`; every release is gated by `npm run verify:release`.
17
17
 
18
18
  ---
19
19
 
@@ -47,24 +47,26 @@ sharing one authoritative workflow store.
47
47
  | 11 | Greenfield/brownfield baseline adoption + advisory context budgets + convergence gate | ✅ done |
48
48
  | 12 | Repository evidence snapshots + gap ledger + migration re-adoption + incident governance | ✅ done |
49
49
  | 13 | Durable init-to-delivery workflows + task execution contracts + immutable stage evidence | ✅ done |
50
+ | 16 | Resumable one-question owner-agent decisions + artifact checkpoints + workflow gates | ✅ done |
50
51
  | 9 | Release pipeline | npm tag publishing live; Homebrew / pip not implemented |
51
52
 
52
53
  ## What is in the repo today
53
54
 
54
55
  ```
55
56
  spec/ ← Phase 1 single source of truth
56
- ├── mcp-tools.yaml (41 live tools across 7 families)
57
+ ├── mcp-tools.yaml (50 live tools across 8 families)
57
58
  ├── cli-protocol.md (CLI ↔ MCP mapping table)
58
59
  ├── schemas/ (state-db.sql + 4 JSON schemas)
59
60
  ├── fixtures/{valid,invalid}/ (+ v4.4-project for migration)
60
61
  └── scripts/test-all.cjs (npm run test:spec — 7 validation stages)
61
62
 
62
63
  mcp-server/ ← Phase 2 authoritative state layer
63
- ├── server.cjs (stdio MCP server, 41 task/session/baseline/change/workflow/system/plan tools)
64
+ ├── server.cjs (stdio MCP server, 50 task/session/baseline/change/decision/workflow/system/plan tools)
64
65
  ├── lib/
65
66
  │ ├── state-db.cjs (SQLite + WAL + pragmas)
66
67
  │ ├── state-ops.cjs (full write API, status state machine)
67
68
  │ ├── baseline-workflow.cjs (project adoption + approval + reconciliation)
69
+ │ ├── decision-dialogue.cjs (one-question authority + checkpoint gates)
68
70
  │ ├── workflow-state.cjs (ordered stage runs, evidence, output digests, and gates)
69
71
  │ └── projector.cjs (state.db → tasks.json + context md)
70
72
  └── tests/ (npm run test:state)
@@ -71,7 +71,7 @@ they do not deny edits or stop active incident work.
71
71
  | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
72
72
  |---|---|---|---|---|
73
73
  | stdio MCP registration | plugin `.mcp.json` | `opencode.json` local MCP entry | plugin `.mcp.json` | plugin `mcpServers` entry |
74
- | Live/declared contracts | 41 | 41 | 41 | 41 |
74
+ | Live/declared contracts | 50 | 50 | 50 | 50 |
75
75
  | Greenfield/brownfield baseline adoption | FULL | FULL | FULL | FULL |
76
76
  | Context Spine v2 / breadcrumb | FULL | FULL, same bundled read-only DB reader as every hook | FULL | FULL |
77
77
  | Approval-gated spec learning | FULL | FULL | FULL | FULL |
@@ -79,7 +79,7 @@ they do not deny edits or stop active incident work.
79
79
  | Durable authority | project `.ultra/state.db` | project `.ultra/state.db` | project `.ultra/state.db` | project `.ultra/state.db` |
80
80
  | Ultra memory API | N/A | N/A | N/A | N/A |
81
81
 
82
- All 41 `task.*`, `session.*`, `baseline.*`, `change.*`, `workflow.*`, `system.*`, and `plan.*` operations
82
+ All 50 `task.*`, `session.*`, `baseline.*`, `change.*`, `decision.*`, `workflow.*`, `system.*`, and `plan.*` operations
83
83
  registered by `mcp-server/server.cjs` are live. Review, impact discovery, skill
84
84
  loading, and user interaction remain host-native surfaces.
85
85
 
@@ -126,9 +126,9 @@ records. Uninstall refuses an unmanaged or conflicting root.
126
126
 
127
127
  | Capability | Contract |
128
128
  |---|---|
129
- | Current state schema | `15.0` |
129
+ | Current state schema | `16.0` |
130
130
  | Runtime values | `claude`, `opencode`, `codex`, `kimi` |
131
- | 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, then typed research semantics, complete Change Contracts, verified learning application, and reconciliation provenance in 15.0 |
131
+ | 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, then resumable owner-agent decision threads, artifact checkpoints, and workflow alignment gates in 16.0 |
132
132
  | Preservation gate | rows, IDs, indexes, foreign keys, telemetry, incidents, and migration history remain intact |
133
133
  | Failure behavior | rollback; no partially upgraded authority database |
134
134
 
@@ -4,17 +4,18 @@
4
4
  > risks R21 / R25.
5
5
 
6
6
  `.ultra/state.db` is the only authoritative state store for baselines, changes,
7
- tasks, workflow runs/steps, events, sessions, incidents, projections, telemetry, and spec references
7
+ decision threads/items, tasks, workflow runs/steps, events, sessions, incidents,
8
+ projections, telemetry, and spec references
8
9
  (D18, D52, D54). Every process
9
10
  that touches it must follow the rules below; deviations are bugs.
10
11
 
11
12
  ## 1. Three-role write matrix
12
13
 
13
- | Role | tasks | baselines | change/workflow/artifact state | events | sessions | telemetry | specs_refs | migration_history |
14
- |---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
15
- | **MCP server** (single writer for mutables) | RW | RW | RW | RW | RW | RW | RW | RW |
16
- | **CLI** (`ultra-tools …`) | R | RW (init only) | R | RW (append-only) | R | R | R | RW (migration only) |
17
- | **Orchestrator daemon** | R | R | R | RW | RW | RW | RW | R |
14
+ | Role | tasks | baselines | change/workflow/artifact state | decisions | events | sessions | telemetry | specs_refs | migration_history |
15
+ |---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
16
+ | **MCP server** (single writer for mutables) | RW | RW | RW | RW | RW | RW | RW | RW | RW |
17
+ | **CLI** (`ultra-tools …`) | R | RW (init only) | R | R | RW (append-only) | R | R | R | RW (migration only) |
18
+ | **Orchestrator daemon** | R | R | R | R | RW | RW | RW | RW | R |
18
19
 
19
20
  - **R** = read-only;
20
21
  - **RW** = read + write;
@@ -73,6 +74,7 @@ resolve the mount/runtime constraint before retrying.
73
74
  | `baselines` | MCP server (`baseline.start` / `baseline.record` / `baseline.converge`); initialization and legacy-projection migration may create only the first draft or compatibility row |
74
75
  | `tasks` | MCP server (`task.create` / `task.update` / `task.delete`) |
75
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 |
76
78
  | `workflow_runs`, `workflow_steps` | MCP server (`workflow.start` / `workflow.step` / `workflow.complete`); skills provide evidence inputs but never write rows directly |
77
79
  | `artifacts`, `context_snapshots`, `spec_learning_candidates`, `trace_links` | MCP server through change lifecycle tools |
78
80
  | `incidents`, `projection_jobs`, `event_consumers`, `circuit_breaker` | MCP server; backup-first doctor recovery may perform only documented mechanical transitions |
@@ -7,8 +7,8 @@ only one small managed section describing its runtime boundary.
7
7
  ## Source and render targets
8
8
 
9
9
  `adapters/_shared/handbook.cjs` is the canonical source. It renders the common
10
- authority, baseline adoption, Context Spine, specification-learning, memory, hook, agent, and
11
- package boundaries with host-native command syntax:
10
+ authority, baseline adoption, decision dialogue, Context Spine, specification-learning,
11
+ memory, hook, agent, and package boundaries with host-native command syntax:
12
12
 
13
13
  | Runtime | Default target | Main invocation form |
14
14
  |---|---|---|
@@ -31,6 +31,12 @@ a blocking reconciliation gap; hooks inject only the DB-derived
31
31
  axis blocks convergence. Detailed procedures remain in the plugin skills so user
32
32
  handbooks do not accumulate duplicated prompt sediment.
33
33
 
34
+ The decision boundary is intentionally short but normative: project-bound owner
35
+ choices use one resumable DB-backed thread; the host resolves observable facts first,
36
+ presents only one current decision with evidence and a recommendation, and stores the
37
+ normalized result rather than conversation text. Matching workflows remain gated until
38
+ blocking choices are resolved and the owner-approved artifact checkpoint is current.
39
+
34
40
  ## Managed-block contract
35
41
 
36
42
  The owned content is bounded by: