ultra-builder-pro-cli 0.13.0 → 0.15.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 (172) 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 +86 -1
  8. package/README.md +40 -26
  9. package/adapters/_shared/codex-assets.cjs +29 -165
  10. package/adapters/_shared/file-ops.cjs +6 -2
  11. package/adapters/_shared/runtime-assets.cjs +1 -0
  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 +33 -122
  16. package/agents/review-coordinator.md +9 -6
  17. package/docs/AGENT-CONTEXT.md +21 -11
  18. package/docs/ARCHITECTURE.md +41 -13
  19. package/docs/PLAN.zh-CN.md +3 -2
  20. package/docs/ROADMAP.md +9 -5
  21. package/docs/RUNTIME-COMPAT-MATRIX.md +6 -6
  22. package/docs/STATE-DB-ACCESS-POLICY.md +27 -25
  23. package/docs/WORKFLOW-LIFECYCLE.md +266 -0
  24. package/hooks/README.md +6 -1
  25. package/hooks/active_task_context.py +22 -50
  26. package/hooks/context_spine.py +61 -332
  27. package/hooks/health_check.py +29 -18
  28. package/hooks/pre_stop_check.py +28 -33
  29. package/hooks/subagent_tracker.py +54 -85
  30. package/hooks/workflow_checkpoint.py +39 -47
  31. package/hooks/workflow_context.py +4 -9
  32. package/hooks/workflow_resume.py +48 -128
  33. package/mcp-server/breadcrumb.cjs +22 -0
  34. package/mcp-server/hook-event.cjs +34 -0
  35. package/mcp-server/lib/archive-journal.cjs +17 -5
  36. package/mcp-server/lib/baseline-workflow.cjs +158 -18
  37. package/mcp-server/lib/change-workflow.cjs +550 -85
  38. package/mcp-server/lib/context-spine.cjs +242 -24
  39. package/mcp-server/lib/doctor.cjs +33 -3
  40. package/mcp-server/lib/init-project.cjs +210 -16
  41. package/mcp-server/lib/plan-store.cjs +4 -1
  42. package/mcp-server/lib/prd-parser.cjs +14 -41
  43. package/mcp-server/lib/pricing.cjs +7 -10
  44. package/mcp-server/lib/project-breadcrumb.cjs +145 -0
  45. package/mcp-server/lib/projector.cjs +57 -3
  46. package/mcp-server/lib/spec-learning.cjs +79 -2
  47. package/mcp-server/lib/state-db.cjs +145 -8
  48. package/mcp-server/lib/state-ops.cjs +160 -9
  49. package/mcp-server/lib/task-expander.cjs +9 -38
  50. package/mcp-server/lib/workflow-state.cjs +2292 -0
  51. package/mcp-server/server.cjs +182 -50
  52. package/orchestrator/daemon.cjs +1 -2
  53. package/orchestrator/dispatch-rules.cjs +5 -31
  54. package/orchestrator/planner/plan-builder.cjs +21 -12
  55. package/package.json +14 -6
  56. package/skills/cc-collab/SKILL.md +2 -2
  57. package/skills/codex-collab/SKILL.md +2 -3
  58. package/skills/ultra-change/SKILL.md +53 -68
  59. package/skills/ultra-change/references/change-contract.md +36 -0
  60. package/skills/ultra-deliver/SKILL.md +69 -79
  61. package/skills/ultra-deliver/references/baseline-reconciliation.md +20 -0
  62. package/skills/ultra-dev/SKILL.md +54 -59
  63. package/skills/ultra-doctor/SKILL.md +40 -71
  64. package/skills/ultra-init/SKILL.md +96 -103
  65. package/skills/ultra-init/references/brownfield-adoption.md +2 -2
  66. package/skills/ultra-plan/SKILL.md +79 -75
  67. package/skills/ultra-plan/references/semantic-preflight.md +18 -0
  68. package/skills/ultra-research/SKILL.md +87 -60
  69. package/skills/ultra-research/references/00-problem-validation.md +36 -0
  70. package/skills/ultra-research/references/01-opportunity-discovery.md +33 -0
  71. package/skills/ultra-research/references/02-market-assessment.md +30 -0
  72. package/skills/ultra-research/references/03-competitive-landscape.md +31 -0
  73. package/skills/ultra-research/references/04-product-strategy.md +32 -0
  74. package/skills/ultra-research/references/05-assumptions-validation.md +31 -0
  75. package/skills/ultra-research/references/10-user-personas.md +29 -0
  76. package/skills/ultra-research/references/11-user-scenarios.md +28 -0
  77. package/skills/ultra-research/references/20-user-stories.md +30 -0
  78. package/skills/ultra-research/references/21-features-scope.md +29 -0
  79. package/skills/ultra-research/references/22-success-metrics.md +28 -0
  80. package/skills/ultra-research/references/30-architecture-context.md +30 -0
  81. package/skills/ultra-research/references/31-solution-strategy.md +28 -0
  82. package/skills/ultra-research/references/32-building-blocks.md +28 -0
  83. package/skills/ultra-research/references/40-deployment.md +29 -0
  84. package/skills/ultra-research/references/41-quality-risks.md +28 -0
  85. package/skills/ultra-research/references/99-synthesis.md +35 -0
  86. package/skills/ultra-review/SKILL.md +57 -73
  87. package/skills/ultra-review/references/review-modes.md +27 -0
  88. package/skills/ultra-review/references/unified-schema.md +25 -0
  89. package/skills/ultra-review/scripts/review_wait.py +40 -3
  90. package/skills/ultra-status/SKILL.md +41 -45
  91. package/skills/ultra-test/SKILL.md +48 -55
  92. package/skills/ultra-verify/SKILL.md +22 -31
  93. package/skills/ultra-verify/references/{confidence-system.md → evidence-status.md} +3 -3
  94. package/skills/ultra-verify/scripts/verify_wait.py +54 -54
  95. package/spec/cli-protocol.md +7 -2
  96. package/spec/mcp-tools.yaml +422 -73
  97. package/spec/schemas/baseline-reconciliation.v1.schema.json +73 -0
  98. package/spec/schemas/delivery-report.v1.schema.json +111 -0
  99. package/spec/schemas/mcp-tools.schema.json +1 -1
  100. package/spec/schemas/state-db.sql +82 -1
  101. package/spec/schemas/tasks.v4.5.schema.json +8 -1
  102. package/spec/schemas/test-report.v1.schema.json +194 -0
  103. package/ultra-tools/cli.cjs +1 -1
  104. package/ultra-tools/commands/migrate.cjs +3 -3
  105. package/ultra-tools/commands/status.cjs +213 -12
  106. package/.ultra-template/delivery-report.json +0 -9
  107. package/.ultra-template/test-report.json +0 -8
  108. package/adapters/_shared/tests/file-ops.test.cjs +0 -54
  109. package/adapters/_shared/tests/frontmatter.test.cjs +0 -47
  110. package/adapters/_shared/tests/handbook.test.cjs +0 -101
  111. package/adapters/_shared/tests/path-rewrite.test.cjs +0 -60
  112. package/adapters/_shared/tests/provenance.test.cjs +0 -133
  113. package/adapters/_shared/tests/resolve-target.test.cjs +0 -75
  114. package/adapters/_shared/tests/runtime-assets.test.cjs +0 -131
  115. package/adapters/_shared/tests/settings-merge.test.cjs +0 -85
  116. package/adapters/_shared/tests/validate.test.cjs +0 -30
  117. package/adapters/tests/claude.test.cjs +0 -137
  118. package/adapters/tests/codex-hook.test.cjs +0 -115
  119. package/adapters/tests/codex.test.cjs +0 -423
  120. package/adapters/tests/kimi-hook.test.cjs +0 -122
  121. package/adapters/tests/kimi.test.cjs +0 -259
  122. package/adapters/tests/opencode.test.cjs +0 -371
  123. package/mcp-server/lib/archive-journal.test.cjs +0 -35
  124. package/mcp-server/lib/baseline-workflow.test.cjs +0 -477
  125. package/mcp-server/lib/change-workflow.test.cjs +0 -971
  126. package/mcp-server/lib/context-spine.test.cjs +0 -93
  127. package/mcp-server/lib/doctor.test.cjs +0 -148
  128. package/mcp-server/lib/llm-client.cjs +0 -157
  129. package/mcp-server/lib/llm-client.test.cjs +0 -156
  130. package/mcp-server/lib/plan-store.test.cjs +0 -132
  131. package/mcp-server/lib/prd-parser.test.cjs +0 -171
  132. package/mcp-server/lib/runtime-state.test.cjs +0 -92
  133. package/mcp-server/lib/spec-learning.test.cjs +0 -67
  134. package/mcp-server/lib/state-db.test.cjs +0 -314
  135. package/mcp-server/lib/task-expander.test.cjs +0 -324
  136. package/mcp-server/lib/topo.test.cjs +0 -158
  137. package/mcp-server/tests/circuit-breaker.test.cjs +0 -125
  138. package/mcp-server/tests/commit-hash-flow.test.cjs +0 -117
  139. package/mcp-server/tests/concurrency-update.test.cjs +0 -96
  140. package/mcp-server/tests/concurrency.test.cjs +0 -112
  141. package/mcp-server/tests/db-ops.test.cjs +0 -121
  142. package/mcp-server/tests/init-project.test.cjs +0 -393
  143. package/mcp-server/tests/migrate.test.cjs +0 -232
  144. package/mcp-server/tests/projector.test.cjs +0 -162
  145. package/mcp-server/tests/server-contract.test.cjs +0 -1471
  146. package/mcp-server/tests/staleness.test.cjs +0 -190
  147. package/mcp-server/tests/state-db.test.cjs +0 -106
  148. package/mcp-server/tests/state-ops.test.cjs +0 -449
  149. package/mcp-server/tests/tagged-tasks.test.cjs +0 -163
  150. package/mcp-server/tests/telemetry.test.cjs +0 -219
  151. package/orchestrator/planner/expand-prompt.cjs +0 -62
  152. package/orchestrator/planner/expand-prompt.test.cjs +0 -52
  153. package/orchestrator/planner/plan-builder.test.cjs +0 -165
  154. package/orchestrator/planner/prd-prompt.cjs +0 -44
  155. package/orchestrator/planner/prd-prompt.test.cjs +0 -30
  156. package/orchestrator/tests/auto-merge.test.cjs +0 -216
  157. package/orchestrator/tests/daemon.test.cjs +0 -311
  158. package/orchestrator/tests/dispatch-rules.test.cjs +0 -124
  159. package/orchestrator/tests/parallel-orchestrator.test.cjs +0 -233
  160. package/orchestrator/tests/phase-8b-gate.test.cjs +0 -183
  161. package/orchestrator/tests/recovery.test.cjs +0 -190
  162. package/orchestrator/tests/session-runner.test.cjs +0 -314
  163. package/orchestrator/tests/skill-miner.test.cjs +0 -147
  164. package/orchestrator/tests/worktree-manager.test.cjs +0 -148
  165. package/skills/ultra-research/references/architecture.md +0 -38
  166. package/skills/ultra-research/references/problem-product.md +0 -39
  167. package/skills/ultra-research/references/quality-delivery.md +0 -34
  168. package/skills/ultra-research/references/synthesis.md +0 -38
  169. package/skills/ultra-research/references/users-scope.md +0 -40
  170. package/ultra-tools/legacy-memory.test.cjs +0 -80
  171. package/ultra-tools/status-command.test.cjs +0 -181
  172. package/ultra-tools/system-command.test.cjs +0 -309
@@ -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,65 @@
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, and accepted
22
+ evidence. Stop on an empty or ambiguous scope.
23
+ 3. Resume or start a `review` workflow. Record `bind-diff` with revision, paths, mode,
24
+ and task set.
25
+ 4. Compile `change.context` for `review` using only accepted intent, delta, task
26
+ contracts, tests, public seams, and diff paths. Record `compile-context` only when
27
+ ready, with the immutable context manifest as the step output.
28
+ 5. Create `.ultra/reviews/<session-id>/` with mode, change id, exact task ids, full HEAD,
29
+ worktree digest, diff range, scope metadata, and pending verdicts.
30
+
31
+ ## Execute independent axes
32
+
33
+ Always run the bounded `review-spec` worker for specification fidelity. Select the
34
+ smallest necessary engineering workers using the mode and risk matrix; a change review
35
+ for delivery runs every applicable role. Record every selected and skipped role with a
36
+ scope-specific rationale. Invoke them through the current host's native bounded-worker
37
+ mechanism. Keep workers independent and pass only the current diff plus their role
38
+ context.
39
+
40
+ Resolve `references/unified-schema.md` from this Skill directory and pass its absolute
41
+ path as `SCHEMA_PATH`. Validate artifacts with `scripts/review_wait.py`; a missing,
42
+ invalid, stale, or partial required artifact is not a pass.
43
+
44
+ Record:
45
+
46
+ - `review-specification` with `spec-fidelity.json` as an output;
47
+ - `review-engineering` with every selected engineering artifact as outputs;
48
+ - `coordinate-findings` with the coordinated summary output.
49
+
50
+ The coordinator preserves every specialist finding unchanged in `SUMMARY.json`.
51
+ Duplicate root causes may be grouped only in the human-readable summary. Review is
52
+ read-only except for review artifacts; implementation fixes are a separate dev action.
53
+
54
+ ## Verify and complete
55
+
56
+ Recheck reviewed HEAD, worktree digest, review-context digest, diff, acceptance, task
57
+ set, artifact schemas, and both verdicts. Record `verify-review-gate`, then call
58
+ `workflow.complete`. MCP
59
+ derives each axis and the durable verdict from the specialist outputs, then requires
60
+ `SUMMARY.json` to match their complete finding set. Prompt claims and a lossy
61
+ coordinator summary cannot replace either axis. Any code, test, spec, or contract edit
62
+ invalidates affected review evidence and requires a new or resumed run.
63
+
64
+ Return both axis verdicts first, blocking findings, reviewed revision and paths,
65
+ artifact digests, workflow id, skipped-role rationale, and one exact next route.
@@ -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,60 @@
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.
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.
26
-
27
- ## Routing
28
-
29
- Follow the breadcrumb's primary route and return one action, not a menu:
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`;
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 `workflow.list`, then `workflow.get` for every active, blocked, or ready run.
17
+ 4. Call `change.breadcrumb`, `change.list`, `task.list`, and `session.list`.
18
+ 5. Inspect current Git branch, full HEAD, and worktree without mutation.
19
+ 6. Read test, review, and delivery artifacts only when referenced by DB workflow state;
20
+ compare their recorded digest and revision with current authority.
21
+
22
+ If state is unreadable, report that panel unavailable and route to `ultra-doctor`.
23
+ Never fall back to generated task JSON, raw SQLite queries, or context frontmatter.
24
+
25
+ ## Choose one route
26
+
27
+ Prefer the breadcrumb and durable workflow position:
28
+
29
+ - state integrity, schema, projection, or installed-asset failure: `ultra-doctor`;
30
+ - missing project or migrated compatibility authority: `ultra-init`;
31
+ - active/blocked research: `ultra-research` at its exact `current_step`;
32
+ - ready research with unconverged baseline: finalize research, record, approve, and
33
+ converge through `ultra-research`;
34
+ - active plan/change/dev/test/review/deliver run: its matching workflow at the exact
35
+ step or blocker;
36
+ - ready baseline with no change: `ultra-change` to persist the requested outcome before
37
+ any planning;
44
38
  - archived change with fresh evidence: report completion without inventing more work.
45
39
 
46
- Require an explicit change id when several active changes make the route ambiguous.
40
+ Context-size warnings are advisory. Missing authority, stale required refs or outputs,
41
+ incomplete task contracts, failed evidence, unresolved learning, and missing approval
42
+ are blockers.
47
43
 
48
44
  ## Output
49
45
 
50
- Use a compact shape:
46
+ Report:
51
47
 
52
48
  ```text
53
49
  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>
50
+ Baseline: <mode>/<status> · research=<run/status> · gaps=<open>/<blocking>
51
+ Workflow: <kind/id/status> · step=<current|finalize> · outputs=<fresh|stale>
52
+ Change: <id/status|none> · Task: <id/status|none> · Sessions: <active>
53
+ Evidence: test=<state> · review=<two axes> · delivery=<state>
54
+ Blockers: <specific codes or none>
55
+ Warnings: <advisory codes or none>
60
56
  Next: <one exact action>
61
57
  ```
62
58
 
63
- This workflow is read-only. It does not repair state, compile context, update tasks, or
64
- release software.
59
+ Separate verified facts, inferences, and unavailable evidence. Do not modify state,
60
+ compile context, repair, or release from this Skill.
@@ -1,59 +1,52 @@
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`, authoritative tasks, completed dev runs,
14
+ current HEAD/diff, and prior test report freshness.
15
+ 2. Resume or start a `test` workflow linked to the change and optional task. Record
16
+ `bind-scope` with the exact revision, task set, and acceptance ids.
17
+ 3. Compile `change.context` for `check`; record `compile-context` only when required
18
+ refs and DB-backed execution contracts are ready, with the immutable context
19
+ manifest as the step output.
20
+ 4. Map each accepted claim to an executable command or a specific bounded manual
21
+ observation. Record `map-acceptance`.
22
+ 5. Run repository-native focused and regression tests, applicable type/lint/build
23
+ checks, public-seam acceptance, and material error/recovery/security checks. Record
24
+ `execute-checks` and `verify-public-seam` with commands and observed results.
25
+
26
+ Use real boundaries where practical. A test double is acceptable at a costly or
27
+ nondeterministic external boundary only when the report explains why it preserves the
28
+ contract. Reject tautologies, hidden skips, weakened assertions, and unconsumed code.
29
+
30
+ ## Report and converge
31
+
32
+ Write `.ultra/reports/tests/<workflow-id>.json` atomically using
33
+ `ultra-test-report-v1`: bind the full HEAD and worktree digest, change and exact task
34
+ ids, the recorded checking-context digest, acceptance
35
+ mapping, exact command results, public seams, failures, recovery evidence, run count,
36
+ timestamp, and blocking issues. Populate every `verification_dimensions` entry:
37
+ acceptance, regression, integration, static analysis, build, performance, security,
38
+ and recovery. Use `not_applicable` only with a concrete rationale; `not_run` cannot
39
+ support a passing gate. For an incident or any bugfix task, also record one
40
+ deterministic `regression_signal` with the exact command, expected red symptom,
41
+ observed red and green results, duration when known, and evidence. `passed` is true only when every recorded command and
42
+ required public seam passes with no blocking issue at that exact checkout.
43
+
44
+ Record `write-report` with the report output so MCP stores its digest. Re-read the file,
45
+ HEAD, task set, and breadcrumb; record `verify-test-gate`, then call
46
+ `workflow.complete`. MCP derives the durable test summary from the report rather than
47
+ trusting a Prompt claim. A malformed, mismatched, changed, or stale report blocks
48
+ completion.
49
+
50
+ Return the workflow id, revision, pass/fail result, exact checks, verified seams,
51
+ blocking failures, report path/digest, and one route to fix, `ultra-review`, or
52
+ `ultra-deliver`.
@@ -1,12 +1,13 @@
1
1
  ---
2
2
  name: ultra-verify
3
- description: Run independent two-model verification with the current host as primary and a read-only external advisor, then verify and synthesize both evidence sets. Use only when the user explicitly requests cross-model verification.
3
+ description: Run independent two-model verification with the current host as primary and one installed read-only advisor, then verify and synthesize both evidence sets. Use only when the user explicitly requests cross-model verification.
4
4
  ---
5
5
 
6
6
  # Run independent cross-model verification
7
7
 
8
- Claude Code writes the first analysis, verifies consequential claims, and owns the
9
- final answer. Codex is an untrusted read-only advisor.
8
+ Keep the current host responsible for scope, evidence, edits, verification, and the
9
+ final answer. Use one installed collaboration companion that invokes a different CLI;
10
+ never recurse into the current host or treat advisor output as authority.
10
11
 
11
12
  ## Modes
12
13
 
@@ -17,36 +18,26 @@ final answer. Codex is an untrusted read-only advisor.
17
18
 
18
19
  ## Workflow
19
20
 
20
- 1. Confirm the advisor CLI and authentication. Define the exact workspace, question,
21
- evidence standard, and response shape. Exclude secrets and unrelated files.
22
- 2. Create `.ultra/collab/<session-id>/` and write the primary host's evidence-backed
23
- analysis to `claude-analysis.md` before reading advisor output.
24
- 3. Launch Codex with the raw bounded question and evidence in a read-only sandbox. Do
25
- not include the primary conclusion when independence matters:
26
-
27
- ```bash
28
- codex exec -s read-only \
29
- -a never \
30
- --ephemeral \
31
- --ignore-user-config \
32
- --ignore-rules \
33
- -o "${SESSION_PATH}/codex-output.md" \
34
- "<bounded prompt>" \
35
- 2> "${SESSION_PATH}/codex-error.log"
36
- ```
37
- 4. Run `scripts/verify_wait.py` resolved relative to this skill directory. Use a
38
- yielded or asynchronous shell session and poll at bounded intervals; do not hold a
39
- blocking tool call longer than one minute.
21
+ 1. Define the workspace, question, evidence standard, and response shape. Confirm the
22
+ selected advisor CLI and authentication. Exclude secrets and unrelated files.
23
+ 2. Create `.ultra/collab/<session-id>/` and write the current host's independent,
24
+ evidence-backed analysis to `host-analysis.md` before reading advisor output.
25
+ 3. Follow the installed collaboration companion's read-only invocation contract. Give
26
+ the advisor the same bounded question and evidence, without the primary conclusion
27
+ when independence matters. Store its result as `advisor-output.md` and diagnostics
28
+ as `advisor-error.log`.
29
+ 4. Run `scripts/verify_wait.py <session-path> --advisor advisor --output
30
+ advisor-output.md` from this skill directory. Use a yielded shell session and poll
31
+ in bounded intervals; do not hold one blocking tool call longer than one minute.
40
32
  5. Read advisor output only after the waiter reports a complete, non-empty file.
41
- 6. Verify both analyses against the current checkout, tests, runtime, or primary
42
- documentation. Explain scope, version, evidence, and assumption differences before
43
- judging disagreement.
44
- 7. Write session metadata and a synthesis artifact, then return one host-owned
45
- conclusion.
33
+ 6. Verify consequential claims against the current checkout, tests, runtime, or
34
+ primary documentation. Explain scope, version, evidence, and assumption differences
35
+ before resolving disagreement.
36
+ 7. Write `metadata.json` and `synthesis.md`, then return one host-owned conclusion.
46
37
 
47
38
  Read `references/cross-verify-modes.md` for mode-specific evidence and
48
- `references/confidence-system.md` when confidence language is useful. Model agreement
39
+ `references/evidence-status.md` when the synthesis needs an evidence status. Model agreement
49
40
  never overrides failing tests or authoritative runtime evidence.
50
41
 
51
- Advisor failure degrades to the primary analysis with a single-source warning. It does
52
- not block the user's underlying task.
42
+ Advisor failure degrades to the primary analysis with a single-source warning. It
43
+ never blocks the user's underlying task.