ultra-builder-pro-cli 0.19.1 → 0.21.1

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 (103) hide show
  1. package/.ultra-template/docs/research/README.md +26 -5
  2. package/.ultra-template/specs/discovery.md +1 -1
  3. package/.ultra-template/tasks/tasks.json +1 -1
  4. package/CHANGELOG.md +90 -1
  5. package/README.md +62 -29
  6. package/adapters/_shared/codex-assets.cjs +69 -11
  7. package/adapters/_shared/interaction-contract.cjs +60 -5
  8. package/adapters/_shared/runtime-assets.cjs +41 -1
  9. package/adapters/claude.js +7 -5
  10. package/adapters/codex.js +1 -1
  11. package/adapters/kimi.js +2 -8
  12. package/adapters/opencode.js +30 -28
  13. package/bin/orchestrator.js +64 -24
  14. package/commands/ultra-research.md +1 -1
  15. package/docs/AGENT-CONTEXT.md +79 -45
  16. package/docs/ARCHITECTURE.md +75 -38
  17. package/docs/ARTIFACT-AUTHORITY.md +234 -0
  18. package/docs/DECISIONS.md +20 -10
  19. package/docs/LEGACY-CLI-CROSSWALK.md +15 -11
  20. package/docs/PLUGIN-ISOLATION-CONTRACT.md +4 -3
  21. package/docs/ROADMAP.md +21 -6
  22. package/docs/RUNTIME-COMPAT-MATRIX.md +30 -13
  23. package/docs/STATE-DB-ACCESS-POLICY.md +11 -9
  24. package/docs/WORKFLOW-LIFECYCLE.md +105 -54
  25. package/hooks/README.md +6 -5
  26. package/hooks/active_task_context.py +97 -12
  27. package/hooks/context_spine.py +16 -4
  28. package/hooks/health_check.py +5 -4
  29. package/hooks/pre_stop_check.py +5 -2
  30. package/hooks/runtime_paths.py +396 -0
  31. package/hooks/subagent_tracker.py +5 -2
  32. package/hooks/workflow_checkpoint.py +16 -3
  33. package/hooks/workflow_context.py +11 -3
  34. package/hooks/workflow_resume.py +7 -4
  35. package/mcp-server/breadcrumb.cjs +20 -2
  36. package/mcp-server/lib/archive-journal.cjs +1026 -111
  37. package/mcp-server/lib/archive-mutation-worker.py +365 -0
  38. package/mcp-server/lib/artifact-registry.cjs +1126 -0
  39. package/mcp-server/lib/baseline-workflow.cjs +9 -4
  40. package/mcp-server/lib/change-packet.cjs +818 -0
  41. package/mcp-server/lib/change-workflow.cjs +932 -176
  42. package/mcp-server/lib/context-paths.cjs +111 -0
  43. package/mcp-server/lib/context-spine.cjs +511 -45
  44. package/mcp-server/lib/decision-dialogue.cjs +427 -12
  45. package/mcp-server/lib/delivery-transaction.cjs +471 -0
  46. package/mcp-server/lib/doctor-backup-worker.cjs +328 -0
  47. package/mcp-server/lib/doctor.cjs +375 -12
  48. package/mcp-server/lib/git-bootstrap.cjs +459 -47
  49. package/mcp-server/lib/init-project.cjs +190 -95
  50. package/mcp-server/lib/plan-publication-worker.cjs +830 -0
  51. package/mcp-server/lib/plan-store.cjs +700 -5
  52. package/mcp-server/lib/project-breadcrumb.cjs +23 -4
  53. package/mcp-server/lib/projector.cjs +174 -40
  54. package/mcp-server/lib/runtime-paths.cjs +1687 -0
  55. package/mcp-server/lib/safe-project-file.cjs +385 -0
  56. package/mcp-server/lib/spec-learning.cjs +28 -12
  57. package/mcp-server/lib/state-db.cjs +397 -13
  58. package/mcp-server/lib/state-ops.cjs +248 -49
  59. package/mcp-server/lib/telemetry.cjs +12 -3
  60. package/mcp-server/lib/workflow-state.cjs +614 -62
  61. package/mcp-server/server.cjs +282 -33
  62. package/orchestrator/daemon.cjs +2 -10
  63. package/orchestrator/parallel-orchestrator.cjs +314 -50
  64. package/orchestrator/planner/plan-builder.cjs +1 -1
  65. package/orchestrator/recovery.cjs +125 -7
  66. package/orchestrator/session-close-journal-worker.cjs +5 -0
  67. package/orchestrator/session-close-journal.cjs +1014 -0
  68. package/orchestrator/session-runner.cjs +679 -69
  69. package/orchestrator/worktree-manager.cjs +186 -35
  70. package/package.json +2 -3
  71. package/skills/cc-collab/SKILL.md +4 -1
  72. package/skills/codex-collab/SKILL.md +5 -2
  73. package/skills/ultra-change/SKILL.md +38 -13
  74. package/skills/ultra-deliver/SKILL.md +23 -11
  75. package/skills/ultra-dev/SKILL.md +33 -6
  76. package/skills/ultra-doctor/SKILL.md +6 -2
  77. package/skills/ultra-init/SKILL.md +4 -2
  78. package/skills/ultra-plan/SKILL.md +68 -18
  79. package/skills/ultra-research/SKILL.md +45 -32
  80. package/skills/ultra-review/SKILL.md +9 -5
  81. package/skills/ultra-status/SKILL.md +9 -4
  82. package/skills/ultra-test/SKILL.md +15 -7
  83. package/skills/ultra-think/SKILL.md +6 -0
  84. package/skills/ultra-think/references/decision-dialogue.md +61 -14
  85. package/skills/ultra-verify/SKILL.md +4 -1
  86. package/spec/cli-protocol.md +19 -7
  87. package/spec/mcp-tools.yaml +531 -46
  88. package/spec/schemas/change-delta.v1.schema.json +153 -0
  89. package/spec/schemas/documentation-reconciliation.v1.schema.json +106 -0
  90. package/spec/schemas/mcp-tools.schema.json +1 -1
  91. package/spec/schemas/state-db.sql +57 -17
  92. package/spec/schemas/tasks.v4.5.schema.json +1 -1
  93. package/ultra-tools/cli.cjs +3 -2
  94. package/ultra-tools/commands/db.cjs +76 -25
  95. package/ultra-tools/commands/migrate.cjs +995 -80
  96. package/ultra-tools/commands/session.cjs +34 -8
  97. package/ultra-tools/commands/status.cjs +34 -7
  98. package/ultra-tools/commands/system.cjs +129 -22
  99. package/commands/learn.md +0 -10
  100. package/orchestrator/skill-miner.cjs +0 -133
  101. package/output-styles/coding-vibes.md +0 -67
  102. package/output-styles/structural-thinking.md +0 -61
  103. package/skills/learn/SKILL.md +0 -58
@@ -27,6 +27,7 @@ families:
27
27
  - { name: change, description: 'continuous post-delivery change lifecycle and convergence', phase: '9' }
28
28
  - { name: decision, description: 'durable owner-agent alignment, one-question presentation, and approved checkpoints', phase: '16' }
29
29
  - { name: workflow, description: 'durable cross-stage run position, evidence, outputs, blockers, and recovery', phase: '13' }
30
+ - { name: artifact, description: 'typed semantic and evidence artifact ownership, digest, provenance, and dependency graph', phase: '20' }
30
31
  - { name: system, description: 'read-only diagnostics and explicit backup-first repair', phase: '9' }
31
32
 
32
33
  tools:
@@ -80,6 +81,11 @@ tools:
80
81
  reason: { type: string, minLength: 1 }
81
82
  kind: { type: string, enum: [spec, source, test, docs, external], default: source }
82
83
  required: { type: boolean, default: true }
84
+ expected_digest: { type: string, pattern: '^[0-9a-f]{64}$' }
85
+ digest: { type: string, pattern: '^[0-9a-f]{64}$', description: 'legacy alias for expected_digest' }
86
+ anchor: { type: string, minLength: 1 }
87
+ scope: { type: string, minLength: 1 }
88
+ freshness_policy: { type: string, enum: [digest, existence, advisory] }
83
89
  docs_impact:
84
90
  type: object
85
91
  required: [status, files, rationale]
@@ -599,7 +605,7 @@ tools:
599
605
  takeover: { type: boolean, default: false, description: 'override active lease (D33 takeover strategy)' }
600
606
  worktree_base:
601
607
  type: string
602
- description: optional path resolving inside the repository `.ultra/worktrees` boundary; outside paths are rejected
608
+ description: optional path resolving inside the repository `.ultra/.runtime/worktrees` boundary; outside paths are rejected
603
609
  output_schema:
604
610
  type: object
605
611
  required: [sid, worktree_path, artifact_dir, lease_expires_at, worktree_created]
@@ -613,6 +619,7 @@ tools:
613
619
  errors:
614
620
  - { code: TASK_NOT_FOUND, description: 'task id missing' }
615
621
  - { code: ADMISSION_DENIED, description: 'active lease exists; choose takeover/resume/abandon' }
622
+ - { code: SESSION_CLOSE_PENDING, description: 'an unfinished durable close intent must recover before spawn or takeover' }
616
623
  - { code: NESTED_SESSION_FORBIDDEN, description: 'an active worker must resume its assigned session instead of recursively spawning another one' }
617
624
  - { code: TAKEOVER_FAILED, description: 'prior owned worker could not be terminated safely' }
618
625
  - { code: TASK_EXECUTION_CONTRACT_INCOMPLETE, description: 'change-owned task contract is incomplete' }
@@ -621,9 +628,12 @@ tools:
621
628
  - { code: WORKFLOW_PLAN_NOT_COMPLETED, description: 'owning change has no healthy completed plan workflow' }
622
629
  - { code: WORKFLOW_PLAN_TASK_SET_STALE, description: 'change task set differs from the current converged plan' }
623
630
  - { code: WORKFLOW_PLAN_TASK_CONTRACT_STALE, description: 'task contract differs from the current converged plan' }
631
+ - { code: WORKFLOW_PLAN_CONTEXT_STALE, description: 'the planning Context no longer matches the current checkout or required references' }
632
+ - { code: WORKFLOW_IMPLEMENTATION_CONTEXT_REQUIRED, description: 'the task has no exact ready implementation Context' }
633
+ - { code: WORKFLOW_IMPLEMENTATION_CONTEXT_STALE, description: 'the task implementation Context is stale, blocked, or bound to different authority' }
624
634
  - { code: WORKTREE_SCOPE_INVALID, description: 'requested worktree base escapes the managed project boundary' }
625
635
  - { code: WORKTREE_FAILED, description: 'Git worktree creation failed or the repository has no usable HEAD' }
626
- - { code: WORKTREE_AUTHORITY_MISSING, description: 'central `.ultra/state.db` disappeared before worktree binding' }
636
+ - { code: WORKTREE_AUTHORITY_MISSING, description: 'central `.ultra/.runtime/state.db` disappeared before worktree binding' }
627
637
  - { code: WORKTREE_AUTHORITY_NOT_IGNORED, description: 'a safe local ignore rule for the `.ultra` authority link could not be established' }
628
638
  - { code: WORKTREE_AUTHORITY_CONFLICT, description: 'the isolated checkout already contains a conflicting `.ultra` entry' }
629
639
  - { code: WORKTREE_AUTHORITY_LINK_FAILED, description: 'the isolated checkout could not be linked to central Ultra authority' }
@@ -642,7 +652,7 @@ tools:
642
652
  additionalProperties: false
643
653
  properties:
644
654
  sid: { type: string }
645
- status: { type: string, enum: [completed, crashed, orphan] }
655
+ status: { type: string, enum: [completed, crashed] }
646
656
  remove_worktree: { type: boolean, default: false }
647
657
  output_schema:
648
658
  type: object
@@ -657,7 +667,7 @@ tools:
657
667
  - { code: SESSION_SCOPE_VIOLATION, description: 'an active worker attempted to close a session it does not own' }
658
668
  - { code: WORKTREE_NOT_INTEGRATED, description: 'Explicit cleanup refused because work is uncommitted, unverified, or not integrated into the current checkout' }
659
669
  cli_subcommand: session close
660
- emits_events: [session_closed, session_crashed, session_orphaned]
670
+ emits_events: [session_closed, session_crashed]
661
671
  trace_to: '§7.3, D32'
662
672
 
663
673
  - name: session.get
@@ -734,7 +744,7 @@ tools:
734
744
  heartbeat_age_ms: { type: integer, minimum: 0 }
735
745
  recommended_action:
736
746
  type: string
737
- enum: [spawn, takeover, resume, abandon, blocked_by_breaker]
747
+ enum: [spawn, takeover, resume, abandon, recover_close, blocked_by_breaker]
738
748
  errors:
739
749
  - { code: TASK_NOT_FOUND, description: 'task id missing' }
740
750
  - { code: TASK_EXECUTION_CONTRACT_INCOMPLETE, description: 'change-owned task contract is incomplete' }
@@ -743,6 +753,9 @@ tools:
743
753
  - { code: WORKFLOW_PLAN_NOT_COMPLETED, description: 'owning change has no healthy completed plan workflow' }
744
754
  - { code: WORKFLOW_PLAN_TASK_SET_STALE, description: 'change task set differs from the current converged plan' }
745
755
  - { code: WORKFLOW_PLAN_TASK_CONTRACT_STALE, description: 'task contract differs from the current converged plan' }
756
+ - { code: WORKFLOW_PLAN_CONTEXT_STALE, description: 'the planning Context no longer matches the current checkout or required references' }
757
+ - { code: WORKFLOW_IMPLEMENTATION_CONTEXT_REQUIRED, description: 'the task has no exact ready implementation Context' }
758
+ - { code: WORKFLOW_IMPLEMENTATION_CONTEXT_STALE, description: 'the task implementation Context is stale, blocked, or bound to different authority' }
746
759
  cli_subcommand: session admission
747
760
  emits_events: []
748
761
  trace_to: '§7.3, D33'
@@ -1184,7 +1197,7 @@ tools:
1184
1197
 
1185
1198
  - name: change.update
1186
1199
  family: change
1187
- description: Update mutable change authority. Semantic changes invalidate every derived task and compiled context so they must be reconciled before execution.
1200
+ description: Update mutable change authority. Semantic changes invalidate only registered transitive consumers so affected tasks and contexts must be reconciled before execution.
1188
1201
  phase: '9'
1189
1202
  writer_role: mcp
1190
1203
  input_schema:
@@ -1251,6 +1264,197 @@ tools:
1251
1264
  cli_subcommand: change update
1252
1265
  emits_events: [task_stale_marked, change_updated]
1253
1266
 
1267
+ - name: change.delta
1268
+ family: change
1269
+ description: Record the typed Change-owned delta overlay against exact baseline anchors without mutating baseline specifications.
1270
+ phase: '21'
1271
+ writer_role: mcp
1272
+ input_schema:
1273
+ type: object
1274
+ required:
1275
+ [id, baseline_anchor, decisions, non_goals, acceptance, documentation_impact, unknowns, mutations]
1276
+ additionalProperties: false
1277
+ properties:
1278
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
1279
+ baseline_anchor:
1280
+ type: object
1281
+ required: [baseline_id, repository_revision, specs]
1282
+ additionalProperties: false
1283
+ properties:
1284
+ baseline_id: { type: string, minLength: 1 }
1285
+ repository_revision: { type: ['string', 'null'] }
1286
+ specs:
1287
+ type: array
1288
+ items:
1289
+ type: object
1290
+ required: [path, digest]
1291
+ additionalProperties: false
1292
+ properties:
1293
+ path: { type: string, minLength: 1 }
1294
+ digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1295
+ decisions:
1296
+ type: array
1297
+ items:
1298
+ type: object
1299
+ required: [id, summary]
1300
+ additionalProperties: false
1301
+ properties:
1302
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
1303
+ summary: { type: string, minLength: 1 }
1304
+ rationale: { type: string, minLength: 1 }
1305
+ non_goals: { type: array, uniqueItems: true, items: { type: string, minLength: 1 } }
1306
+ acceptance:
1307
+ type: array
1308
+ minItems: 1
1309
+ items:
1310
+ type: object
1311
+ required: [id, criterion, verification]
1312
+ additionalProperties: false
1313
+ properties:
1314
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
1315
+ criterion: { type: string, minLength: 1 }
1316
+ verification: { type: string, minLength: 1 }
1317
+ documentation_impact:
1318
+ type: object
1319
+ required: [status, files, rationale]
1320
+ additionalProperties: false
1321
+ properties:
1322
+ status: { type: string, enum: [none, required] }
1323
+ files: { type: array, uniqueItems: true, items: { type: string, minLength: 1 } }
1324
+ rationale: { type: string, minLength: 3 }
1325
+ unknowns:
1326
+ type: array
1327
+ items:
1328
+ type: object
1329
+ required: [id, summary, blocking]
1330
+ additionalProperties: false
1331
+ properties:
1332
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
1333
+ summary: { type: string, minLength: 1 }
1334
+ blocking: { type: boolean }
1335
+ no_semantic_change_reason: { type: string, minLength: 3 }
1336
+ mutations:
1337
+ type: array
1338
+ items:
1339
+ type: object
1340
+ required:
1341
+ [id, action, target_path, overlay_path, before_digest, after_digest, acceptance_refs, documentation_refs]
1342
+ additionalProperties: false
1343
+ properties:
1344
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
1345
+ action: { type: string, enum: [add, update] }
1346
+ target_path: { type: string, minLength: 1 }
1347
+ overlay_path: { type: string, minLength: 1 }
1348
+ before_digest: { type: ['string', 'null'], pattern: '^[0-9a-f]{64}$' }
1349
+ after_digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1350
+ acceptance_refs: { type: array, minItems: 1, uniqueItems: true, items: { type: string, minLength: 1 } }
1351
+ documentation_refs: { type: array, uniqueItems: true, items: { type: string, minLength: 1 } }
1352
+ allOf:
1353
+ - if:
1354
+ properties:
1355
+ mutations: { maxItems: 0 }
1356
+ then:
1357
+ required: [no_semantic_change_reason]
1358
+ output_schema:
1359
+ type: object
1360
+ required: [delta, artifact, payload_artifacts, progress_artifact]
1361
+ additionalProperties: false
1362
+ properties:
1363
+ delta: { type: object }
1364
+ artifact: { type: object }
1365
+ payload_artifacts: { type: array, items: { type: object } }
1366
+ progress_artifact: { type: object }
1367
+ errors:
1368
+ - { code: CHANGE_NOT_FOUND, description: 'change id does not exist' }
1369
+ - { code: CHANGE_NOT_MUTABLE, description: 'terminal Change authority cannot accept a delta' }
1370
+ - { code: CHANGE_DELTA_INVALID, description: 'delta shape or typed mutation contract is invalid' }
1371
+ - { code: CHANGE_DELTA_CONTRACT_MISMATCH, description: 'delta does not match accepted Change non-goals, acceptance, or documentation impact' }
1372
+ - { code: CHANGE_DELTA_BASELINE_CONFLICT, description: 'baseline id, revision, specification digest, or target bytes changed' }
1373
+ - { code: CHANGE_DELTA_PAYLOAD_MISSING, description: 'a declared Change overlay file is missing' }
1374
+ - { code: CHANGE_DELTA_PAYLOAD_STALE, description: 'a declared Change overlay digest is stale' }
1375
+ cli_subcommand: change delta
1376
+ emits_events: [artifact_recorded, spec_changed, change_delta_recorded]
1377
+
1378
+ - name: change.documentation_reconcile
1379
+ family: change
1380
+ description: Record Change-owned documentation before/after digests, delta and acceptance trace, verification, and explicit consumer or no-consumer evidence.
1381
+ phase: '21'
1382
+ writer_role: mcp
1383
+ input_schema:
1384
+ type: object
1385
+ required: [id, delta_artifact_id, delta_digest, documents]
1386
+ additionalProperties: false
1387
+ properties:
1388
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
1389
+ delta_artifact_id: { type: string, minLength: 1 }
1390
+ delta_digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1391
+ no_change_reason: { type: string, minLength: 3 }
1392
+ documents:
1393
+ type: array
1394
+ items:
1395
+ type: object
1396
+ required:
1397
+ [path, action, overlay_path, before_digest, after_digest, delta_refs, acceptance_refs, verification, consumers]
1398
+ additionalProperties: false
1399
+ properties:
1400
+ path: { type: string, minLength: 1 }
1401
+ action: { type: string, enum: [add, update] }
1402
+ overlay_path: { type: string, minLength: 1 }
1403
+ before_digest: { type: ['string', 'null'], pattern: '^[0-9a-f]{64}$' }
1404
+ after_digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1405
+ delta_refs: { type: array, minItems: 1, uniqueItems: true, items: { type: string } }
1406
+ acceptance_refs: { type: array, minItems: 1, uniqueItems: true, items: { type: string } }
1407
+ verification:
1408
+ type: array
1409
+ minItems: 1
1410
+ items:
1411
+ type: object
1412
+ required: [command, status, evidence_refs]
1413
+ additionalProperties: false
1414
+ properties:
1415
+ command: { type: string, minLength: 1 }
1416
+ status: { type: string, const: pass }
1417
+ evidence_refs:
1418
+ type: array
1419
+ minItems: 1
1420
+ uniqueItems: true
1421
+ items: { type: string, minLength: 1 }
1422
+ consumers:
1423
+ type: array
1424
+ items:
1425
+ type: object
1426
+ required: [type, id, relation]
1427
+ additionalProperties: false
1428
+ properties:
1429
+ type: { type: string, enum: [artifact, project, baseline, change, task, workflow, external] }
1430
+ id: { type: string, minLength: 1 }
1431
+ relation: { type: string, minLength: 1 }
1432
+ no_consumer_reason: { type: string, minLength: 3 }
1433
+ allOf:
1434
+ - if:
1435
+ properties:
1436
+ documents: { maxItems: 0 }
1437
+ then:
1438
+ required: [no_change_reason]
1439
+ output_schema:
1440
+ type: object
1441
+ required: [reconciliation, artifact, payload_artifacts, progress_artifact]
1442
+ additionalProperties: false
1443
+ properties:
1444
+ reconciliation: { type: object }
1445
+ artifact: { type: object }
1446
+ payload_artifacts: { type: array, items: { type: object } }
1447
+ progress_artifact: { type: object }
1448
+ errors:
1449
+ - { code: CHANGE_NOT_FOUND, description: 'change id does not exist' }
1450
+ - { code: DOCUMENTATION_DELTA_AUTHORITY_INVALID, description: 'documentation is not bound to the current Change delta' }
1451
+ - { code: DOCUMENTATION_RECONCILIATION_INCOMPLETE, description: 'declared documentation impact is not covered exactly' }
1452
+ - { code: DOCUMENTATION_ORPHAN_UNRESOLVED, description: 'a changed document lacks a consumer or explicit no-consumer reason' }
1453
+ - { code: DOCUMENTATION_BASELINE_CONFLICT, description: 'a documentation target changed after its before digest was recorded' }
1454
+ - { code: DOCUMENTATION_EVIDENCE_STALE, description: 'documentation overlay bytes do not match the recorded after digest' }
1455
+ cli_subcommand: change documentation-reconcile
1456
+ emits_events: [artifact_recorded, spec_changed, documentation_reconciliation_recorded]
1457
+
1254
1458
  - name: change.get
1255
1459
  family: change
1256
1460
  description: Read one continuous change unit and its specification-learning candidates from authoritative state.
@@ -1306,12 +1510,28 @@ tools:
1306
1510
  type: object
1307
1511
  required: [id]
1308
1512
  additionalProperties: false
1513
+ not:
1514
+ required: [context_refs, spec_refs]
1309
1515
  properties:
1310
1516
  id: { type: string }
1311
1517
  task_id: { type: string }
1312
1518
  role: { type: string, enum: [plan, implement, check, review] }
1313
1519
  gate: { type: string, enum: [alignment, planning, implementation, verification, review, convergence, recovery] }
1314
- spec_refs: { type: array, items: { type: object } }
1520
+ spec_refs:
1521
+ type: array
1522
+ maxItems: 64
1523
+ items:
1524
+ type: object
1525
+ required: [ref]
1526
+ additionalProperties: false
1527
+ properties:
1528
+ ref: { type: string, minLength: 1, maxLength: 2048 }
1529
+ reason: { type: string, minLength: 1, maxLength: 2048 }
1530
+ required: { type: boolean, default: true }
1531
+ expected_digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1532
+ anchor: { type: string, minLength: 1, maxLength: 512 }
1533
+ scope: { type: string, minLength: 1, maxLength: 512 }
1534
+ freshness_policy: { type: string, enum: [digest, existence, advisory] }
1315
1535
  context_refs:
1316
1536
  type: array
1317
1537
  maxItems: 64
@@ -1320,11 +1540,15 @@ tools:
1320
1540
  required: [ref, reason]
1321
1541
  additionalProperties: false
1322
1542
  properties:
1323
- ref: { type: string, minLength: 1 }
1543
+ ref: { type: string, minLength: 1, maxLength: 2048 }
1324
1544
  kind: { type: string, enum: [spec, source, test, docs, external], default: source }
1325
- reason: { type: string, minLength: 3 }
1545
+ reason: { type: string, minLength: 3, maxLength: 2048 }
1326
1546
  required: { type: boolean, default: true }
1327
1547
  digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1548
+ expected_digest: { type: string, pattern: '^[0-9a-f]{64}$' }
1549
+ anchor: { type: string, minLength: 1, maxLength: 512 }
1550
+ scope: { type: string, minLength: 1, maxLength: 512 }
1551
+ freshness_policy: { type: string, enum: [digest, existence, advisory] }
1328
1552
  budget:
1329
1553
  type: object
1330
1554
  additionalProperties: false
@@ -1336,21 +1560,6 @@ tools:
1336
1560
  additionalProperties: false
1337
1561
  properties:
1338
1562
  context_budget_percent: { type: integer, minimum: 1, maximum: 100, default: 40 }
1339
- provider_refs:
1340
- type: object
1341
- additionalProperties: false
1342
- properties:
1343
- memory:
1344
- type: object
1345
- required: [provider]
1346
- additionalProperties: false
1347
- properties:
1348
- provider: { type: string }
1349
- project: { type: string }
1350
- reference: { type: string }
1351
- revision: { type: string }
1352
- indexed_head: { type: string }
1353
- status: { type: string, enum: [available, unavailable, fresh, stale, unknown] }
1354
1563
  recommendation:
1355
1564
  type: object
1356
1565
  required: [workflow, rationale]
@@ -1358,17 +1567,6 @@ tools:
1358
1567
  properties:
1359
1568
  workflow: { type: string, minLength: 1 }
1360
1569
  rationale: { type: string, minLength: 3 }
1361
- code_graph:
1362
- type: object
1363
- required: [provider]
1364
- additionalProperties: false
1365
- properties:
1366
- provider: { type: string }
1367
- project: { type: string }
1368
- reference: { type: string }
1369
- revision: { type: string }
1370
- indexed_head: { type: string }
1371
- status: { type: string, enum: [available, unavailable, fresh, stale, unknown] }
1372
1570
  output_schema:
1373
1571
  type: object
1374
1572
  required: [manifest_path, manifest_hash, manifest]
@@ -1385,7 +1583,7 @@ tools:
1385
1583
  - { code: EXECUTION_CONTRACT_CONFLICT, description: 'Prompt input attempted to override the DB-backed task seam or verification command' }
1386
1584
  - { code: EXECUTION_CONTEXT_REFS_CONFLICT, description: 'Prompt input attempted to override DB-backed task context references' }
1387
1585
  - { code: CONTEXT_LEGACY_NEXT_ACTION_UNSUPPORTED, description: 'a canonical next action is not an MCP authority field; use a non-authoritative host recommendation' }
1388
- - { code: PROVIDER_CONTENT_FORBIDDEN, description: 'provider payload content must remain external' }
1586
+ - { code: CONTEXT_PROVIDER_REFS_MUTATION_UNSUPPORTED, description: 'provider references must be updated through change.update before context compilation' }
1389
1587
  cli_subcommand: change context
1390
1588
  emits_events: [context_updated]
1391
1589
 
@@ -1600,7 +1798,7 @@ tools:
1600
1798
  type: object
1601
1799
  additionalProperties: false
1602
1800
  properties:
1603
- status: { type: string, enum: [active, checkpoint_ready, confirmed, cancelled] }
1801
+ status: { type: string, enum: [active, checkpoint_ready, completed, confirmed, cancelled] }
1604
1802
  mode: { type: string, enum: [guided, fast, autonomous, diagnostic] }
1605
1803
  baseline_id: { type: string }
1606
1804
  change_id: { type: string }
@@ -1788,6 +1986,67 @@ tools:
1788
1986
  cli_subcommand: decision supersede
1789
1987
  emits_events: [decision_opened]
1790
1988
 
1989
+ - name: decision.complete
1990
+ family: decision
1991
+ description: Complete a decision thread after its normalized state is settled, without creating an approval receipt or artifact checkpoint.
1992
+ phase: '19'
1993
+ writer_role: mcp
1994
+ input_schema:
1995
+ type: object
1996
+ required: [id, summary]
1997
+ additionalProperties: false
1998
+ properties:
1999
+ id: { type: string, minLength: 1 }
2000
+ summary: { type: string, minLength: 1 }
2001
+ applied_refs:
2002
+ type: array
2003
+ maxItems: 20
2004
+ items:
2005
+ type: object
2006
+ required: [kind, ref]
2007
+ additionalProperties: false
2008
+ allOf:
2009
+ - if:
2010
+ properties:
2011
+ kind: { enum: [baseline, change, workflow, task] }
2012
+ required: [kind]
2013
+ then:
2014
+ required: [field, value]
2015
+ - if:
2016
+ properties:
2017
+ kind: { enum: [spec, artifact] }
2018
+ required: [kind]
2019
+ then:
2020
+ required: [digest]
2021
+ not:
2022
+ anyOf:
2023
+ - { required: [field] }
2024
+ - { required: [value] }
2025
+ properties:
2026
+ kind: { type: string, enum: [baseline, change, workflow, task, spec, artifact] }
2027
+ ref: { type: string, minLength: 1 }
2028
+ field: { type: string, minLength: 1 }
2029
+ value: {}
2030
+ digest: { type: string, pattern: '^[0-9a-f]{64}$' }
2031
+ output_schema:
2032
+ type: object
2033
+ required: [thread]
2034
+ additionalProperties: false
2035
+ properties:
2036
+ thread: { type: object }
2037
+ errors:
2038
+ - { code: DECISION_THREAD_NOT_FOUND, description: 'decision thread id does not exist' }
2039
+ - { code: DECISION_THREAD_NOT_MUTABLE, description: 'the decision thread is already terminal' }
2040
+ - { code: DECISION_CHECKPOINT_PENDING, description: 'a prepared artifact checkpoint must be confirmed or revised first' }
2041
+ - { code: DECISION_ALIGNMENT_BLOCKING, description: 'an unanswered question or blocking deferral prevents completion' }
2042
+ - { code: DECISION_APPLIED_REF_NOT_FOUND, description: 'an applied authority reference cannot be read back from the current project state' }
2043
+ - { code: DECISION_APPLIED_REF_FIELD_NOT_FOUND, description: 'a row-backed applied authority field does not exist' }
2044
+ - { code: DECISION_APPLIED_REF_VALUE_MISMATCH, description: 'a row-backed applied authority value does not match current state' }
2045
+ - { code: DECISION_APPLIED_REF_STALE, description: 'an applied field, specification, or artifact digest does not match current content' }
2046
+ - { code: VALIDATION_ERROR, description: 'the completion summary or applied authority references are invalid' }
2047
+ cli_subcommand: decision complete
2048
+ emits_events: [decision_thread_completed]
2049
+
1791
2050
  - name: decision.checkpoint
1792
2051
  family: decision
1793
2052
  description: Prepare or confirm a decision checkpoint, including renewal of unchanged decisions against current artifacts; change- and workflow-bound threads require an artifact, while a standalone baseline thread may record an explicit no-artifact reason.
@@ -1833,7 +2092,7 @@ tools:
1833
2092
  # ────────────────────────── workflow family ────────────────────────────
1834
2093
  - name: workflow.start
1835
2094
  family: workflow
1836
- description: Start one durable Ultra workflow run. For research, the host model supplies only evidence-relevant semantic coverage; MCP records and validates the selection without choosing it.
2095
+ description: Start one durable Ultra workflow run. For research, the host supplies normalized accepted semantic coverage after user-model alignment; MCP records and validates the state without choosing or proving user intent.
1837
2096
  phase: '13'
1838
2097
  writer_role: mcp
1839
2098
  input_schema:
@@ -1875,6 +2134,7 @@ tools:
1875
2134
  - { code: DUPLICATE_WORKFLOW_ID, description: 'workflow id already exists' }
1876
2135
  - { code: WORKFLOW_IN_PROGRESS, description: 'the same authority already has an active workflow of this kind' }
1877
2136
  - { code: WORKFLOW_CHANGE_NOT_FOUND, description: 'the requested change authority does not exist' }
2137
+ - { code: WORKFLOW_SCOPE_INVALID, description: 'the workflow kind received a task or change scope that it does not own' }
1878
2138
  - { code: WORKFLOW_CHANGE_RUN_REQUIRED, description: 'change-bound stages require the owning durable change workflow; legacy gaps route through doctor repair' }
1879
2139
  - { code: WORKFLOW_BASELINE_MISMATCH, description: 'a supplied stage baseline differs from the baseline bound by the owning change workflow' }
1880
2140
  - { code: WORKFLOW_BASELINE_NOT_READY, description: 'the baseline bound to the change is no longer ready' }
@@ -1883,7 +2143,7 @@ tools:
1883
2143
  - { code: WORKFLOW_AUTHORITY_REQUIRED, description: 'the workflow is missing its required baseline, change, or task authority' }
1884
2144
  - { code: WORKFLOW_CHANGE_DECISION_BLOCKING, description: 'the change contains unresolved material owner decisions' }
1885
2145
  - { code: WORKFLOW_CHANGE_RESEARCH_INCOMPLETE, description: 'the change-bound research disposition is not current and complete' }
1886
- - { code: WORKFLOW_RESEARCH_COVERAGE_REQUIRED, description: 'research requires model-selected coverage with at least one applicable semantic area beyond synthesis' }
2146
+ - { code: WORKFLOW_RESEARCH_COVERAGE_REQUIRED, description: 'research requires accepted coverage with at least one applicable semantic area beyond synthesis' }
1887
2147
  - { code: WORKFLOW_RESEARCH_COVERAGE_EVIDENCE_REQUIRED, description: 'reuse, verification, and not-applicable dispositions require evidence references' }
1888
2148
  - { code: WORKFLOW_RESEARCH_SYNTHESIS_REQUIRED, description: 'research synthesis must execute, verify, or reuse durable evidence' }
1889
2149
  - { code: WORKFLOW_RESEARCH_MODE_MISMATCH, description: 'the selected research mode does not match its authority or baseline mode' }
@@ -2020,6 +2280,7 @@ tools:
2020
2280
  - { code: WORKFLOW_EVIDENCE_REQUIRED, description: 'the step cannot complete without evidence' }
2021
2281
  - { code: WORKFLOW_OUTPUT_REQUIRED, description: 'the step cannot complete without a durable output' }
2022
2282
  - { code: WORKFLOW_OUTPUT_MISSING, description: 'a declared output file is missing' }
2283
+ - { code: WORKFLOW_ARTIFACT_SCOPE_INVALID, description: 'a Change-bound semantic or evidence artifact escaped its owning Change root' }
2023
2284
  - { code: WORKFLOW_RESEARCH_REPORT_REQUIRED, description: 'a research step requires its immutable workflow-and-step-bound report path' }
2024
2285
  - { code: WORKFLOW_RESEARCH_REPORT_INVALID, description: 'the research report is missing its required evidence structure' }
2025
2286
  - { code: WORKFLOW_RESEARCH_SYNTHESIS_INCOMPLETE, description: 'full or adoption synthesis did not bind all baseline specifications and the distillate' }
@@ -2043,6 +2304,65 @@ tools:
2043
2304
  cli_subcommand: workflow step
2044
2305
  emits_events: [workflow_step_updated, workflow_blocked]
2045
2306
 
2307
+ - name: workflow.revise
2308
+ family: workflow
2309
+ description: Create a candidate revision of a completed workflow while preserving the accepted run and its provenance.
2310
+ phase: '21'
2311
+ writer_role: mcp
2312
+ input_schema:
2313
+ type: object
2314
+ required: [id, replacement_id, subject, reason]
2315
+ additionalProperties: false
2316
+ properties:
2317
+ id: { type: string, minLength: 1 }
2318
+ replacement_id: { type: string, minLength: 1 }
2319
+ subject: { type: string, minLength: 1 }
2320
+ reason: { type: string, minLength: 3 }
2321
+ output_schema:
2322
+ type: object
2323
+ required: [workflow]
2324
+ additionalProperties: false
2325
+ properties:
2326
+ workflow: { type: object }
2327
+ errors:
2328
+ - { code: WORKFLOW_NOT_FOUND, description: 'prior workflow id does not exist' }
2329
+ - { code: WORKFLOW_REVISION_SOURCE_NOT_ACCEPTED, description: 'only a completed workflow can be revised' }
2330
+ - { code: WORKFLOW_ALREADY_SUPERSEDED, description: 'the prior workflow already has a replacement authority' }
2331
+ - { code: WORKFLOW_IN_PROGRESS, description: 'a competing active workflow owns the same scope' }
2332
+ cli_subcommand: workflow revise
2333
+ emits_events: [workflow_started, workflow_revision_started]
2334
+
2335
+ - name: workflow.supersede
2336
+ family: workflow
2337
+ description: Promote a completed candidate revision to current authority and invalidate only its transitive registry consumers.
2338
+ phase: '21'
2339
+ writer_role: mcp
2340
+ input_schema:
2341
+ type: object
2342
+ required: [id, replacement_id, reason]
2343
+ additionalProperties: false
2344
+ properties:
2345
+ id: { type: string, minLength: 1 }
2346
+ replacement_id: { type: string, minLength: 1 }
2347
+ reason: { type: string, minLength: 3 }
2348
+ output_schema:
2349
+ type: object
2350
+ required: [superseded, workflow, invalidated, idempotent]
2351
+ additionalProperties: false
2352
+ properties:
2353
+ superseded: { type: object }
2354
+ workflow: { type: object }
2355
+ invalidated: { type: array, items: { type: object } }
2356
+ idempotent: { type: boolean }
2357
+ errors:
2358
+ - { code: WORKFLOW_NOT_FOUND, description: 'prior or replacement workflow id does not exist' }
2359
+ - { code: WORKFLOW_SUPERSESSION_NOT_ACCEPTED, description: 'both workflow revisions must be completed' }
2360
+ - { code: WORKFLOW_SUPERSESSION_AUTHORITY_MISMATCH, description: 'replacement binding or revision provenance differs' }
2361
+ - { code: WORKFLOW_OUTPUT_STALE, description: 'replacement output authority is stale' }
2362
+ - { code: WORKFLOW_ALREADY_SUPERSEDED, description: 'another replacement already owns authority' }
2363
+ cli_subcommand: workflow supersede
2364
+ emits_events: [workflow_superseded, workflow_invalidated, task_stale_marked]
2365
+
2046
2366
  - name: workflow.complete
2047
2367
  family: workflow
2048
2368
  description: Complete a ready workflow only when every selected step is complete and every recorded output digest remains current. Plan approval is optional unless the host identified a material owner decision.
@@ -2108,6 +2428,7 @@ tools:
2108
2428
  - { code: WORKFLOW_TEST_NOT_PASSED, description: 'the current change-level test gate did not pass' }
2109
2429
  - { code: WORKFLOW_SESSION_ACTIVE, description: 'delivery cannot converge while an execution session remains active' }
2110
2430
  - { code: WORKFLOW_CONTEXT_NOT_READY, description: 'delivery evidence lacks a current ready context manifest' }
2431
+ - { code: WORKFLOW_CONTEXT_STALE, description: 'a required Context reference or bound task/change authority changed after compilation; optional drift remains a summary warning' }
2111
2432
  - { code: WORKFLOW_DELIVERY_CHECK_FAILED, description: 'one or more local delivery checks did not pass' }
2112
2433
  - { code: WORKFLOW_CHANGE_NOT_ARCHIVED, description: 'delivery completion requires an archived change' }
2113
2434
  - { code: WORKFLOW_RELEASE_AUTHORITY_MISMATCH, description: 'a local delivery report attempted to claim external release authority' }
@@ -2115,6 +2436,162 @@ tools:
2115
2436
  cli_subcommand: workflow complete
2116
2437
  emits_events: [workflow_completed, plan_approved]
2117
2438
 
2439
+ # ───────────────────────── artifact family ─────────────────────────────
2440
+ - name: artifact.record
2441
+ family: artifact
2442
+ description: Register the current bytes of one semantic or evidence file, replace its dependency edges transactionally, and invalidate exact downstream consumers when its digest changes.
2443
+ phase: '20'
2444
+ writer_role: mcp
2445
+ input_schema:
2446
+ type: object
2447
+ required: [owner_type, owner_id, kind, path, provenance, source_refs, consumer_refs]
2448
+ additionalProperties: false
2449
+ properties:
2450
+ id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
2451
+ owner_type: { type: string, enum: [project, baseline, change, task, workflow] }
2452
+ owner_id: { type: string, minLength: 1 }
2453
+ kind: { type: string, minLength: 1 }
2454
+ path: { type: string, minLength: 1 }
2455
+ status: { type: string, enum: [current, stale, terminal, archived], default: current }
2456
+ expected_before_digest:
2457
+ type: [string, 'null']
2458
+ pattern: '^[a-f0-9]{64}$'
2459
+ provenance: { type: object, additionalProperties: true }
2460
+ metadata: { type: object, additionalProperties: true }
2461
+ source_refs:
2462
+ type: array
2463
+ items:
2464
+ type: object
2465
+ required: [type, id, relation]
2466
+ additionalProperties: false
2467
+ properties:
2468
+ type: { type: string, enum: [artifact, project, baseline, change, task, workflow, external] }
2469
+ id: { type: string, minLength: 1 }
2470
+ relation: { type: string, minLength: 1 }
2471
+ consumer_refs:
2472
+ type: array
2473
+ items:
2474
+ type: object
2475
+ required: [type, id, relation]
2476
+ additionalProperties: false
2477
+ properties:
2478
+ type: { type: string, enum: [artifact, project, baseline, change, task, workflow, external] }
2479
+ id: { type: string, minLength: 1 }
2480
+ relation: { type: string, minLength: 1 }
2481
+ output_schema:
2482
+ type: object
2483
+ required: [artifact, changed, invalidated]
2484
+ additionalProperties: false
2485
+ properties:
2486
+ artifact:
2487
+ type: object
2488
+ required: [id, owner_type, owner_id, kind, path, digest, before_digest, after_digest, managed, status, provenance, metadata, source_refs, consumer_refs, created_at, updated_at]
2489
+ additionalProperties: false
2490
+ properties:
2491
+ id: { type: string }
2492
+ owner_type: { type: string, enum: [project, baseline, change, task, workflow] }
2493
+ owner_id: { type: string }
2494
+ kind: { type: string }
2495
+ path: { type: string }
2496
+ digest: { type: [string, 'null'] }
2497
+ before_digest: { type: [string, 'null'] }
2498
+ after_digest: { type: [string, 'null'] }
2499
+ managed: { type: boolean }
2500
+ status: { type: string, enum: [current, stale, terminal, archived] }
2501
+ provenance: { type: object }
2502
+ metadata: { type: object }
2503
+ source_refs:
2504
+ type: array
2505
+ items:
2506
+ type: object
2507
+ required: [type, id, relation]
2508
+ additionalProperties: false
2509
+ properties:
2510
+ type: { type: string }
2511
+ id: { type: string }
2512
+ relation: { type: string }
2513
+ consumer_refs:
2514
+ type: array
2515
+ items:
2516
+ type: object
2517
+ required: [type, id, relation]
2518
+ additionalProperties: false
2519
+ properties:
2520
+ type: { type: string }
2521
+ id: { type: string }
2522
+ relation: { type: string }
2523
+ created_at: { type: string }
2524
+ updated_at: { type: string }
2525
+ changed: { type: boolean }
2526
+ invalidated:
2527
+ type: array
2528
+ items:
2529
+ type: object
2530
+ required: [type, id]
2531
+ additionalProperties: false
2532
+ properties:
2533
+ type: { type: string }
2534
+ id: { type: string }
2535
+ errors:
2536
+ - { code: ARTIFACT_FILE_MISSING, description: 'declared artifact file does not exist' }
2537
+ - { code: ARTIFACT_PATH_INVALID, description: 'artifact path escapes the project or is not a regular file' }
2538
+ - { code: ARTIFACT_PATH_EXEMPT, description: 'runtime, scratch, or generated projection path cannot become semantic authority' }
2539
+ - { code: ARTIFACT_OWNER_MISSING, description: 'typed artifact owner does not exist' }
2540
+ - { code: ARTIFACT_ENDPOINT_MISSING, description: 'a dependency endpoint does not exist' }
2541
+ - { code: ARTIFACT_DIGEST_CONFLICT, description: 'expected prior digest does not match current registry authority' }
2542
+ - { code: ARTIFACT_AUTHORITY_CONFLICT, description: 'artifact id is bound to another authority or the canonical path already has an active authority' }
2543
+ - { code: ARTIFACT_GRAPH_SELF_EDGE, description: 'an artifact cannot directly depend on itself' }
2544
+ - { code: ARTIFACT_GRAPH_CYCLE, description: 'replacement edges would create a dependency cycle' }
2545
+ cli_subcommand: artifact record
2546
+ emits_events: [artifact_recorded, spec_changed, task_stale_marked]
2547
+
2548
+ - name: artifact.get
2549
+ family: artifact
2550
+ description: Read one registered artifact together with its typed ownership, provenance, and normalized source and consumer edges.
2551
+ phase: '20'
2552
+ readonly: true
2553
+ input_schema:
2554
+ type: object
2555
+ additionalProperties: false
2556
+ oneOf:
2557
+ - required: [id]
2558
+ - required: [path]
2559
+ properties:
2560
+ id: { type: string, minLength: 1 }
2561
+ path: { type: string, minLength: 1 }
2562
+ output_schema:
2563
+ type: object
2564
+ required: [artifact]
2565
+ additionalProperties: false
2566
+ properties:
2567
+ artifact:
2568
+ type: object
2569
+ required: [id, owner_type, owner_id, kind, path, digest, before_digest, after_digest, managed, status, provenance, metadata, source_refs, consumer_refs, created_at, updated_at]
2570
+ additionalProperties: false
2571
+ properties:
2572
+ id: { type: string }
2573
+ owner_type: { type: string, enum: [project, baseline, change, task, workflow] }
2574
+ owner_id: { type: string }
2575
+ kind: { type: string }
2576
+ path: { type: string }
2577
+ digest: { type: [string, 'null'] }
2578
+ before_digest: { type: [string, 'null'] }
2579
+ after_digest: { type: [string, 'null'] }
2580
+ managed: { type: boolean }
2581
+ status: { type: string, enum: [current, stale, terminal, archived] }
2582
+ provenance: { type: object }
2583
+ metadata: { type: object }
2584
+ source_refs: { type: array, items: { type: object } }
2585
+ consumer_refs: { type: array, items: { type: object } }
2586
+ created_at: { type: string }
2587
+ updated_at: { type: string }
2588
+ errors:
2589
+ - { code: ARTIFACT_NOT_FOUND, description: 'artifact id or path is not registered' }
2590
+ - { code: ARTIFACT_DUPLICATE_AUTHORITY, description: 'path lookup resolves to multiple active authorities and requires an id' }
2591
+ - { code: VALIDATION_ERROR, description: 'exactly one lookup key is required' }
2592
+ cli_subcommand: artifact get
2593
+ emits_events: []
2594
+
2118
2595
  # ────────────────────────── system family ──────────────────────────────
2119
2596
  - name: system.doctor
2120
2597
  family: system
@@ -2145,29 +2622,35 @@ tools:
2145
2622
  # ────────────────────────── plan family (D34) ───────────────────────────
2146
2623
  - name: plan.export
2147
2624
  family: plan
2148
- description: Render the current execution-plan artifact to disk (waves + ownership + conflict surface).
2625
+ description: Render deterministic plan.json and plan.md under the owning Change artifact root from the current planning Context Manifest.
2149
2626
  phase: '8a'
2150
2627
  writer_role: mcp
2151
2628
  input_schema:
2152
2629
  type: object
2153
- required: [change_id, out_path]
2630
+ required: [change_id]
2154
2631
  additionalProperties: false
2155
2632
  properties:
2156
- format: { type: string, enum: [json, md], default: json }
2157
2633
  change_id: { type: string, pattern: '^[a-zA-Z0-9_\-]+$' }
2158
- out_path: { type: string }
2159
- tag: { type: string }
2160
2634
  output_schema:
2161
2635
  type: object
2162
- required: [plan_path, wave_count]
2636
+ required: [plan_path, plan_md_path, wave_count]
2163
2637
  additionalProperties: false
2164
2638
  properties:
2165
2639
  plan_path: { type: string }
2640
+ plan_md_path: { type: string }
2166
2641
  wave_count: { type: integer, minimum: 0 }
2167
2642
  errors:
2168
2643
  - { code: NO_TASKS, description: 'no tasks to plan' }
2169
2644
  - { code: CHANGE_NOT_FOUND, description: 'owning change does not exist' }
2170
2645
  - { code: CHANGE_NOT_MUTABLE, description: 'owning change no longer accepts planning output' }
2646
+ - { code: PLAN_CONTEXT_REQUIRED, description: 'the owning Change has no plan/planning Context Manifest' }
2647
+ - { code: PLAN_CONTEXT_STALE, description: 'the plan/planning Context Manifest is stale or blocked' }
2648
+ - { code: PLAN_ARTIFACT_PATH_UNSAFE, description: 'the Change artifact root, an ancestor, or a plan target is a symlink or escapes the physical project root' }
2649
+ - { code: PLAN_PUBLISH_CONFLICT, description: 'plan.json or plan.md changed after publication preparation; concurrent bytes are preserved' }
2650
+ - { code: PLAN_PUBLISH_FAILED, description: 'the journaled plan.json and plan.md publication could not complete and was rolled back' }
2651
+ - { code: PLAN_RECOVERY_REQUIRED, description: 'an interrupted plan publication must be recovered before state mutation continues' }
2652
+ - { code: ARTIFACT_AUTHORITY_CONFLICT, description: 'plan.json or plan.md already has another active registry authority' }
2653
+ - { code: ARTIFACT_DIGEST_CONFLICT, description: 'the registered plan authority changed before publication' }
2171
2654
  - { code: WRITE_FAILED, description: 'cannot write plan file' }
2172
2655
  cli_subcommand: plan export
2173
2656
  emits_events: [plan_exported]
@@ -2175,7 +2658,7 @@ tools:
2175
2658
 
2176
2659
  - name: plan.get
2177
2660
  family: plan
2178
- description: Read a section of the current project's persisted .ultra/execution-plan.json artifact.
2661
+ description: Read a section of the owning Change's persisted plan.json artifact.
2179
2662
  phase: '8a'
2180
2663
  readonly: true
2181
2664
  input_schema:
@@ -2193,7 +2676,9 @@ tools:
2193
2676
  plan: { type: object }
2194
2677
  errors:
2195
2678
  - { code: NO_PLAN, description: 'no plan has been computed yet' }
2679
+ - { code: CHANGE_NOT_FOUND, description: 'owning change does not exist' }
2196
2680
  - { code: PLAN_CHANGE_MISMATCH, description: 'current plan artifact belongs to another change' }
2681
+ - { code: PLAN_ARTIFACT_INVALID, description: 'plan.json is unsafe, malformed, stale, or does not match the current Change-owned registry authority' }
2197
2682
  cli_subcommand: plan get
2198
2683
  emits_events: []
2199
2684
  trace_to: '§7.3, D34'