ultra-builder-pro-cli 0.21.1 → 0.23.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/tasks/tasks.json +10 -3
- package/.ultra-template/templates/task-context.md +19 -0
- package/CHANGELOG.md +78 -0
- package/README.md +210 -36
- package/adapters/_shared/codex-assets.cjs +8 -3
- package/adapters/_shared/interaction-contract.cjs +13 -6
- package/adapters/_shared/runtime-assets.cjs +1 -1
- package/adapters/claude.js +1 -1
- package/adapters/kimi.js +1 -1
- package/adapters/opencode.js +24 -13
- package/docs/AGENT-CONTEXT.md +58 -51
- package/docs/ARCHITECTURE.md +82 -51
- package/docs/ARTIFACT-AUTHORITY.md +83 -44
- package/docs/COMMIT-HASH-BACKFILL.md +33 -90
- package/docs/DECISIONS.md +9 -7
- package/docs/LEGACY-CLI-CROSSWALK.md +10 -2
- package/docs/PLUGIN-ISOLATION-CONTRACT.md +3 -2
- package/docs/ROADMAP.md +3 -3
- package/docs/RUNTIME-COMPAT-MATRIX.md +13 -10
- package/docs/STATE-DB-ACCESS-POLICY.md +47 -19
- package/docs/WORKFLOW-LIFECYCLE.md +79 -49
- package/hooks/README.md +5 -4
- package/hooks/active_task_context.py +41 -39
- package/mcp-server/lib/artifact-registry.cjs +32 -7
- package/mcp-server/lib/baseline-workflow.cjs +60 -24
- package/mcp-server/lib/change-workflow.cjs +42 -6
- package/mcp-server/lib/context-paths.cjs +34 -3
- package/mcp-server/lib/doctor.cjs +28 -0
- package/mcp-server/lib/git-bootstrap.cjs +0 -1
- package/mcp-server/lib/init-project.cjs +52 -2
- package/mcp-server/lib/projector.cjs +43 -8
- package/mcp-server/lib/state-authority.cjs +19 -3
- package/mcp-server/lib/state-ops.cjs +6 -1
- package/mcp-server/lib/task-ledger.cjs +1342 -0
- package/mcp-server/lib/ultra-facade.cjs +646 -0
- package/mcp-server/lib/workflow-state.cjs +166 -2
- package/mcp-server/server.cjs +214 -26
- package/package.json +1 -1
- package/skills/ultra-change/SKILL.md +38 -90
- package/skills/ultra-deliver/SKILL.md +42 -62
- package/skills/ultra-dev/SKILL.md +34 -73
- package/skills/ultra-doctor/SKILL.md +26 -39
- package/skills/ultra-init/SKILL.md +37 -69
- package/skills/ultra-plan/SKILL.md +52 -125
- package/skills/ultra-research/SKILL.md +41 -101
- package/skills/ultra-review/SKILL.md +25 -44
- package/skills/ultra-status/SKILL.md +21 -40
- package/skills/ultra-test/SKILL.md +25 -60
- package/skills/ultra-think/SKILL.md +29 -48
- package/skills/ultra-think/references/decision-dialogue.md +6 -4
- package/spec/cli-protocol.md +15 -0
- package/spec/mcp-tools.yaml +286 -0
- package/spec/schemas/context-file.v4.5.schema.json +1 -1
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/state-db.sql +1 -1
- package/spec/schemas/task-ledger.v1.schema.json +217 -0
- package/ultra-tools/commands/migrate.cjs +5 -2
- package/.ultra-template/tasks/contexts/TEMPLATE.md +0 -19
|
@@ -3,97 +3,45 @@ name: ultra-change
|
|
|
3
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
|
-
# Capture accepted
|
|
6
|
+
# Capture accepted Change intent
|
|
7
7
|
|
|
8
|
-
Change is the durable unit
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Read `../ultra-think/references/decision-dialogue.md` before asking a material question.
|
|
8
|
+
A Change is the durable unit connecting research, plan, implementation, verification,
|
|
9
|
+
review, documentation, and delivery. Its draft stays editable until a semantic
|
|
10
|
+
checkpoint accepts the downstream authority.
|
|
13
11
|
|
|
14
12
|
## Inspect and align
|
|
15
13
|
|
|
16
|
-
1.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
3.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
5.
|
|
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
|
-
When a durable alignment checkpoint is necessary, bind it to a compact artifact and
|
|
52
|
-
pass its id as `alignment_thread_id`. Do not require a checkpoint for a complete,
|
|
53
|
-
unambiguous request that already provides current authority.
|
|
54
|
-
|
|
55
|
-
Call `change.create`. It records and completes exactly:
|
|
56
|
-
|
|
57
|
-
1. `bind-baseline`
|
|
58
|
-
2. `classify-change`
|
|
59
|
-
3. `record-intent`
|
|
60
|
-
|
|
61
|
-
The returned change workflow must be `completed`; research, plan, context, dev, test,
|
|
62
|
-
review, and deliver remain independent capabilities. Keep every Change-owned semantic
|
|
63
|
-
artifact, finding, plan, context, test result, review result, documentation update,
|
|
64
|
-
and progress projection below `.ultra/changes/active/<id>/`. Incidents maintain the
|
|
65
|
-
structured diagnosis artifact there as well.
|
|
66
|
-
|
|
67
|
-
Before planning a standard or major change, write the accepted specification updates
|
|
68
|
-
to the Change overlay and call `change.delta` with exact baseline id, repository
|
|
69
|
-
revision, specification digests, decisions, non-goals, acceptance, documentation
|
|
70
|
-
impact, unknowns, and mutation before/after digests. If accepted behavior truly does
|
|
71
|
-
not change baseline semantics, record an empty typed delta with a specific
|
|
72
|
-
`no_semantic_change_reason`; do not manufacture a mutation. Read back the registered
|
|
73
|
-
delta and deterministic `progress.md`. This records proposed authority only and must
|
|
74
|
-
not edit baseline specifications.
|
|
75
|
-
|
|
76
|
-
Use `change.update` when accepted intent or evidence changes. Update the Change
|
|
77
|
-
Contract, classification, research disposition, and docs impact together when their
|
|
78
|
-
meaning is coupled. Downstream task, context, test, or review evidence affected by that
|
|
79
|
-
change must become stale and be regenerated; never keep old evidence green by prompt
|
|
80
|
-
assertion.
|
|
81
|
-
|
|
82
|
-
If research is required, recommend `ultra-research` with the recorded disposition. If
|
|
83
|
-
the contract is sufficiently evidenced, finish the typed delta and recommend
|
|
84
|
-
`ultra-plan`. Direct Build skips Research only; it never skips Plan, DB-backed task
|
|
85
|
-
contracts, or fresh task context. Return and wait for an explicit user invocation; do
|
|
86
|
-
not start another workflow. `change.context` is compiled only for an actual plan,
|
|
87
|
-
implementation, test, or review consumer.
|
|
88
|
-
|
|
89
|
-
Stable implementation discoveries use the approval-gated specification-learning
|
|
90
|
-
transitions. External memory and graph providers retain their own content; Ultra stores
|
|
91
|
-
metadata references only.
|
|
92
|
-
|
|
93
|
-
Return the normalized contract, change id and kind, research disposition, blockers,
|
|
94
|
-
and `allowed_transitions`. Recommend a semantic next action from those transitions.
|
|
95
|
-
If current intent does not already select it, present the recommendation and credible
|
|
96
|
-
alternatives through the interaction protocol, then wait. MCP does not encode a
|
|
97
|
-
semantic next action.
|
|
98
|
-
|
|
99
|
-
Never invoke the recommended capability here; wait for an explicit user invocation.
|
|
14
|
+
1. Call `ultra.context { stage: project, detail: full }`.
|
|
15
|
+
2. Inspect or import the team checkpoint with `ultra.sync`. Stop only on a real
|
|
16
|
+
baseline, Change, task, ancestry, or active-session conflict.
|
|
17
|
+
3. Reuse an existing matching Change. Do not duplicate authority.
|
|
18
|
+
4. Convert the request into observable outcome, executable acceptance, non-goals,
|
|
19
|
+
public seams, recovery, verification, documentation impact, risk, and research
|
|
20
|
+
disposition.
|
|
21
|
+
5. Recommend `quick`, `standard`, `major`, or `incident` from evidence. Ask only when
|
|
22
|
+
a choice changes accepted product intent, compatibility, security, material cost,
|
|
23
|
+
external effects, or recovery.
|
|
24
|
+
|
|
25
|
+
Read `../ultra-think/references/decision-dialogue.md` before asking. MCP may report
|
|
26
|
+
contradictory risk fields, but the model and owner choose the semantic correction.
|
|
27
|
+
|
|
28
|
+
## Record the contract
|
|
29
|
+
|
|
30
|
+
Use one `ultra.record` batch for `change.create` or `change.update`, relevant
|
|
31
|
+
`decision.*`, and `change.delta` when the delta is already known. Every entry carries
|
|
32
|
+
a stable idempotency key. Read the result through `ultra.context`.
|
|
33
|
+
|
|
34
|
+
Keep every Change-owned semantic artifact below
|
|
35
|
+
`.ultra/changes/active/<change-id>/`. Standard and major Changes require a typed delta
|
|
36
|
+
before planning. A true no-semantic-change case records an explicit reason instead of
|
|
37
|
+
manufacturing a mutation.
|
|
38
|
+
|
|
39
|
+
Changing accepted intent reopens the draft and makes only genuinely dependent evidence
|
|
40
|
+
stale. `ready` is not an absorbing state. A semantic rejection returns diagnostics;
|
|
41
|
+
repair and retry the same draft. Use `workflow.abandon` only to preserve and cancel an
|
|
42
|
+
attempt intentionally.
|
|
43
|
+
|
|
44
|
+
Publish the durable Change contract with `ultra.sync { action: publish }` when it is a
|
|
45
|
+
useful team handoff. Recommend bounded `ultra-research` for a real evidence gap or
|
|
46
|
+
`ultra-plan` when the contract is sufficiently evidenced. Do not invoke the next
|
|
47
|
+
capability automatically.
|
|
@@ -1,68 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-deliver
|
|
3
|
-
description: Converge a verified Ultra
|
|
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
6
|
# Converge and archive local authority
|
|
7
7
|
|
|
8
|
-
Delivery closes
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
1.
|
|
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
|
-
delivery. Verify the refreshed baseline and archived packet, then record
|
|
50
|
-
`archive-change`.
|
|
51
|
-
|
|
52
|
-
Write `<archived-change-root>/delivery/<workflow-id>/report.json` with
|
|
53
|
-
`ultra-delivery-report-v1`: archived change, baseline, HEAD, worktree and context
|
|
54
|
-
digests, local checks, rollback notes, and timestamp. The report must not contain a
|
|
55
|
-
release decision. Record it under `verify-delivery` and complete the workflow.
|
|
56
|
-
|
|
57
|
-
## External effects
|
|
58
|
-
|
|
59
|
-
If the user separately requests commit, push, tag, publish, or deploy, handle that as a
|
|
60
|
-
host-owned effect after Ultra delivery. Confirm only missing material authority, run
|
|
61
|
-
the repository's release checks, and report remote evidence separately. Never infer an
|
|
62
|
-
external effect from `ultra-deliver`, and never encode it as completed Ultra delivery
|
|
63
|
-
state.
|
|
64
|
-
|
|
65
|
-
Return archive and baseline state, evidence digests, recovery notes, residual risks,
|
|
66
|
-
and allowed transitions.
|
|
67
|
-
|
|
68
|
-
Never invoke the recommended capability here; wait for an explicit user invocation.
|
|
8
|
+
Delivery closes local Ultra authority. It never grants commit, push, tag, registry
|
|
9
|
+
publication, deployment, or another external effect.
|
|
10
|
+
|
|
11
|
+
## Prepare the packet
|
|
12
|
+
|
|
13
|
+
1. Call `ultra.context { stage: deliver, scope: { change_id }, detail: full }`.
|
|
14
|
+
2. Import a newer team checkpoint with `ultra.sync`; stop on a real conflict.
|
|
15
|
+
3. Require current task outcomes, test report, both review axes, accepted decisions,
|
|
16
|
+
typed delta, documentation reconciliation, and current checkout evidence.
|
|
17
|
+
4. Resolve every specification-learning candidate. Keep updates inside the Change
|
|
18
|
+
overlay until archive.
|
|
19
|
+
5. Write and register documentation reconciliation and an
|
|
20
|
+
`ultra-delivery-report-v1` report. The report binds Change, baseline, HEAD,
|
|
21
|
+
worktree/context digests, local checks, rollback guidance, and timestamp; it contains
|
|
22
|
+
no release decision.
|
|
23
|
+
|
|
24
|
+
Use one `ultra.record` batch for the reconciliation, report artifact, learning
|
|
25
|
+
resolutions, and other durable facts.
|
|
26
|
+
|
|
27
|
+
## Archive once
|
|
28
|
+
|
|
29
|
+
Call `ultra.archive` once with the Change id, stable idempotency key, archive summary,
|
|
30
|
+
reconciliation fields, delivery evidence steps, and report output. The operation
|
|
31
|
+
internally:
|
|
32
|
+
|
|
33
|
+
- compiles or reuses convergence context;
|
|
34
|
+
- checks the deliver draft;
|
|
35
|
+
- derives convergence from current dev, test, review, delta, docs, and checkout;
|
|
36
|
+
- applies the overlay and archive through the recoverable filesystem/DB transaction;
|
|
37
|
+
- rebinds registered artifacts into a self-contained archive;
|
|
38
|
+
- completes the durable delivery checkpoint;
|
|
39
|
+
- publishes the updated team checkpoint.
|
|
40
|
+
|
|
41
|
+
A semantic rejection returns mutable blockers. Repair the same packet and retry. A
|
|
42
|
+
hard corruption, path, concurrency, or recovery error remains fail-closed and routes to
|
|
43
|
+
`ultra-doctor`.
|
|
44
|
+
|
|
45
|
+
Verify the archived packet, baseline, checkpoint, and rollback state. Handle any
|
|
46
|
+
separately authorized Git or release effect only after local delivery and report it as
|
|
47
|
+
external evidence, not Ultra delivery authority. Do not invoke another capability
|
|
48
|
+
automatically.
|
|
@@ -5,87 +5,48 @@ description: Implement one authoritative Ultra task through a fresh-context, tes
|
|
|
5
5
|
|
|
6
6
|
# Implement one task
|
|
7
7
|
|
|
8
|
-
The
|
|
9
|
-
|
|
8
|
+
The model owns code reasoning and edits. Ultra owns the durable task contract, current
|
|
9
|
+
Context Manifest, execution lease, evidence references, and checkpoint.
|
|
10
10
|
|
|
11
|
-
## Bind
|
|
11
|
+
## Bind execution
|
|
12
12
|
|
|
13
|
-
1.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
3.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Context compilation itself is read-only with respect to Change and provider
|
|
22
|
-
authority.
|
|
23
|
-
5. Confirm the manifest contains the selected task, its direct dependencies, direct
|
|
24
|
-
dependents needed for integration, and relevant integration checkpoints—not the
|
|
25
|
-
entire task graph. Referenced file bodies stay lazy. The token estimate includes
|
|
26
|
-
inline Change/task authority as well as file estimates; budget overflow is
|
|
27
|
-
advisory, while a missing or stale required reference is blocking. Record the
|
|
28
|
-
immutable manifest as `compile-context`.
|
|
29
|
-
6. Reuse an existing valid session. Otherwise pass admission and call `session.spawn`.
|
|
30
|
-
Work only in the returned worktree and preserve unrelated changes.
|
|
13
|
+
1. Call `ultra.context { stage: dev, scope: { change_id, task_id }, detail: full }`.
|
|
14
|
+
2. Import a newer team checkpoint with `ultra.sync`; stop on a real same-record or
|
|
15
|
+
active-session conflict.
|
|
16
|
+
3. Reuse a valid lease or call `ultra.session { action: admission }`, then
|
|
17
|
+
`ultra.session { action: acquire }`. Work only in the returned worktree.
|
|
18
|
+
4. Confirm purpose, acceptance, dependencies, public seam, verification command,
|
|
19
|
+
non-goals, recovery, and required context refs. Update the task contract before
|
|
20
|
+
implementation when accepted intent changed.
|
|
31
21
|
|
|
32
|
-
|
|
33
|
-
evidence, never task completion.
|
|
22
|
+
## Implement adaptively
|
|
34
23
|
|
|
35
|
-
|
|
24
|
+
Reproduce the failure, write a failing test, or establish a characterization signal
|
|
25
|
+
before changing logic. Implement the smallest complete vertical slice. Ask the owner
|
|
26
|
+
only when new evidence changes product intent, compatibility, security, material cost,
|
|
27
|
+
external effects, or recovery.
|
|
36
28
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
3. Keep the loop adaptive. The model may choose implementation details inside the
|
|
42
|
-
accepted contract. If new evidence changes product intent, compatibility, security,
|
|
43
|
-
material cost, external effects, or recovery, use the host's native question UI and
|
|
44
|
-
the decision protocol; do not ask about ordinary reversible details.
|
|
45
|
-
4. Record `implement-slice`, then run focused tests plus the adjacent checks justified
|
|
46
|
-
by the task risk. Record exact results under `verify-slice`.
|
|
47
|
-
5. Run a task-scoped independent review on specification fidelity and relevant
|
|
48
|
-
engineering risks. Record `review-slice`. Fix blocking findings and refresh affected
|
|
49
|
-
evidence.
|
|
50
|
-
6. Create the authorized local task commit. Do not push, publish, tag, or deploy unless
|
|
51
|
-
the user separately authorized that external effect.
|
|
29
|
+
Use `ultra.record` batches for task status, bounded events, artifacts, decisions, and
|
|
30
|
+
documentation candidates. Live ownership, `in_progress`, session ids, leases,
|
|
31
|
+
worktrees, telemetry, and completion hashes remain local runtime state; durable task
|
|
32
|
+
outcome and evidence may enter the team checkpoint.
|
|
52
33
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
impact, recovery, and definition of drift. If accepted intent, the task contract, or a
|
|
56
|
-
digest-bound reference changes, update the owning authority and recompile rather than
|
|
57
|
-
continuing from a stale packet.
|
|
34
|
+
Run focused and adjacent risk-justified checks, then a task-scoped independent review.
|
|
35
|
+
Fix blocking findings and refresh affected evidence.
|
|
58
36
|
|
|
59
|
-
|
|
60
|
-
root. When code changes invalidate or extend maintained documentation, update the
|
|
61
|
-
Change documentation overlay and its evidence rather than editing accepted baseline
|
|
62
|
-
specifications. Hooks may remind the host to reconcile documentation; they must not
|
|
63
|
-
block ordinary development or choose the semantic update.
|
|
37
|
+
## Commit one semantic checkpoint
|
|
64
38
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
39
|
+
Call `ultra.checkpoint` once with `stage: dev`, the exact Change/Task scope, evidence,
|
|
40
|
+
and stable idempotency key. It compiles or reuses the implementation Context Manifest
|
|
41
|
+
and validates the durable outcome. A rejection leaves the draft mutable.
|
|
68
42
|
|
|
69
|
-
|
|
43
|
+
After acceptance, mark the task durably completed, publish with `ultra.sync`, and
|
|
44
|
+
create at most one authorized local task commit containing code and semantic
|
|
45
|
+
artifacts. Record its SHA only in local state; never create a bookkeeping commit.
|
|
70
46
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
47
|
+
Release the lease through `ultra.session`. Preserve a dirty or unintegrated worktree
|
|
48
|
+
on interruption. Commit, push, tag, publish, deploy, or destructive cleanup require
|
|
49
|
+
separate owner authority.
|
|
74
50
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
task. A newer review, test, or plan packet cannot substitute for it.
|
|
78
|
-
|
|
79
|
-
In a parent-supervised worker, record completion evidence and exit without closing the
|
|
80
|
-
parent-owned lease. The primary host verifies the exact session commit, performs any
|
|
81
|
-
integration, refreshes review if the reviewed checkout changed, settles the lease, and
|
|
82
|
-
completes the workflow.
|
|
83
|
-
|
|
84
|
-
Preserve worktrees by default. Remove one only when Git proves it is clean and
|
|
85
|
-
integrated. On interruption, record the current step and task as blocked, preserve
|
|
86
|
-
worktree and evidence, and resume the same run later.
|
|
87
|
-
|
|
88
|
-
Return outcome, changed paths, public seam, exact checks, review axes, commit and
|
|
89
|
-
session state, residual risk, and allowed transitions.
|
|
90
|
-
|
|
91
|
-
Never invoke the recommended capability here; wait for an explicit user invocation.
|
|
51
|
+
Return changed paths, public seam, exact checks, review result, checkpoint, commit,
|
|
52
|
+
session state, and residual risk. Do not invoke the next capability automatically.
|
|
@@ -1,54 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-doctor
|
|
3
|
-
description: Diagnose and mechanically recover Ultra schema,
|
|
3
|
+
description: Diagnose and mechanically recover Ultra schema, projection, session, archive, hook, and installed-asset faults. Use when authority is degraded, contradictory, or unavailable.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Diagnose before repair
|
|
7
7
|
|
|
8
|
-
Doctor owns deterministic health and supported recovery. It cannot
|
|
9
|
-
scope, invent evidence,
|
|
10
|
-
work complete.
|
|
8
|
+
Doctor owns deterministic health and supported recovery. It cannot choose product
|
|
9
|
+
scope, invent evidence, accept a baseline, resolve a user decision, or declare
|
|
10
|
+
semantic work complete.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Diagnose
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Call `ultra.doctor { repair: false }` and inspect:
|
|
15
15
|
|
|
16
|
-
- SQLite integrity, schema
|
|
17
|
-
- artifact
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
- decisions and checkpoint artifact freshness;
|
|
22
|
-
- projection jobs and event cursors;
|
|
23
|
-
- sessions, preserved worktrees, incidents, circuit state, and archive journals;
|
|
24
|
-
- external provider boundaries.
|
|
16
|
+
- SQLite integrity, schema, backups, WAL/SHM, and migration state;
|
|
17
|
+
- artifact ownership, digest freshness, edges, orphans, and duplicate authority;
|
|
18
|
+
- team-checkpoint ancestry and real concurrent record conflicts;
|
|
19
|
+
- projection jobs, sessions, leases, worktrees, and recovery journals;
|
|
20
|
+
- installed plugin assets, MCP startup, and hook paths.
|
|
25
21
|
|
|
26
|
-
An expected workflow pause
|
|
27
|
-
|
|
28
|
-
by doctor.
|
|
22
|
+
An expected workflow pause, editable draft, failed semantic checkpoint, or awaiting
|
|
23
|
+
owner decision is a warning, not corruption.
|
|
29
24
|
|
|
30
|
-
##
|
|
25
|
+
## Repair
|
|
31
26
|
|
|
32
|
-
With explicit repair
|
|
27
|
+
With explicit repair authority, call `ultra.doctor { repair: true }`. It may apply
|
|
28
|
+
backup-first schema migration, regenerate local projections, recover supported
|
|
29
|
+
journals, reconcile orphan sessions, and repair installed mechanical assets.
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- resume supported archive journals;
|
|
39
|
-
- recover missing workflow provenance as a blocked run requiring real evidence.
|
|
31
|
+
It may not manufacture semantic evidence, import or publish a team checkpoint, replace
|
|
32
|
+
a healthy baseline, resolve decisions, edit application code, or force a draft to
|
|
33
|
+
accepted. Use `ultra.sync` for reviewed checkpoint import/publish and
|
|
34
|
+
`workflow.abandon` through `ultra.record` for intentional draft cancellation.
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
Preserve corrupt DB/WAL/SHM and dirty worktrees. Never patch plugin cache files by
|
|
37
|
+
hand; reinstall through `ubp` and verify the installed manifest and hook targets.
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
After repair, rerun doctor read-only and verify backup paths, schema, installed hashes,
|
|
49
|
-
entry points, MCP startup, and hook smoke tests as applicable.
|
|
50
|
-
|
|
51
|
-
Return health first, failed checks, mechanical repairs performed, preserved recovery
|
|
52
|
-
paths, unresolved owners, and allowed transitions plus any unique required transition.
|
|
53
|
-
|
|
54
|
-
Never invoke the recommended capability here; wait for an explicit user invocation.
|
|
39
|
+
Rerun doctor read-only after repair. Report health, exact failed checks, backups,
|
|
40
|
+
repairs, preserved recovery paths, and remaining owner or semantic work. Do not invoke
|
|
41
|
+
another capability automatically.
|
|
@@ -1,85 +1,53 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-init
|
|
3
|
-
description: Create or recover Ultra project authority for a new repository, an existing codebase, or an older Ultra installation. Use when `.ultra` is absent, initialization is incomplete, or doctor reports a migration
|
|
3
|
+
description: Create or recover Ultra project authority for a new repository, an existing codebase, or an older Ultra installation. Use when `.ultra` is absent, initialization is incomplete, or doctor reports a migration fault.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Initialize project authority
|
|
7
7
|
|
|
8
|
-
Initialization
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Initialization creates the repository-local Ultra authority. It does not perform
|
|
9
|
+
research, accept a product baseline, choose a Change, or start another public
|
|
10
|
+
capability.
|
|
11
11
|
|
|
12
|
-
## Inspect
|
|
12
|
+
## Inspect and align
|
|
13
13
|
|
|
14
|
-
1.
|
|
15
|
-
monorepo boundaries, and current
|
|
16
|
-
2.
|
|
17
|
-
|
|
18
|
-
3.
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
1. Inspect the repository root, Git state, meaningful source, existing `.ultra`,
|
|
15
|
+
monorepo boundaries, and the current request.
|
|
16
|
+
2. When authority already exists, call `ultra.doctor { repair: false }` and preserve
|
|
17
|
+
healthy state. Never replace or delete it merely to obtain a clean init.
|
|
18
|
+
3. Classify the repository from evidence:
|
|
19
|
+
- `greenfield`: no meaningful delivered behavior exists;
|
|
20
|
+
- `brownfield`: source, runtime, API, data, deployment, or tests describe an
|
|
21
|
+
existing maintained system;
|
|
22
|
+
- `migrated`: older Ultra authority was preserved but is not yet a trusted baseline.
|
|
23
|
+
4. Ask the owner only when scope, healthy-authority replacement, destructive recovery,
|
|
24
|
+
or another material choice cannot be derived. Reuse explicit intent.
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
Read `../ultra-think/references/decision-dialogue.md` before asking a material
|
|
27
|
+
question.
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
- `brownfield`: source, runtime, API, data, deployment, or tests describe an existing
|
|
26
|
-
maintained system;
|
|
27
|
-
- `migrated`: older Ultra authority was preserved but is not a trusted baseline.
|
|
29
|
+
## Initialize once
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
user decision. Classification must not infer product scope, an MVP, or a release plan.
|
|
31
|
+
Call `ultra.record` with one entry:
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
```text
|
|
34
|
+
operation: task.init_project
|
|
35
|
+
data: target_dir, project_name, mode=auto, git_mode=auto, optional scope
|
|
36
|
+
idempotency_key: stable init attempt id
|
|
37
|
+
```
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
unresolved. Normalize clear intent already present in the request without asking again.
|
|
39
|
+
This stateless bootstrap is the only `ultra.record` operation allowed before
|
|
40
|
+
`state.db` exists. It must create or migrate `.ultra/.runtime/state.db`, preserve
|
|
41
|
+
existing artifacts and Git history, install only missing scaffold assets on resume,
|
|
42
|
+
validate or safely upgrade a legacy task ledger, and read back the result.
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
An unborn Git repository may require a local initial commit, but init never creates a
|
|
45
|
+
remote, tag, push, publish, or deployment. Corrupt DB/WAL/SHM and backups remain
|
|
46
|
+
preserved until an explicit recovery choice is made.
|
|
41
47
|
|
|
42
|
-
|
|
48
|
+
## Return control
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
The operation must:
|
|
50
|
-
|
|
51
|
-
- create or migrate `.ultra/.runtime/state.db` with a backup before schema migration;
|
|
52
|
-
- install only missing scaffold assets on resume;
|
|
53
|
-
- preserve existing artifacts and unrelated work;
|
|
54
|
-
- preserve an existing Git repository and HEAD;
|
|
55
|
-
- initialize Git and a safe `.gitignore` entry when Git is absent;
|
|
56
|
-
- report an unborn repository as `initial_commit_required` without manufacturing a
|
|
57
|
-
commit, remote, tag, or push;
|
|
58
|
-
- read back the created DB, classification, projection, and Git result before
|
|
59
|
-
completing the init workflow.
|
|
60
|
-
|
|
61
|
-
Projection-only projects must use the exact backup-first migration command returned by
|
|
62
|
-
the runtime. A migrated compatibility baseline requires a new brownfield adoption with
|
|
63
|
-
`replace_migrated: true`. Replacing a healthy baseline requires explicit replacement
|
|
64
|
-
authority. Corrupt DB, WAL, SHM, and backups must be preserved until the user chooses a
|
|
65
|
-
documented recovery operation.
|
|
66
|
-
|
|
67
|
-
## Completion and handoff
|
|
68
|
-
|
|
69
|
-
Initialization is complete when the init workflow is `completed`, the current schema is
|
|
70
|
-
healthy, the scaffold is readable, and repository classification and Git state are
|
|
71
|
-
durable. Research status may still be `not_started`; that is not incomplete init.
|
|
72
|
-
|
|
73
|
-
Read the returned `allowed_transitions` and `required_transition`:
|
|
74
|
-
|
|
75
|
-
- a required transition represents a hard recovery invariant and must be followed;
|
|
76
|
-
- otherwise the host model recommends among the allowed capabilities using the user's
|
|
77
|
-
goal and current evidence;
|
|
78
|
-
- never invoke another public Ultra workflow automatically; recommend the best allowed
|
|
79
|
-
capability and wait for an explicit user invocation.
|
|
80
|
-
|
|
81
|
-
Report classification, scope, schema and backup result, Git state, init workflow id,
|
|
82
|
-
baseline state, and allowed transitions. Do not claim that a baseline is ready until a
|
|
83
|
-
separate research/adoption workflow has recorded and converged it.
|
|
84
|
-
|
|
85
|
-
Never invoke the recommended capability here; wait for an explicit user invocation.
|
|
50
|
+
Report classification, scope, schema and backup result, Git state, imported team
|
|
51
|
+
checkpoint state, and any mechanical blocker. Recommend the next useful capability
|
|
52
|
+
from current evidence, usually `ultra-research`, `ultra-change`, `ultra-status`, or
|
|
53
|
+
`ultra-doctor`; do not invoke it automatically.
|