ultra-builder-pro-cli 0.16.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 (64) hide show
  1. package/.ultra-template/specs/research-distillate.md +4 -3
  2. package/CHANGELOG.md +86 -0
  3. package/README.md +54 -24
  4. package/adapters/_shared/codex-assets.cjs +10 -5
  5. package/adapters/_shared/handbook.cjs +1 -1
  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/docs/AGENT-CONTEXT.md +11 -8
  19. package/docs/ARCHITECTURE.md +67 -9
  20. package/docs/LEGACY-CLI-CROSSWALK.md +163 -0
  21. package/docs/PLAN.zh-CN.md +19 -13
  22. package/docs/RUNTIME-COMPAT-MATRIX.md +2 -2
  23. package/docs/WORKFLOW-LIFECYCLE.md +123 -59
  24. package/hooks/pre_stop_check.py +3 -2
  25. package/mcp-server/lib/baseline-workflow.cjs +84 -16
  26. package/mcp-server/lib/change-workflow.cjs +55 -35
  27. package/mcp-server/lib/context-spine.cjs +171 -105
  28. package/mcp-server/lib/git-bootstrap.cjs +240 -0
  29. package/mcp-server/lib/init-project.cjs +178 -41
  30. package/mcp-server/lib/project-breadcrumb.cjs +14 -14
  31. package/mcp-server/lib/state-db.cjs +257 -10
  32. package/mcp-server/lib/state-ops.cjs +64 -1
  33. package/mcp-server/lib/workflow-state.cjs +300 -205
  34. package/mcp-server/server.cjs +58 -34
  35. package/orchestrator/auto-merge.cjs +19 -0
  36. package/orchestrator/daemon.cjs +104 -0
  37. package/orchestrator/parallel-orchestrator.cjs +371 -49
  38. package/orchestrator/session-runner.cjs +354 -25
  39. package/package.json +2 -1
  40. package/skills/ultra-change/SKILL.md +69 -94
  41. package/skills/ultra-deliver/SKILL.md +37 -65
  42. package/skills/ultra-dev/SKILL.md +50 -52
  43. package/skills/ultra-doctor/SKILL.md +34 -49
  44. package/skills/ultra-init/SKILL.md +78 -105
  45. package/skills/ultra-plan/SKILL.md +78 -99
  46. package/skills/ultra-research/SKILL.md +99 -113
  47. package/skills/ultra-review/SKILL.md +38 -53
  48. package/skills/ultra-review/references/review-modes.md +5 -3
  49. package/skills/ultra-review/references/unified-schema.md +26 -6
  50. package/skills/ultra-review/scripts/review_wait.py +12 -0
  51. package/skills/ultra-status/SKILL.md +34 -44
  52. package/skills/ultra-test/SKILL.md +61 -54
  53. package/skills/ultra-think/SKILL.md +37 -51
  54. package/skills/ultra-think/references/decision-dialogue.md +87 -111
  55. package/spec/cli-protocol.md +35 -0
  56. package/spec/mcp-tools.yaml +145 -28
  57. package/spec/schemas/delivery-report.v1.schema.json +1 -46
  58. package/spec/schemas/state-db.sql +8 -2
  59. package/spec/schemas/test-report.v1.schema.json +45 -14
  60. package/ultra-tools/cli.cjs +1 -1
  61. package/ultra-tools/commands/session.cjs +10 -3
  62. package/ultra-tools/commands/status.cjs +19 -14
  63. package/ultra-tools/commands/system.cjs +2 -2
  64. package/ultra-tools/commands/task.cjs +3 -0
@@ -1,58 +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`, active decision state, authoritative
14
- tasks, completed dev runs, current HEAD/diff, and prior test report freshness. An
15
- open decision or unconfirmed checkpoint blocks testing claims and routes to
16
- `ultra-think`.
17
- 2. Resume or start a `test` workflow linked to the change and optional task. Record
18
- `bind-scope` with the exact revision, task set, and acceptance ids.
19
- 3. Compile `change.context` for `check`; record `compile-context` only when required
20
- refs and DB-backed execution contracts are ready, with the immutable context
21
- manifest as the step output.
22
- 4. Map each accepted claim to an executable command or a specific bounded manual
23
- observation. Record `map-acceptance`.
24
- 5. Run repository-native focused and regression tests, applicable type/lint/build
25
- checks, public-seam acceptance, and material error/recovery/security checks. Record
26
- `execute-checks` and `verify-public-seam` with commands and observed results.
27
-
28
- Use real boundaries where practical. A test double is acceptable at a costly or
29
- nondeterministic external boundary only when the report explains why it preserves the
30
- contract. Reject tautologies, hidden skips, weakened assertions, and unconsumed code.
31
- When evidence reveals an unresolved product decision, report the exact consequence and
32
- route it to the decision dialogue; testing must not silently select the desired result.
33
-
34
- ## Report and converge
35
-
36
- Write `.ultra/reports/tests/<workflow-id>.json` atomically using
37
- `ultra-test-report-v1`: bind the full HEAD and worktree digest, change and exact task
38
- ids, the recorded checking-context digest, acceptance
39
- mapping, exact command results, public seams, failures, recovery evidence, run count,
40
- timestamp, and blocking issues. Populate every `verification_dimensions` entry:
41
- acceptance, regression, integration, static analysis, build, performance, security,
42
- and recovery. Use `not_applicable` only with a concrete rationale; `not_run` cannot
43
- support a passing gate. For an incident or any bugfix task, also record one
44
- deterministic `regression_signal` with the exact command, expected red symptom,
45
- observed red and green results, duration when known, and evidence. `passed` is true only when every recorded command and
46
- required public seam passes with no blocking issue at that exact checkout.
47
-
48
- Record `write-report` with the report output so MCP stores its digest. Re-read the file,
49
- HEAD, task set, and breadcrumb; record `verify-test-gate`, then call
50
- `workflow.complete`. MCP derives the durable test summary from the report rather than
51
- trusting a Prompt claim. A malformed, mismatched, changed, or stale report blocks
52
- completion.
53
-
54
- Return the workflow id, revision, pass/fail result, exact checks, verified seams,
55
- blocking failures, report path/digest, and one route to fix, `ultra-review`, or
56
- `ultra-deliver`. A failed implementation contract returns to `ultra-dev`; a new owner
57
- choice returns to `ultra-think`; a passing current change without current aggregate
58
- review routes to `ultra-review`.
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,65 +1,51 @@
1
1
  ---
2
2
  name: ultra-think
3
- description: Resolve a consequential product or technical question through evidence-first analysis or a resumable one-decision-at-a-time owner dialogue. Use when tradeoffs, ambiguity, diagnosis, or failure risk require shared understanding before research, planning, or implementation proceeds.
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
- # Align on a consequential question
6
+ # Align without suppressing model judgment
7
7
 
8
- Use the smallest reasoning structure that resolves the user's actual decision. Answer a
9
- simple self-contained question directly. For a project-bound or multi-turn decision,
10
- read `references/decision-dialogue.md` and use its durable protocol.
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
11
 
12
- ## Establish evidence
12
+ ## Reason first
13
13
 
14
- 1. State the decision, observed symptom, or disputed claim and the constraints that
15
- could change the answer.
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. Decide whether the question is now answerable or still requires owner authority.
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.
35
25
 
36
- ## Route the result
26
+ ## Interact adaptively
37
27
 
38
- - For an answerable read-only question, return the recommendation or diagnosis,
39
- decisive evidence, uncertainty, what would change the conclusion, and one smallest
40
- verification step.
41
- - For a load-bearing owner decision, bind or resume a decision thread, open the one
42
- earliest decision, present it using the shared protocol, and STOP.
43
- - After an answer, normalize it through `decision.resolve`, `decision.delegate`, or
44
- `decision.defer`; never store the conversation transcript.
45
- - At a phase boundary, prepare the checkpoint, obtain approval, bind current artifact
46
- digests when project-bound, and only then return control to the invoking workflow.
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.
47
31
 
48
- ## Output
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.
49
36
 
50
- Adapt the response to the question. Include:
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.
51
40
 
52
- - the conclusion first;
53
- - the decisive evidence and tradeoffs;
54
- - unresolved uncertainty without false precision;
55
- - one concrete verification or follow-up action.
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.
56
44
 
57
- Use a comparison table only when several alternatives share the same decision
58
- criteria. Comparisons are an analysis tool, not a required output section.
45
+ ## Return control
59
46
 
60
- Unbound analysis is read-only. A project-bound dialogue may write only decision state
61
- and explicitly approved checkpoint artifacts. It does not implement the decision or
62
- replace research, planning, testing, or independent review. After a confirmed
63
- checkpoint, return to the exact invoking `ultra-init`, `ultra-research`, `ultra-change`,
64
- `ultra-plan`, `ultra-dev`, `ultra-test`, `ultra-review`, or `ultra-deliver` run and
65
- current step; never choose a new route from conversation history.
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.
@@ -1,130 +1,106 @@
1
- # Decision dialogue protocol
1
+ # User-agent interaction contract
2
2
 
3
- Use this protocol when an Ultra workflow reaches a load-bearing owner decision. Keep
4
- fact acquisition autonomous and decision authority explicit. Do not use it for facts
5
- that repository, runtime, tests, or primary sources can answer.
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
6
 
7
- ## Select the interaction depth
7
+ ## Authority split
8
8
 
9
- - `guided`: ask every unresolved decision that changes accepted product intent, scope,
10
- public behavior, security, material cost, compatibility, delivery semantics, or
11
- recovery. Use for initial research and major changes.
12
- - `fast`: ask only unresolved one-way-door or materially expensive decisions. Decide
13
- reversible implementation detail inside accepted constraints. Use for bounded daily
14
- work.
15
- - `autonomous`: use only after the owner explicitly delegates reversible decisions.
16
- Preserve the delegation, selected result, rationale, and guardrails.
17
- - `diagnostic`: acquire evidence and distinguish falsifiable hypotheses before asking
18
- for a recovery or product decision.
9
+ The user owns:
19
10
 
20
- Do not ask a meta-question about mode when the user's request or current change profile
21
- already determines the appropriate depth.
11
+ - product intent and accepted outcomes;
12
+ - material scope, compatibility, security, cost, and recovery tradeoffs;
13
+ - authorization for destructive or external effects.
22
14
 
23
- ## Separate evidence from decisions
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
24
26
 
25
27
  Before asking:
26
28
 
27
- 1. Inspect current authority, repository, runtime, tests, and relevant primary sources.
28
- 2. Resolve factual unknowns yourself when evidence is obtainable.
29
- 3. Separate `Observed`, `Verified`, `Decided`, and `Unknown`.
30
- 4. Identify the earliest unresolved decision on which later decisions depend.
31
- 5. Form a private candidate queue, but expose only its current item. Do not dump the
32
- backlog, a questionnaire, or every research step.
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.
33
39
 
34
- If more evidence can resolve the current uncertainty, perform that research first. If
35
- the user says they do not know, convert the gap into a bounded validation action rather
36
- than pressuring them to guess.
40
+ ## Choose interaction depth
37
41
 
38
- ## Bind durable authority
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.
39
46
 
40
- For a project-bound dialogue:
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.
41
49
 
42
- 1. Call `decision.list` and resume the matching `active` or `checkpoint_ready` thread.
43
- 2. Otherwise call `decision.thread_start` with one baseline, change, or workflow
44
- binding, a concise purpose, and the selected mode. Never store raw prompts or
45
- transcripts.
46
- 3. Call `decision.open` for exactly one decision. Include:
47
- - why it must be decided now;
48
- - the evidence-backed recommendation;
49
- - zero to three credible alternatives with their net tradeoff;
50
- - evidence references;
51
- - the contract, artifact, gate, or task effects;
52
- - whether deferral blocks progress.
50
+ ## Present questions
53
51
 
54
- Do not encode future questions as open decisions. Re-evaluate the next candidate after
55
- each answer so the dialogue adapts instead of following a static questionnaire.
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.
56
55
 
57
- ## Present one decision and stop
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
58
 
59
- Use a compact shape adapted to the user's language:
59
+ For one dependent decision, present:
60
60
 
61
61
  ```text
62
- Decision <position when known>: <question>
63
- Why now: <one sentence>
64
- Recommendation: <choice or next validation> — <reason>
65
- Options: <only credible alternatives and their net tradeoff>
66
- Effect: <what this answer changes>
62
+ Decision: <question>
63
+ Why now: <decision effect>
64
+ Recommendation: <choice> — <decisive reason>
65
+ Alternatives: <only credible alternatives and their net tradeoff>
67
66
  ```
68
67
 
69
- Ask one question only. Do not combine dependent questions, append a second request, or
70
- continue into analysis, planning, edits, or another workflow step. End the turn and
71
- wait. This STOP is mandatory even when the likely answer seems obvious.
72
-
73
- ## Normalize the answer
74
-
75
- On the next turn:
76
-
77
- - When the answer is unambiguous, briefly reflect the normalized decision and its
78
- durable effect, then call `decision.resolve` with the decision, rationale, and owner.
79
- - When the user says "you decide", select the reversible result within stated bounds
80
- and call `decision.delegate` with the explicit delegation, result, rationale, and
81
- guardrails. Never represent delegation as a direct owner decision.
82
- - When the user defers, call `decision.defer` with the reason, consequence, and revisit
83
- condition. A blocking deferral remains a gate.
84
- - When the answer is ambiguous, ask one clarification for the same decision; do not
85
- infer a product choice from tone or partial wording.
86
- - When evidence or owner intent changes a resolved decision, call
87
- `decision.supersede`. Preserve the prior record and open one replacement question.
88
-
89
- Do not require a redundant confirmation after a clear answer. The owner can correct
90
- the compact reflection; phase checkpoint approval is the durable confirmation.
91
-
92
- ## Checkpoint before projection
93
-
94
- After a coherent cluster of decisions or a phase boundary:
95
-
96
- 1. Call `decision.checkpoint` with `action: "prepare"` and a compact shared
97
- understanding. Open or blocking-deferred decisions must prevent preparation.
98
- 2. Present only accepted decisions, unresolved consequences, and the artifacts that
99
- will change. Ask for one checkpoint approval and STOP.
100
- 3. After approval, update the target specification, Change Contract, delta, or plan
101
- from normalized decisions. Do not write conversation transcripts.
102
- 4. Call `decision.checkpoint` with `action: "confirm"`, owner approval, and the current
103
- artifact paths. MCP binds their digests. A change- or workflow-bound thread must
104
- bind at least one artifact. When a shared specification will continue evolving,
105
- bind a stable decision projection under `.ultra/docs/decisions/<thread-id>.md`
106
- instead of a mutable draft that would immediately become stale. Only a standalone
107
- baseline thinking thread may use an explicit no-artifact reason.
108
- 5. Re-read the confirmed thread. Only then may the linked workflow complete the gated
109
- step or move to another phase.
110
-
111
- If a bound artifact changes while the normalized decisions remain valid, prepare the
112
- same thread again, show the changed effect, obtain one new checkpoint approval, and
113
- confirm the current digest. Do not invent a replacement decision merely to refresh an
114
- artifact. If the decision itself changed, use supersession instead.
115
-
116
- Start a new thread for a new decision cluster. Supersede an old item only when the old
117
- decision itself changed.
118
-
119
- ## Keep the user surface small
120
-
121
- At each turn show only:
122
-
123
- - the current decision or checkpoint;
124
- - the decisive evidence and recommendation;
125
- - the effect of the answer;
126
- - optionally the number of already resolved decisions.
127
-
128
- Provide the hidden evidence inventory, all semantic steps, or full report paths only
129
- when requested. Context and token budgets are advisory; they never justify omitting
130
- load-bearing evidence or refusing legitimate work.
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.
@@ -141,6 +141,9 @@ maintenance CLI because it is the recovery path when MCP startup is degraded.
141
141
  `task init-project --resume` preserves existing `.ultra` files and installs only
142
142
  missing current scaffold assets. Projection-only state uses the supported
143
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.
144
147
  `system doctor --repair` applies supported schema upgrades with a pre-migration
145
148
  backup before mechanical recovery.
146
149
  `system restore` requires the exact `REPLACE_CORRUPT_ULTRA_STATE` confirmation and a
@@ -157,3 +160,35 @@ The CLI follows the `version` field of `spec/mcp-tools.yaml`. Adding a new
157
160
  flag is a minor bump; renaming or removing a flag, or changing exit-code
158
161
  semantics, is a major bump. Major bumps require an entry in
159
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.