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.
- package/.ultra-template/docs/research/README.md +4 -4
- package/CHANGELOG.md +45 -0
- package/README.md +21 -18
- package/adapters/_shared/codex-assets.cjs +121 -65
- package/adapters/_shared/interaction-contract.cjs +7 -1
- package/adapters/_shared/provenance.cjs +7 -2
- package/adapters/_shared/runtime-assets.cjs +3 -2
- package/adapters/_shared/runtime-native.cjs +132 -0
- package/adapters/claude.js +60 -30
- package/adapters/codex.js +178 -81
- package/adapters/grok.js +372 -0
- package/adapters/kimi.js +7 -3
- package/adapters/opencode.js +210 -32
- package/agents/code-reviewer.md +4 -2
- package/agents/debugger.md +4 -1
- package/agents/review-code.md +7 -3
- package/agents/review-comments.md +7 -4
- package/agents/review-coordinator.md +11 -7
- package/agents/review-design.md +8 -4
- package/agents/review-errors.md +8 -4
- package/agents/review-spec.md +8 -5
- package/agents/review-tests.md +7 -4
- package/agents/tdd-runner.md +5 -2
- package/bin/install.js +9 -4
- package/bin/orchestrator.js +4 -13
- package/docs/AGENT-CONTEXT.md +141 -229
- package/docs/ARCHITECTURE.md +203 -494
- package/docs/ARTIFACT-AUTHORITY.md +26 -22
- package/docs/PLUGIN-ISOLATION-CONTRACT.md +12 -9
- package/docs/ROADMAP.md +85 -110
- package/docs/RUNTIME-COMPAT-MATRIX.md +139 -175
- package/docs/SKILL-AUTHORING.md +3 -3
- package/docs/STATE-DB-ACCESS-POLICY.md +13 -8
- package/docs/WORKFLOW-LIFECYCLE.md +174 -448
- package/hooks/README.md +11 -8
- package/hooks/active_task_context.py +16 -16
- package/hooks/adapters/grok.py +134 -0
- package/hooks/{context_spine.py → context_envelope.py} +26 -22
- package/hooks/health_check.py +19 -29
- package/hooks/pre_stop_check.py +22 -12
- package/hooks/subagent_tracker.py +1 -1
- package/hooks/workflow_checkpoint.py +14 -13
- package/hooks/workflow_context.py +11 -12
- package/hooks/workflow_resume.py +14 -13
- package/mcp-server/{breadcrumb.cjs → hook-context.cjs} +7 -9
- package/mcp-server/lib/baseline-workflow.cjs +36 -38
- package/mcp-server/lib/canonical-json.cjs +19 -0
- package/mcp-server/lib/change-workflow.cjs +596 -44
- package/mcp-server/lib/context-envelope.cjs +508 -0
- package/mcp-server/lib/decision-records.cjs +337 -0
- package/mcp-server/lib/doctor.cjs +91 -33
- package/mcp-server/lib/init-project.cjs +78 -39
- package/mcp-server/lib/managed-file-write.cjs +116 -0
- package/mcp-server/lib/plan-checkpoint.cjs +177 -0
- package/mcp-server/lib/project-context.cjs +178 -0
- package/mcp-server/lib/stage-checkpoints.cjs +309 -0
- package/mcp-server/lib/state-db.cjs +155 -24
- package/mcp-server/lib/task-ledger.cjs +522 -13
- package/mcp-server/lib/ultra-facade.cjs +630 -442
- package/mcp-server/lib/worker-packet.cjs +358 -0
- package/mcp-server/server.cjs +200 -1103
- package/orchestrator/daemon.cjs +27 -9
- package/orchestrator/parallel-orchestrator.cjs +111 -76
- package/orchestrator/session-runner.cjs +135 -34
- package/package.json +10 -3
- package/skills/ultra-change/SKILL.md +9 -8
- package/skills/ultra-deliver/SKILL.md +3 -3
- package/skills/ultra-dev/SKILL.md +18 -11
- package/skills/ultra-doctor/SKILL.md +2 -2
- package/skills/ultra-init/SKILL.md +6 -5
- package/skills/ultra-init/references/brownfield-adoption.md +11 -8
- package/skills/ultra-plan/SKILL.md +10 -8
- package/skills/ultra-research/SKILL.md +12 -7
- package/skills/ultra-review/SKILL.md +9 -6
- package/skills/ultra-review/references/unified-schema.md +2 -0
- package/skills/ultra-review/scripts/review_wait.py +8 -0
- package/skills/ultra-status/SKILL.md +2 -2
- package/skills/ultra-test/SKILL.md +4 -2
- package/skills/ultra-think/SKILL.md +7 -7
- package/skills/ultra-think/references/interaction-boundary.md +56 -0
- package/spec/cli-protocol.md +80 -199
- package/spec/mcp-tools.yaml +37 -2804
- package/spec/schemas/state-db.sql +107 -4
- package/spec/schemas/{task-ledger.v1.schema.json → task-ledger.v2.schema.json} +70 -6
- package/ultra-tools/commands/status.cjs +369 -243
- package/mcp-server/lib/context-spine.cjs +0 -1208
- package/mcp-server/lib/decision-dialogue.cjs +0 -1128
- package/mcp-server/lib/project-breadcrumb.cjs +0 -173
- package/mcp-server/lib/spec-learning.cjs +0 -284
- package/mcp-server/lib/workflow-state.cjs +0 -3129
- package/skills/ultra-think/references/decision-dialogue.md +0 -155
|
@@ -1,489 +1,215 @@
|
|
|
1
1
|
# Ultra Builder Pro workflow lifecycle
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Ultra is an adaptive capability graph, not an automatically chained pipeline. The
|
|
4
|
+
current Skill inspects authority and recommends a next capability. The user explicitly
|
|
5
|
+
starts that capability. Skills own semantic procedure; the seven-tool MCP kernel owns
|
|
6
|
+
persistence and mechanical safety across Claude Code, Codex, OpenCode, Kimi Code, and
|
|
7
|
+
Grok Build.
|
|
8
|
+
|
|
9
|
+
## Capability graph
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart TD
|
|
13
|
+
START["Project"] --> INIT["ultra-init"]
|
|
14
|
+
INIT --> RESEARCH["ultra-research"]
|
|
15
|
+
RESEARCH --> THINK["ultra-think when a material decision remains"]
|
|
16
|
+
THINK --> RESEARCH
|
|
17
|
+
RESEARCH --> CHANGE["ultra-change"]
|
|
18
|
+
CHANGE --> ROUTE{"Evidence sufficient?"}
|
|
19
|
+
ROUTE -->|"No"| CR["bounded ultra-research"]
|
|
20
|
+
CR --> PLAN["ultra-plan"]
|
|
21
|
+
ROUTE -->|"Yes"| PLAN
|
|
22
|
+
PLAN --> DEV["ultra-dev for one owned Task"]
|
|
23
|
+
DEV --> MORE{"More executable Tasks?"}
|
|
24
|
+
MORE -->|"Yes"| DEV
|
|
25
|
+
MORE -->|"No"| TEST["ultra-test"]
|
|
26
|
+
TEST -->|"implementation gap"| DEV
|
|
27
|
+
TEST -->|"evidence accepted"| REVIEW["ultra-review"]
|
|
28
|
+
REVIEW -->|"implementation issue"| DEV
|
|
29
|
+
REVIEW -->|"contract issue"| PLAN
|
|
30
|
+
REVIEW -->|"accepted"| DELIVER["ultra-deliver"]
|
|
31
|
+
DELIVER --> CHANGE
|
|
32
|
+
STATUS["ultra-status"] -.-> INIT
|
|
33
|
+
STATUS -.-> CHANGE
|
|
34
|
+
DOCTOR["ultra-doctor"] -.-> INIT
|
|
35
|
+
DOCTOR -.-> CHANGE
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The graph is guidance, not database authorization. A quick, well-understood Change may
|
|
39
|
+
skip extra research, but it still needs an explicit Plan, Task contract, Context,
|
|
40
|
+
verification, review, and delivery evidence. `ultra-status` is read-only.
|
|
41
|
+
`ultra-doctor` repairs mechanical authority only.
|
|
42
|
+
|
|
43
|
+
## Shared command contract
|
|
44
|
+
|
|
45
|
+
Every public Skill follows the same boundary:
|
|
7
46
|
|
|
8
|
-
|
|
47
|
+
1. read the current `ultra.context`;
|
|
48
|
+
2. inspect checkout/runtime facts directly;
|
|
49
|
+
3. identify the smallest unresolved semantic choice;
|
|
50
|
+
4. recommend a route and ask only when user intent is not already explicit;
|
|
51
|
+
5. persist normalized facts through typed `ultra.record`;
|
|
52
|
+
6. update the owning semantic/evidence files;
|
|
53
|
+
7. save or accept the stage through `ultra.checkpoint`;
|
|
54
|
+
8. read back current authority;
|
|
55
|
+
9. report diagnostics and recommend, but do not launch, the next Skill.
|
|
9
56
|
|
|
10
|
-
|
|
57
|
+
No command records ceremonial steps merely to satisfy SQLite.
|
|
58
|
+
|
|
59
|
+
## Capability ownership
|
|
60
|
+
|
|
61
|
+
| Skill | Semantic owner | Durable output |
|
|
11
62
|
|---|---|---|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
durable authority. The host acquires observable facts autonomously, exposes one current
|
|
33
|
-
question, and stops. Unanswered material choices remain warnings or checkpoint
|
|
34
|
-
diagnostics until a capability truly needs their result. A normalized answer alone
|
|
35
|
-
does not require a ceremonial checkpoint.
|
|
36
|
-
|
|
37
|
-
Every host discovers seven public MCP tools: `ultra.context`, `ultra.record`,
|
|
38
|
-
`ultra.checkpoint`, `ultra.sync`, `ultra.session`, `ultra.archive`, and
|
|
39
|
-
`ultra.doctor`. The 0.22 fine-grained operations documented below remain hidden
|
|
40
|
-
compatibility internals for one release. Skills must not drive them one call at a time.
|
|
41
|
-
|
|
42
|
-
Every change-bound research, plan, dev, test, review, and deliver run inherits
|
|
43
|
-
the baseline id from the owning change workflow. A Prompt cannot switch that
|
|
44
|
-
authority, and no new stage may start on an archived or cancelled change. Doctor
|
|
45
|
-
recovers a legacy change without this link into an explicitly blocked workflow;
|
|
46
|
-
it does not fabricate the missing provenance.
|
|
47
|
-
|
|
48
|
-
Ultra does not select product scope or material delivery posture; those remain user
|
|
49
|
-
decisions. Research references form an optional catalog, not a forced questionnaire.
|
|
50
|
-
The host model inspects evidence and recommends only relevant areas. The owner selects,
|
|
51
|
-
modifies, delegates, or defers that route through the native question surface unless
|
|
52
|
-
current intent already resolves it. The host records the normalized accepted coverage
|
|
53
|
-
and rationale. MCP validates identifiers, dispositions, evidence requirements,
|
|
54
|
-
synthesis, and at least one applicable semantic area; it does not prove the preceding
|
|
55
|
-
interaction. Omitted areas create no workflow step. An explicit `not_applicable` or
|
|
56
|
-
accepted `deferred` row is retained only when its exclusion is material.
|
|
57
|
-
|
|
58
|
-
## 2. How `ultra-init` classifies a repository
|
|
59
|
-
|
|
60
|
-
`task.init_project` scans a bounded repository view while ignoring `.git`,
|
|
61
|
-
`.ultra`, dependencies, virtual environments, generated build output, and other
|
|
62
|
-
known non-source directories.
|
|
63
|
-
|
|
64
|
-
`auto` classification is deterministic:
|
|
65
|
-
|
|
66
|
-
- `brownfield` when delivered-system evidence exists: application source, tests,
|
|
67
|
-
deployment configuration, or persisted-state/schema evidence;
|
|
68
|
-
- `greenfield` when none of those signals exists. A Git repository, README,
|
|
69
|
-
package manifest, workspace manifest, or starter documentation alone does not
|
|
70
|
-
prove delivered behavior;
|
|
71
|
-
- `migrated` is never inferred from source. It is a compatibility state created
|
|
72
|
-
when older Ultra authority is preserved and upgraded. It requires a new
|
|
73
|
-
evidence-backed brownfield adoption before normal work.
|
|
74
|
-
|
|
75
|
-
The scan also records bounded signal paths, detected verification commands,
|
|
76
|
-
evidence-backed project type and technology signals, monorepo markers, candidate
|
|
77
|
-
workspace roots, and whether the scan limit was reached. Explicit owner-supplied
|
|
78
|
-
project type or stack metadata overrides detection without deleting the observed
|
|
79
|
-
signals. In a monorepo, the owner selects the repository scope; baseline
|
|
80
|
-
worktree digests and accepted dirty files are restricted to that scope.
|
|
81
|
-
|
|
82
|
-
Classification and readiness are separate. Initialization immediately creates
|
|
83
|
-
or resumes `.ultra/.runtime/state.db`, creates or imports the Git team checkpoint,
|
|
84
|
-
installs only the required scaffold, records the classification, and completes an
|
|
85
|
-
`init` workflow after read-back verification. A ready checkpoint baseline is held for
|
|
86
|
-
checkout-local revalidation. Init
|
|
87
|
-
does not create a research run. A later explicit `ultra-research` invocation selects
|
|
88
|
-
`full` for greenfield or `adoption` for brownfield, records coverage dispositions, and
|
|
89
|
-
works toward baseline readiness. Empty templates are not an approved baseline.
|
|
90
|
-
|
|
91
|
-
With `git_mode: auto`, initialization preserves an existing repository and HEAD.
|
|
92
|
-
When Git is absent it initializes `main` and adds the symlink-safe `.ultra` rule to
|
|
93
|
-
`.gitignore`; an existing repository keeps its tracked ignore file unchanged. Init
|
|
94
|
-
does not create a commit, remote, tag, or push. The resulting `unborn` worktree state
|
|
95
|
-
is durable authority, not equivalent to a non-Git workspace. Full/adoption research
|
|
96
|
-
must obtain explicit approval for one local checkpoint commit before
|
|
97
|
-
`baseline.record`; until then `BASELINE_GIT_HEAD_REQUIRED` blocks convergence.
|
|
98
|
-
|
|
99
|
-
Init completion means only that local authority, Git state, scaffold, and
|
|
100
|
-
classification are usable. Baseline readiness is a separate research and convergence
|
|
101
|
-
outcome; failure there never reopens or blocks the completed init workflow.
|
|
102
|
-
|
|
103
|
-
## 3. Durable status machines
|
|
104
|
-
|
|
105
|
-
### Baseline
|
|
63
|
+
| `ultra-init` | repository classification, scope, Git/runtime bootstrap | initialized local authority and empty/imported team checkpoint |
|
|
64
|
+
| `ultra-research` | adaptive evidence coverage and accepted baseline | baseline specs, research evidence, Decision Records, baseline checkpoint |
|
|
65
|
+
| `ultra-think` | one load-bearing owner decision or bounded diagnosis | normalized Decision Record and applied references |
|
|
66
|
+
| `ultra-change` | feature/fix/refactor/incident contract | active Change intent, classification, delta and decision scope |
|
|
67
|
+
| `ultra-plan` | Task contracts, topology, ownership, acceptance coverage | accepted Plan checkpoint, deterministic plan files, team checkpoint |
|
|
68
|
+
| `ultra-dev` | one owned vertical Task implementation | Worker Packet output, task outcome, implementation evidence checkpoint |
|
|
69
|
+
| `ultra-test` | risk-selected executable validation | test report and accepted test checkpoint |
|
|
70
|
+
| `ultra-review` | independent spec fidelity and engineering quality | specialist artifacts, coordinated summary, accepted review checkpoint |
|
|
71
|
+
| `ultra-deliver` | documentation/spec reconciliation and local archive | delivery evidence, converged baseline, immutable archive, team checkpoint |
|
|
72
|
+
| `ultra-status` | current Context rendering | no state mutation |
|
|
73
|
+
| `ultra-doctor` | mechanical health, migration, backup and repair | diagnostic/repair report; no product decision |
|
|
74
|
+
|
|
75
|
+
## Context and decisions
|
|
76
|
+
|
|
77
|
+
One canonical Context Envelope flows through Skill, Hook, Session, Agent, and compact
|
|
78
|
+
recovery. Accepted Decision Records are always visible, including when no workflow is
|
|
79
|
+
active. A new session therefore resumes from accepted intent rather than reconstructing
|
|
80
|
+
it from conversation.
|
|
81
|
+
|
|
82
|
+
Decision history is append-only through supersession:
|
|
106
83
|
|
|
107
84
|
```text
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
-> blocked -> adopting
|
|
85
|
+
proposed -> accepted -> superseded
|
|
86
|
+
-> rejected
|
|
111
87
|
```
|
|
112
88
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- `blocked`: current baseline evidence, verification, scope, or approval cannot
|
|
116
|
-
converge.
|
|
117
|
-
- `ready`: research, evidence, repository snapshot, gaps, and approval converged.
|
|
118
|
-
- `superseded`: preserved historical baseline after an explicitly authorized
|
|
119
|
-
replacement.
|
|
89
|
+
The status of a proposal never grants execution authority. The accepted record, its
|
|
90
|
+
digest, applied references, and the owning checkpoint do.
|
|
120
91
|
|
|
121
|
-
|
|
122
|
-
revalidates its persisted fields, current files, research outputs, revision and
|
|
123
|
-
worktree, known-red acceptance, blocking gaps, and approval provenance. An ordinary
|
|
124
|
-
active change may downgrade only the expected drift created after its completed
|
|
125
|
-
`bind-baseline` step to warnings; it cannot downgrade adoption, migration, missing
|
|
126
|
-
evidence, or structural blockers. Approved incident break-glass is the only other
|
|
127
|
-
execution exception and creates a mandatory reconciliation gap.
|
|
92
|
+
## Checkpoints, not fixed steps
|
|
128
93
|
|
|
129
|
-
|
|
94
|
+
Stage authority is revisioned:
|
|
130
95
|
|
|
131
96
|
```text
|
|
132
|
-
|
|
133
|
-
|
|
97
|
+
draft revision N
|
|
98
|
+
-> accepted revision N
|
|
99
|
+
-> accepted revision N+1 supersedes N
|
|
134
100
|
```
|
|
135
101
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
102
|
+
A failed acceptance returns diagnostics and keeps the same draft mutable. Plan export
|
|
103
|
+
is part of Plan checkpoint publication, so changing a Task contract before acceptance
|
|
104
|
+
cannot invalidate an already-recorded “export step.” There is no locked intermediate
|
|
105
|
+
run to cancel or manually repair.
|
|
106
|
+
|
|
107
|
+
Accepted checkpoints are immutable evidence. New facts create a replacement draft.
|
|
108
|
+
Only archive history is terminal; subsequent product work opens a new Change.
|
|
109
|
+
|
|
110
|
+
## Change lifecycle
|
|
139
111
|
|
|
140
|
-
|
|
112
|
+
Live v0.24 writes only:
|
|
141
113
|
|
|
142
114
|
```text
|
|
143
|
-
|
|
144
|
-
| |
|
|
145
|
-
v v
|
|
146
|
-
blocked <------+
|
|
115
|
+
active -> archived
|
|
147
116
|
|
|
|
148
|
-
->
|
|
149
|
-
|
|
150
|
-
pending -> expanded -> completed
|
|
117
|
+
-> cancelled
|
|
151
118
|
```
|
|
152
119
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
A session process and a task have different status machines. Process exit zero closes
|
|
166
|
-
the execution transport but leaves the task `in_progress` until development,
|
|
167
|
-
integration, test, and review gates converge. Process failure marks the task `blocked`
|
|
168
|
-
and records failure/circuit evidence. `session.close` preserves the worktree by
|
|
169
|
-
default. Explicit removal succeeds only after Git proves it is clean and its commit is
|
|
170
|
-
integrated into the current checkout.
|
|
171
|
-
|
|
172
|
-
Dependency-wave automation advances only when every task in the current wave is
|
|
173
|
-
`completed` or `expanded` in the DB. A successful worker exit with open gates emits
|
|
174
|
-
`wave_paused` and `plan_paused`; it cannot start dependent work. Re-running the plan
|
|
175
|
-
resumes the first unfinished wave. Explicit auto-merge is additionally gated by task
|
|
176
|
-
completion, an exact completion commit, a ready dev workflow, a current task review,
|
|
177
|
-
clean committed work, and successful integration; otherwise the worktree remains
|
|
178
|
-
recoverable. Legacy tasks without change ownership retain their compatibility path,
|
|
179
|
-
but cannot satisfy the current change workflow contract.
|
|
180
|
-
|
|
181
|
-
Every session worktree resolves its ignored `.ultra` entry to the project authority
|
|
182
|
-
directory. Automated workers receive the central DB path and the isolated checkout
|
|
183
|
-
root separately; their supplied environment cannot override those bindings. If a
|
|
184
|
-
legacy `.ultra/` rule does not ignore the link itself, Ultra adds a repository-local
|
|
185
|
-
`info/exclude` entry without changing tracked files. A missing, tracked, still
|
|
186
|
-
unignored, or conflicting authority entry fails before the session row or worker is
|
|
187
|
-
created and the provisional worktree is removed. A process that already has
|
|
188
|
-
`UBP_SESSION_ID` must reuse that lease and worktree; nested spawn and worker-side close
|
|
189
|
-
are rejected, so the supervising parent alone settles the lease from the real process
|
|
190
|
-
exit. Authority drift detected after wave selection pauses the plan without recording
|
|
191
|
-
execution failure.
|
|
192
|
-
|
|
193
|
-
### Workflow run and step
|
|
120
|
+
`blocked`, `ready`, and `needs_attention` are derived diagnostics, not absorbing Change
|
|
121
|
+
states. An active Change may be revised. Archive requires complete current Task,
|
|
122
|
+
Context, test, review, documentation, and delivery checkpoints, then performs a
|
|
123
|
+
recoverable filesystem/DB transaction. Archived bytes remain immutable.
|
|
124
|
+
|
|
125
|
+
Older `ready` or `blocked` rows are readable migration history. They do not authorize
|
|
126
|
+
new work until migration/revalidation derives current checkpoint authority.
|
|
127
|
+
|
|
128
|
+
## Task and Session lifecycle
|
|
129
|
+
|
|
130
|
+
Task durable outcomes remain portable:
|
|
194
131
|
|
|
195
132
|
```text
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
step: pending -> in_progress -> completed
|
|
202
|
-
| |
|
|
203
|
-
v v
|
|
204
|
-
blocked ------> in_progress/completed
|
|
133
|
+
pending -> completed
|
|
134
|
+
|
|
|
135
|
+
-> blocked
|
|
136
|
+
-> cancelled
|
|
205
137
|
```
|
|
206
138
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
artifact changes reopen `ready` to `active`; only an accepted `completed` revision is
|
|
210
|
-
immutable.
|
|
139
|
+
`in_progress`, Worker ownership, leases, PIDs, heartbeats, worktrees, and completion
|
|
140
|
+
commit backfill are checkout-local. They are not published to Git.
|
|
211
141
|
|
|
212
|
-
|
|
142
|
+
`ultra.session acquire` atomically:
|
|
213
143
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|--------------+--------------+ revision/supersession
|
|
144
|
+
1. checks a real lease/CAS conflict;
|
|
145
|
+
2. compiles or reuses the exact Context Envelope;
|
|
146
|
+
3. creates an immutable Worker Packet;
|
|
147
|
+
4. allocates the lease/worktree;
|
|
148
|
+
5. returns packet path/digest and exact execution boundary.
|
|
220
149
|
|
|
221
|
-
|
|
222
|
-
|
|
150
|
+
A missing semantic detail is diagnostic, not a transport failure. A genuine lease,
|
|
151
|
+
digest, unsafe path, or concurrent authority conflict fails closed. Optional
|
|
152
|
+
orchestration can dispatch only a Change-owned Task with an accepted Plan checkpoint
|
|
153
|
+
and assigned Worker Packet.
|
|
223
154
|
|
|
224
|
-
|
|
225
|
-
allows only one `open` item per thread. Resolved items remain immutable history;
|
|
226
|
-
changed evidence or intent uses `decision.supersede` and reopens alignment.
|
|
227
|
-
`decision.complete` closes settled normalized state without adding an approval claim.
|
|
228
|
-
When an artifact-bound recovery boundary is actually needed, `decision.checkpoint`
|
|
229
|
-
instead freezes a normalized decision digest and binds explicit owner approval to
|
|
230
|
-
current artifact digests or a justified standalone no-artifact case. Neither path
|
|
231
|
-
stores the conversation transcript.
|
|
232
|
-
|
|
233
|
-
## 4. Write and verification lifecycle
|
|
234
|
-
|
|
235
|
-
| Stage | Authoritative writes | Completion verification | Available continuation |
|
|
236
|
-
|---|---|---|---|
|
|
237
|
-
| `init` | Baseline classification/scope, Git bootstrap state, completed init run, initialization event, empty or imported team checkpoint, projection job | DB/schema opens, scaffold/local projection/checkpoint and read-back succeed; existing Git is preserved or missing local Git is initialized; imported ready baseline is not trusted before local revalidation | Explicitly chosen `research`, `status`, or `doctor`; an already-ready project may also enter `change` |
|
|
238
|
-
| `research` | Accepted coverage dispositions, selected step evidence, normalized material decisions, optional artifact checkpoints, typed semantic records with source digests, immutable reports, output paths and SHA-256 digests | Every included coverage area is dispositioned; only executed/verified/reused areas require work evidence; baseline synthesis binds current specifications and distillate, while Change synthesis stays in its overlay; all material decisions and digests are current | Baseline record/convergence for initial research; bounded Change research records its delta and returns to plan |
|
|
239
|
-
| baseline convergence | Spec/source/runtime refs, verification results, known failures, unknowns, gaps, branch/HEAD/worktree, approval, and a published team checkpoint | Full/adoption research complete; required discovery/product/architecture refs current; revision/worktree exact; blocking gaps resolved or explicitly accepted where allowed | `change` for every initial or daily outcome |
|
|
240
|
-
| `change` | Complete Change Contract, profile/risk rationale, research disposition, isolated Change root, typed delta, completed capture run, and portable Change checkpoint; a decision thread only when material intent remains unresolved | Intent, acceptance, recovery, classification, research disposition, exact baseline anchors, and checkpoint digest are current | Model recommends; owner selects bounded `research` or direct `plan`; both routes converge on plan before development |
|
|
241
|
-
| `plan` | Accepted planning posture, immutable `plan/planning` context, selected planning evidence, complete change-owned task rows, acceptance coverage matrix, deterministic `<artifact_root>/plan.json` plus `plan.md`, and published task contracts; approval only for a material owner decision | Every Change acceptance id is owned by a task; trace targets, ownership, dependencies, topology, task contracts, planning-context binding, exported digests, and checkpoint generation match current authority | Any dependency-ready task may enter `dev` |
|
|
242
|
-
| `dev` | Task/session transitions, real worktree, step evidence, immutable implementation context, completion/review references, and published durable task transitions | Task completed; no live session; task contract unchanged; starting context and review artifacts valid; the single completion commit is integrated and remains an ancestor of current HEAD; its hash is backfilled locally without another commit | Next task, then aggregate `test` |
|
|
243
|
-
| `test` | Immutable checking context, an explicit risk-selected verification profile, and `<artifact_root>/test/<workflow-id>/report.json` | Selected dimensions and exact Change acceptance ids pass; every excluded dimension has a rationale; report change/task set, HEAD, worktree, context, commands, blockers, and digests agree | `review` when passing, otherwise resume `dev`/`test` |
|
|
244
|
-
| `review` | Immutable review context plus risk-selected specialist and summary artifacts below `<artifact_root>/review/<workflow-id>/` | Current diff/HEAD and context match; the complete worker roster is selected or skipped with rationale; completed workers match specialist artifacts; both axes complete; findings and axis verdicts derive the final verdict | `deliver` only from a passing `change` review, otherwise resume implementation or checking |
|
|
245
|
-
| `deliver` | Convergence context, typed delta, documentation reconciliation, recoverable overlay transaction, self-contained archive, and immutable delivery report | Tasks/test/change-review and acceptance are current; every before/after digest and baseline anchor is current; the archive transaction is complete; the report contains no release action | Report local completion or start the next `change`; publish/deploy/push are separate explicitly authorized operations |
|
|
246
|
-
| `status` | None | Reads doctor, team-checkpoint condition, baseline, workflows, breadcrumb, tasks, sessions, Git, and DB-referenced reports | Shows allowed transitions, any hard required transition, and a host-owned recommendation |
|
|
247
|
-
| `doctor` | None by default; explicit repair writes only mechanical recovery state | Re-runs integrity, schema, workflow-output, local projection, team-checkpoint, session, incident, archive, and install checks without choosing import/publish conflict resolution | Mechanically required recovery when unique; otherwise a set of safe recovery capabilities |
|
|
248
|
-
|
|
249
|
-
Every mutating MCP operation appends an event and enqueues local projection work when
|
|
250
|
-
the corresponding checkout-local read-only view can change. Projection failure is recorded as
|
|
251
|
-
a retryable incident; it does not silently convert a failed write into success.
|
|
252
|
-
Semantic handoff operations separately publish the Git team checkpoint.
|
|
253
|
-
`task.append_event` accepts only non-authoritative observations. Lifecycle events are
|
|
254
|
-
emitted by their owning DB mutation and never act as a substitute state transition.
|
|
255
|
-
|
|
256
|
-
### Team handoff checkpoint
|
|
257
|
-
|
|
258
|
-
The Git checkpoint is intentionally lower-frequency than SQLite. It publishes accepted
|
|
259
|
-
baseline, Change, plan, task-contract, and durable task-status boundaries; it does not
|
|
260
|
-
mirror heartbeats, leases, active processes, telemetry, or provisional completion
|
|
261
|
-
hashes. On MCP startup or explicit post-pull import, the receiving checkout validates
|
|
262
|
-
checkpoint ancestry and record digests. Clean baseline, Change, and task records
|
|
263
|
-
fast-forward independently. Concurrent edits to the same record or a remote edit to a
|
|
264
|
-
locally active task stop without partial import.
|
|
265
|
-
|
|
266
|
-
A checkpoint can restore portable project intent after clone, but cannot establish
|
|
267
|
-
checkout truth by itself. An imported ready baseline becomes a local adoption/draft
|
|
268
|
-
with `team-ledger-revalidation-required`; current scope content, HEAD, verification,
|
|
269
|
-
known failures, and approval must converge again. Because baseline content hashing
|
|
270
|
-
excludes `.ultra/`, committing the checkpoint cannot make its own baseline stale.
|
|
271
|
-
|
|
272
|
-
## 5. Human-agent alignment lifecycle
|
|
273
|
-
|
|
274
|
-
The host first reads `decision.list` and resumes matching authority. It starts a new
|
|
275
|
-
thread only for a new material decision cluster. Before asking, it must:
|
|
276
|
-
|
|
277
|
-
1. inspect repository, runtime, tests, specifications, and primary-source evidence;
|
|
278
|
-
2. resolve evidence-answerable facts without asking the owner;
|
|
279
|
-
3. normalize an unambiguous decision already present in the current user request
|
|
280
|
-
instead of asking for redundant confirmation;
|
|
281
|
-
4. ask only when the remaining choice changes intent, public behavior, compatibility,
|
|
282
|
-
security, material cost, external effects, or recovery. Use the host-native
|
|
283
|
-
question surface declared by `spec/interaction-contract.json`;
|
|
284
|
-
5. present the earliest dependent choice with a recommendation, credible alternatives,
|
|
285
|
-
evidence refs, and durable effects. Up to three independent low-load facts may be
|
|
286
|
-
grouped when that reduces inconsistency;
|
|
287
|
-
6. normalize the owner response with `decision.resolve`, explicit reversible
|
|
288
|
-
delegation with `decision.delegate`, or a consequence-bearing deferral with
|
|
289
|
-
`decision.defer`;
|
|
290
|
-
7. apply accepted intent through the owning MCP operation or digest-bound artifact;
|
|
291
|
-
8. read the resulting authority back and record typed `applied_refs` when another
|
|
292
|
-
authority changed;
|
|
293
|
-
9. call `decision.complete` when normalized state is settled, or prepare a compact
|
|
294
|
-
checkpoint only when a material decision cluster changes a durable contract and
|
|
295
|
-
interruption recovery needs an artifact-bound boundary.
|
|
296
|
-
|
|
297
|
-
The shared semantic flow is `inspect -> suggest -> host-native ask -> normalize ->
|
|
298
|
-
persist -> apply -> read back`. The ask is skipped only when current explicit intent
|
|
299
|
-
already resolves the material choice. Claude Code and Kimi Code use `AskUserQuestion`, Codex uses
|
|
300
|
-
`request_user_input` when its current mode exposes it, and OpenCode uses `question`
|
|
301
|
-
when permitted. Every host falls back to one concise direct question when normal
|
|
302
|
-
conversation is still allowed. If the current host mode forbids interaction entirely,
|
|
303
|
-
the choice remains unanswered and route-dependent writes stop. A dismissed question
|
|
304
|
-
also remains unanswered. The DB trusts a normalized persisted result as current
|
|
305
|
-
authority across sessions; it does not store or verify a UI receipt, raw prompt, or
|
|
306
|
-
transcript. Breadcrumb and decision reads recall completed normalized intent, so a new
|
|
307
|
-
host session can continue without replaying the dialogue.
|
|
308
|
-
|
|
309
|
-
`ultra-think` owns this interaction protocol. `ultra-research`, `ultra-change`, and
|
|
310
|
-
`ultra-plan` invoke it at their decision boundaries. `ultra-dev`, `ultra-test`,
|
|
311
|
-
`ultra-review`, and `ultra-deliver` stop and route back to the same thread when new
|
|
312
|
-
owner authority is required; they never answer on the owner's behalf. `ultra-status`
|
|
313
|
-
shows current unresolved decisions, relevant accepted intent, and the transition set,
|
|
314
|
-
while `ultra-doctor` diagnoses stale checkpoint artifacts and recovery state.
|
|
315
|
-
|
|
316
|
-
When only a bound artifact changes, the same resolved thread is prepared and approved
|
|
317
|
-
again against the current digest; this is checkpoint renewal, not a fabricated decision
|
|
318
|
-
revision. When the owner choice itself changes, supersession preserves the old item and
|
|
319
|
-
opens one replacement.
|
|
320
|
-
|
|
321
|
-
## 6. Context and prompt follow-through
|
|
322
|
-
|
|
323
|
-
The Context compiler used internally by `ultra.checkpoint` creates an immutable
|
|
324
|
-
Context Manifest v3 snapshot. It combines:
|
|
325
|
-
|
|
326
|
-
- the bound baseline/change/task identity;
|
|
327
|
-
- a role and lifecycle gate;
|
|
328
|
-
- DB-backed task outcome, public seam, verification command, and required refs;
|
|
329
|
-
- the selected task's bounded dependency/integration neighborhood rather than every
|
|
330
|
-
unrelated task;
|
|
331
|
-
- the task-context contract: purpose, why, constraints, non-goals, target seams/files,
|
|
332
|
-
pattern refs, acceptance, documentation impact, recovery, and drift definition;
|
|
333
|
-
- local file hashes, current HEAD, branch, and worktree digest;
|
|
334
|
-
- optional metadata-only external memory or graph references;
|
|
335
|
-
- advisory file/token/context-share budgets, including inline Change/task authority;
|
|
336
|
-
- the current Change and task authority digests;
|
|
337
|
-
- readiness warnings and hard mechanical blockers without a semantic route command.
|
|
338
|
-
|
|
339
|
-
Compilation is pure with respect to accepted Change authority. Provider references are
|
|
340
|
-
recorded through `ultra.record`; they cannot be smuggled into a checkpoint context.
|
|
341
|
-
Context references retain `expected_digest`, `anchor`, `scope`, and
|
|
342
|
-
`freshness_policy`. `digest` requires byte-current content, `existence` allows an
|
|
343
|
-
implementation target to change while remaining present, and `advisory` reports drift
|
|
344
|
-
without blocking.
|
|
345
|
-
|
|
346
|
-
Critical stage workflows bind a matching snapshot as a durable output:
|
|
347
|
-
|
|
348
|
-
| Workflow | Required role | Required gate |
|
|
349
|
-
|---|---|---|
|
|
350
|
-
| `plan` | `plan` | `planning` |
|
|
351
|
-
| `dev` | `implement` | `implementation` |
|
|
352
|
-
| `test` | `check` | `verification` |
|
|
353
|
-
| `review` | `review` | `review` |
|
|
354
|
-
| `deliver` | `check` | `convergence` |
|
|
355
|
-
|
|
356
|
-
Every lookup is exact on `change_id + task_id + role + gate`. The snapshot path and
|
|
357
|
-
digest are carried into plan, test, review, and delivery artifacts. The Plan
|
|
358
|
-
`ultra.checkpoint` writes the owning Change's `plan.json` and deterministic `plan.md`
|
|
359
|
-
once, and binds the exact planning snapshot and digest to the artifact registry.
|
|
360
|
-
The legacy global `.ultra/execution-plan.json` is read-only migration compatibility,
|
|
361
|
-
not current authority. These rules prevent a later Prompt or a different role packet
|
|
362
|
-
from claiming evidence gathered under another context. Referenced file content remains
|
|
363
|
-
lazy; only metadata and bounded task authority are inline. File and token budgets warn;
|
|
364
|
-
they do not block legitimate work. Missing authority, required refs, stale
|
|
365
|
-
digest-bound refs, task contracts, outputs, required owner decisions, or current gate
|
|
366
|
-
evidence do block.
|
|
367
|
-
|
|
368
|
-
## 7. Invalidation rules
|
|
369
|
-
|
|
370
|
-
- Changing a task contract invalidates contexts and gates that depended on the
|
|
371
|
-
former contract.
|
|
372
|
-
- Changing accepted Change intent, contract, classification, research disposition,
|
|
373
|
-
provider evidence, or documentation impact invalidates only transitive registered
|
|
374
|
-
consumers. Planning or task reconciliation must explicitly refresh affected
|
|
375
|
-
authority before execution.
|
|
376
|
-
- Changing required source/spec content invalidates the recorded output or
|
|
377
|
-
context digest.
|
|
378
|
-
- Changing a research semantic source invalidates that workflow even when its immutable
|
|
379
|
-
step report remains unchanged.
|
|
380
|
-
- Changing full HEAD or the worktree invalidates aggregate test, review, and
|
|
381
|
-
delivery evidence.
|
|
382
|
-
- A completed dev run remains valid across later task commits when its bound
|
|
383
|
-
task contract is unchanged and its recorded commits remain ancestors of the
|
|
384
|
-
current HEAD.
|
|
385
|
-
- Test, review, and delivery reports use workflow-id paths so a later run cannot
|
|
386
|
-
overwrite historical evidence.
|
|
387
|
-
- `.ultra` workflow artifacts are excluded from application-worktree drift, but
|
|
388
|
-
their own recorded SHA-256 digests are still authoritative.
|
|
389
|
-
- Generated `.ultra/.runtime/projections/tasks.json` and complete runtime task-context
|
|
390
|
-
files are local projections. Manual edits are overwritten and never repair DB
|
|
391
|
-
authority.
|
|
392
|
-
- `.ultra/tasks/tasks.json` is a tracked MCP checkpoint, not a local projection.
|
|
393
|
-
Its full and per-record digests reject manual edits; publish/import performs typed
|
|
394
|
-
fast-forward or conflict handling.
|
|
395
|
-
- A changed checkpoint artifact digest or superseded decision invalidates the linked
|
|
396
|
-
decision checkpoint and blocks matching workflow advancement until reconfirmed.
|
|
397
|
-
- A rejected draft is repaired in place or explicitly abandoned. A new accepted
|
|
398
|
-
revision preserves prior accepted history and invalidates only true transitive
|
|
399
|
-
registered consumers.
|
|
400
|
-
|
|
401
|
-
## 8. Entry flows
|
|
402
|
-
|
|
403
|
-
### New project
|
|
155
|
+
## Team sync
|
|
404
156
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
-> selected evidence work
|
|
409
|
-
-> local checkpoint when Git is unborn -> baseline approval
|
|
410
|
-
-> ultra-change -> optional bounded research -> typed delta -> plan -> dev -> risk-selected test/review
|
|
411
|
-
-> local deliver/archive
|
|
412
|
-
```
|
|
157
|
+
`.ultra/tasks/tasks.json` is a tracked, digest-chained team checkpoint. It carries
|
|
158
|
+
portable baseline, Change, Decision summary/reference, accepted Stage Checkpoint, Task
|
|
159
|
+
contract, dependency, and durable outcome records. It excludes local execution state.
|
|
413
160
|
|
|
414
|
-
|
|
161
|
+
`ultra.sync` supports:
|
|
415
162
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
-> first ultra-change -> optional bounded research -> typed delta -> plan -> dev -> test/review -> deliver
|
|
421
|
-
```
|
|
163
|
+
- `inspect`: side-effect-free condition and migration advice;
|
|
164
|
+
- `migrate`: exact-byte backup-first legacy conversion;
|
|
165
|
+
- `import`: schema/digest/ancestry/CAS validation and clean fast-forward;
|
|
166
|
+
- `publish`: reconcile incoming Git authority, then publish one new generation.
|
|
422
167
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
168
|
+
Same-record concurrent edits return a typed conflict. Ultra does not silently choose
|
|
169
|
+
one intent. Imported accepted baseline authority requires checkout-local source/spec
|
|
170
|
+
revalidation before descendant publication.
|
|
426
171
|
|
|
427
|
-
|
|
172
|
+
Metadata-only Ultra commits do not make a baseline stale. Source or specification
|
|
173
|
+
drift remains visible and may require revalidation.
|
|
428
174
|
|
|
429
|
-
|
|
430
|
-
doctor/migrate with backup -> migrated compatibility authority
|
|
431
|
-
-> explicit brownfield re-adoption -> full convergence -> normal change loop
|
|
432
|
-
```
|
|
175
|
+
## Hook lifecycle
|
|
433
176
|
|
|
434
|
-
|
|
177
|
+
Hooks do not drive the capability graph. They:
|
|
435
178
|
|
|
436
|
-
|
|
179
|
+
- inject a bounded Context Envelope where the host consumes it;
|
|
180
|
+
- protect the team checkpoint and generated projections from direct writes;
|
|
181
|
+
- save/restore minimal compact recovery state;
|
|
182
|
+
- record minimal lifecycle identifiers;
|
|
183
|
+
- return advisory Stop context.
|
|
437
184
|
|
|
438
|
-
|
|
439
|
-
ultra
|
|
440
|
-
|
|
441
|
-
-> typed delta -> plan -> dev -> risk-selected test -> review
|
|
442
|
-
-> documentation reconciliation -> atomic deliver -> reconciled baseline
|
|
443
|
-
```
|
|
185
|
+
When a host ignores Hook stdout, the adapter records health/events only and every Skill
|
|
186
|
+
reads `ultra.context` explicitly. Hook limitations are never presented as successful
|
|
187
|
+
context injection.
|
|
444
188
|
|
|
445
|
-
|
|
446
|
-
they do not skip task ownership, executable acceptance, current checking, review,
|
|
447
|
-
or baseline reconciliation. Incidents add structured diagnosis and recovery
|
|
448
|
-
evidence rather than bypassing them.
|
|
189
|
+
## Recovery
|
|
449
190
|
|
|
450
|
-
|
|
191
|
+
Use `ultra.context` first; legacy input must return a discoverable migration action
|
|
192
|
+
instead of blocking diagnosis. Use `ultra.sync migrate` for semantic conversion and
|
|
193
|
+
`ultra.doctor { repair: true }` for mechanical backup/recovery.
|
|
451
194
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
Use `ultra.doctor` for project authority and
|
|
475
|
-
`ubp --all --global --doctor` for installed host assets. Both are read-only
|
|
476
|
-
unless an explicit project repair command is chosen.
|
|
477
|
-
|
|
478
|
-
During an explicit repair, a legacy active change that predates durable workflows gets
|
|
479
|
-
one blocked change run at `bind-baseline` with
|
|
480
|
-
`LEGACY_CHANGE_PROVENANCE_REQUIRED`; repair does not invent its evidence. Rebind it to
|
|
481
|
-
the re-adopted baseline and resume the same run before planning. Every plan must use
|
|
482
|
-
the exact baseline id stored by its owning change run; only an approved break-glass
|
|
483
|
-
incident may legitimately bind no baseline id.
|
|
484
|
-
|
|
485
|
-
Resume the same blocked workflow and current step after resolving its blocker.
|
|
486
|
-
Do not create parallel runs to escape state. Supported schema and projection
|
|
487
|
-
repairs are backup-first. A corrupt DB is preserved and requires an explicit
|
|
488
|
-
restore or rebaseline decision; neither action can manufacture research,
|
|
489
|
-
verification, or owner approval.
|
|
195
|
+
Migration supports v4.4/v4.5 projections and v0.22/v0.23 database/ledger authority.
|
|
196
|
+
It is exact-byte backup-first, transactional, and fail-closed on conflict. Legacy
|
|
197
|
+
workflow/dialogue rows survive as history but do not authorize current work.
|
|
198
|
+
|
|
199
|
+
Repair never invents a product choice, edits a semantic artifact to make it pass, or
|
|
200
|
+
asks the user to hand-edit SQLite.
|
|
201
|
+
|
|
202
|
+
## Hard-error boundary
|
|
203
|
+
|
|
204
|
+
Only these classes fail the tool call:
|
|
205
|
+
|
|
206
|
+
- database/schema corruption;
|
|
207
|
+
- unsafe path, symlink, or identity swap;
|
|
208
|
+
- actual digest, CAS, or lease concurrency conflict;
|
|
209
|
+
- missing/incompatible native runtime;
|
|
210
|
+
- permission failure;
|
|
211
|
+
- archive/publish/deploy or another irreversible external-effect failure.
|
|
212
|
+
|
|
213
|
+
Evidence gaps, incomplete exploration, stale optional context, missing reports, or a
|
|
214
|
+
checkpoint that is not yet ready are structured diagnostics. The model remains free to
|
|
215
|
+
investigate, revise, and retry.
|