ultra-builder-pro-cli 0.14.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 (154) 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 +44 -1
  8. package/README.md +34 -19
  9. package/adapters/_shared/codex-assets.cjs +6 -2
  10. package/adapters/_shared/file-ops.cjs +6 -2
  11. package/adapters/claude.js +3 -2
  12. package/adapters/codex.js +1 -0
  13. package/adapters/kimi.js +3 -2
  14. package/adapters/opencode.js +3 -2
  15. package/agents/review-coordinator.md +9 -6
  16. package/docs/AGENT-CONTEXT.md +15 -8
  17. package/docs/ARCHITECTURE.md +33 -12
  18. package/docs/PLAN.zh-CN.md +3 -2
  19. package/docs/ROADMAP.md +8 -4
  20. package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
  21. package/docs/STATE-DB-ACCESS-POLICY.md +27 -25
  22. package/docs/WORKFLOW-LIFECYCLE.md +266 -0
  23. package/hooks/README.md +6 -1
  24. package/hooks/health_check.py +12 -3
  25. package/hooks/subagent_tracker.py +52 -77
  26. package/mcp-server/hook-event.cjs +34 -0
  27. package/mcp-server/lib/archive-journal.cjs +17 -5
  28. package/mcp-server/lib/baseline-workflow.cjs +158 -18
  29. package/mcp-server/lib/change-workflow.cjs +550 -85
  30. package/mcp-server/lib/context-spine.cjs +242 -24
  31. package/mcp-server/lib/doctor.cjs +33 -3
  32. package/mcp-server/lib/init-project.cjs +210 -16
  33. package/mcp-server/lib/plan-store.cjs +4 -1
  34. package/mcp-server/lib/pricing.cjs +7 -10
  35. package/mcp-server/lib/project-breadcrumb.cjs +6 -0
  36. package/mcp-server/lib/projector.cjs +57 -3
  37. package/mcp-server/lib/spec-learning.cjs +79 -2
  38. package/mcp-server/lib/state-db.cjs +145 -8
  39. package/mcp-server/lib/state-ops.cjs +160 -9
  40. package/mcp-server/lib/workflow-state.cjs +2292 -0
  41. package/mcp-server/server.cjs +161 -15
  42. package/orchestrator/daemon.cjs +1 -2
  43. package/orchestrator/dispatch-rules.cjs +5 -31
  44. package/orchestrator/planner/plan-builder.cjs +21 -12
  45. package/package.json +13 -3
  46. package/skills/ultra-change/SKILL.md +53 -68
  47. package/skills/ultra-change/references/change-contract.md +36 -0
  48. package/skills/ultra-deliver/SKILL.md +69 -79
  49. package/skills/ultra-deliver/references/baseline-reconciliation.md +20 -0
  50. package/skills/ultra-dev/SKILL.md +54 -59
  51. package/skills/ultra-doctor/SKILL.md +40 -71
  52. package/skills/ultra-init/SKILL.md +96 -103
  53. package/skills/ultra-init/references/brownfield-adoption.md +2 -2
  54. package/skills/ultra-plan/SKILL.md +79 -85
  55. package/skills/ultra-plan/references/semantic-preflight.md +18 -0
  56. package/skills/ultra-research/SKILL.md +87 -60
  57. package/skills/ultra-research/references/00-problem-validation.md +36 -0
  58. package/skills/ultra-research/references/01-opportunity-discovery.md +33 -0
  59. package/skills/ultra-research/references/02-market-assessment.md +30 -0
  60. package/skills/ultra-research/references/03-competitive-landscape.md +31 -0
  61. package/skills/ultra-research/references/04-product-strategy.md +32 -0
  62. package/skills/ultra-research/references/05-assumptions-validation.md +31 -0
  63. package/skills/ultra-research/references/10-user-personas.md +29 -0
  64. package/skills/ultra-research/references/11-user-scenarios.md +28 -0
  65. package/skills/ultra-research/references/20-user-stories.md +30 -0
  66. package/skills/ultra-research/references/21-features-scope.md +29 -0
  67. package/skills/ultra-research/references/22-success-metrics.md +28 -0
  68. package/skills/ultra-research/references/30-architecture-context.md +30 -0
  69. package/skills/ultra-research/references/31-solution-strategy.md +28 -0
  70. package/skills/ultra-research/references/32-building-blocks.md +28 -0
  71. package/skills/ultra-research/references/40-deployment.md +29 -0
  72. package/skills/ultra-research/references/41-quality-risks.md +28 -0
  73. package/skills/ultra-research/references/99-synthesis.md +35 -0
  74. package/skills/ultra-review/SKILL.md +57 -73
  75. package/skills/ultra-review/references/review-modes.md +27 -0
  76. package/skills/ultra-review/references/unified-schema.md +25 -0
  77. package/skills/ultra-review/scripts/review_wait.py +40 -3
  78. package/skills/ultra-status/SKILL.md +41 -45
  79. package/skills/ultra-test/SKILL.md +48 -55
  80. package/skills/ultra-verify/SKILL.md +1 -1
  81. package/skills/ultra-verify/references/{confidence-system.md → evidence-status.md} +3 -3
  82. package/spec/cli-protocol.md +7 -2
  83. package/spec/mcp-tools.yaml +384 -63
  84. package/spec/schemas/baseline-reconciliation.v1.schema.json +73 -0
  85. package/spec/schemas/delivery-report.v1.schema.json +111 -0
  86. package/spec/schemas/mcp-tools.schema.json +1 -1
  87. package/spec/schemas/state-db.sql +82 -1
  88. package/spec/schemas/tasks.v4.5.schema.json +8 -1
  89. package/spec/schemas/test-report.v1.schema.json +194 -0
  90. package/ultra-tools/cli.cjs +1 -1
  91. package/ultra-tools/commands/migrate.cjs +3 -3
  92. package/ultra-tools/commands/status.cjs +213 -12
  93. package/.ultra-template/delivery-report.json +0 -9
  94. package/.ultra-template/test-report.json +0 -8
  95. package/adapters/_shared/tests/file-ops.test.cjs +0 -54
  96. package/adapters/_shared/tests/frontmatter.test.cjs +0 -47
  97. package/adapters/_shared/tests/handbook.test.cjs +0 -101
  98. package/adapters/_shared/tests/path-rewrite.test.cjs +0 -60
  99. package/adapters/_shared/tests/provenance.test.cjs +0 -133
  100. package/adapters/_shared/tests/resolve-target.test.cjs +0 -75
  101. package/adapters/_shared/tests/runtime-assets.test.cjs +0 -149
  102. package/adapters/_shared/tests/settings-merge.test.cjs +0 -85
  103. package/adapters/_shared/tests/validate.test.cjs +0 -30
  104. package/adapters/tests/claude.test.cjs +0 -138
  105. package/adapters/tests/codex-hook.test.cjs +0 -142
  106. package/adapters/tests/codex.test.cjs +0 -430
  107. package/adapters/tests/kimi-hook.test.cjs +0 -149
  108. package/adapters/tests/kimi.test.cjs +0 -259
  109. package/adapters/tests/opencode.test.cjs +0 -357
  110. package/mcp-server/lib/archive-journal.test.cjs +0 -35
  111. package/mcp-server/lib/baseline-workflow.test.cjs +0 -477
  112. package/mcp-server/lib/change-workflow.test.cjs +0 -971
  113. package/mcp-server/lib/context-spine.test.cjs +0 -93
  114. package/mcp-server/lib/doctor.test.cjs +0 -148
  115. package/mcp-server/lib/plan-store.test.cjs +0 -132
  116. package/mcp-server/lib/prd-parser.test.cjs +0 -82
  117. package/mcp-server/lib/project-breadcrumb.test.cjs +0 -112
  118. package/mcp-server/lib/runtime-state.test.cjs +0 -92
  119. package/mcp-server/lib/spec-learning.test.cjs +0 -67
  120. package/mcp-server/lib/state-db.test.cjs +0 -314
  121. package/mcp-server/lib/task-expander.test.cjs +0 -169
  122. package/mcp-server/lib/topo.test.cjs +0 -158
  123. package/mcp-server/tests/circuit-breaker.test.cjs +0 -125
  124. package/mcp-server/tests/commit-hash-flow.test.cjs +0 -117
  125. package/mcp-server/tests/concurrency-update.test.cjs +0 -96
  126. package/mcp-server/tests/concurrency.test.cjs +0 -112
  127. package/mcp-server/tests/db-ops.test.cjs +0 -121
  128. package/mcp-server/tests/init-project.test.cjs +0 -393
  129. package/mcp-server/tests/migrate.test.cjs +0 -232
  130. package/mcp-server/tests/projector.test.cjs +0 -162
  131. package/mcp-server/tests/server-contract.test.cjs +0 -1467
  132. package/mcp-server/tests/staleness.test.cjs +0 -190
  133. package/mcp-server/tests/state-db.test.cjs +0 -106
  134. package/mcp-server/tests/state-ops.test.cjs +0 -449
  135. package/mcp-server/tests/tagged-tasks.test.cjs +0 -163
  136. package/mcp-server/tests/telemetry.test.cjs +0 -219
  137. package/orchestrator/planner/plan-builder.test.cjs +0 -165
  138. package/orchestrator/tests/auto-merge.test.cjs +0 -216
  139. package/orchestrator/tests/daemon.test.cjs +0 -311
  140. package/orchestrator/tests/dispatch-rules.test.cjs +0 -124
  141. package/orchestrator/tests/parallel-orchestrator.test.cjs +0 -233
  142. package/orchestrator/tests/phase-8b-gate.test.cjs +0 -183
  143. package/orchestrator/tests/recovery.test.cjs +0 -190
  144. package/orchestrator/tests/session-runner.test.cjs +0 -314
  145. package/orchestrator/tests/skill-miner.test.cjs +0 -147
  146. package/orchestrator/tests/worktree-manager.test.cjs +0 -148
  147. package/skills/ultra-research/references/architecture.md +0 -38
  148. package/skills/ultra-research/references/problem-product.md +0 -39
  149. package/skills/ultra-research/references/quality-delivery.md +0 -34
  150. package/skills/ultra-research/references/synthesis.md +0 -38
  151. package/skills/ultra-research/references/users-scope.md +0 -40
  152. package/ultra-tools/legacy-memory.test.cjs +0 -80
  153. package/ultra-tools/status-command.test.cjs +0 -181
  154. package/ultra-tools/system-command.test.cjs +0 -309
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultra-builder-pro.dev/schemas/baseline-reconciliation.v1.schema.json",
4
+ "title": "Ultra baseline reconciliation v1",
5
+ "type": "object",
6
+ "required": [
7
+ "$schema", "change_id", "baseline_id", "baseline_updates", "semantic_changes",
8
+ "resolved_gap_ids", "resolved_unknowns", "verification"
9
+ ],
10
+ "additionalProperties": false,
11
+ "properties": {
12
+ "$schema": { "const": "ultra-baseline-reconciliation-v1" },
13
+ "change_id": { "type": "string", "minLength": 1 },
14
+ "baseline_id": { "type": ["string", "null"] },
15
+ "baseline_updates": {
16
+ "type": "array",
17
+ "uniqueItems": true,
18
+ "items": { "type": "string", "minLength": 1 }
19
+ },
20
+ "semantic_changes": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["id", "action", "source_ref", "before_digest", "after_digest"],
25
+ "additionalProperties": false,
26
+ "properties": {
27
+ "id": { "type": "string", "pattern": "^[a-zA-Z0-9_-]+$" },
28
+ "action": { "enum": ["add", "update"] },
29
+ "source_ref": { "type": "string", "pattern": "^[^#]+#[^#]+$" },
30
+ "before_digest": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" },
31
+ "after_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" }
32
+ }
33
+ }
34
+ },
35
+ "resolved_gap_ids": {
36
+ "type": "array", "uniqueItems": true,
37
+ "items": { "type": "string", "minLength": 1 }
38
+ },
39
+ "resolved_unknowns": {
40
+ "type": "array", "uniqueItems": true,
41
+ "items": { "type": "string", "minLength": 1 }
42
+ },
43
+ "verification": {
44
+ "type": "array",
45
+ "minItems": 1,
46
+ "items": {
47
+ "type": "object",
48
+ "required": ["name", "command", "status", "evidence"],
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "name": { "type": "string", "minLength": 1 },
52
+ "command": { "type": "string", "minLength": 1 },
53
+ "status": { "const": "pass" },
54
+ "evidence": { "type": "string", "minLength": 1 }
55
+ }
56
+ }
57
+ },
58
+ "semantic_no_change_reason": { "type": ["string", "null"], "minLength": 3 }
59
+ },
60
+ "allOf": [
61
+ {
62
+ "if": { "properties": { "baseline_updates": { "maxItems": 0 } } },
63
+ "then": {
64
+ "required": ["semantic_no_change_reason"],
65
+ "properties": {
66
+ "semantic_changes": { "maxItems": 0 },
67
+ "semantic_no_change_reason": { "type": "string", "minLength": 3 }
68
+ }
69
+ },
70
+ "else": { "properties": { "semantic_changes": { "minItems": 1 } } }
71
+ }
72
+ ]
73
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultra-builder-pro.dev/schemas/delivery-report.v1.schema.json",
4
+ "title": "Ultra delivery report v1",
5
+ "type": "object",
6
+ "required": [
7
+ "$schema", "change_id", "archive_status", "baseline_id", "baseline_status",
8
+ "git_commit", "worktree_digest", "context_digest", "checks", "release", "rollback", "timestamp"
9
+ ],
10
+ "additionalProperties": false,
11
+ "properties": {
12
+ "$schema": { "const": "ultra-delivery-report-v1" },
13
+ "change_id": { "type": ["string", "null"] },
14
+ "archive_status": { "type": ["string", "null"], "enum": ["archived", null] },
15
+ "baseline_id": { "type": ["string", "null"] },
16
+ "baseline_status": { "type": ["string", "null"] },
17
+ "git_commit": { "type": ["string", "null"] },
18
+ "worktree_digest": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" },
19
+ "context_digest": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" },
20
+ "checks": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["command", "status", "exit_code", "evidence"],
25
+ "additionalProperties": false,
26
+ "properties": {
27
+ "command": { "type": "string", "minLength": 1 },
28
+ "status": { "enum": ["pass", "fail"] },
29
+ "exit_code": { "type": "integer" },
30
+ "evidence": { "type": "string", "minLength": 1 }
31
+ },
32
+ "allOf": [
33
+ {
34
+ "if": { "properties": { "status": { "const": "pass" } } },
35
+ "then": { "properties": { "exit_code": { "const": 0 } } }
36
+ },
37
+ {
38
+ "if": { "properties": { "status": { "const": "fail" } } },
39
+ "then": { "properties": { "exit_code": { "not": { "const": 0 } } } }
40
+ }
41
+ ]
42
+ }
43
+ },
44
+ "release": {
45
+ "type": "object",
46
+ "required": ["authorized", "performed", "evidence"],
47
+ "additionalProperties": false,
48
+ "properties": {
49
+ "authorized": { "type": "boolean" },
50
+ "performed": { "type": "boolean" },
51
+ "evidence": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "object",
55
+ "required": ["kind", "reference", "status", "evidence"],
56
+ "additionalProperties": false,
57
+ "properties": {
58
+ "kind": { "enum": ["commit", "push", "tag", "registry", "deploy", "release", "other"] },
59
+ "reference": { "type": "string", "minLength": 1 },
60
+ "status": { "const": "pass" },
61
+ "evidence": { "type": "string", "minLength": 1 }
62
+ }
63
+ }
64
+ },
65
+ "version": { "type": "string" },
66
+ "tag": { "type": "string" },
67
+ "commit": { "type": "string" },
68
+ "registry": { "type": "string" },
69
+ "remote": { "type": "string" }
70
+ },
71
+ "allOf": [
72
+ {
73
+ "if": { "properties": { "authorized": { "const": true } } },
74
+ "then": {
75
+ "properties": {
76
+ "performed": { "const": true },
77
+ "evidence": { "minItems": 1 }
78
+ }
79
+ },
80
+ "else": {
81
+ "properties": {
82
+ "performed": { "const": false },
83
+ "evidence": { "maxItems": 0 }
84
+ }
85
+ }
86
+ }
87
+ ]
88
+ },
89
+ "rollback": { "type": ["string", "null"] },
90
+ "timestamp": { "type": ["string", "null"], "format": "date-time" }
91
+ },
92
+ "allOf": [
93
+ {
94
+ "if": { "properties": { "archive_status": { "const": "archived" } } },
95
+ "then": {
96
+ "properties": {
97
+ "change_id": { "type": "string", "minLength": 1 },
98
+ "baseline_id": { "type": "string", "minLength": 1 },
99
+ "baseline_status": { "type": "string", "minLength": 1 },
100
+ "context_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
101
+ "checks": {
102
+ "minItems": 1,
103
+ "items": { "properties": { "status": { "const": "pass" }, "exit_code": { "const": 0 } } }
104
+ },
105
+ "rollback": { "type": "string", "minLength": 1 },
106
+ "timestamp": { "type": "string", "format": "date-time" }
107
+ }
108
+ }
109
+ }
110
+ ]
111
+ }
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "family": {
62
62
  "type": "string",
63
- "enum": ["task", "memory", "review", "impact", "skill", "session", "ask", "plan", "baseline", "change", "system"]
63
+ "enum": ["task", "memory", "review", "impact", "skill", "session", "ask", "plan", "baseline", "change", "workflow", "system"]
64
64
  },
65
65
  "description": { "type": "string", "minLength": 10 },
66
66
  "phase": {
@@ -33,6 +33,7 @@ CREATE TABLE IF NOT EXISTS baselines (
33
33
  worktree_digest TEXT,
34
34
  worktree_files_json TEXT NOT NULL DEFAULT '[]',
35
35
  worktree_accepted INTEGER NOT NULL DEFAULT 0 CHECK (worktree_accepted IN (0, 1)),
36
+ known_red_accepted INTEGER NOT NULL DEFAULT 0 CHECK (known_red_accepted IN (0, 1)),
36
37
  spec_refs_json TEXT NOT NULL DEFAULT '[]',
37
38
  evidence_json TEXT NOT NULL DEFAULT '[]',
38
39
  verification_json TEXT NOT NULL DEFAULT '[]',
@@ -40,6 +41,7 @@ CREATE TABLE IF NOT EXISTS baselines (
40
41
  gaps_json TEXT NOT NULL DEFAULT '[]',
41
42
  classification_json TEXT NOT NULL DEFAULT '{}',
42
43
  provider_refs_json TEXT NOT NULL DEFAULT '{}',
44
+ research_run_id TEXT,
43
45
  approved_by TEXT,
44
46
  approval_note TEXT,
45
47
  started_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
@@ -62,6 +64,9 @@ CREATE TABLE IF NOT EXISTS changes (
62
64
  docs_impact_json TEXT NOT NULL DEFAULT '{"status":"unknown","files":[],"rationale":null}',
63
65
  provider_refs_json TEXT NOT NULL DEFAULT '{}',
64
66
  baseline_bypass_json TEXT,
67
+ contract_json TEXT NOT NULL DEFAULT '{}',
68
+ classification_json TEXT NOT NULL DEFAULT '{}',
69
+ research_disposition_json TEXT NOT NULL DEFAULT '{}',
65
70
  base_commit TEXT,
66
71
  artifact_root TEXT NOT NULL,
67
72
  created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
@@ -88,9 +93,16 @@ CREATE TABLE IF NOT EXISTS tasks (
88
93
  files_modified TEXT, -- JSON array of paths (Phase 8B conflict detection)
89
94
  session_id TEXT, -- current owning session (Phase 4.5)
90
95
  stale INTEGER NOT NULL DEFAULT 0 CHECK (stale IN (0, 1)),
91
- complexity_hint TEXT CHECK (complexity_hint IN ('haiku', 'sonnet', 'opus')),
92
96
  tag TEXT, -- git branch tag (Phase 7.2)
93
97
  trace_to TEXT, -- spec anchor reference
98
+ outcome TEXT, -- observable result owned by this task
99
+ slice_kind TEXT CHECK (slice_kind IS NULL OR slice_kind IN ('tracer_bullet', 'expand_contract', 'integration_checkpoint')),
100
+ public_seam TEXT, -- externally observable seam exercised by the slice
101
+ verification_command TEXT, -- exact task-level verification command
102
+ acceptance_json TEXT NOT NULL DEFAULT '[]',
103
+ context_refs_json TEXT NOT NULL DEFAULT '[]',
104
+ docs_impact_json TEXT NOT NULL DEFAULT '{"status":"unknown","files":[],"rationale":null}',
105
+ ownership_json TEXT NOT NULL DEFAULT '{}',
94
106
  context_file TEXT, -- projection target path
95
107
  completion_commit TEXT, -- backfilled hash (Phase 2.8)
96
108
  change_id TEXT REFERENCES changes(id) ON DELETE SET NULL,
@@ -261,6 +273,10 @@ CREATE TABLE IF NOT EXISTS spec_learning_candidates (
261
273
  status TEXT NOT NULL DEFAULT 'proposed'
262
274
  CHECK (status IN ('proposed', 'approved', 'rejected', 'applied')),
263
275
  resolution TEXT,
276
+ applied_ref TEXT,
277
+ before_digest TEXT,
278
+ after_digest TEXT,
279
+ apply_evidence_json TEXT NOT NULL DEFAULT '[]',
264
280
  proposed_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
265
281
  resolved_at TEXT,
266
282
  applied_at TEXT
@@ -328,6 +344,65 @@ CREATE TABLE IF NOT EXISTS event_consumers (
328
344
  updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
329
345
  );
330
346
 
347
+ -- ──────────────────────────── workflow runs ───────────────────────────────
348
+ -- Skills own judgment and artifact content. MCP owns durable transitions,
349
+ -- evidence references, output digests, blockers, and recovery position.
350
+ CREATE TABLE IF NOT EXISTS workflow_runs (
351
+ id TEXT PRIMARY KEY,
352
+ kind TEXT NOT NULL
353
+ CHECK (kind IN ('init', 'research', 'plan', 'change', 'dev', 'test', 'review', 'deliver')),
354
+ mode TEXT,
355
+ subject TEXT NOT NULL,
356
+ definition_version TEXT NOT NULL DEFAULT '1.0',
357
+ status TEXT NOT NULL DEFAULT 'active'
358
+ CHECK (status IN ('active', 'blocked', 'ready', 'completed', 'cancelled')),
359
+ current_step TEXT,
360
+ baseline_id TEXT REFERENCES baselines(id) ON DELETE SET NULL,
361
+ change_id TEXT REFERENCES changes(id) ON DELETE SET NULL,
362
+ task_id TEXT REFERENCES tasks(id) ON DELETE SET NULL,
363
+ metadata_json TEXT NOT NULL DEFAULT '{}',
364
+ blockers_json TEXT NOT NULL DEFAULT '[]',
365
+ approval_json TEXT,
366
+ summary_json TEXT NOT NULL DEFAULT '{}',
367
+ started_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
368
+ updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
369
+ completed_at TEXT
370
+ );
371
+
372
+ CREATE INDEX IF NOT EXISTS workflow_runs_status
373
+ ON workflow_runs(status, kind, updated_at);
374
+ CREATE INDEX IF NOT EXISTS workflow_runs_baseline
375
+ ON workflow_runs(baseline_id, kind, updated_at);
376
+ CREATE INDEX IF NOT EXISTS workflow_runs_change
377
+ ON workflow_runs(change_id, kind, updated_at);
378
+ CREATE INDEX IF NOT EXISTS workflow_runs_task
379
+ ON workflow_runs(task_id, kind, updated_at);
380
+
381
+ CREATE TABLE IF NOT EXISTS workflow_steps (
382
+ run_id TEXT NOT NULL REFERENCES workflow_runs(id) ON DELETE CASCADE,
383
+ step_id TEXT NOT NULL,
384
+ position INTEGER NOT NULL CHECK (position >= 0),
385
+ title TEXT NOT NULL,
386
+ required INTEGER NOT NULL DEFAULT 1 CHECK (required IN (0, 1)),
387
+ status TEXT NOT NULL DEFAULT 'pending'
388
+ CHECK (status IN ('pending', 'in_progress', 'completed', 'skipped', 'blocked')),
389
+ evidence_json TEXT NOT NULL DEFAULT '[]',
390
+ outputs_json TEXT NOT NULL DEFAULT '[]',
391
+ decisions_json TEXT NOT NULL DEFAULT '[]',
392
+ semantic_records_json TEXT NOT NULL DEFAULT '[]',
393
+ blockers_json TEXT NOT NULL DEFAULT '[]',
394
+ skip_reason TEXT,
395
+ started_at TEXT,
396
+ completed_at TEXT,
397
+ updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
398
+ PRIMARY KEY (run_id, step_id)
399
+ );
400
+
401
+ CREATE UNIQUE INDEX IF NOT EXISTS workflow_steps_position
402
+ ON workflow_steps(run_id, position);
403
+ CREATE INDEX IF NOT EXISTS workflow_steps_status
404
+ ON workflow_steps(run_id, status, position);
405
+
331
406
  -- ──────────────────────────── seed: schema_version ────────────────────────
332
407
  INSERT OR IGNORE INTO schema_version (version, description)
333
408
  VALUES ('4.5', 'Phase 2 initial — tasks/events/sessions/schema_version/migration_history/telemetry/specs_refs');
@@ -347,3 +422,9 @@ INSERT OR IGNORE INTO schema_version (version, description)
347
422
  VALUES ('11.0', 'Greenfield and brownfield baseline adoption, convergence, and drift authority');
348
423
  INSERT OR IGNORE INTO schema_version (version, description)
349
424
  VALUES ('12.0', 'Evidence-backed repository snapshots, gap ledger, safe re-adoption, and incident break-glass governance');
425
+ INSERT OR IGNORE INTO schema_version (version, description)
426
+ VALUES ('13.0', 'Durable cross-stage workflow runs, step evidence, output digests, blockers, and recovery');
427
+ INSERT OR IGNORE INTO schema_version (version, description)
428
+ VALUES ('14.0', 'Continuously revalidated baseline authority and persisted known-red acceptance');
429
+ INSERT OR IGNORE INTO schema_version (version, description)
430
+ VALUES ('15.0', 'Typed research semantics, complete change contracts, verified learning application, and reconciliation provenance');
@@ -54,9 +54,16 @@
54
54
  "x-derived": true,
55
55
  "description": "DERIVED from staleness propagation (Phase 5.3)"
56
56
  },
57
- "complexity_hint": { "type": "string", "enum": ["haiku", "sonnet", "opus"] },
58
57
  "tag": { "type": "string" },
59
58
  "trace_to": { "type": "string" },
59
+ "outcome": { "type": "string" },
60
+ "slice_kind": { "type": "string", "enum": ["tracer_bullet", "expand_contract", "integration_checkpoint"] },
61
+ "public_seam": { "type": "string" },
62
+ "verification_command": { "type": "string" },
63
+ "acceptance": { "type": "array", "items": { "type": "object" } },
64
+ "context_refs": { "type": "array", "items": { "type": "object" } },
65
+ "docs_impact": { "type": "object" },
66
+ "ownership": { "type": "object" },
60
67
  "context_file": { "type": "string" },
61
68
  "completion_commit": { "type": "string", "pattern": "^[0-9a-f]{7,40}$" },
62
69
  "created_at": { "type": "string", "format": "date-time" },
@@ -0,0 +1,194 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ultra-builder-pro.dev/schemas/test-report.v1.schema.json",
4
+ "title": "Ultra test report v1",
5
+ "type": "object",
6
+ "required": [
7
+ "$schema", "change_id", "task_ids", "git_commit", "worktree_digest",
8
+ "context_digest", "acceptance", "commands", "public_seams", "failures",
9
+ "recovery", "verification_dimensions", "regression_signal", "passed", "run_count",
10
+ "timestamp", "blocking_issues"
11
+ ],
12
+ "additionalProperties": false,
13
+ "properties": {
14
+ "$schema": { "const": "ultra-test-report-v1" },
15
+ "change_id": { "type": ["string", "null"] },
16
+ "task_ids": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
17
+ "git_commit": { "type": ["string", "null"] },
18
+ "worktree_digest": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" },
19
+ "context_digest": { "type": ["string", "null"], "pattern": "^[0-9a-f]{64}$" },
20
+ "acceptance": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["id", "status", "evidence"],
25
+ "additionalProperties": false,
26
+ "properties": {
27
+ "id": { "type": "string", "minLength": 1 },
28
+ "status": { "enum": ["pass", "fail"] },
29
+ "evidence": { "type": "string", "minLength": 1 }
30
+ }
31
+ }
32
+ },
33
+ "commands": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "required": ["command", "status", "exit_code", "evidence"],
38
+ "additionalProperties": false,
39
+ "properties": {
40
+ "command": { "type": "string", "minLength": 1 },
41
+ "status": { "enum": ["pass", "fail"] },
42
+ "exit_code": { "type": "integer" },
43
+ "evidence": { "type": "string", "minLength": 1 }
44
+ },
45
+ "allOf": [
46
+ {
47
+ "if": { "properties": { "status": { "const": "pass" } } },
48
+ "then": { "properties": { "exit_code": { "const": 0 } } }
49
+ },
50
+ {
51
+ "if": { "properties": { "status": { "const": "fail" } } },
52
+ "then": { "properties": { "exit_code": { "not": { "const": 0 } } } }
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ "public_seams": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "object",
61
+ "required": ["seam", "status", "evidence"],
62
+ "additionalProperties": false,
63
+ "properties": {
64
+ "seam": { "type": "string", "minLength": 1 },
65
+ "status": { "enum": ["pass", "fail"] },
66
+ "evidence": { "type": "string", "minLength": 1 }
67
+ }
68
+ }
69
+ },
70
+ "failures": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "required": ["symptom", "status", "evidence"],
75
+ "additionalProperties": false,
76
+ "properties": {
77
+ "symptom": { "type": "string", "minLength": 1 },
78
+ "status": { "enum": ["resolved", "unresolved"] },
79
+ "evidence": { "type": "string", "minLength": 1 }
80
+ }
81
+ }
82
+ },
83
+ "recovery": {
84
+ "type": "array",
85
+ "items": {
86
+ "type": "object",
87
+ "required": ["scenario", "status", "evidence"],
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "scenario": { "type": "string", "minLength": 1 },
91
+ "status": { "enum": ["pass", "fail"] },
92
+ "evidence": { "type": "string", "minLength": 1 }
93
+ }
94
+ }
95
+ },
96
+ "verification_dimensions": {
97
+ "type": "object",
98
+ "required": [
99
+ "acceptance", "regression", "integration", "static_analysis",
100
+ "build", "performance", "security", "recovery"
101
+ ],
102
+ "additionalProperties": false,
103
+ "properties": {
104
+ "acceptance": { "$ref": "#/$defs/verificationDimension" },
105
+ "regression": { "$ref": "#/$defs/verificationDimension" },
106
+ "integration": { "$ref": "#/$defs/verificationDimension" },
107
+ "static_analysis": { "$ref": "#/$defs/verificationDimension" },
108
+ "build": { "$ref": "#/$defs/verificationDimension" },
109
+ "performance": { "$ref": "#/$defs/verificationDimension" },
110
+ "security": { "$ref": "#/$defs/verificationDimension" },
111
+ "recovery": { "$ref": "#/$defs/verificationDimension" }
112
+ }
113
+ },
114
+ "regression_signal": {
115
+ "type": ["object", "null"],
116
+ "required": ["command", "expected_red", "observed_red", "observed_green", "deterministic", "evidence"],
117
+ "additionalProperties": false,
118
+ "properties": {
119
+ "command": { "type": "string", "minLength": 1 },
120
+ "expected_red": { "type": "string", "minLength": 1 },
121
+ "observed_red": { "type": "boolean" },
122
+ "observed_green": { "type": "boolean" },
123
+ "deterministic": { "type": "boolean" },
124
+ "duration_ms": { "type": "number", "minimum": 0 },
125
+ "evidence": { "type": "string", "minLength": 1 }
126
+ }
127
+ },
128
+ "passed": { "type": "boolean" },
129
+ "run_count": { "type": "integer", "minimum": 0 },
130
+ "timestamp": { "type": ["string", "null"], "format": "date-time" },
131
+ "blocking_issues": { "type": "array", "items": { "type": "string" } }
132
+ },
133
+ "$defs": {
134
+ "verificationDimension": {
135
+ "type": "object",
136
+ "required": ["status", "evidence", "rationale"],
137
+ "additionalProperties": false,
138
+ "properties": {
139
+ "status": { "enum": ["pass", "fail", "not_run", "not_applicable"] },
140
+ "evidence": {
141
+ "type": "array",
142
+ "items": { "type": "string", "minLength": 1 }
143
+ },
144
+ "rationale": { "type": "string", "minLength": 3 }
145
+ },
146
+ "allOf": [
147
+ {
148
+ "if": { "properties": { "status": { "enum": ["pass", "fail"] } } },
149
+ "then": { "properties": { "evidence": { "minItems": 1 } } }
150
+ }
151
+ ]
152
+ }
153
+ },
154
+ "allOf": [
155
+ {
156
+ "if": { "properties": { "passed": { "const": true } } },
157
+ "then": {
158
+ "properties": {
159
+ "change_id": { "type": "string", "minLength": 1 },
160
+ "context_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
161
+ "acceptance": {
162
+ "minItems": 1,
163
+ "items": { "properties": { "status": { "const": "pass" } } }
164
+ },
165
+ "commands": {
166
+ "minItems": 1,
167
+ "items": { "properties": { "status": { "const": "pass" }, "exit_code": { "const": 0 } } }
168
+ },
169
+ "public_seams": {
170
+ "minItems": 1,
171
+ "items": { "properties": { "status": { "const": "pass" } } }
172
+ },
173
+ "failures": { "items": { "properties": { "status": { "const": "resolved" } } } },
174
+ "recovery": { "items": { "properties": { "status": { "const": "pass" } } } },
175
+ "verification_dimensions": {
176
+ "properties": {
177
+ "acceptance": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
178
+ "regression": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
179
+ "integration": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
180
+ "static_analysis": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
181
+ "build": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
182
+ "performance": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
183
+ "security": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } },
184
+ "recovery": { "properties": { "status": { "enum": ["pass", "not_applicable"] } } }
185
+ }
186
+ },
187
+ "run_count": { "minimum": 1 },
188
+ "timestamp": { "type": "string", "format": "date-time" },
189
+ "blocking_issues": { "maxItems": 0 }
190
+ }
191
+ }
192
+ }
193
+ ]
194
+ }
@@ -38,7 +38,7 @@ SUBCOMMANDS:
38
38
  system doctor [--repair] | restore | rebaseline
39
39
  status [--cost] [--since <duration>] [--json]
40
40
  db init | checkpoint | vacuum | integrity | backup (Phase 2)
41
- migrate --from=<4.4|4.5> --to=<4.5|12.0> [--dry|--rollback]
41
+ migrate --from=<4.4|4.5> --to=<4.5|15.0> [--dry|--rollback]
42
42
  legacy-memory inspect | archive | prune --confirm DELETE_ULTRA_LEGACY_MEMORY
43
43
 
44
44
  --help / -h show this message
@@ -4,7 +4,7 @@ const fs = require('node:fs');
4
4
  const path = require('node:path');
5
5
 
6
6
  const {
7
- initStateDb, openStateDb, closeStateDb, MIGRATED_GAPS,
7
+ EXPECTED_VERSION, initStateDb, openStateDb, closeStateDb, MIGRATED_GAPS,
8
8
  } = require('../../mcp-server/lib/state-db.cjs');
9
9
  const ops = require('../../mcp-server/lib/state-ops.cjs');
10
10
  const projector = require('../../mcp-server/lib/projector.cjs');
@@ -12,7 +12,7 @@ const projector = require('../../mcp-server/lib/projector.cjs');
12
12
  const DEFAULT_FROM = '4.4';
13
13
  const SUPPORTED_TRANSITIONS = Object.freeze({
14
14
  '4.4': '4.5',
15
- '4.5': '12.0',
15
+ '4.5': EXPECTED_VERSION,
16
16
  });
17
17
 
18
18
  // Frozen SQL — values flow through parameter bindings.
@@ -443,7 +443,7 @@ const USAGE = `ultra-tools migrate --from=<version> --to=<version> [flags]
443
443
 
444
444
  Supported transitions:
445
445
  4.4 -> 4.5 import the legacy task projection into authoritative state
446
- 4.5 -> 12.0 import a projection-only project into current authoritative state
446
+ 4.5 -> ${EXPECTED_VERSION} import a projection-only project into current authoritative state
447
447
 
448
448
  Flags:
449
449
  --source-dir <dir> project root containing .ultra/ (default: .)