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
@@ -1,106 +1,93 @@
1
- import { projectStoredRun } from './core.mjs';
2
- // Bounded, read-only current-Run projection. Typed records and display policy come
3
- // from the canonical pure Core modules. This does not qualify seals or file evidence
4
- // and never authorizes a gate or command. File access remains injected by the host.
1
+ // Run view reader (SD SDD-010): obtains the Core run view through the plugin runtime's read-only
2
+ // `run-view` command and maps it to the companion's runs. The companion derives no run semantics of
3
+ // its own: status, gate path, missing approval, next step and figure come from the status card's
4
+ // evaluator. Process access is injected by the host ({ run(argv, init) }, as `$.process` provides).
5
5
 
6
- export const GATES = Object.freeze(['UR', 'PRD', 'SD', 'TP', 'QA', 'UAT', 'OR']);
7
- // The internal steps between an approved TP and QA, shown as the build phase (SDD-02, SDD-03).
6
+ export const RUN_VIEW_SCHEMA = 'run-view/1';
7
+ export const RUN_VIEW_TIMEOUT_MS = 10_000;
8
+ // Why a run-view read failed; each has a catalog text under `unreadable` (shown with the failure).
9
+ export const READ_FAILURE_REASONS = Object.freeze(['timeout', 'unavailable', 'exit', 'malformed', 'source_changed']);
10
+ // Store reasons of a read that may succeed on the next attempt (a write during the read, the read
11
+ // budget); they keep the last good view, marked stale, like a failed read (CR delta review RV-1).
12
+ export const TRANSIENT_STORE_REASONS = Object.freeze(['source_changed', 'timeout']);
13
+ // The internal steps between an approved TP and QA, shown as the build phase in the gate bar.
8
14
  export const BUILD_GATES = Object.freeze(['Brownfield Analysis', 'CD+Tests', 'CR']);
9
15
  export const isStructured = route => route === 'structured_delivery' || route === 'structured_slice';
10
- // The host rejects reads over 4 MiB; the largest observed run state is about 280 KB.
11
- export const MAX_RUN_STATE_BYTES = 1024 * 1024;
12
16
  const TEXT_LIMIT = 240;
17
+ const clip = text => { const value = String(text ?? ''); return value.length > TEXT_LIMIT ? `${value.slice(0, TEXT_LIMIT - 1)}…` : value; };
13
18
 
14
- // The run lifecycles the core reader accepts (`LIFECYCLES` in run-state-parser.js); the logic suite
15
- // asserts that both sets are equal, so a new core lifecycle fails it instead of reading unreadable.
16
- export const LIFECYCLES = Object.freeze(['active', 'completed', 'superseded', 'abandoned']);
17
- const KNOWN_LIFECYCLES = new Set(LIFECYCLES);
18
- const plain = value => String(value ?? '').replace(/`/gu, '').trim();
19
- const clip = text => (text.length > TEXT_LIMIT ? `${text.slice(0, TEXT_LIMIT - 1)}…` : text);
20
-
21
- // Body of a level-two section, without its heading; '' when absent.
22
- export function section(text, heading) {
23
- const lines = text.split('\n');
24
- const start = lines.findIndex(line => line.trimEnd() === `## ${heading}`);
25
- if (start < 0) return '';
26
- const rest = lines.slice(start + 1);
27
- const end = rest.findIndex(line => line.startsWith('## '));
28
- return (end < 0 ? rest : rest.slice(0, end)).join('\n');
19
+ // The only command the companion runs: the read-only run view of one project root.
20
+ export function runViewArgv({ pluginRoot, root, language, runIds = [] }) {
21
+ return ['node', `${pluginRoot}/runtime/agdf-local.js`, 'run-view', '--dir', root, '--json', '--language', language,
22
+ ...runIds.flatMap(runId => ['--run', runId])];
29
23
  }
30
24
 
31
- const field = (body, key) => plain(body.match(new RegExp(`^- ${key}:[ \\t]*(.*)$`, 'mu'))?.[1]);
32
-
33
- // Canonical writers keep a review or gate result in the Artefacts row of the step that produced it
34
- // (`CR | … | revise`, `QA | … | block`); a Quick Task's Code Review is the CR row. The Run Meta
35
- // `decision` stays `in_progress` (CR-F02).
36
- const RESULT_ROWS = Object.freeze({ 'Quick Task Execution': ['CR'] });
37
- const RESULTS = new Set(['revise', 'block', 'blocked']);
38
- // The core's decision-content placeholder rule (`isDecisionContentPlaceholder`,
39
- // decision-content-readiness.js), so a template objective is never shown as the run's goal.
40
- const PROMPTS = new Set(['describe the trustworthy outcome.', 'what outcome should become possible?',
41
- 'which tp tasks are fully done, partially done or not done?', 'what remains unverified?', 'which risks remain and what is their impact?']);
42
- export function isPlaceholderText(value) {
43
- if (typeof value !== 'string') return true;
44
- const text = value.trim().replace(/^`([^`]+)`$/u, '$1').replace(/\s+/gu, ' ').toLowerCase();
45
- return !text || PROMPTS.has(text)
46
- || /^(?:todo|tbd|<[^>]+>|(?:draft|done|ready|blocked|pass|revise|block)(?:\s*\|\s*(?:draft|done|ready|blocked|pass|revise|block))+)$/u.test(text);
25
+ // One run-view entry as the companion's run.
26
+ export function companionRun(entry) {
27
+ return Object.freeze({
28
+ id: entry.run_id,
29
+ lifecycle: entry.lifecycle,
30
+ evaluated: entry.evaluated === true,
31
+ gate: entry.current_gate ?? null,
32
+ route: entry.mode ?? null,
33
+ updatedAt: entry.last_activity ?? '',
34
+ missing: entry.missing_approval ?? 'none',
35
+ next: entry.next_step ?? '',
36
+ nextText: entry.next_step_text ?? '',
37
+ blockingText: entry.blocking_text ?? '',
38
+ path: Object.freeze((entry.path ?? []).map(({ gate, status }) => Object.freeze({ gate, status }))),
39
+ figure: entry.figure,
40
+ // Bound documents changed after recording (SDD-008), as the run view reports them.
41
+ drift: Object.freeze((entry.drift ?? []).map(item => Object.freeze({ ...item }))),
42
+ // The authored objective, never the status card's run title or a template text.
43
+ objective: clip(entry.objective ?? ''),
44
+ });
47
45
  }
48
46
 
49
- // Returns { ok: true, run } or { ok: false, id, reason } with reason missing | too_large | format.
50
- // Only version 4 typed records are accepted; retired persisted derived tables are refused.
51
- export function parseRunState(id, text) {
52
- if (typeof text !== 'string') return { ok: false, id, reason: 'missing' };
53
- if (text.length > MAX_RUN_STATE_BYTES) return { ok: false, id, reason: 'too_large' };
54
- const normalized = text.replace(/^/u, '').replace(/\r\n?/gu, '\n');
55
- const meta = section(normalized, 'Run Meta');
56
- let projection; try { projection = projectStoredRun(normalized); } catch { return { ok: false, id, reason: 'format' }; }
57
- const control = projection.control;
58
- const runId = field(meta, 'run_id');
59
- const lifecycle = field(meta, 'lifecycle');
60
- const gate = control.current_gate;
61
- const decision = lifecycle === 'completed' ? 'completed' : 'in_progress';
62
- const updatedAt = Number.isNaN(Date.parse(field(meta, 'updated_at'))) ? '' : field(meta, 'updated_at');
63
- if (!meta || runId !== id || !KNOWN_LIFECYCLES.has(lifecycle) || !gate) return { ok: false, id, reason: 'format' };
64
- const objective = section(normalized, 'Objective').split('\n').map(line => line.trim()).find(Boolean) ?? '';
65
- const statuses = new Map([...projection.facts.artefacts].map(([name, row]) => [name, row.status]));
66
- const gateResult = (RESULT_ROWS[gate] ?? [gate]).map(type => statuses.get(type)).find(status => RESULTS.has(status)) ?? null;
67
- return { ok: true, run: Object.freeze({
68
- id,
69
- lifecycle,
70
- gate,
71
- decision,
72
- route: projection.route,
73
- gateResult,
74
- gateDecision: control.presentation_decision?.action ?? null,
75
- updatedAt,
76
- missing: clip(projection.facts.artefacts.get(gate)?.path || gate === 'UAT' ? control.missing_approval ?? '' : 'none'),
77
- next: clip(control.next_allowed_action ?? ''),
78
- approved: Object.freeze([...projection.facts.approvals].filter(([, row]) => row.status === 'approved').map(([name]) => name)),
79
- objective: isPlaceholderText(objective) ? '' : clip(objective),
80
- }) };
47
+ // stdout of the command as a snapshot: { status, root, runs, unreadable, diagnosis, readAt }.
48
+ // status is ok, no_control, unavailable (store diagnosis with reason) or failed (no usable view).
49
+ export function snapshotFromRunView(stdout, { now }) {
50
+ let view;
51
+ try { view = JSON.parse(stdout); } catch { return { status: 'failed', runs: [], unreadable: [], readAt: now, error: 'malformed' }; }
52
+ if (view?.schema_version !== RUN_VIEW_SCHEMA || !Array.isArray(view.runs) || !view.store) {
53
+ return { status: 'failed', runs: [], unreadable: [], readAt: now, error: 'malformed' };
54
+ }
55
+ if (view.store.status === 'unavailable' && TRANSIENT_STORE_REASONS.includes(view.store.reason)) {
56
+ return { status: 'failed', runs: [], unreadable: [], readAt: now, error: view.store.reason };
57
+ }
58
+ // A run read while its files changed (after the run view's bounded retries) makes the view incomplete;
59
+ // like a transient store failure it keeps the last good view instead of showing that run as blocked.
60
+ const changedRun = view.runs.find(run => TRANSIENT_STORE_REASONS.includes(run?.evaluation_error));
61
+ if (changedRun) return { status: 'failed', runs: [], unreadable: [], readAt: now, error: changedRun.evaluation_error };
62
+ const status = view.store.status === 'ok' ? 'ok' : view.store.status === 'no_control' ? 'no_control' : 'unavailable';
63
+ return {
64
+ status,
65
+ root: view.root,
66
+ reason: view.store.reason ?? null,
67
+ // The run folders of an unsupported store, which the run view counts without reading them (AC-002).
68
+ runFolders: Number.isSafeInteger(view.store.run_folders) && view.store.run_folders > 0 ? view.store.run_folders : null,
69
+ runs: view.runs.filter(entry => entry.valid !== false && entry.listed !== false).map(companionRun),
70
+ unreadable: (view.diagnosis?.unreadable ?? []).map(({ run_id, reason }) => ({ id: run_id, reason })),
71
+ diagnosis: view.diagnosis ?? null,
72
+ readAt: now,
73
+ };
81
74
  }
82
75
 
83
- // Reads every run state below <projectRoot>/.agdf/control/runs through the injected file access
84
- // ({ exists, list, read }, as `$.fs` provides). Never writes. A failing directory read is
85
- // transient (status 'failed'); a single unreadable run state is reported per run. Without a
86
- // control folder the snapshot names the checked project root, so the panel can say where it looked.
87
- export async function readSnapshot(fs, projectRoot, { now }) {
88
- const runsDir = `${projectRoot}/.agdf/control/runs`;
76
+ // Runs the command through the host and never throws: a process failure, a timeout or malformed
77
+ // output is a failed snapshot with its cause, which the adapter settles as stale.
78
+ export async function readSnapshot(processes, { pluginRoot, root, language, runIds = [], now, clock = () => Date.now() }) {
79
+ let ran;
80
+ const started = await clock();
89
81
  try {
90
- if (!(await fs.exists(`${projectRoot}/.agdf/control`))) return { status: 'no_control', root: projectRoot, runs: [], unreadable: [], readAt: now };
91
- if (!(await fs.exists(runsDir))) return { status: 'ok', runs: [], unreadable: [], readAt: now };
92
- const folders = (await fs.list(runsDir)).filter(entry => entry.kind === 'dir' && !entry.isLink);
93
- const results = await Promise.all(folders.map(folder => fs.read(`${runsDir}/${folder.name}/RUN_STATE.md`)
94
- .then(text => parseRunState(folder.name, text), () => ({ ok: false, id: folder.name, reason: 'missing' }))));
95
- return {
96
- status: 'ok',
97
- runs: results.filter(result => result.ok).map(result => result.run),
98
- unreadable: results.filter(result => !result.ok).map(({ id, reason }) => ({ id, reason })),
99
- readAt: now,
100
- };
101
- } catch (error) {
102
- return { status: 'failed', runs: [], unreadable: [], readAt: now, error: String(error?.message ?? error).slice(0, TEXT_LIMIT) };
82
+ ran = await processes.run(runViewArgv({ pluginRoot, root, language, runIds }), { timeoutMs: RUN_VIEW_TIMEOUT_MS });
83
+ } catch {
84
+ // `$.process.run` rejects when the command cannot start or is still running at the timeout; its
85
+ // message format is not specified, so the elapsed time tells the two apart (CR finding CIR-06).
86
+ const elapsed = (await clock()) - started;
87
+ return { status: 'failed', runs: [], unreadable: [], readAt: now, error: elapsed >= RUN_VIEW_TIMEOUT_MS ? 'timeout' : 'unavailable' };
103
88
  }
89
+ if (ran.exitCode !== 0 && ran.exitCode !== 2) return { status: 'failed', runs: [], unreadable: [], readAt: now, error: 'exit' };
90
+ return snapshotFromRunView(ran.stdout, { now });
104
91
  }
105
92
 
106
93
  // A transient failure keeps the last good snapshot, marked stale with the failed read time (AC-006).
@@ -1,37 +1,11 @@
1
- // State rules (AC-003, AC-002 of the follow-up): which of the five moods a run shows and why, as a
2
- // reason descriptor the view localizes. A run matching no rule is reported unreadable rather than
3
- // guessed (SDD-04).
1
+ // Figure state of a run (SD SDD-004): the Core run view carries the derived mood and reason, so the
2
+ // companion only overlays its own turn activity. It derives no run semantics itself.
4
3
 
5
- import { BUILD_GATES, isStructured } from './run-state.mjs';
4
+ export const MOODS = Object.freeze(['laeuft', 'baut', 'wartet', 'blockiert', 'fertig', 'bereit']);
6
5
 
7
- export const MOODS = Object.freeze(['laeuft', 'baut', 'wartet', 'blockiert', 'fertig']);
8
- const BLOCKING = new Set(['revise', 'block', 'blocked', 'decline']);
9
- const AWAITING = new Set(['pending', 'awaiting_uat']);
10
- const WORKING = new Set(['in_progress', 'pass', 'qa_approved', 'completed']);
11
-
12
- // The gate a pending approval names, as in "Exact Approval: QA." or "Exact Approval: PRD for the new revision."
13
- export const pendingApproval = missing => String(missing ?? '').match(/\bApproval: (UR|PRD|SD|TP|QA|UAT|OR)\b/u)?.[1] ?? null;
14
-
15
- // The blocking outcome of a run: a legacy Run Meta decision, the current gate's recorded result
16
- // (`revise`, `block`, `blocked`) or a deliberate decision on its presented material.
17
- function blockingOutcome(run) {
18
- if (BLOCKING.has(run.decision)) return run.decision;
19
- if (run.gateResult) return run.gateResult;
20
- return { reject: 'decline', request_change: 'revise' }[run.gateDecision] ?? null;
21
- }
22
-
23
- // { mood, reason: { key, gate?, decision? } } or { mood: null, reason: { key: 'unknownState' } }.
24
- // A structured run between an approved TP and QA (Brownfield Analysis, CD+Tests, CR) is being built.
6
+ // { mood, reason: { key, gate?, decision?, reason? } } as the run view derived it.
25
7
  export function runState(run) {
26
- if (run.lifecycle === 'completed') return { mood: 'fertig', reason: { key: 'done' } };
27
- const outcome = blockingOutcome(run);
28
- if (outcome) return { mood: 'blockiert', reason: { key: 'blocked', gate: run.gate, decision: outcome } };
29
- const approval = pendingApproval(run.missing);
30
- if (approval) return { mood: 'wartet', reason: { key: 'waitingApproval', gate: approval } };
31
- if (AWAITING.has(run.decision)) return { mood: 'wartet', reason: { key: 'waitingDecision', gate: run.gate } };
32
- if (WORKING.has(run.decision) && isStructured(run.route) && BUILD_GATES.includes(run.gate)) return { mood: 'baut', reason: { key: 'building', gate: run.gate } };
33
- if (WORKING.has(run.decision)) return { mood: 'laeuft', reason: { key: 'working', gate: run.gate } };
34
- return { mood: null, reason: { key: 'unknownState' } };
8
+ return run?.figure ?? { mood: 'bereit', reason: { key: 'idle' } };
35
9
  }
36
10
 
37
11
  // Moods a main-loop turn does not cover: a run being built stays baut, and a run waiting for an
@@ -43,6 +17,6 @@ const THROUGH_TURN = new Set(['baut', 'wartet']);
43
17
  // the turn.
44
18
  export function displayState(run, { isTurnActive = false } = {}) {
45
19
  const derived = runState(run);
46
- if (isTurnActive && derived.mood !== null && !THROUGH_TURN.has(derived.mood)) return { mood: 'laeuft', reason: { key: 'turnActive' } };
20
+ if (isTurnActive && !THROUGH_TURN.has(derived.mood)) return { mood: 'laeuft', reason: { key: 'turnActive' } };
47
21
  return derived;
48
22
  }
@@ -5,53 +5,73 @@
5
5
  import { assignRun } from './assignment.mjs';
6
6
  import { FIGURE_TEXT } from './figure.mjs';
7
7
  import { condensedGateBar, gateBar, gateMarks } from './gate-bar.mjs';
8
- import { gateTitle, label, localizeNextStep } from './localization.mjs';
8
+ import { gateTitle, label } from './localization.mjs';
9
9
  import { displayState } from './state.mjs';
10
+ import { READ_FAILURE_REASONS } from './run-state.mjs';
11
+ import { eventText, latestReview, PANE_EVENTS, shortDigest } from './events.mjs';
10
12
 
11
13
  const two = value => String(value).padStart(2, '0');
14
+ // Preview lines the terminal text shows beneath the material line.
15
+ export const TERMINAL_PREVIEW_LINES = 3;
12
16
  // Last part of a project root in either path form ("C:\Work\app\" → "app").
13
17
  const folderName = root => String(root ?? '').replace(/[\\/]+$/u, '').split(/[\\/]/u).pop() || String(root ?? '');
14
18
  // Host-local wall-clock time, HH:MM.
15
19
  export const clockText = ms => { const at = new Date(ms); return `${two(at.getHours())}:${two(at.getMinutes())}`; };
16
20
 
17
21
  // input: { snapshot, sessionStartedAt, selection, mention, isBrowsing, isTurnActive, registry, labels,
18
- // locale, columns, isObjectiveExpanded }. Display only: the adapter persists selection changes.
22
+ // locale, columns, isObjectiveExpanded, events, eventsAvailable }. Display only: the adapter persists
23
+ // selection changes. `events` are this root's journal events since the last main-loop turn, newest first.
19
24
  export function buildPanelView(input) {
20
25
  const { snapshot, registry, labels, locale } = input;
21
26
  const t = (path, params) => label(labels, locale, path, params);
22
- const base = { title: t('title'), locale, mood: 'neutral', stateLabel: t('states.neutral'),
27
+ const base = { title: t('title'), locale, mood: 'bereit', stateLabel: t('states.bereit'),
23
28
  readAt: snapshot ? t('fields.lastRead', { time: clockText(snapshot.readAt) }) : null,
24
29
  stale: snapshot?.stale ? t('messages.stale', { time: clockText(snapshot.stale.failedAt), readAt: clockText(snapshot.readAt) }) : null,
25
30
  canRetry: true, openRuns: [] };
26
- const neutral = (message, extra = {}) => ({ ...base, message, ...extra });
31
+ // Event lines name only runs other than the shown one (owner request of 2026-11-06, T-013).
32
+ const events = shownRunId => eventFields(input, t, { shownRunId, runs: snapshot?.runs ?? [] });
33
+ const neutral = (message, extra = {}) => ({ ...base, ...events(null), message, ...extra });
27
34
  const unreadable = reason => neutral(t('messages.unreadable', { reason: t(`unreadable.${reason}`) }));
28
35
 
29
36
  if (!snapshot) return neutral(t('messages.reading'), { readAt: null });
30
- if (snapshot.status === 'failed') return unreadable('failed');
37
+ if (snapshot.status === 'failed') {
38
+ const reason = READ_FAILURE_REASONS.includes(snapshot.error) ? snapshot.error : 'unavailable';
39
+ return neutral(t('messages.runViewUnavailable', { reason: t(`unreadable.${reason}`) }));
40
+ }
41
+ if (snapshot.status === 'unavailable') {
42
+ // An unsupported store names how many run folders it holds and why none is readable (AC-002).
43
+ const reason = snapshot.reason ?? 'read_failed';
44
+ return snapshot.runFolders
45
+ ? neutral(t('messages.unreadableRuns', { count: snapshot.runFolders, reasons: t(`unreadable.${reason}`) }))
46
+ : unreadable(reason);
47
+ }
31
48
  if (snapshot.status === 'no_control') {
32
49
  return neutral(t('messages.noControl', { folder: folderName(snapshot.root) }), { hint: t('messages.noControlHint', { path: snapshot.root ?? '' }) });
33
50
  }
34
51
 
35
52
  const { run, origin, open, chatRunId } = assignRun({ runs: snapshot.runs, sessionStartedAt: input.sessionStartedAt, selection: input.selection,
36
53
  mention: input.mention ?? null, isBrowsing: Boolean(input.isBrowsing) });
54
+ // Unreadable runs stay visible as a count with their reasons beside the readable ones (AC-002, AC-003).
55
+ const reasons = [...new Set(snapshot.unreadable.map(item => t(`unreadable.${item.reason}`)))].join(', ');
56
+ const unreadableHint = snapshot.unreadable.length ? t('messages.unreadableRuns', { count: snapshot.unreadable.length, reasons }) : null;
37
57
  // Each open run carries its condensed gate bar for the list (owner request of 2026-10-28).
38
58
  const openRuns = open.map(item => ({ id: item.id, objective: item.objective, bar: condensedGateBar(gateMarks(item)) }));
39
59
  if (!run) {
40
60
  const broken = input.selection && snapshot.unreadable.find(item => item.id === input.selection);
41
- if (broken) return { ...unreadable(broken.reason), openRuns, chatRunId };
42
- if (!open.length) return neutral(t('messages.noOpenRuns'));
43
- return neutral(t('messages.noRunAssigned'), { hint: t('messages.noRunAssignedHint'), openRuns, chatRunId,
61
+ if (broken) return { ...unreadable(broken.reason), openRuns, chatRunId, unreadableHint };
62
+ if (!open.length) return neutral(unreadableHint ?? t('messages.noOpenRuns'));
63
+ return neutral(t('messages.noRunAssigned'), { hint: t('messages.noRunAssignedHint'), openRuns, chatRunId, unreadableHint,
44
64
  openCount: t('fields.openRuns', { count: open.length }) });
45
65
  }
46
66
 
47
67
  const position = open.findIndex(item => item.id === run.id);
48
68
  const openCount = position >= 0 ? t('fields.position', { position: position + 1, count: open.length }) : t('fields.openRuns', { count: open.length });
49
69
  const state = displayState(run, { isTurnActive: input.isTurnActive });
50
- // A run in an unknown state keeps stepping and the way back to the chat's run (CR-F01).
51
- if (state.mood === null) return { ...unreadable('unknownState'), runId: run.id, openRuns, chatRunId, openCount };
52
- const reasonParams = { gate: gateTitle(registry, locale, state.reason.gate), decision: t(`decisions.${state.reason.decision}`) };
70
+ const reasonParams = { gate: gateTitle(registry, locale, state.reason.gate), decision: run.blockingText || state.reason.decision,
71
+ reason: state.reason.reason ? t(`unreadable.${state.reason.reason}`) : '' };
53
72
  return {
54
73
  ...base,
74
+ ...events(run.id),
55
75
  mood: state.mood,
56
76
  stateLabel: t(`states.${state.mood}`),
57
77
  reason: t(`reasons.${state.reason.key}`, reasonParams),
@@ -59,12 +79,28 @@ export function buildPanelView(input) {
59
79
  runId: run.id,
60
80
  objective: run.objective,
61
81
  isObjectiveExpanded: Boolean(input.isObjectiveExpanded),
62
- nextStep: run.lifecycle === 'completed' ? null : localizeNextStep(registry, locale, run.next).text,
82
+ nextStep: run.lifecycle === 'completed' ? null : run.nextText || null,
83
+ unreadableHint,
63
84
  origin: t(`origin.${origin}`),
64
85
  originKind: origin,
65
86
  chatRunId,
66
87
  openRuns,
67
88
  openCount,
89
+ drift: run.drift?.length ? run.drift.map(item => t('messages.drift', { document: item.document,
90
+ recorded: shortDigest(item.recorded_digest), current: shortDigest(item.current_digest) })) : null,
91
+ };
92
+ }
93
+
94
+ // Pane entries of the journal (decision P1) and the review facts of the newest staging or recording
95
+ // (decision P2); without a readable journal the pane says so and invents nothing. `naming` is
96
+ // { shownRunId, runs }: the shown run's events name no run.
97
+ function eventFields(input, t, naming) {
98
+ const events = (input.events ?? []).slice(0, PANE_EVENTS);
99
+ const gate = value => gateTitle(input.registry, input.locale, value);
100
+ return {
101
+ events: events.length ? events.map(event => `${clockText(Date.parse(event.at))} ${eventText(event, t, { gateTitle: gate, ...naming })}`) : null,
102
+ review: latestReview(events, t),
103
+ eventsHint: input.eventsAvailable === false ? t('messages.eventsUnavailable') : null,
68
104
  };
69
105
  }
70
106
 
@@ -74,10 +110,19 @@ export function terminalText(view, { labels, locale }) {
74
110
  const lines = [view.title, `${FIGURE_TEXT[view.mood]} ${view.stateLabel}${view.reason ? ` · ${view.reason}` : ''}`];
75
111
  if (view.message) lines.push(view.message);
76
112
  if (view.hint) lines.push(view.hint);
113
+ if (view.unreadableHint && view.unreadableHint !== view.message) lines.push(view.unreadableHint);
77
114
  if (view.gateBar) lines.push(view.gateBar);
78
115
  if (view.runId) lines.push(view.origin ? `${view.runId} · ${view.origin}` : view.runId);
79
116
  if (view.objective) lines.push(`${t('fields.objective')}: ${view.objective}`);
80
117
  if (view.nextStep) lines.push(`${t('fields.nextStep')}: ${view.nextStep}`);
118
+ for (const warning of view.drift ?? []) lines.push(warning);
119
+ if (view.events) lines.push(`${t('fields.events')}:`, ...view.events);
120
+ if (view.review) {
121
+ lines.push(`${t('fields.material')}: ${view.review.summary} · ${view.review.match}${view.review.truncated ? ` · ${view.review.truncated}` : ''}`);
122
+ // The terminal shows the start of the preview too (PRD M1, AC-007; CR finding B10).
123
+ if (view.review.preview) lines.push(...view.review.preview.split('\n').slice(0, TERMINAL_PREVIEW_LINES).map(line => ` ${line}`));
124
+ }
125
+ if (view.eventsHint) lines.push(view.eventsHint);
81
126
  if (view.stale) lines.push(view.stale);
82
127
  if (view.readAt) lines.push(view.readAt);
83
128
  return lines.join('\n');
@@ -11,6 +11,7 @@ Explicit initialization creates `control_layout: "run-folders-v1"`. This is the
11
11
  SOT_REGISTRY.md
12
12
  CONTEXT_GRAPH.md
13
13
  AGENT_QUALITY_CONTRACTS.json
14
+ BRAND.md
14
15
  templates/
15
16
  planned/<plan_id>/UR.md
16
17
  runs/<run_id>/
@@ -28,6 +29,10 @@ Explicit initialization creates `control_layout: "run-folders-v1"`. This is the
28
29
 
29
30
  Configuration, templates and curated project context stay project-wide. A multi-Run closure preview is a target-wide decision proposal under `closure-previews/`; it changes no Run until deliberately applied. Run-owned outputs never use a separate top-level artefacts directory.
30
31
 
32
+ `BRAND.md` starts as a neutral English worksheet. Complete it with the project's
33
+ own design intent and declare the finished source in `SOT_REGISTRY.md` when it is
34
+ authoritative for design work.
35
+
31
36
  `RUN_STATE.md` keeps identity, objective, mode and typed decisions, source bindings and operations. Approval status, current gate, current document references, relationship chains, evidence summaries and inventory are derived when read. They are not separately writable tables or a second state file. A binding embeds its reviewer attestation; no separate RECORD/REVIEW JSON repeats its mapping. A planned handoff records its source in the creation receipt and immutable planning snapshot, without an origin JSON copy.
32
37
 
33
38
  Create a fresh scaffold in an explicitly confirmed existing Git repository:
@@ -0,0 +1,28 @@
1
+ # Brand and Design Intent
2
+
3
+ Complete this worksheet with confirmed project decisions. Declare the completed
4
+ profile in `SOT_REGISTRY.md` when it is the project's authoritative design source.
5
+
6
+ ## Owner and scope
7
+
8
+ Name the accountable owner, the product, and the surfaces and audiences covered.
9
+
10
+ ## Design intent
11
+
12
+ Describe what people should understand, feel, or be able to do when using the
13
+ product. Tie each priority to a concrete user task or situation.
14
+
15
+ ## Information and visual priorities
16
+
17
+ Explain what deserves emphasis in relevant states and how the project balances
18
+ competing priorities. Record any confirmed constraints and their sources.
19
+
20
+ ## Observable checks
21
+
22
+ For each applicable priority, name the scenario, the expected observable outcome,
23
+ and the evidence that would verify it. Record open decisions with their owners.
24
+
25
+ ## Related sources
26
+
27
+ Link the project's design system, implementation values, and brand usage policy
28
+ where applicable.
@@ -69,6 +69,17 @@ visible feedback, blocker/failure behavior, recovery/next action, observable suc
69
69
  evidence. Specify observable behavior, not implementation. Do not leave the section empty or retain
70
70
  placeholders when requesting approval.
71
71
 
72
+ Use separate field names; never combine them (for example,
73
+ `observable_success_required_evidence` is not `observable_success`). For same-language approval,
74
+ each criterion needs at least one nonempty `observable_success`, `visible_feedback` or
75
+ `expected_effective_state`. Keep applicable UX fields separate as well. Example:
76
+
77
+ ```markdown
78
+ - criterion_id: AC-001
79
+ - observable_success: A later list command shows the saved task unchanged.
80
+ - required_evidence: A real CLI test across separate processes.
81
+ ```
82
+
72
83
  ## 6. Non-Goals
73
84
 
74
85
  What remains out of scope?
@@ -25,6 +25,10 @@ Use stable IDs. If no binding design decision is needed, record one reasoned bul
25
25
  When a decision selects or changes external technology (framework, library, API, protocol,
26
26
  service or major version), name the checked authoritative source, version and check date in its
27
27
  rationale.
28
+ Quoted CLI arguments such as `done <id>` are literal syntax. In a decision clause, a labelled
29
+ inline JSON schema/example may use quoted type metavariables such as `"<uuid>"` and
30
+ `"<non-empty string>"`; keep actual choices, rationale and consequence concrete. The complete
31
+ notation and unresolved-prompt boundary are defined in `meta/contracts/sd-definition.md`.
28
32
 
29
33
  ## 4. Integration Points
30
34
 
@@ -1,7 +1,7 @@
1
1
  # UX Intent Definition: <Title>
2
2
 
3
3
  Status: draft | ready | blocked | not_applicable
4
- Decision: ready | blocked | not_applicable
4
+ - decision: ready | blocked | not_applicable
5
5
  Based on: approved UR and post-UR routing evidence
6
6
  Date:
7
7
  Owner:
@@ -85,8 +85,18 @@ Unknown/unowned partial states remain blocked. Successful setup returns creation
85
85
  `agdf_run/run.create` creates an unapproved Run from a semantic title and original operation UUID;
86
86
  pre-Run `operation-status` resolves a lost response without inventing a second Run.
87
87
  `authoring-inputs` returns versioned templates and exact sources with bounded cursors.
88
- `agdf_record/material.stage` transfers at most 16 KiB per part and 128 KiB per file, then seals
89
- Core-owned references for existing typed writers, including reviewed formal artefacts, unapproved
88
+ `authoring-inputs.material_call` supplies a bound form: fill its UTF-8 content and use
89
+ `agdf_record/material.stage` action `put` to seal files of at most 48 KiB each within the 64 KiB whole JSON request bound in one call.
90
+ The Core computes byte counts, material identities and digests. Larger files retain the bounded
91
+ multipart path (16 KiB per part, 128 KiB per file). Each multipart action has its own operation UUID;
92
+ only an identical retry reuses a UUID. Returned `recording_calls` provide the binding and material
93
+ reference; fill only the listed author/review fields. Ready `next_calls` are executable as supplied;
94
+ do not add intake/revision fields to a supplied `continue_delivery` dispatch.
95
+ Pass authored Markdown as UTF-8 string data through structured input. If a host uses JavaScript,
96
+ author with its file-editing tool and pass the UTF-8 file read as the content value; embedding
97
+ the whole document in a backtick literal makes Markdown syntax executable JavaScript syntax.
98
+ This guidance adds no server-side file reader and changes no byte or input limit.
99
+ These Core-owned references feed existing typed writers, including reviewed formal artefacts, unapproved
90
100
  UR replacement, Verified Change and closeout. Code edits, actual tests and Git execution remain
91
101
  external work; none of these operations grants approval.
92
102
 
@@ -246,3 +256,17 @@ They do not qualify an installed host or another OS. The fixed performance test
246
256
  the actual owned plugin launcher with 20/20 samples and p95 limits of 2500 ms cold /
247
257
  1000 ms warm. Performance acceptance and native qualification are separate
248
258
  required evidence, not consequences of the topology declaration.
259
+
260
+ The normal MCP path is `next_action.call`: either a ready call forwarded unchanged or a form with named `required_inputs` such as `content`, `title`, `reviewer`, `reviewed` or `response`. The adapter maps those names to the stored canonical payload fields. It retains the original target, Run, revision, permission group and operation UUID; it never fills authored content, review attestations or approval replies. The former competing `submit` form is absent. Raw requests remain accepted for compatibility, but the full original request is exposed only under the explicit `recovery_only` branch, with the exact field map and original UUID. Retain that branch and the actual submitted inputs for uncertain-outcome recovery; do not generate a replacement identity.
261
+
262
+ Verified owned plugin launchers retain offered templates in a private bounded journal under their existing MCP data root. The namespace includes the serving surface, version and server/dispatcher/SDK identity. A reconnect at that same identity can resolve the original reference without a new UUID or refreshed revision. The original 30-minute lifetime is never renewed. No submitted author/review/reply inputs or execution receipts are added to this journal; it is transport storage, not canonical Run State or authority. Direct transports without this verified owner remain connection-local. Private material buffers have their separate existing generation lifetime and still require exact semantic-byte recovery after generation loss.
263
+
264
+ Empty, malformed, unknown and known-expired references remain distinct. An unavailable live reference returns `prepared_call_unknown`, rather than blaming the authored command schema. Store failures are distinguished from missing references. A failed publication of a future reference never discards an already successful operation receipt; its exact original request remains in recovery. Every restored call still passes the current SDK, permission-group, Core and revision checks.
265
+
266
+ For a unique Core-supplied normal next step, the adapter may execute one exact `agdf_inspect` call for `authoring-inputs`, `gate-check` or `operation-contract` and include it as `next_read.result`. `next_action.context_path` names that already-loaded context. The original operation outcome and receipt remain intact if this separate read fails. No dispatch, write, presentation or approval is chained automatically; `agdf_dispatch` is not read-only. Source pagination remains explicit. Internal read attempts/failures are accounted separately from outer MCP invocations in native observations.
267
+
268
+ `authoring-inputs` supports `bundle:true` for bounded multi-document pages. Read every chunk and cursor without a duplicate writer-contract lookup. A retained first-page form is reusable only for the same exact manifest and an available connection reference; otherwise use the supplied first-page read. Page transport does not prove source review.
269
+
270
+ Prepared references also retain explicitly offered `agdf_inspect` reads, including source pages, contract help and original-operation status. Read inputs stay `{}`; the original SDK schema validates the complete supplied request before registration. Target, Run, revision, cursor and original status selection are never inferred or refreshed. The actual `next_read.tool/arguments` remain the record of an already executed read; its separate `next_read.call` is the exact prepared retry. Explicit recovery reads remain Raw for reconnect, and dispatch retains its original schema. No reference changes permission or bypasses canonical validation.
271
+
272
+ Bundled authoring reports use `document_bundle_v2`: `documents` contains complete text, `document_manifest` is metadata only, and `fragments` must be joined by identity and byte offsets across all cursors before editing. Missing content must never be coerced into a replacement string.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agdf/mcp-server",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Local MCP adapter for version-matched AGDF dispatch and control inspection.",
5
5
  "type": "module",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  "scripts": {
23
23
  "test:contract": "node ./test/worker-build.test.js && node ./test/contract.test.js",
24
24
  "test:continuation": "node ./test/continuation.test.js",
25
- "test:protocol": "node ./test/defaulted-inputs.test.js && node ./test/protocol.test.js && node ./test/ergonomics.test.js && node ./test/skill-names.test.js && node ./test/tool-errors.test.js && node ./test/doctor-observation.test.js",
25
+ "test:protocol": "node ./test/defaulted-inputs.test.js && node ./test/protocol.test.js && node ./test/ergonomics.test.js && node ./test/skill-names.test.js && node ./test/tool-errors.test.js && node ./test/pre-dispatch-failure.test.js && node ./test/companion-journal.test.js && node ./test/doctor-observation.test.js && node ./test/prepared-call-transport.test.js && node ./test/prepared-call-journal.test.js && node --test ./test/next-action.test.js && node ./test/safe-read-continuation.test.js && node ./test/prepared-submission.test.js && node ./test/prepared-reads.test.js && node ./test/prepared-reconnect.test.js",
26
26
  "test:safety": "node ./test/safety.test.js && node ./test/worker-lock-release.test.js && node ./test/worker-deadline.test.js",
27
27
  "test:cockpit-gating": "node ./test/cockpit-gating.test.js",
28
28
  "test:provenance": "node ./test/provenance.test.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@modelcontextprotocol/server": "2.0.0",
39
- "create-agdf": "0.30.0"
39
+ "create-agdf": "0.31.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@modelcontextprotocol/client": "2.0.0"
@@ -12,6 +12,11 @@ export function startGenerationRuntime({ epoch, generation, channel }) {
12
12
  return { ...owned, inflight: inflight + (starting ? 1 : 0) + (owned.inflight ?? 0),
13
13
  executor: executor?.active ? 1 : 0, uncertain: unknown.size + (owned.uncertain ?? 0), closing };
14
14
  }
15
+ // Companion events (SD SDD-006): this generation executed the call, so it journals the final result
16
+ // once, before the result leaves; a failing journal never changes or delays the result.
17
+ function journal(name, args, projected) {
18
+ try { runtime.observeOutcome?.(name, args, projected); } catch { /* notification only */ }
19
+ }
15
20
  function send(input, kind, payload) {
16
21
  const reply = generationMessage(epoch, generation, kind, payload, {}, input.original_operation_id, input.request_id);
17
22
  if (validGenerationMessage(reply, { epoch, generation, reply: true })) channel.send(reply);
@@ -76,11 +81,15 @@ export function startGenerationRuntime({ epoch, generation, channel }) {
76
81
  if (input.original_operation_id && result.outcome === 'effect_unknown') unknown.add(input.original_operation_id);
77
82
  if (name === 'agdf_inspect' && args.operation === 'operation-status' && result.report?.status === 'recorded'
78
83
  && (result.report.receipt?.operation_id ?? result.report.receipt?.operation?.operation_id) === args.module.split('/').at(-1)) unknown.delete(args.module.split('/').at(-1));
79
- send(input, 'result', runtime.projectToolResult(name, args, result));
84
+ const projected = runtime.projectToolResult(name, args, result);
85
+ journal(name, args, projected);
86
+ send(input, 'result', projected);
80
87
  } catch (error) {
81
88
  const facts = runtime.normalizeFailure(error, { phase });
82
89
  if (input.original_operation_id && facts.dispatch !== 'not_dispatched') unknown.add(input.original_operation_id);
83
- send(input, 'result', runtime.projectToolResult(name, args, runtime.failure(facts.code, name, args, { ...facts, elapsed_ms: performance.now() - started }), facts));
90
+ const projected = runtime.projectToolResult(name, args, runtime.failure(facts.code, name, args, { ...facts, elapsed_ms: performance.now() - started }), facts);
91
+ journal(name, args, projected);
92
+ send(input, 'result', projected);
84
93
  } finally { --inflight; }
85
94
  }
86
95
  } catch (error) { if (input.kind === 'qualify') starting = false; send(input, 'failure', { reason: generationFailureReason(error) }); }
@@ -73,6 +73,7 @@ export async function runMcpServer({ surface, cockpitDir, cockpitMode, runtime,
73
73
  const handle = serveAgdfStdio({
74
74
  runtime,
75
75
  executor: dispatchExecutor,
76
+ preparedCallStore: ownedPublication ? ownedPublisher?.preparedCallStore?.({ surface }) : undefined,
76
77
  onerror(code) {
77
78
  process.stderr.write(`${code}\n`);
78
79
  },