ultra-builder-pro-cli 0.15.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 +120 -1
- package/README.md +67 -30
- package/adapters/_shared/codex-assets.cjs +10 -5
- package/adapters/_shared/handbook.cjs +3 -2
- 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/commands/ultra-think.md +2 -2
- package/docs/AGENT-CONTEXT.md +38 -18
- package/docs/ARCHITECTURE.md +91 -13
- package/docs/LEGACY-CLI-CROSSWALK.md +163 -0
- package/docs/PLAN.zh-CN.md +19 -12
- package/docs/ROADMAP.md +5 -3
- package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
- package/docs/STATE-DB-ACCESS-POLICY.md +8 -6
- package/docs/USER-HANDBOOK-CONTRACT.md +8 -2
- package/docs/WORKFLOW-LIFECYCLE.md +179 -39
- package/hooks/pre_stop_check.py +3 -2
- package/mcp-server/lib/baseline-workflow.cjs +84 -16
- package/mcp-server/lib/change-workflow.cjs +107 -39
- package/mcp-server/lib/context-spine.cjs +215 -87
- package/mcp-server/lib/decision-dialogue.cjs +713 -0
- package/mcp-server/lib/doctor.cjs +9 -0
- 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 +23 -14
- package/mcp-server/lib/state-db.cjs +279 -9
- package/mcp-server/lib/state-ops.cjs +64 -1
- package/mcp-server/lib/workflow-state.cjs +313 -205
- package/mcp-server/server.cjs +112 -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 -65
- package/skills/ultra-deliver/SKILL.md +37 -58
- package/skills/ultra-dev/SKILL.md +55 -49
- package/skills/ultra-doctor/SKILL.md +44 -49
- package/skills/ultra-init/SKILL.md +78 -100
- package/skills/ultra-plan/SKILL.md +78 -79
- package/skills/ultra-research/SKILL.md +99 -98
- package/skills/ultra-review/SKILL.md +38 -47
- 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 -40
- package/skills/ultra-test/SKILL.md +61 -48
- package/skills/ultra-think/SKILL.md +47 -47
- package/skills/ultra-think/references/decision-dialogue.md +106 -0
- package/spec/cli-protocol.md +46 -2
- package/spec/mcp-tools.yaml +444 -29
- package/spec/schemas/delivery-report.v1.schema.json +1 -46
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/state-db.sql +66 -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 +34 -14
- package/ultra-tools/commands/system.cjs +2 -2
- package/ultra-tools/commands/task.cjs +3 -0
|
@@ -1,77 +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
|
-
2. Resume or start a
|
|
17
|
-
3. Require
|
|
18
|
-
|
|
19
|
-
`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`.
|
|
20
18
|
|
|
21
|
-
Evidence from another revision, task set,
|
|
22
|
-
approved break-glass incident follows only its recorded recovery contract.
|
|
19
|
+
Evidence from another revision, task set, or change is invalid.
|
|
23
20
|
|
|
24
|
-
## Reconcile
|
|
21
|
+
## Reconcile specifications
|
|
25
22
|
|
|
26
|
-
Resolve every specification-learning
|
|
27
|
-
|
|
28
|
-
accepted delta and documentation impact into baseline documents, or record an exact
|
|
29
|
-
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.
|
|
30
25
|
|
|
31
|
-
Read `references/baseline-reconciliation.md` and write the
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
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`.
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
record its immutable manifest as the `verify-candidate` output. Any edit invalidates
|
|
41
|
-
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`.
|
|
42
34
|
|
|
43
|
-
Call `change.converge
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
workflows and current artifacts. Resolve named blockers and rerun invalidated gates. Record
|
|
47
|
-
`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.
|
|
48
38
|
|
|
49
|
-
Call `change.archive` with the
|
|
50
|
-
|
|
51
|
-
Ordinary archive refreshes baseline revision and digests atomically and rolls back on
|
|
52
|
-
incomplete reconciliation. Record `archive-change`. For break-glass delivery, verify
|
|
53
|
-
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`.
|
|
54
41
|
|
|
55
|
-
|
|
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.
|
|
56
46
|
|
|
57
|
-
|
|
58
|
-
user's request, complete it with exactly one `release_authorization` decision containing
|
|
59
|
-
`authorized: false` and the reason. When explicitly authorized, record
|
|
60
|
-
`authorized: true`, `approved_by`, the exact release `scope`, and the reason; then
|
|
61
|
-
determine compatibility impact, update version and
|
|
62
|
-
changelog, rerun invalidated checks, create a non-force commit/tag, push, publish, and
|
|
63
|
-
verify remote commit, tag, release, and registry version independently.
|
|
47
|
+
## External effects
|
|
64
48
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
deployment action, rollback notes, and timestamp. The report authorization must match
|
|
71
|
-
the DB-recorded decision. Record `verify-delivery` with that
|
|
72
|
-
output and call `workflow.complete` only after the change is archived and local and
|
|
73
|
-
remote evidence agree for every authorized action. MCP derives the delivery summary
|
|
74
|
-
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.
|
|
75
54
|
|
|
76
|
-
Return
|
|
77
|
-
|
|
55
|
+
Return archive and baseline state, evidence digests, recovery notes, residual risks,
|
|
56
|
+
and allowed transitions.
|
|
@@ -1,58 +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
|
|
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
|
-
4.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`
|
|
40
|
-
|
|
41
|
-
|
|
6
|
+
# Implement one task
|
|
7
|
+
|
|
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.
|
|
10
|
+
|
|
11
|
+
## Bind and resume
|
|
12
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
Do not spawn recursively from a parent-owned worker session. Process exit is transport
|
|
24
|
+
evidence, never task completion.
|
|
25
|
+
|
|
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.
|
|
42
47
|
|
|
43
48
|
## Complete or recover
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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.
|
|
51
58
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
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.
|
|
56
62
|
|
|
57
|
-
Return
|
|
58
|
-
|
|
63
|
+
Return outcome, changed paths, public seam, exact checks, review axes, commit and
|
|
64
|
+
session state, residual risk, and allowed transitions.
|
|
@@ -1,55 +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
|
-
|
|
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
|
-
and a hook smoke test. Project doctor and installer doctor are separate authorities.
|
|
52
|
-
|
|
53
|
-
Return health first, failing authority checks, workflow warnings, backup/recovery
|
|
54
|
-
paths, whether repair ran, unresolved owners, and one exact next action. Do not edit
|
|
55
|
-
application code or external memory/graph providers through this Skill.
|
|
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.
|
|
11
|
+
|
|
12
|
+
## Read-only diagnosis
|
|
13
|
+
|
|
14
|
+
Run `system.doctor` without repair and inspect:
|
|
15
|
+
|
|
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.
|
|
23
|
+
|
|
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.
|
|
27
|
+
|
|
28
|
+
## Recovery boundary
|
|
29
|
+
|
|
30
|
+
With explicit repair authorization, `system.doctor` may:
|
|
31
|
+
|
|
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.
|
|
38
|
+
|
|
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.
|
|
41
|
+
|
|
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.
|
|
45
|
+
|
|
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.
|
|
@@ -1,104 +1,82 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra-init
|
|
3
|
-
description:
|
|
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 or initialization fault.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Ultra
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
research
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- Record deterministic blockers on the current workflow; never create a parallel run.
|
|
85
|
-
- Use `system.doctor` repair only for supported schema, projection, session, incident,
|
|
86
|
-
archive, or legacy workflow-provenance recovery. A recovered legacy change workflow
|
|
87
|
-
remains blocked for real baseline evidence; repair cannot invent research or approve
|
|
88
|
-
a baseline.
|
|
89
|
-
- Treat context budgets as advisory. Missing authority, evidence, output, or approval
|
|
90
|
-
is blocking.
|
|
91
|
-
- Store only references to external memory and code-graph providers.
|
|
92
|
-
|
|
93
|
-
## Completion
|
|
94
|
-
|
|
95
|
-
Read `baseline.get`, `workflow.get`, and `system.doctor` after convergence. Report
|
|
96
|
-
classification evidence, scope, revision, worktree snapshot, migration backups,
|
|
97
|
-
research run and output health, verification, gaps, approval, and one route.
|
|
98
|
-
|
|
99
|
-
Initialization is complete only when the baseline is `ready`, the init workflow is
|
|
100
|
-
`completed`, the research workflow is `completed`, and
|
|
101
|
-
`baseline.research_run_id` names that exact research run with healthy outputs. Route
|
|
102
|
-
every newly converged or already initialized baseline through `ultra-change`; planning
|
|
103
|
-
starts only after that command persists a complete Change Contract, profile, and
|
|
104
|
-
research disposition. Otherwise return the exact current workflow step or blocker.
|
|
6
|
+
# Initialize project authority
|
|
7
|
+
|
|
8
|
+
Initialization is a bounded setup capability. It creates or repairs the repository and
|
|
9
|
+
Ultra authority; it does not perform product research, approve a baseline, or choose
|
|
10
|
+
the next semantic workflow.
|
|
11
|
+
|
|
12
|
+
## Inspect before mutation
|
|
13
|
+
|
|
14
|
+
1. Identify the repository root, existing `.ultra` state, Git state, meaningful source,
|
|
15
|
+
monorepo boundaries, and current owner request.
|
|
16
|
+
2. If `.ultra/state.db` exists, run `system.doctor` read-only and resume with
|
|
17
|
+
`task.init_project` only when its report permits it.
|
|
18
|
+
3. Otherwise call `task.init_project` with `mode: "auto"`, the project name, and an
|
|
19
|
+
explicit scope only when the repository contains multiple plausible roots.
|
|
20
|
+
4. Leave `git_mode` as `auto` unless the user explicitly requires a non-Git workspace.
|
|
21
|
+
|
|
22
|
+
Use repository evidence to classify:
|
|
23
|
+
|
|
24
|
+
- `greenfield`: no meaningful delivered application behavior is present;
|
|
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.
|
|
28
|
+
|
|
29
|
+
The model may override an automatic classification only with evidence or an explicit
|
|
30
|
+
user decision. Classification must not infer product scope, an MVP, or a release plan.
|
|
31
|
+
|
|
32
|
+
## Interaction boundary
|
|
33
|
+
|
|
34
|
+
Read `../ultra-think/references/decision-dialogue.md` before asking a material question.
|
|
35
|
+
Inspect observable facts yourself. Use the host's native question UI when available and
|
|
36
|
+
plain direct interaction otherwise. Ask only when repository scope, replacement of
|
|
37
|
+
healthy authority, destructive recovery, or another material owner decision is truly
|
|
38
|
+
unresolved. Normalize clear intent already present in the request without asking again.
|
|
39
|
+
|
|
40
|
+
## Deterministic initialization contract
|
|
41
|
+
|
|
42
|
+
`task.init_project` owns these steps:
|
|
43
|
+
|
|
44
|
+
1. `inspect-authority`
|
|
45
|
+
2. `classify-repository`
|
|
46
|
+
3. `scaffold-authority`
|
|
47
|
+
4. `verify-initialization`
|
|
48
|
+
|
|
49
|
+
The operation must:
|
|
50
|
+
|
|
51
|
+
- create or migrate `.ultra/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
|
+
- start `ultra-research` only when the user invoked it or the host selects it after init.
|
|
79
|
+
|
|
80
|
+
Report classification, scope, schema and backup result, Git state, init workflow id,
|
|
81
|
+
baseline state, and allowed transitions. Do not claim that a baseline is ready until a
|
|
82
|
+
separate research/adoption workflow has recorded and converged it.
|