ultra-builder-pro-cli 0.14.0 → 0.16.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.
Files changed (163) hide show
  1. package/.ultra-template/docs/research/README.md +11 -7
  2. package/.ultra-template/specs/architecture.md +36 -36
  3. package/.ultra-template/specs/discovery.md +46 -33
  4. package/.ultra-template/specs/product.md +38 -29
  5. package/.ultra-template/specs/research-distillate.md +48 -0
  6. package/.ultra-template/tasks/contexts/TEMPLATE.md +11 -28
  7. package/CHANGELOG.md +77 -1
  8. package/README.md +46 -24
  9. package/adapters/_shared/codex-assets.cjs +6 -2
  10. package/adapters/_shared/file-ops.cjs +6 -2
  11. package/adapters/_shared/handbook.cjs +2 -1
  12. package/adapters/claude.js +3 -2
  13. package/adapters/codex.js +1 -0
  14. package/adapters/kimi.js +3 -2
  15. package/adapters/opencode.js +3 -2
  16. package/agents/review-coordinator.md +9 -6
  17. package/commands/ultra-change.md +1 -1
  18. package/commands/ultra-plan.md +1 -1
  19. package/commands/ultra-research.md +1 -1
  20. package/commands/ultra-think.md +2 -2
  21. package/docs/AGENT-CONTEXT.md +43 -19
  22. package/docs/ARCHITECTURE.md +54 -13
  23. package/docs/PLAN.zh-CN.md +4 -2
  24. package/docs/ROADMAP.md +10 -4
  25. package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
  26. package/docs/STATE-DB-ACCESS-POLICY.md +33 -29
  27. package/docs/USER-HANDBOOK-CONTRACT.md +8 -2
  28. package/docs/WORKFLOW-LIFECYCLE.md +342 -0
  29. package/hooks/README.md +6 -1
  30. package/hooks/health_check.py +12 -3
  31. package/hooks/subagent_tracker.py +52 -77
  32. package/mcp-server/hook-event.cjs +34 -0
  33. package/mcp-server/lib/archive-journal.cjs +17 -5
  34. package/mcp-server/lib/baseline-workflow.cjs +158 -18
  35. package/mcp-server/lib/change-workflow.cjs +598 -85
  36. package/mcp-server/lib/context-spine.cjs +305 -25
  37. package/mcp-server/lib/decision-dialogue.cjs +713 -0
  38. package/mcp-server/lib/doctor.cjs +42 -3
  39. package/mcp-server/lib/init-project.cjs +210 -16
  40. package/mcp-server/lib/plan-store.cjs +4 -1
  41. package/mcp-server/lib/pricing.cjs +7 -10
  42. package/mcp-server/lib/project-breadcrumb.cjs +15 -0
  43. package/mcp-server/lib/projector.cjs +57 -3
  44. package/mcp-server/lib/spec-learning.cjs +79 -2
  45. package/mcp-server/lib/state-db.cjs +168 -8
  46. package/mcp-server/lib/state-ops.cjs +160 -9
  47. package/mcp-server/lib/workflow-state.cjs +2305 -0
  48. package/mcp-server/server.cjs +215 -15
  49. package/orchestrator/daemon.cjs +1 -2
  50. package/orchestrator/dispatch-rules.cjs +5 -31
  51. package/orchestrator/planner/plan-builder.cjs +21 -12
  52. package/package.json +13 -3
  53. package/skills/ultra-change/SKILL.md +94 -80
  54. package/skills/ultra-change/references/change-contract.md +36 -0
  55. package/skills/ultra-deliver/SKILL.md +76 -79
  56. package/skills/ultra-deliver/references/baseline-reconciliation.md +20 -0
  57. package/skills/ultra-dev/SKILL.md +62 -59
  58. package/skills/ultra-doctor/SKILL.md +61 -82
  59. package/skills/ultra-init/SKILL.md +101 -103
  60. package/skills/ultra-init/references/brownfield-adoption.md +2 -2
  61. package/skills/ultra-plan/SKILL.md +99 -85
  62. package/skills/ultra-plan/references/semantic-preflight.md +18 -0
  63. package/skills/ultra-research/SKILL.md +102 -60
  64. package/skills/ultra-research/references/00-problem-validation.md +36 -0
  65. package/skills/ultra-research/references/01-opportunity-discovery.md +33 -0
  66. package/skills/ultra-research/references/02-market-assessment.md +30 -0
  67. package/skills/ultra-research/references/03-competitive-landscape.md +31 -0
  68. package/skills/ultra-research/references/04-product-strategy.md +32 -0
  69. package/skills/ultra-research/references/05-assumptions-validation.md +31 -0
  70. package/skills/ultra-research/references/10-user-personas.md +29 -0
  71. package/skills/ultra-research/references/11-user-scenarios.md +28 -0
  72. package/skills/ultra-research/references/20-user-stories.md +30 -0
  73. package/skills/ultra-research/references/21-features-scope.md +29 -0
  74. package/skills/ultra-research/references/22-success-metrics.md +28 -0
  75. package/skills/ultra-research/references/30-architecture-context.md +30 -0
  76. package/skills/ultra-research/references/31-solution-strategy.md +28 -0
  77. package/skills/ultra-research/references/32-building-blocks.md +28 -0
  78. package/skills/ultra-research/references/40-deployment.md +29 -0
  79. package/skills/ultra-research/references/41-quality-risks.md +28 -0
  80. package/skills/ultra-research/references/99-synthesis.md +35 -0
  81. package/skills/ultra-review/SKILL.md +63 -73
  82. package/skills/ultra-review/references/review-modes.md +27 -0
  83. package/skills/ultra-review/references/unified-schema.md +25 -0
  84. package/skills/ultra-review/scripts/review_wait.py +40 -3
  85. package/skills/ultra-status/SKILL.md +41 -41
  86. package/skills/ultra-test/SKILL.md +54 -55
  87. package/skills/ultra-think/SKILL.md +26 -12
  88. package/skills/ultra-think/references/decision-dialogue.md +130 -0
  89. package/skills/ultra-verify/SKILL.md +1 -1
  90. package/skills/ultra-verify/references/{confidence-system.md → evidence-status.md} +3 -3
  91. package/spec/cli-protocol.md +17 -3
  92. package/spec/mcp-tools.yaml +683 -64
  93. package/spec/schemas/baseline-reconciliation.v1.schema.json +73 -0
  94. package/spec/schemas/delivery-report.v1.schema.json +111 -0
  95. package/spec/schemas/mcp-tools.schema.json +1 -1
  96. package/spec/schemas/state-db.sql +140 -1
  97. package/spec/schemas/tasks.v4.5.schema.json +8 -1
  98. package/spec/schemas/test-report.v1.schema.json +194 -0
  99. package/ultra-tools/cli.cjs +1 -1
  100. package/ultra-tools/commands/migrate.cjs +3 -3
  101. package/ultra-tools/commands/status.cjs +228 -12
  102. package/.ultra-template/delivery-report.json +0 -9
  103. package/.ultra-template/test-report.json +0 -8
  104. package/adapters/_shared/tests/file-ops.test.cjs +0 -54
  105. package/adapters/_shared/tests/frontmatter.test.cjs +0 -47
  106. package/adapters/_shared/tests/handbook.test.cjs +0 -101
  107. package/adapters/_shared/tests/path-rewrite.test.cjs +0 -60
  108. package/adapters/_shared/tests/provenance.test.cjs +0 -133
  109. package/adapters/_shared/tests/resolve-target.test.cjs +0 -75
  110. package/adapters/_shared/tests/runtime-assets.test.cjs +0 -149
  111. package/adapters/_shared/tests/settings-merge.test.cjs +0 -85
  112. package/adapters/_shared/tests/validate.test.cjs +0 -30
  113. package/adapters/tests/claude.test.cjs +0 -138
  114. package/adapters/tests/codex-hook.test.cjs +0 -142
  115. package/adapters/tests/codex.test.cjs +0 -430
  116. package/adapters/tests/kimi-hook.test.cjs +0 -149
  117. package/adapters/tests/kimi.test.cjs +0 -259
  118. package/adapters/tests/opencode.test.cjs +0 -357
  119. package/mcp-server/lib/archive-journal.test.cjs +0 -35
  120. package/mcp-server/lib/baseline-workflow.test.cjs +0 -477
  121. package/mcp-server/lib/change-workflow.test.cjs +0 -971
  122. package/mcp-server/lib/context-spine.test.cjs +0 -93
  123. package/mcp-server/lib/doctor.test.cjs +0 -148
  124. package/mcp-server/lib/plan-store.test.cjs +0 -132
  125. package/mcp-server/lib/prd-parser.test.cjs +0 -82
  126. package/mcp-server/lib/project-breadcrumb.test.cjs +0 -112
  127. package/mcp-server/lib/runtime-state.test.cjs +0 -92
  128. package/mcp-server/lib/spec-learning.test.cjs +0 -67
  129. package/mcp-server/lib/state-db.test.cjs +0 -314
  130. package/mcp-server/lib/task-expander.test.cjs +0 -169
  131. package/mcp-server/lib/topo.test.cjs +0 -158
  132. package/mcp-server/tests/circuit-breaker.test.cjs +0 -125
  133. package/mcp-server/tests/commit-hash-flow.test.cjs +0 -117
  134. package/mcp-server/tests/concurrency-update.test.cjs +0 -96
  135. package/mcp-server/tests/concurrency.test.cjs +0 -112
  136. package/mcp-server/tests/db-ops.test.cjs +0 -121
  137. package/mcp-server/tests/init-project.test.cjs +0 -393
  138. package/mcp-server/tests/migrate.test.cjs +0 -232
  139. package/mcp-server/tests/projector.test.cjs +0 -162
  140. package/mcp-server/tests/server-contract.test.cjs +0 -1467
  141. package/mcp-server/tests/staleness.test.cjs +0 -190
  142. package/mcp-server/tests/state-db.test.cjs +0 -106
  143. package/mcp-server/tests/state-ops.test.cjs +0 -449
  144. package/mcp-server/tests/tagged-tasks.test.cjs +0 -163
  145. package/mcp-server/tests/telemetry.test.cjs +0 -219
  146. package/orchestrator/planner/plan-builder.test.cjs +0 -165
  147. package/orchestrator/tests/auto-merge.test.cjs +0 -216
  148. package/orchestrator/tests/daemon.test.cjs +0 -311
  149. package/orchestrator/tests/dispatch-rules.test.cjs +0 -124
  150. package/orchestrator/tests/parallel-orchestrator.test.cjs +0 -233
  151. package/orchestrator/tests/phase-8b-gate.test.cjs +0 -183
  152. package/orchestrator/tests/recovery.test.cjs +0 -190
  153. package/orchestrator/tests/session-runner.test.cjs +0 -314
  154. package/orchestrator/tests/skill-miner.test.cjs +0 -147
  155. package/orchestrator/tests/worktree-manager.test.cjs +0 -148
  156. package/skills/ultra-research/references/architecture.md +0 -38
  157. package/skills/ultra-research/references/problem-product.md +0 -39
  158. package/skills/ultra-research/references/quality-delivery.md +0 -34
  159. package/skills/ultra-research/references/synthesis.md +0 -38
  160. package/skills/ultra-research/references/users-scope.md +0 -40
  161. package/ultra-tools/legacy-memory.test.cjs +0 -80
  162. package/ultra-tools/status-command.test.cjs +0 -181
  163. package/ultra-tools/system-command.test.cjs +0 -309
@@ -0,0 +1,29 @@
1
+ # Deployment and operations
2
+
3
+ Use for workflow step `40-deployment`.
4
+
5
+ ## Objective
6
+
7
+ Record how the system is built, configured, migrated, deployed, observed, recovered,
8
+ and rolled back across its actual environments.
9
+
10
+ ## Evidence
11
+
12
+ - Inspect repository-native build and deployment configuration, environment contracts,
13
+ migrations, health checks, and operational documentation.
14
+ - Use current provider documentation only when repository evidence is insufficient.
15
+ - Separate verified deployment behavior from intended delivery design.
16
+ - Never record secrets or fabricate infrastructure that has not been selected.
17
+
18
+ ## Record
19
+
20
+ Update `architecture.md` with environments, topology, CI/CD entry points, configuration,
21
+ migrations, observability, rollback, recovery, cost constraints when relevant, and
22
+ unknowns.
23
+
24
+ Complete the step with file, runtime, or provider evidence and the updated output path.
25
+
26
+ ## Semantic record
27
+
28
+ Use kind `deployment`. Record `environment`, `entry_point`, `config_migration`,
29
+ `observation`, and `rollback_recovery`.
@@ -0,0 +1,28 @@
1
+ # Quality scenarios and risks
2
+
3
+ Use for workflow step `41-quality-risks`.
4
+
5
+ ## Objective
6
+
7
+ Turn quality goals and known failure modes into observable scenarios, mitigations,
8
+ recovery expectations, and a durable risk ledger.
9
+
10
+ ## Method
11
+
12
+ - Cover only qualities material to the accepted system: correctness, availability,
13
+ security, performance, privacy, maintainability, or others supported by evidence.
14
+ - State trigger, operating condition, expected response, measurement, and recovery.
15
+ - Separate known defect, technical debt, uncertain risk, and accepted constraint.
16
+ - Do not assign arbitrary probability or confidence scores.
17
+
18
+ ## Record
19
+
20
+ Update `architecture.md` with quality scenarios, risk evidence, mitigation, owner,
21
+ verification, recovery, technical debt, and architecture decisions where needed.
22
+
23
+ Complete the step with evidence references and the updated output path.
24
+
25
+ ## Semantic record
26
+
27
+ Use kind `risk`. Record `trigger_condition`, `expected_response`, `measurement`,
28
+ `mitigation`, `recovery`, and `owner`.
@@ -0,0 +1,35 @@
1
+ # Research synthesis
2
+
3
+ Use for workflow step `99-synthesis`.
4
+
5
+ ## Objective
6
+
7
+ Verify that research artifacts form one traceable, planning-ready baseline without
8
+ creating a second condensed authority.
9
+
10
+ ## Validate
11
+
12
+ - Every consequential claim is marked `Observed`, `Verified`, `Decided`, or `Unknown`.
13
+ - Product behavior traces from problem or constraint through actor, scenario,
14
+ requirement, acceptance, architecture, quality, and delivery evidence.
15
+ - Current behavior and proposed behavior are not silently merged.
16
+ - Scope reflects owner decisions and never an inferred MVP or reduction.
17
+ - Documentation conflicts, known failures, and load-bearing unknowns are in the gap
18
+ ledger with owners or explicit decisions.
19
+ - Verification commands and observed results are current.
20
+
21
+ ## Record
22
+
23
+ Write `research-distillate.md` as a navigation and traceability artifact containing
24
+ baseline ids, source document anchors, accepted decisions, blockers, gaps, verification
25
+ evidence, and the exact planning entry. Do not duplicate the specifications' prose.
26
+
27
+ Write the immutable `99-synthesis` step report, then complete the step with that report,
28
+ all three baseline specification paths, the distillate path, and the evidence used for
29
+ the synthesis. Read the completed workflow back before baseline convergence.
30
+
31
+ ## Semantic record
32
+
33
+ Use kind `synthesis_trace`. Record one verified chain through `problem_id`,
34
+ `scenario_id`, `requirement_ids`, `architecture_path_ids`, and `verification_refs`.
35
+ Every referenced id must exist in an earlier selected step.
@@ -1,81 +1,71 @@
1
1
  ---
2
2
  name: ultra-review
3
- description: Run independent specification-fidelity and engineering reviews over one current diff using bounded workers and file-based evidence. Use when implementation needs a read-only review gate before task completion or delivery.
3
+ description: Run independent specification-fidelity and engineering reviews over one current Ultra diff and persist bounded review evidence. Use when a task or change needs a read-only review gate before completion, convergence, or delivery.
4
4
  ---
5
5
 
6
6
  # Review one current diff
7
7
 
8
8
  Keep two verdict axes independent:
9
9
 
10
- 1. `spec_fidelity`: intent, acceptance, delta, documentation impact, and public seam;
11
- 2. `engineering_standards`: correctness, safety, maintainability, testing,
12
- observability, and recovery.
13
-
14
- One axis cannot compensate for the other. Preserve each finding's source, severity,
15
- file and line, and axis during coordination.
16
-
17
- ## Scope and context
18
-
19
- 1. Resolve one explicit diff range and file set. Include staged and unstaged changes
20
- for a default working-tree review.
21
- 2. Bind the single matching change through `change.list` and `task.list`; require an id
22
- when ambiguous.
23
- 3. Compile `change.context` for the review role and gate with only the intent, delta,
24
- acceptance, tests, diff paths, and public-seam contract needed for this review.
25
- 4. Stop on stale HEAD, blocked readiness, empty scope, or missing acceptance evidence.
26
- 5. Create `.ultra/reviews/<session-id>/` with the reviewed HEAD, range, change id,
27
- selected workers, and a pending verdict.
28
-
29
- ## Run the independent fidelity axis
30
-
31
- Always dispatch `review-spec` with only the accepted intent, delta, acceptance criteria,
32
- public-seam context, current HEAD, and diff scope. Do not give it engineering findings
33
- or an implementation rationale that is not part of the accepted contract. It writes
34
- `spec-fidelity.json` with `axis: spec_fidelity`.
35
-
36
- ## Select engineering specialists
37
-
38
- Use the smallest set that covers the diff. The delivery gate runs all five:
39
-
40
- - `review-code`: correctness, security, and live-path reachability;
41
- - `review-tests`: behavioral coverage and feedback-loop evidence;
42
- - `review-errors`: hidden failures, recovery, and observability;
43
- - `review-design`: types, boundaries, complexity, and coupling;
44
- - `review-comments`: stale or misleading comments and documentation.
45
-
46
- Record why any engineering specialist is skipped. The independent specification
47
- worker is required for every change-linked review.
48
-
49
- ## Execute bounded workers
50
-
51
- Use the current host's native bounded-worker mechanism. Dispatch `review-spec` and the
52
- selected engineering workers independently. Each worker must inspect only the supplied
53
- diff and role context. Resolve `references/unified-schema.md` from this
54
- Skill directory and pass that absolute path as `SCHEMA_PATH`; never make a worker infer
55
- the plugin installation root. Each worker writes `<session>/<worker>.json` following
56
- that contract, limits output to actionable findings, and returns only a short file
57
- acknowledgement to the parent context.
58
-
59
- Resolve bundled paths relative to this skill directory. Validate the exact expected
60
- artifacts before coordination:
61
-
62
- ```bash
63
- python3 scripts/review_wait.py <session-path> agents spec-fidelity review-code review-tests
64
- ```
65
-
66
- Pass only the engineering worker stems actually selected. Missing or invalid required
67
- artifacts make the corresponding axis incomplete; a partial set is never a pass.
68
-
69
- Run `review-coordinator` only after validation. It may merge duplicate root causes but
70
- must retain source identifiers and the highest original severity.
71
- Validate its summary with the same waiter.
72
-
73
- ## Report and handoff
74
-
75
- Report both axis verdicts first, followed by blocking findings and artifact paths.
76
- Review is read-only except for review artifacts; fixes are a separate implementation
77
- action. Recheck only unresolved or changed scope after fixes.
78
-
79
- At the final HEAD, compile review context with one convergence action. Delivery must
80
- submit separate review evidence rows for `spec_fidelity` and
81
- `engineering_standards`; a single aggregate pass is invalid.
10
+ - `spec_fidelity`: accepted intent, delta, behavior, docs impact, and public seam;
11
+ - `engineering_standards`: correctness, safety, tests, maintainability, observability,
12
+ integration, and recovery.
13
+
14
+ One axis cannot compensate for the other.
15
+
16
+ ## Bind durable scope
17
+
18
+ 1. Read `references/review-modes.md`. Select exactly one review mode: `task` for one
19
+ implementation slice, `change` for aggregate delivery readiness, or `plan` for an
20
+ approved plan before implementation. Bind only the evidence defined by that mode.
21
+ 2. Resolve one explicit diff range, current full HEAD, change, task set, accepted
22
+ evidence, and decision checkpoint state. Stop on an empty or ambiguous scope or an
23
+ unconfirmed alignment checkpoint.
24
+ 3. Resume or start a `review` workflow. Record `bind-diff` with revision, paths, mode,
25
+ and task set.
26
+ 4. Compile `change.context` for `review` using only accepted intent, delta, task
27
+ contracts, tests, public seams, and diff paths. Record `compile-context` only when
28
+ ready, with the immutable context manifest as the step output.
29
+ 5. Create `.ultra/reviews/<session-id>/` with mode, change id, exact task ids, full HEAD,
30
+ worktree digest, diff range, scope metadata, and pending verdicts.
31
+
32
+ ## Execute independent axes
33
+
34
+ Always run the bounded `review-spec` worker for specification fidelity. Select the
35
+ smallest necessary engineering workers using the mode and risk matrix; a change review
36
+ for delivery runs every applicable role. Record every selected and skipped role with a
37
+ scope-specific rationale. Invoke them through the current host's native bounded-worker
38
+ mechanism. Keep workers independent and pass only the current diff plus their role
39
+ context.
40
+
41
+ Resolve `references/unified-schema.md` from this Skill directory and pass its absolute
42
+ path as `SCHEMA_PATH`. Validate artifacts with `scripts/review_wait.py`; a missing,
43
+ invalid, stale, or partial required artifact is not a pass.
44
+
45
+ Record:
46
+
47
+ - `review-specification` with `spec-fidelity.json` as an output;
48
+ - `review-engineering` with every selected engineering artifact as outputs;
49
+ - `coordinate-findings` with the coordinated summary output.
50
+
51
+ The coordinator preserves every specialist finding unchanged in `SUMMARY.json`.
52
+ Duplicate root causes may be grouped only in the human-readable summary. Review is
53
+ read-only except for review artifacts; implementation fixes are a separate dev action.
54
+ If a finding exposes a new owner choice, preserve it as a finding and route the primary
55
+ agent to `ultra-think`; a review worker must not open, answer, or hide that decision.
56
+
57
+ ## Verify and complete
58
+
59
+ Recheck reviewed HEAD, worktree digest, review-context digest, diff, acceptance, task
60
+ set, artifact schemas, and both verdicts. Record `verify-review-gate`, then call
61
+ `workflow.complete`. MCP
62
+ derives each axis and the durable verdict from the specialist outputs, then requires
63
+ `SUMMARY.json` to match their complete finding set. Prompt claims and a lossy
64
+ coordinator summary cannot replace either axis. Any code, test, spec, or contract edit
65
+ invalidates affected review evidence and requires a new or resumed run.
66
+
67
+ Return both axis verdicts first, blocking findings, reviewed revision and paths,
68
+ artifact digests, workflow id, skipped-role rationale, and one exact next route. A
69
+ blocking implementation finding returns to `ultra-dev`; stale verification returns to
70
+ `ultra-test`; a new owner choice returns to `ultra-think`; an approved current change
71
+ review routes to `ultra-deliver`.
@@ -0,0 +1,27 @@
1
+ # Review modes and worker selection
2
+
3
+ Select one mode before creating review artifacts.
4
+
5
+ ## Task
6
+
7
+ Review one completed task and its bounded diff. Require specification fidelity and the
8
+ engineering roles implicated by the task's code, tests, errors, comments, or design.
9
+ The result supports `review-slice`; it does not replace aggregate change review.
10
+
11
+ ## Change
12
+
13
+ Review the current full change, accepted task set, test report, documentation impact,
14
+ and convergence boundary. Run specification fidelity plus every engineering role that
15
+ can materially affect delivery. This is the delivery-facing review.
16
+
17
+ ## Plan
18
+
19
+ Review accepted intent, task coverage, seams, dependencies, recovery, and verification
20
+ before implementation. Use a plan artifact as the bounded scope; code-diff-only roles
21
+ may be skipped with a concrete rationale.
22
+
23
+ ## Selection record
24
+
25
+ For every available worker, record `selected` or `skipped` and a rationale tied to the
26
+ mode, changed paths, public seam, and risk flags. A role is applicable when its evidence
27
+ could change either verdict axis. Tool availability alone is not a selection reason.
@@ -67,8 +67,13 @@ preference as a defect. Preserve the source specialist's severity during coordin
67
67
  ```json
68
68
  {
69
69
  "$schema": "ultra-review-summary-v2",
70
+ "mode": "change",
70
71
  "session": "<session-id>",
72
+ "change_id": "<change-id>",
73
+ "task_ids": ["<task-id>"],
71
74
  "head": "<full-git-head>",
75
+ "worktree_digest": "<sha256-of-current-worktree>",
76
+ "context_digest": "<sha256-of-recorded-review-context>",
72
77
  "status": "complete",
73
78
  "verdict": "REQUEST_CHANGES",
74
79
  "axes": {
@@ -86,12 +91,32 @@ preference as a defect. Preserve the source specialist's severity during coordin
86
91
  "failed": [],
87
92
  "skipped": []
88
93
  },
94
+ "worker_selection": [
95
+ {
96
+ "worker": "review-spec",
97
+ "status": "selected",
98
+ "rationale": "The specification axis is required for every review mode."
99
+ },
100
+ {
101
+ "worker": "review-comments",
102
+ "status": "skipped",
103
+ "rationale": "The current diff does not change maintained comments or API documentation."
104
+ }
105
+ ],
89
106
  "findings": [],
90
107
  "positive_observations": [],
91
108
  "limitations": []
92
109
  }
93
110
  ```
94
111
 
112
+ `findings` must contain every specialist finding unchanged. Group duplicates only in
113
+ the human-readable summary; never delete or merge machine-readable records.
114
+
115
+ `mode` is `task`, `change`, or `plan`. `worker_selection` contains every selected or
116
+ skipped worker exactly once with a scope-specific rationale. Its selected set equals
117
+ `workers.completed` plus `workers.failed`; its skipped set equals `workers.skipped`.
118
+ `review-spec` is always selected and completed.
119
+
95
120
  The overall verdict is `APPROVE` only when both axes pass, artifacts are complete and
96
121
  current, and no P0 or P1 finding remains. Use `REQUEST_CHANGES` for a failed axis or
97
122
  blocking finding, and `INCOMPLETE` when required evidence or workers are missing.
@@ -23,6 +23,8 @@ AXES = {"spec_fidelity", "engineering_standards"}
23
23
  SEVERITIES = {"P0", "P1", "P2", "P3"}
24
24
  AXIS_VERDICTS = {"PASS", "FAIL", "INCOMPLETE"}
25
25
  OVERALL_VERDICTS = {"APPROVE", "REQUEST_CHANGES", "INCOMPLETE"}
26
+ REVIEW_MODES = {"task", "change", "plan"}
27
+ SELECTION_STATUSES = {"selected", "skipped"}
26
28
  ARTIFACT_STEM = re.compile(r"^[a-z][a-z0-9-]*$")
27
29
  FINDING_FIELDS = {
28
30
  "id", "axis", "severity", "category", "title", "file", "line", "trigger",
@@ -182,9 +184,16 @@ def expected_overall_verdict(data) -> str:
182
184
  def validate_summary(data):
183
185
  if data.get("$schema") != SUMMARY_SCHEMA:
184
186
  return f"$schema must be {SUMMARY_SCHEMA}"
185
- for field in ["session", "head"]:
187
+ if data.get("mode") not in REVIEW_MODES:
188
+ return "mode must be task, change, or plan"
189
+ for field in ["session", "change_id", "head", "context_digest"]:
186
190
  if not nonempty_string(data.get(field)):
187
191
  return f"{field} must be a non-empty string"
192
+ if data.get("worktree_digest") is not None and not nonempty_string(data.get("worktree_digest")):
193
+ return "worktree_digest must be null or a non-empty string"
194
+ task_ids = data.get("task_ids")
195
+ if not isinstance(task_ids, list) or not all(nonempty_string(item) for item in task_ids):
196
+ return "task_ids must be a string array"
188
197
  if data.get("status") != "complete":
189
198
  return "status must be complete"
190
199
  if data.get("verdict") not in OVERALL_VERDICTS:
@@ -203,8 +212,36 @@ def validate_summary(data):
203
212
  if not isinstance(workers, dict):
204
213
  return "workers must be an object"
205
214
  for field in ["completed", "failed", "skipped"]:
206
- if not isinstance(workers.get(field), list):
207
- return f"workers.{field} must be an array"
215
+ values = workers.get(field)
216
+ if not isinstance(values, list) or not all(nonempty_string(item) for item in values):
217
+ return f"workers.{field} must be a string array"
218
+ if len(values) != len(set(values)):
219
+ return f"workers.{field} must not contain duplicates"
220
+ worker_selection = data.get("worker_selection")
221
+ if not isinstance(worker_selection, list) or not worker_selection:
222
+ return "worker_selection must be a non-empty array"
223
+ selected = set()
224
+ skipped = set()
225
+ seen_workers = set()
226
+ for item in worker_selection:
227
+ if not isinstance(item, dict):
228
+ return "worker_selection items must be objects"
229
+ worker = item.get("worker")
230
+ status = item.get("status")
231
+ if not nonempty_string(worker) or status not in SELECTION_STATUSES:
232
+ return "worker_selection requires worker and selected or skipped status"
233
+ if worker in seen_workers:
234
+ return f"duplicate worker selection: {worker}"
235
+ if not nonempty_string(item.get("rationale")):
236
+ return f"worker selection rationale is required: {worker}"
237
+ seen_workers.add(worker)
238
+ (selected if status == "selected" else skipped).add(worker)
239
+ if selected != set(workers["completed"]) | set(workers["failed"]):
240
+ return "selected workers must equal completed and failed workers"
241
+ if skipped != set(workers["skipped"]):
242
+ return "skipped worker selection must match workers.skipped"
243
+ if "review-spec" not in selected or "review-spec" not in set(workers["completed"]):
244
+ return "review-spec must be selected and completed"
208
245
  findings = data.get("findings")
209
246
  if not isinstance(findings, list):
210
247
  return "findings must be an array"
@@ -1,64 +1,64 @@
1
1
  ---
2
2
  name: ultra-status
3
- description: Report authoritative Ultra health, position, readiness, evidence freshness, and one deterministic next action. Use when the user asks where an Ultra project stands or what should happen next.
3
+ description: Report authoritative Ultra project health, baseline, workflow position, task/session progress, evidence freshness, blockers, and one deterministic next action. Use when the user asks what is complete, blocked, stale, or next in an Ultra project.
4
4
  ---
5
5
 
6
- # Route from authoritative status
6
+ # Route from authoritative state
7
7
 
8
- Answer status questions without reconstructing state from prose. `.ultra/state.db` is
9
- authoritative; reports and Markdown are evidence or projections.
8
+ This workflow is read-only. Never reconstruct status from prose or generated task
9
+ projections.
10
10
 
11
11
  ## Read order
12
12
 
13
- 1. Call `system.doctor` in read-only mode. If authority is unhealthy, route only to
14
- `ultra-doctor` and include the blocking diagnostic.
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
21
- HEAD differs from the current checkout.
22
- 6. Read Git branch, HEAD, and worktree status without mutation.
13
+ 1. Call `system.doctor` with repair disabled.
14
+ 2. Call `baseline.get` for classification, readiness, revision, worktree, spec digests,
15
+ research provenance, gaps, and blockers.
16
+ 3. Call `decision.list`, then `decision.get` for the current active or checkpoint-ready
17
+ thread. Expose only its current question or checkpoint, not the hidden history.
18
+ 4. Call `workflow.list`, then `workflow.get` for every active, blocked, or ready run.
19
+ 5. Call `change.breadcrumb`, `change.list`, `task.list`, and `session.list`.
20
+ 6. Inspect current Git branch, full HEAD, and worktree without mutation.
21
+ 7. Read test, review, and delivery artifacts only when referenced by DB workflow state;
22
+ compare their recorded digest and revision with current authority.
23
23
 
24
- If MCP task or change state is unavailable, label that panel unavailable. Never fall
25
- back to generated task JSON, context frontmatter, or raw SQLite.
24
+ If state is unreadable, report that panel unavailable and route to `ultra-doctor`.
25
+ Never fall back to generated task JSON, raw SQLite queries, or context frontmatter.
26
26
 
27
- ## Routing
27
+ ## Choose one route
28
28
 
29
- Follow the breadcrumb's primary route and return one action, not a menu:
29
+ Prefer the breadcrumb and durable workflow position:
30
30
 
31
- - unhealthy authority: `ultra-doctor`;
32
- - missing Ultra project: `ultra-init`;
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;
39
- - blocked or stale context: the workflow named by the breadcrumb;
40
- - ready implementation task: `ultra-dev <task-id>`;
41
- - completed tasks with missing or stale test evidence: `ultra-test`;
42
- - incomplete review or convergence: `ultra-review` or `ultra-deliver`;
43
- - ready change: `ultra-deliver`;
31
+ - state integrity, schema, projection, or installed-asset failure: `ultra-doctor`;
32
+ - open decision or checkpoint: `ultra-think` with its exact decision id;
33
+ - missing project or migrated compatibility authority: `ultra-init`;
34
+ - active/blocked research: `ultra-research` at its exact `current_step`;
35
+ - ready research with unconverged baseline: finalize research, record, approve, and
36
+ converge through `ultra-research`;
37
+ - active plan/change/dev/test/review/deliver run: its matching workflow at the exact
38
+ step or blocker;
39
+ - ready baseline with no change: `ultra-change` to persist the requested outcome before
40
+ any planning;
44
41
  - archived change with fresh evidence: report completion without inventing more work.
45
42
 
46
- Require an explicit change id when several active changes make the route ambiguous.
43
+ Context-size warnings are advisory. Missing authority, stale required refs or outputs,
44
+ incomplete task contracts, failed evidence, unresolved learning, and missing approval
45
+ are blockers.
47
46
 
48
47
  ## Output
49
48
 
50
- Use a compact shape:
49
+ Report:
51
50
 
52
51
  ```text
53
52
  Ultra: <healthy|degraded> · <branch>@<head> · worktree <clean|dirty>
54
- Position: change=<id|none> task=<id|none> role=<role> gate=<gate>
55
- Baseline: <greenfield|brownfield|migrated>/<status> revision=<revision|none> gaps=<open>/<blocking>
56
- Readiness: <ready|blocked|stale> — <blockers or none>
57
- Warnings: <advisory conditions or none>
58
- Progress: <completed>/<total>; sessions=<active count>
59
- Evidence: tests=<fresh|stale|missing>; delivery=<fresh|stale|missing>
53
+ Baseline: <mode>/<status> · research=<run/status> · gaps=<open>/<blocking>
54
+ Workflow: <kind/id/status> · step=<current|finalize> · outputs=<fresh|stale>
55
+ Decision: <id/phase|checkpoint|none> · thread=<id/status>
56
+ Change: <id/status|none> · Task: <id/status|none> · Sessions: <active>
57
+ Evidence: test=<state> · review=<two axes> · delivery=<state>
58
+ Blockers: <specific codes or none>
59
+ Warnings: <advisory codes or none>
60
60
  Next: <one exact action>
61
61
  ```
62
62
 
63
- This workflow is read-only. It does not repair state, compile context, update tasks, or
64
- release software.
63
+ Separate verified facts, inferences, and unavailable evidence. Do not modify state,
64
+ compile context, repair, or release from this Skill.
@@ -1,59 +1,58 @@
1
1
  ---
2
2
  name: ultra-test
3
- description: Run an independent pre-delivery verification gate and record exact feedback-loop, reachability, recovery, and acceptance evidence. Use when scoped implementation tasks are complete and delivery readiness must be established.
3
+ description: Verify completed Ultra tasks and one current change through independent acceptance, regression, build, public-seam, failure, and recovery evidence. Use when implementation needs a current test gate before review, convergence, or delivery.
4
4
  ---
5
5
 
6
- # Verify delivery readiness
7
-
8
- Run this gate from a fresh checking context. It complements task-level development
9
- tests and writes `.ultra/test-report.json`; it does not replace authoritative task or
10
- change state.
11
-
12
- ## Entry gate
13
-
14
- 1. Call `task.list` and require at least one completed task in scope.
15
- 2. Call `change.list` and bind exactly one relevant change, or record a null change id
16
- for an initial baseline.
17
- 3. For a change, compile `change.context` for the checking role and verification gate
18
- with only the specifications, tests, and source seams needed for acceptance.
19
- 4. Call `change.breadcrumb`; stop when context is stale or readiness is blocked.
20
-
21
- Never use generated task JSON as authority or reuse the implementer's full
22
- conversation as test context.
23
-
24
- ## Evidence matrix
25
-
26
- Map each acceptance claim to observable evidence:
27
-
28
- | Check | Evidence | Blocking result |
29
- |---|---|---|
30
- | Feedback loop | exact command and observed result | failure or missing baseline signal for a fix |
31
- | Public seam | reachable entry-to-consumer path | orphan, stub, or unwired behavior |
32
- | Regression | focused and adjacent suites | failure or weakened assertion |
33
- | Static/build | applicable type, lint, and build commands | non-zero result |
34
- | Error/recovery | exercised failure and recovery path | silent or unrecoverable critical path |
35
- | Security | relevant input, authorization, secret, and dependency checks | high-impact exploitable issue |
36
- | Docs/spec | delivered behavior matches the declared baseline or delta | drift or unknown impact |
37
-
38
- Use repository-native commands and real boundaries when practical. Use test doubles
39
- only at costly or nondeterministic external boundaries, and state why they preserve
40
- the contract being tested.
41
-
42
- Inspect tests for tautologies, empty assertions, hidden skips, excessive boundary
43
- mocking, changed exports without behavioral coverage, and code with no non-test
44
- consumer. Apply checks by risk and scope rather than forcing every category.
45
-
46
- ## Report contract
47
-
48
- Write the report atomically with the current full HEAD, change id, context manifest
49
- hash, exact commands, baseline and final signals, verified public seams, checks, and
50
- blocking issues. Preserve concise failure excerpts instead of full logs.
51
-
52
- Set `passed: true` only when every required check passes, the report HEAD is current,
53
- and at least one declared public seam is verified. A not-applicable check needs a
54
- specific scope reason.
55
-
56
- ## Exit
57
-
58
- Call `change.breadcrumb` and return one next action: fix a named blocker, run
59
- `ultra-review`, or run `ultra-deliver`. A stale report never routes to delivery.
6
+ # Verify the current change
7
+
8
+ Testing is independent checking. Do not reuse the implementer's conclusions as proof
9
+ or use generated task JSON as authority.
10
+
11
+ ## Bind and execute
12
+
13
+ 1. Read `system.doctor`, `change.breadcrumb`, active decision state, authoritative
14
+ tasks, completed dev runs, current HEAD/diff, and prior test report freshness. An
15
+ open decision or unconfirmed checkpoint blocks testing claims and routes to
16
+ `ultra-think`.
17
+ 2. Resume or start a `test` workflow linked to the change and optional task. Record
18
+ `bind-scope` with the exact revision, task set, and acceptance ids.
19
+ 3. Compile `change.context` for `check`; record `compile-context` only when required
20
+ refs and DB-backed execution contracts are ready, with the immutable context
21
+ manifest as the step output.
22
+ 4. Map each accepted claim to an executable command or a specific bounded manual
23
+ observation. Record `map-acceptance`.
24
+ 5. Run repository-native focused and regression tests, applicable type/lint/build
25
+ checks, public-seam acceptance, and material error/recovery/security checks. Record
26
+ `execute-checks` and `verify-public-seam` with commands and observed results.
27
+
28
+ Use real boundaries where practical. A test double is acceptable at a costly or
29
+ nondeterministic external boundary only when the report explains why it preserves the
30
+ contract. Reject tautologies, hidden skips, weakened assertions, and unconsumed code.
31
+ When evidence reveals an unresolved product decision, report the exact consequence and
32
+ route it to the decision dialogue; testing must not silently select the desired result.
33
+
34
+ ## Report and converge
35
+
36
+ Write `.ultra/reports/tests/<workflow-id>.json` atomically using
37
+ `ultra-test-report-v1`: bind the full HEAD and worktree digest, change and exact task
38
+ ids, the recorded checking-context digest, acceptance
39
+ mapping, exact command results, public seams, failures, recovery evidence, run count,
40
+ timestamp, and blocking issues. Populate every `verification_dimensions` entry:
41
+ acceptance, regression, integration, static analysis, build, performance, security,
42
+ and recovery. Use `not_applicable` only with a concrete rationale; `not_run` cannot
43
+ support a passing gate. For an incident or any bugfix task, also record one
44
+ deterministic `regression_signal` with the exact command, expected red symptom,
45
+ observed red and green results, duration when known, and evidence. `passed` is true only when every recorded command and
46
+ required public seam passes with no blocking issue at that exact checkout.
47
+
48
+ Record `write-report` with the report output so MCP stores its digest. Re-read the file,
49
+ HEAD, task set, and breadcrumb; record `verify-test-gate`, then call
50
+ `workflow.complete`. MCP derives the durable test summary from the report rather than
51
+ trusting a Prompt claim. A malformed, mismatched, changed, or stale report blocks
52
+ completion.
53
+
54
+ Return the workflow id, revision, pass/fail result, exact checks, verified seams,
55
+ blocking failures, report path/digest, and one route to fix, `ultra-review`, or
56
+ `ultra-deliver`. A failed implementation contract returns to `ultra-dev`; a new owner
57
+ choice returns to `ultra-think`; a passing current change without current aggregate
58
+ review routes to `ultra-review`.