ultra-builder-pro-cli 0.19.1 → 0.21.1

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 (103) hide show
  1. package/.ultra-template/docs/research/README.md +26 -5
  2. package/.ultra-template/specs/discovery.md +1 -1
  3. package/.ultra-template/tasks/tasks.json +1 -1
  4. package/CHANGELOG.md +90 -1
  5. package/README.md +62 -29
  6. package/adapters/_shared/codex-assets.cjs +69 -11
  7. package/adapters/_shared/interaction-contract.cjs +60 -5
  8. package/adapters/_shared/runtime-assets.cjs +41 -1
  9. package/adapters/claude.js +7 -5
  10. package/adapters/codex.js +1 -1
  11. package/adapters/kimi.js +2 -8
  12. package/adapters/opencode.js +30 -28
  13. package/bin/orchestrator.js +64 -24
  14. package/commands/ultra-research.md +1 -1
  15. package/docs/AGENT-CONTEXT.md +79 -45
  16. package/docs/ARCHITECTURE.md +75 -38
  17. package/docs/ARTIFACT-AUTHORITY.md +234 -0
  18. package/docs/DECISIONS.md +20 -10
  19. package/docs/LEGACY-CLI-CROSSWALK.md +15 -11
  20. package/docs/PLUGIN-ISOLATION-CONTRACT.md +4 -3
  21. package/docs/ROADMAP.md +21 -6
  22. package/docs/RUNTIME-COMPAT-MATRIX.md +30 -13
  23. package/docs/STATE-DB-ACCESS-POLICY.md +11 -9
  24. package/docs/WORKFLOW-LIFECYCLE.md +105 -54
  25. package/hooks/README.md +6 -5
  26. package/hooks/active_task_context.py +97 -12
  27. package/hooks/context_spine.py +16 -4
  28. package/hooks/health_check.py +5 -4
  29. package/hooks/pre_stop_check.py +5 -2
  30. package/hooks/runtime_paths.py +396 -0
  31. package/hooks/subagent_tracker.py +5 -2
  32. package/hooks/workflow_checkpoint.py +16 -3
  33. package/hooks/workflow_context.py +11 -3
  34. package/hooks/workflow_resume.py +7 -4
  35. package/mcp-server/breadcrumb.cjs +20 -2
  36. package/mcp-server/lib/archive-journal.cjs +1026 -111
  37. package/mcp-server/lib/archive-mutation-worker.py +365 -0
  38. package/mcp-server/lib/artifact-registry.cjs +1126 -0
  39. package/mcp-server/lib/baseline-workflow.cjs +9 -4
  40. package/mcp-server/lib/change-packet.cjs +818 -0
  41. package/mcp-server/lib/change-workflow.cjs +932 -176
  42. package/mcp-server/lib/context-paths.cjs +111 -0
  43. package/mcp-server/lib/context-spine.cjs +511 -45
  44. package/mcp-server/lib/decision-dialogue.cjs +427 -12
  45. package/mcp-server/lib/delivery-transaction.cjs +471 -0
  46. package/mcp-server/lib/doctor-backup-worker.cjs +328 -0
  47. package/mcp-server/lib/doctor.cjs +375 -12
  48. package/mcp-server/lib/git-bootstrap.cjs +459 -47
  49. package/mcp-server/lib/init-project.cjs +190 -95
  50. package/mcp-server/lib/plan-publication-worker.cjs +830 -0
  51. package/mcp-server/lib/plan-store.cjs +700 -5
  52. package/mcp-server/lib/project-breadcrumb.cjs +23 -4
  53. package/mcp-server/lib/projector.cjs +174 -40
  54. package/mcp-server/lib/runtime-paths.cjs +1687 -0
  55. package/mcp-server/lib/safe-project-file.cjs +385 -0
  56. package/mcp-server/lib/spec-learning.cjs +28 -12
  57. package/mcp-server/lib/state-db.cjs +397 -13
  58. package/mcp-server/lib/state-ops.cjs +248 -49
  59. package/mcp-server/lib/telemetry.cjs +12 -3
  60. package/mcp-server/lib/workflow-state.cjs +614 -62
  61. package/mcp-server/server.cjs +282 -33
  62. package/orchestrator/daemon.cjs +2 -10
  63. package/orchestrator/parallel-orchestrator.cjs +314 -50
  64. package/orchestrator/planner/plan-builder.cjs +1 -1
  65. package/orchestrator/recovery.cjs +125 -7
  66. package/orchestrator/session-close-journal-worker.cjs +5 -0
  67. package/orchestrator/session-close-journal.cjs +1014 -0
  68. package/orchestrator/session-runner.cjs +679 -69
  69. package/orchestrator/worktree-manager.cjs +186 -35
  70. package/package.json +2 -3
  71. package/skills/cc-collab/SKILL.md +4 -1
  72. package/skills/codex-collab/SKILL.md +5 -2
  73. package/skills/ultra-change/SKILL.md +38 -13
  74. package/skills/ultra-deliver/SKILL.md +23 -11
  75. package/skills/ultra-dev/SKILL.md +33 -6
  76. package/skills/ultra-doctor/SKILL.md +6 -2
  77. package/skills/ultra-init/SKILL.md +4 -2
  78. package/skills/ultra-plan/SKILL.md +68 -18
  79. package/skills/ultra-research/SKILL.md +45 -32
  80. package/skills/ultra-review/SKILL.md +9 -5
  81. package/skills/ultra-status/SKILL.md +9 -4
  82. package/skills/ultra-test/SKILL.md +15 -7
  83. package/skills/ultra-think/SKILL.md +6 -0
  84. package/skills/ultra-think/references/decision-dialogue.md +61 -14
  85. package/skills/ultra-verify/SKILL.md +4 -1
  86. package/spec/cli-protocol.md +19 -7
  87. package/spec/mcp-tools.yaml +531 -46
  88. package/spec/schemas/change-delta.v1.schema.json +153 -0
  89. package/spec/schemas/documentation-reconciliation.v1.schema.json +106 -0
  90. package/spec/schemas/mcp-tools.schema.json +1 -1
  91. package/spec/schemas/state-db.sql +57 -17
  92. package/spec/schemas/tasks.v4.5.schema.json +1 -1
  93. package/ultra-tools/cli.cjs +3 -2
  94. package/ultra-tools/commands/db.cjs +76 -25
  95. package/ultra-tools/commands/migrate.cjs +995 -80
  96. package/ultra-tools/commands/session.cjs +34 -8
  97. package/ultra-tools/commands/status.cjs +34 -7
  98. package/ultra-tools/commands/system.cjs +129 -22
  99. package/commands/learn.md +0 -10
  100. package/orchestrator/skill-miner.cjs +0 -133
  101. package/output-styles/coding-vibes.md +0 -67
  102. package/output-styles/structural-thinking.md +0 -61
  103. package/skills/learn/SKILL.md +0 -58
@@ -11,21 +11,47 @@ accepted Change Contract without adding ceremonial approval.
11
11
 
12
12
  ## Bind current authority
13
13
 
14
- 1. Read doctor, baseline, change, decisions, existing plan runs, tasks, and current
15
- checkout.
14
+ 1. Read doctor, baseline, change, breadcrumb `accepted_intent`, decisions, existing plan
15
+ runs, tasks, and current checkout.
16
16
  2. Require one mutable change with a healthy baseline or recorded incident bypass.
17
+ For the first delivery of a greenfield project, an accepted ready baseline may
18
+ already contain the complete delivery outcome. When no matching Change exists,
19
+ materialize one `change.create` contract from that accepted intent and read it back
20
+ without asking the owner to repeat the same choice. Do not invent scope, expand an
21
+ incomplete baseline, or use this shortcut for a later change.
17
22
  3. Complete the exact change-bound research disposition before planning.
18
- 4. Resume the matching plan run or start one bound to the change and baseline.
23
+ 4. For a standard or major Change, read the current registered `change.delta` and
24
+ verify its baseline anchors and digest. A Direct Build route supplies the delta
25
+ directly from accepted intent; it skips Research, not this authority boundary.
26
+ 5. Resume the matching plan run. Do not start a new run until planning posture is
27
+ accepted.
19
28
 
20
29
  Read `references/semantic-preflight.md` and inspect requirements, real consumers,
21
30
  state, tests, deployment, and recovery paths.
22
31
 
32
+ ## Align planning posture
33
+
34
+ Use the interaction protocol in `../ultra-think/references/decision-dialogue.md`.
35
+ Normalize a posture already explicit in current intent. Otherwise recommend one based
36
+ on the Change Contract, explain its scope effect, and use the host's native question
37
+ surface:
38
+
39
+ - `EXPAND`: surface evidence-backed opportunities beyond accepted scope;
40
+ - `SELECTIVE`: hold accepted scope and offer optional expansions individually;
41
+ - `HOLD`: preserve scope and strengthen completeness, failure handling, and recovery;
42
+ - `REDUCE`: propose the smallest outcome that still satisfies revised acceptance.
43
+
44
+ The user may select, modify, delegate, or defer the posture. Stop on an unanswered
45
+ choice. Start `workflow.start` only after alignment and store `planning_posture` plus
46
+ its rationale in workflow metadata. This is a scope boundary, not approval of the
47
+ eventual technical design.
48
+
23
49
  ## Design with model autonomy
24
50
 
25
- Build a candidate plan privately. Ask the user only if the plan would change accepted
51
+ Build a candidate plan from the Change Contract, current typed delta, and any selected
52
+ research. Ask the user only if the plan would change accepted
26
53
  scope, public behavior, compatibility, security, material cost, external effects, or
27
- recovery. Use the host's native question UI when available and the interaction protocol
28
- in `../ultra-think/references/decision-dialogue.md`.
54
+ recovery. Use the same host-native interaction protocol.
29
55
 
30
56
  When the candidate remains inside the accepted Change Contract, proceed without a
31
57
  second approval. A user may still request a plan review before persistence; that is an
@@ -34,26 +60,42 @@ interaction preference, not a runtime invariant.
34
60
  Record:
35
61
 
36
62
  1. `validate-baseline`
37
- 2. `analyze-requirements`
38
- 3. `analyze-codebase`
39
- 4. `design-slices`
40
- 5. `validate-dependencies`
41
- 6. `persist-task-contracts`
42
- 7. `verify-plan`
63
+ 2. `compile-context`
64
+ 3. `analyze-requirements`
65
+ 4. `analyze-codebase`
66
+ 5. `design-slices`
67
+ 6. `validate-dependencies`
68
+ 7. `persist-task-contracts`
69
+ 8. `verify-plan`
43
70
 
44
71
  Design a walking skeleton and subsequent vertical slices. Every slice reaches a real
45
72
  consumer and owns its validation, side effects, errors, documentation, migration,
46
73
  observability, and recovery obligations. Avoid unconsumed horizontal scaffolding.
47
74
 
75
+ After starting or resuming the workflow, compile `change.context` with `role: plan`
76
+ and `gate: planning`. Record its immutable manifest as the `compile-context` output.
77
+ The packet is the accepted planning input, not a mutable plan draft. `change.context`
78
+ must not update Change provider references; persist new provider metadata with
79
+ `change.update` before recompiling.
80
+
48
81
  ## Persist task contracts
49
82
 
50
83
  Create each task with:
51
84
 
52
- - observable outcome and stable trace;
85
+ - observable outcome (`purpose`) and stable trace (`why`);
53
86
  - `slice_kind`, public seam, and exact verification command;
54
87
  - structured acceptance mapped to Change acceptance ids;
55
- - bounded context refs and reasons;
56
- - documentation impact, ownership, dependencies, and affected files when known.
88
+ - target seams and affected files when known;
89
+ - bounded pattern/context refs with a reason, optional anchor and scope, and an
90
+ explicit freshness policy;
91
+ - documentation impact, ownership, and dependencies.
92
+
93
+ Use `digest` freshness with `expected_digest` for accepted inputs that must remain
94
+ byte-current. Use `existence` for source targets expected to change during
95
+ implementation. Use `advisory` only when drift should be visible but non-blocking.
96
+ The compiled task context restores constraints and non-goals from the Change Contract,
97
+ plus acceptance, recovery, documentation impact, and the definition of drift. Keep
98
+ large referenced files lazy; do not paste their bodies into the plan packet.
57
99
 
58
100
  Use estimates only when evidence supports them. A quick change has exactly one task.
59
101
  Read every task back from DB. Never read or write `.ultra/tasks/tasks.json` directly;
@@ -66,8 +108,13 @@ evidence. Rebind the complete execution contract while clearing `stale` through
66
108
  the current Change authority digest. Never clear staleness merely to pass a gate.
67
109
 
68
110
  Validate the change-scoped graph with `task.dependency_topo`. Export
69
- `.ultra/execution-plan.json` with `plan.export`, read it through `plan.get`, and record
70
- it as the `verify-plan` output.
111
+ the deterministic `<artifact_root>/plan.json` and `<artifact_root>/plan.md` pair with
112
+ `plan.export { change_id }`. The JSON binds the exact planning context snapshot and
113
+ manifest digest; the Markdown is a deterministic human view of the same task graph.
114
+ Read the JSON through `plan.get` and record it as the `verify-plan` output. Do not
115
+ choose an arbitrary output path or overwrite another Change's plan. A legacy global
116
+ `.ultra/execution-plan.json` may be read for migration diagnosis only and is never a
117
+ current write target.
71
118
 
72
119
  Call `workflow.complete`. `approval` is optional: include it only when a material plan
73
120
  decision actually required and received user approval. MCP derives task coverage and
@@ -75,8 +122,11 @@ topology from DB and must reject incomplete contracts, uncovered acceptance, cyc
75
122
  cross-change tasks, stale research, or a mismatched export.
76
123
 
77
124
  Do not advance or complete the Change workflow; change capture is already complete.
78
- Compile task context later for the consumer that needs it.
125
+ Compile a separate task context later for each consumer that needs it. Planning,
126
+ implementation, testing, review, and convergence snapshots are not interchangeable.
79
127
 
80
128
  Return topology, first executable slices, public seams, verification commands, plan
81
129
  workflow id, and allowed transitions. The host may recommend parallel or sequential
82
130
  execution based on dependency and conflict evidence.
131
+
132
+ Never invoke the recommended capability here; wait for an explicit user invocation.
@@ -1,36 +1,39 @@
1
1
  ---
2
2
  name: ultra-research
3
- description: Build or refresh an evidence-backed product and architecture baseline with model-selected semantic coverage and low-load user alignment. Use when initialization, brownfield adoption, or an active change has a real evidence gap.
3
+ description: Build or refresh an evidence-backed product and architecture baseline through recommended, user-selected semantic coverage and low-load alignment. Use when initialization, brownfield adoption, or an active change has a real evidence gap.
4
4
  ---
5
5
 
6
6
  # Research with adaptive coverage
7
7
 
8
- The host model owns investigation, synthesis, and coverage judgment. Ultra MCP owns the
9
- run, evidence references, semantic records, artifact digests, freshness, and
10
- convergence. The reference areas are an optional coverage catalog, not a mandatory
11
- questionnaire or a fixed sequence of user conversations.
8
+ The model owns investigation, synthesis, and coverage recommendations; the user owns
9
+ the accepted semantic route and material deferrals. MCP owns run state, evidence,
10
+ semantic records, digests, freshness, and convergence, not a questionnaire.
12
11
 
13
12
  Read `../ultra-think/references/decision-dialogue.md` before asking a material question.
14
13
 
15
14
  ## Bind authority
16
15
 
17
- 1. Read `system.doctor`, `baseline.get`, active decisions, and existing research runs.
16
+ 1. Read `system.doctor`, `baseline.get`, breadcrumb `accepted_intent`, active decisions,
17
+ and existing research runs.
18
18
  2. Resume the matching active, blocked, or ready run. Do not create parallel authority.
19
- 3. If none exists, select:
20
- - `full` for a greenfield baseline;
21
- - `adoption` for a brownfield baseline;
22
- - a bounded mode only for a recorded active-change research disposition.
19
+ 3. If none exists, use `full` for greenfield, `adoption` for brownfield, or a bounded
20
+ mode only for a recorded active-Change disposition. Focused baseline coverage
21
+ remains `full` or `adoption`; `custom` is Change-bound only.
23
22
  4. Before `workflow.start`, inspect current code, docs, tests, runtime, and prior
24
- artifacts. Select the smallest sufficient set of applicable catalog areas. Include
25
- only areas that need work or whose exclusion must remain auditable:
26
- - `execute`: produce fresh evidence;
27
- - `verify_existing`: verify a current artifact against its source;
28
- - `reuse`: reuse evidence that is still current;
29
- - `not_applicable`: exclude with an evidence reference and rationale;
30
- - `deferred`: record the consequence and owner acceptance when deferral changes the
31
- accepted scope or leaves material risk.
32
- 5. Pass the evidence-based coverage rationale as `metadata.selection_reason`. Omitted
23
+ artifacts. Recommend the smallest sufficient set of applicable catalog areas.
24
+ Explain the net effect without dumping all 17 areas. Offer at most three credible
25
+ routes: the recommended adaptive set, the full catalog, and a focused or custom set.
26
+ 5. If current user intent does not already select a route, use the host's native
27
+ structured question surface. The user selects, modifies, delegates, or defers.
28
+ Treat a dismissal as unanswered, stop, and perform no route-dependent write.
29
+ 6. Normalize the answer and persist the accepted coverage through `workflow.start`.
30
+ Use `execute` for fresh evidence, `verify_existing` for source validation, `reuse`
31
+ for current evidence, `not_applicable` with evidence and rationale, or `deferred`
32
+ with consequence and owner acceptance when scope or material risk changes.
33
+ 7. Pass the evidence-based coverage rationale as `metadata.selection_reason`. Omitted
33
34
  catalog areas create no DB step and need no ceremonial disposition.
35
+ 8. Read back the created workflow and accepted coverage. When a durable decision thread
36
+ recorded the route, complete it with the workflow reference in `applied_refs`.
34
37
 
35
38
  `99-synthesis` must execute, verify, or reuse. A missing disposition is a coverage
36
39
  error only for an included area; a recorded exclusion with evidence is not incomplete.
@@ -69,15 +72,20 @@ For each active area:
69
72
  artifact. Do not copy prompts, transcripts, provider payloads, or internal chain of
70
73
  thought.
71
74
 
72
- For every required workflow step, write
73
- `.ultra/docs/research/<workflow-id>/<step-id>.md` with `Evidence`,
74
- `Specification updates`, and `Decisions and unknowns`. Call `workflow.step` with
75
- bounded evidence, the report output, and typed semantic records. Reused or verified
76
- evidence must still produce a current report and digest. Block the same step when
77
- required evidence or owner authority is missing.
75
+ Every required step writes `Evidence`, `Specification updates`, and `Decisions and
76
+ unknowns` to `.ultra/docs/research/<workflow-id>/<step-id>.md` for a baseline, or
77
+ `<change-root>/research/<workflow-id>/<step-id>.md` for an active Change.
78
+
79
+ Call `workflow.step` with bounded evidence, the report output, and typed semantic
80
+ records. Reused or verified evidence must still produce a current report and digest.
81
+ Block the same step when required evidence or owner authority is missing. For Change
82
+ research, keep `findings.md` and every semantic output inside the same Change root and
83
+ register them through workflow outputs; do not write baseline specifications.
78
84
 
79
85
  At synthesis, bind the current `discovery.md`, `product.md`, `architecture.md`, and
80
- `research-distillate.md` for initial/adoption research.
86
+ `research-distillate.md` only for initial/adoption research. Change-bound synthesis
87
+ updates the Change findings and specification overlay, then records or refreshes
88
+ `change.delta`. It never mutates the accepted baseline.
81
89
 
82
90
  ## Baseline convergence
83
91
 
@@ -96,11 +104,16 @@ known failures, blocking gaps, and scope. Reuse an unambiguous current approval;
96
104
  ask twice. MCP must reject stale research, drift, missing evidence, and unaccepted
97
105
  failures.
98
106
 
99
- Reuse the final research checkpoint approval during baseline convergence; do not ask
100
- for an equivalent approval again. After initial or adoption convergence,
101
- `ultra-change` becomes an available transition. Bounded change research returns to
102
- its owning Change authority.
107
+ Reuse the final research acceptance or current artifact checkpoint during baseline
108
+ convergence; do not ask for an equivalent approval again. After initial or adoption
109
+ convergence, `ultra-change` becomes an available transition. Bounded change research
110
+ returns to its owning Change authority; the next route is still `ultra-plan`, never
111
+ direct implementation.
103
112
 
104
113
  Return a compact coverage summary by disposition, current evidence or decision
105
- blocker, baseline state, gaps, and allowed transitions. The host chooses the semantic
106
- recommendation; MCP supplies only valid and required transitions.
114
+ blocker, baseline state, gaps, and allowed transitions. Recommend a semantic next
115
+ action from those transitions. If current intent does not already select it, present
116
+ the recommendation and credible alternatives through the interaction protocol, then
117
+ wait. MCP supplies only valid and required transitions.
118
+
119
+ Never invoke the recommended capability here; wait for an explicit user invocation.
@@ -18,7 +18,7 @@ Neither axis can compensate for the other.
18
18
  1. Read `references/review-modes.md` and select `plan`, `task`, or `change` from the
19
19
  actual review request.
20
20
  2. Bind one explicit diff or plan artifact, full HEAD, worktree digest, task set,
21
- acceptance, and current decision state.
21
+ acceptance, breadcrumb `accepted_intent`, and current decision state.
22
22
  3. Resume or start the review workflow and record `bind-diff`.
23
23
  4. Compile `change.context` for `review` and record the immutable manifest under
24
24
  `compile-context`.
@@ -37,8 +37,9 @@ not decide owner choices or edit source.
37
37
 
38
38
  Resolve `references/unified-schema.md` from this Skill directory and pass its absolute
39
39
  path as `SCHEMA_PATH`. Validate specialist artifacts with
40
- `scripts/review_wait.py`. Record outputs under `review-specification`,
41
- `review-engineering`, and `coordinate-findings`.
40
+ `scripts/review_wait.py`. Store all specialist artifacts and `SUMMARY.json` below
41
+ `.ultra/changes/active/<change-id>/review/<workflow-id>/`. Record outputs under
42
+ `review-specification`, `review-engineering`, and `coordinate-findings`.
42
43
 
43
44
  The coordinator preserves every finding unchanged in `SUMMARY.json`; it may group
44
45
  duplicate root causes only in the human summary. A new material owner choice remains a
@@ -52,5 +53,8 @@ the durable verdict and rejects missing specialists, lossy coordination, stale
52
53
  artifacts, or prompt-supplied conclusions.
53
54
 
54
55
  Any relevant code, test, specification, or contract edit invalidates the affected
55
- review evidence. Return both verdict axes, blocking findings, reviewed scope, worker
56
- selection rationale, artifact digests, and allowed transitions.
56
+ review evidence through registered provenance edges; unrelated evidence remains
57
+ current. Return both verdict axes, blocking findings, reviewed scope, worker selection
58
+ rationale, artifact digests, and allowed transitions.
59
+
60
+ Never invoke the recommended capability here; wait for an explicit user invocation.
@@ -13,9 +13,11 @@ frontmatter when DB authority is missing or degraded.
13
13
  1. Run `system.doctor` without repair.
14
14
  2. Read baseline classification, revision, worktree, research provenance, gaps, and
15
15
  health.
16
- 3. Read current decision state without exposing hidden future questions.
16
+ 3. Read current decision state and breadcrumb `accepted_intent` without exposing hidden
17
+ future questions.
17
18
  4. Read active, blocked, and ready workflows and their current steps.
18
- 5. Read breadcrumb, changes, tasks, sessions, and current Git state.
19
+ 5. Read the active Change root, typed delta, plan, deterministic progress projection,
20
+ documentation reconciliation, findings, tasks, sessions, and current Git state.
19
21
  6. Read test, review, and delivery artifacts only through DB references and verify
20
22
  their digests and revisions.
21
23
 
@@ -42,8 +44,9 @@ Ultra: <healthy|degraded> · <branch>@<head|unborn|non-git> · worktree <state>
42
44
  Baseline: <mode>/<status> · research=<run/status> · gaps=<open>/<blocking>
43
45
  Workflow: <kind/id/status> · step=<current|complete> · outputs=<fresh|stale>
44
46
  Decision: <current|checkpoint|none>
45
- Change: <id/status|none> · Task: <id/status|none> · Sessions: <active>
46
- Evidence: test=<state> · review=<axes> · delivery=<state>
47
+ Change: <id/status|none> · delta=<fresh|stale|missing> · docs=<fresh|stale|missing>
48
+ Task: <id/status|none> · Sessions: <active>
49
+ Evidence: plan=<state> · test=<state> · review=<axes> · delivery=<state>
47
50
  Blockers: <codes or none>
48
51
  Warnings: <codes or none>
49
52
  Allowed transitions: <capabilities>
@@ -52,3 +55,5 @@ Host recommendation: <capability and concise rationale>
52
55
  ```
53
56
 
54
57
  Separate verified facts, host inference, and unavailable evidence.
58
+
59
+ Never invoke the recommended capability here; wait for an explicit user invocation.
@@ -10,8 +10,8 @@ projections as proof.
10
10
 
11
11
  ## Bind scope
12
12
 
13
- 1. Read doctor, change, breadcrumb, decisions, task and dev evidence, current checkout,
14
- and prior report freshness.
13
+ 1. Read doctor, change, breadcrumb `accepted_intent`, decisions, task and dev evidence,
14
+ current checkout, and prior report freshness.
15
15
  2. Resume or start a test workflow bound to the exact change and optional task.
16
16
  3. Record `bind-scope`, then compile `change.context` for `check` and record its
17
17
  immutable manifest under `compile-context`.
@@ -47,10 +47,12 @@ question UI and decision protocol; testing must not choose the desired outcome.
47
47
 
48
48
  ## Report
49
49
 
50
- Write `.ultra/reports/tests/<workflow-id>.json` with
50
+ Write
51
+ `.ultra/changes/active/<change-id>/test/<workflow-id>/report.json` with
51
52
  `ultra-test-report-v1`, binding:
52
53
 
53
- - change, exact task ids, HEAD, worktree digest, and checking-context digest;
54
+ - change, exact task ids, current Change acceptance ids, HEAD, worktree digest, and
55
+ checking-context digest;
54
56
  - acceptance mapping, commands, public seams, failures, and recovery evidence;
55
57
  - `verification_profile` and the selected `verification_dimensions`;
56
58
  - regression signal when required;
@@ -58,8 +60,14 @@ Write `.ultra/reports/tests/<workflow-id>.json` with
58
60
 
59
61
  Record `execute-checks`, `verify-public-seam`, and `write-report`, then re-read the
60
62
  report and current checkout before `verify-test-gate`. `workflow.complete` derives its
61
- summary from the report and rejects stale, malformed, or contradictory evidence.
63
+ summary from the report and rejects stale, malformed, contradictory, out-of-Change,
64
+ or acceptance-incomplete evidence.
62
65
 
63
66
  Return the profile, exact results, verified seams, blockers, report digest, workflow
64
- state, and allowed transitions. The host decides whether a broader review, more
65
- implementation, or delivery is appropriate.
67
+ state, and allowed transitions. Recommend broader review, more implementation, or
68
+ delivery from those transitions. If current intent does not already select the
69
+ semantic next action, use
70
+ `../ultra-think/references/decision-dialogue.md` and wait for the user to select,
71
+ modify, delegate, or defer it.
72
+
73
+ Never invoke the recommended capability here; wait for an explicit user invocation.
@@ -37,6 +37,10 @@ Do not expose the hidden decision queue.
37
37
  For durable project decisions, use `decision.thread_start`, `decision.open`, and the
38
38
  appropriate resolve, delegate, defer, or supersede transition. Store normalized
39
39
  decisions and artifact references, never transcripts or internal reasoning.
40
+ Apply any resulting change through its owning baseline, change, workflow, task, or
41
+ semantic artifact operation, read it back, and pass typed `applied_refs` to
42
+ `decision.complete`. If the decision record itself is the complete durable authority,
43
+ the list may be empty. Completion is not another owner approval.
40
44
 
41
45
  Prepare and confirm a checkpoint only when the decision changes a durable contract or
42
46
  artifact and a checkpoint is needed for recovery. Do not add a ceremonial approval
@@ -49,3 +53,5 @@ contracts. Re-read the invoking workflow or breadcrumb and recommend one of its
49
53
  `allowed_transitions`; follow `required_transition` only when a hard invariant leaves
50
54
  no alternative. Thinking does not implement code, mutate unrelated state, or invent a
51
55
  canonical next action.
56
+
57
+ Never invoke the recommended capability here; wait for an explicit user invocation.
@@ -10,6 +10,7 @@ The user owns:
10
10
 
11
11
  - product intent and accepted outcomes;
12
12
  - material scope, compatibility, security, cost, and recovery tradeoffs;
13
+ - semantic route selection and risk acceptance;
13
14
  - authorization for destructive or external effects.
14
15
 
15
16
  The model owns:
@@ -22,15 +23,40 @@ The model owns:
22
23
  MCP owns durable state, evidence references, digests, freshness, locks, valid
23
24
  transitions, and hard invariants. It does not choose semantic intent.
24
25
 
26
+ ## Follow the common selection flow
27
+
28
+ 1. **Inspect** repository authority, source, runtime, tests, and relevant primary
29
+ sources.
30
+ 2. **Suggest** one recommendation and only credible alternatives, with their effects.
31
+ 3. **Ask** through the host-native structured question surface only when current user
32
+ intent does not already resolve the material choice.
33
+ 4. **Normalize** a direct choice, modified route, delegation, or deferral. Treat a
34
+ dismissed question as unanswered.
35
+ 5. **Persist** the normalized result through MCP, then trust the DB record as current
36
+ authority across sessions.
37
+ 6. **Apply** the result to its owning baseline, change, workflow, task, specification,
38
+ or artifact when that authority has a corresponding field or content boundary.
39
+ 7. **Read back** the normalized decision and every changed owning authority before
40
+ continuing.
41
+
42
+ The DB treats normalized intent as current authority. It does not prove that the user
43
+ selected it, store a host interaction receipt, or judge whether the choice was wise.
44
+ The host interaction is the semantic gate; MCP validates state shape, bindings,
45
+ freshness, and legal transitions.
46
+
47
+ When an unanswered material question must survive interruption, `decision.open` stores
48
+ that pending question before the host presents it. A pending question is recovery
49
+ state, not accepted user intent. Only the normalized resolution becomes intent
50
+ authority.
51
+
25
52
  ## Decide whether to ask
26
53
 
27
54
  Before asking:
28
55
 
29
- 1. Inspect repository authority, source, runtime, tests, and relevant primary sources.
30
- 2. Separate `Observed`, `Verified`, `Decided`, `Delegated`, and `Unknown`.
31
- 3. Resolve evidence-answerable unknowns autonomously.
32
- 4. Normalize clear decisions already present in the user's current request.
33
- 5. Ask only if the remaining choice changes accepted intent, public behavior,
56
+ 1. Separate `Observed`, `Verified`, `Decided`, `Delegated`, and `Unknown`.
57
+ 2. Resolve evidence-answerable unknowns autonomously.
58
+ 3. Normalize clear decisions already present in the user's current request.
59
+ 4. Ask only if the remaining choice changes accepted intent, public behavior,
34
60
  compatibility, security, material cost, external effects, or recovery.
35
61
 
36
62
  Do not ask about a reversible implementation detail already delegated by the contract.
@@ -50,8 +76,11 @@ that choice itself changes the outcome.
50
76
  ## Present questions
51
77
 
52
78
  Use the host-native structured question surface declared by the installed interaction
53
- contract when it exists. If that surface is unavailable in the current mode, ask one
54
- concise direct question instead of inventing a tool or foreign-host syntax.
79
+ contract when it exists. If that surface is unavailable but normal conversation is
80
+ permitted, ask one concise direct question instead of inventing a tool or foreign-host
81
+ syntax. If the host mode forbids interaction entirely, keep the choice unanswered and
82
+ stop before any route-dependent write. Do not convert host unavailability into
83
+ delegated authority.
55
84
 
56
85
  Ask one question only for a dependent decision. STOP is mandatory after presenting
57
86
  that question: do not perform writes whose meaning depends on an unanswered choice.
@@ -70,27 +99,40 @@ low-cognitive-load facts when seeing them together improves consistency. Never d
70
99
  questionnaire, hidden queue, or every research area.
71
100
 
72
101
  The question tool or direct question ends the current interaction naturally.
102
+ A dismissed or unavailable response is not acceptance of the recommendation.
73
103
 
74
- ## Persist only when recovery needs it
104
+ ## Persist normalized authority
75
105
 
76
106
  For a project-bound material decision:
77
107
 
78
- 1. Call `decision.list` and resume a matching active decision thread, or use
79
- `decision.thread_start` for one new baseline-, change-, or workflow-bound thread.
80
- 2. Use `decision.open` for only the current decision with evidence refs, recommendation, credible
81
- alternatives, effects, and blocking consequence.
108
+ 1. Read breadcrumb `accepted_intent`, call `decision.list`, and resume a matching active
109
+ decision thread, or use `decision.thread_start` for one new baseline-, change-, or
110
+ workflow-bound thread.
111
+ 2. Use `decision.open` before presenting only the current decision, with evidence refs,
112
+ recommendation, credible alternatives, effects, and its real blocking consequence.
113
+ A non-blocking follow-up must not become a global workflow gate.
82
114
  3. After the answer:
83
115
  - `decision.resolve` for a direct user choice;
84
116
  - `decision.delegate` for explicit model delegation;
85
117
  - `decision.defer` with consequence and revisit condition;
86
118
  - `decision.supersede` when accepted intent actually changed.
87
- 4. Use `decision.checkpoint` only for the digest-bound recovery boundary described
88
- below.
119
+ 4. Apply the normalized result through the owning MCP operation or update the smallest
120
+ relevant semantic artifact. Do not leave a material answer only in conversation.
121
+ 5. Read back the owning baseline, change, workflow, task, specification digest, or
122
+ artifact record. If another authority changed, pass its typed reference in
123
+ `decision.complete.applied_refs`.
124
+ 6. Call `decision.complete` only after that read-back. This closes lifecycle state; it
125
+ is not another user approval. If the decision record itself is the complete durable
126
+ authority, `applied_refs` may remain empty.
127
+ 7. Use `decision.checkpoint` instead only for the digest-bound recovery boundary
128
+ described below.
89
129
 
90
130
  Keep fact acquisition autonomous and decision authority explicit.
91
131
  Never store raw prompts or transcripts; store normalized decisions, not internal
92
132
  chain of thought.
93
133
  Do not require a redundant confirmation after an unambiguous answer.
134
+ An answered thread with no open or blocking deferred decision does not require a
135
+ checkpoint merely to prove intent.
94
136
 
95
137
  Use a checkpoint only when a coherent decision cluster changes a durable contract or
96
138
  artifact and interruption recovery requires a digest-bound boundary. Present the
@@ -98,6 +140,11 @@ compact effect once, obtain any missing approval, update the artifact, and confi
98
140
  digest. Do not create ceremonial checkpoints for routine implementation detail or an
99
141
  already explicit current instruction.
100
142
 
143
+ Every checkpoint binds the normalized decision digest. Change- and workflow-bound
144
+ checkpoints also require at least one current artifact digest. A standalone baseline
145
+ thread may instead record a specific `no_artifact_reason` when no durable artifact
146
+ exists; that exception does not create interaction proof.
147
+
101
148
  ## Return to the capability graph
102
149
 
103
150
  After alignment, re-read the invoking workflow and breadcrumb. A
@@ -20,8 +20,9 @@ never recurse into the current host or treat advisor output as authority.
20
20
 
21
21
  1. Define the workspace, question, evidence standard, and response shape. Confirm the
22
22
  selected advisor CLI and authentication. Exclude secrets and unrelated files.
23
- 2. Create `.ultra/collab/<session-id>/` and write the current host's independent,
23
+ 2. Create `.ultra/.runtime/collab/<session-id>/` and write the current host's independent,
24
24
  evidence-backed analysis to `host-analysis.md` before reading advisor output.
25
+ Treat the directory as working scratch, not Ultra authority.
25
26
  3. Follow the installed collaboration companion's read-only invocation contract. Give
26
27
  the advisor the same bounded question and evidence, without the primary conclusion
27
28
  when independence matters. Store its result as `advisor-output.md` and diagnostics
@@ -34,6 +35,8 @@ never recurse into the current host or treat advisor output as authority.
34
35
  primary documentation. Explain scope, version, evidence, and assumption differences
35
36
  before resolving disagreement.
36
37
  7. Write `metadata.json` and `synthesis.md`, then return one host-owned conclusion.
38
+ Promote only verified conclusions into the invoking DB-bound workflow artifact or
39
+ report; files under `.ultra/.runtime/collab/` remain non-authoritative.
37
40
 
38
41
  Read `references/cross-verify-modes.md` for mode-specific evidence and
39
42
  `references/evidence-status.md` when the synthesis needs an evidence status. Model agreement
@@ -106,6 +106,8 @@ as a fallback unless `ultra-tools <family> --help` lists it.
106
106
  | `baseline.converge` | `baseline converge` | 11 | mcp |
107
107
  | `change.create` | `change create` | 9 | mcp |
108
108
  | `change.update` | `change update` | 9 | mcp |
109
+ | `change.delta` | `change delta` | 21 | mcp |
110
+ | `change.documentation_reconcile` | `change documentation-reconcile` | 21 | mcp |
109
111
  | `change.get` | `change get` | 9 | any |
110
112
  | `change.list` | `change list` | 9 | any |
111
113
  | `change.context` | `change context` | 9 | mcp |
@@ -122,12 +124,17 @@ as a fallback unless `ultra-tools <family> --help` lists it.
122
124
  | `decision.delegate` | `decision delegate` | 16 | mcp |
123
125
  | `decision.defer` | `decision defer` | 16 | mcp |
124
126
  | `decision.supersede` | `decision supersede` | 16 | mcp |
127
+ | `decision.complete` | `decision complete` | 19 | mcp |
125
128
  | `decision.checkpoint` | `decision checkpoint` | 16 | mcp |
126
129
  | `workflow.start` | `workflow start` | 13 | mcp |
127
130
  | `workflow.get` | `workflow get` | 13 | any |
128
131
  | `workflow.list` | `workflow list` | 13 | any |
129
132
  | `workflow.step` | `workflow step` | 13 | mcp |
133
+ | `workflow.revise` | `workflow revise` | 21 | mcp |
134
+ | `workflow.supersede` | `workflow supersede` | 21 | mcp |
130
135
  | `workflow.complete` | `workflow complete` | 13 | mcp |
136
+ | `artifact.record` | `artifact record` | 20 | mcp |
137
+ | `artifact.get` | `artifact get` | 20 | any |
131
138
  | `system.doctor` | `system doctor` | 9 | mcp |
132
139
  | `plan.export` | `plan export` | 8a | mcp |
133
140
  | `plan.get` | `plan get` | 8a | any |
@@ -135,7 +142,7 @@ as a fallback unless `ultra-tools <family> --help` lists it.
135
142
  Current executable maintenance surfaces are `task init-project`,
136
143
  `session close|get|list|admission|heartbeat|subscribe|reap`, `status`, `db`,
137
144
  `migrate`, `system doctor|restore|rebaseline`, and `legacy-memory`. In particular, `task create|update|list|get`
138
- and all `change` and `decision` lifecycle verbs are not CLI fallbacks. Change and decision state must use
145
+ and all `change`, `decision`, and `artifact` lifecycle verbs are not CLI fallbacks. Their state must use
139
146
  the live MCP server; `system doctor` may additionally be exposed by the
140
147
  maintenance CLI because it is the recovery path when MCP startup is degraded.
141
148
  `task init-project --resume` preserves existing `.ultra` files and installs only
@@ -147,7 +154,7 @@ the same Git ancestry and dirty-state verifier as MCP and fails with
147
154
  `system doctor --repair` applies supported schema upgrades with a pre-migration
148
155
  backup before mechanical recovery.
149
156
  `system restore` requires the exact `REPLACE_CORRUPT_ULTRA_STATE` confirmation and a
150
- verified database inside `.ultra/backups`; it quarantines the corrupt state before
157
+ verified database inside `.ultra/.runtime/backups`; it quarantines the corrupt state before
151
158
  atomic replacement. `system rebaseline` requires the exact
152
159
  `REBASELINE_CORRUPT_ULTRA_STATE` confirmation and preserves corrupt state plus the
153
160
  legacy task projection before starting a new brownfield adoption.
@@ -163,13 +170,18 @@ semantics, is a major bump. Major bumps require an entry in
163
170
 
164
171
  ## 7. `ubp-orchestrator`
165
172
 
166
- `ubp-orchestrator execute-plan` consumes the completed and current
167
- `.ultra/execution-plan.json` and resumes from the first unfinished dependency wave.
173
+ `ubp-orchestrator execute-plan` resolves the completed current plan from the active
174
+ Change's DB row and `<artifact_root>/plan.json`, then resumes from the first unfinished
175
+ dependency wave. Use `--change <id>` when more than one active Change has a completed
176
+ plan. The legacy global `.ultra/execution-plan.json` is never selected implicitly;
177
+ `--plan <path>` is explicit read-only migration compatibility for an unbound legacy
178
+ plan and cannot be combined with `--change`.
168
179
  Before creating a session it rejects an empty, malformed, cyclic, duplicate-task, or
169
180
  cross-change plan. For change-owned tasks, the plan must exactly match the current DB
170
- task graph and a healthy completed `plan` workflow; an exported but incomplete or
171
- stale artifact is not executable. A separate owner approval is present only when a
172
- material planning decision required it.
181
+ task graph, planning-context digest, canonical Change artifact paths, and a healthy
182
+ completed `plan` workflow; an exported but incomplete, displaced, or stale artifact is
183
+ not executable. A separate owner approval is present only when a material planning
184
+ decision required it.
173
185
  It returns `status: "paused"` when that wave still has non-terminal Ultra tasks and
174
186
  does not dispatch later waves. Worktrees are preserved unless `--auto-merge` is
175
187
  explicitly supplied and the corresponding change task has an exact completion commit,