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,177 +1,142 @@
1
- # Runtime Compatibility Matrix
2
-
3
- Current presentation contract for Ultra Builder Pro. Claude Code, OpenCode,
4
- Codex, and Kimi Code 0.26+ are supported native plugin hosts. The canonical
5
- asset boundary lives in `adapters/_shared/runtime-assets.cjs`.
6
-
7
- Legend: **FULL** = native host surface, **FUNCTIONAL** = the complete outcome is
8
- available through a different native host primitive, **DEGRADED** = supported
9
- but missing an equivalent lifecycle/control surface, **N/A** = intentionally
10
- not installed.
11
-
12
- ## 1. Plugin and workflow surface
13
-
14
- | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
15
- |---|---|---|---|---|
16
- | Package form | `.claude-plugin` native plugin | native config bundle + JS plugin | personal `.codex-plugin` | managed `kimi.plugin.json` plugin |
17
- | Public entry | `/ultra-builder-pro:ultra-*` | `/ultra-*` | `$ultra-builder-pro:ultra-*` | `/ultra-builder-pro:ultra-*` |
18
- | Public Ultra capabilities | 11, model invocation disabled | 11 commands backed by private workflow assets | 11, implicit invocation disabled | 11, model invocation disabled |
19
- | Internal agent-rule skills | 4, non-user-facing | 4, non-user-facing | 4 with implicit invocation disabled | 4, consumed by review workers |
20
- | Collaboration companions | `codex-collab`, `ultra-verify` | `cc-collab`, `codex-collab`, `ultra-verify` | `cc-collab`, `ultra-verify` | `cc-collab`, `codex-collab`, `ultra-verify` |
21
- | Automatic workflow bootstrap | N/A | N/A | N/A | N/A |
22
- | External browser/deploy/framework skills | N/A | N/A | N/A | N/A |
23
-
24
- Codex converts workflows into namespaced skills and records ten compatibility
25
- command mappings in `command-map.json`; `ultra-review` remains directly
26
- invocable as a skill. Kimi registers all eleven commands through its native
27
- plugin command directory and exposes the allowlisted skills independently.
28
-
29
- ## 2. Agents and collaboration
30
-
31
- | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
32
- |---|---|---|---|---|
33
- | Bundled review/debug workers | FULL, native Markdown agents | FULL, native agent frontmatter | FULL, 10 managed TOML agents | FUNCTIONAL, 10 prompt templates consumed by `Agent` / `AgentSwarm` |
34
- | Plugin custom-agent registration | FULL | FULL | FULL | N/A; the 0.26 manifest has no custom-agent field |
35
- | Native bounded delegation | native agent surface | native agent surface | native Codex subagents | native `Agent` / `AgentSwarm` |
36
- | Cross-host advisor | explicit and read-only | explicit and read-only | explicit and read-only | explicit and read-only |
37
- | Primary-agent ownership | FULL | FULL | FULL | FULL |
38
-
39
- No bundled worker owns private conversational memory. It receives current-checkout
40
- evidence and bounded context from the primary host, then returns a result for
41
- primary verification. On Kimi, the review workflow reads the bundled worker
42
- template before creating the corresponding `AgentSwarm` item; the templates are
43
- not presented as nonexistent custom agents.
44
-
45
- ## 3. Workflow hooks
46
-
47
- | Lifecycle | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
48
- |---|---|---|---|---|
49
- | Session context/health | FULL, active-workflow breadcrumb on native `SessionStart` | FULL, native JS plugin injects only an active-workflow breadcrumb; health via `system.doctor` | FULL, active-workflow breadcrumb on native `SessionStart` | FULL, active-workflow breadcrumb via native hooks |
50
- | Active edit boundary | FULL, `PreToolUse Edit|Write` | FULL, `tool.execute.before` rejects managed checkpoint/projection writes | FULL, `PreToolUse Edit|Write|apply_patch` | FULL, native `PreToolUse Edit|Write` deny contract |
51
- | Pre-compact checkpoint | FULL | FULL | FULL | FULL, native `PreCompact` |
52
- | Post-compact context injection | FULL | FULL, native compacting context | FULL, native `PostCompact` restore | DEGRADED; checkpoint restoration runs, but Kimi 0.26/0.27 does not reinject fire-and-forget hook text |
53
- | Stop lifecycle advisory | FULL, native non-blocking `Stop` | N/A, no equivalent stop event needed | FULL, native non-blocking `Stop` | FULL, native non-blocking `Stop` |
54
- | Subagent lifecycle evidence | FULL | DEGRADED, no equivalent packaged event | FULL | FULL, native `SubagentStart` / `SubagentStop` |
55
-
56
- Health/context, compact, stop, and subagent hooks remain silent unless
57
- `.ultra/.runtime/state.db` proves an active, blocked, or ready workflow. Managed-file
58
- protection applies to every initialized project because neither a hand-edited team
59
- checkpoint nor generated local projection may become a second authority. No host
60
- receives prompt capture, transcript capture,
61
- observation journaling, session-summary memory, generic command blocking, or
62
- generic post-edit policy.
63
- Baseline-adoption and context-budget warnings are injected as advisory context;
64
- they do not deny edits or stop active incident work.
65
-
66
- ## 4. MCP and state
67
-
68
- | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
69
- |---|---|---|---|---|
70
- | stdio MCP registration | plugin `.mcp.json` | `opencode.json` local MCP entry | plugin `.mcp.json` | plugin `mcpServers` entry |
71
- | Live/declared contracts | 60 | 60 | 60 | 60 |
72
- | Structured user alignment | `AskUserQuestion` in interactive sessions | `question` when permission is not denied | `request_user_input` when the current mode exposes it | `AskUserQuestion` outside auto mode |
73
- | Greenfield/brownfield baseline adoption | FULL | FULL | FULL | FULL |
74
- | Context Manifest v3 / breadcrumb | FULL | FULL, same bundled read-only DB reader as every hook | FULL | FULL |
75
- | Approval-gated spec learning | FULL | FULL | FULL | FULL |
76
- | Host-native review/discovery/ask | native | native | documented in `codex-capability-map.json` | native Kimi tools and workers |
77
- | Workflow-memory envelope | project `.ultra/` | project `.ultra/` | project `.ultra/` | project `.ultra/` |
78
- | Lifecycle/index authority | project `.ultra/.runtime/state.db` | project `.ultra/.runtime/state.db` | project `.ultra/.runtime/state.db` | project `.ultra/.runtime/state.db` |
79
- | Git team checkpoint | `.ultra/tasks/tasks.json` | `.ultra/tasks/tasks.json` | `.ultra/tasks/tasks.json` | `.ultra/tasks/tasks.json` |
80
- | General memory-provider API | N/A | N/A | N/A | N/A |
81
-
82
- All 60 `task.*`, `session.*`, `baseline.*`, `change.*`, `decision.*`,
83
- `workflow.*`, `artifact.*`, `system.*`, and `plan.*` operations
84
- registered by `mcp-server/server.cjs` are live. Review, impact discovery, skill
85
- loading, and user interaction remain host-native surfaces.
86
-
87
- When a native structured question surface is unavailable, the shared interaction
88
- contract permits one concise direct question only if ordinary conversation is still
89
- available. A host mode that forbids interaction leaves the choice unanswered; Ultra
90
- does not infer consent or silently delegate the semantic route.
91
-
92
- Kimi starts plugin MCP processes with the managed plugin root as `cwd`. The
93
- generated launcher recovers the project from the inherited `PWD`, sets
94
- `UBP_ROOT_DIR` and `UBP_DB_PATH`, and refuses to start if that project boundary
95
- cannot be established. On POSIX it intentionally uses `env node` because Kimi
96
- 0.26/0.27's embedded Node ABI differs from the ABI used to install `better-sqlite3`.
97
-
98
- Archive finalization and archive-journal recovery use an adjacent, explicitly
99
- packaged Python 3 worker. The worker accepts only bounded, basename-only
100
- operations and performs mutations relative to inherited, identity-checked
101
- directory descriptors. This boundary requires a POSIX Python runtime with
102
- `dir_fd`, no-follow `stat`, and `O_NOFOLLOW` support. If that prerequisite is
103
- missing, archive operations fail closed with `ARCHIVE_RUNTIME_UNAVAILABLE`;
104
- Ultra never falls back to ancestor-sensitive pathname mutation. Other MCP
105
- operations remain available.
106
-
107
- ## 5. User instruction isolation
108
-
109
- | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
110
- |---|---|---|---|---|
111
- | Durable user file | `~/.claude/CLAUDE.md` | `~/.config/opencode/AGENTS.md` | `~/.codex/AGENTS.md` | `~/.kimi-code/AGENTS.md` |
112
- | Automatic overwrite by plugin install | no | no | no | no |
113
- | Writer shipped by Ultra | N/A | N/A | N/A | N/A |
114
- | Uninstall removes user instructions | no | no | no | no |
115
-
116
- The Kimi plugin installer also does not edit `~/.kimi-code/config.toml`. Durable
117
- user preferences belong to each host and remain outside Ultra's ownership.
118
- Legacy Ultra handbook text is not proof of plugin ownership and is never
119
- silently rewritten or removed.
120
-
121
- ## 6. Install, update, and uninstall
122
-
123
- | Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
124
- |---|---|---|---|---|
125
- | Adapter install | FULL | FULL | FULL | FULL |
126
- | Global install command | `ubp --claude --global` | `ubp --opencode --global` | `ubp --codex --global` | `ubp --kimi --global` |
127
- | Native update visibility | next host session | host restart | cachebuster + new task | `/reload` or new session |
128
- | Removes stale managed assets | FULL | FULL | FULL | FULL |
129
- | Preserves unrelated config | FULL | FULL | FULL | FULL, including `config.toml` and unrelated registry records |
130
- | Uninstall ownership guard | managed plugin root | sentinels + owned MCP entry | managed root/manifest/agent headers | managed root + exact registry record |
131
- | Normalized install provenance | FULL | FULL | FULL | FULL |
132
- | Local-source dirty state and worktree digest | FULL | FULL | FULL | FULL |
133
- | Read-only `ubp --all --global --doctor` | FULL | FULL | FULL | FULL |
134
- | Asset-content and host-contract drift detection | FULL | FULL | FULL | FULL |
135
-
136
- Package-local Git provenance never falls through to an enclosing consumer
137
- repository. Source installs record commit, dirty state, and a deterministic
138
- worktree digest; registry installs record unavailable checkout fields as
139
- `null`.
140
-
141
- Kimi's global managed root is
142
- `~/.kimi-code/plugins/managed/ultra-builder-pro`; its only registry mutation is
143
- the owned `ultra-builder-pro` entry in `~/.kimi-code/plugins/installed.json`.
144
- Reinstall preserves the user's enabled/capability choices and unrelated plugin
145
- records. Uninstall refuses an unmanaged or conflicting root.
146
-
147
- ## 7. Durable schema compatibility
1
+ # Runtime compatibility matrix
2
+
3
+ Claude Code, OpenCode, Codex, Kimi Code, and Grok Build are supported plugin
4
+ hosts. The canonical asset boundary lives in
5
+ `adapters/_shared/runtime-assets.cjs`.
6
+
7
+ Legend: **FULL** means a native equivalent exists; **FUNCTIONAL** means the same
8
+ outcome uses a different native primitive; **DEGRADED** means the missing host
9
+ surface is stated and the Skill-entry Context read remains authoritative; **N/A**
10
+ means intentionally absent.
11
+
12
+ ## Plugin and workflow surface
13
+
14
+ | Capability | Claude Code | OpenCode | Codex | Kimi Code | Grok Build |
15
+ |---|---|---|---|---|---|
16
+ | Package form | `.claude-plugin` | config bundle + JS plugin | personal `.codex-plugin` | managed `kimi.plugin.json` | native Grok plugin |
17
+ | Public entry | `/ultra-builder-pro:ultra-*` | `/ultra-*` | `$ultra-builder-pro:ultra-*` | `/ultra-builder-pro:ultra-*` | native Ultra commands/Skills |
18
+ | Public workflow Skills | 11 explicit-only | 11 command-backed private assets | 11 implicit-disabled | 11 model-disabled | 11 explicit-only |
19
+ | Internal rule Skills | 4 worker-only | 4 worker-only | 4 implicit-disabled | 4 worker templates | 4 worker templates |
20
+ | MCP tools | exactly 7 | exactly 7 | exactly 7 | exactly 7 | exactly 7 |
21
+ | Automatic semantic chaining | N/A | N/A | N/A | N/A | N/A |
22
+
23
+ Commands are thin launchers. The Skill contains adaptable semantic workflow prose;
24
+ the adapter contains only host metadata, translation, and wiring.
25
+
26
+ ## Agents and collaboration
27
+
28
+ | Capability | Claude Code | OpenCode | Codex | Kimi Code | Grok Build |
29
+ |---|---|---|---|---|---|
30
+ | Bundled review/debug workers | FULL, 10 native Markdown agents | FULL, 10 native agents | FULL, 10 managed TOML agents | FUNCTIONAL, 10 prompt templates | FUNCTIONAL, 10 prompt templates |
31
+ | Immutable Worker Packet | FULL | FULL | FULL | FULL | FULL |
32
+ | Native bounded delegation | native agent surface | native agent surface | native subagents | Agent/AgentSwarm | plugin agent surface |
33
+ | Cross-host advisor | explicit read-only | explicit read-only | explicit read-only | explicit read-only | explicit read-only |
34
+ | Final acceptance owner | primary host | primary host | primary host | primary host | primary host |
35
+
36
+ Every Worker Packet binds Context, decisions, Git, Task, acceptance, evidence,
37
+ output schema, and digest. A worker cannot write SQLite or accept its own result.
38
+
39
+ ## Hooks and Context
40
+
41
+ | Lifecycle | Claude Code | OpenCode | Codex | Kimi Code | Grok Build |
42
+ |---|---|---|---|---|---|
43
+ | Session Context | FULL, SessionStart compact | FULL, system transform | FULL, session/prompt compact | FULL where native event consumes output | DEGRADED, ignored stdout is not claimed as injection |
44
+ | Skill-entry Context | FULL | FULL | FULL | FULL | FULL and authoritative |
45
+ | Managed-file protection | PreToolUse | tool.before | PreToolUse | PreToolUse | camelCase PreToolUse |
46
+ | Compact recovery | PreCompact + SessionStart | compacting transform | pre/post compact | native pre/post where available | records lifecycle; Skill rereads Context |
47
+ | Stop | non-blocking advisory | session.idle annotation | non-blocking advisory | non-blocking advisory | advisory only for `reason=end_turn` |
48
+ | Subagent event | minimal ids | DEGRADED when host lacks event | minimal ids | native start/stop | minimal ids where exposed |
49
+
50
+ All Hook context comes from the canonical Context Envelope generator. Hooks never
51
+ capture prompts, transcripts, general memory, observations, or code-graph payloads.
52
+ They do not create semantic records or block ordinary work for incomplete evidence.
53
+
54
+ ## MCP and native runtime
55
+
56
+ | Capability | Claude Code | OpenCode | Codex | Kimi Code | Grok Build |
57
+ |---|---|---|---|---|---|
58
+ | stdio registration | `.mcp.json` | local MCP entry | `.mcp.json` | `mcpServers` | native plugin MCP entry |
59
+ | Public discovered tools | 7 | 7 | 7 | 7 | 7 |
60
+ | Public write/read smoke | FULL | FULL | FULL | FULL | FULL |
61
+ | Doctor backup/reopen | FULL | FULL | FULL | FULL | FULL |
62
+ | Bundled `better-sqlite3` native | FULL | FULL | FULL | FULL | FULL |
63
+ | ABI/provenance validation | FULL | FULL | FULL | FULL | FULL |
64
+ | Git team checkpoint | `.ultra/tasks/tasks.json` | same | same | same | same |
65
+ | Local authority | `.ultra/.runtime/state.db` | same | same | same | same |
66
+
67
+ The installed runtime includes the externalized `better-sqlite3` package and its
68
+ native `.node`. Provenance records native digest, platform, architecture, Node ABI,
69
+ and runtime command. A mismatched ABI fails before authority is opened; Doctor
70
+ repairs through staging and atomic swap.
71
+
72
+ Archive finalization uses a packaged Python 3 worker with identity-checked
73
+ descriptor-relative filesystem operations on POSIX. If this prerequisite is absent,
74
+ archive fails closed with `ARCHIVE_RUNTIME_UNAVAILABLE`; other MCP tools remain usable.
75
+
76
+ ## Structured user interaction
77
+
78
+ | Host | Native question surface | Fallback |
79
+ |---|---|---|
80
+ | Claude Code | `AskUserQuestion` | one concise direct question |
81
+ | OpenCode | `question` | one concise direct question |
82
+ | Codex | `request_user_input` when exposed by current mode | one concise direct question |
83
+ | Kimi Code | `AskUserQuestion` outside auto mode | one concise direct question |
84
+ | Grok Build | native structured question when exposed | one concise direct question |
85
+
86
+ An interaction-disabled mode leaves the choice unresolved. The adapter never infers
87
+ consent or stores an interaction receipt.
88
+
89
+ ## User instruction isolation
90
+
91
+ | Host | Durable user instruction | Installer writes it? |
92
+ |---|---|---|
93
+ | Claude Code | `~/.claude/CLAUDE.md` | no |
94
+ | OpenCode | `~/.config/opencode/AGENTS.md` | no |
95
+ | Codex | `~/.codex/AGENTS.md` | no |
96
+ | Kimi Code | `~/.kimi-code/AGENTS.md` | no |
97
+ | Grok Build | host-owned instruction file | no |
98
+
99
+ Install, update, Doctor, and uninstall preserve user instructions, repository
100
+ instructions, project `.ultra`, unrelated plugins, and unrelated host configuration.
101
+
102
+ ## Install lifecycle
103
+
104
+ | Capability | Claude Code | OpenCode | Codex | Kimi Code | Grok Build |
105
+ |---|---|---|---|---|---|
106
+ | Global flag | `--claude` | `--opencode` | `--codex` | `--kimi` | `--grok` |
107
+ | Staging + atomic swap | FULL | FULL | FULL | FULL | FULL |
108
+ | Exact-host preflight | FULL | FULL | FULL | FULL | FULL |
109
+ | Managed uninstall guard | FULL | FULL | FULL | FULL | FULL |
110
+ | Preserve unrelated config | FULL | FULL | FULL | FULL | FULL |
111
+ | Read-only Doctor | FULL | FULL | FULL | FULL | FULL |
112
+
113
+ Preflight uses the final manifest command and verifies initialize, `tools/list == 7`,
114
+ public write/read, Doctor backup, close/reopen consistency, native provenance, and
115
+ lazy project initialization.
116
+
117
+ ## Durable compatibility
148
118
 
149
119
  | Capability | Contract |
150
120
  |---|---|
151
- | Current state schema | `20.0` |
152
- | Runtime values | `claude`, `opencode`, `codex`, `kimi` |
153
- | Upgrade from earlier schema | preserves runtime rows, adds Context Spine state through 10.0, authoritative baseline adoption in 11.0, repository evidence in 12.0, durable workflows in 13.0, continuous baseline revalidation in 14.0, typed research semantics and verified reconciliation in 15.0, resumable owner-agent decision threads and workflow alignment gates in 16.0, explicit unborn-Git authority in 17.0, adaptive transitions and legacy workflow normalization in 18.0, non-ceremonial decision completion in 19.0, then typed artifact ownership and normalized dependency edges in 20.0 |
154
- | Preservation gate | rows, IDs, indexes, foreign keys, telemetry, incidents, and migration history remain intact |
155
- | Failure behavior | rollback; no partially upgraded authority database |
156
-
157
- ## 8. Verification sources
158
-
159
- - `adapters/tests/*.test.cjs` verifies each installer and native manifest.
160
- - `tests/conformance/<runtime>/*.test.cjs` verifies command/skill, hook, MCP,
161
- idempotency, and smoke presentation for all four hosts.
162
- - `tests/conformance/kimi/smoke.test.cjs` reproduces Kimi's plugin-root MCP
163
- `cwd` and proves that the first state write lands in the active project.
164
- - `adapters/_shared/tests/runtime-assets.test.cjs` prevents retired or external
165
- skills and generic/memory hooks from re-entering a package.
166
- - `tests/retired-runtime.test.cjs` prevents retired runtime code or prompt text
167
- from re-entering active product surfaces.
168
- - `adapters/_shared/tests/plugin-isolation.test.cjs` and `tests/install.test.cjs`
169
- verify the absence of a handbook writer and byte-preservation of all user instruction files.
170
- - `adapters/_shared/tests/provenance.test.cjs` verifies normalized manifests,
171
- content hashes, source attribution, corruption handling, and contract drift.
172
- - `tests/install.test.cjs` verifies healthy four-host doctor output and
173
- host-specific hook/MCP degradation after controlled tampering.
174
- - `tests/package-smoke.test.cjs` installs the packed tarball into a clean
175
- consumer and executes a live MCP round trip through every generated launcher.
176
-
177
- Any capability claim elsewhere must match current adapter code and these tests.
121
+ | Current authority schema | `22.0` |
122
+ | Runtime values | `claude`, `opencode`, `codex`, `kimi`, `grok` |
123
+ | Legacy inputs | v4.4/v4.5 task projections, the legacy root-level state database, Task Contexts, v0.22/v0.23 DB and team ledger |
124
+ | Preservation | exact-byte backup, row/ID/event/migration-history preservation, verified semantic promotion |
125
+ | Failure | transactional rollback; no partial DB, ledger, native runtime, or host installation |
126
+
127
+ Old workflow/dialogue rows are retained as non-authoritative history. Current
128
+ Decisions, Stage Checkpoints, Context Envelopes, Worker Packets, and team checkpoint
129
+ are reconstructed only from verified authority.
130
+
131
+ ## Verification sources
132
+
133
+ - `adapters/tests/*.test.cjs` validates every native builder and manifest.
134
+ - `tests/conformance/<runtime>/*.test.cjs` validates all five hosts.
135
+ - `adapters/_shared/tests/runtime-assets.test.cjs` keeps docs and asset allowlists
136
+ synchronized.
137
+ - `tests/install.test.cjs` verifies atomic install, rollback, Doctor, and instruction
138
+ preservation.
139
+ - `tests/package-smoke.test.cjs` installs the npm tarball and performs five real
140
+ launcher write/read/backup/reopen round trips.
141
+ - Grok acceptance also runs the available native plugin validate/inspect command and
142
+ camelCase Hook fixtures.
@@ -37,8 +37,8 @@ only from the main workflow or one directly relevant reference.
37
37
  ## Language
38
38
 
39
39
  The standards do not prohibit Chinese. Ultra source prompts use English as a project
40
- policy because one source is transformed for Claude Code, Codex, OpenCode, and Kimi
41
- Code. The host or user instruction controls the response language; a workflow must not
40
+ policy because one source is transformed for Claude Code, Codex, OpenCode, Kimi Code,
41
+ and Grok Build. The host or user instruction controls the response language; a workflow must not
42
42
  hard-code the user's output language unless language is itself part of the task.
43
43
 
44
44
  Maintainer documentation may use the language appropriate for its audience. English
@@ -72,4 +72,4 @@ against delivered behavior, or independent analyses against authoritative eviden
72
72
  5. Are judgments evidence-based rather than threshold-based?
73
73
  6. Are commands thin and agents bounded?
74
74
  7. Do positive and negative trigger evals cover accidental activation?
75
- 8. Do source, four generated runtimes, and package contents pass validation?
75
+ 8. Do source, five generated runtimes, and package contents pass validation?
@@ -3,10 +3,10 @@
3
3
  > Multi-process access contract. Current authority is defined by
4
4
  > [`DECISIONS.md`](./DECISIONS.md) and the live database schema.
5
5
 
6
- `.ultra/.runtime/state.db` is the checkout-local lifecycle, index, transition,
7
- freshness, and coordination authority for baselines, changes, decision threads/items, tasks,
8
- workflow runs/steps, events, sessions, incidents, projections, telemetry, and spec
9
- references (D18, D52, D54). Registered digest-bound files carry semantic and evidence
6
+ `.ultra/.runtime/state.db` is the checkout-local persistence and safety authority for
7
+ baselines, Changes, normalized Decision Records, Stage Checkpoints, Context Envelopes,
8
+ Worker Packets, Tasks, events, Sessions, incidents, projections, telemetry, and spec
9
+ references. Registered digest-bound files carry semantic and evidence
10
10
  bodies; the DB owns their references and current digests. The tracked
11
11
  `.ultra/tasks/tasks.json` is an MCP-published handoff checkpoint, not a parallel live
12
12
  writer. Every process that touches the DB must follow the rules below; deviations are
@@ -26,7 +26,7 @@ bugs.
26
26
  but never `UPDATE` / `DELETE`.
27
27
 
28
28
  The CLI may indirectly mutate ordinary workflow tables by spawning the MCP server over
29
- stdio and calling `task.update`, `session.spawn`, etc. — but the actual
29
+ stdio and calling the public `ultra.*` kernel — but the actual
30
30
  SQLite write is performed by the MCP server's writer connection. The documented
31
31
  exceptions are initial schema/baseline creation, migration, and explicitly
32
32
  authorized backup-first doctor recovery. The CLI never provides a parallel raw
@@ -36,8 +36,8 @@ The append-only carve-out for `events` exists because `events.id INTEGER
36
36
  PRIMARY KEY AUTOINCREMENT` makes concurrent inserts collision-free under
37
37
  WAL + `busy_timeout`. This lets hooks and short-lived CLI invocations
38
38
  record audit observations without paying the cost of a full MCP round trip.
39
- It does not grant lifecycle authority: external writers and public
40
- `task.append_event` use the published observation allowlist, while lifecycle event
39
+ It does not grant lifecycle authority: external writers use the published observation
40
+ allowlist, while lifecycle event
41
41
  names are emitted only inside the mutation that owns the corresponding state change.
42
42
  Consumers must verify mutable rows rather than infer success from an event name.
43
43
 
@@ -74,16 +74,18 @@ resolve the mount/runtime constraint before retrying.
74
74
 
75
75
  | Table | Writer of record |
76
76
  |--------------------|--------------------------------------------------------|
77
- | `baselines` | MCP server (`baseline.start` / `baseline.record` / `baseline.converge`); initialization and legacy-projection migration may create only the first draft or compatibility row |
78
- | `tasks` | MCP server (`task.create` / `task.update` / `task.delete`) |
79
- | `changes` | MCP server (`change.create` / `change.update` / `change.converge` / `change.archive`) |
80
- | `decision_threads`, `decision_items` | MCP server (`decision.thread_start` / `decision.open` / `decision.resolve` / `decision.delegate` / `decision.defer` / `decision.supersede` / `decision.complete` / `decision.checkpoint`); pending recovery state, normalized accepted intent, durable effects, typed applied references, lifecycle completion, and optional artifact checkpoints are stored, never UI receipts, prompts, or transcripts |
81
- | `workflow_runs`, `workflow_steps` | MCP server (`workflow.start` / `workflow.step` / `workflow.complete`); skills provide evidence inputs but never write rows directly |
82
- | `artifacts`, `artifact_edges` | MCP server (`artifact.record`); workflow-owned registration may use the same internal registry transaction |
83
- | `context_snapshots`, `spec_learning_candidates`, `trace_links` | MCP server through change lifecycle tools |
77
+ | `baselines` | MCP server through `ultra.record`, `ultra.checkpoint`, and `ultra.archive`; initialization and legacy migration may create only the first draft or compatibility row |
78
+ | `tasks` | MCP server through `ultra.record`, `ultra.checkpoint`, and `ultra.sync` |
79
+ | `changes` | MCP server through `ultra.record`, `ultra.checkpoint`, and `ultra.archive` |
80
+ | `decision_records` | MCP server through `ultra.record`; normalized accepted intent and applied references are stored, never UI receipts, prompts, or transcripts |
81
+ | `stage_checkpoints` | MCP server through `ultra.checkpoint`; mutable drafts and immutable accepted/superseded revisions, never fixed reasoning steps |
82
+ | `context_envelopes`, `worker_packets` | MCP server through `ultra.context`, `ultra.checkpoint`, and `ultra.session`; exact digest-bound handoff authority |
83
+ | `decision_threads`, `decision_items`, `workflow_runs`, `workflow_steps` | legacy history retained for migration and audit; no current public writer or authorization role |
84
+ | `artifacts`, `artifact_edges` | MCP server through `ultra.record` and checkpoint-owned registration |
85
+ | `context_snapshots`, `spec_learning_candidates`, `trace_links` | MCP server through `ultra.record` and `ultra.checkpoint` |
84
86
  | `incidents`, `projection_jobs`, `event_consumers`, `circuit_breaker` | MCP server; backup-first doctor recovery may perform only documented mechanical transitions |
85
- | `events` | MCP server for lifecycle events; approved processes and `task.append_event` for allowlisted append-only observations |
86
- | `sessions` | MCP server (`session.spawn` / `session.close` / `session.heartbeat`); orchestrator may write status transitions |
87
+ | `events` | MCP server for lifecycle events; approved processes and `ultra.record` for allowlisted append-only observations |
88
+ | `sessions` | MCP server through `ultra.session`; orchestrator may write status transitions |
87
89
  | `telemetry` | MCP server (collected from tool-call wrappers); orchestrator may dump bulk samples |
88
90
  | `specs_refs` | MCP server (rebuilt on `spec_changed` event); orchestrator may rebuild |
89
91
  | `migration_history`| schema initializer and `ultra-tools migrate` or doctor repair |
@@ -91,8 +93,8 @@ resolve the mount/runtime constraint before retrying.
91
93
 
92
94
  ## 5. Git team checkpoint
93
95
 
94
- Only `task.ledger_publish` may derive `.ultra/tasks/tasks.json` from SQLite, and only
95
- `task.ledger_import` may merge it into SQLite. Server startup performs one import after
96
+ Only `ultra.sync { action: publish }` may derive `.ultra/tasks/tasks.json` from SQLite,
97
+ and only `ultra.sync { action: import }` may merge it into SQLite. Server startup performs one import after
96
98
  opening project authority; later pulls in a long-running process require an explicit
97
99
  import. The same checkpoint is idempotent and must not append an event again.
98
100
 
@@ -142,8 +144,11 @@ The contract on this page is enforced by:
142
144
  no duplicates.
143
145
  - `mcp-server/tests/state-ops.test.cjs` — immediate transactions, rollback,
144
146
  status transitions, task contracts, and event coupling.
145
- - `mcp-server/lib/workflow-state.test.cjs` — ordered workflow transitions,
146
- evidence/output requirements, blocking/resume, and cross-stage gates.
147
+ - `mcp-server/lib/stage-checkpoints.test.cjs` — mutable drafts, immutable accepted
148
+ revisions, supersession, and report-first diagnostics.
149
+ - `mcp-server/lib/context-envelope.test.cjs` and
150
+ `mcp-server/lib/worker-packet.test.cjs` — content-addressed Context and immutable
151
+ delegated handoff.
147
152
  - `mcp-server/lib/task-ledger.test.cjs` — portable-field filtering, digest ancestry,
148
153
  idempotent import, baseline/Change/task fast-forward and conflict behavior, legacy
149
154
  backup, and active-session protection.