ultra-builder-pro-cli 0.23.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 (91) hide show
  1. package/.ultra-template/docs/research/README.md +4 -4
  2. package/CHANGELOG.md +45 -0
  3. package/README.md +21 -18
  4. package/adapters/_shared/codex-assets.cjs +121 -65
  5. package/adapters/_shared/interaction-contract.cjs +7 -1
  6. package/adapters/_shared/provenance.cjs +7 -2
  7. package/adapters/_shared/runtime-assets.cjs +3 -2
  8. package/adapters/_shared/runtime-native.cjs +132 -0
  9. package/adapters/claude.js +60 -30
  10. package/adapters/codex.js +178 -81
  11. package/adapters/grok.js +372 -0
  12. package/adapters/kimi.js +7 -3
  13. package/adapters/opencode.js +210 -32
  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 -229
  27. package/docs/ARCHITECTURE.md +203 -494
  28. package/docs/ARTIFACT-AUTHORITY.md +26 -22
  29. package/docs/PLUGIN-ISOLATION-CONTRACT.md +12 -9
  30. package/docs/ROADMAP.md +85 -110
  31. package/docs/RUNTIME-COMPAT-MATRIX.md +139 -175
  32. package/docs/SKILL-AUTHORING.md +3 -3
  33. package/docs/STATE-DB-ACCESS-POLICY.md +13 -8
  34. package/docs/WORKFLOW-LIFECYCLE.md +174 -448
  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/baseline-workflow.cjs +36 -38
  47. package/mcp-server/lib/canonical-json.cjs +19 -0
  48. package/mcp-server/lib/change-workflow.cjs +596 -44
  49. package/mcp-server/lib/context-envelope.cjs +508 -0
  50. package/mcp-server/lib/decision-records.cjs +337 -0
  51. package/mcp-server/lib/doctor.cjs +91 -33
  52. package/mcp-server/lib/init-project.cjs +78 -39
  53. package/mcp-server/lib/managed-file-write.cjs +116 -0
  54. package/mcp-server/lib/plan-checkpoint.cjs +177 -0
  55. package/mcp-server/lib/project-context.cjs +178 -0
  56. package/mcp-server/lib/stage-checkpoints.cjs +309 -0
  57. package/mcp-server/lib/state-db.cjs +155 -24
  58. package/mcp-server/lib/task-ledger.cjs +522 -13
  59. package/mcp-server/lib/ultra-facade.cjs +630 -442
  60. package/mcp-server/lib/worker-packet.cjs +358 -0
  61. package/mcp-server/server.cjs +200 -1103
  62. package/orchestrator/daemon.cjs +27 -9
  63. package/orchestrator/parallel-orchestrator.cjs +111 -76
  64. package/orchestrator/session-runner.cjs +135 -34
  65. package/package.json +10 -3
  66. package/skills/ultra-change/SKILL.md +9 -8
  67. package/skills/ultra-deliver/SKILL.md +3 -3
  68. package/skills/ultra-dev/SKILL.md +18 -11
  69. package/skills/ultra-doctor/SKILL.md +2 -2
  70. package/skills/ultra-init/SKILL.md +6 -5
  71. package/skills/ultra-init/references/brownfield-adoption.md +11 -8
  72. package/skills/ultra-plan/SKILL.md +10 -8
  73. package/skills/ultra-research/SKILL.md +12 -7
  74. package/skills/ultra-review/SKILL.md +9 -6
  75. package/skills/ultra-review/references/unified-schema.md +2 -0
  76. package/skills/ultra-review/scripts/review_wait.py +8 -0
  77. package/skills/ultra-status/SKILL.md +2 -2
  78. package/skills/ultra-test/SKILL.md +4 -2
  79. package/skills/ultra-think/SKILL.md +7 -7
  80. package/skills/ultra-think/references/interaction-boundary.md +56 -0
  81. package/spec/cli-protocol.md +80 -199
  82. package/spec/mcp-tools.yaml +37 -2804
  83. package/spec/schemas/state-db.sql +107 -4
  84. package/spec/schemas/{task-ledger.v1.schema.json → task-ledger.v2.schema.json} +70 -6
  85. package/ultra-tools/commands/status.cjs +369 -243
  86. package/mcp-server/lib/context-spine.cjs +0 -1208
  87. package/mcp-server/lib/decision-dialogue.cjs +0 -1128
  88. package/mcp-server/lib/project-breadcrumb.cjs +0 -173
  89. package/mcp-server/lib/spec-learning.cjs +0 -284
  90. package/mcp-server/lib/workflow-state.cjs +0 -3129
  91. package/skills/ultra-think/references/decision-dialogue.md +0 -155
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra-builder-pro-cli",
3
- "version": "0.23.0",
4
- "description": "Explicitly invoked Ultra Builder Pro workflows for Claude Code, OpenCode, Codex CLI, and Kimi Code, with project-local MCP authority and lifecycle recovery.",
3
+ "version": "0.24.0",
4
+ "description": "Explicitly invoked Ultra Builder Pro workflows for Claude Code, OpenCode, Codex CLI, Kimi Code, and Grok Build, with a project-local MCP persistence and safety kernel.",
5
5
  "bin": {
6
6
  "ultra-builder-pro-cli": "bin/install.js",
7
7
  "ubp": "bin/install.js",
@@ -61,13 +61,19 @@
61
61
  "!**/*.pyo",
62
62
  "!**/*.test.cjs",
63
63
  "!**/tests/**",
64
- "!mcp-server/test-support/**"
64
+ "!mcp-server/test-support/**",
65
+ "!mcp-server/lib/workflow-state.cjs",
66
+ "!mcp-server/lib/decision-dialogue.cjs",
67
+ "!mcp-server/lib/context-spine.cjs",
68
+ "!mcp-server/lib/project-breadcrumb.cjs",
69
+ "!mcp-server/lib/spec-learning.cjs"
65
70
  ],
66
71
  "keywords": [
67
72
  "claude-code",
68
73
  "opencode",
69
74
  "codex",
70
75
  "kimi-code",
76
+ "grok-build",
71
77
  "agent",
72
78
  "cli",
73
79
  "multi-runtime",
@@ -101,6 +107,7 @@
101
107
  "prepublishOnly": "npm run verify:release",
102
108
  "install:claude": "node bin/install.js --claude --local",
103
109
  "install:kimi": "node bin/install.js --kimi --local",
110
+ "install:grok": "node bin/install.js --grok --local",
104
111
  "install:all": "node bin/install.js --all --local"
105
112
  },
106
113
  "dependencies": {
@@ -22,24 +22,25 @@ checkpoint accepts the downstream authority.
22
22
  a choice changes accepted product intent, compatibility, security, material cost,
23
23
  external effects, or recovery.
24
24
 
25
- Read `../ultra-think/references/decision-dialogue.md` before asking. MCP may report
25
+ Read `../ultra-think/references/interaction-boundary.md` before asking. MCP may report
26
26
  contradictory risk fields, but the model and owner choose the semantic correction.
27
27
 
28
28
  ## Record the contract
29
29
 
30
- Use one `ultra.record` batch for `change.create` or `change.update`, relevant
31
- `decision.*`, and `change.delta` when the delta is already known. Every entry carries
32
- a stable idempotency key. Read the result through `ultra.context`.
30
+ Use one `ultra.record` batch with `change_contract / open` or
31
+ `change_contract / revise`, relevant `decision / accept`, and `artifact / bind` for
32
+ an already-known typed delta. Every entry carries a stable idempotency key. Read the
33
+ result through `ultra.context`.
33
34
 
34
35
  Keep every Change-owned semantic artifact below
35
36
  `.ultra/changes/active/<change-id>/`. Standard and major Changes require a typed delta
36
37
  before planning. A true no-semantic-change case records an explicit reason instead of
37
38
  manufacturing a mutation.
38
39
 
39
- Changing accepted intent reopens the draft and makes only genuinely dependent evidence
40
- stale. `ready` is not an absorbing state. A semantic rejection returns diagnostics;
41
- repair and retry the same draft. Use `workflow.abandon` only to preserve and cancel an
42
- attempt intentionally.
40
+ Changing accepted intent creates a new accepted checkpoint revision and makes only
41
+ genuinely dependent evidence stale. Readiness is derived, not a stored absorbing
42
+ state. A semantic rejection returns diagnostics; repair and retry the same draft.
43
+ Use `change_contract / cancel` only when the owner intentionally abandons the Change.
43
44
 
44
45
  Publish the durable Change contract with `ultra.sync { action: publish }` when it is a
45
46
  useful team handoff. Recommend bounded `ultra-research` for a real evidence gap or
@@ -21,8 +21,8 @@ publication, deployment, or another external effect.
21
21
  worktree/context digests, local checks, rollback guidance, and timestamp; it contains
22
22
  no release decision.
23
23
 
24
- Use one `ultra.record` batch for the reconciliation, report artifact, learning
25
- resolutions, and other durable facts.
24
+ Use one typed `ultra.record` batch for `artifact / bind`, any normalized
25
+ `decision / accept`, and bounded `event / append` facts.
26
26
 
27
27
  ## Archive once
28
28
 
@@ -35,7 +35,7 @@ internally:
35
35
  - derives convergence from current dev, test, review, delta, docs, and checkout;
36
36
  - applies the overlay and archive through the recoverable filesystem/DB transaction;
37
37
  - rebinds registered artifacts into a self-contained archive;
38
- - completes the durable delivery checkpoint;
38
+ - accepts one immutable delivery checkpoint revision;
39
39
  - publishes the updated team checkpoint.
40
40
 
41
41
  A semantic rejection returns mutable blockers. Repair the same packet and retry. A
@@ -5,17 +5,21 @@ description: Implement one authoritative Ultra task through a fresh-context, tes
5
5
 
6
6
  # Implement one task
7
7
 
8
- The model owns code reasoning and edits. Ultra owns the durable task contract, current
9
- Context Manifest, execution lease, evidence references, and checkpoint.
8
+ The model owns code reasoning and edits. Ultra owns the durable task contract,
9
+ canonical Context Envelope, execution lease, immutable Worker Packet, evidence
10
+ references, and checkpoint.
10
11
 
11
12
  ## Bind execution
12
13
 
13
14
  1. Call `ultra.context { stage: dev, scope: { change_id, task_id }, detail: full }`.
14
15
  2. Import a newer team checkpoint with `ultra.sync`; stop on a real same-record or
15
16
  active-session conflict.
16
- 3. Reuse a valid lease or call `ultra.session { action: admission }`, then
17
- `ultra.session { action: acquire }`. Work only in the returned worktree.
18
- 4. Confirm purpose, acceptance, dependencies, public seam, verification command,
17
+ 3. Reuse a valid lease or call `ultra.session { action: acquire }`. Acquire atomically
18
+ performs admission, compiles or reuses the implementation Context Envelope, mints
19
+ the lease/worktree, and returns the immutable Worker Packet. A separate
20
+ `action: admission` is an optional read-only preview, not a prerequisite.
21
+ 4. Verify the returned packet digest, purpose, acceptance, dependencies, public seam,
22
+ exact output path/schema, verification command,
19
23
  non-goals, recovery, and required context refs. Update the task contract before
20
24
  implementation when accepted intent changed.
21
25
 
@@ -26,10 +30,13 @@ before changing logic. Implement the smallest complete vertical slice. Ask the o
26
30
  only when new evidence changes product intent, compatibility, security, material cost,
27
31
  external effects, or recovery.
28
32
 
29
- Use `ultra.record` batches for task status, bounded events, artifacts, decisions, and
30
- documentation candidates. Live ownership, `in_progress`, session ids, leases,
31
- worktrees, telemetry, and completion hashes remain local runtime state; durable task
32
- outcome and evidence may enter the team checkpoint.
33
+ Use typed `ultra.record` entries for `task_outcome / start|block|complete`,
34
+ `event / append`, `artifact / bind`, `decision / accept`, and corrected
35
+ `task_contract / revise`. Every worker output must repeat the exact `packet_digest`;
36
+ the parent registers it only after packet, output path, schema, and digest validation.
37
+ Live ownership, `in_progress`, session ids, leases, worktrees, telemetry, and
38
+ completion hashes remain local runtime state; durable task outcome and evidence may
39
+ enter the team checkpoint.
33
40
 
34
41
  Run focused and adjacent risk-justified checks, then a task-scoped independent review.
35
42
  Fix blocking findings and refresh affected evidence.
@@ -37,8 +44,8 @@ Fix blocking findings and refresh affected evidence.
37
44
  ## Commit one semantic checkpoint
38
45
 
39
46
  Call `ultra.checkpoint` once with `stage: dev`, the exact Change/Task scope, evidence,
40
- and stable idempotency key. It compiles or reuses the implementation Context Manifest
41
- and validates the durable outcome. A rejection leaves the draft mutable.
47
+ and stable idempotency key. It binds the exact Context Envelope and Worker Packet and
48
+ reports outcome diagnostics. A rejection leaves the draft mutable.
42
49
 
43
50
  After acceptance, mark the task durably completed, publish with `ultra.sync`, and
44
51
  create at most one authorized local task commit containing code and semantic
@@ -30,8 +30,8 @@ journals, reconcile orphan sessions, and repair installed mechanical assets.
30
30
 
31
31
  It may not manufacture semantic evidence, import or publish a team checkpoint, replace
32
32
  a healthy baseline, resolve decisions, edit application code, or force a draft to
33
- accepted. Use `ultra.sync` for reviewed checkpoint import/publish and
34
- `workflow.abandon` through `ultra.record` for intentional draft cancellation.
33
+ accepted. Use `ultra.sync` for reviewed checkpoint import/publish. Doctor never changes
34
+ semantic checkpoint acceptance or Change intent.
35
35
 
36
36
  Preserve corrupt DB/WAL/SHM and dirty worktrees. Never patch plugin cache files by
37
37
  hand; reinstall through `ubp` and verify the installed manifest and hook targets.
@@ -23,17 +23,18 @@ capability.
23
23
  4. Ask the owner only when scope, healthy-authority replacement, destructive recovery,
24
24
  or another material choice cannot be derived. Reuse explicit intent.
25
25
 
26
- Read `../ultra-think/references/decision-dialogue.md` before asking a material
26
+ Read `../ultra-think/references/interaction-boundary.md` before asking a material
27
27
  question.
28
28
 
29
29
  ## Initialize once
30
30
 
31
- Call `ultra.record` with one entry:
31
+ Call `ultra.record` with one typed entry:
32
32
 
33
33
  ```text
34
- operation: task.init_project
35
- data: target_dir, project_name, mode=auto, git_mode=auto, optional scope
36
- idempotency_key: stable init attempt id
34
+ kind: baseline
35
+ action: initialize
36
+ data: { target_dir, project_name, mode=auto, git_mode=auto, optional scope }
37
+ idempotency_key: <stable init attempt id>
37
38
  ```
38
39
 
39
40
  This stateless bootstrap is the only `ultra.record` operation allowed before
@@ -66,7 +66,8 @@ ledger into hundreds of application tasks.
66
66
 
67
67
  ## Record authority
68
68
 
69
- Call `baseline.record` with full replacement arrays for:
69
+ Use `ultra.record` with `kind: baseline`, `action: observe`, and full replacement
70
+ arrays for:
70
71
 
71
72
  - scope and repository revision;
72
73
  - repository classification;
@@ -82,12 +83,14 @@ Use the server-returned revision, branch, worktree digest, and specification dig
82
83
  ## Obtain approval and converge
83
84
 
84
85
  Present scope, observed behavior, drift, known-red verification, unknowns, gaps, dirty
85
- worktree state, and material decisions to the owner. Call `baseline.converge` only after
86
- explicit approval. Set `accept_known_red` and `accept_dirty_worktree` only for the exact
87
- items the owner accepted.
86
+ worktree state, and material decisions to the owner. Use `ultra.record` with
87
+ `kind: baseline`, `action: accept` only after explicit approval. Set
88
+ `accept_known_red` and `accept_dirty_worktree` only for the exact items the owner
89
+ accepted.
88
90
 
89
91
  Resolve returned blockers through evidence or an owner decision, record the replacement
90
- snapshot, and retry. Adoption is complete only when `baseline.get` is `ready` and
91
- current, the gap ledger has no open blocker, and project doctor has no authority
92
- failure. Route all selected work through `ultra-change`, including work described by a
93
- legacy plan. Import its accepted intent into a current Change Contract before planning.
92
+ snapshot, and retry. Adoption is complete only when `ultra.context` reports a current
93
+ accepted baseline, the gap ledger has no open blocker, and project doctor has no
94
+ authority failure. Route all selected work through `ultra-change`, including work
95
+ described by a legacy plan. Import its accepted intent into a current Change Contract
96
+ before planning.
@@ -28,13 +28,14 @@ Large sources stay lazy. Use digest freshness for accepted inputs that must rema
28
28
  byte-current, existence for expected implementation targets, and advisory only when
29
29
  drift must be visible without blocking.
30
30
 
31
- Read `../ultra-think/references/decision-dialogue.md` before asking a material
31
+ Read `../ultra-think/references/interaction-boundary.md` before asking a material
32
32
  question.
33
33
 
34
34
  ## Record and checkpoint
35
35
 
36
- Use one `ultra.record` batch for all `task.create` and necessary `task.update`
37
- operations. Read back the draft with `ultra.context`.
36
+ Use one `ultra.record` batch with `task_contract / define` for new tasks and
37
+ `task_contract / revise` for corrected contracts. Read back the draft with
38
+ `ultra.context`.
38
39
  Never read or write `.ultra/tasks/tasks.json`; use `ultra.sync` for the Git team
39
40
  checkpoint, and never edit the local runtime projection directly.
40
41
 
@@ -47,13 +48,14 @@ payload: planning posture, optional approval already obtained, context budget/re
47
48
  idempotency_key: stable semantic Plan checkpoint id
48
49
  ```
49
50
 
50
- The checkpoint compiles or reuses the content-addressed Context Manifest, validates
51
- task coverage and dependencies, exports `plan.json` and `plan.md` once, completes the
52
- durable Plan, and publishes the team checkpoint. Do not export again after validation.
51
+ The checkpoint compiles or reuses the content-addressed Context Envelope, derives
52
+ coverage diagnostics, exports `plan.json` and `plan.md` inside the same recoverable
53
+ publication, accepts one Plan revision, and publishes the team checkpoint. Do not
54
+ export separately.
53
55
 
54
56
  If rejected, the same Plan draft stays mutable. Fix task contracts or evidence and
55
- retry. To discard it, record `workflow.abandon`; never edit SQLite or open a parallel
56
- run to escape a blocker.
57
+ retry. To replace an accepted Plan, submit a new checkpoint revision; never edit
58
+ SQLite or open a parallel run to escape a diagnostic.
57
59
 
58
60
  Return topology, executable slices, public seams, exact checks, checkpoint result, and
59
61
  the model's recommended execution order. Do not invoke `ultra-dev` automatically.
@@ -21,7 +21,7 @@ not a questionnaire or a step-by-step supervisor.
21
21
  5. Use the host-native question surface only for a material unresolved route. Reuse an
22
22
  explicit owner choice without asking again.
23
23
 
24
- Read `../ultra-think/references/decision-dialogue.md` before asking. Load only the
24
+ Read `../ultra-think/references/interaction-boundary.md` before asking. Load only the
25
25
  reference files for research areas that actually apply.
26
26
 
27
27
  ## Investigate
@@ -34,10 +34,15 @@ For each selected area:
34
34
  - never store transcripts, hidden reasoning, raw provider payloads, or copied prompts;
35
35
  - record evidence, specification updates, decisions, deferrals, and consequences.
36
36
 
37
- Use one `ultra.record` batch for durable facts such as `artifact.record`,
38
- `decision.*`, `baseline.*`, `change.update`, or `change.delta`. Every entry needs a
39
- stable idempotency key. A rejected entry is a mutable diagnostic: fix the draft and
40
- retry; use `workflow.abandon` only when intentionally discarding that attempt.
37
+ Use one `ultra.record` batch for typed durable facts:
38
+
39
+ - `artifact / bind` for a managed research or specification artifact;
40
+ - `decision / accept` for normalized owner intent;
41
+ - `baseline / observe` or `baseline / accept` for baseline authority;
42
+ - `change_contract / revise` for Change-bound findings.
43
+
44
+ Every entry needs a stable idempotency key. A semantic rejection is a mutable
45
+ diagnostic: correct the same draft and retry.
41
46
 
42
47
  ## Commit one research checkpoint
43
48
 
@@ -46,8 +51,8 @@ and their report outputs in `payload.steps`; include only work actually performe
46
51
  verified, reused, deferred with owner authority, or proved not applicable. Synthesis
47
52
  must always be present.
48
53
 
49
- For baseline research, record and converge the accepted baseline through
50
- `ultra.record`, then publish the team checkpoint with `ultra.sync { action: publish }`.
54
+ For baseline research, update and accept the baseline through typed `ultra.record`
55
+ entries, then publish the team checkpoint with `ultra.sync { action: publish }`.
51
56
  For Change-bound research, keep all findings and delta artifacts below the Change
52
57
  root and never edit accepted baseline specs directly.
53
58
 
@@ -21,12 +21,15 @@ Keep two independent verdict axes:
21
21
  5. Always run `review-spec`. Select the smallest engineering worker set that covers
22
22
  actual risk; record selected and excluded roles with rationale.
23
23
 
24
- Workers are read-only and use the host-native bounded-worker mechanism. Validate their
25
- artifacts with `scripts/review_wait.py` and
26
- `references/unified-schema.md`. Preserve every finding unchanged in `SUMMARY.json`;
27
- group duplicates only in the human summary.
28
-
29
- Register specialist and summary artifacts through one `ultra.record` batch.
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.
30
+
31
+ Register specialist and summary artifacts through one `ultra.record` batch using
32
+ `artifact / bind`.
30
33
 
31
34
  ## Checkpoint
32
35
 
@@ -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")
@@ -20,14 +20,14 @@ Report:
20
20
  ```text
21
21
  Ultra: <healthy|degraded> · <branch>@<head|unborn|non-git>
22
22
  Baseline: <mode>/<status> · gaps=<open>/<blocking>
23
- Workflow drafts: <active|blocked|ready> · accepted checkpoints=<current|stale>
23
+ Stage checkpoints: drafts=<count> · accepted=<current|stale|none>
24
24
  Change: <id/status|none> · delta/docs=<state>
25
25
  Task: <id/status|none> · Sessions: <active>
26
26
  Evidence: plan=<state> · test=<state> · review=<axes> · delivery=<state>
27
27
  Team checkpoint: <current|drifted|revalidation_required|missing|invalid>
28
28
  Blockers: <hard mechanical blockers or none>
29
29
  Warnings: <advisory semantic diagnostics or none>
30
- Host recommendation: <capability and concise rationale>
30
+ Model recommendation: <capability and concise rationale>
31
31
  ```
32
32
 
33
33
  Treat warnings and failed draft checks as information, not mechanical orders. Only
@@ -20,10 +20,12 @@ generated projections are not evidence.
20
20
  5. Run repository-native commands and real boundaries. A bug or incident needs one
21
21
  deterministic red-to-green regression signal.
22
22
 
23
- Write an `ultra-test-report-v1` report below the owning Change. Bind exact acceptance
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
24
26
  ids, task ids, HEAD, worktree/context digests, commands, seams, failures, recovery,
25
27
  profile, timestamp, blockers, and evidence-derived verdict. Register it with
26
- `ultra.record` using `artifact.record`.
28
+ `ultra.record` using `artifact / bind`.
27
29
 
28
30
  ## Checkpoint
29
31
 
@@ -18,20 +18,20 @@ project-bound decision that must survive interruption or control later work.
18
18
  implementation judgment, and unresolved owner choice.
19
19
  5. Stress-test the leading answer with its strongest failure path and recovery.
20
20
 
21
- Read `references/decision-dialogue.md`. Reuse a clear decision already present in the
21
+ Read `references/interaction-boundary.md`. Reuse a clear decision already present in the
22
22
  request. Decide reversible delegated implementation details yourself. When owner
23
23
  authority is necessary, ask one dependent decision through the host-native question
24
24
  surface with a recommendation, decisive evidence, and the effect of the answer.
25
25
 
26
26
  ## Persist only the normalized result
27
27
 
28
- Use one `ultra.record` batch for `decision.thread_start`, `decision.open`, the
29
- appropriate resolve/delegate/defer/supersede operation, the owning artifact mutation,
30
- and `decision.complete` when they are all known. Store normalized decisions and
31
- artifact references, never transcripts or internal reasoning.
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
32
 
33
- A semantic rejection remains a mutable diagnostic. Correct the record or intentionally
34
- abandon the draft; do not invent a new decision merely to satisfy a state machine.
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
35
 
36
36
  Return the conclusion, decisive evidence, uncertainty, affected authority, and the
37
37
  model's recommended next explicit capability. Thinking never performs unrelated
@@ -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.