ultra-builder-pro-cli 0.19.1 → 0.21.1
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.
- package/.ultra-template/docs/research/README.md +26 -5
- package/.ultra-template/specs/discovery.md +1 -1
- package/.ultra-template/tasks/tasks.json +1 -1
- package/CHANGELOG.md +90 -1
- package/README.md +62 -29
- package/adapters/_shared/codex-assets.cjs +69 -11
- package/adapters/_shared/interaction-contract.cjs +60 -5
- package/adapters/_shared/runtime-assets.cjs +41 -1
- package/adapters/claude.js +7 -5
- package/adapters/codex.js +1 -1
- package/adapters/kimi.js +2 -8
- package/adapters/opencode.js +30 -28
- package/bin/orchestrator.js +64 -24
- package/commands/ultra-research.md +1 -1
- package/docs/AGENT-CONTEXT.md +79 -45
- package/docs/ARCHITECTURE.md +75 -38
- package/docs/ARTIFACT-AUTHORITY.md +234 -0
- package/docs/DECISIONS.md +20 -10
- package/docs/LEGACY-CLI-CROSSWALK.md +15 -11
- package/docs/PLUGIN-ISOLATION-CONTRACT.md +4 -3
- package/docs/ROADMAP.md +21 -6
- package/docs/RUNTIME-COMPAT-MATRIX.md +30 -13
- package/docs/STATE-DB-ACCESS-POLICY.md +11 -9
- package/docs/WORKFLOW-LIFECYCLE.md +105 -54
- package/hooks/README.md +6 -5
- package/hooks/active_task_context.py +97 -12
- package/hooks/context_spine.py +16 -4
- package/hooks/health_check.py +5 -4
- package/hooks/pre_stop_check.py +5 -2
- package/hooks/runtime_paths.py +396 -0
- package/hooks/subagent_tracker.py +5 -2
- package/hooks/workflow_checkpoint.py +16 -3
- package/hooks/workflow_context.py +11 -3
- package/hooks/workflow_resume.py +7 -4
- package/mcp-server/breadcrumb.cjs +20 -2
- package/mcp-server/lib/archive-journal.cjs +1026 -111
- package/mcp-server/lib/archive-mutation-worker.py +365 -0
- package/mcp-server/lib/artifact-registry.cjs +1126 -0
- package/mcp-server/lib/baseline-workflow.cjs +9 -4
- package/mcp-server/lib/change-packet.cjs +818 -0
- package/mcp-server/lib/change-workflow.cjs +932 -176
- package/mcp-server/lib/context-paths.cjs +111 -0
- package/mcp-server/lib/context-spine.cjs +511 -45
- package/mcp-server/lib/decision-dialogue.cjs +427 -12
- package/mcp-server/lib/delivery-transaction.cjs +471 -0
- package/mcp-server/lib/doctor-backup-worker.cjs +328 -0
- package/mcp-server/lib/doctor.cjs +375 -12
- package/mcp-server/lib/git-bootstrap.cjs +459 -47
- package/mcp-server/lib/init-project.cjs +190 -95
- package/mcp-server/lib/plan-publication-worker.cjs +830 -0
- package/mcp-server/lib/plan-store.cjs +700 -5
- package/mcp-server/lib/project-breadcrumb.cjs +23 -4
- package/mcp-server/lib/projector.cjs +174 -40
- package/mcp-server/lib/runtime-paths.cjs +1687 -0
- package/mcp-server/lib/safe-project-file.cjs +385 -0
- package/mcp-server/lib/spec-learning.cjs +28 -12
- package/mcp-server/lib/state-db.cjs +397 -13
- package/mcp-server/lib/state-ops.cjs +248 -49
- package/mcp-server/lib/telemetry.cjs +12 -3
- package/mcp-server/lib/workflow-state.cjs +614 -62
- package/mcp-server/server.cjs +282 -33
- package/orchestrator/daemon.cjs +2 -10
- package/orchestrator/parallel-orchestrator.cjs +314 -50
- package/orchestrator/planner/plan-builder.cjs +1 -1
- package/orchestrator/recovery.cjs +125 -7
- package/orchestrator/session-close-journal-worker.cjs +5 -0
- package/orchestrator/session-close-journal.cjs +1014 -0
- package/orchestrator/session-runner.cjs +679 -69
- package/orchestrator/worktree-manager.cjs +186 -35
- package/package.json +2 -3
- package/skills/cc-collab/SKILL.md +4 -1
- package/skills/codex-collab/SKILL.md +5 -2
- package/skills/ultra-change/SKILL.md +38 -13
- package/skills/ultra-deliver/SKILL.md +23 -11
- package/skills/ultra-dev/SKILL.md +33 -6
- package/skills/ultra-doctor/SKILL.md +6 -2
- package/skills/ultra-init/SKILL.md +4 -2
- package/skills/ultra-plan/SKILL.md +68 -18
- package/skills/ultra-research/SKILL.md +45 -32
- package/skills/ultra-review/SKILL.md +9 -5
- package/skills/ultra-status/SKILL.md +9 -4
- package/skills/ultra-test/SKILL.md +15 -7
- package/skills/ultra-think/SKILL.md +6 -0
- package/skills/ultra-think/references/decision-dialogue.md +61 -14
- package/skills/ultra-verify/SKILL.md +4 -1
- package/spec/cli-protocol.md +19 -7
- package/spec/mcp-tools.yaml +531 -46
- package/spec/schemas/change-delta.v1.schema.json +153 -0
- package/spec/schemas/documentation-reconciliation.v1.schema.json +106 -0
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/state-db.sql +57 -17
- package/spec/schemas/tasks.v4.5.schema.json +1 -1
- package/ultra-tools/cli.cjs +3 -2
- package/ultra-tools/commands/db.cjs +76 -25
- package/ultra-tools/commands/migrate.cjs +995 -80
- package/ultra-tools/commands/session.cjs +34 -8
- package/ultra-tools/commands/status.cjs +34 -7
- package/ultra-tools/commands/system.cjs +129 -22
- package/commands/learn.md +0 -10
- package/orchestrator/skill-miner.cjs +0 -133
- package/output-styles/coding-vibes.md +0 -67
- package/output-styles/structural-thinking.md +0 -61
- package/skills/learn/SKILL.md +0 -58
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Ultra artifact authority
|
|
2
|
+
|
|
3
|
+
This document defines what `.ultra/` remembers across sessions, which surface owns
|
|
4
|
+
each fact, and how working output becomes durable Ultra authority.
|
|
5
|
+
|
|
6
|
+
## Boundary
|
|
7
|
+
|
|
8
|
+
`.ultra/` is the project-local cross-session workflow-memory envelope for Ultra
|
|
9
|
+
Builder Pro. It retains normalized intent, lifecycle progress, tasks, bounded execution
|
|
10
|
+
context, specifications, evidence, provenance, recovery state, and external provider
|
|
11
|
+
references. It is not a general conversational-memory system and does not retain raw
|
|
12
|
+
prompts, transcripts, chain-of-thought, general episodic summaries, or code-graph
|
|
13
|
+
payloads.
|
|
14
|
+
|
|
15
|
+
Semantic and evidence artifacts under `.ultra/` are trackable so reviewed intent and
|
|
16
|
+
verification can travel with the repository. `.ultra/.runtime/` is always ignored:
|
|
17
|
+
the SQLite authority, leases, worktrees, local telemetry, and recovery snapshots remain
|
|
18
|
+
checkout-local unless a team uses an explicit synchronization or artifact handoff.
|
|
19
|
+
|
|
20
|
+
## Artifact classes
|
|
21
|
+
|
|
22
|
+
| Class | Examples | Authority |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| Lifecycle and index | `.ultra/.runtime/state.db` | Sole authority for identifiers, normalized accepted intent, status, legal transitions, references, digests, freshness, provenance, locks, leases, transactions, recovery, and coordination |
|
|
25
|
+
| Digest-bound semantic artifacts | specifications, research reports, Change intent/delta/plan, context manifests | Authoritative semantic bodies only while registered by the owning DB row or workflow step and matching its recorded digest |
|
|
26
|
+
| Digest-bound evidence artifacts | test, review, delivery, and verification reports | Authoritative evidence bodies only while registered, immutable where required, and matching the recorded digest and scope |
|
|
27
|
+
| Generated projections | `tasks/tasks.json`, generated task-status headers, activity exports | Read-only views derived from DB authority; manual edits are overwritten and never become authority |
|
|
28
|
+
| Advisory recovery | `.ultra/.runtime/checkpoint.json` | Compact recovery hint derived from DB authority; stale or missing content never overrides the DB |
|
|
29
|
+
| Working scratch | `.ultra/.runtime/collab/`, temporary session output, incomplete drafts | Non-authoritative working material until verified and promoted through a supported workflow write |
|
|
30
|
+
| External provider references | memory or code-graph provider name, scope, version, stable reference, freshness metadata | Metadata-only context stored by Ultra; the provider remains authority for its payload |
|
|
31
|
+
|
|
32
|
+
The DB is not expected to contain every semantic paragraph. It owns the lifecycle and
|
|
33
|
+
the binding between a fact and its current content. A digest-bound file owns the
|
|
34
|
+
registered semantic or evidence body. Neither surface is a parallel lifecycle source.
|
|
35
|
+
|
|
36
|
+
## Human, model, and mechanical responsibilities
|
|
37
|
+
|
|
38
|
+
| Actor | Responsible for | Must not do |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| Owner | Goals, acceptance, non-goals, material choices, risk acceptance, and authorization for irreversible or external effects | Supply facts the checkout or runtime can establish directly |
|
|
41
|
+
| Host model | Inspect evidence, recommend a route, ask only for unresolved owner choices, normalize the answer, call the owning write, update semantic artifacts, read back the result, and present the next recommendation | Fabricate evidence, infer owner authorization, or bypass legal transitions |
|
|
42
|
+
| Ultra MCP | Persist normalized inputs, validate structure and current digests, record lifecycle and provenance, enforce legal transitions, project views, and expose recovery | Choose product direction, prove a UI click, force a semantic route, or replace model judgment |
|
|
43
|
+
| Host adapter | Render the shared interaction contract through the host-native question and tool surfaces | Become a second workflow authority |
|
|
44
|
+
| Hook | Observe lifecycle, inject compact DB-derived recovery context, and protect generated projections | Select a semantic route or block ordinary development |
|
|
45
|
+
|
|
46
|
+
## Intent persistence
|
|
47
|
+
|
|
48
|
+
The interaction sequence is:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
inspect -> suggest -> host-native ask -> normalize -> persist -> apply -> read back
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The host-native ask is conditional. An explicit owner instruction can already resolve
|
|
55
|
+
a choice, so the model must not ask
|
|
56
|
+
again merely to manufacture proof. When interaction is needed, the adapter uses the
|
|
57
|
+
host-native question surface. Once the model writes the normalized result through
|
|
58
|
+
`decision.resolve`, `decision.delegate`, or `decision.defer`, the DB treats that result
|
|
59
|
+
as current cross-session intent authority. It does not store or verify a UI receipt,
|
|
60
|
+
raw prompt, or transcript.
|
|
61
|
+
|
|
62
|
+
If the accepted decision changes another Ultra authority, the model applies that change
|
|
63
|
+
through its owning MCP tool or digest-bound artifact, reads the result back, and passes
|
|
64
|
+
typed `applied_refs` to `decision.complete`. A decision whose normalized record is
|
|
65
|
+
itself the complete authority may have no applied reference. Breadcrumb and decision
|
|
66
|
+
read paths recall accepted intent only after the dialogue thread is completed or
|
|
67
|
+
confirmed. A row-backed applied reference names an exact field and canonical value,
|
|
68
|
+
with an optional digest of that value. A specification or artifact reference names
|
|
69
|
+
the exact file digest. Row existence alone never proves that intent was applied.
|
|
70
|
+
|
|
71
|
+
## Promotion and evidence
|
|
72
|
+
|
|
73
|
+
Working material becomes durable only when all applicable conditions hold:
|
|
74
|
+
|
|
75
|
+
1. the active workflow permits the write;
|
|
76
|
+
2. consequential claims are verified against the checkout, runtime, test result, or
|
|
77
|
+
primary source;
|
|
78
|
+
3. the model writes through the owning MCP operation or immutable artifact path;
|
|
79
|
+
4. the DB records the owning baseline, change, workflow, task, or artifact reference;
|
|
80
|
+
5. content-bearing files match the recorded SHA-256 digest and scope;
|
|
81
|
+
6. the model reads back the resulting state before reporting completion.
|
|
82
|
+
|
|
83
|
+
The durable evidence trail may include normalized decisions, delegation source,
|
|
84
|
+
durable effects, typed applied references, workflow-step evidence, artifact hashes,
|
|
85
|
+
verification commands and results, provenance, events, and recovery state. It must not
|
|
86
|
+
include chain-of-thought, UI-click proof, raw prompts, or conversation transcripts.
|
|
87
|
+
|
|
88
|
+
Verified conclusions from `.ultra/.runtime/collab/` or other scratch locations must be promoted
|
|
89
|
+
into the invoking DB-bound workflow artifact or report. Keeping a file in the scratch
|
|
90
|
+
directory is not promotion.
|
|
91
|
+
|
|
92
|
+
## Change overlay authority
|
|
93
|
+
|
|
94
|
+
An active Change is an isolated overlay below
|
|
95
|
+
`.ultra/changes/active/<change-id>/`. Its intent, adaptive research, `findings.md`,
|
|
96
|
+
typed delta payloads, plan, contexts, documentation payloads, progress projection,
|
|
97
|
+
test reports, review artifacts, and delivery evidence remain below that root. Change
|
|
98
|
+
research never edits baseline specifications.
|
|
99
|
+
|
|
100
|
+
`change.delta` registers exact baseline id, repository revision, specification
|
|
101
|
+
digests, accepted decisions, non-goals, acceptance, documentation impact, unknowns,
|
|
102
|
+
and every semantic mutation's before/after digest. A no-semantic-change result is an
|
|
103
|
+
explicit typed delta, not an absent file. `progress.md` is a deterministic projection
|
|
104
|
+
of the registered delta and documentation state; it is never an independent status
|
|
105
|
+
authority.
|
|
106
|
+
|
|
107
|
+
`change.documentation_reconcile` binds the current delta id and digest, every changed
|
|
108
|
+
document's before/after digest, delta and acceptance references, verification, and a
|
|
109
|
+
verified consumer or explicit no-consumer reason. Standard and major delivery require
|
|
110
|
+
one current reconciliation even when its document set is empty.
|
|
111
|
+
|
|
112
|
+
`change.archive` preflights the complete target set before writing, applies overlay
|
|
113
|
+
bytes through a recoverable local transaction, refreshes baseline digests, moves the
|
|
114
|
+
complete Change root to its archive location, and rebinds registry paths. A conflict,
|
|
115
|
+
crash, or DB failure must roll back or resume the whole packet; no subset is reported
|
|
116
|
+
as delivered.
|
|
117
|
+
|
|
118
|
+
## Context and plan authority
|
|
119
|
+
|
|
120
|
+
`change.context` is a pure compiler. It reads accepted Change, task, baseline, checkout,
|
|
121
|
+
and provider-reference authority and writes one immutable manifest plus its DB snapshot
|
|
122
|
+
row. It never updates provider references or semantic Change fields. Each snapshot is
|
|
123
|
+
identified exactly by `change_id`, nullable `task_id`, `role`, and `gate`; consumers
|
|
124
|
+
must not substitute a newer snapshot from a different tuple.
|
|
125
|
+
|
|
126
|
+
Context refs preserve `expected_digest`, `anchor`, `scope`, and `freshness_policy`.
|
|
127
|
+
Digest-bound refs are revalidated at the consuming gate, existence-bound implementation
|
|
128
|
+
targets may change while remaining present, and advisory drift is retained as a
|
|
129
|
+
warning. File bodies stay lazy. Implementation manifests inline only the selected task,
|
|
130
|
+
its direct dependency/integration neighborhood, and its task-context contract.
|
|
131
|
+
|
|
132
|
+
A current plan is a Change-owned pair:
|
|
133
|
+
|
|
134
|
+
- `<artifact_root>/plan.json` is the machine-readable topology and exact planning
|
|
135
|
+
context binding;
|
|
136
|
+
- `<artifact_root>/plan.md` is the deterministic human projection of the same plan and
|
|
137
|
+
task contracts.
|
|
138
|
+
|
|
139
|
+
`plan.export` selects both paths from the owning Change and accepts no arbitrary output
|
|
140
|
+
path. `verify-plan` binds the JSON digest and the preceding `plan/planning` snapshot;
|
|
141
|
+
the artifact registry records both plan files with that context provenance. Publication
|
|
142
|
+
preflights both path authorities and prior digests, rejects symlinked ancestors or
|
|
143
|
+
targets, and journals the two file replacements so a registry or event failure restores
|
|
144
|
+
both prior files while the SQLite transaction rolls back. The global
|
|
145
|
+
`.ultra/execution-plan.json` remains readable only for explicit legacy migration and is
|
|
146
|
+
never current write or dispatch authority.
|
|
147
|
+
|
|
148
|
+
## Registry contract
|
|
149
|
+
|
|
150
|
+
`artifact.record` is the public writer for a semantic or evidence file that is not
|
|
151
|
+
already registered by its owning workflow operation. Every managed registry row has:
|
|
152
|
+
|
|
153
|
+
- a typed `owner_type` and `owner_id`;
|
|
154
|
+
- an artifact `kind`, project-relative `path`, lifecycle `status`, and SHA-256
|
|
155
|
+
`digest`;
|
|
156
|
+
- `before_digest` and `after_digest` values for optimistic write validation and
|
|
157
|
+
change evidence;
|
|
158
|
+
- structured `provenance` and optional metadata;
|
|
159
|
+
- normalized source and consumer edges in `artifact_edges`.
|
|
160
|
+
|
|
161
|
+
The write replaces all edges for the artifact in one immediate SQLite transaction.
|
|
162
|
+
It never accumulates stale edges with `INSERT OR IGNORE`. If an existing digest
|
|
163
|
+
changes, the same transaction emits `spec_changed`, marks only reachable artifact
|
|
164
|
+
and task consumers stale through typed artifact/task/workflow/change intermediates,
|
|
165
|
+
and records the exact invalidated endpoints. Self-edges and dependency cycles are
|
|
166
|
+
rejected without changing prior authority. A caller can provide
|
|
167
|
+
`expected_before_digest`; a mismatch fails without changing the row or its edges.
|
|
168
|
+
|
|
169
|
+
`artifact.get` reads by unique ID or unambiguous path. It fails closed when a path
|
|
170
|
+
has multiple active authorities and reports whether the row satisfies the managed
|
|
171
|
+
registry contract. A canonical path can have only one non-archived authority across
|
|
172
|
+
all owners and kinds. Runtime, scratch, `tasks.json`, and generated task contexts
|
|
173
|
+
cannot be promoted through this API.
|
|
174
|
+
|
|
175
|
+
Owning internal writers use the same transaction contract. Change intent, delta and
|
|
176
|
+
documentation packets, contexts, adaptive research, findings, incident diagnosis,
|
|
177
|
+
plan, test, review, delivery, archive reconciliation, and specification learning
|
|
178
|
+
cannot update a managed digest or provenance through a parallel SQL path.
|
|
179
|
+
|
|
180
|
+
Rows migrated from pre-20 schemas remain readable and preserve their original IDs,
|
|
181
|
+
paths, hashes, timestamps, and legacy change/task ownership. They are marked
|
|
182
|
+
`managed = 0` until an owning workflow or `artifact.record` supplies complete
|
|
183
|
+
provenance and dependency edges. This compatibility state preserves data without
|
|
184
|
+
pretending that an old row satisfies the current registry contract.
|
|
185
|
+
|
|
186
|
+
## Dependency and orphan diagnosis
|
|
187
|
+
|
|
188
|
+
`system.doctor` compares the registry, dependency graph, filesystem, and owner
|
|
189
|
+
tables. It reports:
|
|
190
|
+
|
|
191
|
+
- unregistered semantic or evidence files;
|
|
192
|
+
- registered files that are missing or whose digest/status is stale;
|
|
193
|
+
- missing typed owners;
|
|
194
|
+
- current managed artifacts without a consumer, unless explicitly terminal;
|
|
195
|
+
- dangling source or consumer endpoints;
|
|
196
|
+
- graph cycles that cannot become consumer evidence;
|
|
197
|
+
- more than one active authority for the same canonical path;
|
|
198
|
+
- legacy compatibility rows that remain unmanaged;
|
|
199
|
+
- generated task contexts whose task no longer exists.
|
|
200
|
+
|
|
201
|
+
`.ultra/.runtime/**`, `.ultra/scratch/**`, and fixed scaffold support files are outside
|
|
202
|
+
orphan diagnosis. Current generated projections are recognized from the DB task set,
|
|
203
|
+
not from a blanket directory exemption. Before a baseline is ready, only the reserved
|
|
204
|
+
`discovery.md`, `product.md`, `architecture.md`, and `research-distillate.md` scaffold
|
|
205
|
+
paths under `.ultra/specs/` are provisional; every additional specification is subject
|
|
206
|
+
to orphan diagnosis immediately. Completion cannot be manufactured by registering
|
|
207
|
+
empty templates. Doctor and status expose registered, managed, and unmanaged counts,
|
|
208
|
+
and compatibility remains unhealthy until every retained row is deliberately promoted
|
|
209
|
+
or retired.
|
|
210
|
+
|
|
211
|
+
## Task-context projection
|
|
212
|
+
|
|
213
|
+
`.ultra/tasks/contexts/<task-id>.md` is fully generated from current DB authority.
|
|
214
|
+
The projector replaces the whole file, including its execution contract and stale
|
|
215
|
+
banner, and marks it with `generated_by: ultra-projector`. It never preserves arbitrary
|
|
216
|
+
prose inserted into an earlier projection.
|
|
217
|
+
|
|
218
|
+
Before replacing an existing authored context, the projector promotes the exact legacy
|
|
219
|
+
body bytes once into a digest-bound `legacy_context_findings` artifact owned and
|
|
220
|
+
consumed by the task. Legacy frontmatter, stale banners, and generated contract marker
|
|
221
|
+
regions are removed first; any remaining authored body is retained exactly, even when
|
|
222
|
+
an older projector had preserved it after a generated contract. Replacement is skipped
|
|
223
|
+
without promotion only when no authored content remains. If promotion cannot be
|
|
224
|
+
registered, projection fails without deleting the authored body. A context target must
|
|
225
|
+
remain lexically and physically below
|
|
226
|
+
`.ultra/tasks/contexts/`; traversal and symlink ancestors are rejected by projection and
|
|
227
|
+
migration. When a task disappears, only an orphan carrying the generated marker may be
|
|
228
|
+
pruned, and the removal emits `projection_pruned`; unknown authored files are retained
|
|
229
|
+
for diagnosis.
|
|
230
|
+
|
|
231
|
+
Model findings, decisions, or evidence discovered during development must be written
|
|
232
|
+
below the owning Change root and registered through the workflow or `artifact.record`.
|
|
233
|
+
The next context projection references that authority. Editing the task-context body
|
|
234
|
+
or an accepted baseline specification directly is neither persistence nor promotion.
|
package/docs/DECISIONS.md
CHANGED
|
@@ -9,28 +9,38 @@ release-version authority.
|
|
|
9
9
|
|
|
10
10
|
| Layer | Owns | Must not own |
|
|
11
11
|
|---|---|---|
|
|
12
|
-
| User intent | Goals, acceptance, non-goals, material product trade-offs, risk acceptance, and authorization for irreversible or external effects | Facts that the current checkout or runtime can establish directly |
|
|
13
|
-
| Host model | Classification, investigation,
|
|
12
|
+
| User intent | Goals, acceptance, non-goals, semantic route selection, material product trade-offs, risk acceptance, and authorization for irreversible or external effects | Facts that the current checkout or runtime can establish directly |
|
|
13
|
+
| Host model | Classification and route recommendations, investigation, solution design, task decomposition, context, test and review strategy, documentation impact, intent normalization, and next-action recommendations | Fabricated evidence, bypassed authorization, or durable lifecycle state |
|
|
14
14
|
| Ultra MCP | IDs, state, digests, provenance, freshness, locks, leases, transactions, recovery, and legal state transitions | Product direction, a fixed research route, technology selection, or business decisions |
|
|
15
15
|
| Host adapter | Native Skill discovery, user-question surfaces, tool invocation, installation, and runtime wiring | A second project-state authority |
|
|
16
16
|
| Hook | Lifecycle observation, compact DB-derived context, recovery hints, and generated-projection protection | Ordinary development blocking or semantic route selection |
|
|
17
17
|
|
|
18
|
-
`.ultra
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
`.ultra/` is project-local cross-session workflow memory. `.ultra/.runtime/state.db` is
|
|
19
|
+
the only lifecycle, index, transition, freshness, and coordination authority.
|
|
20
|
+
Registered digest-bound files carry semantic or evidence bodies; generated
|
|
21
|
+
projections and working scratch are not authority. Prompt text, chat history,
|
|
22
|
+
general external-memory payloads, and code-graph payloads are not Ultra
|
|
23
|
+
authority. See [`ARTIFACT-AUTHORITY.md`](./ARTIFACT-AUTHORITY.md).
|
|
21
24
|
|
|
22
25
|
## Research coverage
|
|
23
26
|
|
|
24
27
|
The research references form an optional semantic catalog. The host model
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
inspects current evidence and recommends the smallest sufficient route. The
|
|
29
|
+
owner selects, modifies, delegates, or defers that route through the current
|
|
30
|
+
host's native question surface unless current intent already resolves it. The
|
|
31
|
+
host then normalizes and records the accepted coverage with an evidence-based
|
|
32
|
+
rationale and synthesis. Omitted catalog areas create no workflow rows. An
|
|
33
|
+
explicit `not_applicable` or accepted `deferred` entry is recorded only when
|
|
34
|
+
preserving that exclusion is useful.
|
|
29
35
|
|
|
30
36
|
MCP validates generic invariants: selected identifiers must exist, dispositions
|
|
31
37
|
must be legal, reused or excluded evidence must be referenced, synthesis must be
|
|
32
38
|
active, and at least one non-synthesis area must be applicable. MCP does not
|
|
33
|
-
choose the coverage set.
|
|
39
|
+
choose the coverage set or prove how the owner answered. Once normalized intent
|
|
40
|
+
is written, `.ultra/.runtime/state.db` treats it as current cross-session authority. If
|
|
41
|
+
that intent changes another Ultra authority, the host applies the change,
|
|
42
|
+
reads it back, and records typed applied references when completing the
|
|
43
|
+
decision thread.
|
|
34
44
|
|
|
35
45
|
## Lifecycle boundaries
|
|
36
46
|
|
|
@@ -24,21 +24,22 @@ contract and adds stronger authority, recovery, or portability.
|
|
|
24
24
|
| Original capability | Current implementation | Compatibility result |
|
|
25
25
|
|---|---|---|
|
|
26
26
|
| Init gathers project facts, creates Ultra files, and establishes Git | `task.init_project` performs deterministic classification, scaffold, schema, Git bootstrap, read-back verification, and then stops | Preserved and strengthened. Init has its own completion boundary and never starts research implicitly. |
|
|
27
|
-
| Complete product and architecture research | `ultra-research` retains the semantic reference catalog while the model
|
|
27
|
+
| Complete product and architecture research | `ultra-research` retains the semantic reference catalog while the model recommends evidence-relevant coverage and the owner selects, modifies, delegates, or defers the route | Preserved without questionnaire overload. Accepted dispositions, necessary reports, typed semantic records, source digests, and optional material decision checkpoints add durable evidence. |
|
|
28
28
|
| Planning converts accepted research into executable work with dependencies | `ultra-plan` persists complete change-owned task contracts and an exact dependency graph | Preserved and strengthened with topology, acceptance coverage, public seams, verification commands, and plan digests. |
|
|
29
29
|
| Development uses isolated Git work, TDD, verification, review, commit, and integration | `ultra-dev`, `session.*`, and the session runner create real worktrees and retain task/review/commit evidence | Preserved and strengthened. Process exit cannot complete a task; uncommitted or unintegrated worktrees cannot be deleted. |
|
|
30
30
|
| Test checks wiring, acceptance, regression, build, performance, security, and failures | `ultra-test` emits a change-bound immutable report covering each applicable dimension | Preserved and strengthened with HEAD, context, task-set, and report-digest validation. |
|
|
31
31
|
| Review challenges specification fidelity and engineering quality | `ultra-review` is a first-class stage with independent specification and engineering axes | Strengthened. A coordinated summary cannot replace either complete axis. |
|
|
32
32
|
| Delivery verifies clean readiness, documentation, build, and evidence | `ultra-deliver` requires current tasks, test, review, learning resolution, reconciliation, a local archive, and an immutable report | Preserved and strengthened. Publish, deploy, push, and other external effects remain separate explicitly authorized operations. |
|
|
33
33
|
| Status restores the current workflow position | `ultra-status` reads DB authority, Git, sessions, artifacts, decisions, allowed transitions, and any hard recovery requirement | Strengthened. The host recommends the semantic route; projections and Prompt prose cannot override state. |
|
|
34
|
-
| Thinking synchronizes owner and Agent intent | `ultra-think` plus `decision.*` persists one-question dialogue and artifact checkpoints | Strengthened. Observable facts are resolved first; only load-bearing owner choices block. |
|
|
34
|
+
| Thinking synchronizes owner and Agent intent | `ultra-think` plus `decision.*` persists one-question dialogue, non-ceremonial completion, and optional artifact checkpoints | Strengthened. Observable facts are resolved first; only load-bearing owner choices block. |
|
|
35
35
|
|
|
36
36
|
## CLI-original capabilities
|
|
37
37
|
|
|
38
38
|
The following are deliberate extensions built on the original spine:
|
|
39
39
|
|
|
40
|
-
1. `.ultra/state.db` as the only lifecycle
|
|
41
|
-
or
|
|
40
|
+
1. `.ultra/.runtime/state.db` as the only lifecycle and index authority; registered
|
|
41
|
+
digest-bound Markdown and JSON carry semantic or evidence bodies, while generated
|
|
42
|
+
views remain projections.
|
|
42
43
|
2. Typed MCP transitions for baseline, change, decision, workflow, task, session,
|
|
43
44
|
incident, projection, and evidence state.
|
|
44
45
|
3. Greenfield, brownfield, monorepo-scope, migrated, restore, and rebaseline paths.
|
|
@@ -57,7 +58,8 @@ The following are deliberate extensions built on the original spine:
|
|
|
57
58
|
|
|
58
59
|
These items are not compatibility losses:
|
|
59
60
|
|
|
60
|
-
- embedded prompt, transcript, observation, summary, or
|
|
61
|
+
- embedded prompt, transcript, observation journal, session summary, or general
|
|
62
|
+
conversational cross-session memory;
|
|
61
63
|
- an internal code graph or memory store;
|
|
62
64
|
- retired model runtimes and their prompts;
|
|
63
65
|
- retired command-proxy integrations;
|
|
@@ -73,8 +75,9 @@ metadata references.
|
|
|
73
75
|
## Reference capability paths and gates
|
|
74
76
|
|
|
75
77
|
These paths show common capability order and hard prerequisites. They are not a
|
|
76
|
-
single mandatory pipeline: the
|
|
77
|
-
while
|
|
78
|
+
single mandatory pipeline: the model recommends among MCP-reported allowed
|
|
79
|
+
transitions, while the owner selects or delegates the semantic route. MCP requires one
|
|
80
|
+
route only for a unique mechanical recovery invariant.
|
|
78
81
|
|
|
79
82
|
### New repository
|
|
80
83
|
|
|
@@ -83,7 +86,7 @@ task.init_project
|
|
|
83
86
|
-> greenfield classification
|
|
84
87
|
-> Git bootstrap when absent
|
|
85
88
|
-> init read-back and completion
|
|
86
|
-
-> explicit full research with model-selected
|
|
89
|
+
-> explicit full research with a model-recommended, owner-selected route
|
|
87
90
|
-> selected execute/verify/reuse work and synthesis
|
|
88
91
|
-> owner-authorized local checkpoint commit when Git is unborn
|
|
89
92
|
-> baseline.record
|
|
@@ -99,7 +102,7 @@ task.init_project
|
|
|
99
102
|
-> brownfield classification and selected scope
|
|
100
103
|
-> preserve current Git HEAD and dirty-state evidence
|
|
101
104
|
-> init read-back and completion
|
|
102
|
-
-> explicit adoption research with model-selected
|
|
105
|
+
-> explicit adoption research with a model-recommended, owner-selected route
|
|
103
106
|
-> characterization verification + known-red/gap ledger
|
|
104
107
|
-> baseline.record + owner approval
|
|
105
108
|
-> baseline.converge
|
|
@@ -122,7 +125,8 @@ doctor/migrate with backup
|
|
|
122
125
|
status
|
|
123
126
|
-> change intent capture
|
|
124
127
|
-> material alignment only when unresolved
|
|
125
|
-
->
|
|
128
|
+
-> model-recommended, owner-selected or delegated bounded research, plan,
|
|
129
|
+
current dev work, think, or status
|
|
126
130
|
-> session.spawn creates the real task worktree
|
|
127
131
|
-> red/green/verify/review
|
|
128
132
|
-> local task commit and verified integration
|
|
@@ -144,7 +148,7 @@ status
|
|
|
144
148
|
| Dependency waves advanced after transport exit | The plan pauses at the first non-terminal wave and resumes only after its DB tasks converge. |
|
|
145
149
|
| A crafted or merely exported plan could bypass current plan authority | Change-owned dispatch requires a healthy completed plan workflow and the exact current DB graph; malformed, cyclic, stale, duplicate-task, or cross-change plans fail before session creation. |
|
|
146
150
|
| Direct session or daemon spawn bypassed the current plan | Every change-owned admission and spawn revalidates current task-contract digests, task set, dependencies, and staleness before takeover or worktree creation. |
|
|
147
|
-
| A worker launched inside a worktree could create a second `.ultra/state.db` | Every session checkout links its ignored `.ultra` entry to central authority and receives non-overridable DB/root bindings; legacy repositories get a local `info/exclude` rule without tracked drift, while unsafe ignore or link state rolls back before worker launch. |
|
|
151
|
+
| A worker launched inside a worktree could create a second `.ultra/.runtime/state.db` | Every session checkout links its ignored `.ultra` entry to central authority and receives non-overridable DB/root bindings; legacy repositories get a local `info/exclude` rule without tracked drift, while unsafe ignore or link state rolls back before worker launch. |
|
|
148
152
|
| Plan authority could drift between wave admission and actual spawn | The spawn-time gate converts this race into an authority pause without task-failure or circuit-breaker evidence. |
|
|
149
153
|
| Explicit auto-merge could integrate before workflow gates | A change-owned auto-merge requires the exact completion commit, ready dev evidence, a current task review, and clean committed Git work; otherwise the worktree is preserved. |
|
|
150
154
|
| Session close or auto-merge could delete uncommitted work | Close preserves by default; explicit cleanup verifies clean and integrated Git ancestry. |
|
|
@@ -12,7 +12,8 @@ An adapter may write only:
|
|
|
12
12
|
- the plugin's own provenance and managed-file markers.
|
|
13
13
|
|
|
14
14
|
The first command allowed to create project authority is `ultra-init`. Once invoked,
|
|
15
|
-
Ultra owns only the repository-local `.ultra/`
|
|
15
|
+
Ultra owns only the repository-local `.ultra/` workflow-memory envelope and its
|
|
16
|
+
generated projections.
|
|
16
17
|
|
|
17
18
|
## Surfaces Ultra does not own
|
|
18
19
|
|
|
@@ -21,7 +22,7 @@ Install, update, doctor, and uninstall must not create, rewrite, trim, merge, or
|
|
|
21
22
|
- user-level `CLAUDE.md`, `AGENTS.md`, or equivalent instruction files;
|
|
22
23
|
- repository-level instruction files;
|
|
23
24
|
- project source, Git history, remotes, or `.ultra/` data;
|
|
24
|
-
- memory or code-graph provider data.
|
|
25
|
+
- general memory or code-graph provider data.
|
|
25
26
|
|
|
26
27
|
Existing Ultra marker blocks in a user handbook are legacy user content after this
|
|
27
28
|
contract takes effect. They are not silently removed because the plugin cannot prove
|
|
@@ -44,7 +45,7 @@ Internal review-rule skills remain available only to their bounded workers.
|
|
|
44
45
|
|
|
45
46
|
## Idle behavior
|
|
46
47
|
|
|
47
|
-
Outside a repository containing `.ultra/state.db`, all Ultra hooks are silent. Inside
|
|
48
|
+
Outside a repository containing `.ultra/.runtime/state.db`, all Ultra hooks are silent. Inside
|
|
48
49
|
an initialized repository they remain silent unless a DB-authoritative workflow is
|
|
49
50
|
active, blocked, or ready. The sole idle-time enforcement is protection against direct
|
|
50
51
|
writes to generated Ultra projections; the DB remains authoritative.
|
package/docs/ROADMAP.md
CHANGED
|
@@ -40,7 +40,7 @@ sharing one authoritative workflow store.
|
|
|
40
40
|
| 5 | Recovery + staleness + auto-routing | ✅ done (D43) → v0.2 |
|
|
41
41
|
| 6 | Monitoring + telemetry | ✅ done (D44) → v0.2 |
|
|
42
42
|
| 4.6b | Full conformance suite | ✅ done (D45) — 20 conformance + 21 resolveTarget tests |
|
|
43
|
-
| 7 | tagged tasks
|
|
43
|
+
| 7 | tagged tasks; non-core generation and retention surfaces removed from the plugin | ✅ superseded by the package-boundary cleanup |
|
|
44
44
|
| 8A | Plan automation (parse / topo / expand + artifact + human gate) | ✅ done (D47, `a932cb8`) → v0.3 |
|
|
45
45
|
| 8B | Execution automation (dispatch / parallel worktree / merge) | ✅ done (D48, `8224159`) — **v0.3 ready** |
|
|
46
46
|
| 8C | Continuous change packets + context compiler + convergence + doctor | ✅ done (D52) |
|
|
@@ -49,25 +49,27 @@ sharing one authoritative workflow store.
|
|
|
49
49
|
| 12 | Repository evidence snapshots + gap ledger + migration re-adoption + incident governance | ✅ done |
|
|
50
50
|
| 13 | Durable init-to-delivery workflows + task execution contracts + immutable stage evidence | ✅ done |
|
|
51
51
|
| 16 | Resumable one-question owner-agent decisions + artifact checkpoints + workflow gates | ✅ done |
|
|
52
|
+
| 19 | Non-ceremonial decision completion + four-host semantic-selection contract | ✅ done |
|
|
53
|
+
| 20 | Typed artifact registry + normalized dependency graph + orphan diagnostics | ✅ done |
|
|
52
54
|
| 9 | Release pipeline | npm tag publishing live; Homebrew / pip not implemented |
|
|
53
55
|
|
|
54
56
|
## What is in the repo today
|
|
55
57
|
|
|
56
58
|
```
|
|
57
59
|
spec/ ← Phase 1 single source of truth
|
|
58
|
-
├── mcp-tools.yaml (
|
|
60
|
+
├── mcp-tools.yaml (57 live tools across 9 families)
|
|
59
61
|
├── cli-protocol.md (CLI ↔ MCP mapping table)
|
|
60
62
|
├── schemas/ (state-db.sql + 4 JSON schemas)
|
|
61
63
|
├── fixtures/{valid,invalid}/ (+ v4.4-project for migration)
|
|
62
64
|
└── scripts/test-all.cjs (npm run test:spec — 7 validation stages)
|
|
63
65
|
|
|
64
66
|
mcp-server/ ← Phase 2 authoritative state layer
|
|
65
|
-
├── server.cjs (stdio MCP server,
|
|
67
|
+
├── server.cjs (stdio MCP server, 57 task/session/baseline/change/decision/workflow/artifact/system/plan tools)
|
|
66
68
|
├── lib/
|
|
67
69
|
│ ├── state-db.cjs (SQLite + WAL + pragmas)
|
|
68
70
|
│ ├── state-ops.cjs (full write API, status state machine)
|
|
69
71
|
│ ├── baseline-workflow.cjs (project adoption + approval + reconciliation)
|
|
70
|
-
│ ├── decision-dialogue.cjs (one-question authority + checkpoint gates)
|
|
72
|
+
│ ├── decision-dialogue.cjs (one-question authority + completion/checkpoint gates)
|
|
71
73
|
│ ├── workflow-state.cjs (ordered stage runs, evidence, output digests, and gates)
|
|
72
74
|
│ └── projector.cjs (state.db → tasks.json + context md)
|
|
73
75
|
└── tests/ (npm run test:state)
|
|
@@ -80,9 +82,22 @@ ultra-tools/ ← CLI fallback, migration, and diagnostics
|
|
|
80
82
|
└── legacy-memory.cjs (explicit inspect/archive/confirmed prune)
|
|
81
83
|
|
|
82
84
|
bin/install.js ← multi-runtime installer
|
|
83
|
-
adapters/ ← native
|
|
85
|
+
adapters/ ← native host plugin builders
|
|
86
|
+
├── claude.js
|
|
87
|
+
├── opencode.js
|
|
88
|
+
├── codex.js
|
|
89
|
+
└── kimi.js
|
|
84
90
|
skills/ ← allowlisted Ultra workflows, internal rules, and collab companions
|
|
85
|
-
hooks/ ←
|
|
91
|
+
hooks/ ← allowlisted workflow hooks; OpenCode uses native JavaScript hooks
|
|
92
|
+
├── active_task_context.py
|
|
93
|
+
├── context_spine.py
|
|
94
|
+
├── health_check.py
|
|
95
|
+
├── pre_stop_check.py
|
|
96
|
+
├── runtime_paths.py
|
|
97
|
+
├── subagent_tracker.py
|
|
98
|
+
├── workflow_checkpoint.py
|
|
99
|
+
├── workflow_context.py
|
|
100
|
+
└── workflow_resume.py
|
|
86
101
|
docs/
|
|
87
102
|
├── DECISIONS.md current authority and package boundaries
|
|
88
103
|
├── ARCHITECTURE.md Phase 1 single-page entry point
|
|
@@ -14,29 +14,29 @@ not installed.
|
|
|
14
14
|
| Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
|
|
15
15
|
|---|---|---|---|---|
|
|
16
16
|
| Package form | `.claude-plugin` native plugin | native config bundle + JS plugin | personal `.codex-plugin` | managed `kimi.plugin.json` plugin |
|
|
17
|
-
| Public entry | `/ultra
|
|
18
|
-
| Public Ultra
|
|
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
19
|
| Internal agent-rule skills | 4, non-user-facing | 4, non-user-facing | 4 with implicit invocation disabled | 4, consumed by review workers |
|
|
20
20
|
| Collaboration companions | `codex-collab`, `ultra-verify` | `cc-collab`, `codex-collab`, `ultra-verify` | `cc-collab`, `ultra-verify` | `cc-collab`, `codex-collab`, `ultra-verify` |
|
|
21
21
|
| Automatic workflow bootstrap | N/A | N/A | N/A | N/A |
|
|
22
22
|
| External browser/deploy/framework skills | N/A | N/A | N/A | N/A |
|
|
23
23
|
|
|
24
|
-
Codex converts workflows into namespaced skills and records
|
|
24
|
+
Codex converts workflows into namespaced skills and records ten compatibility
|
|
25
25
|
command mappings in `command-map.json`; `ultra-review` remains directly
|
|
26
|
-
invocable as a skill. Kimi registers all
|
|
26
|
+
invocable as a skill. Kimi registers all eleven commands through its native
|
|
27
27
|
plugin command directory and exposes the allowlisted skills independently.
|
|
28
28
|
|
|
29
29
|
## 2. Agents and collaboration
|
|
30
30
|
|
|
31
31
|
| Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
|
|
32
32
|
|---|---|---|---|---|
|
|
33
|
-
| Bundled review/debug workers | FULL, native Markdown agents | FULL, native agent frontmatter | FULL,
|
|
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
34
|
| Plugin custom-agent registration | FULL | FULL | FULL | N/A; the 0.26 manifest has no custom-agent field |
|
|
35
35
|
| Native bounded delegation | native agent surface | native agent surface | native Codex subagents | native `Agent` / `AgentSwarm` |
|
|
36
36
|
| Cross-host advisor | explicit and read-only | explicit and read-only | explicit and read-only | explicit and read-only |
|
|
37
37
|
| Primary-agent ownership | FULL | FULL | FULL | FULL |
|
|
38
38
|
|
|
39
|
-
No bundled worker owns private
|
|
39
|
+
No bundled worker owns private conversational memory. It receives current-checkout
|
|
40
40
|
evidence and bounded context from the primary host, then returns a result for
|
|
41
41
|
primary verification. On Kimi, the review workflow reads the bundled worker
|
|
42
42
|
template before creating the corresponding `AgentSwarm` item; the templates are
|
|
@@ -54,7 +54,7 @@ not presented as nonexistent custom agents.
|
|
|
54
54
|
| Subagent lifecycle evidence | FULL | DEGRADED, no equivalent packaged event | FULL | FULL, native `SubagentStart` / `SubagentStop` |
|
|
55
55
|
|
|
56
56
|
Health/context, compact, stop, and subagent hooks remain silent unless
|
|
57
|
-
`.ultra/state.db` proves an active, blocked, or ready workflow. Projection
|
|
57
|
+
`.ultra/.runtime/state.db` proves an active, blocked, or ready workflow. Projection
|
|
58
58
|
protection applies to every initialized project because generated projections
|
|
59
59
|
must never become a second authority. No host receives prompt capture, transcript capture,
|
|
60
60
|
observation journaling, session-summary memory, generic command blocking, or
|
|
@@ -67,24 +67,41 @@ they do not deny edits or stop active incident work.
|
|
|
67
67
|
| Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
|
|
68
68
|
|---|---|---|---|---|
|
|
69
69
|
| stdio MCP registration | plugin `.mcp.json` | `opencode.json` local MCP entry | plugin `.mcp.json` | plugin `mcpServers` entry |
|
|
70
|
-
| Live/declared contracts |
|
|
70
|
+
| Live/declared contracts | 57 | 57 | 57 | 57 |
|
|
71
|
+
| 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 |
|
|
71
72
|
| Greenfield/brownfield baseline adoption | FULL | FULL | FULL | FULL |
|
|
72
73
|
| Context Manifest v3 / breadcrumb | FULL | FULL, same bundled read-only DB reader as every hook | FULL | FULL |
|
|
73
74
|
| Approval-gated spec learning | FULL | FULL | FULL | FULL |
|
|
74
75
|
| Host-native review/discovery/ask | native | native | documented in `codex-capability-map.json` | native Kimi tools and workers |
|
|
75
|
-
|
|
|
76
|
-
|
|
|
76
|
+
| Workflow-memory envelope | project `.ultra/` | project `.ultra/` | project `.ultra/` | project `.ultra/` |
|
|
77
|
+
| Lifecycle/index authority | project `.ultra/.runtime/state.db` | project `.ultra/.runtime/state.db` | project `.ultra/.runtime/state.db` | project `.ultra/.runtime/state.db` |
|
|
78
|
+
| General memory-provider API | N/A | N/A | N/A | N/A |
|
|
77
79
|
|
|
78
|
-
All
|
|
80
|
+
All 57 `task.*`, `session.*`, `baseline.*`, `change.*`, `decision.*`,
|
|
81
|
+
`workflow.*`, `artifact.*`, `system.*`, and `plan.*` operations
|
|
79
82
|
registered by `mcp-server/server.cjs` are live. Review, impact discovery, skill
|
|
80
83
|
loading, and user interaction remain host-native surfaces.
|
|
81
84
|
|
|
85
|
+
When a native structured question surface is unavailable, the shared interaction
|
|
86
|
+
contract permits one concise direct question only if ordinary conversation is still
|
|
87
|
+
available. A host mode that forbids interaction leaves the choice unanswered; Ultra
|
|
88
|
+
does not infer consent or silently delegate the semantic route.
|
|
89
|
+
|
|
82
90
|
Kimi starts plugin MCP processes with the managed plugin root as `cwd`. The
|
|
83
91
|
generated launcher recovers the project from the inherited `PWD`, sets
|
|
84
92
|
`UBP_ROOT_DIR` and `UBP_DB_PATH`, and refuses to start if that project boundary
|
|
85
93
|
cannot be established. On POSIX it intentionally uses `env node` because Kimi
|
|
86
94
|
0.26/0.27's embedded Node ABI differs from the ABI used to install `better-sqlite3`.
|
|
87
95
|
|
|
96
|
+
Archive finalization and archive-journal recovery use an adjacent, explicitly
|
|
97
|
+
packaged Python 3 worker. The worker accepts only bounded, basename-only
|
|
98
|
+
operations and performs mutations relative to inherited, identity-checked
|
|
99
|
+
directory descriptors. This boundary requires a POSIX Python runtime with
|
|
100
|
+
`dir_fd`, no-follow `stat`, and `O_NOFOLLOW` support. If that prerequisite is
|
|
101
|
+
missing, archive operations fail closed with `ARCHIVE_RUNTIME_UNAVAILABLE`;
|
|
102
|
+
Ultra never falls back to ancestor-sensitive pathname mutation. Other MCP
|
|
103
|
+
operations remain available.
|
|
104
|
+
|
|
88
105
|
## 5. User instruction isolation
|
|
89
106
|
|
|
90
107
|
| Capability | Claude Code | OpenCode | Codex | Kimi Code 0.26+ |
|
|
@@ -129,9 +146,9 @@ records. Uninstall refuses an unmanaged or conflicting root.
|
|
|
129
146
|
|
|
130
147
|
| Capability | Contract |
|
|
131
148
|
|---|---|
|
|
132
|
-
| Current state schema | `
|
|
149
|
+
| Current state schema | `20.0` |
|
|
133
150
|
| Runtime values | `claude`, `opencode`, `codex`, `kimi` |
|
|
134
|
-
| 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,
|
|
151
|
+
| 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 |
|
|
135
152
|
| Preservation gate | rows, IDs, indexes, foreign keys, telemetry, incidents, and migration history remain intact |
|
|
136
153
|
| Failure behavior | rollback; no partially upgraded authority database |
|
|
137
154
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
# `.ultra/state.db` access policy
|
|
1
|
+
# `.ultra/.runtime/state.db` access policy
|
|
2
2
|
|
|
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/state.db` is the only
|
|
7
|
-
|
|
8
|
-
projections, telemetry, and spec
|
|
9
|
-
(D18, D52, D54).
|
|
6
|
+
`.ultra/.runtime/state.db` is the only lifecycle, index, transition, freshness, and
|
|
7
|
+
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
|
|
10
|
+
bodies; the DB owns their references and current digests. Every process
|
|
10
11
|
that touches it must follow the rules below; deviations are bugs.
|
|
11
12
|
|
|
12
13
|
## 1. Three-role write matrix
|
|
@@ -64,7 +65,7 @@ WAL is part of the authority contract, not an optional performance setting.
|
|
|
64
65
|
`openStateDb` asks SQLite to enable WAL and checks the actual returned mode. If
|
|
65
66
|
the storage layer returns anything else, startup fails with
|
|
66
67
|
`STATE_DB_WAL_UNAVAILABLE`. Ultra does not silently downgrade to a different
|
|
67
|
-
concurrency model. Move `.ultra/state.db` to storage that supports SQLite WAL or
|
|
68
|
+
concurrency model. Move `.ultra/.runtime/state.db` to storage that supports SQLite WAL or
|
|
68
69
|
resolve the mount/runtime constraint before retrying.
|
|
69
70
|
|
|
70
71
|
## 4. Where each table is owned
|
|
@@ -74,9 +75,10 @@ resolve the mount/runtime constraint before retrying.
|
|
|
74
75
|
| `baselines` | MCP server (`baseline.start` / `baseline.record` / `baseline.converge`); initialization and legacy-projection migration may create only the first draft or compatibility row |
|
|
75
76
|
| `tasks` | MCP server (`task.create` / `task.update` / `task.delete`) |
|
|
76
77
|
| `changes` | MCP server (`change.create` / `change.update` / `change.converge` / `change.archive`) |
|
|
77
|
-
| `decision_threads`, `decision_items` | MCP server (`decision.thread_start` / `decision.open` / `decision.resolve` / `decision.delegate` / `decision.defer` / `decision.supersede` / `decision.checkpoint`);
|
|
78
|
+
| `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 |
|
|
78
79
|
| `workflow_runs`, `workflow_steps` | MCP server (`workflow.start` / `workflow.step` / `workflow.complete`); skills provide evidence inputs but never write rows directly |
|
|
79
|
-
| `artifacts`, `
|
|
80
|
+
| `artifacts`, `artifact_edges` | MCP server (`artifact.record`); workflow-owned registration may use the same internal registry transaction |
|
|
81
|
+
| `context_snapshots`, `spec_learning_candidates`, `trace_links` | MCP server through change lifecycle tools |
|
|
80
82
|
| `incidents`, `projection_jobs`, `event_consumers`, `circuit_breaker` | MCP server; backup-first doctor recovery may perform only documented mechanical transitions |
|
|
81
83
|
| `events` | MCP server for lifecycle events; approved processes and `task.append_event` for allowlisted append-only observations |
|
|
82
84
|
| `sessions` | MCP server (`session.spawn` / `session.close` / `session.heartbeat`); orchestrator may write status transitions |
|
|
@@ -87,7 +89,7 @@ resolve the mount/runtime constraint before retrying.
|
|
|
87
89
|
|
|
88
90
|
## 5. Forbidden patterns
|
|
89
91
|
|
|
90
|
-
- **No file copies for state.** Don't `cp .ultra/state.db
|
|
92
|
+
- **No file copies for state.** Don't `cp .ultra/.runtime/state.db
|
|
91
93
|
somewhere/state.db` and edit; use `ultra-tools db backup`.
|
|
92
94
|
- **No long-held writer connections** outside the MCP server. Pop a
|
|
93
95
|
short transaction, finish, close.
|