ultra-builder-pro-cli 0.16.0 → 0.17.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/specs/research-distillate.md +4 -3
- package/CHANGELOG.md +86 -0
- package/README.md +54 -24
- package/adapters/_shared/codex-assets.cjs +10 -5
- package/adapters/_shared/handbook.cjs +1 -1
- package/adapters/_shared/interaction-contract.cjs +61 -0
- package/adapters/claude.js +1 -1
- package/adapters/opencode.js +1 -1
- package/bin/orchestrator.js +175 -19
- package/commands/ultra-change.md +1 -1
- package/commands/ultra-deliver.md +3 -3
- package/commands/ultra-init.md +1 -1
- package/commands/ultra-plan.md +1 -1
- package/commands/ultra-research.md +2 -2
- package/commands/ultra-review.md +10 -0
- package/commands/ultra-status.md +1 -1
- package/commands/ultra-test.md +1 -1
- package/docs/AGENT-CONTEXT.md +11 -8
- package/docs/ARCHITECTURE.md +67 -9
- package/docs/LEGACY-CLI-CROSSWALK.md +163 -0
- package/docs/PLAN.zh-CN.md +19 -13
- package/docs/RUNTIME-COMPAT-MATRIX.md +2 -2
- package/docs/WORKFLOW-LIFECYCLE.md +123 -59
- package/hooks/pre_stop_check.py +3 -2
- package/mcp-server/lib/baseline-workflow.cjs +84 -16
- package/mcp-server/lib/change-workflow.cjs +55 -35
- package/mcp-server/lib/context-spine.cjs +171 -105
- package/mcp-server/lib/git-bootstrap.cjs +240 -0
- package/mcp-server/lib/init-project.cjs +178 -41
- package/mcp-server/lib/project-breadcrumb.cjs +14 -14
- package/mcp-server/lib/state-db.cjs +257 -10
- package/mcp-server/lib/state-ops.cjs +64 -1
- package/mcp-server/lib/workflow-state.cjs +300 -205
- package/mcp-server/server.cjs +58 -34
- package/orchestrator/auto-merge.cjs +19 -0
- package/orchestrator/daemon.cjs +104 -0
- package/orchestrator/parallel-orchestrator.cjs +371 -49
- package/orchestrator/session-runner.cjs +354 -25
- package/package.json +2 -1
- package/skills/ultra-change/SKILL.md +69 -94
- package/skills/ultra-deliver/SKILL.md +37 -65
- package/skills/ultra-dev/SKILL.md +50 -52
- package/skills/ultra-doctor/SKILL.md +34 -49
- package/skills/ultra-init/SKILL.md +78 -105
- package/skills/ultra-plan/SKILL.md +78 -99
- package/skills/ultra-research/SKILL.md +99 -113
- package/skills/ultra-review/SKILL.md +38 -53
- package/skills/ultra-review/references/review-modes.md +5 -3
- package/skills/ultra-review/references/unified-schema.md +26 -6
- package/skills/ultra-review/scripts/review_wait.py +12 -0
- package/skills/ultra-status/SKILL.md +34 -44
- package/skills/ultra-test/SKILL.md +61 -54
- package/skills/ultra-think/SKILL.md +37 -51
- package/skills/ultra-think/references/decision-dialogue.md +87 -111
- package/spec/cli-protocol.md +35 -0
- package/spec/mcp-tools.yaml +145 -28
- package/spec/schemas/delivery-report.v1.schema.json +1 -46
- package/spec/schemas/state-db.sql +8 -2
- package/spec/schemas/test-report.v1.schema.json +45 -14
- package/ultra-tools/cli.cjs +1 -1
- package/ultra-tools/commands/session.cjs +10 -3
- package/ultra-tools/commands/status.cjs +19 -14
- package/ultra-tools/commands/system.cjs +2 -2
- package/ultra-tools/commands/task.cjs +3 -0
|
@@ -1,98 +1,73 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-change
|
|
3
|
-
description:
|
|
3
|
+
description: Capture or revise one bounded feature, fix, redesign, or incident contract against a ready Ultra baseline. Use when post-baseline work needs accepted intent before research, planning, or implementation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
reconciliation. Adoption/migration state, missing approval or evidence, blocking gaps,
|
|
75
|
-
and any other structural baseline failure block tasks, context, and later stages. Only
|
|
76
|
-
the recorded incident break-glass authority can bypass that gate.
|
|
77
|
-
|
|
78
|
-
Call `workflow.complete` only after all change workflow steps are current. Return the
|
|
79
|
-
change id, kind, task set, context digest, blockers or warnings, workflow state, and the
|
|
80
|
-
breadcrumb's one route.
|
|
81
|
-
|
|
82
|
-
When implementation reveals a stable missing invariant, use
|
|
83
|
-
`change.learning_propose` and the approval/reject/apply transition. Unresolved learning
|
|
84
|
-
blocks delivery. An approved application must bind the declared target anchor, its
|
|
85
|
-
before and after digests, and current evidence before the proposal becomes `applied`.
|
|
86
|
-
|
|
87
|
-
## Automatic routing contract
|
|
88
|
-
|
|
89
|
-
Automatic means route, inspect, and recover automatically; it never means silently
|
|
90
|
-
choose an owner decision. The normal route is:
|
|
91
|
-
|
|
92
|
-
`capture → align → Change Contract checkpoint → change authority → bounded research when
|
|
93
|
-
needed → plan candidate → plan decision review → plan approval → ultra-dev → test →
|
|
94
|
-
review → deliver → baseline reconciliation`.
|
|
95
|
-
|
|
96
|
-
A quick change may omit research and use one task only when evidence proves the request
|
|
97
|
-
has no material unresolved decision or risk. An incident routes through reproduction,
|
|
98
|
-
hypothesis discrimination, recovery choice, fix, and verification before convergence.
|
|
6
|
+
# Capture accepted change intent
|
|
7
|
+
|
|
8
|
+
Change is the durable unit that connects later research, plan, implementation,
|
|
9
|
+
verification, review, and baseline reconciliation. Capturing a change does not start
|
|
10
|
+
those workflows or compile execution context.
|
|
11
|
+
|
|
12
|
+
Read `../ultra-think/references/decision-dialogue.md` before asking a material question.
|
|
13
|
+
|
|
14
|
+
## Inspect and align
|
|
15
|
+
|
|
16
|
+
1. Read `system.doctor`, `baseline.get`, active changes, decisions, and
|
|
17
|
+
`change.breadcrumb`.
|
|
18
|
+
2. Resume an existing change that matches the request. Do not duplicate authority.
|
|
19
|
+
3. Ordinary work requires a healthy ready baseline. An incident may use only an
|
|
20
|
+
explicit `baseline_bypass` reason and approver; urgency is not approval.
|
|
21
|
+
4. Inspect the checkout and accepted baseline before asking the user. Resolve code and
|
|
22
|
+
runtime facts yourself.
|
|
23
|
+
5. Convert the request into a Change Contract:
|
|
24
|
+
- observable outcome and executable acceptance;
|
|
25
|
+
- non-goals and public seams;
|
|
26
|
+
- recovery strategy and verification;
|
|
27
|
+
- unresolved material decisions;
|
|
28
|
+
- documentation impact;
|
|
29
|
+
- change kind and evidence-backed risk flags;
|
|
30
|
+
- research disposition.
|
|
31
|
+
|
|
32
|
+
Select `quick`, `standard`, `major`, or `incident` from actual scope and risk. A quick
|
|
33
|
+
change may have no material risk, research obligation, or more than one task.
|
|
34
|
+
|
|
35
|
+
Ask only when a choice changes accepted product intent, scope, public behavior,
|
|
36
|
+
compatibility, security, material cost, external effects, or recovery. Use the host's
|
|
37
|
+
native question UI when available. Normalize clear choices already in the user's
|
|
38
|
+
request. The model owns reversible implementation detail inside the accepted contract.
|
|
39
|
+
|
|
40
|
+
## Persist the contract
|
|
41
|
+
|
|
42
|
+
When a durable alignment checkpoint is necessary, bind it to a compact artifact and
|
|
43
|
+
pass its id as `alignment_thread_id`. Do not require a checkpoint for a complete,
|
|
44
|
+
unambiguous request that already provides current authority.
|
|
45
|
+
|
|
46
|
+
Call `change.create`. It records and completes exactly:
|
|
47
|
+
|
|
48
|
+
1. `bind-baseline`
|
|
49
|
+
2. `classify-change`
|
|
50
|
+
3. `record-intent`
|
|
51
|
+
|
|
52
|
+
The returned change workflow must be `completed`; research, plan, context, dev, test,
|
|
53
|
+
review, and deliver remain independent capabilities. Standard and major changes may
|
|
54
|
+
store delta artifacts under `.ultra/changes/active/<id>/delta/`. Incidents maintain
|
|
55
|
+
the structured diagnosis artifact.
|
|
56
|
+
|
|
57
|
+
Use `change.update` when accepted intent or evidence changes. Update the Change
|
|
58
|
+
Contract, classification, research disposition, and docs impact together when their
|
|
59
|
+
meaning is coupled. Downstream task, context, test, or review evidence affected by that
|
|
60
|
+
change must become stale and be regenerated; never keep old evidence green by prompt
|
|
61
|
+
assertion.
|
|
62
|
+
|
|
63
|
+
If research is required, invoke `ultra-research` with the recorded disposition. If the
|
|
64
|
+
contract is sufficiently evidenced, the host may recommend `ultra-plan`. `change.context`
|
|
65
|
+
is compiled only for an actual plan, implementation, test, or review consumer.
|
|
66
|
+
|
|
67
|
+
Stable implementation discoveries use the approval-gated specification-learning
|
|
68
|
+
transitions. External memory and graph providers retain their own content; Ultra stores
|
|
69
|
+
metadata references only.
|
|
70
|
+
|
|
71
|
+
Return the normalized contract, change id and kind, research disposition, blockers,
|
|
72
|
+
and `allowed_transitions`. The host selects a recommendation from those transitions;
|
|
73
|
+
MCP does not encode a semantic next action.
|
|
@@ -1,84 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-deliver
|
|
3
|
-
description: Converge
|
|
3
|
+
description: Converge a verified Ultra change, reconcile baseline specifications, and archive it with recoverable local evidence. Use when implementation, testing, and review are current.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Converge and
|
|
6
|
+
# Converge and archive local authority
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
output digests.
|
|
8
|
+
Delivery closes Ultra's local change authority. It does not grant or perform commit,
|
|
9
|
+
push, tag, registry publication, deployment, or another external effect.
|
|
11
10
|
|
|
12
11
|
## Bind current evidence
|
|
13
12
|
|
|
14
|
-
1. Read
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
verified public seam, and current independent `spec_fidelity` and
|
|
20
|
-
`engineering_standards` verdicts. Record `bind-evidence`.
|
|
13
|
+
1. Read doctor, baseline, change, breadcrumb, decisions, tasks, test, review, learning,
|
|
14
|
+
and current checkout.
|
|
15
|
+
2. Resume or start a deliver workflow bound to the change and baseline.
|
|
16
|
+
3. Require complete task evidence, a current test report, both review axes, current
|
|
17
|
+
context, and resolved material decisions. Record `bind-evidence`.
|
|
21
18
|
|
|
22
|
-
Evidence from another revision, task set,
|
|
23
|
-
approved break-glass incident follows only its recorded recovery contract.
|
|
19
|
+
Evidence from another revision, task set, or change is invalid.
|
|
24
20
|
|
|
25
|
-
## Reconcile
|
|
21
|
+
## Reconcile specifications
|
|
26
22
|
|
|
27
|
-
Resolve every specification-learning
|
|
28
|
-
|
|
29
|
-
accepted delta and documentation impact into baseline documents, or record an exact
|
|
30
|
-
no-change reason. Record `reconcile-specifications`.
|
|
23
|
+
Resolve every specification-learning candidate. Apply approved learning to its target
|
|
24
|
+
with before/after digests and verification; preserve rejection reasons.
|
|
31
25
|
|
|
32
|
-
Read `references/baseline-reconciliation.md` and write the
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
semantic no-change reason.
|
|
26
|
+
Read `references/baseline-reconciliation.md` and write the reconciliation manifest
|
|
27
|
+
inside the active change directory. Record semantic additions or updates, resolved
|
|
28
|
+
gaps and unknowns, and verification. If baseline semantics did not change, record an
|
|
29
|
+
evidenced no-change reason. Record `reconcile-specifications`.
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
record its immutable manifest as the `verify-candidate` output. Any edit invalidates
|
|
42
|
-
affected evidence.
|
|
31
|
+
Compile final convergence context and run the risk-selected candidate checks, install
|
|
32
|
+
or doctor smoke when this change modifies distributed assets, public-seam verification,
|
|
33
|
+
and recovery sanity. Record the immutable context under `verify-candidate`.
|
|
43
34
|
|
|
44
|
-
Call `change.converge
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
workflows and current artifacts. Resolve named blockers and rerun invalidated gates. Record
|
|
48
|
-
`converge-authority` only when the change is ready.
|
|
35
|
+
Call `change.converge`; MCP derives readiness from durable dev, test, review,
|
|
36
|
+
specification, docs, diagnosis, and current checkout evidence. Record
|
|
37
|
+
`converge-authority` only when ready.
|
|
49
38
|
|
|
50
|
-
Call `change.archive` with the
|
|
51
|
-
|
|
52
|
-
Ordinary archive refreshes baseline revision and digests atomically and rolls back on
|
|
53
|
-
incomplete reconciliation. Record `archive-change`. For break-glass delivery, verify
|
|
54
|
-
the returned bypass and blocking reconciliation gap.
|
|
39
|
+
Call `change.archive` with the reconciliation manifest and summary. Verify the refreshed
|
|
40
|
+
baseline and archived packet, then record `archive-change`.
|
|
55
41
|
|
|
56
|
-
|
|
42
|
+
Write `.ultra/reports/delivery/<workflow-id>.json` with
|
|
43
|
+
`ultra-delivery-report-v1`: archived change, baseline, HEAD, worktree and context
|
|
44
|
+
digests, local checks, rollback notes, and timestamp. The report must not contain a
|
|
45
|
+
release decision. Record it under `verify-delivery` and complete the workflow.
|
|
57
46
|
|
|
58
|
-
|
|
59
|
-
user's request, complete it with exactly one `release_authorization` decision containing
|
|
60
|
-
`authorized: false` and the reason. When explicitly authorized, record
|
|
61
|
-
`authorized: true`, `approved_by`, the exact release `scope`, and the reason; then
|
|
62
|
-
determine compatibility impact, update version and
|
|
63
|
-
changelog, rerun invalidated checks, create a non-force commit/tag, push, publish, and
|
|
64
|
-
verify remote commit, tag, release, and registry version independently.
|
|
65
|
-
If release authority is not already explicit, present that authorization as one compact
|
|
66
|
-
question and stop. Do not bundle release permission with unrelated delivery choices or
|
|
67
|
-
ask again when the current user request already grants the exact scope.
|
|
47
|
+
## External effects
|
|
68
48
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
deployment action, rollback notes, and timestamp. The report authorization must match
|
|
75
|
-
the DB-recorded decision. Record `verify-delivery` with that
|
|
76
|
-
output and call `workflow.complete` only after the change is archived and local and
|
|
77
|
-
remote evidence agree for every authorized action. MCP derives the delivery summary
|
|
78
|
-
from this report rather than a Prompt claim.
|
|
49
|
+
If the user separately requests commit, push, tag, publish, or deploy, handle that as a
|
|
50
|
+
host-owned effect after Ultra delivery. Confirm only missing material authority, run
|
|
51
|
+
the repository's release checks, and report remote evidence separately. Never infer an
|
|
52
|
+
external effect from `ultra-deliver`, and never encode it as completed Ultra delivery
|
|
53
|
+
state.
|
|
79
54
|
|
|
80
|
-
Return
|
|
81
|
-
|
|
82
|
-
`ultra-status` for the final authoritative view or `ultra-change` for the next accepted
|
|
83
|
-
outcome. Stale gates return to their owning workflow; a new owner choice routes to
|
|
84
|
-
`ultra-think`; broken authority routes to `ultra-doctor`.
|
|
55
|
+
Return archive and baseline state, evidence digests, recovery notes, residual risks,
|
|
56
|
+
and allowed transitions.
|
|
@@ -1,66 +1,64 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-dev
|
|
3
|
-
description:
|
|
3
|
+
description: Implement one authoritative Ultra task through a fresh-context, test-driven, review-backed live path. Use when a planned task is executable, interrupted, or ready for focused recovery.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Implement one
|
|
6
|
+
# Implement one task
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
recovery.
|
|
8
|
+
The host model owns code reasoning and edits. Ultra owns the task and workflow state,
|
|
9
|
+
fresh context contract, session lease, evidence references, and recovery.
|
|
11
10
|
|
|
12
|
-
##
|
|
11
|
+
## Bind and resume
|
|
13
12
|
|
|
14
|
-
1. Read
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
required refs from the task row. Record its immutable manifest as the
|
|
24
|
-
`compile-context` output only when ready. That starting snapshot remains historical
|
|
25
|
-
task evidence; later task commits do not invalidate it when its commit stays on the
|
|
26
|
-
current ancestry and the task contract is unchanged.
|
|
27
|
-
5. Run session admission before spawning an isolated session. Do not open a second
|
|
28
|
-
active lease without the documented resume, takeover, or abandon decision.
|
|
13
|
+
1. Read doctor, breadcrumb, active decisions, task contract, dependencies, dev runs,
|
|
14
|
+
sessions, HEAD, and worktree.
|
|
15
|
+
2. Resume the matching dev run or start one with `change_id` and `task_id`.
|
|
16
|
+
3. Record `bind-task` with current authority and dependency evidence.
|
|
17
|
+
4. Compile `change.context` for `implement` using DB-backed public seam, verification
|
|
18
|
+
command, and refs. Context budgets are advisory; missing required evidence is
|
|
19
|
+
blocking. Record the immutable manifest as `compile-context`.
|
|
20
|
+
5. Reuse an existing valid session. Otherwise pass admission and call `session.spawn`.
|
|
21
|
+
Work only in the returned worktree and preserve unrelated changes.
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
Do not spawn recursively from a parent-owned worker session. Process exit is transport
|
|
24
|
+
evidence, never task completion.
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
## Focused inner loop
|
|
27
|
+
|
|
28
|
+
1. Reproduce the bug, write a failing test, or establish a characterization signal
|
|
29
|
+
before a logic change. Record `establish-feedback-loop`.
|
|
30
|
+
2. Mark the task `in_progress` and implement the smallest complete slice through the
|
|
31
|
+
declared public seam.
|
|
32
|
+
3. Keep the loop adaptive. The model may choose implementation details inside the
|
|
33
|
+
accepted contract. If new evidence changes product intent, compatibility, security,
|
|
34
|
+
material cost, external effects, or recovery, use the host's native question UI and
|
|
35
|
+
the decision protocol; do not ask about ordinary reversible details.
|
|
36
|
+
4. Record `implement-slice`, then run focused tests plus the adjacent checks justified
|
|
37
|
+
by the task risk. Record exact results under `verify-slice`.
|
|
38
|
+
5. Run a task-scoped independent review on specification fidelity and relevant
|
|
39
|
+
engineering risks. Record `review-slice`. Fix blocking findings and refresh affected
|
|
40
|
+
evidence.
|
|
41
|
+
6. Create the authorized local task commit. Do not push, publish, tag, or deploy unless
|
|
42
|
+
the user separately authorized that external effect.
|
|
43
|
+
|
|
44
|
+
Task-level tests and review belong to this inner loop. They do not replace aggregate
|
|
45
|
+
change testing or review when multiple slices, integrations, or broader risks require
|
|
46
|
+
those capabilities.
|
|
48
47
|
|
|
49
48
|
## Complete or recover
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
In direct mode, integrate the task commit through the repository's accepted path,
|
|
51
|
+
verify ancestry and the public seam, close the session, update the task to `completed`,
|
|
52
|
+
record `record-completion`, and complete the dev workflow.
|
|
53
|
+
|
|
54
|
+
In a parent-supervised worker, record completion evidence and exit without closing the
|
|
55
|
+
parent-owned lease. The primary host verifies the exact session commit, performs any
|
|
56
|
+
integration, refreshes review if the reviewed checkout changed, settles the lease, and
|
|
57
|
+
completes the workflow.
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
review, or context evidence.
|
|
59
|
+
Preserve worktrees by default. Remove one only when Git proves it is clean and
|
|
60
|
+
integrated. On interruption, record the current step and task as blocked, preserve
|
|
61
|
+
worktree and evidence, and resume the same run later.
|
|
62
62
|
|
|
63
|
-
Return
|
|
64
|
-
|
|
65
|
-
task to `ultra-dev`; route a fully implemented change to aggregate `ultra-test`;
|
|
66
|
-
route a new owner choice to `ultra-think`; route broken authority to `ultra-doctor`.
|
|
63
|
+
Return outcome, changed paths, public seam, exact checks, review axes, commit and
|
|
64
|
+
session state, residual risk, and allowed transitions.
|
|
@@ -1,65 +1,50 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-doctor
|
|
3
|
-
description: Diagnose and recover Ultra
|
|
3
|
+
description: Diagnose and mechanically recover Ultra schema, workflow, projection, session, archive, hook, and installed-asset faults. Use when authority is degraded, stale, contradictory, or unavailable.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Diagnose before repair
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Doctor owns deterministic health and supported recovery. It cannot decide product
|
|
9
|
+
scope, invent evidence, approve a baseline, answer a user decision, or mark semantic
|
|
10
|
+
work complete.
|
|
9
11
|
|
|
10
|
-
-
|
|
11
|
-
- baseline classification/readiness, research provenance, spec/evidence digests, gaps,
|
|
12
|
-
and revision/worktree drift;
|
|
13
|
-
- active, blocked, and ready workflow runs, current steps, blockers, and output health;
|
|
14
|
-
- active decision threads, the sole current question, blocking deferrals, checkpoint
|
|
15
|
-
state, and current checkpoint artifact digests;
|
|
16
|
-
- event/projection cursor lag and failed or interrupted projection jobs;
|
|
17
|
-
- sessions, incidents, circuit state, active-change artifacts, and archive journals;
|
|
18
|
-
- external provider ownership boundaries.
|
|
12
|
+
## Read-only diagnosis
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
missing recorded output is an authority failure for that run. Doctor cannot invent
|
|
22
|
-
evidence, complete a step, accept a failure, approve a baseline, or change product
|
|
23
|
-
scope.
|
|
24
|
-
An awaiting owner decision is also a recoverable warning, not corruption. A missing or
|
|
25
|
-
changed artifact bound to a current confirmed checkpoint is an authority failure;
|
|
26
|
-
doctor may report it but cannot reconstruct the decision or approval.
|
|
14
|
+
Run `system.doctor` without repair and inspect:
|
|
27
15
|
|
|
28
|
-
|
|
16
|
+
- SQLite integrity, schema 18 migration, required tables, and backups;
|
|
17
|
+
- baseline and research provenance, gaps, digests, and Git/worktree drift;
|
|
18
|
+
- workflow status, obsolete-step migration, blockers, and output freshness;
|
|
19
|
+
- decisions and checkpoint artifact freshness;
|
|
20
|
+
- projection jobs and event cursors;
|
|
21
|
+
- sessions, preserved worktrees, incidents, circuit state, and archive journals;
|
|
22
|
+
- external provider boundaries.
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- Projection lag with healthy authority: eligible for mechanical regeneration.
|
|
34
|
-
- Orphan session: reconcile the recorded lease; do not kill unrelated processes.
|
|
35
|
-
- Missing change artifact: recover from version control, backup, or explicit owner
|
|
36
|
-
decision rather than silently recreating it.
|
|
37
|
-
- Open decision: resume its exact question through `ultra-think`; checkpoint-ready
|
|
38
|
-
state requires owner confirmation, not mechanical repair.
|
|
39
|
-
- Stale decision artifact: restore or update the artifact from accepted authority,
|
|
40
|
-
then reprepare and reconfirm the same checkpoint through `ultra-think`; do not
|
|
41
|
-
rewrite the owner decision or mark the failure healthy mechanically.
|
|
42
|
-
- Corrupt SQLite: preserve DB/WAL/SHM and obtain a restore-or-rebaseline decision.
|
|
24
|
+
An expected workflow pause or awaiting user decision is a warning, not corruption.
|
|
25
|
+
Missing or changed required evidence is an authority failure but cannot be reconstructed
|
|
26
|
+
by doctor.
|
|
43
27
|
|
|
44
|
-
##
|
|
28
|
+
## Recovery boundary
|
|
45
29
|
|
|
46
|
-
|
|
47
|
-
supported schema upgrades, backup-first archive recovery, orphan reconciliation,
|
|
48
|
-
staleness consumption, projection requeue, and projection regeneration. Verify the
|
|
49
|
-
pre-migration and repair backup paths and rerun the read-only report. A completed repair
|
|
50
|
-
action does not imply healthy workflow evidence.
|
|
30
|
+
With explicit repair authorization, `system.doctor` may:
|
|
51
31
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
32
|
+
- apply backup-first supported schema migrations;
|
|
33
|
+
- migrate active pre-18 rigid workflows into recoverable adaptive state;
|
|
34
|
+
- requeue or regenerate projections from healthy DB authority;
|
|
35
|
+
- reconcile orphan sessions without deleting unrelated or dirty worktrees;
|
|
36
|
+
- resume supported archive journals;
|
|
37
|
+
- recover missing workflow provenance as a blocked run requiring real evidence.
|
|
55
38
|
|
|
56
|
-
|
|
39
|
+
It may not create a Git checkpoint, replace a healthy baseline, accept known failures,
|
|
40
|
+
resolve decisions, regenerate semantic content, or edit application code.
|
|
57
41
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
and a hook smoke test. Project doctor and installer doctor are separate authorities.
|
|
42
|
+
Corrupt SQLite requires preservation of DB, WAL, and SHM followed by an explicit
|
|
43
|
+
restore-or-rebaseline choice. Missing hook adapters or stale cache paths require
|
|
44
|
+
`ubp --doctor` and adapter reinstall; never patch plugin cache contents by hand.
|
|
62
45
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
After repair, rerun doctor read-only and verify backup paths, schema, installed hashes,
|
|
47
|
+
entry points, MCP startup, and hook smoke tests as applicable.
|
|
48
|
+
|
|
49
|
+
Return health first, failed checks, mechanical repairs performed, preserved recovery
|
|
50
|
+
paths, unresolved owners, and allowed transitions plus any unique required transition.
|