ultra-builder-pro-cli 0.22.0 → 0.24.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 (93) hide show
  1. package/.ultra-template/docs/research/README.md +4 -4
  2. package/CHANGELOG.md +83 -0
  3. package/README.md +68 -35
  4. package/adapters/_shared/codex-assets.cjs +121 -60
  5. package/adapters/_shared/interaction-contract.cjs +20 -7
  6. package/adapters/_shared/provenance.cjs +7 -2
  7. package/adapters/_shared/runtime-assets.cjs +4 -3
  8. package/adapters/_shared/runtime-native.cjs +132 -0
  9. package/adapters/claude.js +61 -31
  10. package/adapters/codex.js +178 -81
  11. package/adapters/grok.js +372 -0
  12. package/adapters/kimi.js +8 -4
  13. package/adapters/opencode.js +211 -33
  14. package/agents/code-reviewer.md +4 -2
  15. package/agents/debugger.md +4 -1
  16. package/agents/review-code.md +7 -3
  17. package/agents/review-comments.md +7 -4
  18. package/agents/review-coordinator.md +11 -7
  19. package/agents/review-design.md +8 -4
  20. package/agents/review-errors.md +8 -4
  21. package/agents/review-spec.md +8 -5
  22. package/agents/review-tests.md +7 -4
  23. package/agents/tdd-runner.md +5 -2
  24. package/bin/install.js +9 -4
  25. package/bin/orchestrator.js +4 -13
  26. package/docs/AGENT-CONTEXT.md +141 -231
  27. package/docs/ARCHITECTURE.md +203 -498
  28. package/docs/ARTIFACT-AUTHORITY.md +38 -35
  29. package/docs/PLUGIN-ISOLATION-CONTRACT.md +12 -9
  30. package/docs/ROADMAP.md +85 -110
  31. package/docs/RUNTIME-COMPAT-MATRIX.md +139 -174
  32. package/docs/SKILL-AUTHORING.md +3 -3
  33. package/docs/STATE-DB-ACCESS-POLICY.md +25 -20
  34. package/docs/WORKFLOW-LIFECYCLE.md +174 -442
  35. package/hooks/README.md +11 -8
  36. package/hooks/active_task_context.py +16 -16
  37. package/hooks/adapters/grok.py +134 -0
  38. package/hooks/{context_spine.py → context_envelope.py} +26 -22
  39. package/hooks/health_check.py +19 -29
  40. package/hooks/pre_stop_check.py +22 -12
  41. package/hooks/subagent_tracker.py +1 -1
  42. package/hooks/workflow_checkpoint.py +14 -13
  43. package/hooks/workflow_context.py +11 -12
  44. package/hooks/workflow_resume.py +14 -13
  45. package/mcp-server/{breadcrumb.cjs → hook-context.cjs} +7 -9
  46. package/mcp-server/lib/artifact-registry.cjs +25 -1
  47. package/mcp-server/lib/baseline-workflow.cjs +36 -38
  48. package/mcp-server/lib/canonical-json.cjs +19 -0
  49. package/mcp-server/lib/change-workflow.cjs +637 -49
  50. package/mcp-server/lib/context-envelope.cjs +508 -0
  51. package/mcp-server/lib/decision-records.cjs +337 -0
  52. package/mcp-server/lib/doctor.cjs +91 -33
  53. package/mcp-server/lib/init-project.cjs +78 -39
  54. package/mcp-server/lib/managed-file-write.cjs +116 -0
  55. package/mcp-server/lib/plan-checkpoint.cjs +177 -0
  56. package/mcp-server/lib/project-context.cjs +178 -0
  57. package/mcp-server/lib/stage-checkpoints.cjs +309 -0
  58. package/mcp-server/lib/state-db.cjs +155 -24
  59. package/mcp-server/lib/task-ledger.cjs +522 -13
  60. package/mcp-server/lib/ultra-facade.cjs +834 -0
  61. package/mcp-server/lib/worker-packet.cjs +358 -0
  62. package/mcp-server/server.cjs +208 -1059
  63. package/orchestrator/daemon.cjs +27 -9
  64. package/orchestrator/parallel-orchestrator.cjs +111 -76
  65. package/orchestrator/session-runner.cjs +135 -34
  66. package/package.json +10 -3
  67. package/skills/ultra-change/SKILL.md +39 -98
  68. package/skills/ultra-deliver/SKILL.md +42 -65
  69. package/skills/ultra-dev/SKILL.md +52 -99
  70. package/skills/ultra-doctor/SKILL.md +35 -57
  71. package/skills/ultra-init/SKILL.md +48 -88
  72. package/skills/ultra-init/references/brownfield-adoption.md +11 -8
  73. package/skills/ultra-plan/SKILL.md +54 -132
  74. package/skills/ultra-research/SKILL.md +58 -112
  75. package/skills/ultra-review/SKILL.md +28 -46
  76. package/skills/ultra-review/references/unified-schema.md +2 -0
  77. package/skills/ultra-review/scripts/review_wait.py +8 -0
  78. package/skills/ultra-status/SKILL.md +22 -45
  79. package/skills/ultra-test/SKILL.md +27 -61
  80. package/skills/ultra-think/SKILL.md +29 -48
  81. package/skills/ultra-think/references/interaction-boundary.md +56 -0
  82. package/spec/cli-protocol.md +80 -187
  83. package/spec/mcp-tools.yaml +130 -2738
  84. package/spec/schemas/mcp-tools.schema.json +1 -1
  85. package/spec/schemas/state-db.sql +107 -4
  86. package/spec/schemas/{task-ledger.v1.schema.json → task-ledger.v2.schema.json} +70 -6
  87. package/ultra-tools/commands/status.cjs +369 -243
  88. package/mcp-server/lib/context-spine.cjs +0 -1208
  89. package/mcp-server/lib/decision-dialogue.cjs +0 -1128
  90. package/mcp-server/lib/project-breadcrumb.cjs +0 -173
  91. package/mcp-server/lib/spec-learning.cjs +0 -284
  92. package/mcp-server/lib/workflow-state.cjs +0 -2965
  93. package/skills/ultra-think/references/decision-dialogue.md +0 -153
@@ -1,62 +1,44 @@
1
1
  ---
2
2
  name: ultra-review
3
- description: Independently review one current Ultra plan, task diff, or aggregate change on specification fidelity and engineering standards. Use when current evidence needs a review gate or focused risk analysis.
3
+ description: Independently review one current Ultra plan, task diff, or aggregate Change on specification fidelity and engineering standards. Use when current evidence needs review or focused risk analysis.
4
4
  ---
5
5
 
6
6
  # Review one bounded scope
7
7
 
8
8
  Keep two independent verdict axes:
9
9
 
10
- - `spec_fidelity`: accepted intent, behavior, documentation impact, and public seams;
11
- - `engineering_standards`: correctness, safety, tests, integration, maintainability,
12
- observability, and recovery.
10
+ - `spec_fidelity`: accepted intent, behavior, docs, and public seams;
11
+ - `engineering_standards`: correctness, safety, tests, integration,
12
+ maintainability, observability, and recovery.
13
13
 
14
- Neither axis can compensate for the other.
14
+ ## Bind and review
15
15
 
16
- ## Bind evidence
16
+ 1. Read `references/review-modes.md`.
17
+ 2. Call `ultra.context { stage: review, scope: { change_id, task_id? }, detail: full }`.
18
+ 3. Import a newer team checkpoint with `ultra.sync`; stop on a real conflict.
19
+ 4. Bind one explicit diff or Plan, full HEAD, worktree digest, task set, acceptance,
20
+ decisions, and current evidence. Empty or stale scope cannot pass.
21
+ 5. Always run `review-spec`. Select the smallest engineering worker set that covers
22
+ actual risk; record selected and excluded roles with rationale.
17
23
 
18
- 1. Read `references/review-modes.md` and select `plan`, `task`, or `change` from the
19
- actual review request.
20
- 2. Read doctor and `task.ledger_get`. Import a newer descendant checkpoint before
21
- binding the review scope; stop on a typed merge conflict.
22
- 3. Bind one explicit diff or plan artifact, full HEAD, worktree digest, task set,
23
- acceptance, breadcrumb `accepted_intent`, and current decision state.
24
- 4. Resume or start the review workflow and record `bind-diff`.
25
- 5. Compile `change.context` for `review` and record the immutable manifest under
26
- `compile-context`.
24
+ Use the current host's native bounded-worker mechanism. Workers are read-only and
25
+ receive one immutable Worker Packet containing the exact Context Envelope, HEAD/diff,
26
+ decisions, acceptance, output path/schema, and `packet_digest`. Validate their artifacts with `scripts/review_wait.py` and
27
+ `references/unified-schema.md`; reject any output that does not echo the exact packet
28
+ digest. Preserve every finding unchanged in `SUMMARY.json`; group duplicates only in
29
+ the human summary.
27
30
 
28
- An empty, ambiguous, or stale scope cannot pass.
31
+ Register specialist and summary artifacts through one `ultra.record` batch using
32
+ `artifact / bind`.
29
33
 
30
- ## Select workers by risk
34
+ ## Checkpoint
31
35
 
32
- Always run `review-spec`. Select the smallest engineering worker set that covers the
33
- actual diff and risk. Record every selected and excluded worker with a specific
34
- rationale; do not run every specialist ceremonially.
36
+ Call `ultra.checkpoint` once with `stage: review`, exact scope, evidence, and outputs
37
+ tagged `spec_review`, `engineering_review`, or summary. The checkpoint compiles or
38
+ reuses review context and derives both axes from registered artifacts.
35
39
 
36
- Invoke workers through the current host's native bounded-worker mechanism and pass
37
- only their role, current scope, and relevant evidence. Workers are read-only and may
38
- not decide owner choices or edit source.
40
+ A rejected checkpoint leaves the draft mutable. Fix stale scope or evidence and retry;
41
+ do not open a replacement run or suppress a finding.
39
42
 
40
- Resolve `references/unified-schema.md` from this Skill directory and pass its absolute
41
- path as `SCHEMA_PATH`. Validate specialist artifacts with
42
- `scripts/review_wait.py`. Store all specialist artifacts and `SUMMARY.json` below
43
- `.ultra/changes/active/<change-id>/review/<workflow-id>/`. Record outputs under
44
- `review-specification`, `review-engineering`, and `coordinate-findings`.
45
-
46
- The coordinator preserves every finding unchanged in `SUMMARY.json`; it may group
47
- duplicate root causes only in the human summary. A new material owner choice remains a
48
- finding and routes to the interaction protocol.
49
-
50
- ## Complete
51
-
52
- Recheck HEAD, worktree, context digest, diff, task set, acceptance, artifact schemas,
53
- and both axes. Record `verify-review-gate`, then call `workflow.complete`. MCP derives
54
- the durable verdict and rejects missing specialists, lossy coordination, stale
55
- artifacts, or prompt-supplied conclusions.
56
-
57
- Any relevant code, test, specification, or contract edit invalidates the affected
58
- review evidence through registered provenance edges; unrelated evidence remains
59
- current. Return both verdict axes, blocking findings, reviewed scope, worker selection
60
- rationale, artifact digests, and allowed transitions.
61
-
62
- Never invoke the recommended capability here; wait for an explicit user invocation.
43
+ Return both axes, findings, reviewed scope, worker rationale, digests, and the model's
44
+ recommended next explicit capability. Do not invoke it automatically.
@@ -10,6 +10,7 @@ return only a one-line acknowledgement to the parent.
10
10
  "$schema": "ultra-review-findings-v2",
11
11
  "agent": "review-code",
12
12
  "axis": "engineering_standards",
13
+ "packet_digest": "<sha256-of-exact-worker-packet>",
13
14
  "session": "<session-id>",
14
15
  "timestamp": "<ISO-8601>",
15
16
  "scope": {
@@ -74,6 +75,7 @@ preference as a defect. Preserve the source specialist's severity during coordin
74
75
  "head": "<full-git-head>",
75
76
  "worktree_digest": "<sha256-of-current-worktree>",
76
77
  "context_digest": "<sha256-of-recorded-review-context>",
78
+ "packet_digest": "<sha256-of-coordinator-worker-packet>",
77
79
  "status": "complete",
78
80
  "verdict": "REQUEST_CHANGES",
79
81
  "axes": {
@@ -66,6 +66,10 @@ def nonempty_string(value) -> bool:
66
66
  return isinstance(value, str) and bool(value.strip())
67
67
 
68
68
 
69
+ def digest_string(value) -> bool:
70
+ return isinstance(value, str) and re.fullmatch(r"[0-9a-f]{64}", value) is not None
71
+
72
+
69
73
  def validate_finding(finding, artifact_axis: str, seen_ids):
70
74
  if not isinstance(finding, dict):
71
75
  return "finding must be an object"
@@ -97,6 +101,8 @@ def validate_specialist(data):
97
101
  return f"$schema must be {FINDINGS_SCHEMA}"
98
102
  if not nonempty_string(data.get("agent")):
99
103
  return "agent must be a non-empty string"
104
+ if not digest_string(data.get("packet_digest")):
105
+ return "packet_digest must be a lowercase SHA-256 digest"
100
106
  axis = data.get("axis")
101
107
  if axis not in AXES:
102
108
  return "axis must be spec_fidelity or engineering_standards"
@@ -197,6 +203,8 @@ def validate_summary(data):
197
203
  for field in ["session", "change_id", "head", "context_digest"]:
198
204
  if not nonempty_string(data.get(field)):
199
205
  return f"{field} must be a non-empty string"
206
+ if not digest_string(data.get("packet_digest")):
207
+ return "packet_digest must be a lowercase SHA-256 digest"
200
208
  if data.get("worktree_digest") is not None and not nonempty_string(data.get("worktree_digest")):
201
209
  return "worktree_digest must be null or a non-empty string"
202
210
  task_ids = data.get("task_ids")
@@ -1,63 +1,40 @@
1
1
  ---
2
2
  name: ultra-status
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.
3
+ description: Read authoritative Ultra health, workflows, decisions, changes, tasks, evidence freshness, and team checkpoint state. Use when the user asks what is complete, blocked, stale, or currently possible.
4
4
  ---
5
5
 
6
6
  # Report authoritative state
7
7
 
8
- This Skill is read-only. Never fall back to the Git team checkpoint, generated task
9
- JSON, prose, or context frontmatter when checkout-local DB authority is missing or
10
- degraded.
8
+ This Skill is read-only.
11
9
 
12
10
  ## Read
13
11
 
14
- 1. Run `system.doctor` without repair.
15
- 2. Run `task.ledger_get`. Report `current`, `drifted`, `revalidation_required`,
16
- `missing`, or a typed invalid/conflict state; do not import or publish from status.
17
- 3. Read baseline classification, revision, worktree, research provenance, gaps, and
18
- health.
19
- 4. Read current decision state and breadcrumb `accepted_intent` without exposing hidden
20
- future questions.
21
- 5. Read active, blocked, and ready workflows and their current steps.
22
- 6. Read the active Change root, typed delta, plan, deterministic progress projection,
23
- documentation reconciliation, findings, tasks, sessions, and current Git state.
24
- 7. Read test, review, and delivery artifacts only through DB references and verify
25
- their digests and revisions.
26
-
27
- If authority is unreadable, report the unavailable panel and the required doctor or
28
- init transition. Do not mutate, compile context, repair, or release.
29
-
30
- ## Interpret transitions
31
-
32
- MCP reports:
33
-
34
- - `allowed_transitions`: mechanically valid capabilities;
35
- - `required_transition`: the sole recovery route only when a hard invariant permits no
36
- safe alternative.
37
-
38
- The host model recommends among allowed transitions using the user's current goal,
39
- workflow evidence, and cost of interruption. Do not present the recommendation as DB
40
- authority. A healthy project may validly allow research, change, thinking, or status at
41
- the same time.
12
+ Call `ultra.context { stage: project, detail: full }`. Use `ultra.sync { action:
13
+ inspect }` only when the user needs team-checkpoint detail. Do not import, publish,
14
+ repair, compile context, or mutate state.
15
+ Never fall back to the Git team checkpoint, generated task JSON, or report files as
16
+ live authority when `ultra.context` reports missing or unhealthy local state.
42
17
 
43
18
  Report:
44
19
 
45
20
  ```text
46
- Ultra: <healthy|degraded> · <branch>@<head|unborn|non-git> · worktree <state>
47
- Baseline: <mode>/<status> · research=<run/status> · gaps=<open>/<blocking>
48
- Workflow: <kind/id/status> · step=<current|complete> · outputs=<fresh|stale>
49
- Decision: <current|checkpoint|none>
50
- Change: <id/status|none> · delta=<fresh|stale|missing> · docs=<fresh|stale|missing>
21
+ Ultra: <healthy|degraded> · <branch>@<head|unborn|non-git>
22
+ Baseline: <mode>/<status> · gaps=<open>/<blocking>
23
+ Stage checkpoints: drafts=<count> · accepted=<current|stale|none>
24
+ Change: <id/status|none> · delta/docs=<state>
51
25
  Task: <id/status|none> · Sessions: <active>
52
26
  Evidence: plan=<state> · test=<state> · review=<axes> · delivery=<state>
53
- Team checkpoint: <current|drifted|revalidation_required|missing|invalid> · generation=<n>
54
- Blockers: <codes or none>
55
- Warnings: <codes or none>
56
- Allowed transitions: <capabilities>
57
- Required transition: <capability or none>
58
- Host recommendation: <capability and concise rationale>
27
+ Team checkpoint: <current|drifted|revalidation_required|missing|invalid>
28
+ Blockers: <hard mechanical blockers or none>
29
+ Warnings: <advisory semantic diagnostics or none>
30
+ Model recommendation: <capability and concise rationale>
59
31
  ```
60
32
 
61
- Separate verified facts, host inference, and unavailable evidence.
33
+ Treat warnings and failed draft checks as information, not mechanical orders. Only
34
+ corruption, unsafe paths, real concurrency conflicts, permissions, or irreversible
35
+ external effects are hard blockers.
62
36
 
63
- Never invoke the recommended capability here; wait for an explicit user invocation.
37
+ The host model recommends the next useful capability from accepted intent, current
38
+ evidence, cost of interruption, and owner goal. SQLite does not choose the route.
39
+ Separate verified facts, model inference, and unavailable evidence. Never invoke the
40
+ recommendation automatically.
@@ -1,74 +1,40 @@
1
1
  ---
2
2
  name: ultra-test
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.
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
6
  # Verify current behavior
7
7
 
8
- Testing is independent checking. Do not reuse implementation conclusions or generated
9
- projections as proof.
8
+ Testing independently checks the current checkout. Implementation conclusions and
9
+ generated projections are not evidence.
10
10
 
11
- ## Bind scope
11
+ ## Bind and execute
12
12
 
13
- 1. Read doctor, `task.ledger_get`, change, breadcrumb `accepted_intent`, decisions,
14
- task and dev evidence, current checkout, and prior report freshness. Import a newer
15
- descendant checkpoint before binding the task set; stop on a typed merge conflict.
16
- 2. Resume or start a test workflow bound to the exact change and optional task.
17
- 3. Record `bind-scope`, then compile `change.context` for `check` and record its
18
- immutable manifest under `compile-context`.
19
- 4. Record `map-acceptance` after mapping every accepted claim to an executable check
20
- or bounded observable seam.
13
+ 1. Call `ultra.context { stage: test, scope: { change_id, task_id? }, detail: full }`.
14
+ 2. Import a newer team checkpoint with `ultra.sync`; stop on a real conflict.
15
+ 3. Bind exact acceptance, task set, HEAD, worktree, decisions, dev evidence, and public
16
+ seams.
17
+ 4. Select a risk-based profile from acceptance, regression, integration, static
18
+ analysis, build, performance, security, and recovery. Acceptance is mandatory;
19
+ explain every material exclusion.
20
+ 5. Run repository-native commands and real boundaries. A bug or incident needs one
21
+ deterministic red-to-green regression signal.
21
22
 
22
- ## Select verification by risk
23
+ When delegated, use the immutable Worker Packet supplied by the parent and echo its
24
+ `packet_digest` in the report. Write an `ultra-test-report-v1` report below the owning
25
+ Change. Bind exact acceptance
26
+ ids, task ids, HEAD, worktree/context digests, commands, seams, failures, recovery,
27
+ profile, timestamp, blockers, and evidence-derived verdict. Register it with
28
+ `ultra.record` using `artifact / bind`.
23
29
 
24
- The model selects from:
30
+ ## Checkpoint
25
31
 
26
- - acceptance;
27
- - regression;
28
- - integration;
29
- - static analysis;
30
- - build;
31
- - performance;
32
- - security;
33
- - recovery.
32
+ Call `ultra.checkpoint` once with `stage: test`, exact scope, evidence, and an output
33
+ for the report (`kind: test-report`). The checkpoint compiles or reuses checking
34
+ context and derives the verdict from the registered report.
34
35
 
35
- Acceptance is always selected. Select other dimensions when the change, repository, or
36
- failure mode makes them material. Record excluded dimensions and concrete rationales in
37
- `verification_profile`; omission without a rationale is invalid. A selected dimension
38
- must be `pass`, `fail`, or `not_run`; `not_run` cannot support a passing gate.
36
+ If rejected, keep the same draft, repair evidence, and retry. Never weaken an
37
+ assertion, hide a skip, or turn a warning into proof.
39
38
 
40
- Run repository-native commands and real boundaries where practical. Test doubles are
41
- acceptable only at costly or nondeterministic external boundaries when the report
42
- explains the preserved contract. Do not weaken assertions, hide skips, or validate
43
- unconsumed code.
44
-
45
- For an incident or bugfix, record one deterministic red-to-green `regression_signal`.
46
- When evidence reveals a material product or recovery choice, use the host's native
47
- question UI and decision protocol; testing must not choose the desired outcome.
48
-
49
- ## Report
50
-
51
- Write
52
- `.ultra/changes/active/<change-id>/test/<workflow-id>/report.json` with
53
- `ultra-test-report-v1`, binding:
54
-
55
- - change, exact task ids, current Change acceptance ids, HEAD, worktree digest, and
56
- checking-context digest;
57
- - acceptance mapping, commands, public seams, failures, and recovery evidence;
58
- - `verification_profile` and the selected `verification_dimensions`;
59
- - regression signal when required;
60
- - run count, timestamp, blockers, and evidence-derived `passed`.
61
-
62
- Record `execute-checks`, `verify-public-seam`, and `write-report`, then re-read the
63
- report and current checkout before `verify-test-gate`. `workflow.complete` derives its
64
- summary from the report and rejects stale, malformed, contradictory, out-of-Change,
65
- or acceptance-incomplete evidence.
66
-
67
- Return the profile, exact results, verified seams, blockers, report digest, workflow
68
- state, and allowed transitions. Recommend broader review, more implementation, or
69
- delivery from those transitions. If current intent does not already select the
70
- semantic next action, use
71
- `../ultra-think/references/decision-dialogue.md` and wait for the user to select,
72
- modify, delegate, or defer it.
73
-
74
- Never invoke the recommended capability here; wait for an explicit user invocation.
39
+ Return the profile, exact results, verified seams, blockers, report digest, and the
40
+ model's recommended next explicit capability. Do not invoke it automatically.
@@ -3,55 +3,36 @@ name: ultra-think
3
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 without suppressing model judgment
6
+ # Align without suppressing judgment
7
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.
8
+ Thinking is optional. Answer self-contained questions directly. Persist only a
9
+ project-bound decision that must survive interruption or control later work.
11
10
 
12
- ## Reason first
11
+ ## Reason and interact
13
12
 
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
13
+ 1. Call `ultra.context` for the relevant project or Change scope.
14
+ 2. Define the real decision and the constraints that can change its answer.
15
+ 3. Inspect source, runtime, tests, accepted artifacts, and primary documentation
16
+ before asking the owner for facts.
17
+ 4. Separate verified fact, evidence-backed inference, accepted intent, delegated
19
18
  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
- 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.
44
-
45
- Prepare and confirm a checkpoint only when the decision changes a durable contract or
46
- artifact and a checkpoint is needed for recovery. Do not add a ceremonial approval
47
- gate to an already explicit user instruction or a reversible implementation detail.
48
-
49
- ## Return control
50
-
51
- Return the conclusion, decisive evidence, material uncertainty, and affected
52
- contracts. Re-read the invoking workflow or breadcrumb and recommend one of its
53
- `allowed_transitions`; follow `required_transition` only when a hard invariant leaves
54
- no alternative. Thinking does not implement code, mutate unrelated state, or invent a
55
- canonical next action.
56
-
57
- Never invoke the recommended capability here; wait for an explicit user invocation.
19
+ 5. Stress-test the leading answer with its strongest failure path and recovery.
20
+
21
+ Read `references/interaction-boundary.md`. Reuse a clear decision already present in the
22
+ request. Decide reversible delegated implementation details yourself. When owner
23
+ authority is necessary, ask one dependent decision through the host-native question
24
+ surface with a recommendation, decisive evidence, and the effect of the answer.
25
+
26
+ ## Persist only the normalized result
27
+
28
+ Use one `ultra.record` batch with `decision / accept` and, when required,
29
+ `artifact / bind` for the owning semantic document. A revised answer carries
30
+ `supersedes_id`; accepted records remain immutable history. Store normalized decisions
31
+ and artifact references, never transcripts or internal reasoning.
32
+
33
+ A semantic rejection remains a mutable diagnostic. Correct the record; do not invent a
34
+ new decision merely to satisfy a state machine.
35
+
36
+ Return the conclusion, decisive evidence, uncertainty, affected authority, and the
37
+ model's recommended next explicit capability. Thinking never performs unrelated
38
+ implementation or an external effect. Do not invoke the next capability automatically.
@@ -0,0 +1,56 @@
1
+ # Owner interaction boundary
2
+
3
+ Use this reference only when a material choice remains after inspecting current
4
+ authority and observable facts. Ultra does not require a ceremonial question before
5
+ every write.
6
+
7
+ ## Responsibility split
8
+
9
+ - The owner controls product intent, acceptance, non-goals, material tradeoffs, risk
10
+ acceptance, irreversible actions, external effects, and real-money commitments.
11
+ - The host model investigates facts, recommends a direction, makes reversible
12
+ implementation judgments, and explains uncertainty.
13
+ - Use the host-native question surface declared by the installed interaction contract;
14
+ prefer its structured form when the host exposes one.
15
+ - `ultra.record` persists only the normalized result and its provenance.
16
+ - MCP validates structure, identity, digests, CAS, leases, paths, and recovery. It does
17
+ not decide whether a product answer is good.
18
+
19
+ ## Interaction sequence
20
+
21
+ 1. Read `ultra.context` for the relevant scope.
22
+ 2. Inspect source, runtime, tests, accepted artifacts, and primary documentation.
23
+ 3. Reuse an explicit choice already present in the current request or an accepted
24
+ Decision Record.
25
+ 4. Decide a reversible delegated detail without asking.
26
+ 5. When owner authority is still required, ask one unresolved owner choice at a time
27
+ with:
28
+ - the recommendation;
29
+ - the discriminating evidence;
30
+ - the meaningful cost or failure mode;
31
+ - what changes when the answer changes.
32
+ 6. Normalize the answer into a deterministic Decision Record and persist it with
33
+ `ultra.record` using `kind: decision`, `action: accept`.
34
+ 7. Read `ultra.context` back and verify that the accepted decision is visible before
35
+ relying on it.
36
+
37
+ ## Decision Record
38
+
39
+ Persist only:
40
+
41
+ - normalized question;
42
+ - recommendation and selected answer;
43
+ - effects and non-goals;
44
+ - owner, source, and bounded provenance;
45
+ - applied artifact references;
46
+ - supersession link when revising an earlier answer.
47
+
48
+ Never persist raw transcripts, hidden reasoning, full prompts, UI receipts, or copied
49
+ memory-provider payloads.
50
+
51
+ ## Revisions and interruptions
52
+
53
+ Accepted decisions are immutable history. A changed answer creates a new Decision
54
+ Record that supersedes the prior record. A cancelled question writes nothing. If a
55
+ decision cannot be obtained, preserve the unresolved issue as a diagnostic or bounded
56
+ event; do not invent an answer or block unrelated work.