@oscharko-dev/keiko 1.1.6 → 1.1.7

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 (211) hide show
  1. package/dist/ui/csp-hashes.json +7 -7
  2. package/dist/ui/static/404.html +1 -1
  3. package/dist/ui/static/__next.__PAGE__.txt +10 -10
  4. package/dist/ui/static/__next._full.txt +12 -12
  5. package/dist/ui/static/__next._tree.txt +1 -1
  6. package/dist/ui/static/_next/static/chunks/{1gb6os129fico.js → 01rp_j2a-73pp.js} +1 -1
  7. package/dist/ui/static/_next/static/chunks/02i0eppipph7e.js +1 -0
  8. package/dist/ui/static/_next/static/chunks/0hc828_gdkyek.js +3 -0
  9. package/dist/ui/static/_next/static/chunks/0hq0i12hw0ypm.js +1 -0
  10. package/dist/ui/static/_next/static/chunks/{0ak5o5brryicl.js → 18grpx4tuavds.js} +1 -1
  11. package/dist/ui/static/_next/static/chunks/1be0-x1mk56wu.js +1 -0
  12. package/dist/ui/static/_next/static/chunks/{0bbv42deftomm.js → 1c1gbfapof8m0.js} +1 -1
  13. package/dist/ui/static/_next/static/chunks/{3d-10944zk2o9.js → 1lj5se4u-t-e9.js} +1 -1
  14. package/dist/ui/static/_next/static/chunks/{1th8j9weqwhgx.js → 1o2cihsnxhmh6.js} +1 -1
  15. package/dist/ui/static/_next/static/chunks/22x3pxeia7hk_.js +1 -0
  16. package/dist/ui/static/_next/static/chunks/{0e6em7dg4gr6q.js → 25lgzefdnbdh6.js} +1 -1
  17. package/dist/ui/static/_next/static/chunks/{182b4sf3i-krz.js → 29p86cxry0h-l.js} +1 -1
  18. package/dist/ui/static/_next/static/chunks/{28mbnwl9g65al.js → 2ctd04x-fzbwc.js} +1 -1
  19. package/dist/ui/static/_next/static/chunks/2jfg687n_mvf8.js +1 -0
  20. package/dist/ui/static/_next/static/chunks/{2t2wftn5liinr.js → 2mnldrncbucm0.js} +1 -1
  21. package/dist/ui/static/_next/static/chunks/{21t1klb1thn76.js → 306ima8lxo17-.js} +1 -1
  22. package/dist/ui/static/_next/static/chunks/{2dpxapmdvqlh1.js → 36-tv3y56oau8.js} +1 -1
  23. package/dist/ui/static/_next/static/chunks/{0ks_l2sa4nfn0.js → 3aizxizjzdddj.js} +1 -1
  24. package/dist/ui/static/_next/static/chunks/{3doin5vaz4zjs.js → 3fuqgie3p2068.js} +1 -1
  25. package/dist/ui/static/_next/static/chunks/3k6g7nzn589fs.js +1 -0
  26. package/dist/ui/static/_next/static/chunks/3r4fz572q3l7s.js +1 -0
  27. package/dist/ui/static/_next/static/chunks/{1lb8ju8qa0d9m.js → 40g2_9ovqiuiu.js} +1 -1
  28. package/dist/ui/static/_not-found/__next._full.txt +9 -9
  29. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +8 -8
  30. package/dist/ui/static/_not-found/__next._tree.txt +1 -1
  31. package/dist/ui/static/_not-found.html +1 -1
  32. package/dist/ui/static/_not-found.txt +9 -9
  33. package/dist/ui/static/atlassian-connectors/__next._full.txt +13 -13
  34. package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
  35. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +10 -10
  36. package/dist/ui/static/atlassian-connectors.html +1 -1
  37. package/dist/ui/static/atlassian-connectors.txt +13 -13
  38. package/dist/ui/static/index.html +1 -1
  39. package/dist/ui/static/index.txt +12 -12
  40. package/dist/ui/static/launch/__next._full.txt +12 -12
  41. package/dist/ui/static/launch/__next._tree.txt +1 -1
  42. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +10 -10
  43. package/dist/ui/static/launch.html +1 -1
  44. package/dist/ui/static/launch.txt +12 -12
  45. package/dist/ui/static/local-knowledge/__next._full.txt +12 -12
  46. package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
  47. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +10 -10
  48. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +13 -13
  49. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
  50. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +10 -10
  51. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  52. package/dist/ui/static/local-knowledge/capsule.txt +13 -13
  53. package/dist/ui/static/local-knowledge.html +1 -1
  54. package/dist/ui/static/local-knowledge.txt +12 -12
  55. package/node_modules/@oscharko-dev/keiko-cli/package.json +14 -14
  56. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.d.ts +1 -1
  57. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.js +1 -1
  58. package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
  59. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts +43 -3
  60. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts.map +1 -1
  61. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.js +79 -2
  62. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.d.ts +645 -18
  63. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.d.ts.map +1 -1
  64. package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.js +768 -16
  65. package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts +7 -2
  66. package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts.map +1 -1
  67. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.js +2 -1
  68. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.d.ts +1 -1
  69. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.d.ts.map +1 -1
  70. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts +1 -1
  71. package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts.map +1 -1
  72. package/node_modules/@oscharko-dev/keiko-contracts/dist/context-engineering.d.ts +3 -0
  73. package/node_modules/@oscharko-dev/keiko-contracts/dist/context-engineering.d.ts.map +1 -1
  74. package/node_modules/@oscharko-dev/keiko-contracts/dist/context-engineering.js +20 -4
  75. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.d.ts +2 -2
  76. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.js +2 -2
  77. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  78. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
  79. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
  80. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
  81. package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
  82. package/node_modules/@oscharko-dev/keiko-git/dist/version.d.ts +1 -1
  83. package/node_modules/@oscharko-dev/keiko-git/dist/version.js +1 -1
  84. package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
  85. package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
  86. package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
  87. package/node_modules/@oscharko-dev/keiko-harness/package.json +7 -7
  88. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
  89. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
  90. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
  91. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
  92. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
  93. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
  94. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
  95. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
  96. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
  97. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
  98. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
  99. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
  100. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
  101. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
  102. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
  103. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
  104. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
  105. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
  106. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.d.ts.map +1 -1
  107. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.js +4 -1
  108. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
  109. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +127 -23
  110. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts.map +1 -1
  111. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.js +32 -1
  112. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts.map +1 -1
  113. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.js +12 -3
  114. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/realtime-voice-adapter.d.ts.map +1 -1
  115. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/realtime-voice-adapter.js +3 -1
  116. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/rerank-adapter.d.ts.map +1 -1
  117. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/rerank-adapter.js +4 -1
  118. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +9 -1
  119. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
  120. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +87 -5
  121. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/speech-to-text-adapter.d.ts +1 -0
  122. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/speech-to-text-adapter.d.ts.map +1 -1
  123. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/speech-to-text-adapter.js +158 -10
  124. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/text-to-speech-adapter.d.ts.map +1 -1
  125. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/text-to-speech-adapter.js +176 -12
  126. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
  127. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
  128. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +4 -4
  129. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
  130. package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
  131. package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
  132. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts +7 -1
  133. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts.map +1 -1
  134. package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.js +21 -0
  135. package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
  136. package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
  137. package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
  138. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts +6 -0
  139. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
  140. package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +299 -104
  141. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +15 -0
  142. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
  143. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +5 -1
  144. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
  145. package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +11 -0
  146. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts +24 -2
  147. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
  148. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +215 -38
  149. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.d.ts +6 -0
  150. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.d.ts.map +1 -0
  151. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.js +27 -0
  152. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts +33 -0
  153. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
  154. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +256 -25
  155. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.d.ts +2 -1
  156. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.d.ts.map +1 -1
  157. package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.js +11 -4
  158. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.d.ts +2 -1
  159. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.d.ts.map +1 -1
  160. package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.js +221 -38
  161. package/node_modules/@oscharko-dev/keiko-server/package.json +22 -22
  162. package/node_modules/@oscharko-dev/keiko-tool-catalog/package.json +3 -3
  163. package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
  164. package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
  165. package/node_modules/@oscharko-dev/keiko-tools/package.json +7 -7
  166. package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
  167. package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
  168. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
  169. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
  170. package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
  171. package/package.json +26 -26
  172. package/release-impact.catalog.json +78 -23
  173. package/vendor/{oscharko-dev-keiko-cli-1.1.6.tgz → oscharko-dev-keiko-cli-1.1.7.tgz} +0 -0
  174. package/vendor/{oscharko-dev-keiko-connectors-1.1.6.tgz → oscharko-dev-keiko-connectors-1.1.7.tgz} +0 -0
  175. package/vendor/oscharko-dev-keiko-contracts-1.1.7.tgz +0 -0
  176. package/vendor/{oscharko-dev-keiko-evaluations-1.1.6.tgz → oscharko-dev-keiko-evaluations-1.1.7.tgz} +0 -0
  177. package/vendor/{oscharko-dev-keiko-evidence-1.1.6.tgz → oscharko-dev-keiko-evidence-1.1.7.tgz} +0 -0
  178. package/vendor/{oscharko-dev-keiko-git-1.1.6.tgz → oscharko-dev-keiko-git-1.1.7.tgz} +0 -0
  179. package/vendor/{oscharko-dev-keiko-harness-1.1.6.tgz → oscharko-dev-keiko-harness-1.1.7.tgz} +0 -0
  180. package/vendor/{oscharko-dev-keiko-local-knowledge-1.1.6.tgz → oscharko-dev-keiko-local-knowledge-1.1.7.tgz} +0 -0
  181. package/vendor/{oscharko-dev-keiko-memory-capture-1.1.6.tgz → oscharko-dev-keiko-memory-capture-1.1.7.tgz} +0 -0
  182. package/vendor/{oscharko-dev-keiko-memory-consolidation-1.1.6.tgz → oscharko-dev-keiko-memory-consolidation-1.1.7.tgz} +0 -0
  183. package/vendor/{oscharko-dev-keiko-memory-governance-1.1.6.tgz → oscharko-dev-keiko-memory-governance-1.1.7.tgz} +0 -0
  184. package/vendor/{oscharko-dev-keiko-memory-retrieval-1.1.6.tgz → oscharko-dev-keiko-memory-retrieval-1.1.7.tgz} +0 -0
  185. package/vendor/{oscharko-dev-keiko-memory-vault-1.1.6.tgz → oscharko-dev-keiko-memory-vault-1.1.7.tgz} +0 -0
  186. package/vendor/oscharko-dev-keiko-model-gateway-1.1.7.tgz +0 -0
  187. package/vendor/{oscharko-dev-keiko-quality-intelligence-1.1.6.tgz → oscharko-dev-keiko-quality-intelligence-1.1.7.tgz} +0 -0
  188. package/vendor/{oscharko-dev-keiko-sandbox-1.1.6.tgz → oscharko-dev-keiko-sandbox-1.1.7.tgz} +0 -0
  189. package/vendor/{oscharko-dev-keiko-sdk-1.1.6.tgz → oscharko-dev-keiko-sdk-1.1.7.tgz} +0 -0
  190. package/vendor/oscharko-dev-keiko-security-1.1.7.tgz +0 -0
  191. package/vendor/oscharko-dev-keiko-server-1.1.7.tgz +0 -0
  192. package/vendor/{oscharko-dev-keiko-tool-catalog-1.1.6.tgz → oscharko-dev-keiko-tool-catalog-1.1.7.tgz} +0 -0
  193. package/vendor/{oscharko-dev-keiko-tools-1.1.6.tgz → oscharko-dev-keiko-tools-1.1.7.tgz} +0 -0
  194. package/vendor/{oscharko-dev-keiko-verification-1.1.6.tgz → oscharko-dev-keiko-verification-1.1.7.tgz} +0 -0
  195. package/vendor/{oscharko-dev-keiko-workflows-1.1.6.tgz → oscharko-dev-keiko-workflows-1.1.7.tgz} +0 -0
  196. package/vendor/{oscharko-dev-keiko-workspace-1.1.6.tgz → oscharko-dev-keiko-workspace-1.1.7.tgz} +0 -0
  197. package/dist/ui/static/_next/static/chunks/0c3w2ubla6ek6.js +0 -1
  198. package/dist/ui/static/_next/static/chunks/0gnizm29lk3ll.js +0 -1
  199. package/dist/ui/static/_next/static/chunks/19fesd0w1gjhp.js +0 -3
  200. package/dist/ui/static/_next/static/chunks/1k6f6m-u2q69-.js +0 -1
  201. package/dist/ui/static/_next/static/chunks/1pze64zkvx8vt.js +0 -1
  202. package/dist/ui/static/_next/static/chunks/2h_zvmb272ozs.js +0 -1
  203. package/dist/ui/static/_next/static/chunks/3-5_wuwrev-8c.js +0 -1
  204. package/dist/ui/static/_next/static/chunks/3-l-8qt163_y6.js +0 -1
  205. package/vendor/oscharko-dev-keiko-contracts-1.1.6.tgz +0 -0
  206. package/vendor/oscharko-dev-keiko-model-gateway-1.1.6.tgz +0 -0
  207. package/vendor/oscharko-dev-keiko-security-1.1.6.tgz +0 -0
  208. package/vendor/oscharko-dev-keiko-server-1.1.6.tgz +0 -0
  209. /package/dist/ui/static/_next/static/{ytpWXc-OicMB-rH2zX5b3 → nXnJJ05BP_rtUCiZsedfT}/_buildManifest.js +0 -0
  210. /package/dist/ui/static/_next/static/{ytpWXc-OicMB-rH2zX5b3 → nXnJJ05BP_rtUCiZsedfT}/_clientMiddlewareManifest.js +0 -0
  211. /package/dist/ui/static/_next/static/{ytpWXc-OicMB-rH2zX5b3 → nXnJJ05BP_rtUCiZsedfT}/_ssgManifest.js +0 -0
@@ -20,6 +20,7 @@
20
20
  // diff-backed commit draft has its own explicit endpoint, so the read-only preview never hides model
21
21
  // latency, cost, or an unavailable model behind ordinary staging changes.
22
22
  import { selectConfiguredModel, } from "@oscharko-dev/keiko-model-gateway";
23
+ import { ProviderOutputExhaustedError, TimeoutError } from "@oscharko-dev/keiko-security";
23
24
  import { analyzeGitCommitIntent } from "@oscharko-dev/keiko-contracts/runtime/git-commit-intent";
24
25
  import { evaluateGitDeliveryEffectivePolicy, evaluateGitPolicy, } from "@oscharko-dev/keiko-contracts/runtime/git-delivery-policy";
25
26
  import { gitDeliveryRiskClassForInputs } from "@oscharko-dev/keiko-contracts/runtime/git-delivery";
@@ -27,6 +28,7 @@ import { validateGitCommitMessage } from "@oscharko-dev/keiko-contracts/runtime/
27
28
  import { activityLogEvent, defineActivityLogOperation, } from "@oscharko-dev/keiko-contracts/runtime/observability";
28
29
  import { evaluateGitPreflight, summarizeStagedChangeset, } from "@oscharko-dev/keiko-tools";
29
30
  import { correlationIdOrUnknown, UNKNOWN_CORRELATION_ID } from "../correlation.js";
31
+ import { gatewayRouteDeadlineMs } from "../gateway-route-deadline.js";
30
32
  import { emitServerDiagnostic, serverDiagnosticFromError } from "../diagnostics-log.js";
31
33
  import { processServerLogSink } from "../process-log-sink.js";
32
34
  import { requiresConfiguredManagedWorkspaceAuthority } from "../task-workspace/workspace-root-access.js";
@@ -72,9 +74,13 @@ const COMMIT_DRAFT_COMPLETED_OPERATION = defineActivityLogOperation({
72
74
  owner: "keiko-server",
73
75
  emitter: "gitDelivery/commitRoutes.logCommitDraft",
74
76
  fields: {
75
- stagedFileCount: { type: "integer", dataClass: "count", required: true },
76
- areaCount: { type: "integer", dataClass: "count", required: true },
77
- touchesTests: { type: "boolean", dataClass: "closed-enum", required: true },
77
+ // The staged changeset's counts, present once the route has read it. A client that
78
+ // disconnects before that read ends the draft as `GIT_DELIVERY_COMMIT_DRAFT_CANCELLED` with
79
+ // the counts absent, never invented (PR #3602 review): an absent count means "not observed",
80
+ // a zero means "observed and empty".
81
+ stagedFileCount: { type: "integer", dataClass: "count", required: false },
82
+ areaCount: { type: "integer", dataClass: "count", required: false },
83
+ touchesTests: { type: "boolean", dataClass: "closed-enum", required: false },
78
84
  outcome: {
79
85
  type: "string",
80
86
  dataClass: "closed-enum",
@@ -91,12 +97,21 @@ const COMMIT_DRAFT_COMPLETED_OPERATION = defineActivityLogOperation({
91
97
  "GIT_DELIVERY_COMMIT_FORBIDDEN_PAYLOAD",
92
98
  "GIT_DELIVERY_COMMIT_DRAFT_FAILED",
93
99
  "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT",
100
+ "GIT_DELIVERY_COMMIT_DRAFT_OUTPUT_EXHAUSTED",
101
+ "GIT_DELIVERY_COMMIT_DRAFT_TIMED_OUT",
102
+ "GIT_DELIVERY_COMMIT_DRAFT_CANCELLED",
94
103
  "GIT_DELIVERY_COMMIT_DRAFT_MODEL_UNAVAILABLE",
95
104
  "GIT_DELIVERY_COMMIT_DRAFT_NO_CHANGES",
96
105
  "GIT_DELIVERY_COMMIT_UNKNOWN_PROJECT",
97
106
  "GIT_DELIVERY_COMMIT_WORKTREE_UNAVAILABLE",
98
107
  ],
99
108
  },
109
+ // #3591 (1.1.7): the bounds the model call ran under, present once a model was resolved — the
110
+ // output allowance sent (the raised draft budget, clamped to the model's declared limit) and
111
+ // the route's own deadline behind the gateway's floors — so an exhausted or timed-out draft
112
+ // can be reconstructed from this line alone.
113
+ maxOutputTokens: { type: "integer", dataClass: "count", required: false },
114
+ deadlineMs: { type: "integer", dataClass: "duration", required: false },
100
115
  },
101
116
  causal: "correlation",
102
117
  lifecycle: "end",
@@ -105,11 +120,21 @@ const COMMIT_DRAFT_COMPLETED_OPERATION = defineActivityLogOperation({
105
120
  proofIds: ["git.commit.draft.completed.emitted-line"],
106
121
  releaseImpact: "patch",
107
122
  });
123
+ // #3591: an output-exhausted answer is not shape-invalid (the model simply spent its whole budget
124
+ // before finishing), but it is just as unusable as a malformed one, so it shares the
125
+ // "validation-failed" errorKind with GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT — the precise class
126
+ // still survives on the record via the `failureCode` field below.
108
127
  function commitDraftErrorKind(code) {
109
128
  if (code === "GIT_DELIVERY_COMMIT_DRAFT_MODEL_UNAVAILABLE")
110
129
  return "unavailable";
111
- if (code === "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT")
130
+ if (code === "GIT_DELIVERY_COMMIT_DRAFT_TIMED_OUT")
131
+ return "timeout";
132
+ if (code === "GIT_DELIVERY_COMMIT_DRAFT_CANCELLED")
133
+ return "cancelled";
134
+ if (code === "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT" ||
135
+ code === "GIT_DELIVERY_COMMIT_DRAFT_OUTPUT_EXHAUSTED") {
112
136
  return "validation-failed";
137
+ }
113
138
  if (code === "GIT_DELIVERY_COMMIT_DRAFT_NO_CHANGES")
114
139
  return "conflict";
115
140
  return "internal";
@@ -119,7 +144,10 @@ const SAFE_MESSAGES = {
119
144
  GIT_DELIVERY_COMMIT_PAYLOAD_TOO_LARGE: "The governed commit request exceeds the maximum size.",
120
145
  GIT_DELIVERY_COMMIT_FORBIDDEN_PAYLOAD: "The request contained a forbidden field. Requests may not carry credentials, headers, or URLs.",
121
146
  GIT_DELIVERY_COMMIT_DRAFT_FAILED: "Keiko could not generate a commit draft from the staged diff.",
147
+ GIT_DELIVERY_COMMIT_DRAFT_CANCELLED: "The commit draft was cancelled because the client disconnected before it was ready.",
122
148
  GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT: "Keiko generated a commit draft that did not pass validation.",
149
+ GIT_DELIVERY_COMMIT_DRAFT_OUTPUT_EXHAUSTED: "Keiko's model spent its whole output budget reasoning about the change and produced no draft. Retry, or write the commit message yourself.",
150
+ GIT_DELIVERY_COMMIT_DRAFT_TIMED_OUT: "The gateway did not answer in time; the draft was not generated. Retry, or write the message yourself.",
123
151
  GIT_DELIVERY_COMMIT_DRAFT_MODEL_UNAVAILABLE: "No compatible model is available for commit draft generation.",
124
152
  GIT_DELIVERY_COMMIT_DRAFT_NO_CHANGES: "Stage one or more changes before asking Keiko to draft a commit message.",
125
153
  GIT_DELIVERY_COMMIT_UNKNOWN_PROJECT: "The requested project is not a known workspace.",
@@ -133,8 +161,19 @@ const UTF8 = new TextEncoder();
133
161
  const KEIKO_GENERATED_FOOTER = "🤖 Generated with [Keiko](https://github.com/oscharko-dev/Keiko)";
134
162
  const COMMIT_DRAFT_DIFF_MAX_CHARS = 90_000;
135
163
  const COMMIT_DRAFT_INSTRUCTION_MAX_CHARS = 1_500;
136
- const COMMIT_DRAFT_MODEL_TIMEOUT_MS = 30_000;
137
- const COMMIT_DRAFT_MAX_OUTPUT_TOKENS = 700;
164
+ // #3591 (1.1.7): a LiteLLM-fronted vLLM gateway at peak load can take 30-120s or longer to answer.
165
+ // The flat 30s AbortSignal this route used to pass as `cancellationSignal` capped the WHOLE buffered
166
+ // gateway call -- including the gateway's own internal retries -- so a healthy but slow answer was
167
+ // reported as GIT_DELIVERY_COMMIT_DRAFT_FAILED, indistinguishable from a real outage.
168
+ // `latencyProfile: "coding-workbench"` on the built request (buildCommitDraftModelRequest) asks the
169
+ // gateway to apply the coding-workbench PER-ATTEMPT floor; the route's own backstop is derived from
170
+ // that same retry budget (`gatewayRouteDeadlineMs`, shared with the Coding Workbench route) so it
171
+ // always sits BEHIND the gateway's clock and never becomes the shorter, primary timeout.
172
+ // A reasoning model (gpt-oss / gemma thinking) spends output tokens on its reasoning trace before
173
+ // its first answer token. 700 was tight enough that the whole budget was consumed by reasoning,
174
+ // leaving `finish_reason: "length"` and no usable content (#3591). 4,000 gives a reasoning model
175
+ // room to think AND still answer.
176
+ export const COMMIT_DRAFT_MAX_OUTPUT_TOKENS = 4_000;
138
177
  const LOCAL_USER_COMMIT_AUTHORITY = {
139
178
  runId: "local-user-git-widget",
140
179
  envelopeDigest: "0".repeat(64),
@@ -391,7 +430,23 @@ function resolveCommitDraftModel(deps) {
391
430
  const model = deps.modelPortFactory(modelId);
392
431
  if (model === undefined)
393
432
  return undefined;
394
- return { model, modelId, useResponseFormat: structuredModelId !== undefined };
433
+ return {
434
+ model,
435
+ modelId,
436
+ useResponseFormat: structuredModelId !== undefined,
437
+ maxOutputTokens: commitDraftOutputTokens(config.capabilities ?? [], modelId),
438
+ // The draft only buffers, so its backstop follows the buffered budget alone (PR #3602 review).
439
+ deadlineMs: gatewayRouteDeadlineMs(config, modelId, ["buffered"]),
440
+ };
441
+ }
442
+ // #3591 review: the raised draft budget must not exceed what the model declares. The spend-budget
443
+ // port refuses a request above `capability.maxOutputTokens` before any provider call, and a
444
+ // provider would reject it; a model that declares no limit (0) keeps the full draft budget.
445
+ function commitDraftOutputTokens(capabilities, modelId) {
446
+ const declared = capabilities.find((capability) => capability.id === modelId)?.maxOutputTokens;
447
+ return declared !== undefined && declared > 0
448
+ ? Math.min(COMMIT_DRAFT_MAX_OUTPUT_TOKENS, declared)
449
+ : COMMIT_DRAFT_MAX_OUTPUT_TOKENS;
395
450
  }
396
451
  function boundedStagedDiff(diff) {
397
452
  if (diff.length <= COMMIT_DRAFT_DIFF_MAX_CHARS)
@@ -427,10 +482,13 @@ function buildCommitDraftModelRequest(input) {
427
482
  { role: "user", content: commitDraftEvidence(input) },
428
483
  ],
429
484
  ...(input.useResponseFormat ? { responseFormat: COMMIT_DRAFT_RESPONSE_FORMAT } : {}),
430
- maxOutputTokens: COMMIT_DRAFT_MAX_OUTPUT_TOKENS,
485
+ maxOutputTokens: input.maxOutputTokens,
431
486
  temperature: 0.2,
432
487
  stream: false,
433
488
  logContext: { correlationId: input.correlationId },
489
+ // Applies the gateway's coding-workbench provider-timeout floor (#3591) — see
490
+ // COMMIT_DRAFT_MODEL_DEADLINE_MS above for why this route no longer sets its own flat cap.
491
+ latencyProfile: "coding-workbench",
434
492
  };
435
493
  }
436
494
  function unfencedJson(text) {
@@ -462,73 +520,153 @@ function draftTextField(record, field) {
462
520
  return normalized.length > 0 ? normalized : undefined;
463
521
  }
464
522
  function modelCommitMessage(response, policy) {
465
- if (response.finishReason !== "stop" || response.toolCalls.length !== 0)
466
- return undefined;
523
+ // A reasoning model that spends its whole output budget before answering ends with
524
+ // `finish_reason: "length"`; whatever content survived to that point is a mid-thought fragment,
525
+ // never a complete, trustworthy commit message (#3591). Checked BEFORE parsing so a fragment that
526
+ // happens to close as valid JSON at the truncation boundary is never mistaken for a real answer.
527
+ if (response.finishReason === "length")
528
+ return { ok: false, reason: "output-exhausted" };
529
+ if (response.finishReason !== "stop" || response.toolCalls.length !== 0) {
530
+ return { ok: false, reason: "invalid-output" };
531
+ }
467
532
  const candidate = draftCandidate(response);
468
533
  if (!isPlainObject(candidate))
469
- return undefined;
534
+ return { ok: false, reason: "invalid-output" };
470
535
  const subject = draftTextField(candidate, "subject");
471
536
  const body = draftTextField(candidate, "body");
472
537
  if (subject === undefined || body === undefined)
473
- return undefined;
538
+ return { ok: false, reason: "invalid-output" };
474
539
  const message = appendKeikoGeneratedFooter(`${subject}\n\n${body}`);
475
- return validateGitCommitMessage(message, policy).ok ? message : undefined;
476
- }
477
- async function generateModelCommitMessage(deps, input) {
540
+ return validateGitCommitMessage(message, policy).ok
541
+ ? { ok: true, message }
542
+ : { ok: false, reason: "invalid-output" };
543
+ }
544
+ // #3591: classifies a failed model call into the three failure classes the UI must tell apart — a
545
+ // provider that never answered in time, a provider that answered but exhausted its output budget on
546
+ // reasoning, and a provider that answered completely but produced something unusable. `signal` is
547
+ // the caller's own cancellation (route deadline + client disconnect, see commitDraftCancellation
548
+ // below); this function no longer builds its own.
549
+ function classifyCommitDraftModelFailure(error, signal) {
550
+ if (error instanceof ProviderOutputExhaustedError) {
551
+ return "GIT_DELIVERY_COMMIT_DRAFT_OUTPUT_EXHAUSTED";
552
+ }
553
+ if (error instanceof TimeoutError || routeDeadlineFired(signal)) {
554
+ return "GIT_DELIVERY_COMMIT_DRAFT_TIMED_OUT";
555
+ }
556
+ // The composed signal aborted without the deadline: the client left during the model call.
557
+ if (signal.aborted)
558
+ return "GIT_DELIVERY_COMMIT_DRAFT_CANCELLED";
559
+ return "GIT_DELIVERY_COMMIT_DRAFT_FAILED";
560
+ }
561
+ // The route deadline firing while the gateway sleeps before a retry surfaces as the gateway's
562
+ // CancelledError, not as TimeoutError; the composed signal's reason still names the deadline
563
+ // (#3591 review). A client disconnect aborts without that reason and stays a generic failure.
564
+ function routeDeadlineFired(signal) {
565
+ const reason = signal.reason;
566
+ return signal.aborted && reason instanceof DOMException && reason.name === "TimeoutError";
567
+ }
568
+ async function generateModelCommitMessage(deps, input, signal) {
478
569
  const resolved = resolveCommitDraftModel(deps);
479
570
  if (resolved === undefined) {
480
571
  return { ok: false, code: "GIT_DELIVERY_COMMIT_DRAFT_MODEL_UNAVAILABLE" };
481
572
  }
482
- const signal = AbortSignal.timeout(COMMIT_DRAFT_MODEL_TIMEOUT_MS);
573
+ const bounds = {
574
+ maxOutputTokens: resolved.maxOutputTokens,
575
+ deadlineMs: resolved.deadlineMs,
576
+ };
577
+ // The route deadline is armed only now, for THIS model's budget, and composed with the client
578
+ // disconnect signal; its reason (a TimeoutError DOMException) tells the two apart below.
579
+ const callSignal = AbortSignal.any([signal, AbortSignal.timeout(resolved.deadlineMs)]);
483
580
  try {
484
581
  const response = await resolved.model.call(buildCommitDraftModelRequest({
485
582
  ...input,
486
583
  modelId: resolved.modelId,
487
584
  useResponseFormat: resolved.useResponseFormat,
488
- }), signal);
489
- const message = modelCommitMessage(response, input.policy);
490
- return message === undefined
491
- ? { ok: false, code: "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT" }
492
- : { ok: true, message };
585
+ maxOutputTokens: resolved.maxOutputTokens,
586
+ }), callSignal);
587
+ const validated = modelCommitMessage(response, input.policy);
588
+ if (validated.ok)
589
+ return { ok: true, message: validated.message, bounds };
590
+ const code = validated.reason === "output-exhausted"
591
+ ? "GIT_DELIVERY_COMMIT_DRAFT_OUTPUT_EXHAUSTED"
592
+ : "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT";
593
+ return { ok: false, code, bounds };
493
594
  }
494
595
  catch (error) {
495
- return { ok: false, code: "GIT_DELIVERY_COMMIT_DRAFT_FAILED", error };
596
+ return { ok: false, code: classifyCommitDraftModelFailure(error, callSignal), error, bounds };
496
597
  }
497
598
  }
498
- function logCommitDraft(log, correlationId, summary, status, failureCode) {
599
+ // `summary` is undefined only when the draft ended before the staged changeset was read (a client
600
+ // disconnect during the policy lookup): the counts are then absent from the line, never invented.
601
+ function logCommitDraft(log, correlationId, summary, status, failureCode, bounds) {
499
602
  log.write(activityLogEvent(COMMIT_DRAFT_COMPLETED_OPERATION, {
500
603
  correlationId,
501
604
  status,
502
605
  ...(failureCode === undefined ? {} : { errorKind: commitDraftErrorKind(failureCode) }),
503
606
  }, {
504
- stagedFileCount: summary.stagedFileCount,
505
- areaCount: summary.areaCount,
506
- touchesTests: summary.touchesTests,
607
+ ...(summary === undefined
608
+ ? {}
609
+ : {
610
+ stagedFileCount: summary.stagedFileCount,
611
+ areaCount: summary.areaCount,
612
+ touchesTests: summary.touchesTests,
613
+ }),
507
614
  outcome: status === 200 ? "succeeded" : "failed",
508
615
  ...(failureCode === undefined ? {} : { failureCode }),
616
+ ...bounds,
509
617
  }));
510
618
  }
511
- function draftFailureResult(log, correlationId, summary, status, code) {
512
- logCommitDraft(log, correlationId, summary, status, code);
619
+ function draftFailureResult(log, correlationId, summary, status, code, bounds) {
620
+ logCommitDraft(log, correlationId, summary, status, code, bounds);
513
621
  return errResult(status, code);
514
622
  }
623
+ // Read through a call so the abort state is looked at afresh after each await: a property read
624
+ // narrows to `false` after the first guard and would make every later guard dead code to the
625
+ // compiler, although the signal can flip between two awaits.
626
+ function clientLeft(signal) {
627
+ return signal.aborted;
628
+ }
629
+ // A client that leaves while the draft is still being prepared ends it as cancelled — no further
630
+ // worktree read, no model call — with whatever the route had observed by then (PR #3602 review).
631
+ function draftCancelled(log, correlationId, summary) {
632
+ return draftFailureResult(log, correlationId, summary, commitDraftFailureStatus("GIT_DELIVERY_COMMIT_DRAFT_CANCELLED"), "GIT_DELIVERY_COMMIT_DRAFT_CANCELLED");
633
+ }
634
+ // S7776: a Set, not `.includes()` on a constant array.
635
+ const COMMIT_DRAFT_BAD_GATEWAY_CODES = new Set([
636
+ "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT",
637
+ "GIT_DELIVERY_COMMIT_DRAFT_OUTPUT_EXHAUSTED",
638
+ ]);
515
639
  function commitDraftFailureStatus(code) {
516
- return code === "GIT_DELIVERY_COMMIT_DRAFT_INVALID_OUTPUT" ? 502 : 503;
640
+ // Matches repositoryInitializationRoutes.ts / gitRepositoryRoutes.ts: a bounded operation that
641
+ // did not finish in time reports 504, never the generic 503 an unavailable model reports; a
642
+ // client that left reports 499 like the chat stream and grounded routes do.
643
+ if (code === "GIT_DELIVERY_COMMIT_DRAFT_TIMED_OUT")
644
+ return 504;
645
+ if (code === "GIT_DELIVERY_COMMIT_DRAFT_CANCELLED")
646
+ return 499;
647
+ return COMMIT_DRAFT_BAD_GATEWAY_CODES.has(code) ? 502 : 503;
517
648
  }
518
649
  function modelDraftFailureResult(deps, log, correlationId, summary, suggested) {
519
650
  if (suggested.error !== undefined) {
520
651
  reportCommitDraftModelFailure(deps, correlationId, suggested.error);
521
652
  }
522
- return draftFailureResult(log, correlationId, summary, commitDraftFailureStatus(suggested.code), suggested.code);
653
+ return draftFailureResult(log, correlationId, summary, commitDraftFailureStatus(suggested.code), suggested.code, suggested.bounds);
523
654
  }
524
- async function computeModelCommitDraft(deps, workspace, req, policy, seams, now, correlationId) {
655
+ async function computeModelCommitDraft(deps, workspace, req, policy, seams, now, run) {
656
+ const { correlationId, signal } = run;
525
657
  const log = seams.activityLog ?? processServerLogSink();
526
658
  const stagedPaths = await readStagedPathsFor(workspace, seams, now, correlationId);
527
659
  const summary = summarizeStagedChangeset(stagedPaths);
660
+ // Re-checked after every await that can outlast a disconnect (PR #3602 review): a client that
661
+ // left while a worktree read was pending gets no further read and no model call.
662
+ if (clientLeft(signal))
663
+ return draftCancelled(log, correlationId, summary);
528
664
  if (summary.stagedFileCount === 0 || stagedPaths.length === 0) {
529
665
  return draftFailureResult(log, correlationId, summary, 409, "GIT_DELIVERY_COMMIT_DRAFT_NO_CHANGES");
530
666
  }
531
667
  const stagedDiff = await readStagedDiffFor(workspace, seams, now, correlationId);
668
+ if (clientLeft(signal))
669
+ return draftCancelled(log, correlationId, summary);
532
670
  const suggested = await generateModelCommitMessage(deps, {
533
671
  policy,
534
672
  stagedPaths,
@@ -536,11 +674,11 @@ async function computeModelCommitDraft(deps, workspace, req, policy, seams, now,
536
674
  stagedDiff,
537
675
  instruction: req.instruction,
538
676
  correlationId,
539
- });
677
+ }, signal);
540
678
  if (!suggested.ok) {
541
679
  return modelDraftFailureResult(deps, log, correlationId, summary, suggested);
542
680
  }
543
- logCommitDraft(log, correlationId, summary, 200);
681
+ logCommitDraft(log, correlationId, summary, 200, undefined, suggested.bounds);
544
682
  const body = {
545
683
  schemaVersion: "1",
546
684
  status: "succeeded",
@@ -550,6 +688,31 @@ async function computeModelCommitDraft(deps, workspace, req, policy, seams, now,
550
688
  };
551
689
  return { status: 200, body: deps.redactor(body) };
552
690
  }
691
+ // Bounds the model call by COMMIT_DRAFT_MODEL_DEADLINE_MS AND aborts it the moment the client goes
692
+ // away — mirrors coding-sidecar-gateway.ts's `gatewayRequestCancellation` /
693
+ // coding-sidecar-tool-facade.ts's `bindRouteDisconnect`, the established "abort-on-close" pattern in
694
+ // this server (#3591), applied here to the one long-latency call this route makes.
695
+ function commitDraftCancellation(ctx) {
696
+ const controller = new AbortController();
697
+ const onDisconnect = () => {
698
+ controller.abort();
699
+ };
700
+ const onResponseClosed = () => {
701
+ if (!ctx.res.writableFinished)
702
+ onDisconnect();
703
+ };
704
+ ctx.req.once("aborted", onDisconnect);
705
+ ctx.res.once("close", onResponseClosed);
706
+ // The route deadline itself is armed per model, behind that model's gateway budget, where the
707
+ // model is resolved (`generateModelCommitMessage`); this signal only carries the disconnect.
708
+ return {
709
+ signal: controller.signal,
710
+ dispose: () => {
711
+ ctx.req.removeListener("aborted", onDisconnect);
712
+ ctx.res.removeListener("close", onResponseClosed);
713
+ },
714
+ };
715
+ }
553
716
  export const createHandleCommitDraft = (options = {}) => {
554
717
  const activityLog = options.execution?.activityLog ?? options.activityLog ?? processServerLogSink();
555
718
  const seams = { ...options.execution, activityLog };
@@ -568,16 +731,36 @@ export const createHandleCommitDraft = (options = {}) => {
568
731
  const workspace = resolveProjectWorkspace(deps, req.projectId);
569
732
  if (workspace === undefined)
570
733
  return errResult(404, "GIT_DELIVERY_COMMIT_UNKNOWN_PROJECT");
571
- const policy = await resolveGovernedCommitMessagePolicy(deps, workspace.root, options.messagePolicy);
734
+ // Armed BEFORE the policy lookup: a client that leaves while the policy is still being resolved
735
+ // is already recorded on the signal the model call arms, so that call is never made for nobody
736
+ // (PR #3602 review). Disposed once both the lookup and the call have settled, however they end.
737
+ const cancellation = commitDraftCancellation(ctx);
572
738
  try {
573
- return await computeModelCommitDraft(deps, workspace, req, policy, seams, now, correlationId);
739
+ const policy = await resolveGovernedCommitMessagePolicy(deps, workspace.root, options.messagePolicy);
740
+ // Nothing has been read yet, so the completion line carries no staged counts.
741
+ if (cancellation.signal.aborted)
742
+ return draftCancelled(activityLog, correlationId, undefined);
743
+ return await draftWithModel(deps, workspace, req, policy, seams, now, {
744
+ correlationId,
745
+ signal: cancellation.signal,
746
+ });
574
747
  }
575
- catch (error) {
576
- reportDraftWorktreeFailure(deps, correlationId, error);
577
- return errResult(409, "GIT_DELIVERY_COMMIT_WORKTREE_UNAVAILABLE");
748
+ finally {
749
+ cancellation.dispose();
578
750
  }
579
751
  };
580
752
  };
753
+ // The model call's own failure envelope: a worktree that cannot be read for the staged diff is a
754
+ // 409, never a 500, and it is reported once with the request's correlation id.
755
+ async function draftWithModel(deps, workspace, req, policy, seams, now, run) {
756
+ try {
757
+ return await computeModelCommitDraft(deps, workspace, req, policy, seams, now, run);
758
+ }
759
+ catch (error) {
760
+ reportDraftWorktreeFailure(deps, run.correlationId, error);
761
+ return errResult(409, "GIT_DELIVERY_COMMIT_WORKTREE_UNAVAILABLE");
762
+ }
763
+ }
581
764
  // ─── Execute (governed, with message-policy gate) ───────────────────────────────────────────────
582
765
  const EXECUTE_KEYS = new Set([
583
766
  "schemaVersion",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-server",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Internal server package: local loopback BFF runtime (HTTP/SSE/WebSocket router, CSP, host check, CSRF gate, terminal, browser, files, run engine, SQLite-backed UI store) that mediates the browser presentation tier and the Node-side domain packages (ADR-0019). Not published independently.",
@@ -55,26 +55,26 @@
55
55
  },
56
56
  "private": true,
57
57
  "peerDependencies": {
58
- "@oscharko-dev/keiko-connectors": "1.1.6",
59
- "@oscharko-dev/keiko-contracts": "1.1.6",
60
- "@oscharko-dev/keiko-evidence": "1.1.6",
61
- "@oscharko-dev/keiko-git": "1.1.6",
62
- "@oscharko-dev/keiko-harness": "1.1.6",
63
- "@oscharko-dev/keiko-local-knowledge": "1.1.6",
64
- "@oscharko-dev/keiko-memory-capture": "1.1.6",
65
- "@oscharko-dev/keiko-memory-consolidation": "1.1.6",
66
- "@oscharko-dev/keiko-memory-governance": "1.1.6",
67
- "@oscharko-dev/keiko-memory-retrieval": "1.1.6",
68
- "@oscharko-dev/keiko-memory-vault": "1.1.6",
69
- "@oscharko-dev/keiko-model-gateway": "1.1.6",
70
- "@oscharko-dev/keiko-quality-intelligence": "1.1.6",
71
- "@oscharko-dev/keiko-sandbox": "1.1.6",
72
- "@oscharko-dev/keiko-sdk": "1.1.6",
73
- "@oscharko-dev/keiko-security": "1.1.6",
74
- "@oscharko-dev/keiko-tool-catalog": "1.1.6",
75
- "@oscharko-dev/keiko-tools": "1.1.6",
76
- "@oscharko-dev/keiko-verification": "1.1.6",
77
- "@oscharko-dev/keiko-workflows": "1.1.6",
78
- "@oscharko-dev/keiko-workspace": "1.1.6"
58
+ "@oscharko-dev/keiko-connectors": "1.1.7",
59
+ "@oscharko-dev/keiko-contracts": "1.1.7",
60
+ "@oscharko-dev/keiko-evidence": "1.1.7",
61
+ "@oscharko-dev/keiko-git": "1.1.7",
62
+ "@oscharko-dev/keiko-harness": "1.1.7",
63
+ "@oscharko-dev/keiko-local-knowledge": "1.1.7",
64
+ "@oscharko-dev/keiko-memory-capture": "1.1.7",
65
+ "@oscharko-dev/keiko-memory-consolidation": "1.1.7",
66
+ "@oscharko-dev/keiko-memory-governance": "1.1.7",
67
+ "@oscharko-dev/keiko-memory-retrieval": "1.1.7",
68
+ "@oscharko-dev/keiko-memory-vault": "1.1.7",
69
+ "@oscharko-dev/keiko-model-gateway": "1.1.7",
70
+ "@oscharko-dev/keiko-quality-intelligence": "1.1.7",
71
+ "@oscharko-dev/keiko-sandbox": "1.1.7",
72
+ "@oscharko-dev/keiko-sdk": "1.1.7",
73
+ "@oscharko-dev/keiko-security": "1.1.7",
74
+ "@oscharko-dev/keiko-tool-catalog": "1.1.7",
75
+ "@oscharko-dev/keiko-tools": "1.1.7",
76
+ "@oscharko-dev/keiko-verification": "1.1.7",
77
+ "@oscharko-dev/keiko-workflows": "1.1.7",
78
+ "@oscharko-dev/keiko-workspace": "1.1.7"
79
79
  }
80
80
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-tool-catalog",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Internal pure governed-tool descriptors, schema projections, compatibility, and catalog identities.",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "private": true,
23
23
  "peerDependencies": {
24
- "@oscharko-dev/keiko-contracts": "1.1.6",
25
- "@oscharko-dev/keiko-security": "1.1.6"
24
+ "@oscharko-dev/keiko-contracts": "1.1.7",
25
+ "@oscharko-dev/keiko-security": "1.1.7"
26
26
  }
27
27
  }
@@ -1,2 +1,2 @@
1
- export declare const KEIKO_TOOLS_VERSION: "1.1.6";
1
+ export declare const KEIKO_TOOLS_VERSION: "1.1.7";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Package version constant. Bumped in lockstep with the package.json version so consumers can
2
2
  // detect divergence in tests without parsing package metadata at runtime.
3
- export const KEIKO_TOOLS_VERSION = "1.1.6";
3
+ export const KEIKO_TOOLS_VERSION = "1.1.7";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-tools",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Internal tools package: Keiko safe tool-execution layer — terminal-policy command allowlist, env-isolated no-shell spawn, atomic patch workflow, browser CDP adapter, and the WorkspaceWriter boundary (ADR-0006 / ADR-0017). Not published independently.",
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "private": true,
42
42
  "peerDependencies": {
43
- "@oscharko-dev/keiko-contracts": "1.1.6",
44
- "@oscharko-dev/keiko-git": "1.1.6",
45
- "@oscharko-dev/keiko-sandbox": "1.1.6",
46
- "@oscharko-dev/keiko-security": "1.1.6",
47
- "@oscharko-dev/keiko-workspace": "1.1.6",
48
- "@oscharko-dev/keiko-tool-catalog": "1.1.6"
43
+ "@oscharko-dev/keiko-contracts": "1.1.7",
44
+ "@oscharko-dev/keiko-git": "1.1.7",
45
+ "@oscharko-dev/keiko-sandbox": "1.1.7",
46
+ "@oscharko-dev/keiko-security": "1.1.7",
47
+ "@oscharko-dev/keiko-workspace": "1.1.7",
48
+ "@oscharko-dev/keiko-tool-catalog": "1.1.7"
49
49
  }
50
50
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-verification",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Internal verification package: deterministic verification orchestrator — plan construction, resource-limit policy, best-effort memory monitoring, command classification, and audit/Markdown summaries (ADR-0007, ADR-0019). Not published independently.",
@@ -21,9 +21,9 @@
21
21
  },
22
22
  "private": true,
23
23
  "peerDependencies": {
24
- "@oscharko-dev/keiko-contracts": "1.1.6",
25
- "@oscharko-dev/keiko-security": "1.1.6",
26
- "@oscharko-dev/keiko-tools": "1.1.6",
27
- "@oscharko-dev/keiko-workspace": "1.1.6"
24
+ "@oscharko-dev/keiko-contracts": "1.1.7",
25
+ "@oscharko-dev/keiko-security": "1.1.7",
26
+ "@oscharko-dev/keiko-tools": "1.1.7",
27
+ "@oscharko-dev/keiko-workspace": "1.1.7"
28
28
  }
29
29
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-workflows",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Internal workflows package: reviewable developer-assist workflows (unit-test generation, bug investigation), prompts/parsers/guards/report rendering, apply-mode verification gating, and UI descriptors (ADR-0008 + ADR-0009 + ADR-0019). Not published independently.",
@@ -25,14 +25,14 @@
25
25
  },
26
26
  "private": true,
27
27
  "peerDependencies": {
28
- "@oscharko-dev/keiko-contracts": "1.1.6",
29
- "@oscharko-dev/keiko-security": "1.1.6",
30
- "@oscharko-dev/keiko-model-gateway": "1.1.6",
31
- "@oscharko-dev/keiko-workspace": "1.1.6",
32
- "@oscharko-dev/keiko-tools": "1.1.6",
33
- "@oscharko-dev/keiko-evidence": "1.1.6",
34
- "@oscharko-dev/keiko-verification": "1.1.6",
35
- "@oscharko-dev/keiko-harness": "1.1.6",
36
- "@oscharko-dev/keiko-quality-intelligence": "1.1.6"
28
+ "@oscharko-dev/keiko-contracts": "1.1.7",
29
+ "@oscharko-dev/keiko-security": "1.1.7",
30
+ "@oscharko-dev/keiko-model-gateway": "1.1.7",
31
+ "@oscharko-dev/keiko-workspace": "1.1.7",
32
+ "@oscharko-dev/keiko-tools": "1.1.7",
33
+ "@oscharko-dev/keiko-evidence": "1.1.7",
34
+ "@oscharko-dev/keiko-verification": "1.1.7",
35
+ "@oscharko-dev/keiko-harness": "1.1.7",
36
+ "@oscharko-dev/keiko-quality-intelligence": "1.1.7"
37
37
  }
38
38
  }
@@ -1,2 +1,2 @@
1
- export declare const KEIKO_WORKSPACE_VERSION: "1.1.6";
1
+ export declare const KEIKO_WORKSPACE_VERSION: "1.1.7";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Version identifier for the workspace package. Pattern matches keiko-contracts /
2
2
  // keiko-security / keiko-model-gateway: keep the literal type via `as const` so
3
3
  // downstream assertions can pin on the exact string.
4
- export const KEIKO_WORKSPACE_VERSION = "1.1.6";
4
+ export const KEIKO_WORKSPACE_VERSION = "1.1.7";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscharko-dev/keiko-workspace",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Internal workspace package: Keiko repository context and workspace access — detection, safe reads, path containment, deny/ignore rules, context packs, retrieval, and summaries. Not published independently.",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "private": true,
70
70
  "peerDependencies": {
71
- "@oscharko-dev/keiko-contracts": "1.1.6",
72
- "@oscharko-dev/keiko-security": "1.1.6"
71
+ "@oscharko-dev/keiko-contracts": "1.1.7",
72
+ "@oscharko-dev/keiko-security": "1.1.7"
73
73
  }
74
74
  }