ultra-builder-pro-cli 0.6.0 → 0.8.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/changes/active/.gitkeep +1 -0
- package/.ultra-template/changes/archive/.gitkeep +1 -0
- package/CHANGELOG.md +90 -11
- package/README.md +39 -19
- package/adapters/_shared/handbook.cjs +8 -7
- package/adapters/_shared/provenance.cjs +286 -0
- package/adapters/_shared/runtime-assets.cjs +2 -0
- package/adapters/_shared/tests/handbook.test.cjs +4 -1
- package/adapters/_shared/tests/provenance.test.cjs +133 -0
- package/adapters/_shared/tests/runtime-assets.test.cjs +2 -0
- package/adapters/claude.js +33 -0
- package/adapters/codex.js +87 -0
- package/adapters/opencode.js +147 -20
- package/adapters/tests/codex.test.cjs +42 -3
- package/adapters/tests/opencode.test.cjs +16 -9
- package/agents/debugger.md +12 -0
- package/bin/install.js +63 -27
- package/bin/orchestrator.js +1 -26
- package/commands/ultra-change.md +48 -0
- package/commands/ultra-deliver.md +14 -7
- package/commands/ultra-dev.md +6 -3
- package/commands/ultra-doctor.md +36 -0
- package/commands/ultra-init.md +4 -3
- package/commands/ultra-status.md +7 -5
- package/commands/ultra-test.md +2 -1
- package/docs/AGENT-CONTEXT.md +31 -23
- package/docs/ARCHITECTURE.md +80 -17
- package/docs/PLAN.zh-CN.md +37 -29
- package/docs/ROADMAP.md +14 -14
- package/docs/RUNTIME-COMPAT-MATRIX.md +19 -12
- package/hooks/README.md +14 -9
- package/hooks/active_task_context.py +22 -15
- package/hooks/health_check.py +136 -38
- package/hooks/workflow_checkpoint.py +15 -1
- package/hooks/workflow_context.py +120 -30
- package/hooks/workflow_resume.py +96 -7
- package/mcp-server/lib/change-workflow.cjs +625 -0
- package/mcp-server/lib/change-workflow.test.cjs +346 -0
- package/mcp-server/lib/doctor.cjs +112 -0
- package/mcp-server/lib/doctor.test.cjs +86 -0
- package/mcp-server/lib/init-project.cjs +32 -6
- package/mcp-server/lib/runtime-state.cjs +222 -0
- package/mcp-server/lib/runtime-state.test.cjs +92 -0
- package/mcp-server/lib/state-db.cjs +31 -8
- package/mcp-server/lib/state-ops.cjs +17 -3
- package/mcp-server/server.cjs +102 -10
- package/mcp-server/tests/db-ops.test.cjs +5 -1
- package/mcp-server/tests/init-project.test.cjs +45 -0
- package/mcp-server/tests/server-contract.test.cjs +123 -1
- package/mcp-server/tests/state-db.test.cjs +44 -7
- package/mcp-server/tests/state-ops.test.cjs +19 -0
- package/orchestrator/daemon.cjs +39 -0
- package/orchestrator/tests/daemon.test.cjs +50 -0
- package/package.json +3 -3
- package/settings.json +1 -2
- package/skills/ultra-change/SKILL.md +149 -0
- package/skills/ultra-deliver/SKILL.md +83 -15
- package/skills/ultra-dev/SKILL.md +32 -12
- package/skills/ultra-doctor/SKILL.md +97 -0
- package/skills/ultra-init/SKILL.md +8 -5
- package/skills/ultra-review/SKILL.md +16 -0
- package/skills/ultra-status/SKILL.md +30 -7
- package/skills/ultra-test/SKILL.md +14 -2
- package/spec/cli-protocol.md +12 -1
- package/spec/mcp-tools.yaml +337 -1
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/state-db.sql +117 -0
- package/ultra-tools/cli.cjs +3 -0
- package/ultra-tools/commands/system.cjs +57 -0
- package/ultra-tools/system-command.test.cjs +53 -0
- package/adapters/_shared/rtk-detect.cjs +0 -86
- package/adapters/_shared/tests/rtk-detect.test.cjs +0 -116
- package/docs/LEGACY-HERMES.md +0 -1099
- package/orchestrator/code-graph-watcher.cjs +0 -121
- package/orchestrator/tests/code-graph-watcher.test.cjs +0 -183
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-deliver
|
|
3
|
-
description: "
|
|
3
|
+
description: "Converge and deliver a verified baseline or continuous change: reconcile specs, build/test, archive evidence, version, tag, and push."
|
|
4
4
|
runtime: all
|
|
5
|
+
mcp_tools_required:
|
|
6
|
+
- change.list
|
|
7
|
+
- change.get
|
|
8
|
+
- change.context
|
|
9
|
+
- change.converge
|
|
10
|
+
- change.archive
|
|
5
11
|
cli_fallback: "direct user interaction"
|
|
6
12
|
---
|
|
7
13
|
|
|
8
14
|
# ultra-deliver — Phase 3.5
|
|
9
15
|
|
|
10
|
-
Release the current working tree
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
Release the current working tree and close its continuous-change packet when
|
|
17
|
+
one exists. `.ultra/test-report.json` is the test gate; `change.converge` is the
|
|
18
|
+
deterministic closure gate; `.ultra/delivery-report.json` is the release report.
|
|
19
|
+
Change lifecycle writes go through MCP only.
|
|
13
20
|
|
|
14
|
-
## Prerequisites (
|
|
21
|
+
## Prerequisites (all validations are blocking)
|
|
22
|
+
|
|
23
|
+
### Validation 0 — Resolve continuous change
|
|
24
|
+
|
|
25
|
+
Call `change.list` for `active`, `blocked`, and `ready` work.
|
|
26
|
+
|
|
27
|
+
- Exactly one relevant change → bind delivery to that id.
|
|
28
|
+
- More than one → require an explicit id; never guess which change to archive.
|
|
29
|
+
- None → allow initial-baseline delivery, but record `change_id: null`.
|
|
30
|
+
- Active/blocked change → its linked tasks must all be completed and its
|
|
31
|
+
`test-report.json.change_id` must match.
|
|
32
|
+
- Ready change → do not rerun convergence blindly; verify its existing
|
|
33
|
+
verification artifact still matches current HEAD before archive.
|
|
15
34
|
|
|
16
35
|
### Validation 1 — `/ultra-test` passed
|
|
17
36
|
|
|
@@ -59,10 +78,19 @@ Commit failure (conflicts, hook rejection) → surface error and **EXIT**.
|
|
|
59
78
|
2. If signatures changed, update README usage examples
|
|
60
79
|
3. Verify examples match the new API
|
|
61
80
|
|
|
81
|
+
**1.4 Baseline specification reconciliation** (continuous change):
|
|
82
|
+
|
|
83
|
+
1. Read `intent.md`, `delta/`, and `docs_impact` from the bound change.
|
|
84
|
+
2. Merge accepted deltas into the declared baseline documents.
|
|
85
|
+
3. Record every updated project-relative path as `baseline_updates`.
|
|
86
|
+
4. If no baseline file changes, write a specific `no_baseline_change_reason`.
|
|
87
|
+
5. Verify no `[NEEDS CLARIFICATION]` or unresolved delta remains for delivered behavior.
|
|
88
|
+
|
|
62
89
|
**Checklist**:
|
|
63
90
|
- [ ] CHANGELOG.md updated
|
|
64
91
|
- [ ] technical-debt.md refreshed
|
|
65
92
|
- [ ] README.md reflects current API (if applicable)
|
|
93
|
+
- [ ] active delta reconciled into baseline, or explicit no-change rationale exists
|
|
66
94
|
|
|
67
95
|
Any unchecked → fix, then continue.
|
|
68
96
|
|
|
@@ -80,7 +108,7 @@ Non-zero exit → block with stderr captured, then ask the user:
|
|
|
80
108
|
- A: "Fix error and retry"
|
|
81
109
|
- B: "Abort delivery"
|
|
82
110
|
|
|
83
|
-
### Step 3 — Version +
|
|
111
|
+
### Step 3 — Version + convergence + release
|
|
84
112
|
|
|
85
113
|
**3.1 Determine version bump**:
|
|
86
114
|
- `git log <last-tag>..HEAD --oneline` → analyze commit types
|
|
@@ -91,6 +119,13 @@ Non-zero exit → block with stderr captured, then ask the user:
|
|
|
91
119
|
- `package.json`, `Cargo.toml`, `pyproject.toml`, etc.
|
|
92
120
|
- Verify: read the file; confirm new version.
|
|
93
121
|
|
|
122
|
+
**3.2a Re-run release evidence after docs/version edits**:
|
|
123
|
+
|
|
124
|
+
- Run the exact relevant test, type-check, build, and package commands again.
|
|
125
|
+
- Capture command, exit code, and result. Any non-zero exit blocks delivery.
|
|
126
|
+
- Do not reuse a test report whose `change_id` or pre-change HEAD belongs to a
|
|
127
|
+
different change as final evidence.
|
|
128
|
+
|
|
94
129
|
**3.3 Release commit**:
|
|
95
130
|
```bash
|
|
96
131
|
git add -A
|
|
@@ -98,13 +133,35 @@ git commit -m "chore(release): v<X.Y.Z>"
|
|
|
98
133
|
```
|
|
99
134
|
Verify with `git log -1 --oneline`.
|
|
100
135
|
|
|
101
|
-
**3.4
|
|
136
|
+
**3.4 Recompile context and converge the change** (skip only for initial baseline):
|
|
137
|
+
|
|
138
|
+
For `active` or `blocked`, call `change.context` after the release commit so its
|
|
139
|
+
git head and task set are current. Then call `change.converge` with the exact
|
|
140
|
+
evidence required by kind:
|
|
141
|
+
|
|
142
|
+
- `quick`: diff, tests, spec;
|
|
143
|
+
- `standard` / `major`: diff, tests, spec, docs, review;
|
|
144
|
+
- `incident`: diagnosis, diff, tests. The diagnosis evidence must point to the
|
|
145
|
+
completed `diagnosis.md`; convergence separately validates all five required
|
|
146
|
+
debugging sections and cannot be satisfied by the evidence string alone.
|
|
147
|
+
|
|
148
|
+
Evidence must name concrete commands, artifacts, or file paths. If blockers are
|
|
149
|
+
returned, stop before tag/push and route to the owning workflow. Do not weaken
|
|
150
|
+
the change kind or mark failed evidence `not_applicable` merely to pass.
|
|
151
|
+
|
|
152
|
+
**3.5 Archive after baseline reconciliation**:
|
|
153
|
+
|
|
154
|
+
Call `change.archive` with the summary and either `baseline_updates` or the
|
|
155
|
+
explicit no-change reason. This moves the packet from `changes/active` to the
|
|
156
|
+
dated archive and records closure in state.db. Archive failure blocks release.
|
|
157
|
+
|
|
158
|
+
**3.6 Git tag**:
|
|
102
159
|
```bash
|
|
103
160
|
git tag v<X.Y.Z>
|
|
104
161
|
```
|
|
105
162
|
Verify with `git tag -l v<X.Y.Z>`.
|
|
106
163
|
|
|
107
|
-
**3.
|
|
164
|
+
**3.7 Push to remote**:
|
|
108
165
|
```bash
|
|
109
166
|
git push origin main # release commit
|
|
110
167
|
git push origin v<X.Y.Z> # version tag
|
|
@@ -115,6 +172,7 @@ Verify with `git ls-remote --tags origin | grep v<X.Y.Z>`.
|
|
|
115
172
|
- [ ] Version determined and displayed
|
|
116
173
|
- [ ] Version file updated and verified
|
|
117
174
|
- [ ] Release commit created and verified
|
|
175
|
+
- [ ] Change context current, convergence ready, baseline reconciled, archive complete
|
|
118
176
|
- [ ] Git tag created and verified
|
|
119
177
|
- [ ] Commit and tag pushed and verified on remote
|
|
120
178
|
|
|
@@ -128,6 +186,10 @@ Any failure → stop immediately; do NOT continue; surface last-step error.
|
|
|
128
186
|
"version": "<X.Y.Z>",
|
|
129
187
|
"git_tag": "v<X.Y.Z>",
|
|
130
188
|
"git_commit": "<HEAD SHA>",
|
|
189
|
+
"change_id": "<archived-change-id-or-null>",
|
|
190
|
+
"change_archive_path": "<path-or-null>",
|
|
191
|
+
"convergence_ready": true,
|
|
192
|
+
"baseline_updates": ["<project-relative-path>"],
|
|
131
193
|
"changelog_updated": true,
|
|
132
194
|
"technical_debt_refreshed": true,
|
|
133
195
|
"build_success": true,
|
|
@@ -137,8 +199,9 @@ Any failure → stop immediately; do NOT continue; surface last-step error.
|
|
|
137
199
|
|
|
138
200
|
### Step 5 — Report
|
|
139
201
|
|
|
140
|
-
Print a tight release summary:
|
|
141
|
-
outstanding technical-debt count,
|
|
202
|
+
Print a tight release summary: change id/archive, baseline files reconciled,
|
|
203
|
+
tag, commit, exact verification commands, outstanding technical-debt count,
|
|
204
|
+
and next suggested action. After release, daily work starts with `/ultra-change`.
|
|
142
205
|
|
|
143
206
|
## Deliverables Checklist (final)
|
|
144
207
|
|
|
@@ -146,6 +209,7 @@ outstanding technical-debt count, next suggested action (deploy / announce).
|
|
|
146
209
|
- [ ] Uncommitted changes handled
|
|
147
210
|
- [ ] CHANGELOG + technical-debt refreshed (README if API changed)
|
|
148
211
|
- [ ] Production build exit 0
|
|
212
|
+
- [ ] Continuous change converged and archived (when present)
|
|
149
213
|
- [ ] Version bumped, tagged, pushed
|
|
150
214
|
- [ ] delivery-report.json written
|
|
151
215
|
|
|
@@ -155,17 +219,21 @@ outstanding technical-debt count, next suggested action (deploy / announce).
|
|
|
155
219
|
|---------|----------|--------------|
|
|
156
220
|
| Resolve dirty-tree action | none | current Host's native user-interaction surface |
|
|
157
221
|
| Override version bump | none | current Host's native user-interaction surface |
|
|
222
|
+
| Resolve/bind change | `change.list` / `change.get` | none; fail closed |
|
|
223
|
+
| Refresh context | `change.context` | none; fail closed |
|
|
224
|
+
| Deterministic closure | `change.converge` / `change.archive` | none; fail closed |
|
|
158
225
|
|
|
159
226
|
## What this skill DOES NOT do
|
|
160
227
|
|
|
161
|
-
- Does NOT
|
|
228
|
+
- Does NOT replace `/ultra-test`; it re-runs the exact release evidence after
|
|
229
|
+
documentation and version changes so the shipped commit is verified
|
|
162
230
|
- Does NOT publish to npm / crates.io / PyPI (Phase 9 handles distribution)
|
|
163
|
-
- Does NOT mutate state.db
|
|
231
|
+
- Does NOT directly mutate state.db or external provider state
|
|
164
232
|
|
|
165
233
|
## Integration
|
|
166
234
|
|
|
167
235
|
| | |
|
|
168
236
|
|---|---|
|
|
169
|
-
| **Input** |
|
|
170
|
-
| **Output** |
|
|
171
|
-
| **Next** |
|
|
237
|
+
| **Input** | bound change (if any), test/review artifacts, current repo |
|
|
238
|
+
| **Output** | archived change, reconciled baseline, delivery report, git tag + remote push |
|
|
239
|
+
| **Next** | deploy/announce; next daily change begins with `/ultra-change` |
|
|
@@ -6,6 +6,8 @@ mcp_tools_required:
|
|
|
6
6
|
- task.update
|
|
7
7
|
- task.get
|
|
8
8
|
- task.list
|
|
9
|
+
- change.get
|
|
10
|
+
- change.context
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
# ultra-dev — Phase 3.4
|
|
@@ -13,8 +15,9 @@ mcp_tools_required:
|
|
|
13
15
|
Drive one task from `pending → completed` using a strict TDD loop, gated by
|
|
14
16
|
`/ultra-review`. **state.db is the authority**: status transitions go through
|
|
15
17
|
MCP `task.update`; the projector regenerates `tasks.json` and context-md
|
|
16
|
-
frontmatter.
|
|
17
|
-
|
|
18
|
+
frontmatter. For a task linked by `change_id`, requirement discoveries go to
|
|
19
|
+
the active change delta first; baseline reconciliation happens in
|
|
20
|
+
`/ultra-deliver`.
|
|
18
21
|
|
|
19
22
|
## Authority failure boundary
|
|
20
23
|
|
|
@@ -85,6 +88,11 @@ Pick the first result (dependency-resolved) or the one matching `$1`.
|
|
|
85
88
|
Read `.ultra/tasks/contexts/task-{id}.md` body for the Implementation /
|
|
86
89
|
Acceptance sections. Use the Acceptance list as the initial todo set.
|
|
87
90
|
|
|
91
|
+
If the task has `change_id`, call `change.get` and inspect its
|
|
92
|
+
`context-manifest.json`. The task id, git head, allowed paths, spec refs, and
|
|
93
|
+
external provider metadata must match the current slice. Call `change.context`
|
|
94
|
+
before editing whenever they are stale. Provider content remains external.
|
|
95
|
+
|
|
88
96
|
### Step 1.5 — Status → in_progress (single-write)
|
|
89
97
|
|
|
90
98
|
```jsonc
|
|
@@ -266,6 +274,10 @@ Any unchecked → fix; do NOT commit.
|
|
|
266
274
|
git push origin main && git branch -d feat/task-<id>-<slug>
|
|
267
275
|
```
|
|
268
276
|
|
|
277
|
+
8. For a task with `change_id`, call `change.context` after the final commit,
|
|
278
|
+
rebase, and verification so the manifest records the actual HEAD and task
|
|
279
|
+
set used for convergence.
|
|
280
|
+
|
|
269
281
|
Checkpoint `step="6", status="committed", commit=<sha>`.
|
|
270
282
|
|
|
271
283
|
### Step 7 — Report
|
|
@@ -274,16 +286,16 @@ Checkpoint `step="6", status="committed", commit=<sha>`.
|
|
|
274
286
|
- Project progress (`task.list` → `completed/total`)
|
|
275
287
|
- Next task suggestion (first remaining `pending` in topological order)
|
|
276
288
|
|
|
277
|
-
##
|
|
289
|
+
## Delta-First Specification Mode
|
|
278
290
|
|
|
279
|
-
Triggered when implementation reveals
|
|
291
|
+
Triggered when implementation reveals specification gaps or requirement changes.
|
|
280
292
|
|
|
281
293
|
**Classification (mandatory before updating specs)**:
|
|
282
294
|
|
|
283
295
|
| Kind | Meaning | Action |
|
|
284
296
|
|------|---------|--------|
|
|
285
|
-
| **EXPANSION** | new requirement surfaced | update
|
|
286
|
-
| **CORRECTION** | spec error/ambiguity | update
|
|
297
|
+
| **EXPANSION** | new requirement surfaced | update active change delta + Change Log |
|
|
298
|
+
| **CORRECTION** | spec error/ambiguity | update active change delta + Change Log |
|
|
287
299
|
| **REDUCTION** | removing/weakening scope | **STOP** → ask the user for approval |
|
|
288
300
|
|
|
289
301
|
**REDUCTION gate** — options:
|
|
@@ -291,16 +303,23 @@ Triggered when implementation reveals spec gaps or requirement changes.
|
|
|
291
303
|
- B: "Keep original scope, find alternative implementation"
|
|
292
304
|
- C: "Split into separate task, defer to next cycle"
|
|
293
305
|
|
|
294
|
-
|
|
295
|
-
|
|
306
|
+
For a task with `change_id`, update
|
|
307
|
+
`.ultra/changes/active/<change-id>/delta/` immediately, then recompile
|
|
308
|
+
`change.context`. Do not silently rewrite the baseline while parallel tasks are
|
|
309
|
+
still executing. `/ultra-deliver` must reconcile the approved delta into the
|
|
310
|
+
declared baseline files before archive.
|
|
311
|
+
|
|
312
|
+
For an initial-baseline task with no `change_id`, update `.ultra/specs/`
|
|
313
|
+
directly because no continuous-change packet exists yet. In both cases log the
|
|
314
|
+
decision in the context-md body Change Log:
|
|
296
315
|
|
|
297
316
|
```markdown
|
|
298
317
|
| <date> | <KIND> | <change desc> | specs/<file>#<section> | <reason> |
|
|
299
318
|
```
|
|
300
319
|
|
|
301
|
-
**Principle**:
|
|
302
|
-
|
|
303
|
-
|
|
320
|
+
**Principle**: the baseline specs describe accepted product truth; the active
|
|
321
|
+
delta describes proposed change; task contexts record implementation history.
|
|
322
|
+
No layer may silently shrink scope without the REDUCTION gate.
|
|
304
323
|
|
|
305
324
|
## MCP failure matrix
|
|
306
325
|
|
|
@@ -311,6 +330,7 @@ never silently shrink (REDUCTION without gate).
|
|
|
311
330
|
| Pre-review checkpoint | none | write `.ultra/workflow-state.json`; lifecycle hooks restore it |
|
|
312
331
|
| Run review | none | `/ultra-review all` + Host-native review agents |
|
|
313
332
|
| Status → completed | `task.update` (2) | stop; do not claim completion |
|
|
333
|
+
| Refresh linked context | `change.context` (9) | stop; do not claim the change packet is current |
|
|
314
334
|
| Ask user | none | current Host's native user-interaction surface |
|
|
315
335
|
|
|
316
336
|
## What this skill DOES NOT do
|
|
@@ -325,5 +345,5 @@ never silently shrink (REDUCTION without gate).
|
|
|
325
345
|
| | |
|
|
326
346
|
|---|---|
|
|
327
347
|
| **Input** | state.db via MCP, plus the `context_file` body returned for the selected task |
|
|
328
|
-
| **Writes** | state.db (via `task.update`),
|
|
348
|
+
| **Writes** | state.db (via `task.update`/`change.context`), active delta or baseline spec as classified, context-md body, workflow-state checkpoints |
|
|
329
349
|
| **Next** | `/ultra-dev <next-id>` or `/ultra-test` when all Walking Skeleton + critical-path tasks complete |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ultra-doctor
|
|
3
|
+
description: "Inspect Ultra state, projection, session, incident, and active-change health; optionally run explicit backup-first mechanical recovery."
|
|
4
|
+
runtime: all
|
|
5
|
+
mcp_tools_required:
|
|
6
|
+
- system.doctor
|
|
7
|
+
cli_fallback: "system doctor"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# ultra-doctor — Runtime Diagnostics and Recovery
|
|
11
|
+
|
|
12
|
+
Use this workflow when Ultra state appears empty, projections disagree with
|
|
13
|
+
`state.db`, a hook reports a missing adapter, sessions are orphaned, a change
|
|
14
|
+
artifact is missing, or MCP operations return degraded projection metadata.
|
|
15
|
+
|
|
16
|
+
## Default is read-only
|
|
17
|
+
|
|
18
|
+
Call `system.doctor` with `{ "repair": false }` unless the user explicitly
|
|
19
|
+
requests repair. Read-only diagnosis reports:
|
|
20
|
+
|
|
21
|
+
- SQLite integrity and required tables;
|
|
22
|
+
- open structured incidents;
|
|
23
|
+
- projection queue failures and event/projection cursor lag;
|
|
24
|
+
- orphan sessions;
|
|
25
|
+
- missing active-change artifact roots;
|
|
26
|
+
- the external ownership boundary for Memory and code graph.
|
|
27
|
+
|
|
28
|
+
Do not infer health from `tasks.json`. Do not mutate provider state, delete
|
|
29
|
+
artifacts, rebuild a graph, or collect memory during diagnosis.
|
|
30
|
+
|
|
31
|
+
## Interpret the report
|
|
32
|
+
|
|
33
|
+
| Check | Meaning | Next action |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `state_db` fail | schema/integrity problem | stop ordinary workflow; preserve DB evidence |
|
|
36
|
+
| `incidents` fail | a structured runtime failure remains open | report code, source, retryability, and evidence |
|
|
37
|
+
| `projections` fail | state commit is ahead of generated views or a projector failed | explicit repair is appropriate when authorized |
|
|
38
|
+
| `sessions` fail | an orphan execution lease exists | repair may mark/reconcile it; never kill unrelated processes blindly |
|
|
39
|
+
| `change_artifacts` fail | DB points to a missing active packet | recover from version control/backup or recreate deliberately |
|
|
40
|
+
| `external_providers` pass | ownership is correctly external | provider availability must be checked with its own plugin/tool |
|
|
41
|
+
|
|
42
|
+
## Explicit repair mode
|
|
43
|
+
|
|
44
|
+
Only after the user asks for repair, call `system.doctor` with
|
|
45
|
+
`{ "repair": true }`, or use the fallback:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ultra-tools system doctor --repair
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The runtime must create `.ultra/backups/state-<timestamp>.db` before any
|
|
52
|
+
mechanical repair. Repair is bounded to:
|
|
53
|
+
|
|
54
|
+
- boot recovery for orphan sessions;
|
|
55
|
+
- durable consumption of spec-staleness events;
|
|
56
|
+
- requeueing projection jobs left `running` beyond the interruption cutoff;
|
|
57
|
+
- requeueing failed projection jobs;
|
|
58
|
+
- regenerating projections from authoritative state.
|
|
59
|
+
|
|
60
|
+
If backup fails, repair must stop with `BACKUP_FAILED`. A repair result is not
|
|
61
|
+
automatically healthy; inspect the returned post-repair report and keep any
|
|
62
|
+
remaining incident unresolved.
|
|
63
|
+
|
|
64
|
+
## Hook/path failures
|
|
65
|
+
|
|
66
|
+
For an installed hook that points to a missing cached file:
|
|
67
|
+
|
|
68
|
+
1. capture the exact hook config path and missing target;
|
|
69
|
+
2. run the separate read-only installer boundary check:
|
|
70
|
+
`npx ultra-builder-pro-cli --<runtime> --local --doctor --json` (or use
|
|
71
|
+
`--global` when that is the actual install scope);
|
|
72
|
+
3. preserve its provenance, asset-hash, and host-contract findings;
|
|
73
|
+
4. reinstall or regenerate the host-native plugin through the adapter;
|
|
74
|
+
5. rerun both installer doctor and `system.doctor`, then a host hook smoke test.
|
|
75
|
+
|
|
76
|
+
`system.doctor` diagnoses project `.ultra/state.db` and workflow recovery.
|
|
77
|
+
Installer `ubp --doctor` diagnoses the installed plugin files and host wiring.
|
|
78
|
+
Neither report substitutes for the other.
|
|
79
|
+
|
|
80
|
+
Do not bypass a broken hook by changing application implementation, and do not
|
|
81
|
+
treat a hook failure as project-code evidence.
|
|
82
|
+
|
|
83
|
+
## Output
|
|
84
|
+
|
|
85
|
+
Lead with `healthy` or `degraded`, list only failing checks, and include:
|
|
86
|
+
|
|
87
|
+
- incident ids/codes and sources;
|
|
88
|
+
- event vs projected cursor;
|
|
89
|
+
- whether repair ran;
|
|
90
|
+
- backup path when repair ran;
|
|
91
|
+
- unresolved actions and their owner (`Ultra`, host plugin, or external provider).
|
|
92
|
+
|
|
93
|
+
## What this skill does not do
|
|
94
|
+
|
|
95
|
+
- It does not fix project code or semantic specification conflicts.
|
|
96
|
+
- It does not delete state, force-reset git, or close live healthy sessions.
|
|
97
|
+
- It does not install, query, refresh, or repair external Memory/graph providers.
|
|
@@ -10,7 +10,8 @@ cli_fallback: "task init-project"
|
|
|
10
10
|
# ultra-init — Phase 3.1
|
|
11
11
|
|
|
12
12
|
把当前工作目录(或 `--target-dir`)初始化为一个 Ultra Builder Pro 项目:拉起
|
|
13
|
-
`.ultra/`
|
|
13
|
+
`.ultra/` 骨架、初始化权威 `state.db`、建立持续变更目录、写入 `tasks.json`
|
|
14
|
+
初始元数据,并按需配置 git。
|
|
14
15
|
|
|
15
16
|
真实的目录搭建 + 模板拷贝 + tasks.json 注入统一由 **MCP tool `task.init_project`** 完成;
|
|
16
17
|
MCP 不可达时回退 `ultra-tools task init-project`。
|
|
@@ -18,7 +19,7 @@ MCP 不可达时回退 `ultra-tools task init-project`。
|
|
|
18
19
|
## 设计要点(对比 pre-Phase-3 行为)
|
|
19
20
|
|
|
20
21
|
- **无 Claude 独占依赖**:`task.init_project` + `ultra-tools init-project` 两条路径
|
|
21
|
-
都不调 Claude 原生工具,
|
|
22
|
+
都不调 Claude 原生工具,Claude Code、OpenCode、Codex 三个 runtime 都能走通。
|
|
22
23
|
- **模板内置**:`.ultra/` 骨架来自仓内 `templates/.ultra/`;不再依赖 `~/.claude/.ultra-template/`。
|
|
23
24
|
- **幂等**:二次 init 默认拒绝,`--overwrite` 才会备份旧 `.ultra/` 为
|
|
24
25
|
`.ultra.backup.<ts>` 后重建。
|
|
@@ -83,9 +84,11 @@ MCP 不可达时回退 `ultra-tools task init-project`。
|
|
|
83
84
|
"copied_files": [
|
|
84
85
|
"specs/discovery.md", "specs/product.md", "specs/architecture.md",
|
|
85
86
|
"tasks/tasks.json", "tasks/contexts/TEMPLATE.md",
|
|
87
|
+
"changes/active/.gitkeep", "changes/archive/.gitkeep",
|
|
86
88
|
"docs/research/README.md",
|
|
87
89
|
"test-report.json", "delivery-report.json"
|
|
88
|
-
]
|
|
90
|
+
],
|
|
91
|
+
"state_db_path": "/abs/path/to/project/.ultra/state.db"
|
|
89
92
|
}
|
|
90
93
|
```
|
|
91
94
|
|
|
@@ -121,7 +124,8 @@ CLI 最后一行是 `{ "ok": true, "data": { ... } }`(见 spec/cli-protocol.md
|
|
|
121
124
|
### Step 4: 成功总结 + 下一步
|
|
122
125
|
|
|
123
126
|
用中文输出:
|
|
124
|
-
- ✅ `.ultra/` 骨架(specs / tasks / docs / reports)
|
|
127
|
+
- ✅ `.ultra/` 骨架(specs / tasks / changes / docs / reports)
|
|
128
|
+
- ✅ `.ultra/state.db` 已初始化为当前 schema,后续不再依赖第一次写操作懒创建
|
|
125
129
|
- ✅ tasks.json 注入元数据(name / type / stack / created / updated)
|
|
126
130
|
- ✅ git 状态(按选择)
|
|
127
131
|
- ⚠️ **下一步**:跑 `/ultra-research` 做 17 步 discovery 填 spec;不要跳过直接 `/ultra-plan`
|
|
@@ -143,5 +147,4 @@ CLI 最后一行是 `{ "ok": true, "data": { ... } }`(见 spec/cli-protocol.md
|
|
|
143
147
|
## 不做的事
|
|
144
148
|
|
|
145
149
|
- **不**创建业务 task(业务 task 由 `/ultra-plan` 在 spec 填完后批量创建)
|
|
146
|
-
- **不**写入 state.db(state.db 由第一次 MCP 写操作或显式 `ultra-tools db init` 触发)
|
|
147
150
|
- **不**调 web:离线可执行
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
name: ultra-review
|
|
3
3
|
description: "Parallel code review orchestration with 6 specialized agents + coordinator. Zero context pollution - all output via JSON files."
|
|
4
4
|
user-invocable: true
|
|
5
|
+
runtime: all
|
|
6
|
+
mcp_tools_required:
|
|
7
|
+
- change.list
|
|
8
|
+
- task.list
|
|
5
9
|
---
|
|
6
10
|
|
|
7
11
|
# /ultra-review - Ultra Review System
|
|
@@ -54,6 +58,7 @@ Orchestrates parallel code review using specialized agents. All findings written
|
|
|
54
58
|
# 1. Determine session context
|
|
55
59
|
BRANCH = git branch --show-current # e.g., "feat/task-3-auth"
|
|
56
60
|
ITER = count existing sessions matching this branch + 1 # iteration number
|
|
61
|
+
CHANGE_ID = active change whose linked tasks/diff match this scope, else null
|
|
57
62
|
|
|
58
63
|
# 2. Create session directory with full context
|
|
59
64
|
SESSION_ID = "<YYYYMMDD-HHmmss>-<branch>-iter<N>"
|
|
@@ -94,6 +99,15 @@ git diff RANGE --name-only
|
|
|
94
99
|
DIFF_RANGE="RANGE"
|
|
95
100
|
```
|
|
96
101
|
|
|
102
|
+
**Continuous-change linkage**:
|
|
103
|
+
|
|
104
|
+
Call `change.list` and `task.list`, then bind the review to the single active or
|
|
105
|
+
blocked change whose linked task files intersect `DIFF_FILES`. If multiple
|
|
106
|
+
changes match, require an explicit scope instead of guessing. Write
|
|
107
|
+
`change_id` and reviewed HEAD into `SUMMARY.json` and the session index so
|
|
108
|
+
`/ultra-deliver` can use this artifact as review evidence. Initial-baseline
|
|
109
|
+
reviews may use `change_id: null`.
|
|
110
|
+
|
|
97
111
|
### Phase 2: Agent Selection
|
|
98
112
|
|
|
99
113
|
Based on the mode argument and file classification:
|
|
@@ -277,6 +291,7 @@ A lightweight index file tracks all sessions for cross-referencing:
|
|
|
277
291
|
{
|
|
278
292
|
"id": "20260214-103000-feat-task-3-auth-iter1",
|
|
279
293
|
"branch": "feat/task-3-auth",
|
|
294
|
+
"change_id": "auth-change",
|
|
280
295
|
"iteration": 1,
|
|
281
296
|
"mode": "full",
|
|
282
297
|
"timestamp": "2026-02-14T10:30:00Z",
|
|
@@ -308,6 +323,7 @@ A lightweight index file tracks all sessions for cross-referencing:
|
|
|
308
323
|
|-------|-------------|
|
|
309
324
|
| `id` | Session directory name |
|
|
310
325
|
| `branch` | Git branch at review time |
|
|
326
|
+
| `change_id` | Continuous change reviewed, or null for initial baseline |
|
|
311
327
|
| `iteration` | Nth review for this branch (auto-incremented) |
|
|
312
328
|
| `mode` | Review mode used (full/quick/security/recheck/delta) |
|
|
313
329
|
| `timestamp` | ISO 8601 |
|
|
@@ -7,6 +7,8 @@ mcp_tools_required:
|
|
|
7
7
|
- task.get
|
|
8
8
|
- session.list
|
|
9
9
|
- session.subscribe_events
|
|
10
|
+
- change.list
|
|
11
|
+
- system.doctor
|
|
10
12
|
cli_fallback: "status --cost --json"
|
|
11
13
|
---
|
|
12
14
|
|
|
@@ -15,6 +17,8 @@ cli_fallback: "status --cost --json"
|
|
|
15
17
|
Single-call dashboard. Pulls task state from state.db (authoritative), layers
|
|
16
18
|
in `.ultra/test-report.json` + `.ultra/delivery-report.json` (file artifacts),
|
|
17
19
|
reports progress + risks + workflow routing.
|
|
20
|
+
It never treats a completed initial delivery as a terminal state: a healthy
|
|
21
|
+
baseline routes the next daily request through `/ultra-change`.
|
|
18
22
|
|
|
19
23
|
## Authority failure boundary
|
|
20
24
|
|
|
@@ -47,6 +51,12 @@ user to run `ultra-tools migrate --from=4.4 --to=4.5 --source-dir <project-root>
|
|
|
47
51
|
// MCP: session.subscribe_events (recent events for the "last event" panel)
|
|
48
52
|
{ "since_id": 0, "limit": 20 }
|
|
49
53
|
// → { events: [...], next_since_id: M }
|
|
54
|
+
|
|
55
|
+
// MCP: change.list (continuous-change lane)
|
|
56
|
+
{ "limit": 20 }
|
|
57
|
+
|
|
58
|
+
// MCP: system.doctor (read-only runtime health)
|
|
59
|
+
{ "repair": false }
|
|
50
60
|
```
|
|
51
61
|
|
|
52
62
|
Also read:
|
|
@@ -60,6 +70,8 @@ Extract:
|
|
|
60
70
|
- Most recent 20 events (by `events.id` DESC) — "last event" panel
|
|
61
71
|
- Test passed / failed / stale (compare `git_commit` to HEAD)
|
|
62
72
|
- Delivery readiness (tag + pushed)
|
|
73
|
+
- Active/blocked/ready change, linked task counts, docs impact, and context freshness
|
|
74
|
+
- Runtime health: open incidents, projection lag/failure, orphan sessions, missing change artifacts
|
|
63
75
|
|
|
64
76
|
### Phase 2 — Progress report
|
|
65
77
|
|
|
@@ -68,6 +80,8 @@ Compact multi-section output:
|
|
|
68
80
|
- **Tasks**: counts per status + per priority
|
|
69
81
|
- **Test**: pass/fail, `run_count`, `blocking_issues` if any
|
|
70
82
|
- **Delivery**: `version` + `pushed` + last tag
|
|
83
|
+
- **Change**: active id/kind/status, docs impact, task completion, context/provider freshness
|
|
84
|
+
- **Runtime**: healthy/degraded with failing doctor checks only
|
|
71
85
|
- **Risks**: auto-detected list (see Phase 3)
|
|
72
86
|
- **Next**: recommended next task (see Phase 4)
|
|
73
87
|
|
|
@@ -81,6 +95,10 @@ Auto-detect:
|
|
|
81
95
|
- **Test stale**: `test-report.json.git_commit ≠ HEAD`
|
|
82
96
|
- **Orphan sessions**: any session with `lease_expires_at < now()` still status=running
|
|
83
97
|
(uninitialized by orphan-reaper; escalate)
|
|
98
|
+
- **Projection/incident failure**: read-only doctor is degraded → route to
|
|
99
|
+
`/ultra-doctor`; never infer recovery from a generated JSON file
|
|
100
|
+
- **Context stale**: active change manifest head or task set differs from current state
|
|
101
|
+
- **Docs drift**: change has `docs_impact.status=unknown` or declared required file is missing
|
|
84
102
|
|
|
85
103
|
| Icon | Meaning | Action |
|
|
86
104
|
|------|---------|--------|
|
|
@@ -105,12 +123,15 @@ Detect position from artifacts:
|
|
|
105
123
|
|-----------|-------|
|
|
106
124
|
| No `.ultra/` | `/ultra-init` |
|
|
107
125
|
| Specs have `[NEEDS CLARIFICATION]` or missing | `/ultra-research` |
|
|
108
|
-
| No tasks | `/ultra-plan` |
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
126
|
+
| No tasks and no delivered baseline | `/ultra-plan` |
|
|
127
|
+
| Doctor degraded because of Ultra runtime state | `/ultra-doctor` |
|
|
128
|
+
| No active/blocked/ready change and fresh delivery exists | `/ultra-change` for the next daily change |
|
|
129
|
+
| Active change has any `pending` linked task | `/ultra-dev` (show which) |
|
|
130
|
+
| Active change linked tasks all `completed` | `/ultra-test` |
|
|
131
|
+
| Matching fresh `test-report.json.passed === true` | `/ultra-deliver` |
|
|
112
132
|
| `test-report.json.passed === false` | `/ultra-dev` (show blocking issues) |
|
|
113
|
-
| `
|
|
133
|
+
| Change is `ready` | `/ultra-deliver` to reconcile/archive before release completion |
|
|
134
|
+
| Latest change archived and delivery fresh | Baseline healthy; next work starts with `/ultra-change` |
|
|
114
135
|
|
|
115
136
|
**Safety checks before routing**:
|
|
116
137
|
- Routing to deliver but `test-report.git_commit ≠ HEAD` → warn "Tests stale"
|
|
@@ -143,6 +164,8 @@ session_id (if active), `context_file`, `trace_to`, stale flag, update history.
|
|
|
143
164
|
|---------|----------|--------------|
|
|
144
165
|
| List tasks | `task.list` | none; fail closed |
|
|
145
166
|
| Single task detail | `task.get` | none; fail closed |
|
|
167
|
+
| Change lane | `change.list` | none; fail closed |
|
|
168
|
+
| Runtime health | `system.doctor { repair:false }` | `ultra-tools system doctor` |
|
|
146
169
|
| Cost panel (Phase 6.3) | — | `ultra-tools status --cost --json --since 7d` |
|
|
147
170
|
|
|
148
171
|
## Cost panel (Phase 6.3)
|
|
@@ -154,7 +177,7 @@ is the conventional weekly window; override with ISO-8601 for custom ranges.
|
|
|
154
177
|
|
|
155
178
|
## What this skill DOES NOT do
|
|
156
179
|
|
|
157
|
-
- Does NOT modify state
|
|
180
|
+
- Does NOT modify or repair state
|
|
158
181
|
- Does NOT run tests / build / deploy
|
|
159
182
|
- Does NOT require all artifacts (partial reports are tolerated)
|
|
160
183
|
|
|
@@ -162,6 +185,6 @@ is the conventional weekly window; override with ISO-8601 for custom ranges.
|
|
|
162
185
|
|
|
163
186
|
| | |
|
|
164
187
|
|---|---|
|
|
165
|
-
| **Input** | state.db
|
|
188
|
+
| **Input** | state.db via task/change/session/system reads, test/delivery reports, git HEAD |
|
|
166
189
|
| **Output** | console report (Chinese per project rule) |
|
|
167
190
|
| **When** | anytime — idempotent read-only |
|
|
@@ -4,6 +4,7 @@ description: "Pre-delivery quality audit — Anti-Pattern + Coverage Gap + Wirin
|
|
|
4
4
|
runtime: all
|
|
5
5
|
mcp_tools_required:
|
|
6
6
|
- task.list
|
|
7
|
+
- change.list
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# ultra-test — Phase 3.5
|
|
@@ -31,7 +32,9 @@ returns an authority error, stop the audit. Never fall back to
|
|
|
31
32
|
|
|
32
33
|
1. Detect project type from config (`package.json` / `Cargo.toml` / `go.mod` / `pyproject.toml` / …)
|
|
33
34
|
2. `task.list { status: "completed" }` → confirm ≥1 task delivered
|
|
34
|
-
3.
|
|
35
|
+
3. `change.list` → identify the active/blocked change, if any; filter linked
|
|
36
|
+
tasks locally by `change_id`
|
|
37
|
+
4. Find test files (suffix `.test.*`, `.spec.*`, `test_*.py`, `*_test.go`)
|
|
35
38
|
|
|
36
39
|
Block with instructive error if any precheck fails.
|
|
37
40
|
|
|
@@ -144,8 +147,12 @@ If max reached → surface remaining issues; `passed=false`.
|
|
|
144
147
|
{
|
|
145
148
|
"timestamp": "<ISO8601>",
|
|
146
149
|
"git_commit": "<HEAD>",
|
|
150
|
+
"change_id": "<active-change-id-or-null>",
|
|
147
151
|
"passed": true,
|
|
148
152
|
"run_count": 1,
|
|
153
|
+
"commands": [
|
|
154
|
+
{ "command": "<exact command>", "exit_code": 0, "scope": "unit/integration/e2e/build" }
|
|
155
|
+
],
|
|
149
156
|
"gates": {
|
|
150
157
|
"anti_pattern": { "passed": true, "critical": 0, "warning": 1 },
|
|
151
158
|
"coverage_gaps": { "passed": true, "high": 0, "medium": 3, "low": 5 },
|
|
@@ -162,6 +169,10 @@ Rules:
|
|
|
162
169
|
- File exists → increment `run_count`
|
|
163
170
|
- `passed = true` iff all gates `.passed === true`
|
|
164
171
|
- `blocking_issues` lists human-readable strings for any fail
|
|
172
|
+
- `commands` records exact executable evidence; prose such as “tests look good”
|
|
173
|
+
is not convergence evidence
|
|
174
|
+
- when a continuous change is active, `change_id` must match it; never reuse a
|
|
175
|
+
report from another change
|
|
165
176
|
|
|
166
177
|
### Step 8 — Report
|
|
167
178
|
|
|
@@ -184,6 +195,7 @@ when `passed=true`.
|
|
|
184
195
|
| Purpose | MCP tool | CLI fallback |
|
|
185
196
|
|---------|----------|--------------|
|
|
186
197
|
| Confirm ≥1 completed task | `task.list { status: "completed" }` | none; fail closed |
|
|
198
|
+
| Identify active change | `change.list` | none; omit only for initial baseline delivery |
|
|
187
199
|
| Confirm risky auto-fix | none | current Host's native user-interaction surface |
|
|
188
200
|
|
|
189
201
|
## What this skill DOES NOT do
|
|
@@ -197,5 +209,5 @@ when `passed=true`.
|
|
|
197
209
|
| | |
|
|
198
210
|
|---|---|
|
|
199
211
|
| **Input** | Source + test files, state.db (read-only) |
|
|
200
|
-
| **Output** | `.ultra/test-report.json
|
|
212
|
+
| **Output** | `.ultra/test-report.json` with exact commands/change id, `.ultra/docs/test-coverage-gaps.md` |
|
|
201
213
|
| **Next** | `/ultra-deliver` (only when `passed=true`) |
|