ultra-builder-pro-cli 0.15.0 → 0.17.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 (71) hide show
  1. package/.ultra-template/specs/research-distillate.md +4 -3
  2. package/CHANGELOG.md +120 -1
  3. package/README.md +67 -30
  4. package/adapters/_shared/codex-assets.cjs +10 -5
  5. package/adapters/_shared/handbook.cjs +3 -2
  6. package/adapters/_shared/interaction-contract.cjs +61 -0
  7. package/adapters/claude.js +1 -1
  8. package/adapters/opencode.js +1 -1
  9. package/bin/orchestrator.js +175 -19
  10. package/commands/ultra-change.md +1 -1
  11. package/commands/ultra-deliver.md +3 -3
  12. package/commands/ultra-init.md +1 -1
  13. package/commands/ultra-plan.md +1 -1
  14. package/commands/ultra-research.md +2 -2
  15. package/commands/ultra-review.md +10 -0
  16. package/commands/ultra-status.md +1 -1
  17. package/commands/ultra-test.md +1 -1
  18. package/commands/ultra-think.md +2 -2
  19. package/docs/AGENT-CONTEXT.md +38 -18
  20. package/docs/ARCHITECTURE.md +91 -13
  21. package/docs/LEGACY-CLI-CROSSWALK.md +163 -0
  22. package/docs/PLAN.zh-CN.md +19 -12
  23. package/docs/ROADMAP.md +5 -3
  24. package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
  25. package/docs/STATE-DB-ACCESS-POLICY.md +8 -6
  26. package/docs/USER-HANDBOOK-CONTRACT.md +8 -2
  27. package/docs/WORKFLOW-LIFECYCLE.md +179 -39
  28. package/hooks/pre_stop_check.py +3 -2
  29. package/mcp-server/lib/baseline-workflow.cjs +84 -16
  30. package/mcp-server/lib/change-workflow.cjs +107 -39
  31. package/mcp-server/lib/context-spine.cjs +215 -87
  32. package/mcp-server/lib/decision-dialogue.cjs +713 -0
  33. package/mcp-server/lib/doctor.cjs +9 -0
  34. package/mcp-server/lib/git-bootstrap.cjs +240 -0
  35. package/mcp-server/lib/init-project.cjs +178 -41
  36. package/mcp-server/lib/project-breadcrumb.cjs +23 -14
  37. package/mcp-server/lib/state-db.cjs +279 -9
  38. package/mcp-server/lib/state-ops.cjs +64 -1
  39. package/mcp-server/lib/workflow-state.cjs +313 -205
  40. package/mcp-server/server.cjs +112 -34
  41. package/orchestrator/auto-merge.cjs +19 -0
  42. package/orchestrator/daemon.cjs +104 -0
  43. package/orchestrator/parallel-orchestrator.cjs +371 -49
  44. package/orchestrator/session-runner.cjs +354 -25
  45. package/package.json +2 -1
  46. package/skills/ultra-change/SKILL.md +69 -65
  47. package/skills/ultra-deliver/SKILL.md +37 -58
  48. package/skills/ultra-dev/SKILL.md +55 -49
  49. package/skills/ultra-doctor/SKILL.md +44 -49
  50. package/skills/ultra-init/SKILL.md +78 -100
  51. package/skills/ultra-plan/SKILL.md +78 -79
  52. package/skills/ultra-research/SKILL.md +99 -98
  53. package/skills/ultra-review/SKILL.md +38 -47
  54. package/skills/ultra-review/references/review-modes.md +5 -3
  55. package/skills/ultra-review/references/unified-schema.md +26 -6
  56. package/skills/ultra-review/scripts/review_wait.py +12 -0
  57. package/skills/ultra-status/SKILL.md +34 -40
  58. package/skills/ultra-test/SKILL.md +61 -48
  59. package/skills/ultra-think/SKILL.md +47 -47
  60. package/skills/ultra-think/references/decision-dialogue.md +106 -0
  61. package/spec/cli-protocol.md +46 -2
  62. package/spec/mcp-tools.yaml +444 -29
  63. package/spec/schemas/delivery-report.v1.schema.json +1 -46
  64. package/spec/schemas/mcp-tools.schema.json +1 -1
  65. package/spec/schemas/state-db.sql +66 -2
  66. package/spec/schemas/test-report.v1.schema.json +45 -14
  67. package/ultra-tools/cli.cjs +1 -1
  68. package/ultra-tools/commands/session.cjs +10 -3
  69. package/ultra-tools/commands/status.cjs +34 -14
  70. package/ultra-tools/commands/system.cjs +2 -2
  71. package/ultra-tools/commands/task.cjs +3 -0
@@ -1,60 +1,54 @@
1
1
  ---
2
2
  name: ultra-status
3
- description: Report authoritative Ultra project health, baseline, workflow position, task/session progress, evidence freshness, blockers, and one deterministic next action. Use when the user asks what is complete, blocked, stale, or next in an Ultra project.
3
+ description: Read authoritative Ultra health, workflows, decisions, changes, tasks, evidence freshness, and valid transitions. Use when the user asks what is complete, blocked, stale, or currently possible.
4
4
  ---
5
5
 
6
- # Route from authoritative state
6
+ # Report authoritative state
7
7
 
8
- This workflow is read-only. Never reconstruct status from prose or generated task
9
- projections.
8
+ This Skill is read-only. Never fall back to generated task JSON, prose, or context
9
+ frontmatter when DB authority is missing or degraded.
10
10
 
11
- ## Read order
11
+ ## Read
12
12
 
13
- 1. Call `system.doctor` with repair disabled.
14
- 2. Call `baseline.get` for classification, readiness, revision, worktree, spec digests,
15
- research provenance, gaps, and blockers.
16
- 3. Call `workflow.list`, then `workflow.get` for every active, blocked, or ready run.
17
- 4. Call `change.breadcrumb`, `change.list`, `task.list`, and `session.list`.
18
- 5. Inspect current Git branch, full HEAD, and worktree without mutation.
19
- 6. Read test, review, and delivery artifacts only when referenced by DB workflow state;
20
- compare their recorded digest and revision with current authority.
13
+ 1. Run `system.doctor` without repair.
14
+ 2. Read baseline classification, revision, worktree, research provenance, gaps, and
15
+ health.
16
+ 3. Read current decision state without exposing hidden future questions.
17
+ 4. Read active, blocked, and ready workflows and their current steps.
18
+ 5. Read breadcrumb, changes, tasks, sessions, and current Git state.
19
+ 6. Read test, review, and delivery artifacts only through DB references and verify
20
+ their digests and revisions.
21
21
 
22
- If state is unreadable, report that panel unavailable and route to `ultra-doctor`.
23
- Never fall back to generated task JSON, raw SQLite queries, or context frontmatter.
22
+ If authority is unreadable, report the unavailable panel and the required doctor or
23
+ init transition. Do not mutate, compile context, repair, or release.
24
24
 
25
- ## Choose one route
25
+ ## Interpret transitions
26
26
 
27
- Prefer the breadcrumb and durable workflow position:
27
+ MCP reports:
28
28
 
29
- - state integrity, schema, projection, or installed-asset failure: `ultra-doctor`;
30
- - missing project or migrated compatibility authority: `ultra-init`;
31
- - active/blocked research: `ultra-research` at its exact `current_step`;
32
- - ready research with unconverged baseline: finalize research, record, approve, and
33
- converge through `ultra-research`;
34
- - active plan/change/dev/test/review/deliver run: its matching workflow at the exact
35
- step or blocker;
36
- - ready baseline with no change: `ultra-change` to persist the requested outcome before
37
- any planning;
38
- - archived change with fresh evidence: report completion without inventing more work.
29
+ - `allowed_transitions`: mechanically valid capabilities;
30
+ - `required_transition`: the sole recovery route only when a hard invariant permits no
31
+ safe alternative.
39
32
 
40
- Context-size warnings are advisory. Missing authority, stale required refs or outputs,
41
- incomplete task contracts, failed evidence, unresolved learning, and missing approval
42
- are blockers.
43
-
44
- ## Output
33
+ The host model recommends among allowed transitions using the user's current goal,
34
+ workflow evidence, and cost of interruption. Do not present the recommendation as DB
35
+ authority. A healthy project may validly allow research, change, thinking, or status at
36
+ the same time.
45
37
 
46
38
  Report:
47
39
 
48
40
  ```text
49
- Ultra: <healthy|degraded> · <branch>@<head> · worktree <clean|dirty>
41
+ Ultra: <healthy|degraded> · <branch>@<head|unborn|non-git> · worktree <state>
50
42
  Baseline: <mode>/<status> · research=<run/status> · gaps=<open>/<blocking>
51
- Workflow: <kind/id/status> · step=<current|finalize> · outputs=<fresh|stale>
43
+ Workflow: <kind/id/status> · step=<current|complete> · outputs=<fresh|stale>
44
+ Decision: <current|checkpoint|none>
52
45
  Change: <id/status|none> · Task: <id/status|none> · Sessions: <active>
53
- Evidence: test=<state> · review=<two axes> · delivery=<state>
54
- Blockers: <specific codes or none>
55
- Warnings: <advisory codes or none>
56
- Next: <one exact action>
46
+ Evidence: test=<state> · review=<axes> · delivery=<state>
47
+ Blockers: <codes or none>
48
+ Warnings: <codes or none>
49
+ Allowed transitions: <capabilities>
50
+ Required transition: <capability or none>
51
+ Host recommendation: <capability and concise rationale>
57
52
  ```
58
53
 
59
- Separate verified facts, inferences, and unavailable evidence. Do not modify state,
60
- compile context, repair, or release from this Skill.
54
+ Separate verified facts, host inference, and unavailable evidence.
@@ -1,52 +1,65 @@
1
1
  ---
2
2
  name: ultra-test
3
- description: Verify completed Ultra tasks and one current change through independent acceptance, regression, build, public-seam, failure, and recovery evidence. Use when implementation needs a current test gate before review, convergence, or delivery.
3
+ description: Independently verify an Ultra task set or change with an evidence-backed, risk-selected test profile. Use when implementation or current acceptance and recovery evidence needs independent verification.
4
4
  ---
5
5
 
6
- # Verify the current change
7
-
8
- Testing is independent checking. Do not reuse the implementer's conclusions as proof
9
- or use generated task JSON as authority.
10
-
11
- ## Bind and execute
12
-
13
- 1. Read `system.doctor`, `change.breadcrumb`, authoritative tasks, completed dev runs,
14
- current HEAD/diff, and prior test report freshness.
15
- 2. Resume or start a `test` workflow linked to the change and optional task. Record
16
- `bind-scope` with the exact revision, task set, and acceptance ids.
17
- 3. Compile `change.context` for `check`; record `compile-context` only when required
18
- refs and DB-backed execution contracts are ready, with the immutable context
19
- manifest as the step output.
20
- 4. Map each accepted claim to an executable command or a specific bounded manual
21
- observation. Record `map-acceptance`.
22
- 5. Run repository-native focused and regression tests, applicable type/lint/build
23
- checks, public-seam acceptance, and material error/recovery/security checks. Record
24
- `execute-checks` and `verify-public-seam` with commands and observed results.
25
-
26
- Use real boundaries where practical. A test double is acceptable at a costly or
27
- nondeterministic external boundary only when the report explains why it preserves the
28
- contract. Reject tautologies, hidden skips, weakened assertions, and unconsumed code.
29
-
30
- ## Report and converge
31
-
32
- Write `.ultra/reports/tests/<workflow-id>.json` atomically using
33
- `ultra-test-report-v1`: bind the full HEAD and worktree digest, change and exact task
34
- ids, the recorded checking-context digest, acceptance
35
- mapping, exact command results, public seams, failures, recovery evidence, run count,
36
- timestamp, and blocking issues. Populate every `verification_dimensions` entry:
37
- acceptance, regression, integration, static analysis, build, performance, security,
38
- and recovery. Use `not_applicable` only with a concrete rationale; `not_run` cannot
39
- support a passing gate. For an incident or any bugfix task, also record one
40
- deterministic `regression_signal` with the exact command, expected red symptom,
41
- observed red and green results, duration when known, and evidence. `passed` is true only when every recorded command and
42
- required public seam passes with no blocking issue at that exact checkout.
43
-
44
- Record `write-report` with the report output so MCP stores its digest. Re-read the file,
45
- HEAD, task set, and breadcrumb; record `verify-test-gate`, then call
46
- `workflow.complete`. MCP derives the durable test summary from the report rather than
47
- trusting a Prompt claim. A malformed, mismatched, changed, or stale report blocks
48
- completion.
49
-
50
- Return the workflow id, revision, pass/fail result, exact checks, verified seams,
51
- blocking failures, report path/digest, and one route to fix, `ultra-review`, or
52
- `ultra-deliver`.
6
+ # Verify current behavior
7
+
8
+ Testing is independent checking. Do not reuse implementation conclusions or generated
9
+ projections as proof.
10
+
11
+ ## Bind scope
12
+
13
+ 1. Read doctor, change, breadcrumb, decisions, task and dev evidence, current checkout,
14
+ and prior report freshness.
15
+ 2. Resume or start a test workflow bound to the exact change and optional task.
16
+ 3. Record `bind-scope`, then compile `change.context` for `check` and record its
17
+ immutable manifest under `compile-context`.
18
+ 4. Record `map-acceptance` after mapping every accepted claim to an executable check
19
+ or bounded observable seam.
20
+
21
+ ## Select verification by risk
22
+
23
+ The model selects from:
24
+
25
+ - acceptance;
26
+ - regression;
27
+ - integration;
28
+ - static analysis;
29
+ - build;
30
+ - performance;
31
+ - security;
32
+ - recovery.
33
+
34
+ Acceptance is always selected. Select other dimensions when the change, repository, or
35
+ failure mode makes them material. Record excluded dimensions and concrete rationales in
36
+ `verification_profile`; omission without a rationale is invalid. A selected dimension
37
+ must be `pass`, `fail`, or `not_run`; `not_run` cannot support a passing gate.
38
+
39
+ Run repository-native commands and real boundaries where practical. Test doubles are
40
+ acceptable only at costly or nondeterministic external boundaries when the report
41
+ explains the preserved contract. Do not weaken assertions, hide skips, or validate
42
+ unconsumed code.
43
+
44
+ For an incident or bugfix, record one deterministic red-to-green `regression_signal`.
45
+ When evidence reveals a material product or recovery choice, use the host's native
46
+ question UI and decision protocol; testing must not choose the desired outcome.
47
+
48
+ ## Report
49
+
50
+ Write `.ultra/reports/tests/<workflow-id>.json` with
51
+ `ultra-test-report-v1`, binding:
52
+
53
+ - change, exact task ids, HEAD, worktree digest, and checking-context digest;
54
+ - acceptance mapping, commands, public seams, failures, and recovery evidence;
55
+ - `verification_profile` and the selected `verification_dimensions`;
56
+ - regression signal when required;
57
+ - run count, timestamp, blockers, and evidence-derived `passed`.
58
+
59
+ Record `execute-checks`, `verify-public-seam`, and `write-report`, then re-read the
60
+ report and current checkout before `verify-test-gate`. `workflow.complete` derives its
61
+ summary from the report and rejects stale, malformed, or contradictory evidence.
62
+
63
+ 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.
@@ -1,51 +1,51 @@
1
1
  ---
2
2
  name: ultra-think
3
- description: Produce an evidence-bounded recommendation or diagnosis for a consequential technical or product question. Use when the decision has material tradeoffs, uncertainty, or failure risk that benefits from explicit stress testing.
3
+ description: Resolve a consequential product, architecture, or recovery question through evidence-first reasoning and adaptive user alignment. Use when a material decision cannot be derived safely from accepted intent and current evidence.
4
4
  ---
5
5
 
6
- # Analyze a consequential question
7
-
8
- Use the smallest reasoning structure that resolves the user's actual decision. Answer
9
- simple questions directly; do not turn every request into a framework exercise.
10
-
11
- ## Workflow
12
-
13
- 1. State the decision, observed symptom, or disputed claim and the constraints that
14
- could change the answer. Ask only for missing information that materially affects
15
- the result.
16
- 2. Gather evidence from the most authoritative available source:
17
- - current checkout and runtime for repository claims;
18
- - official primary documentation for product or API behavior;
19
- - current web sources for unstable external facts.
20
- 3. Separate verified facts, evidence-backed inferences, and unresolved assumptions.
21
- Cite the supporting file, command, runtime result, or source near each consequential
22
- claim.
23
- 4. For a decision, compare only credible alternatives. Do not invent a fixed number of
24
- options or assign arbitrary numeric scores. Name the criteria that actually drive
25
- the choice and explain the tradeoffs.
26
- 5. For a diagnosis, form falsifiable hypotheses and identify the smallest observation
27
- that distinguishes them. Do not recommend implementation before the earliest
28
- incorrect state is supported by evidence.
29
- 6. Stress-test the leading conclusion with the techniques that fit the problem:
30
- - strongest counterargument;
31
- - likely failure scenario and recovery;
32
- - load-bearing assumption;
33
- - meaningful second-order effect.
34
- 7. Return the recommendation or diagnosis, evidence, uncertainty, what would change
35
- the conclusion, and the smallest verification step.
36
-
37
- ## Output
38
-
39
- Adapt the response to the question. Include:
40
-
41
- - the conclusion first;
42
- - the decisive evidence and tradeoffs;
43
- - unresolved uncertainty without false precision;
44
- - one concrete verification or follow-up action.
45
-
46
- Use a comparison table only when several alternatives share the same decision
47
- criteria. Comparisons are an analysis tool, not a required output section.
48
-
49
- This skill is read-only unless the user separately authorizes writing an analysis
50
- artifact. It does not update Ultra state, implement the recommendation, or replace an
51
- independent review.
6
+ # Align without suppressing model judgment
7
+
8
+ Thinking is an optional reasoning capability, not a mandatory stage. Answer
9
+ self-contained questions directly. Use durable decision state only when a
10
+ project-bound choice must survive interruption or gate later work.
11
+
12
+ ## Reason first
13
+
14
+ 1. Define the actual decision or disputed claim and the constraints that can change
15
+ its answer.
16
+ 2. Inspect current authority, source, runtime, tests, and primary documentation before
17
+ asking the user for facts.
18
+ 3. Separate verified fact, evidence-backed inference, accepted intent, delegated
19
+ implementation judgment, and unresolved owner choice.
20
+ 4. Form credible alternatives only when alternatives materially help the decision.
21
+ Evaluate them against the real constraints; do not impose a fixed option count,
22
+ scoring system, or confidence percentage.
23
+ 5. Stress-test the leading answer with its strongest counterexample, likely failure
24
+ path, recovery, and load-bearing assumption.
25
+
26
+ ## Interact adaptively
27
+
28
+ Read `references/decision-dialogue.md`. If the user already gave a clear decision,
29
+ normalize and use it without asking for confirmation. If the decision is reversible
30
+ and delegated by the accepted contract, decide it and explain the reasoning.
31
+
32
+ When owner authority is required, use the host's native question UI when available.
33
+ Ask the earliest dependent decision with a recommendation, decisive evidence, and the
34
+ effect of the answer. Keep cognitive load small; group only independent, simple facts.
35
+ Do not expose the hidden decision queue.
36
+
37
+ For durable project decisions, use `decision.thread_start`, `decision.open`, and the
38
+ appropriate resolve, delegate, defer, or supersede transition. Store normalized
39
+ decisions and artifact references, never transcripts or internal reasoning.
40
+
41
+ Prepare and confirm a checkpoint only when the decision changes a durable contract or
42
+ artifact and a checkpoint is needed for recovery. Do not add a ceremonial approval
43
+ gate to an already explicit user instruction or a reversible implementation detail.
44
+
45
+ ## Return control
46
+
47
+ Return the conclusion, decisive evidence, material uncertainty, and affected
48
+ contracts. Re-read the invoking workflow or breadcrumb and recommend one of its
49
+ `allowed_transitions`; follow `required_transition` only when a hard invariant leaves
50
+ no alternative. Thinking does not implement code, mutate unrelated state, or invent a
51
+ canonical next action.
@@ -0,0 +1,106 @@
1
+ # User-agent interaction contract
2
+
3
+ Use this protocol only when evidence and accepted intent do not resolve a material
4
+ choice. The goal is shared understanding with low cognitive load, not a mandatory
5
+ interview.
6
+
7
+ ## Authority split
8
+
9
+ The user owns:
10
+
11
+ - product intent and accepted outcomes;
12
+ - material scope, compatibility, security, cost, and recovery tradeoffs;
13
+ - authorization for destructive or external effects.
14
+
15
+ The model owns:
16
+
17
+ - fact finding and synthesis;
18
+ - reversible implementation detail inside accepted constraints;
19
+ - research coverage and risk-profile recommendations;
20
+ - technical decomposition, verification selection, and route recommendation.
21
+
22
+ MCP owns durable state, evidence references, digests, freshness, locks, valid
23
+ transitions, and hard invariants. It does not choose semantic intent.
24
+
25
+ ## Decide whether to ask
26
+
27
+ Before asking:
28
+
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,
34
+ compatibility, security, material cost, external effects, or recovery.
35
+
36
+ Do not ask about a reversible implementation detail already delegated by the contract.
37
+ If the user does not know, recommend a bounded validation action instead of forcing a
38
+ guess.
39
+
40
+ ## Choose interaction depth
41
+
42
+ - `guided`: material initial product or major-change choices;
43
+ - `fast`: only one-way-door or costly choices in routine work;
44
+ - `autonomous`: reversible choices explicitly delegated by the user;
45
+ - `diagnostic`: gather discriminating evidence before asking about recovery.
46
+
47
+ Infer the depth from the request and risk. Do not ask a meta-question about mode unless
48
+ that choice itself changes the outcome.
49
+
50
+ ## Present questions
51
+
52
+ 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.
55
+
56
+ Ask one question only for a dependent decision. STOP is mandatory after presenting
57
+ that question: do not perform writes whose meaning depends on an unanswered choice.
58
+
59
+ For one dependent decision, present:
60
+
61
+ ```text
62
+ Decision: <question>
63
+ Why now: <decision effect>
64
+ Recommendation: <choice> — <decisive reason>
65
+ Alternatives: <only credible alternatives and their net tradeoff>
66
+ ```
67
+
68
+ Ask dependent decisions one at a time. A host may group up to three independent,
69
+ low-cognitive-load facts when seeing them together improves consistency. Never dump a
70
+ questionnaire, hidden queue, or every research area.
71
+
72
+ The question tool or direct question ends the current interaction naturally.
73
+
74
+ ## Persist only when recovery needs it
75
+
76
+ For a project-bound material decision:
77
+
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.
82
+ 3. After the answer:
83
+ - `decision.resolve` for a direct user choice;
84
+ - `decision.delegate` for explicit model delegation;
85
+ - `decision.defer` with consequence and revisit condition;
86
+ - `decision.supersede` when accepted intent actually changed.
87
+ 4. Use `decision.checkpoint` only for the digest-bound recovery boundary described
88
+ below.
89
+
90
+ Keep fact acquisition autonomous and decision authority explicit.
91
+ Never store raw prompts or transcripts; store normalized decisions, not internal
92
+ chain of thought.
93
+ Do not require a redundant confirmation after an unambiguous answer.
94
+
95
+ Use a checkpoint only when a coherent decision cluster changes a durable contract or
96
+ artifact and interruption recovery requires a digest-bound boundary. Present the
97
+ compact effect once, obtain any missing approval, update the artifact, and confirm its
98
+ digest. Do not create ceremonial checkpoints for routine implementation detail or an
99
+ already explicit current instruction.
100
+
101
+ ## Return to the capability graph
102
+
103
+ After alignment, re-read the invoking workflow and breadcrumb. A
104
+ `required_transition` is authoritative only for a hard invariant. Otherwise the host
105
+ model recommends among `allowed_transitions` based on the user's goal and current
106
+ evidence. Do not persist that semantic recommendation as MCP authority.
@@ -114,6 +114,15 @@ as a fallback unless `ultra-tools <family> --help` lists it.
114
114
  | `change.learning_resolve` | `change learning-resolve` | 10 | mcp |
115
115
  | `change.converge` | `change converge` | 9 | mcp |
116
116
  | `change.archive` | `change archive` | 9 | mcp |
117
+ | `decision.thread_start` | `decision thread-start` | 16 | mcp |
118
+ | `decision.get` | `decision get` | 16 | any |
119
+ | `decision.list` | `decision list` | 16 | any |
120
+ | `decision.open` | `decision open` | 16 | mcp |
121
+ | `decision.resolve` | `decision resolve` | 16 | mcp |
122
+ | `decision.delegate` | `decision delegate` | 16 | mcp |
123
+ | `decision.defer` | `decision defer` | 16 | mcp |
124
+ | `decision.supersede` | `decision supersede` | 16 | mcp |
125
+ | `decision.checkpoint` | `decision checkpoint` | 16 | mcp |
117
126
  | `workflow.start` | `workflow start` | 13 | mcp |
118
127
  | `workflow.get` | `workflow get` | 13 | any |
119
128
  | `workflow.list` | `workflow list` | 13 | any |
@@ -126,12 +135,15 @@ as a fallback unless `ultra-tools <family> --help` lists it.
126
135
  Current executable maintenance surfaces are `task init-project`,
127
136
  `session close|get|list|admission|heartbeat|subscribe|reap`, `status`, `db`,
128
137
  `migrate`, `system doctor|restore|rebaseline`, and `legacy-memory`. In particular, `task create|update|list|get`
129
- and all `change` lifecycle verbs are not CLI fallbacks. Change state must use
138
+ and all `change` and `decision` lifecycle verbs are not CLI fallbacks. Change and decision state must use
130
139
  the live MCP server; `system doctor` may additionally be exposed by the
131
140
  maintenance CLI because it is the recovery path when MCP startup is degraded.
132
141
  `task init-project --resume` preserves existing `.ultra` files and installs only
133
142
  missing current scaffold assets. Projection-only state uses the supported
134
- `migrate --from=4.4 --to=4.5` or `--from=4.5 --to=15.0` transition before resume.
143
+ `migrate --from=4.4 --to=4.5` or the current supported state-schema transition before resume.
144
+ `session close` preserves the worktree by default. `--remove-worktree` delegates to
145
+ the same Git ancestry and dirty-state verifier as MCP and fails with
146
+ `WORKTREE_NOT_INTEGRATED` instead of deleting uncommitted or unintegrated work.
135
147
  `system doctor --repair` applies supported schema upgrades with a pre-migration
136
148
  backup before mechanical recovery.
137
149
  `system restore` requires the exact `REPLACE_CORRUPT_ULTRA_STATE` confirmation and a
@@ -148,3 +160,35 @@ The CLI follows the `version` field of `spec/mcp-tools.yaml`. Adding a new
148
160
  flag is a minor bump; renaming or removing a flag, or changing exit-code
149
161
  semantics, is a major bump. Major bumps require an entry in
150
162
  `docs/PLAN.zh-CN.md §14 Decision log`.
163
+
164
+ ## 7. `ubp-orchestrator`
165
+
166
+ `ubp-orchestrator execute-plan` consumes the completed and current
167
+ `.ultra/execution-plan.json` and resumes from the first unfinished dependency wave.
168
+ Before creating a session it rejects an empty, malformed, cyclic, duplicate-task, or
169
+ 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.
173
+ It returns `status: "paused"` when that wave still has non-terminal Ultra tasks and
174
+ does not dispatch later waves. Worktrees are preserved unless `--auto-merge` is
175
+ explicitly supplied and the corresponding change task has an exact completion commit,
176
+ ready dev workflow, and current task review. `run` and `start` are optional queue daemons and additionally require
177
+ `orchestrator.auto_dispatch: true`.
178
+
179
+ Every execution mode requires a shell-free worker contract:
180
+
181
+ ```json
182
+ {
183
+ "orchestrator": {
184
+ "command": "/absolute/path/to/ultra-worker",
185
+ "command_args": []
186
+ }
187
+ }
188
+ ```
189
+
190
+ `UBP_ORCH_COMMAND` and a JSON-array `UBP_ORCH_ARGS_JSON` may override that contract.
191
+ The daemon refuses startup without a real executable. Worker exit zero is execution
192
+ evidence only and leaves the Ultra task `in_progress`; failure blocks the task and
193
+ records session-linked circuit-breaker evidence. Worker spawn errors follow the same
194
+ failure path instead of leaving a running lease.