ultra-builder-pro-cli 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ultra-template/docs/research/README.md +21 -44
- package/.ultra-template/specs/architecture.md +54 -223
- package/.ultra-template/specs/discovery.md +41 -228
- package/.ultra-template/specs/product.md +44 -200
- package/.ultra-template/tasks/contexts/TEMPLATE.md +36 -0
- package/.ultra-template/tasks/tasks.json +6 -0
- package/CHANGELOG.md +94 -1
- package/README.md +37 -9
- package/adapters/_shared/codex-assets.cjs +1 -1
- package/adapters/_shared/handbook.cjs +5 -4
- package/adapters/_shared/tests/handbook.test.cjs +4 -0
- package/adapters/opencode.js +8 -2
- package/adapters/tests/codex.test.cjs +10 -2
- package/adapters/tests/kimi-hook.test.cjs +1 -1
- package/adapters/tests/opencode.test.cjs +36 -1
- package/commands/ultra-init.md +3 -3
- package/docs/AGENT-CONTEXT.md +17 -8
- package/docs/ARCHITECTURE.md +51 -8
- package/docs/PLAN.zh-CN.md +9 -6
- package/docs/ROADMAP.md +5 -3
- package/docs/RUNTIME-COMPAT-MATRIX.md +8 -5
- package/docs/STATE-DB-ACCESS-POLICY.md +19 -13
- package/docs/USER-HANDBOOK-CONTRACT.md +9 -5
- package/hooks/README.md +4 -3
- package/hooks/adapters/codex.py +1 -1
- package/hooks/adapters/kimi.py +1 -1
- package/hooks/context_spine.py +153 -16
- package/hooks/health_check.py +11 -0
- package/hooks/pre_stop_check.py +6 -5
- package/mcp-server/lib/archive-journal.cjs +192 -0
- package/mcp-server/lib/archive-journal.test.cjs +35 -0
- package/mcp-server/lib/baseline-workflow.cjs +781 -0
- package/mcp-server/lib/baseline-workflow.test.cjs +477 -0
- package/mcp-server/lib/change-workflow.cjs +256 -85
- package/mcp-server/lib/change-workflow.test.cjs +436 -6
- package/mcp-server/lib/context-spine.cjs +74 -9
- package/mcp-server/lib/context-spine.test.cjs +20 -0
- package/mcp-server/lib/doctor.cjs +28 -1
- package/mcp-server/lib/doctor.test.cjs +63 -1
- package/mcp-server/lib/init-project.cjs +334 -16
- package/mcp-server/lib/provider-refs.cjs +42 -0
- package/mcp-server/lib/spec-learning.test.cjs +5 -0
- package/mcp-server/lib/state-authority.cjs +9 -3
- package/mcp-server/lib/state-db.cjs +202 -21
- package/mcp-server/lib/state-db.test.cjs +140 -3
- package/mcp-server/lib/state-ops.cjs +68 -6
- package/mcp-server/lib/task-expander.cjs +7 -1
- package/mcp-server/lib/task-expander.test.cjs +71 -0
- package/mcp-server/server.cjs +62 -6
- package/mcp-server/tests/init-project.test.cjs +216 -9
- package/mcp-server/tests/migrate.test.cjs +33 -0
- package/mcp-server/tests/server-contract.test.cjs +478 -3
- package/mcp-server/tests/state-db.test.cjs +23 -2
- package/mcp-server/tests/state-ops.test.cjs +108 -0
- package/package.json +1 -1
- package/skills/ultra-change/SKILL.md +32 -13
- package/skills/ultra-deliver/SKILL.md +19 -5
- package/skills/ultra-dev/SKILL.md +8 -2
- package/skills/ultra-doctor/SKILL.md +30 -9
- package/skills/ultra-init/SKILL.md +107 -66
- package/skills/ultra-init/references/brownfield-adoption.md +93 -0
- package/skills/ultra-plan/SKILL.md +15 -5
- package/skills/ultra-research/SKILL.md +17 -5
- package/skills/ultra-status/SKILL.md +15 -6
- package/spec/cli-protocol.md +15 -1
- package/spec/mcp-tools.yaml +316 -11
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/state-db.sql +44 -2
- package/ultra-tools/cli.cjs +9 -5
- package/ultra-tools/commands/migrate.cjs +62 -36
- package/ultra-tools/commands/status.cjs +29 -2
- package/ultra-tools/commands/system.cjs +340 -6
- package/ultra-tools/commands/task.cjs +11 -2
- package/ultra-tools/status-command.test.cjs +49 -0
- package/ultra-tools/system-command.test.cjs +256 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Brownfield adoption
|
|
2
|
+
|
|
3
|
+
Execute this procedure for a detected brownfield repository, a migrated compatibility
|
|
4
|
+
baseline, or an existing adoption in `adopting` or `blocked` state.
|
|
5
|
+
|
|
6
|
+
## Bind the repository boundary
|
|
7
|
+
|
|
8
|
+
Record the repository root, selected scope, workspace roots, branch, HEAD, dirty files,
|
|
9
|
+
generated and vendored exclusions, manifests, verification commands, and public seams.
|
|
10
|
+
Use `.` for a whole-repository adoption. Use selected workspace roots only when the
|
|
11
|
+
user's requested ownership is narrower than the monorepo.
|
|
12
|
+
|
|
13
|
+
The authoritative worktree snapshot contains only selected-scope paths. Report dirty
|
|
14
|
+
files outside that scope separately as repository context, but do not include them in
|
|
15
|
+
the baseline digest. Require `accept_dirty_worktree: true` only after the owner confirms
|
|
16
|
+
the exact in-scope `worktree_files` returned by the server.
|
|
17
|
+
|
|
18
|
+
## Build the evidence model
|
|
19
|
+
|
|
20
|
+
Inspect the maintained system through its live boundaries:
|
|
21
|
+
|
|
22
|
+
- product behavior, actors, entry points, and public acceptance;
|
|
23
|
+
- runtime modules, consumers, data flow, persistence, and authority;
|
|
24
|
+
- APIs, events, integrations, permissions, security, and failure paths;
|
|
25
|
+
- build, test, lint, typecheck, deployment, migration, observability, and recovery;
|
|
26
|
+
- maintained documents and every detected source-to-document conflict.
|
|
27
|
+
|
|
28
|
+
Classify each material statement as `Observed`, `Verified`, `Decided`, or `Unknown`.
|
|
29
|
+
Record document/source conflicts as drift. Keep provider payloads outside Ultra and
|
|
30
|
+
record only bounded metadata references.
|
|
31
|
+
|
|
32
|
+
## Write baseline artifacts
|
|
33
|
+
|
|
34
|
+
Update `.ultra/specs/product.md` with current delivered behavior and acceptance. Update
|
|
35
|
+
`.ultra/specs/architecture.md` with real boundaries, owners, writers, consumers,
|
|
36
|
+
consistency rules, permissions, failures, and recovery. Use `discovery.md` for scope
|
|
37
|
+
evidence, decisions, and unresolved questions.
|
|
38
|
+
|
|
39
|
+
Capture current facts without redesigning the application or manufacturing product
|
|
40
|
+
narratives that are absent from evidence.
|
|
41
|
+
|
|
42
|
+
## Run characterization verification
|
|
43
|
+
|
|
44
|
+
Run the repository's existing verification commands. Record each result as `pass`,
|
|
45
|
+
`known_red`, or `not_run`. A known-red item needs evidence and a rationale; a missing
|
|
46
|
+
command is not a passing result. Record a characterization gap for a critical public
|
|
47
|
+
seam that has no stable verification signal; create its ordinary task only after the
|
|
48
|
+
baseline is ready.
|
|
49
|
+
|
|
50
|
+
## Maintain the gap ledger
|
|
51
|
+
|
|
52
|
+
Record every adoption gap with a stable id, evidence references, owner, blocking flag,
|
|
53
|
+
and one category:
|
|
54
|
+
|
|
55
|
+
- `baseline_blocker`: prevents trustworthy adoption;
|
|
56
|
+
- `documentation_drift`: maintained prose conflicts with observed behavior;
|
|
57
|
+
- `known_defect`: reproducible incorrect behavior;
|
|
58
|
+
- `technical_debt`: accepted maintainability or quality cost;
|
|
59
|
+
- `unknown`: evidence is insufficient;
|
|
60
|
+
- `future_change`: desired behavior outside the current baseline.
|
|
61
|
+
|
|
62
|
+
Use `open` for unresolved gaps, `accepted` for owner-accepted non-blocking debt,
|
|
63
|
+
`resolved` when evidence closes the gap, and `deferred` for explicitly postponed
|
|
64
|
+
non-blocking work. Every open `baseline_blocker` remains blocking. Do not convert the
|
|
65
|
+
ledger into hundreds of application tasks.
|
|
66
|
+
|
|
67
|
+
## Record authority
|
|
68
|
+
|
|
69
|
+
Call `baseline.record` with full replacement arrays for:
|
|
70
|
+
|
|
71
|
+
- scope and repository revision;
|
|
72
|
+
- repository classification;
|
|
73
|
+
- product and architecture specification paths;
|
|
74
|
+
- bounded source, documentation, runtime, test, deployment, or external references;
|
|
75
|
+
- verification results;
|
|
76
|
+
- blocking and non-blocking unknowns;
|
|
77
|
+
- the complete gap ledger;
|
|
78
|
+
- external provider metadata references, when supplied.
|
|
79
|
+
|
|
80
|
+
Use the server-returned revision, branch, worktree digest, and specification digests.
|
|
81
|
+
|
|
82
|
+
## Obtain approval and converge
|
|
83
|
+
|
|
84
|
+
Present scope, observed behavior, drift, known-red verification, unknowns, gaps, dirty
|
|
85
|
+
worktree state, and material decisions to the owner. Call `baseline.converge` only after
|
|
86
|
+
explicit approval. Set `accept_known_red` and `accept_dirty_worktree` only for the exact
|
|
87
|
+
items the owner accepted.
|
|
88
|
+
|
|
89
|
+
Resolve returned blockers through evidence or an owner decision, record the replacement
|
|
90
|
+
snapshot, and retry. Adoption is complete only when `baseline.get` is `ready` and
|
|
91
|
+
current, the gap ledger has no open blocker, and project doctor has no authority
|
|
92
|
+
failure. Route new work through `ultra-change`; route already accepted planned work
|
|
93
|
+
through `ultra-plan`.
|
|
@@ -13,6 +13,13 @@ Markdown are generated projections.
|
|
|
13
13
|
|
|
14
14
|
Start with a state-backed MCP read. If state or schema health blocks access, stop and
|
|
15
15
|
route to `ultra-doctor`. Never read or write `.ultra/tasks/tasks.json` as a fallback.
|
|
16
|
+
Call `baseline.get`. Initial product planning is blocked until the baseline is
|
|
17
|
+
`ready` and current; route its missing, adopting, blocked, or stale state to
|
|
18
|
+
`ultra-init`. Planning an already active bounded change may continue with the
|
|
19
|
+
baseline condition recorded as a warning. Ordinary convergence still requires
|
|
20
|
+
approved adoption, and archive atomically reconciles revision and specification
|
|
21
|
+
drift. An approved break-glass incident follows its recorded recovery contract and
|
|
22
|
+
creates a blocking reconciliation gap at archive.
|
|
16
23
|
|
|
17
24
|
Choose one input:
|
|
18
25
|
|
|
@@ -30,8 +37,10 @@ current evidence. A material unresolved assumption blocks persistence.
|
|
|
30
37
|
2. Prefer a walking skeleton or `tracer_bullet` before horizontal layers.
|
|
31
38
|
3. Give each task one outcome, bounded ownership, explicit dependencies, required
|
|
32
39
|
references, and one deterministic verification command.
|
|
33
|
-
4. Use the context budget
|
|
34
|
-
|
|
40
|
+
4. Use the context budget as an attention signal. Prefer bounded excerpts, direct
|
|
41
|
+
reads, or a smaller slice, but keep necessary files when correctness requires them.
|
|
42
|
+
Budget overflow is a warning, never a reason to inflate a threshold or manufacture
|
|
43
|
+
a smaller but incomplete contract.
|
|
35
44
|
5. Add integration checkpoints at actual boundaries, not after arbitrary task counts.
|
|
36
45
|
6. Put validation, errors, recovery, documentation, and migrations in the task that
|
|
37
46
|
owns the behavior.
|
|
@@ -56,11 +65,12 @@ id when applicable.
|
|
|
56
65
|
|
|
57
66
|
## PRD mode
|
|
58
67
|
|
|
59
|
-
1. Call `task.parse_prd` with `dry_run: true
|
|
68
|
+
1. Call `task.parse_prd` with `dry_run: true` and the active `change_id` when
|
|
69
|
+
applicable.
|
|
60
70
|
2. Show the proposed slices, topology, conflict surface, and cost estimate.
|
|
61
71
|
3. Require explicit approval; rejection performs no state write.
|
|
62
|
-
4. On approval, repeat with `dry_run: false
|
|
63
|
-
dry-run and persisted task identities agree.
|
|
72
|
+
4. On approval, repeat with `dry_run: false` and the same change ownership, export
|
|
73
|
+
the plan, and verify that the dry-run and persisted task identities agree.
|
|
64
74
|
|
|
65
75
|
## Completion gate
|
|
66
76
|
|
|
@@ -10,8 +10,8 @@ decision. Do not force a fixed discovery ceremony onto a well-defined change.
|
|
|
10
10
|
|
|
11
11
|
## Preflight
|
|
12
12
|
|
|
13
|
-
1. Require an initialized `.ultra/specs/` directory
|
|
14
|
-
absent.
|
|
13
|
+
1. Require an initialized `.ultra/specs/` directory and call `baseline.get`. Route to
|
|
14
|
+
`ultra-init` when state or the baseline is absent. Preserve its mode and id.
|
|
15
15
|
2. Read the current specification files and repository evidence before asking the
|
|
16
16
|
user to repeat known facts.
|
|
17
17
|
3. Define the intended deliverable, unresolved decisions, and evidence standard.
|
|
@@ -50,7 +50,19 @@ default.
|
|
|
50
50
|
open questions. Do not duplicate the same narrative across several files.
|
|
51
51
|
5. Validate cross-document consistency and trace each required behavior from problem
|
|
52
52
|
or constraint to acceptance and architecture.
|
|
53
|
-
6. Use `references/synthesis.md` for the completion check
|
|
53
|
+
6. Use `references/synthesis.md` for the completion check.
|
|
54
|
+
7. Record unresolved evidence as the baseline gap ledger: `baseline_blocker`,
|
|
55
|
+
`documentation_drift`, `known_defect`, `technical_debt`, `unknown`, or
|
|
56
|
+
`future_change`. Keep accepted non-blocking work out of the implementation backlog
|
|
57
|
+
until the owner selects it.
|
|
58
|
+
8. Call `baseline.record` with the complete current specification list, bounded evidence
|
|
59
|
+
references, actual verification results, provider metadata, explicit unknowns,
|
|
60
|
+
classification, and the full gap ledger. Use the returned repository revision for
|
|
61
|
+
convergence.
|
|
62
|
+
9. Present the baseline, open gaps, dirty-worktree state, and any known-red verification
|
|
63
|
+
to the owner. After explicit approval, call `baseline.converge`, setting acceptance
|
|
64
|
+
flags only for the exact known-red or dirty snapshot approved by the owner. Resolve
|
|
65
|
+
deterministic blockers before routing.
|
|
54
66
|
|
|
55
67
|
## Completion gate
|
|
56
68
|
|
|
@@ -59,5 +71,5 @@ material decision is recorded, required acceptance is testable, architecture res
|
|
|
59
71
|
known constraints, and unresolved items are either blocking or explicitly outside the
|
|
60
72
|
accepted scope.
|
|
61
73
|
|
|
62
|
-
Route a
|
|
63
|
-
|
|
74
|
+
Route a converged baseline to `ultra-plan`. Do not create business tasks, write raw
|
|
75
|
+
SQLite, or maintain a second condensed specification that can drift from the baseline.
|
|
@@ -12,12 +12,14 @@ authoritative; reports and Markdown are evidence or projections.
|
|
|
12
12
|
|
|
13
13
|
1. Call `system.doctor` in read-only mode. If authority is unhealthy, route only to
|
|
14
14
|
`ultra-doctor` and include the blocking diagnostic.
|
|
15
|
-
2. Call `
|
|
16
|
-
|
|
17
|
-
3. Call `
|
|
18
|
-
|
|
15
|
+
2. Call `baseline.get` for mode, lifecycle status, repository revision, branch,
|
|
16
|
+
worktree snapshot, specification digest health, gap ledger, and adoption blockers.
|
|
17
|
+
3. Call `change.breadcrumb` for the active change, task, role, gate, readiness,
|
|
18
|
+
blockers, advisory warnings, staleness, and next action.
|
|
19
|
+
4. Call `task.list` and `session.list` for progress and active execution details.
|
|
20
|
+
5. Read test and delivery reports only when present, and mark a report stale when its
|
|
19
21
|
HEAD differs from the current checkout.
|
|
20
|
-
|
|
22
|
+
6. Read Git branch, HEAD, and worktree status without mutation.
|
|
21
23
|
|
|
22
24
|
If MCP task or change state is unavailable, label that panel unavailable. Never fall
|
|
23
25
|
back to generated task JSON, context frontmatter, or raw SQLite.
|
|
@@ -28,7 +30,12 @@ Follow the breadcrumb's primary route and return one action, not a menu:
|
|
|
28
30
|
|
|
29
31
|
- unhealthy authority: `ultra-doctor`;
|
|
30
32
|
- missing Ultra project: `ultra-init`;
|
|
31
|
-
-
|
|
33
|
+
- projection-only authority conflict: run the exact supported import command from the
|
|
34
|
+
MCP error, then `ultra-init`;
|
|
35
|
+
- migrated or missing baseline evidence with no active change: `ultra-init`, then
|
|
36
|
+
`ultra-research` or `ultra-plan` according to the gap;
|
|
37
|
+
- baseline or context-budget warning during an active change: keep the current route
|
|
38
|
+
and surface the warning; do not turn it into a refusal;
|
|
32
39
|
- blocked or stale context: the workflow named by the breadcrumb;
|
|
33
40
|
- ready implementation task: `ultra-dev <task-id>`;
|
|
34
41
|
- completed tasks with missing or stale test evidence: `ultra-test`;
|
|
@@ -45,7 +52,9 @@ Use a compact shape:
|
|
|
45
52
|
```text
|
|
46
53
|
Ultra: <healthy|degraded> · <branch>@<head> · worktree <clean|dirty>
|
|
47
54
|
Position: change=<id|none> task=<id|none> role=<role> gate=<gate>
|
|
55
|
+
Baseline: <greenfield|brownfield|migrated>/<status> revision=<revision|none> gaps=<open>/<blocking>
|
|
48
56
|
Readiness: <ready|blocked|stale> — <blockers or none>
|
|
57
|
+
Warnings: <advisory conditions or none>
|
|
49
58
|
Progress: <completed>/<total>; sessions=<active count>
|
|
50
59
|
Evidence: tests=<fresh|stale|missing>; delivery=<fresh|stale|missing>
|
|
51
60
|
Next: <one exact action>
|
package/spec/cli-protocol.md
CHANGED
|
@@ -100,6 +100,10 @@ as a fallback unless `ultra-tools <family> --help` lists it.
|
|
|
100
100
|
| `session.admission_check` | `session admission` | 4.5 | any |
|
|
101
101
|
| `session.heartbeat` | `session heartbeat` | 4.5 | mcp |
|
|
102
102
|
| `session.subscribe_events`| `session subscribe` | 4.5 | any |
|
|
103
|
+
| `baseline.start` | `baseline start` | 11 | mcp |
|
|
104
|
+
| `baseline.record` | `baseline record` | 11 | mcp |
|
|
105
|
+
| `baseline.get` | `baseline get` | 11 | any |
|
|
106
|
+
| `baseline.converge` | `baseline converge` | 11 | mcp |
|
|
103
107
|
| `change.create` | `change create` | 9 | mcp |
|
|
104
108
|
| `change.update` | `change update` | 9 | mcp |
|
|
105
109
|
| `change.get` | `change get` | 9 | any |
|
|
@@ -116,10 +120,20 @@ as a fallback unless `ultra-tools <family> --help` lists it.
|
|
|
116
120
|
|
|
117
121
|
Current executable maintenance surfaces are `task init-project`,
|
|
118
122
|
`session close|get|list|admission|heartbeat|subscribe|reap`, `status`, `db`,
|
|
119
|
-
`migrate`, and `legacy-memory`. In particular, `task create|update|list|get`
|
|
123
|
+
`migrate`, `system doctor|restore|rebaseline`, and `legacy-memory`. In particular, `task create|update|list|get`
|
|
120
124
|
and all `change` lifecycle verbs are not CLI fallbacks. Change state must use
|
|
121
125
|
the live MCP server; `system doctor` may additionally be exposed by the
|
|
122
126
|
maintenance CLI because it is the recovery path when MCP startup is degraded.
|
|
127
|
+
`task init-project --resume` preserves existing `.ultra` files and installs only
|
|
128
|
+
missing current scaffold assets. Projection-only state uses the supported
|
|
129
|
+
`migrate --from=4.4 --to=4.5` or `--from=4.5 --to=12.0` transition before resume.
|
|
130
|
+
`system doctor --repair` applies supported schema upgrades with a pre-migration
|
|
131
|
+
backup before mechanical recovery.
|
|
132
|
+
`system restore` requires the exact `REPLACE_CORRUPT_ULTRA_STATE` confirmation and a
|
|
133
|
+
verified database inside `.ultra/backups`; it quarantines the corrupt state before
|
|
134
|
+
atomic replacement. `system rebaseline` requires the exact
|
|
135
|
+
`REBASELINE_CORRUPT_ULTRA_STATE` confirmation and preserves corrupt state plus the
|
|
136
|
+
legacy task projection before starting a new brownfield adoption.
|
|
123
137
|
The full access policy lives in
|
|
124
138
|
`docs/STATE-DB-ACCESS-POLICY.md` (Phase 2.2 / R25).
|
|
125
139
|
|