create-agdf 0.30.0 → 0.31.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 (341) hide show
  1. package/generated/.agdf/control/README.md +5 -0
  2. package/generated/.agdf/control/templates/BRAND.md +28 -0
  3. package/generated/.agdf/control/templates/artefacts/PRD.md +11 -0
  4. package/generated/.agdf/control/templates/artefacts/SD.md +4 -0
  5. package/generated/.agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
  6. package/generated/.opencode/agdf-interaction-locales.json +292 -2
  7. package/generated/.opencode/contracts/gate-artifact-preparation.md +9 -3
  8. package/generated/.opencode/contracts/interaction.md +10 -4
  9. package/generated/.opencode/contracts/modes.md +5 -0
  10. package/generated/.opencode/contracts/prd-definition.md +40 -1
  11. package/generated/.opencode/contracts/quality.md +35 -0
  12. package/generated/.opencode/contracts/request-activation.md +6 -3
  13. package/generated/.opencode/contracts/sd-definition.md +46 -0
  14. package/generated/.opencode/contracts/tp-definition.md +8 -0
  15. package/generated/.opencode/contracts/ur-definition.md +9 -5
  16. package/generated/.opencode/skills/agdf-ux-intent-definition/SKILL.md +31 -2
  17. package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
  18. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  19. package/generated/plugins/agdf/companion/events.mjs +117 -0
  20. package/generated/plugins/agdf/companion/figure.mjs +6 -6
  21. package/generated/plugins/agdf/companion/gate-bar.mjs +10 -28
  22. package/generated/plugins/agdf/companion/localization.mjs +10 -32
  23. package/generated/plugins/agdf/companion/notice.mjs +10 -8
  24. package/generated/plugins/agdf/companion/register.mjs +229 -43
  25. package/generated/plugins/agdf/companion/run-state.mjs +77 -90
  26. package/generated/plugins/agdf/companion/state.mjs +6 -32
  27. package/generated/plugins/agdf/companion/view.mjs +57 -12
  28. package/generated/plugins/agdf/control/README.md +5 -0
  29. package/generated/plugins/agdf/control/templates/BRAND.md +28 -0
  30. package/generated/plugins/agdf/control/templates/artefacts/PRD.md +11 -0
  31. package/generated/plugins/agdf/control/templates/artefacts/SD.md +4 -0
  32. package/generated/plugins/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
  33. package/generated/plugins/agdf/mcp/server/README.md +26 -2
  34. package/generated/plugins/agdf/mcp/server/package.json +3 -3
  35. package/generated/plugins/agdf/mcp/server/src/generation-runtime.js +11 -2
  36. package/generated/plugins/agdf/mcp/server/src/main.js +1 -0
  37. package/generated/plugins/agdf/mcp/server/src/next-action.js +227 -0
  38. package/generated/plugins/agdf/mcp/server/src/prepared-call-transport.js +306 -0
  39. package/generated/plugins/agdf/mcp/server/src/safe-read-continuation.js +62 -0
  40. package/generated/plugins/agdf/mcp/server/src/server.js +139 -35
  41. package/generated/plugins/agdf/mcp/server/ui/cockpit.html +2 -2
  42. package/generated/plugins/agdf/mcp/server/ui/decision-manifest.json +3 -3
  43. package/generated/plugins/agdf/mcp/server/ui/decision.html +2 -2
  44. package/generated/plugins/agdf/mcp/server/ui/manifest.json +3 -3
  45. package/generated/plugins/agdf/meta/agdf-interaction-locales.json +292 -2
  46. package/generated/plugins/agdf/meta/agdf-mcp-capability.json +1 -1
  47. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  48. package/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  49. package/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
  50. package/generated/plugins/agdf/meta/contracts/modes.md +5 -0
  51. package/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
  52. package/generated/plugins/agdf/meta/contracts/quality.md +35 -0
  53. package/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
  54. package/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
  55. package/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
  56. package/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
  57. package/generated/plugins/agdf/meta/copilot-payload-baseline.json +3 -3
  58. package/generated/plugins/agdf/meta/distribution-profile-history.json +7 -0
  59. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +292 -2
  60. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  61. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  62. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
  63. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +5 -0
  64. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
  65. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +35 -0
  66. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
  67. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
  68. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
  69. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
  70. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -1
  71. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/parse-args.js +7 -4
  72. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/project-read-command.js +29 -0
  73. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +2 -1
  74. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +32 -6
  75. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +7 -0
  76. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +34 -6
  77. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
  78. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +86 -83
  79. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
  80. package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
  81. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/events.js +154 -0
  82. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/figure-state.js +36 -0
  83. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/journal.js +180 -0
  84. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/run-view.js +184 -0
  85. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
  86. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
  87. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +44 -6
  88. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
  89. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
  90. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
  91. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +9 -0
  92. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
  93. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
  94. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
  95. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
  96. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit.js +4 -20
  97. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +64 -24
  98. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
  99. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +2 -1
  100. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/run-classification.js +31 -0
  101. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +6 -0
  102. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +32 -5
  103. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
  104. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +7 -5
  105. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/material-limits.js +4 -0
  106. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
  107. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +4 -1
  108. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +10 -4
  109. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +9 -3
  110. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +35 -11
  111. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +2 -0
  112. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +5 -3
  113. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +25 -7
  114. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +84 -28
  115. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +38 -20
  116. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +37 -17
  117. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +10 -3
  118. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +8 -5
  119. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/index.js +3 -1
  120. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +6 -1
  121. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +8 -0
  122. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +26 -1
  123. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +30 -1
  124. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +5 -3
  125. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +1 -1
  126. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +9 -2
  127. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +6 -4
  128. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
  129. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
  130. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
  131. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
  132. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
  133. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +17 -4
  134. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
  135. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  136. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +4 -3
  137. package/generated/plugins/agdf/skills/ux-intent-definition/SKILL.md +31 -2
  138. package/generated/plugins/agdf/skills/ux-intent-definition/help.md +8 -1
  139. package/generated/plugins/agdf/submission/openai/availability.md +1 -1
  140. package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
  141. package/generated/plugins/agdf/submission/openai/release-notes.md +8 -8
  142. package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
  143. package/generated/plugins/agdf-planning/.codex-plugin/plugin.json +1 -1
  144. package/generated/plugins/agdf-planning/plugin.json +1 -1
  145. package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +332 -195
  146. package/generated/plugins/copilot/agdf/control/README.md +5 -0
  147. package/generated/plugins/copilot/agdf/control/templates/BRAND.md +28 -0
  148. package/generated/plugins/copilot/agdf/control/templates/artefacts/PRD.md +11 -0
  149. package/generated/plugins/copilot/agdf/control/templates/artefacts/SD.md +4 -0
  150. package/generated/plugins/copilot/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
  151. package/generated/plugins/copilot/agdf/mcp/server/README.md +26 -2
  152. package/generated/plugins/copilot/agdf/mcp/server/package.json +3 -3
  153. package/generated/plugins/copilot/agdf/mcp/server/src/generation-runtime.js +11 -2
  154. package/generated/plugins/copilot/agdf/mcp/server/src/main.js +1 -0
  155. package/generated/plugins/copilot/agdf/mcp/server/src/next-action.js +227 -0
  156. package/generated/plugins/copilot/agdf/mcp/server/src/prepared-call-transport.js +306 -0
  157. package/generated/plugins/copilot/agdf/mcp/server/src/safe-read-continuation.js +62 -0
  158. package/generated/plugins/copilot/agdf/mcp/server/src/server.js +139 -35
  159. package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +1 -1
  160. package/generated/plugins/copilot/agdf/meta/distribution-profile-history.json +7 -0
  161. package/generated/plugins/copilot/agdf/plugin.json +1 -1
  162. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +292 -2
  163. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  164. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  165. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
  166. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +5 -0
  167. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
  168. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +35 -0
  169. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
  170. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
  171. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
  172. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
  173. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -1
  174. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +7 -4
  175. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/project-read-command.js +29 -0
  176. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +2 -1
  177. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +32 -6
  178. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +7 -0
  179. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +34 -6
  180. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
  181. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +81 -78
  182. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
  183. package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +1 -1
  184. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/events.js +154 -0
  185. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/figure-state.js +36 -0
  186. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/journal.js +180 -0
  187. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/run-view.js +184 -0
  188. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
  189. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
  190. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +44 -6
  191. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
  192. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
  193. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
  194. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +9 -0
  195. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
  196. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
  197. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
  198. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
  199. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +64 -24
  200. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
  201. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +2 -1
  202. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/run-classification.js +31 -0
  203. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +6 -0
  204. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +32 -5
  205. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
  206. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +7 -5
  207. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/material-limits.js +4 -0
  208. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
  209. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +4 -1
  210. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +10 -4
  211. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +9 -3
  212. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +35 -11
  213. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +2 -0
  214. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +5 -3
  215. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +25 -7
  216. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +84 -28
  217. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +38 -20
  218. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +37 -17
  219. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +10 -3
  220. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +8 -5
  221. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/index.js +3 -1
  222. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +6 -1
  223. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +8 -0
  224. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +26 -1
  225. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +30 -1
  226. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +5 -3
  227. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +1 -1
  228. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +9 -2
  229. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +6 -4
  230. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
  231. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
  232. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
  233. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
  234. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
  235. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +17 -4
  236. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
  237. package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +2 -2
  238. package/generated/plugins/copilot/agdf/skills/agdf-interaction-locales.json +1 -1
  239. package/generated/plugins/copilot/agdf/skills/agdf-ux-intent-definition/SKILL.md +31 -2
  240. package/generated/plugins/copilot/agdf/skills/contracts/gate-artifact-preparation.md +9 -3
  241. package/generated/plugins/copilot/agdf/skills/contracts/interaction.md +10 -4
  242. package/generated/plugins/copilot/agdf/skills/contracts/modes.md +5 -0
  243. package/generated/plugins/copilot/agdf/skills/contracts/prd-definition.md +40 -1
  244. package/generated/plugins/copilot/agdf/skills/contracts/quality.md +35 -0
  245. package/generated/plugins/copilot/agdf/skills/contracts/request-activation.md +6 -3
  246. package/generated/plugins/copilot/agdf/skills/contracts/sd-definition.md +46 -0
  247. package/generated/plugins/copilot/agdf/skills/contracts/tp-definition.md +8 -0
  248. package/generated/plugins/copilot/agdf/skills/contracts/ur-definition.md +9 -5
  249. package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
  250. package/generated/submissions/openai/agdf/meta/agdf-interaction-locales.json +292 -2
  251. package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +1 -1
  252. package/generated/submissions/openai/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  253. package/generated/submissions/openai/agdf/meta/contracts/interaction.md +10 -4
  254. package/generated/submissions/openai/agdf/meta/contracts/modes.md +5 -0
  255. package/generated/submissions/openai/agdf/meta/contracts/prd-definition.md +40 -1
  256. package/generated/submissions/openai/agdf/meta/contracts/quality.md +35 -0
  257. package/generated/submissions/openai/agdf/meta/contracts/request-activation.md +6 -3
  258. package/generated/submissions/openai/agdf/meta/contracts/sd-definition.md +46 -0
  259. package/generated/submissions/openai/agdf/meta/contracts/tp-definition.md +8 -0
  260. package/generated/submissions/openai/agdf/meta/contracts/ur-definition.md +9 -5
  261. package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +3 -3
  262. package/generated/submissions/openai/agdf/meta/distribution-profile-history.json +7 -0
  263. package/generated/submissions/openai/agdf/plugin.json +1 -1
  264. package/generated/submissions/openai/agdf/skills/ux-intent-definition/SKILL.md +31 -2
  265. package/generated/submissions/openai/agdf/skills/ux-intent-definition/help.md +8 -1
  266. package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
  267. package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
  268. package/generated/submissions/openai/agdf/submission/openai/inventory.json +24 -24
  269. package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
  270. package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
  271. package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
  272. package/generated/submissions/openai/agdf/submission/openai/release-notes.md +8 -8
  273. package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
  274. package/lib/cli/command-registry.js +2 -1
  275. package/lib/cli/parse-args.js +7 -4
  276. package/lib/cli/project-read-command.js +29 -0
  277. package/lib/cli/validation-handlers.js +2 -1
  278. package/lib/mcp-dispatch-runtime.js +32 -6
  279. package/lib/mcp-lifecycle/package.js +7 -0
  280. package/lib/mcp-lifecycle/plugin-runtime.js +34 -6
  281. package/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
  282. package/lib/mcp-worker-runtime.js +86 -83
  283. package/lib/runtime/validator-application.js +2 -2
  284. package/lib/scaffold/plan.js +2 -0
  285. package/package.json +1 -1
  286. package/runtime/core/lib/companion/events.js +154 -0
  287. package/runtime/core/lib/companion/figure-state.js +36 -0
  288. package/runtime/core/lib/companion/journal.js +180 -0
  289. package/runtime/core/lib/companion/run-view.js +184 -0
  290. package/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
  291. package/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
  292. package/runtime/core/lib/control-evaluation/gate-check.js +44 -6
  293. package/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
  294. package/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
  295. package/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
  296. package/runtime/core/lib/control-evaluation/report-decision.js +9 -0
  297. package/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
  298. package/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
  299. package/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
  300. package/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
  301. package/runtime/core/lib/control-inspect/cockpit.js +4 -20
  302. package/runtime/core/lib/control-inspect/contract.js +64 -24
  303. package/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
  304. package/runtime/core/lib/control-inspect/project-state.js +2 -1
  305. package/runtime/core/lib/control-inspect/run-classification.js +31 -0
  306. package/runtime/core/lib/control-inspect/selection.js +6 -0
  307. package/runtime/core/lib/control-inspect/service.js +32 -5
  308. package/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
  309. package/runtime/core/lib/control-state/input-resolution.js +7 -5
  310. package/runtime/core/lib/control-state/material-limits.js +4 -0
  311. package/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
  312. package/runtime/core/lib/control-state/presentation-delivery.js +4 -1
  313. package/runtime/core/lib/control-state/run-command-contract.js +10 -4
  314. package/runtime/core/lib/control-state/run-command-schema.js +9 -3
  315. package/runtime/core/lib/control-state/run-command-service.js +35 -11
  316. package/runtime/core/lib/control-state/run-identity.js +2 -0
  317. package/runtime/core/lib/control-state/run-inventory-reader.js +5 -3
  318. package/runtime/core/lib/control-state/run-material.js +25 -7
  319. package/runtime/core/lib/control-state/run-presentation-render.js +84 -28
  320. package/runtime/core/lib/control-state/run-revision.js +38 -20
  321. package/runtime/core/lib/control-state/run-source-revisions.js +37 -17
  322. package/runtime/core/lib/control-state/run-state-reader.js +10 -3
  323. package/runtime/core/lib/control-state/run-steps.js +8 -5
  324. package/runtime/core/lib/index.js +3 -1
  325. package/runtime/core/lib/interaction-catalog-validation.js +6 -1
  326. package/runtime/core/lib/interaction-catalog.js +8 -0
  327. package/runtime/core/lib/interaction-presentation.js +26 -1
  328. package/runtime/core/lib/mcp-input-hints.js +30 -1
  329. package/runtime/core/lib/mcp-tool-errors.js +5 -3
  330. package/runtime/core/lib/resources/canonical-init-plan.js +1 -1
  331. package/runtime/core/lib/runtime/plugin-provenance.js +9 -2
  332. package/runtime/core/lib/skill-dispatch/contract.js +6 -4
  333. package/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
  334. package/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
  335. package/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
  336. package/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
  337. package/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
  338. package/runtime/core/lib/skill-dispatch/service.js +17 -4
  339. package/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
  340. package/generated/plugins/agdf/companion/core.mjs +0 -16
  341. package/generated/plugins/agdf/companion/locales.json +0 -200
@@ -33,6 +33,22 @@ PRD criterion exactly once to realization, authoritative owner, stable SDD IDs o
33
33
  and compatibility/risk. Never duplicate acceptance, invent scope/users or claim implementation.
34
34
  Retain actual sources/draft and a reasoned derivation review; structure alone is not semantic proof.
35
35
 
36
+ Architecture Decisions use `SDD-...: decision; rationale: reason; consequence: trade-off`.
37
+ Each bullet has one concrete decision statement, exactly one nonempty `rationale:` field and
38
+ exactly one nonempty `consequence:` field (`trade-off:` is its alias, not an additional field).
39
+ The readiness check distinguishes absent decision/rationale/consequence fields from unresolved
40
+ author prompts and identifies the exact offending token and field. Quoted CLI syntax such as
41
+ `done <id>` stays literal. An inline, parseable JSON object/array introduced immediately by
42
+ `schema`, `JSON schema`, `schema example` or `JSON example` may use full quoted string values
43
+ `"<uuid>"`, `"<string>"`, `"<non-empty string>"`, `"<number>"`, `"<integer>"`,
44
+ `"<positive number>"`, `"<non-negative number>"`, `"<positive integer>"`,
45
+ `"<non-negative integer>"`, `"<boolean>"`, `"<null>"`, `"<object>"` or `"<array>"`.
46
+ This exception applies only to the decision clause, not type placeholders in JSON keys, arbitrary
47
+ inline code, malformed JSON, or the rationale/consequence. Regular JSON keys such as `"todo"`
48
+ are literal schema property names; angle-bracket prompts in keys remain unresolved.
49
+ Unknown prompts such as `<choose encoding>`,
50
+ `<why>`, `TBD` and `TODO` remain blockers; type notation cannot settle a material design choice.
51
+
36
52
  A decision that selects or changes a framework, library, external API, protocol, service or major
37
53
  version not already evidenced in the repository needs current authoritative sources through the
38
54
  host's available tools: official documentation/specification, release notes or migration guide of
@@ -60,8 +76,38 @@ A product-scope/acceptance conflict stays unresolved and returns to the earliest
60
76
  UR/PRD revision owner. Do not edit approved sources, invent a transition after downstream linking
61
77
  or manufacture answers; use supported revision/recovery and fresh source approval where required.
62
78
 
79
+ ### Realize brand-informed criteria
80
+
81
+ For applicable design work, read the adopted PRD criteria together with the exact project brand
82
+ source references retained by UX/PRD: path, version or content digest and relevant passages. Keep
83
+ that source identity in the existing Ownership And Source Of Truth and Constraints And Compatibility
84
+ sections and confirm the consumed version matches it. A framework example or another project's
85
+ brand file cannot replace the selected source; brand context cannot silently expand approved
86
+ product intent or acceptance.
87
+
88
+ SD owns the concrete realization: design tokens, typography, layout, information hierarchy and
89
+ controls. Record the relevant choices, reuse, rationale and trade-offs with the existing SDD IDs
90
+ and map each approved criterion once through Acceptance Traceability. Preserve the approved
91
+ perception and information priorities rather than inventing a parallel brand specification.
92
+
93
+ In Test And Evidence Strategy, identify representative states, observable checks and the evidence
94
+ needed to judge those criteria. Plan evidence for quality.md's UX Intent Fidelity matrix under the
95
+ same PRD criterion IDs; its existing review owner produces that matrix at the appropriate stage.
96
+ Add no second matrix, gate or automatic fidelity claim. A preview or source-file match is not
97
+ implementation evidence or independent human acceptance. Non-applicable work requires no new brand
98
+ file. Missing material design facts remain before_sd decisions below;
99
+ product conflicts return to the existing PRD/UR revision owner.
100
+
63
101
  ## Explicit revision and recording
64
102
 
103
+ A returned bound authoring continuation for an incomplete own unapproved draft already
104
+ selects its correction route. Consume its authoring-inputs/material_call/recording_calls
105
+ forms directly and use the supplied update_draft value. Do not dispatch this author again
106
+ or add another intake for that same snapshot. The *_action revise route below is only for
107
+ NEW editing intent on an already READY draft, and uses skill_id gate-check, never an author
108
+ skill ID or a host skill alias. After saving, follow the returned continuation once.
109
+
110
+
65
111
  Before recording, use the continuation's resolved language and summary fields with
66
112
  gate-artifact-preparation's Language and approval summary preparation. A translated summary
67
113
  must be part of the draft before presentation, not deferred until a renderer failure.
@@ -69,6 +69,14 @@ not independent proof of human provenance. Table headings may use levels two thr
69
69
 
70
70
  ## Recording and revision
71
71
 
72
+ A returned bound authoring continuation for an incomplete own unapproved draft already
73
+ selects its correction route. Consume its authoring-inputs/material_call/recording_calls
74
+ forms directly and use the supplied update_draft value. Do not dispatch this author again
75
+ or add another intake for that same snapshot. The *_action revise route below is only for
76
+ NEW editing intent on an already READY draft, and uses skill_id gate-check, never an author
77
+ skill ID or a host skill alias. After saving, follow the returned continuation once.
78
+
79
+
72
80
  A ready draft without new editing intent is presented unchanged. Explicit ready-draft revision uses
73
81
  gate-check intake true, intake_mode resume, exact run_id/expected_revision_id and tp_action revise
74
82
  (CLI --tp-action revise), exclusive of other source actions and continue_delivery. Approved changes
@@ -42,7 +42,7 @@ For `phase: ur_definition`, use only the returned governance_target, run_id, rev
42
42
  template_path is the absolute, version-matched template owned by the installed plugin runtime.
43
43
  Repository copies under `.agdf/control/templates/` are derived scaffold references and never
44
44
  override this authoring source. Read the template without rewriting it; persist only artifact_path.
45
- A direct invocation first dispatches ur-definition; without a bound run follow the existing
45
+ An already returned bound `ur_definition` continuation satisfies entry: consume its authoring inputs and writer forms directly. Do not repeat author dispatch or intake for that same snapshot. A direct invocation without such a continuation first dispatches ur-definition; without a bound run follow the existing
46
46
  resolve_delivery_run assignment, then gate-check intake/resume with its expected_revision_id.
47
47
  Never use AGDF_RUN_ID, cwd, discovery or a previous approval as authority. Missing, stale,
48
48
  foreign, invalid or approved bindings require fresh control routing; do not write.
@@ -104,7 +104,7 @@ follows its current-request language contract and does not change the artefact l
104
104
 
105
105
  Before recording a complete draft, when `approval_summary_required` is true, include exactly
106
106
  one `## <approval_summary_heading>` section using the supplied heading verbatim. Write a
107
- complete summary in the resolved presentation language covering problem, goal, affected users,
107
+ complete summary in the resolved presentation language. Read `approval_summary_format.required_fields` from authoring-inputs: those exact list field declarations need concrete authored values; prose or a heading alone is not a named field. Cover problem, goal, affected users,
108
108
  scope, non-goals, acceptance signals, source ownership, risks/unknowns and next step.
109
109
  Do not truncate decision-relevant content or use ellipses. The existing approval renderer's
110
110
  limits and validation apply. This summary is editorial; the UR remains authoritative.
@@ -116,9 +116,13 @@ is required merely to complete an unapproved incomplete draft.
116
116
 
117
117
  A new draft is recorded through existing run-step --step ur --title <short title>, using
118
118
  --dir <governance_target> --run <run_id> --revision <revision_id>.
119
- For an already registered unapproved draft, require explicit user revision intent. Resume
120
- through gate-check with intake true, intake_mode resume, run_id, expected_revision_id and
121
- ur_action revise (CLI --ur-action revise). Ordinary intake of a ready draft still presents it.
119
+ When this bound continuation returns a registered, incomplete unapproved draft, correct its
120
+ readiness gaps directly through the supplied `ur_draft.replace` form. The existing authoring
121
+ route already covers completing that same need; do not open another intake or dispatch.
122
+ A deliberate change to an already READY registered draft outside that continuation still
123
+ requires explicit user revision intent: enter via gate-check with intake true, intake_mode
124
+ resume, run_id, expected_revision_id and ur_action revise (CLI --ur-action revise).
125
+ Ordinary intake of a ready draft still presents it. Never substitute a field named revision.
122
126
  Stage the replacement and use ur_draft.replace with the current binding. The writer
123
127
  publishes the document and typed evidence atomically. Never edit bound bytes, reseal
124
128
  an unknown change or alter an approved UR or its approval.
@@ -34,6 +34,7 @@ export const commandRegistry = Object.freeze([
34
34
  command("opencode-repo", { preferred: [" --dir <path>"], scaffold: [" --dir <path>"] }),
35
35
  command("init", { preferred: [" [--operation <original-uuid>]"], scaffold: [""] }),
36
36
  command('project-state', { local: [' --dir <absolute-git-root> [--json] [--language <tag>]'] }),
37
+ command('run-view', { local: [' --dir <absolute-git-root> [--json] [--language <tag>] [--run <run-id>]...'] }),
37
38
  command('operation-status', { local: [' --dir <absolute-git-root> --module project.initialize/<original-uuid> [--json] [--language <tag>]'] }),
38
39
  command("config", { scaffold: [" --language de"] }),
39
40
  command("target-check", { local: [` --json [--language <tag>] [--working-directory <absolute-path>] [--target-source ${TASK_TARGET_SOURCE_GRAMMAR} --primary-target <absolute-path>]`] }),
@@ -72,7 +73,7 @@ export function supportedCommandNames() {
72
73
  export function validateCommandOptions(options) {
73
74
  if (options.native && (options.target !== 'status' || options.surface !== 'codex' || !options.dirExplicit || !options.dirInputAbsolute))
74
75
  throw Error('--native requires status --surface codex --dir <absolute-target>.');
75
- if (['project-state', 'operation-status'].includes(options.target)) {
76
+ if (['project-state', 'operation-status', 'run-view'].includes(options.target)) {
76
77
  if (!options.dirExplicit || !options.dirInputAbsolute) throw Error('Project reads require an explicit absolute --dir Git root.');
77
78
  if (options.target === 'operation-status' && !/^project\.initialize\/[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/u.test(options.contractModule ?? ''))
78
79
  throw Error('operation-status requires --module project.initialize/<original-uuid>.');
@@ -68,6 +68,7 @@ export function parseArgs(argv, dependencies = {}) {
68
68
  let generationTimeoutMs = 30000;
69
69
  let generationCostUnits = 5;
70
70
  let runId;
71
+ const runIds = [];
71
72
  let gate;
72
73
  let revisionId;
73
74
  let response;
@@ -161,6 +162,7 @@ export function parseArgs(argv, dependencies = {}) {
161
162
 
162
163
  if (arg === "--run") {
163
164
  runId = requiredValue(args, i, arg);
165
+ runIds.push(runId);
164
166
  i += 1;
165
167
  continue;
166
168
  }
@@ -363,10 +365,10 @@ export function parseArgs(argv, dependencies = {}) {
363
365
  throw new CliUsageError("Source revision identity and evidence flags may not repeat");
364
366
  }
365
367
  if (documentServer !== undefined && target !== 'render-document') throw new CliUsageError('--server requires render-document');
366
- if (['project-state', 'operation-status'].includes(target)) {
367
- const allowed = new Set(['--dir', '--json', '--language', '--lang', ...(target === 'operation-status' ? ['--module'] : [])]);
368
- if ([...flagCounts].some(([flag, count]) => count !== 1 || !allowed.has(flag)))
369
- throw new CliUsageError('Project reads accept only unique --dir, --json, --language and operation-status --module selectors.');
368
+ if (['project-state', 'operation-status', 'run-view'].includes(target)) {
369
+ const allowed = new Set(['--dir', '--json', '--language', '--lang', ...(target === 'operation-status' ? ['--module'] : []), ...(target === 'run-view' ? ['--run'] : [])]);
370
+ if ([...flagCounts].some(([flag, count]) => (count !== 1 && flag !== '--run') || !allowed.has(flag)))
371
+ throw new CliUsageError('Project reads accept only unique --dir, --json, --language, operation-status --module and repeatable run-view --run selectors.');
370
372
  }
371
373
  if (documentRequest && target !== 'render-document') throw new CliUsageError('--request requires render-document');
372
374
  if (target === 'render-document') {
@@ -462,6 +464,7 @@ export function parseArgs(argv, dependencies = {}) {
462
464
  model,
463
465
  generateCandidates,
464
466
  runId,
467
+ ...(target === 'run-view' ? { runIds } : {}),
465
468
  gate,
466
469
  revisionId,
467
470
  response,
@@ -1,6 +1,35 @@
1
1
  import { createCoreServices } from '#agdf-core';
2
+ import { readRunView } from '#agdf-core/companion/run-view.js';
2
3
  import { resources, resolveConfiguredChatLanguage } from '../runtime/control-context.js';
3
4
  import { cliGitObservation } from '../control-evaluation/git-observation.js';
5
+ import { RUN_ID_PATTERN } from '#agdf-core/control-state/run-identity.js';
6
+ import { CliUsageError } from './parse-args.js';
7
+
8
+ // An explicit --language wins; otherwise the configured chat language. A configuration that cannot be
9
+ // resolved (unsupported layout, invalid value) must not hide the store diagnosis (PRD AC-002), so the
10
+ // language is left to Core as executeProjectRead does: an unsupported store is reported in `store`,
11
+ // an invalid configuration as the evaluation error of every evaluated run (CR finding CIR-05; both
12
+ // cases are covered by run-view-command-test.js).
13
+ const readLanguage = options => {
14
+ if (options.languageExplicit) return options.language?.chat_language;
15
+ try { return resolveConfiguredChatLanguage(options.dir); } catch { return undefined; }
16
+ };
17
+
18
+ // Read-only companion run view (SD SDD-001): the status card fields of every active or unreadable
19
+ // run of one project root plus every run named with --run, versioned run-view/1. Writes nothing.
20
+ // Exit 0 for a complete view, 2 when the store is unavailable or has no control folder.
21
+ export function executeRunView(options, io = console) {
22
+ // A malformed run id is a usage error, never an evaluated run of its own (CR finding C3).
23
+ const invalid = (options.runIds ?? []).find(runId => !RUN_ID_PATTERN.test(runId));
24
+ if (invalid !== undefined) throw new CliUsageError(`run-view --run requires a run id (${RUN_ID_PATTERN}); got ${JSON.stringify(invalid)}.`);
25
+ const view = readRunView(options.dir, { language: readLanguage(options), runIds: options.runIds ?? [] });
26
+ if (options.json) io.log(JSON.stringify(view, null, 2));
27
+ else {
28
+ io.log(`AGDF run-view: ${view.store.status}${view.store.reason ? ` (${view.store.reason})` : ''}`);
29
+ for (const run of view.runs) io.log(`- ${run.run_id}: ${run.evaluated ? `${run.status} · ${run.current_gate} · ${run.next_step_text}` : run.lifecycle ?? 'unreadable'}`);
30
+ }
31
+ return view.store.status === 'ok' ? 0 : 2;
32
+ }
4
33
 
5
34
  // CLI syntax only. Target confirmation, facts and original-operation semantics
6
35
  // stay with the same inspect owner used by MCP.
@@ -1,5 +1,5 @@
1
1
  import { executeRunAlias } from './run-command-aliases.js';
2
- import { executeProjectRead } from './project-read-command.js';
2
+ import { executeProjectRead, executeRunView } from './project-read-command.js';
3
3
  import { localePack } from '#agdf-core/interaction-presentation.js';
4
4
  import { renderCodexDocument } from './codex-document-command.js';
5
5
  import { readFileSync, lstatSync, openSync, fstatSync, closeSync, constants } from "node:fs";
@@ -46,6 +46,7 @@ export function createValidationHandlers(io = console) {
46
46
  } }).dispatch;
47
47
  return new Map([
48
48
  ...['project-state', 'operation-status'].map(name => [name, options => executeProjectRead(options, io)]),
49
+ ['run-view', options => executeRunView(options, io)],
49
50
  ['render-document', options => renderCodexDocument(options)],
50
51
  ...['run-create', 'run-present', 'run-approve', 'run-step', 'run-revise', 'run-close'].map(name => [name, options => executeRunAlias(options, io)]),
51
52
  ...Object.entries(commandGroupRoutes).map(([route, group]) => [route, options => {
@@ -7,11 +7,30 @@ import { createPresentationDelivery } from '#agdf-core/control-state/presentatio
7
7
  import { mcpControlContinuation } from '#agdf-core/skill-dispatch/mcp-continuation.js';
8
8
  import { inspectRunInputResolution } from '#agdf-core/control-state/run-input-resolution.js';
9
9
  import { assertMcpControlReadBoundary } from "#agdf-core/control-read-boundary.js";
10
+ import { knownExecutionCode, validExecutionFacts } from '#agdf-core/mcp-tool-errors.js';
11
+ import { createCompanionJournal } from '#agdf-core/companion/journal.js';
10
12
  import { existsSync, lstatSync, realpathSync } from 'node:fs';
11
13
  import { isAbsolute } from 'node:path';
12
14
  import { composeMcpProtocolRuntime, errorSupport, inspectMcpDispatcherRuntime, configuredMcpCommandGroups } from './mcp-protocol-runtime.js';
13
15
  export { inspectMcpDispatcherRuntime, configuredMcpCommandGroups, CONTROL_INSPECT_FUNCTION_DEFINITION, SKILL_DISPATCH_FUNCTION_DEFINITION,
14
16
  parseControlInspectFunctionArguments, parseSkillDispatchFunctionArguments, serializeSkillDispatchResult, DECISION_UI_URI, OWNED_LOCK_CHANNEL, releaseAbandonedOwnedLock } from './mcp-protocol-runtime.js';
17
+ // Core reasons that the tool-error contract names differently. Core's command service maps
18
+ // RECOVERY_REQUIRED the same way and rejects the others under these existing codes.
19
+ const PREPARATION_REASONS = Object.freeze([
20
+ [/RECOVERY_REQUIRED/iu, 'recovery_required'],
21
+ [/^AGDF_PLANNED_SOURCE_STALE$/u, 'planning_source_stale'],
22
+ [/^(?:run_state_invalid|run_id_invalid)$/u, 'invalid_run'],
23
+ [/^AGDF_CONTROL_LAYOUT_MIGRATION_REQUIRED$/u, 'control_layout_unsupported'],
24
+ ]);
25
+ // Dispatch preparation only reads the input context and grants staged material; no command has
26
+ // been dispatched yet. Its failures therefore carry typed not_dispatched facts, so the facade and
27
+ // generation call sites report a rejected command with its classified reason, never an unknown effect.
28
+ export function preDispatchFailure(error) {
29
+ if (validExecutionFacts(error?.facts)) return Object.assign(error, { facts: { ...error.facts, dispatch: 'not_dispatched' } });
30
+ const reason = String(error?.message ?? '');
31
+ const code = knownExecutionCode(PREPARATION_REASONS.find(([pattern]) => pattern.test(reason))?.[1] ?? reason);
32
+ return Object.assign(new Error(code), { facts: { code, dispatch: 'not_dispatched' } });
33
+ }
15
34
  export async function createMcpCockpitRuntime({ surface, cockpitDir, cockpitMode, inspected = inspectMcpDispatcherRuntime() } = {}) {
16
35
  const pluginMode = cockpitMode === 'plugin';
17
36
  if (cockpitMode !== undefined && !pluginMode || pluginMode && (surface !== 'codex' || cockpitDir !== undefined)
@@ -66,6 +85,9 @@ export function createMcpDispatchRuntime({ surface, inspected = inspectMcpDispat
66
85
  commandGroups, runtimeControl, materialGrants, gitObservation: cliGitObservation,
67
86
  observeDoctor: (root, input, signal) => diagnostic.observe(root, input, signal),
68
87
  } });
88
+ // Companion events (companion core SDD-006): the executing process journals each final command result
89
+ // once, below the data root the launcher hands over; review facts read the sealed material here.
90
+ const journal = createCompanionJournal({ sealedFiles: transferId => services.material.sealedFiles(transferId) });
69
91
  const execute = input => mcpControlContinuation(input, services.dispatch(input), commandGroups);
70
92
  const executeInspect = services.inspect;
71
93
  const protocol = composeMcpProtocolRuntime({ surface, inspected, commandGroups, execute, executeInspect, inputContext, executionContext,
@@ -76,25 +98,28 @@ export function createMcpDispatchRuntime({ surface, inspected = inspectMcpDispat
76
98
  : input.command.kind === 'presentation.deliver' ? delivery.deliver(input, host) : services.command(group, input) });
77
99
  return Object.freeze({ ...protocol,
78
100
  verifyProducer,
79
- prepareDispatch(name, input) { return { inputContext: protocol.inputContextFor(input), materialGrants: ['agdf_record', 'agdf_revise', 'agdf_closeout'].includes(name) ? services.material.grants(input) : [] }; },
101
+ prepareDispatch(name, input) {
102
+ try {
103
+ return { inputContext: protocol.inputContextFor(input), materialGrants: ['agdf_record', 'agdf_revise', 'agdf_closeout'].includes(name) ? services.material.grants(input) : [] };
104
+ } catch (error) { throw preDispatchFailure(error); }
105
+ },
80
106
  readBudget,
81
107
  delivery,
108
+ observeOutcome: (name, input, result) => journal.observe(name, input, result),
82
109
  async postprocessToolResult(name, input, result) {
83
110
  const configuration = protocol.configurationProjection(input);
84
111
  if (configuration && name === 'agdf_inspect' && result.report) result = { ...result, report: { ...result.report, effective_configuration: configuration } };
85
112
  if (['agdf_record', 'agdf_revise', 'agdf_closeout'].includes(name)) services.material.settle(input, result);
86
113
  if (name !== 'agdf_prepare' || input.command?.kind !== 'presentation.prepare' || !result.family_result?.text) return result;
87
114
  delivery.remember(input, result);
88
- const prepared = result.family_result, { operation_id, ...binding } = input;
115
+ const prepared = result.family_result;
89
116
  return { ...result, presentation_delivery: { mode: 'prepared', text: '', presentation_id: prepared.presentation_id,
90
117
  document_digest: prepared.document_digest, authorizes: false,
91
118
  ...(prepared.preview_review ? { preview_review: { operation: 'presentation-preview', version: prepared.preview_review.descriptor.version,
92
119
  content_digest: prepared.preview_review.rendered_digest, access_state: 'not_observed', target_id: input.target_id,
93
120
  run_id: input.run_id, gate: 'PRD', expected_revision_id: input.expected_revision_id, presentation_id: prepared.presentation_id } } : {}),
94
- instruction: 'Prepared, not delivered. Optionally open agdf_decision_view as a non-primary preview. Then presentation.deliver selects once. Default route markdown; no second summary.',
95
- next_calls: [{ tool: 'agdf_prepare', arguments: { ...binding, command: { kind: 'presentation.deliver',
96
- payload: { gate: input.command.payload.gate, presentation_id: prepared.presentation_id, route: 'markdown' } } },
97
- required_input: { operation_id: 'Generate a new UUID for delivery; no gate approval is required.' } }] } };
121
+ instruction: 'Prepared, not delivered. Optionally open agdf_decision_view as a non-primary preview. Follow the authoritative top-level next action for presentation.deliver; its original UUID and binding are already supplied. No second summary and no generated delivery UUID.',
122
+ next_action_source: 'next_calls' } };
98
123
  },
99
124
  async close() { services.material.close(); delivery.close(); await diagnostic.close(); },
100
125
  inspectOwnership() { const d = diagnostic.inspectOwnership(); return { diagnostic: d, read_workers: readBudget.inspect(),
@@ -116,6 +141,7 @@ export async function createMcpDecisionRuntime({ runtime, ui, appOnlyMediationQu
116
141
  open: (input, result, host) => session.open(input, result, host), read: (input, signal, host) => session.read(input, signal, host),
117
142
  action: (input, host) => session.action(input, host), close: () => session.close() });
118
143
  return Object.freeze({ ...protocol,
144
+ observeOutcome: (name, input, result) => runtime.observeOutcome?.(name, input, result) ?? false,
119
145
  async postprocessToolResult(name, input, result, { uiSupported, client } = {}) {
120
146
  if (name === 'agdf_inspect' && input.operation === 'native-qualification' && result.report?.available) {
121
147
  return { ...result, report: { ...result.report, ui_rendering_support: uiSupported ? 'supported' : 'unsupported',
@@ -27,6 +27,7 @@ import {
27
27
  import { defaultNpmInstallRoot, npmInvocation } from "../npm-invocation.js";
28
28
  import { renameSyncWithRetry } from "#agdf-core/fs-swap.js";
29
29
  import { fsyncDirectory, withOwnedFileLock } from '#agdf-core/owned-file-lock.js';
30
+ import { createPreparedCallJournal } from './prepared-call-journal.js';
30
31
 
31
32
  const CLAIMS = '.agdf-executable-claims';
32
33
 
@@ -440,6 +441,12 @@ export function createMcpGenerationPublisher(base, { publicationDeadline = Infin
440
441
  if (canonical !== base.publisher_root || !base.immutable) throw Error('runtime_publication_unowned');
441
442
  return Object.freeze({
442
443
  initial: base,
444
+ // Only a freshly owned publisher supplies persistent transport storage.
445
+ // This is lazy: constructing/discovering the SDK creates no journal files.
446
+ preparedCallStore({ surface }) {
447
+ return createPreparedCallJournal({ publisherRoot: canonical, identity: { surface, version: base.version,
448
+ server_digest: base.digest, dispatcher_digest: base.dispatcherDigest, sdk_digest: base.sdkDigest } });
449
+ },
443
450
  resolve(candidate) {
444
451
  const keys = ['schema_version', 'publication_id', 'version', 'server_digest', 'dispatcher_digest', 'sdk_digest'];
445
452
  if (!candidate || Object.keys(candidate).sort().join() !== keys.sort().join()
@@ -1,10 +1,11 @@
1
1
  import { execFileSync, spawn, fork } from "node:child_process";
2
- import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, writeFileSync, rmdirSync } from "node:fs";
2
+ import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, realpathSync, writeFileSync, rmdirSync, unlinkSync } from "node:fs";
3
3
  import { dirname, isAbsolute, join, resolve } from "node:path";
4
4
  import process from "node:process";
5
5
  import { createHash, randomUUID } from 'node:crypto';
6
6
  import { digestDirectory, digestPluginMcpDispatcherSource, mcpDispatcherRuntimeEntries, mcpDispatcherPackageExports } from "#agdf-core/runtime/plugin-provenance.js";
7
7
  import { acquireMcpExecutableClaim, inspectMcpServerPackage, mcpPackageConstants, mcpRuntimeRetirementState, prepareMcpServerPackage, createMcpRuntimeRetirementTransaction } from "./package.js";
8
+ import { inspectPreparedCallJournals, retirePreparedCallJournals } from './prepared-call-journal.js';
8
9
 
9
10
  // Plugin-local AGDF MCP runtime shared by the hosts whose runtime plugin declares the server itself:
10
11
  // Claude Code passes ${CLAUDE_PLUGIN_DATA}, which it deletes on uninstall; Codex receives an absolute
@@ -15,6 +16,12 @@ const SDK_PACKAGE_SPEC = "@modelcontextprotocol/server@2.0.0";
15
16
  // the shipped digest; the override deliberately restores the unverified install and is recorded.
16
17
  export const SDK_BUNDLE = Object.freeze({ manifest: "package.json", lock: "package-lock.json", expected: "expected-sdk.json" });
17
18
  export const SDK_OVERRIDE_ENV = "AGDF_MCP_ALLOW_UNVERIFIED_SDK";
19
+ // The journal's data-root variable (COMPANION_DATA_ROOT_ENV of core companion/journal.js), kept as a
20
+ // literal so the launcher stays free of the journal module; the journal test asserts both agree.
21
+ export const COMPANION_DATA_ROOT_ENV = "AGDF_COMPANION_DATA_ROOT";
22
+ // The journal's directory and its two files below the data root (JOURNAL_DIRECTORY, JOURNAL_FILE and
23
+ // JOURNAL_ROTATED_FILE of core companion/journal.js), owned and removed with the runtime (SD SDD-006).
24
+ export const COMPANION_JOURNAL = Object.freeze({ directory: "companion", files: Object.freeze(["events.jsonl", "events.1.jsonl"]) });
18
25
  export const SDK_VERIFICATION = Object.freeze({ verified: "verified", override: "unverified_override" });
19
26
 
20
27
  function readJson(path) {
@@ -249,6 +256,10 @@ export async function launchPluginMcpServer({
249
256
  return null;
250
257
  }
251
258
  const { surface, dataRoot, cockpitDir, cockpitMode, prepareOnly } = invocation;
259
+ // Companion events (companion core SDD-006): the facade and its generations journal final tool
260
+ // results below the data root this launcher received; the variable reaches them with the facade's
261
+ // environment only. Preparation keeps the launcher's own environment.
262
+ const facadeEnv = typeof dataRoot === 'string' && dataRoot ? { ...env, [COMPANION_DATA_ROOT_ENV]: resolve(dataRoot) } : env;
252
263
  const publicationDeadline = performance.now() + CONCURRENT_PUBLICATION_WAIT_MS;
253
264
  let runtime, waitingOwner;
254
265
  try {
@@ -256,7 +267,7 @@ export async function launchPluginMcpServer({
256
267
  // preparation. It cannot claim or start a facade until the private message
257
268
  // carries the successfully verified publication.
258
269
  if (!prepareOnly && !startFacade && acquireClaim === acquireMcpExecutableClaim && ensure === ensurePluginMcpRuntime)
259
- waitingOwner = startFacadeOwner({ surface, cockpitDir, cockpitMode, pluginRoot, env, publicationDeadline });
270
+ waitingOwner = startFacadeOwner({ surface, cockpitDir, cockpitMode, pluginRoot, env: facadeEnv, publicationDeadline });
260
271
  // Reject a damaged installed dispatcher before publication, claim acquisition
261
272
  // or SDK execution. Its downstream resource context cannot qualify a facade;
262
273
  // starting one first would correctly retain its unconfirmed executable use.
@@ -285,7 +296,7 @@ export async function launchPluginMcpServer({
285
296
  // executable before fork and releases only after orderly teardown AND exit.
286
297
  if (!startFacade && acquireClaim === acquireMcpExecutableClaim) {
287
298
  try {
288
- const owner = waitingOwner ?? startFacadeOwner({ runtime, surface, cockpitDir, cockpitMode, pluginRoot, env, publicationDeadline });
299
+ const owner = waitingOwner ?? startFacadeOwner({ runtime, surface, cockpitDir, cockpitMode, pluginRoot, env: facadeEnv, publicationDeadline });
289
300
  waitingOwner?.activate(runtime);
290
301
  return await owner.settled;
291
302
  }
@@ -299,7 +310,7 @@ export async function launchPluginMcpServer({
299
310
  ? error.message : 'AGDF_MCP_EXECUTABLE_CLAIM_INVALID';
300
311
  stderr.write(`${launcherFailureLine(code)}\n`); process.exitCode = 1; return null;
301
312
  }
302
- try { return await (startFacade ?? supervisePluginMcpFacade)({ runtime, surface, cockpitDir, cockpitMode, pluginRoot, env, publicationDeadline, claim }); }
313
+ try { return await (startFacade ?? supervisePluginMcpFacade)({ runtime, surface, cockpitDir, cockpitMode, pluginRoot, env: facadeEnv, publicationDeadline, claim }); }
303
314
  catch (error) {
304
315
  const code = Object.hasOwn(LAUNCHER_FAILURES, error?.message) ? error.message : 'AGDF_MCP_PLUGIN_RUNTIME_FAILED';
305
316
  stderr.write(`${launcherFailureLine(code, 'facade')}\n`); process.exitCode = 1; return null;
@@ -376,12 +387,18 @@ export const claudePluginMcpConstants = Object.freeze({ sdkPackageSpec: SDK_PACK
376
387
 
377
388
  // Codex keeps the plugin-local MCP runtime in an AGDF-owned data root because it passes no plugin data
378
389
  // directory; `codex plugin remove` cannot delete it. `dataRoot` is the launcher data root (--data);
379
- // uninstall removes it only when it holds nothing but owned runtimes and abandoned stages under mcp/.
390
+ // uninstall removes it only when it holds nothing but owned runtimes and abandoned stages under mcp/
391
+ // and the companion journal (a plain directory holding only its own regular files).
392
+ function ownedCompanionJournal(dataRoot) {
393
+ const directory = join(dataRoot, COMPANION_JOURNAL.directory), stats = lstatSync(directory);
394
+ if (!stats.isDirectory() || stats.isSymbolicLink()) return false;
395
+ return readdirSync(directory).every(name => COMPANION_JOURNAL.files.includes(name) && lstatSync(join(directory, name)).isFile());
396
+ }
380
397
  export function inspectPluginMcpDataRoot(dataRoot) {
381
398
  if (!existsSync(dataRoot)) return "absent";
382
399
  try {
383
400
  if (!lstatSync(dataRoot).isDirectory() || lstatSync(dataRoot).isSymbolicLink()) return "foreign";
384
- if (readdirSync(dataRoot).some((name) => name !== "mcp")) return "foreign";
401
+ if (readdirSync(dataRoot).some((name) => name !== "mcp" && !(name === COMPANION_JOURNAL.directory && ownedCompanionJournal(dataRoot)))) return "foreign";
385
402
  const mcpDataRoot = join(realpathSync(dataRoot), "mcp");
386
403
  if (!existsSync(mcpDataRoot)) return "owned";
387
404
  if (!lstatSync(mcpDataRoot).isDirectory() || lstatSync(mcpDataRoot).isSymbolicLink()) return "foreign";
@@ -390,6 +407,10 @@ export function inspectPluginMcpDataRoot(dataRoot) {
390
407
  const path = join(mcpDataRoot, name);
391
408
  const stats = lstatSync(path);
392
409
  if (!stats.isDirectory() || stats.isSymbolicLink()) return "foreign";
410
+ if (name === 'prepared-calls') {
411
+ if (inspectPreparedCallJournals(mcpDataRoot) !== 'owned') return 'foreign';
412
+ continue;
413
+ }
393
414
  if (name !== 'generations') {
394
415
  if (!ownedRoot(path) && !name.startsWith('.stage-')) return 'foreign';
395
416
  protectedFiles = true; continue;
@@ -430,7 +451,14 @@ export function retirePluginMcpDataRoot(dataRoot, revalidate = () => {}) {
430
451
  rmdirSync(publication);
431
452
  }
432
453
  if (existsSync(generations)) rmdirSync(generations);
454
+ retirePreparedCallJournals(mcp);
433
455
  if (existsSync(mcp)) rmdirSync(mcp);
456
+ const journal = join(dataRoot, COMPANION_JOURNAL.directory);
457
+ if (existsSync(journal)) {
458
+ revalidate();
459
+ for (const name of COMPANION_JOURNAL.files) if (existsSync(join(journal, name))) unlinkSync(join(journal, name));
460
+ rmdirSync(journal);
461
+ }
434
462
  revalidate(); rmdirSync(dataRoot);
435
463
  return true;
436
464
  } catch (error) {