create-agdf 0.30.0 → 0.32.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 (366) 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 +436 -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 +119 -0
  20. package/generated/plugins/agdf/companion/figure.mjs +242 -111
  21. package/generated/plugins/agdf/companion/gate-bar.mjs +10 -28
  22. package/generated/plugins/agdf/companion/localization.mjs +15 -32
  23. package/generated/plugins/agdf/companion/notice.mjs +20 -10
  24. package/generated/plugins/agdf/companion/register.mjs +310 -66
  25. package/generated/plugins/agdf/companion/run-state.mjs +89 -90
  26. package/generated/plugins/agdf/companion/state.mjs +6 -32
  27. package/generated/plugins/agdf/companion/view.mjs +199 -24
  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 +14 -3
  36. package/generated/plugins/agdf/mcp/server/src/generation.js +8 -2
  37. package/generated/plugins/agdf/mcp/server/src/main.js +5 -1
  38. package/generated/plugins/agdf/mcp/server/src/next-action.js +227 -0
  39. package/generated/plugins/agdf/mcp/server/src/prepared-call-transport.js +306 -0
  40. package/generated/plugins/agdf/mcp/server/src/safe-read-continuation.js +62 -0
  41. package/generated/plugins/agdf/mcp/server/src/server.js +155 -37
  42. package/generated/plugins/agdf/mcp/server/ui/cockpit.html +130 -33
  43. package/generated/plugins/agdf/mcp/server/ui/decision-manifest.json +3 -3
  44. package/generated/plugins/agdf/mcp/server/ui/decision.html +3 -3
  45. package/generated/plugins/agdf/mcp/server/ui/manifest.json +3 -3
  46. package/generated/plugins/agdf/meta/agdf-interaction-locales.json +436 -2
  47. package/generated/plugins/agdf/meta/agdf-mcp-capability.json +1 -1
  48. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  49. package/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  50. package/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
  51. package/generated/plugins/agdf/meta/contracts/modes.md +5 -0
  52. package/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
  53. package/generated/plugins/agdf/meta/contracts/quality.md +35 -0
  54. package/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
  55. package/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
  56. package/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
  57. package/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
  58. package/generated/plugins/agdf/meta/copilot-payload-baseline.json +3 -3
  59. package/generated/plugins/agdf/meta/distribution-profile-history.json +14 -0
  60. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +436 -2
  61. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  62. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  63. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
  64. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +5 -0
  65. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
  66. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +35 -0
  67. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
  68. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
  69. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
  70. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
  71. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -1
  72. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/parse-args.js +7 -4
  73. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/project-read-command.js +29 -0
  74. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +2 -1
  75. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +36 -7
  76. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +7 -0
  77. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +34 -6
  78. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
  79. package/generated/plugins/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +86 -83
  80. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
  81. package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
  82. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/events.js +157 -0
  83. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/figure-state.js +38 -0
  84. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/journal.js +186 -0
  85. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/companion/run-view.js +227 -0
  86. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
  87. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
  88. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-placeholder.js +4 -1
  89. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +49 -7
  90. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
  91. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
  92. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
  93. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +9 -0
  94. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
  95. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
  96. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
  97. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
  98. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-list.js +10 -8
  99. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-session.js +11 -3
  100. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit-work.js +4 -2
  101. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/cockpit.js +47 -33
  102. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +64 -24
  103. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
  104. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +2 -1
  105. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/run-classification.js +31 -0
  106. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +6 -0
  107. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +32 -5
  108. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/work-situation.js +25 -0
  109. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-read/cockpit-worker.js +1 -0
  110. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
  111. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +7 -5
  112. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/material-limits.js +4 -0
  113. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
  114. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +4 -1
  115. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +10 -4
  116. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +9 -3
  117. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +35 -11
  118. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-create-command.js +6 -1
  119. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +2 -0
  120. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +54 -5
  121. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory.js +12 -27
  122. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +25 -7
  123. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +113 -28
  124. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +38 -20
  125. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +37 -17
  126. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +10 -3
  127. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +8 -5
  128. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-title.js +43 -0
  129. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/index.js +3 -1
  130. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +7 -1
  131. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +8 -0
  132. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +31 -10
  133. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +30 -1
  134. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +5 -3
  135. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +1 -1
  136. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +9 -2
  137. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +6 -4
  138. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
  139. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
  140. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
  141. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
  142. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
  143. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +17 -4
  144. package/generated/plugins/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
  145. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  146. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +4 -3
  147. package/generated/plugins/agdf/skills/ux-intent-definition/SKILL.md +31 -2
  148. package/generated/plugins/agdf/skills/ux-intent-definition/help.md +8 -1
  149. package/generated/plugins/agdf/submission/openai/availability.md +1 -1
  150. package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
  151. package/generated/plugins/agdf/submission/openai/release-notes.md +5 -8
  152. package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
  153. package/generated/plugins/agdf-planning/.codex-plugin/plugin.json +1 -1
  154. package/generated/plugins/agdf-planning/plugin.json +1 -1
  155. package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +358 -203
  156. package/generated/plugins/copilot/agdf/control/README.md +5 -0
  157. package/generated/plugins/copilot/agdf/control/templates/BRAND.md +28 -0
  158. package/generated/plugins/copilot/agdf/control/templates/artefacts/PRD.md +11 -0
  159. package/generated/plugins/copilot/agdf/control/templates/artefacts/SD.md +4 -0
  160. package/generated/plugins/copilot/agdf/control/templates/artefacts/UX_INTENT_DEFINITION.md +1 -1
  161. package/generated/plugins/copilot/agdf/mcp/server/README.md +26 -2
  162. package/generated/plugins/copilot/agdf/mcp/server/package.json +3 -3
  163. package/generated/plugins/copilot/agdf/mcp/server/src/generation-runtime.js +14 -3
  164. package/generated/plugins/copilot/agdf/mcp/server/src/generation.js +8 -2
  165. package/generated/plugins/copilot/agdf/mcp/server/src/main.js +5 -1
  166. package/generated/plugins/copilot/agdf/mcp/server/src/next-action.js +227 -0
  167. package/generated/plugins/copilot/agdf/mcp/server/src/prepared-call-transport.js +306 -0
  168. package/generated/plugins/copilot/agdf/mcp/server/src/safe-read-continuation.js +62 -0
  169. package/generated/plugins/copilot/agdf/mcp/server/src/server.js +155 -37
  170. package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +1 -1
  171. package/generated/plugins/copilot/agdf/meta/distribution-profile-history.json +14 -0
  172. package/generated/plugins/copilot/agdf/plugin.json +1 -1
  173. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +436 -2
  174. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  175. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  176. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/interaction.md +10 -4
  177. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/modes.md +5 -0
  178. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/prd-definition.md +40 -1
  179. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/quality.md +35 -0
  180. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/request-activation.md +6 -3
  181. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/sd-definition.md +46 -0
  182. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/tp-definition.md +8 -0
  183. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/contracts/ur-definition.md +9 -5
  184. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +2 -1
  185. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +7 -4
  186. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/project-read-command.js +29 -0
  187. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +2 -1
  188. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-dispatch-runtime.js +36 -7
  189. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/package.js +7 -0
  190. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/plugin-runtime.js +34 -6
  191. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
  192. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/mcp-worker-runtime.js +81 -78
  193. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +2 -2
  194. package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +1 -1
  195. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/events.js +157 -0
  196. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/figure-state.js +38 -0
  197. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/journal.js +186 -0
  198. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/companion/run-view.js +227 -0
  199. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
  200. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
  201. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/decision-content-placeholder.js +4 -1
  202. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-check.js +49 -7
  203. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
  204. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
  205. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
  206. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/report-decision.js +9 -0
  207. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
  208. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
  209. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
  210. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
  211. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/contract.js +64 -24
  212. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
  213. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/project-state.js +2 -1
  214. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/run-classification.js +31 -0
  215. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/selection.js +6 -0
  216. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/service.js +32 -5
  217. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-inspect/work-situation.js +25 -0
  218. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
  219. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/input-resolution.js +7 -5
  220. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/material-limits.js +4 -0
  221. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
  222. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/presentation-delivery.js +4 -1
  223. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-contract.js +10 -4
  224. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-schema.js +9 -3
  225. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-command-service.js +35 -11
  226. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-create-command.js +6 -1
  227. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-identity.js +2 -0
  228. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory-reader.js +54 -5
  229. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-inventory.js +12 -27
  230. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-material.js +25 -7
  231. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-presentation-render.js +113 -28
  232. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-revision.js +38 -20
  233. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-source-revisions.js +37 -17
  234. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-state-reader.js +10 -3
  235. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-steps.js +8 -5
  236. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/control-state/run-title.js +43 -0
  237. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/index.js +3 -1
  238. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog-validation.js +7 -1
  239. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-catalog.js +8 -0
  240. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/interaction-presentation.js +31 -10
  241. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-input-hints.js +30 -1
  242. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/mcp-tool-errors.js +5 -3
  243. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/resources/canonical-init-plan.js +1 -1
  244. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/runtime/plugin-provenance.js +9 -2
  245. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/contract.js +6 -4
  246. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
  247. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
  248. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
  249. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
  250. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
  251. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/service.js +17 -4
  252. package/generated/plugins/copilot/agdf/runtime/create-agdf/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
  253. package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +2 -2
  254. package/generated/plugins/copilot/agdf/skills/agdf-interaction-locales.json +1 -1
  255. package/generated/plugins/copilot/agdf/skills/agdf-ux-intent-definition/SKILL.md +31 -2
  256. package/generated/plugins/copilot/agdf/skills/contracts/gate-artifact-preparation.md +9 -3
  257. package/generated/plugins/copilot/agdf/skills/contracts/interaction.md +10 -4
  258. package/generated/plugins/copilot/agdf/skills/contracts/modes.md +5 -0
  259. package/generated/plugins/copilot/agdf/skills/contracts/prd-definition.md +40 -1
  260. package/generated/plugins/copilot/agdf/skills/contracts/quality.md +35 -0
  261. package/generated/plugins/copilot/agdf/skills/contracts/request-activation.md +6 -3
  262. package/generated/plugins/copilot/agdf/skills/contracts/sd-definition.md +46 -0
  263. package/generated/plugins/copilot/agdf/skills/contracts/tp-definition.md +8 -0
  264. package/generated/plugins/copilot/agdf/skills/contracts/ur-definition.md +9 -5
  265. package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
  266. package/generated/submissions/openai/agdf/meta/agdf-interaction-locales.json +436 -2
  267. package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +1 -1
  268. package/generated/submissions/openai/agdf/meta/contracts/gate-artifact-preparation.md +9 -3
  269. package/generated/submissions/openai/agdf/meta/contracts/interaction.md +10 -4
  270. package/generated/submissions/openai/agdf/meta/contracts/modes.md +5 -0
  271. package/generated/submissions/openai/agdf/meta/contracts/prd-definition.md +40 -1
  272. package/generated/submissions/openai/agdf/meta/contracts/quality.md +35 -0
  273. package/generated/submissions/openai/agdf/meta/contracts/request-activation.md +6 -3
  274. package/generated/submissions/openai/agdf/meta/contracts/sd-definition.md +46 -0
  275. package/generated/submissions/openai/agdf/meta/contracts/tp-definition.md +8 -0
  276. package/generated/submissions/openai/agdf/meta/contracts/ur-definition.md +9 -5
  277. package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +3 -3
  278. package/generated/submissions/openai/agdf/meta/distribution-profile-history.json +14 -0
  279. package/generated/submissions/openai/agdf/plugin.json +1 -1
  280. package/generated/submissions/openai/agdf/skills/ux-intent-definition/SKILL.md +31 -2
  281. package/generated/submissions/openai/agdf/skills/ux-intent-definition/help.md +8 -1
  282. package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
  283. package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
  284. package/generated/submissions/openai/agdf/submission/openai/inventory.json +24 -24
  285. package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
  286. package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
  287. package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
  288. package/generated/submissions/openai/agdf/submission/openai/release-notes.md +5 -8
  289. package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
  290. package/lib/cli/command-registry.js +2 -1
  291. package/lib/cli/parse-args.js +7 -4
  292. package/lib/cli/project-read-command.js +29 -0
  293. package/lib/cli/validation-handlers.js +2 -1
  294. package/lib/mcp-dispatch-runtime.js +36 -7
  295. package/lib/mcp-lifecycle/package.js +7 -0
  296. package/lib/mcp-lifecycle/plugin-runtime.js +34 -6
  297. package/lib/mcp-lifecycle/prepared-call-journal.js +269 -0
  298. package/lib/mcp-worker-runtime.js +86 -83
  299. package/lib/runtime/validator-application.js +2 -2
  300. package/lib/scaffold/plan.js +2 -0
  301. package/package.json +1 -1
  302. package/runtime/core/lib/companion/events.js +157 -0
  303. package/runtime/core/lib/companion/figure-state.js +38 -0
  304. package/runtime/core/lib/companion/journal.js +186 -0
  305. package/runtime/core/lib/companion/run-view.js +227 -0
  306. package/runtime/core/lib/control-evaluation/acceptance-criteria.js +2 -0
  307. package/runtime/core/lib/control-evaluation/closeout-readiness.js +24 -6
  308. package/runtime/core/lib/control-evaluation/decision-content-placeholder.js +4 -1
  309. package/runtime/core/lib/control-evaluation/gate-check.js +49 -7
  310. package/runtime/core/lib/control-evaluation/gate-policy-inputs.js +2 -0
  311. package/runtime/core/lib/control-evaluation/gate-policy-pure.js +7 -3
  312. package/runtime/core/lib/control-evaluation/prd-readiness.js +7 -2
  313. package/runtime/core/lib/control-evaluation/report-decision.js +9 -0
  314. package/runtime/core/lib/control-evaluation/traceability-readiness.js +57 -8
  315. package/runtime/core/lib/control-evaluation/ur-readiness.js +15 -2
  316. package/runtime/core/lib/control-inspect/artifact-readiness.js +5 -3
  317. package/runtime/core/lib/control-inspect/authoring-inputs.js +107 -22
  318. package/runtime/core/lib/control-inspect/cockpit-list.js +10 -8
  319. package/runtime/core/lib/control-inspect/cockpit-session.js +11 -3
  320. package/runtime/core/lib/control-inspect/cockpit-work.js +4 -2
  321. package/runtime/core/lib/control-inspect/cockpit.js +47 -33
  322. package/runtime/core/lib/control-inspect/contract.js +64 -24
  323. package/runtime/core/lib/control-inspect/material-recording-calls.js +54 -0
  324. package/runtime/core/lib/control-inspect/project-state.js +2 -1
  325. package/runtime/core/lib/control-inspect/run-classification.js +31 -0
  326. package/runtime/core/lib/control-inspect/selection.js +6 -0
  327. package/runtime/core/lib/control-inspect/service.js +32 -5
  328. package/runtime/core/lib/control-inspect/work-situation.js +25 -0
  329. package/runtime/core/lib/control-read/cockpit-worker.js +1 -0
  330. package/runtime/core/lib/control-state/authoring-text-handoff.js +3 -0
  331. package/runtime/core/lib/control-state/input-resolution.js +7 -5
  332. package/runtime/core/lib/control-state/material-limits.js +4 -0
  333. package/runtime/core/lib/control-state/prepared-control-calls.js +137 -0
  334. package/runtime/core/lib/control-state/presentation-delivery.js +4 -1
  335. package/runtime/core/lib/control-state/run-command-contract.js +10 -4
  336. package/runtime/core/lib/control-state/run-command-schema.js +9 -3
  337. package/runtime/core/lib/control-state/run-command-service.js +35 -11
  338. package/runtime/core/lib/control-state/run-create-command.js +6 -1
  339. package/runtime/core/lib/control-state/run-identity.js +2 -0
  340. package/runtime/core/lib/control-state/run-inventory-reader.js +54 -5
  341. package/runtime/core/lib/control-state/run-inventory.js +12 -27
  342. package/runtime/core/lib/control-state/run-material.js +25 -7
  343. package/runtime/core/lib/control-state/run-presentation-render.js +113 -28
  344. package/runtime/core/lib/control-state/run-revision.js +38 -20
  345. package/runtime/core/lib/control-state/run-source-revisions.js +37 -17
  346. package/runtime/core/lib/control-state/run-state-reader.js +10 -3
  347. package/runtime/core/lib/control-state/run-steps.js +8 -5
  348. package/runtime/core/lib/control-state/run-title.js +43 -0
  349. package/runtime/core/lib/index.js +3 -1
  350. package/runtime/core/lib/interaction-catalog-validation.js +7 -1
  351. package/runtime/core/lib/interaction-catalog.js +8 -0
  352. package/runtime/core/lib/interaction-presentation.js +31 -10
  353. package/runtime/core/lib/mcp-input-hints.js +30 -1
  354. package/runtime/core/lib/mcp-tool-errors.js +5 -3
  355. package/runtime/core/lib/resources/canonical-init-plan.js +1 -1
  356. package/runtime/core/lib/runtime/plugin-provenance.js +9 -2
  357. package/runtime/core/lib/skill-dispatch/contract.js +6 -4
  358. package/runtime/core/lib/skill-dispatch/delivery-intake.js +3 -1
  359. package/runtime/core/lib/skill-dispatch/mcp-continuation.js +25 -2
  360. package/runtime/core/lib/skill-dispatch/prd-definition.js +3 -2
  361. package/runtime/core/lib/skill-dispatch/readiness-findings.js +7 -0
  362. package/runtime/core/lib/skill-dispatch/sd-definition.js +4 -2
  363. package/runtime/core/lib/skill-dispatch/service.js +17 -4
  364. package/runtime/core/lib/skill-dispatch/tp-definition.js +4 -2
  365. package/generated/plugins/agdf/companion/core.mjs +0 -16
  366. package/generated/plugins/agdf/companion/locales.json +0 -200
@@ -11,6 +11,7 @@ import {
11
11
  import { normalizeTaskTargetSource, TASK_TARGET_SOURCES } from "../task-target-resolution.js";
12
12
  import { SKILL_DISPATCH_MAX_OUTPUT_BYTES, SkillDispatchInputError, emptySkillDispatchTiming } from "../skill-dispatch/contract.js";
13
13
  import { ARTIFACT_READINESS_GATES, ALL_ACTIVE_OPERATIONS, VARIANT_OPERATION, MODULE_OPERATION, CONTROL_INSPECT_OPERATIONS, GATE_CHECK_VARIANTS, ReadSelectionError, validateReadSelection } from "./selection.js";
14
+ import { CLOSEOUT_AUTHORING_SCOPE } from './selection.js';
14
15
 
15
16
  export const CONTROL_INSPECT_SCHEMA_VERSION = "1";
16
17
  export const CONTROL_INSPECT_CONTRACT_VERSION = 1;
@@ -29,6 +30,7 @@ function deepFreeze(value) {
29
30
  export const PRESENTATION_OPERATIONS = Object.freeze(['presentation-document', 'presentation-preview']);
30
31
  export const BOUND_INSPECT_OPERATIONS = Object.freeze(['artifact-readiness', 'authoring-inputs', 'operation-contract', 'operation-status', 'native-qualification', ...PRESENTATION_OPERATIONS, 'runtime-generations']);
31
32
  export const PRESENTATION_CATALOG_MODULE = 'agdf_prepare/presentation.prepare';
33
+ const CLI_MODULE_HINTS = Object.freeze({ 'agdf_approve/run-approve': 'agdf_approve/approval.record' });
32
34
  const uuidSchema = { type: 'string', pattern: REVISION_ID_PATTERN.source };
33
35
  const cursorSchema = { type: 'string', maxLength: 80, pattern: '^[0-9a-f]{64}:(?:0|[1-9][0-9]{0,6})$' };
34
36
  const fieldModel = {
@@ -43,36 +45,46 @@ const fieldModel = {
43
45
  expected_revision_id: { help: 'Bound inspections use current gate-check revision. Document/preview reads preserve the original selected catalog or conversation revision.', schema: { $ref: '#/$defs/i' }, description: 'gate-check revision; original for reads.', operations: BOUND_INSPECT_OPERATIONS },
44
46
  presentation_id: { help: 'Exact prepared ID from validated catalog or conversation. Never guess, select by timestamp, or prepare a replacement to read.', schema: { $ref: '#/$defs/i' }, description: 'ID from catalog/conversation.', operations: PRESENTATION_OPERATIONS },
45
47
  target_id: { help: 'Optional confirmed target hash on target-bound reads; when supplied it must match. Required for presentation reads; never grants authority.', schema: { type: 'string', pattern: '^sha256:[0-9a-f]{64}$' }, description: 'Optional verified target hash.' },
48
+ bundle: { help: 'authoring-inputs only: bounded multi-document pages with exact source bytes.', schema: { type: 'boolean' }, operations: ['authoring-inputs'] },
49
+ authoring_scope: { help: 'Bundled authoring-inputs for a completed structured Run: read only its current OR and QA.', schema: { type: 'string', const: CLOSEOUT_AUTHORING_SCOPE }, operations: ['authoring-inputs'] },
46
50
  cursor: { help: 'Omit initially; copy next_cursor. doctor requires all_active; catalog requires its declared module. Never exchange cursor types.', schema: cursorSchema, description: 'Copy next_cursor.', operations: [...PRESENTATION_OPERATIONS, 'operation-contract', 'authoring-inputs', 'doctor'] },
47
51
  variant: { help: 'gate-check view only; never records approval.', schema: { enum: [...GATE_CHECK_VARIANTS] }, description: 'gate-check view.', operations: [VARIANT_OPERATION] },
48
52
  module: { help: 'contract: advertised module; operation-contract: group/kind; operation-status: original operation UUID from saved receipt, never a new UUID. Setup uses project.initialize/ORIGINAL_UUID without Run/revision; Run operations require Run/revision.', schema: { type: 'string', minLength: 1, maxLength: 64 }, description: 'Contract, group/kind or receipt UUID.', operations: [MODULE_OPERATION, 'operation-contract', 'operation-status'] },
49
53
  all_active: { help: 'true: doctor/delivery-map only; false: selected Run.', schema: { type: 'boolean' }, description: 'doctor/delivery-map only.' },
50
54
  };
51
- const selectorKeys = { gate: 'gate', expected_revision_id: 'expectedRevisionId', presentation_id: 'presentationId', target_id: 'targetId', cursor: 'cursor', variant: 'variant', module: 'contractModule', planning: 'planning' };
55
+ const selectorKeys = { gate: 'gate', expected_revision_id: 'expectedRevisionId', presentation_id: 'presentationId', target_id: 'targetId', cursor: 'cursor', variant: 'variant', module: 'contractModule', planning: 'planning', bundle: 'bundle', authoring_scope: 'authoringScope' };
52
56
  const moduleOperations = [MODULE_OPERATION, 'operation-contract', 'operation-status'];
53
57
  const inputSchema = {
54
58
  type: 'object', additionalProperties: false,
55
59
  required: ['operation', 'presentation_language', 'working_directory'],
56
- $defs: { i: uuidSchema, b: { not: { enum: CONTROL_INSPECT_OPERATIONS.filter(op => !BOUND_INSPECT_OPERATIONS.includes(op)) } }, d: { enum: PRESENTATION_OPERATIONS }, m: { enum: ['operation-contract', 'operation-status'] } },
60
+ $defs: {
61
+ i: uuidSchema,
62
+ b: { not: { enum: CONTROL_INSPECT_OPERATIONS.filter(op => !BOUND_INSPECT_OPERATIONS.includes(op)) } },
63
+ d: { enum: PRESENTATION_OPERATIONS },
64
+ m: { enum: ['operation-contract', 'operation-status'] },
65
+ u: { not: { anyOf: [{ required: ['run_id'] }, { required: ['expected_revision_id'] }] } },
66
+ },
57
67
  properties: Object.fromEntries(Object.entries(fieldModel).map(([name, field]) => [name, { ...field.schema, description: field.description }])),
58
68
  dependentRequired: { target_source: ['primary_target'], primary_target: ['target_source'], target_id: ['primary_target', 'target_source'] },
59
69
  dependentSchemas: Object.fromEntries(Object.entries(fieldModel).filter(([, f]) => f.operations).map(([name, field]) => [name,
60
- name === 'cursor' ? { anyOf: [ { properties: { operation: { enum: [...PRESENTATION_OPERATIONS, 'authoring-inputs'] } } },
70
+ // Bundle selects authoring-inputs, whose Run binding requires an expected revision.
71
+ name === 'authoring_scope' ? { properties: { bundle: { const: true } }, required: ['bundle', 'run_id'] }
72
+ : name === 'cursor' ? { anyOf: [ { properties: { operation: { enum: [...PRESENTATION_OPERATIONS, 'authoring-inputs'] } } },
61
73
  { properties: { operation: { const: 'doctor' }, all_active: { const: true } }, required: ['all_active'] },
62
74
  { properties: { operation: { const: 'operation-contract' }, module: { const: PRESENTATION_CATALOG_MODULE } } } ] }
63
75
  : { properties: { operation: field.operations === BOUND_INSPECT_OPERATIONS ? { $ref: '#/$defs/b' }
64
76
  : field.operations === PRESENTATION_OPERATIONS ? { $ref: '#/$defs/d' } : name === 'module' ? { enum: moduleOperations } : { enum: field.operations } } },
65
77
  ])),
66
78
  allOf: [
67
- { if: { properties: { operation: { enum: ['project-state', 'planned-inventory', 'planned-entry'] } } }, then: { required: ['target_source', 'primary_target'], not: { anyOf: [{ required: ['run_id'] }, { required: ['expected_revision_id'] }] } } },
79
+ { if: { properties: { operation: { enum: ['project-state', 'planned-inventory', 'planned-entry'] } } }, then: { required: ['target_source', 'primary_target'], $ref: '#/$defs/u' } },
68
80
  { if: { properties: { operation: { const: 'planned-entry' } } }, then: { required: ['planning'] } },
69
- { if: { required: ['planning'] }, then: { required: ['target_source', 'primary_target'], not: { anyOf: [{ required: ['run_id'] }, { required: ['expected_revision_id'] }] } } },
81
+ { if: { required: ['planning'] }, then: { required: ['target_source', 'primary_target'], $ref: '#/$defs/u' } },
70
82
  { not: { properties: { all_active: { const: true } }, required: ['all_active', 'run_id'] } },
71
83
  { anyOf: [{ properties: { all_active: { const: false } } }, { properties: { operation: { enum: [...ALL_ACTIVE_OPERATIONS] } } }] },
72
84
  { if: { properties: { operation: { $ref: '#/$defs/m' } } }, then: { required: ['module'] } },
73
85
  { if: { properties: { operation: { $ref: '#/$defs/b' } } }, then: { required: ['target_source'], anyOf: [
74
86
  { required: ['run_id', 'expected_revision_id'] },
75
- { not: { anyOf: [{ required: ['run_id'] }, { required: ['expected_revision_id'] }] }, oneOf: [
87
+ { $ref: '#/$defs/u', oneOf: [
76
88
  { properties: { operation: { const: 'operation-status' } } },
77
89
  { properties: { operation: { const: 'operation-contract' }, module: { anyOf: [{ enum: ['agdf_run/run.create', 'agdf_project/project.initialize'] }, { pattern: '/(?:planned_|run\\.create_from_planned)' }] } }, required: ['module'] },
78
90
  { properties: { operation: { const: 'authoring-inputs' } }, required: ['planning'] },
@@ -85,21 +97,17 @@ const inputSchema = {
85
97
 
86
98
  inputSchema.dependentSchemas.operation = { allOf: inputSchema.allOf };
87
99
  delete inputSchema.allOf;
88
- const conciseHelp = { target_source: 'Pair primary_target; explicit=named; continued=confirmed; current=unambiguous repo.', primary_target: 'Confirmed root; pair target_source.',
89
- module: 'contract:index; operation-contract:group/kind; status:UUID.',
90
- run_id: 'Not for inventory/project/planned.',
91
- expected_revision_id: 'Bound reads only; not gate-check.',
92
- planning: 'Planning reads only.',
93
- target_id: 'Required for docs; gate-check.',
94
- gate: 'Not for gate-check.' };
95
- for (const [key, field] of Object.entries(inputSchema.properties)) {
96
- delete field.description;
97
- if (conciseHelp[key]) field.description = conciseHelp[key];
98
- }
100
+ // Full selector help is available on demand; discovery keeps the exact guards.
101
+ for (const field of Object.values(inputSchema.properties)) delete field.description;
102
+ Object.assign(inputSchema.properties.target_source, { description: 'Pair primary_target.' });
103
+ Object.assign(inputSchema.properties.primary_target, { description: 'Confirmed target.' });
104
+ Object.assign(inputSchema.properties.module, { description: 'Contract, group/kind or receipt UUID.' });
105
+ Object.assign(inputSchema.properties.gate, { description: 'Not for gate-check.' });
106
+ Object.assign(inputSchema.properties.target_id, { description: 'Required for docs; gate-check.' });
99
107
 
100
108
  const inspectContract = {
101
109
  name: "agdf_inspect",
102
- description: 'Read-only. Ex:{"operation":"operation-contract","module":"agdf_run/run.create","working_directory":"/r","target_source":"explicit_target","primary_target":"/r"}. navigation.next_calls sequentially; read all pages; never dispatch. Setup status: project.initialize/UUID, no Run/revision. Run status: original UUID+run_id+expected_revision_id.',
110
+ description: 'Read only. Use next_action.call. Raw bound reads need working_directory,presentation_language,primary_target,target_source. Run status needs run_id+expected_revision_id. Setup omits both.',
103
111
  annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
104
112
  inputSchema: projectMcpInputSchema(inputSchema),
105
113
  outputSchema: {
@@ -175,14 +183,42 @@ export function inspectContractHelp() {
175
183
  });
176
184
  }
177
185
 
186
+ function correctedOperationModule(module) {
187
+ if (typeof module !== 'string' || module.length > 64 || OPERATION_CONTRACT_MODULES.includes(module)) return null;
188
+ const exact = CLI_MODULE_HINTS[module];
189
+ if (exact && OPERATION_CONTRACT_MODULES.includes(exact)) return exact;
190
+ const kind = module.split('/').at(-1);
191
+ const matches = OPERATION_CONTRACT_MODULES.filter(value => value.split('/').at(-1) === kind);
192
+ return matches.length === 1 ? matches[0] : null;
193
+ }
194
+
195
+ // A new read-only schema lookup for one unambiguous registered owner. This
196
+ // preserves explicit bindings; it never executes or repairs the invalid request.
197
+ export function inspectModuleRecoveryCall(input) {
198
+ if (!input || input.operation !== 'operation-contract') return null;
199
+ const module = correctedOperationModule(input.module);
200
+ const allowed = new Set(['operation', 'module', 'working_directory', 'primary_target', 'target_source',
201
+ 'presentation_language', 'run_id', 'expected_revision_id', 'gate', 'target_id']);
202
+ if (!module || Object.keys(input).some(key => !allowed.has(key))) return null;
203
+ for (const key of ['working_directory', 'primary_target', 'target_source', 'run_id'])
204
+ if (!Object.hasOwn(input, key) || schemaDiagnostics(input[key], fieldModel[key].schema).length) return null;
205
+ if (!isAbsolute(input.working_directory) || !isAbsolute(input.primary_target)
206
+ || typeof input.expected_revision_id !== 'string' || !REVISION_ID_PATTERN.test(input.expected_revision_id)
207
+ || input.presentation_language !== undefined && schemaDiagnostics(input.presentation_language, fieldModel.presentation_language.schema).length
208
+ || input.gate !== undefined && !APPROVAL_GATES.includes(input.gate)
209
+ || input.target_id !== undefined && (typeof input.target_id !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(input.target_id))) return null;
210
+ return { tool: 'agdf_inspect', arguments: { ...input, module } };
211
+ }
212
+
178
213
  export function inspectInputValidationHint(input) {
179
214
  if (!input || typeof input !== 'object' || !CONTROL_INSPECT_OPERATIONS.includes(input.operation)) return '';
180
215
  const operation = input.operation, messages = [];
216
+ let diagnosedModule = input.module;
181
217
  if (operation === 'operation-contract' && typeof input.module === 'string' && input.module.length <= 64
182
218
  && !OPERATION_CONTRACT_MODULES.includes(input.module)) {
183
- const kind = input.module.split('/').at(-1);
184
- const matches = OPERATION_CONTRACT_MODULES.filter(module => module.split('/').at(-1) === kind);
185
- messages.push(matches.length === 1 ? `Use module ${matches[0]}; this is the registered owner of ${kind}.`
219
+ const correction = correctedOperationModule(input.module);
220
+ if (correction) diagnosedModule = correction; // Help only; the original invalid request remains rejected.
221
+ messages.push(correction ? `Use module ${correction}; the original module is invalid and was not executed.`
186
222
  : 'Read contract without module for the registered operation_modules; do not guess a group/kind.');
187
223
  }
188
224
  for (const [name, field] of Object.entries(fieldModel)) {
@@ -194,8 +230,8 @@ export function inspectInputValidationHint(input) {
194
230
  // Diagnose the selected operation, rather than making the model interpret
195
231
  // errors from every alternative of the discovery schema's oneOf branches.
196
232
  const unboundContract = operation === 'operation-contract' &&
197
- (['agdf_run/run.create', 'agdf_project/project.initialize'].includes(input.module)
198
- || OPERATION_CONTRACT_MODULES.includes(input.module) && /\/(?:planned_|run\.create_from_planned)/u.test(input.module));
233
+ (['agdf_run/run.create', 'agdf_project/project.initialize'].includes(diagnosedModule)
234
+ || OPERATION_CONTRACT_MODULES.includes(diagnosedModule) && /\/(?:planned_|run\.create_from_planned)/u.test(diagnosedModule));
199
235
  const bound = BOUND_INSPECT_OPERATIONS.includes(operation) && !unboundContract
200
236
  && !(operation === 'operation-status' && !input.run_id && !input.expected_revision_id)
201
237
  && !(operation === 'authoring-inputs' && input.planning);
@@ -254,6 +290,7 @@ export function parseControlInspectFunctionArguments(argumentsValue, trustedCont
254
290
 
255
291
  // Shared language, target and read-selection rules; errors carry the invalid field.
256
292
  export function normalizeControlInspectInput(input) {
293
+ if (input.bundle !== undefined && typeof input.bundle !== 'boolean') throw new SkillDispatchInputError('bundle', 'bundle must be boolean');
257
294
  const operation = requireText(input.operation, "operation", 64);
258
295
  if (!CONTROL_INSPECT_OPERATIONS.includes(operation)) throw new SkillDispatchInputError("operation", `Unsupported inspect operation: ${operation}`);
259
296
  let requestedPresentationLanguage;
@@ -276,6 +313,9 @@ export function normalizeControlInspectInput(input) {
276
313
  throw new SkillDispatchInputError('target_id', 'A valid target hash requires a confirmed target');
277
314
  const runId = input.runId || null;
278
315
  const planning = input.planning;
316
+ if (input.authoringScope !== undefined && (input.authoringScope !== CLOSEOUT_AUTHORING_SCOPE
317
+ || input.bundle !== true || !runId || planning !== undefined))
318
+ throw new SkillDispatchInputError('authoring_scope', 'Closeout scope requires a bundled Run read');
279
319
  if (planning !== undefined && (schemaDiagnostics(planning, PLANNING_SCOPE_SCHEMA).length || runId || input.expectedRevisionId !== undefined || input.gate !== undefined
280
320
  || !primaryTarget || !fieldModel.planning.operations.includes(operation))) throw new SkillDispatchInputError('planning', 'Planning requires one exact pre-Run source scope and confirmed target; no Run/revision/gate');
281
321
  if (operation === 'operation-status' && Boolean(planning) !== /^(?:planned_ur\.|run\.create_from_planned\/)/u.test(input.contractModule ?? ''))
@@ -336,7 +376,7 @@ export function normalizeControlInspectInput(input) {
336
376
  target_source: targetSource,
337
377
  primary_target: primaryTarget,
338
378
  run_id: runId,
339
- planning,
379
+ planning, bundle: input.bundle, authoring_scope: input.authoringScope,
340
380
  gate: input.gate,
341
381
  expected_revision_id: input.expectedRevisionId,
342
382
  presentation_id: input.presentationId, target_id: input.targetId, cursor: input.cursor,
@@ -0,0 +1,54 @@
1
+ import { resolveTaskTarget } from '../task-target-resolution.js';
2
+ import { preparedCommandCall } from '../control-state/prepared-control-calls.js';
3
+ import { inspectUxIntentDecision, UX_DECISION_FORMAT } from '../control-evaluation/definition-sources.js';
4
+ import { validateRunCommand } from '../control-state/run-command-schema.js';
5
+ import { inspectAuthoringInputs } from './authoring-inputs.js';
6
+
7
+ // Mirrors an explicit author declaration; never chooses a judgement or review.
8
+ export function withUxSourceDecision(form, content) {
9
+ const observed = inspectUxIntentDecision(content);
10
+ const source_validation = { ...observed, format: UX_DECISION_FORMAT, authorizes: false };
11
+ if (!observed.well_formed || !observed.supported || observed.decision === 'not_applicable') return {
12
+ source_validation: { ...source_validation, recordable: false,
13
+ reason: !observed.well_formed ? 'ux_decision_malformed' : 'ux_decision_not_supported_for_required_analysis',
14
+ instruction: 'Correct the explicit - decision: field in the authored report, then stage the corrected bytes with the new material_call. No canonical record was attempted; choose ready or blocked from actual analysis, never from this diagnostic.' } };
15
+ const filled = structuredClone(form);
16
+ filled.call.arguments.command.payload.decision = observed.decision;
17
+ filled.required_inputs = filled.required_inputs.filter(p => p !== '/command/payload/decision');
18
+ filled.state = validateRunCommand(filled.call.tool, filled.call.arguments).length ? 'requires_author_input' : 'ready';
19
+ return { form: filled, source_validation: { ...source_validation, recordable: true,
20
+ decision_origin: 'exact explicit author declaration in staged source; not generated judgement' } };
21
+ }
22
+
23
+ // Reuse the canonical author/source selection, including analytical prerequisites
24
+ // at an outer gate. Transport itself cannot choose a future/protected writer.
25
+ export function withMaterialRecordingCalls(input, result) {
26
+ if (result.outcome !== 'accepted' || input.planning || !['put', 'seal'].includes(input.command.payload.action)) return result;
27
+ try {
28
+ const target = resolveTaskTarget({ workingDirectory: input.working_directory, primaryTarget: input.primary_target, targetSource: input.target_source });
29
+ if (target.resolution_state !== 'resolved') return result;
30
+ const authoring = inspectAuthoringInputs(target.governance_target, input);
31
+ if (!authoring.available || authoring.revision_id !== input.expected_revision_id) return result;
32
+ const slot = authoring.material_call?.call.arguments.command.payload.files[0].slot;
33
+ const files = (result.family_result.files ?? []).filter(file => file.reference && file.slot === slot);
34
+ if (files.length !== 1 || !authoring.formats?.available) return result;
35
+ const { group, kind } = authoring.formats;
36
+ if (kind === 'closeout.record') {
37
+ if (!['structured_delivery', 'structured_slice'].includes(authoring.mode)
38
+ || authoring.next_operation?.type !== 'record_closeout' || authoring.authoring_owner !== 'OR' || slot !== 'OR') return result;
39
+ } else if (!['step.record', 'artefact.record', 'ur_draft.replace'].includes(kind)) return result;
40
+ const form = preparedCommandCall(group, kind, input,
41
+ { gate: authoring.authoring_owner, material: files[0].reference, recording: authoring.recording });
42
+ if (kind === 'closeout.record' && form?.state !== 'ready') return result;
43
+ if (form && authoring.authoring_owner === 'UX Intent Definition' && input.command.payload.action === 'put') {
44
+ const text = input.command.payload.files.find(file => file.slot === slot)?.content;
45
+ if (typeof text === 'string') {
46
+ const checked = withUxSourceDecision(form, text);
47
+ return { ...result, source_validation: checked.source_validation,
48
+ ...(checked.form ? { recording_calls: [{ slot, ...checked.form }] }
49
+ : { recording_calls: [], material_call: authoring.material_call }) };
50
+ }
51
+ }
52
+ return form && !form.required_inputs.includes('/command/payload') ? { ...result, recording_calls: [{ slot, ...form }] } : result;
53
+ } catch { return result; } // Guidance cannot conceal an accepted private transfer.
54
+ }
@@ -37,7 +37,8 @@ export function inspectProjectState(root, input, gitObservation) {
37
37
  ? projectOperationStatusCall({ ...input, operation_id: original }) : null;
38
38
  const report = { available: true, target_id, repository, plan: inspectCanonicalInitializationPlan(), ...state,
39
39
  setup: { tool: 'agdf_project', kind: 'project.initialize', binding: { schema_version: '1', assurance: 'cooperative_local', ...common, target_id },
40
- required_agent_fields: ['operation_id'], requires_explicit_intent: true }, next_calls: [...(next ? [next] : []), ...(statusCall ? [statusCall] : [])],
40
+ required_agent_fields: ['operation_id'], requires_explicit_intent: true }, next_calls: next ? [next] : [],
41
+ ...(statusCall ? { recovery_only: { status_call: statusCall, authorizes: false } } : {}),
41
42
  ...(input.operation === 'operation-status' ? { operation_id: input.operation_id, status: state.operation_status, current_setup: state.status } : {}),
42
43
  ...(state.status === 'pending' ? { recovery: { action: 'replay_original', operation_id: state.operation.operation_id,
43
44
  request_digest: state.operation.request_digest, instruction: 'Replay only the saved original project.initialize UUID/payload. Owned stage, target, plan and producer are revalidated before any effect.', authorizes: false } } : {}),
@@ -0,0 +1,31 @@
1
+ // Read-only run classification shared by the Codex cockpit and the companion run view (companion core
2
+ // SDD-001, SDD-003). It lives apart from the cockpit so every runtime profile carries it, Copilot
3
+ // included, whose projection leaves the private cockpit out. Nothing here evaluates a gate rule.
4
+ import { ENDED_LIFECYCLES } from '../control-state/run-operations.js';
5
+
6
+ // The read-failure codes passed through unchanged, and every code `boundedCode` can return.
7
+ const READ_FAILURE_CODES = Object.freeze(['resource_denied', 'source_changed', 'timeout', 'resource_limit', 'read_failed']);
8
+ export const BOUNDED_READ_CODES = Object.freeze(['control_layout_unsupported', 'run_version_unsupported', 'control_invalid', ...READ_FAILURE_CODES]);
9
+
10
+ // Bounded reason code of a read failure.
11
+ export function boundedCode(error) {
12
+ const code = error.code ?? error.message;
13
+ if (code === 'AGDF_CONTROL_LAYOUT_UNSUPPORTED' || code === 'control_layout_unsupported') return 'control_layout_unsupported';
14
+ if (code === 'AGDF_RUN_VERSION_UNSUPPORTED') return 'run_version_unsupported';
15
+ // The configuration owner's codes (resources/configuration.js configurationError).
16
+ if (code === 'AGDF_CONTROL_LAYOUT_INVALID' || code === 'configuration_invalid') return 'control_invalid';
17
+ return READ_FAILURE_CODES.includes(error.code) ? error.code : 'read_failed';
18
+ }
19
+
20
+ // Read-only projection of the evaluated decision, never a second gate evaluator.
21
+ // Doctor warnings are already considered by evaluateGateCheck; they are not a UI veto.
22
+ export function projectCockpitAssessment(report, lifecycle) {
23
+ const state = ENDED_LIFECYCLES.includes(lifecycle) ? 'ended'
24
+ : lifecycle === 'completed' ? report.completion?.fulfilled === true ? 'completed' : 'unconfirmed'
25
+ : lifecycle !== 'active' ? 'unconfirmed'
26
+ : report.status === 'blocked' || (report.blocking_reason && report.blocking_reason !== 'none')
27
+ || (report.missing_approval && report.missing_approval !== 'none') ? 'blocked'
28
+ : report.status === 'open' && report.blocking_reason === 'none' && report.missing_approval === 'none' ? 'open'
29
+ : 'unconfirmed';
30
+ return { state, authorizes: false };
31
+ }
@@ -2,6 +2,12 @@
2
2
 
3
3
  export const ARTIFACT_READINESS_GATES = Object.freeze(['UR', 'PRD', 'SD', 'TP']);
4
4
  export const CONTROL_INSPECT_OPERATIONS = Object.freeze(["doctor", "gate-check", "delivery-map", "contract", "artifact-readiness", "authoring-inputs", "operation-contract", "operation-status", "native-qualification", "presentation-document", "presentation-preview", "runtime-generations", "project-state", "inventory", "planned-inventory", "planned-entry"]);
5
+ export const CLOSEOUT_AUTHORING_SCOPE = 'delivery-closeout';
6
+
7
+ export function isCompletedStructuredCloseout(control, mode) {
8
+ return control.current_gate === 'OR' && control.completion?.fulfilled === true
9
+ && ['structured_delivery', 'structured_slice'].includes(mode);
10
+ }
5
11
  export const ALL_ACTIVE_OPERATIONS = Object.freeze(["doctor", "delivery-map"]);
6
12
  export const VARIANT_OPERATION = "gate-check";
7
13
  export const MODULE_OPERATION = "contract";
@@ -1,5 +1,6 @@
1
1
  import { baseResult, bindHostAction } from "./result.js";
2
2
  import { inspectArtefactRecordingMode } from '../control-state/run-artefact-recording.js';
3
+ import { preparedCommandCall } from '../control-state/prepared-control-calls.js';
3
4
  import { inspectProjectState } from './project-state.js';
4
5
  import process from "node:process";
5
6
  import { DISPATCH_RECOVERY } from "../interaction-catalog.js";
@@ -10,8 +11,9 @@ import { readRuntimeContract, runtimeContractModules } from "../resources/contra
10
11
  import { renderSkillDispatchInputRecovery, renderSkillDispatchRecovery, renderTaskTargetOrientation, renderActiveRunInventory, renderRunInventory } from "../interaction-presentation.js";
11
12
  import { resolveTaskTarget, TaskTargetInputError } from "../task-target-resolution.js";
12
13
  import { SKILL_DISPATCH_PRESENTATION_LANGUAGE_RECOVERY, SkillDispatchInputError, emptySkillDispatchTiming } from "../skill-dispatch/contract.js";
13
- import { CONTROL_INSPECT_CONTRACT_VERSION, CONTROL_INSPECT_SCHEMA_VERSION, ReadSelectionError, normalizeControlInspectInput, inspectContractHelp, OPERATION_CONTRACT_MODULES, PRESENTATION_CATALOG_MODULE } from "./contract.js";
14
+ import { CONTROL_INSPECT_CONTRACT_VERSION, CONTROL_INSPECT_SCHEMA_VERSION, ReadSelectionError, normalizeControlInspectInput, inspectContractHelp, inspectModuleRecoveryCall, OPERATION_CONTRACT_MODULES, PRESENTATION_CATALOG_MODULE } from "./contract.js";
14
15
  import { RUN_COMMAND_DESCRIPTORS, operationContract } from '../control-state/run-command-contract.js';
16
+ import { PROPOSAL_COMMAND_KINDS, PROPOSAL_MATERIAL_SLOT } from '../control-state/run-command-schema.js';
15
17
  import { inspectRunOperation } from '../control-state/run-operation-status.js';
16
18
  import { resolveControlCommandTarget } from '../control-state/approval-command-contract.js';
17
19
  import { readRunState } from '../control-evaluation/run-state.js';
@@ -132,6 +134,19 @@ export function createControlInspectService(dependencies = {}) {
132
134
  result.diagnostics = [{ code: "inspect_input_invalid", field,
133
135
  ...(inputError?.allowedValues?.length ? { allowed_values: [...inputError.allowedValues] } : {}),
134
136
  }];
137
+ if (field === 'module') {
138
+ const supplied = { operation: rawInput.operation,
139
+ ...Object.fromEntries([['module', 'contractModule'], ['working_directory', 'workingDirectory'],
140
+ ['primary_target', 'primaryTarget'], ['target_source', 'targetSource'], ['presentation_language', 'presentationLanguage'],
141
+ ['run_id', 'runId'], ['expected_revision_id', 'expectedRevisionId'], ['gate', 'gate'], ['target_id', 'targetId']]
142
+ .filter(([, key]) => rawInput[key] !== undefined).map(([field, key]) => [field, rawInput[key]])) };
143
+ // Preserve unsupported selectors too, so they prevent a misleading
144
+ // executable suggestion rather than disappearing from the new lookup.
145
+ for (const [field, key] of [['presentation_id', 'presentationId'], ['cursor', 'cursor'], ['planning', 'planning'], ['all_active', 'allActive']])
146
+ if (rawInput[key] !== undefined) supplied[field] = rawInput[key];
147
+ const next = inspectModuleRecoveryCall(supplied);
148
+ if (next) result.recovery.next_calls = [next];
149
+ }
135
150
  return bindHostAction(result);
136
151
  }
137
152
  timing.input_ms = round(milliseconds(started, now()));
@@ -208,7 +223,7 @@ export function createControlInspectService(dependencies = {}) {
208
223
  if (!valid) return { report: { available: false, reason: 'operation_binding_stale_or_invalid', authorizes: false }, presentation: null };
209
224
  if (input.operation === 'runtime-generations') return { report: dependencies.runtimeControl?.status()
210
225
  ?? { available: false, reason: 'connection_control_unavailable', authorizes: false }, presentation: null };
211
- const decision = gateCheck(target.governance_target, { runId: input.run_id, presentationLanguage: input.presentationLanguage });
226
+ const decision = gateCheck(target.governance_target, { runId: input.run_id, presentationLanguage: input.presentation_language });
212
227
  return { report: { available: true, run_id: input.run_id, revision_id: state.meta.revision_id,
213
228
  ui_rendering_support: 'unknown', action_qualification: { qualified: false, reason: 'host_context_unavailable', authorizes: false },
214
229
  business_readiness: { current_gate: decision.current_gate, status: decision.status,
@@ -221,15 +236,27 @@ export function createControlInspectService(dependencies = {}) {
221
236
  next_calls: [{ tool: input.group, kind: input.kind, instruction: contract.planning_capture?.instructions
222
237
  ?? 'Use the confirmed planning scope and original UUID; no Run/revision. Planning never approves a gate. Start a Run only from a deliberately selected complete source.' }] }, presentation: null };
223
238
  }
224
- if (['agdf_run', 'agdf_project'].includes(input.group) && !input.run_id) return { report: { ...operationContract(input.group, input.kind),
239
+ if (['agdf_run', 'agdf_project'].includes(input.group) && !input.run_id) {
240
+ const prepared = preparedCommandCall(input.group, input.kind, { ...input, presentation_language: input.presentation_language,
241
+ target_id: resolveControlCommandTarget(target.governance_target).target_id });
242
+ return { report: { ...operationContract(input.group, input.kind),
225
243
  binding: { target_id: resolveControlCommandTarget(target.governance_target).target_id },
226
- next_calls: [{ tool: input.group, kind: input.kind, instruction: input.group === 'agdf_project' ? 'Explicit fixed setup only. Use the confirmed existing Git root and one original UUID. No Run/revision, force, repair, install or approval.' : 'Use a new original operation UUID and confirmed title; there is no prior Run/revision.' }] }, presentation: null };
244
+ prepared_call: prepared, next_calls: prepared?.state === 'ready' ? [prepared.call] : [],
245
+ next_action: input.group === 'agdf_project' ? 'Explicit fixed setup only. No Run, repair, installation or approval.'
246
+ : 'Fill the prepared title from the authorized original request, preserving its UUID and target. No prior Run/revision.' }, presentation: null };
247
+ }
227
248
  const state = readRunState(target.governance_target, { runId: input.run_id });
228
249
  const targetId = resolveControlCommandTarget(target.governance_target).target_id;
229
250
  const valid = parseRunState(state.content, input.run_id).valid && state.meta?.revision_id === input.expected_revision_id
230
251
  && runSealState(target.governance_target, state.content).status === 'valid';
231
252
  return { report: valid ? { ...operationContract(input.group, input.kind, { gate: input.gate ?? state.current_gate }),
253
+ prepared_call: preparedCommandCall(input.group, input.kind, { ...input, presentation_language: input.presentation_language, target_id: targetId },
254
+ { gate: input.gate ?? state.current_gate, recording: inspectArtefactRecordingMode(state, input.gate ?? state.current_gate) }),
232
255
  ...(input.kind === 'artefact.record' ? { recording: inspectArtefactRecordingMode(state, input.gate ?? state.current_gate) } : {}),
256
+ // Revision proposals are staged in their own slot. Offer that staging form with the
257
+ // revision commands and beside a material.stage form, whose prepared_call uses the gate's slot.
258
+ ...(PROPOSAL_COMMAND_KINDS.includes(input.kind) || input.kind === 'material.stage' ? { material_call: preparedCommandCall('agdf_record', 'material.stage',
259
+ { ...input, presentation_language: input.presentation_language, target_id: targetId }, { gate: PROPOSAL_MATERIAL_SLOT }) } : {}),
233
260
  ...(input.contract_module === PRESENTATION_CATALOG_MODULE ? {
234
261
  inspect_contract: inspectContractHelp(),
235
262
  presentation_catalog: readPresentationCatalog(target.governance_target, { runId: input.run_id,
@@ -243,7 +270,7 @@ export function createControlInspectService(dependencies = {}) {
243
270
  quality_records: sourceRevisionQualityFacts(state, path => { try { return readHistoryBytes(target.governance_target, path).toString('utf8'); } catch { return undefined; } }),
244
271
  } } : {}),
245
272
  binding: { target_id: targetId, run_id: input.run_id, expected_revision_id: input.expected_revision_id },
246
- current: (() => { const decision = gateCheck(target.governance_target, { runId: input.run_id, presentationLanguage: input.presentationLanguage });
273
+ current: (() => { const decision = gateCheck(target.governance_target, { runId: input.run_id, presentationLanguage: input.presentation_language });
247
274
  return { current_gate: decision.current_gate, lifecycle: state.meta.lifecycle, status: decision.status, missing_approval: decision.missing_approval,
248
275
  next_operation: decision.next_operation, completion: decision.completion,
249
276
  artefacts: [...state.artefacts].filter(([type]) => ['UR', 'PRD', 'SD', 'TP', 'Brownfield Review', 'UX Intent Definition', 'Brownfield Analysis', 'CD+Tests', 'TP Review', 'Clean Implementation Review', 'CR', 'QA', 'OR'].includes(type))
@@ -0,0 +1,25 @@
1
+ // Presentation of one canonical control assessment. This module never evaluates or authorizes work.
2
+ export function projectWorkSituation({ assessment, gate, blockingReason, missingApproval, closureOutcome, persistedGate, persistedNext, nextAllowedAction } = {}) {
3
+ if (persistedGate !== undefined && (persistedGate !== gate || !(assessment === 'ended' && closureOutcome) && persistedNext !== nextAllowedAction)) assessment = 'unconfirmed';
4
+ let kind = 'unconfirmed';
5
+ if (assessment === 'open') kind = gate === 'CD+Tests' ? 'in_progress' : 'open';
6
+ else if (assessment === 'blocked') {
7
+ kind = blockingReason === 'presentation_version_decided' ? 'revision_required'
8
+ : blockingReason === 'none' && missingApproval === `Approval: ${gate}` ? 'approval_required'
9
+ : gate === 'UR' && blockingReason === 'AGDF_UR_REQUIREMENTS_INCOMPLETE' ? 'clarification_required' : 'blocked';
10
+ } else if (assessment === 'completed') kind = 'completed';
11
+ else if (assessment === 'ended' && closureOutcome) kind = 'ended';
12
+ const values = {
13
+ revision_required: ['clarification_required', 'Revision required', 'Überarbeitung nötig'],
14
+ approval_required: ['decision_required', 'Approval required', 'Freigabe erforderlich'],
15
+ clarification_required: ['clarification_required', 'Clarification required', 'Klärung erforderlich'],
16
+ in_progress: ['in_progress', 'In implementation', 'In Umsetzung'],
17
+ open: ['in_progress', 'Work may continue', 'Weiterarbeit offen'],
18
+ blocked: ['blocked', 'Blocked', 'Blockiert'],
19
+ completed: ['none', 'Completed', 'Vorhaben abgeschlossen'],
20
+ ended: ['none', 'Ended', 'Vorhaben beendet'],
21
+ unconfirmed: ['unclear', 'Current conditions unconfirmed', 'Aktuelle Voraussetzungen nicht bestätigt'],
22
+ };
23
+ const [code, en, de] = values[kind];
24
+ return { kind, code, en, de };
25
+ }
@@ -18,6 +18,7 @@ parentPort.on('message', ({ id, operation, selector, snapshot, input }) => {
18
18
  : operation === 'planned' ? reader.planned(selector, snapshot)
19
19
  : operation === 'artifact_readiness' ? reader.artifactReadiness(input.run_id, snapshot, input.gate, input.expected_revision_id)
20
20
  : operation === 'document' ? reader.document(selector, snapshot, input?.run_id)
21
+ : operation === 'preview' ? reader.preview(selector, snapshot, input?.run_id)
21
22
  : operation === 'freshness' ? reader.freshness(snapshot)
22
23
  : operation === 'context' ? reader.context(selector, snapshot)
23
24
  : operation === 'prepare_context' ? reader.prepareContext(input)
@@ -0,0 +1,3 @@
1
+ // Shared guidance for passing authored bytes; never an additional file reader,
2
+ // an authoring result or authority to record an artefact.
3
+ export const AUTHORING_TEXT_HANDOFF = 'Pass Markdown as UTF-8 string data, never executable code. Prefer structured tool input. If the host uses JavaScript, author with its file-editing tool and pass a UTF-8 file read as content; never embed the document in backtick literals.';
@@ -2,7 +2,7 @@ import { CURRENT_LAYOUT } from './run-identity.js';
2
2
  // Shared representation, not a file owner or replay ledger. Existing operation
3
3
  // families alone validate, persist and recover their versioned records.
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
- import { isAbsolute } from 'node:path';
5
+ import { isAbsolute, posix, win32 } from 'node:path';
6
6
  import { canonicalJson, exactObject, DIGEST_PATTERN } from './approval-command-contract.js';
7
7
  import { runCommandRequestDigest } from './run-command-schema.js';
8
8
  import { canonicalizeLanguageTag } from '../interaction-presentation.js';
@@ -28,7 +28,9 @@ export function createInputResolution(original, effective, configuration) {
28
28
  operation_id: original.operation_id ?? null, kind: original.command?.kind ?? null,
29
29
  fields: Object.fromEntries(paths.filter(path => get(original, path) === undefined && get(effective, path) !== undefined).map(path => [path, get(effective, path)])), configuration };
30
30
  }
31
- export function validInputResolution(value) {
31
+ export function validInputResolution(value, { persisted = false } = {}) {
32
+ // Stored paths describe the writer's host. Live requests still use the serving host's paths.
33
+ const absolutePath = persisted ? path => posix.isAbsolute(path) || win32.isAbsolute(path) : isAbsolute;
32
34
  if (!exactObject(value, ['schema_version', 'logical_digest', 'effective_digest', 'operation_id', 'kind', 'fields', 'configuration']) || value.schema_version !== 1
33
35
  || !(value.operation_id === null || typeof value.operation_id === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u.test(value.operation_id))
34
36
  || !(value.kind === null || typeof value.kind === 'string' && /^[a-z_]+\.[a-z_]+$/u.test(value.kind) && value.kind.length <= 64)
@@ -36,14 +38,14 @@ export function validInputResolution(value) {
36
38
  || Buffer.byteLength(canonicalJson(value)) > 8192 || Object.keys(value.fields).some(key => !paths.includes(key))) return false;
37
39
  const f = value.fields, c = value.configuration;
38
40
  if (Object.hasOwn(f, 'presentation_language') && !tag(f.presentation_language)
39
- || Object.hasOwn(f, 'working_directory') && (typeof f.working_directory !== 'string' || !isAbsolute(f.working_directory) || f.working_directory.length > 4096)
41
+ || Object.hasOwn(f, 'working_directory') && (typeof f.working_directory !== 'string' || !absolutePath(f.working_directory) || f.working_directory.length > 4096)
40
42
  || Object.hasOwn(f, 'schema_version') && f.schema_version !== '1'
41
43
  || Object.hasOwn(f, 'assurance') && f.assurance !== 'cooperative_local'
42
44
  || Object.hasOwn(f, 'variant') && !['status-card', 'approval-envelope'].includes(f.variant)
43
45
  || Object.hasOwn(f, 'command.payload.route') && !['markdown', 'automatic', 'fallback'].includes(f['command.payload.route'])) return false;
44
46
  if (!exactObject(c, ['root', 'control', 'config_digest', 'values', 'sources', 'defaults_digest', 'control_layout'])
45
47
  || (c.control === 'active' ? c.control_layout !== CURRENT_LAYOUT : c.control_layout !== null)
46
- || !(c.root === null || typeof c.root === 'string' && isAbsolute(c.root) && c.root.length <= 4096) || !['inactive', 'active'].includes(c.control)
48
+ || !(c.root === null || typeof c.root === 'string' && absolutePath(c.root) && c.root.length <= 4096) || !['inactive', 'active'].includes(c.control)
47
49
  || !(c.config_digest === null || hash(c.config_digest)) || !hash(c.defaults_digest)
48
50
  || !exactObject(c.values, preferenceKeys) || !exactObject(c.sources, preferenceKeys)
49
51
  || !tag(c.values.chat_language) || !tag(c.values.artifact_language)
@@ -82,7 +84,7 @@ export function resolutionRecord(record) {
82
84
  const { input_resolution: extension, ...body } = record;
83
85
  if (!plain(extension)) return null;
84
86
  const { record_version, ...resolution } = extension;
85
- if (!['string', 'number'].includes(typeof record_version) || !validInputResolution(resolution)) return null;
87
+ if (!['string', 'number'].includes(typeof record_version) || !validInputResolution(resolution, { persisted: true })) return null;
86
88
  // Pending journals retain the owning family's digest (approval/revision have
87
89
  // their own domain digest). The committed receipt binds the full command and
88
90
  // journal recovery cross-checks both retained resolutions below that owner.
@@ -0,0 +1,4 @@
1
+ // Private transfer limits; direct text is bounded independently from a multipart piece.
2
+ // The existing 64 KiB canonical command budget additionally bounds every JSON request.
3
+ export const MATERIAL_LIMITS = Object.freeze({ inline: 49152, part: 16384, file: 131072, set: 524288, sets: 4, total: 2097152,
4
+ lifetime: 600000, idle: 120000 });