@smartergpt/lexrunner 1.0.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1433) hide show
  1. package/CHANGELOG.md +84 -1
  2. package/LICENSE.md +110 -0
  3. package/README.mcp.md +10 -9
  4. package/README.md +127 -1012
  5. package/dist/adapters-DciX_uRh.d.ts +331 -0
  6. package/dist/{api-7H7SJZIX.js → api-QBPBKYOC.js} +1 -1
  7. package/dist/{audit-2TZ2LU72.js → audit-5ZUBPZZX.js} +2 -2
  8. package/dist/{autopilot-AL5F5AUS.js → autopilot-APNRAJTS.js} +7 -6
  9. package/dist/chunk-6HASN2LZ.js +5584 -0
  10. package/dist/{chunk-Q6Y524KH.js → chunk-6TB2UCBZ.js} +5 -179
  11. package/{src/monitoring/metrics.ts → dist/chunk-AXOAVRTU.js} +35 -100
  12. package/dist/{chunk-UZFYNSMJ.js → chunk-L7YDEIPO.js} +428 -133
  13. package/dist/{chunk-GTP4OHD7.js → chunk-R4DWK6FE.js} +2 -2
  14. package/dist/chunk-TPVORFSN.js +629 -0
  15. package/dist/{chunk-2ESYSVXG.js → chunk-V3BU2VDU.js} +7 -17
  16. package/dist/{chunk-4RVZNLD4.js → chunk-WFN4JTZI.js} +0 -88
  17. package/dist/cli.cjs +42537 -25131
  18. package/dist/cli.d.ts +4027 -272
  19. package/dist/cli.js +22696 -10921
  20. package/dist/{commandValidator-AT5OYZFC.js → commandValidator-VHBB2H3K.js} +2 -2
  21. package/dist/{constraints-M52FVL2X.js → constraints-V4VWCWR5.js} +2 -2
  22. package/dist/errors/index.cjs +865 -0
  23. package/dist/errors/index.d.ts +115 -0
  24. package/dist/errors/index.js +73 -0
  25. package/dist/frames/index.cjs +11992 -0
  26. package/dist/frames/index.d.ts +278 -0
  27. package/dist/frames/index.js +51 -0
  28. package/dist/{gateMapping-E5MGNJH5.js → gateMapping-R3RJYKMS.js} +1 -1
  29. package/dist/hooks/events.cjs +288 -0
  30. package/dist/hooks/events.d.ts +497 -0
  31. package/dist/hooks/events.js +242 -0
  32. package/dist/{jsonEnvelope-R4SWKX2N.js → jsonEnvelope-K2U5CWKU.js} +1 -1
  33. package/dist/{mergeTreeSimulator-X4BA647P.js → mergeTreeSimulator-QCFSOU25.js} +1 -1
  34. package/dist/package-schemas/behavior-rule.cjs +61 -0
  35. package/{.smartergpt/schemas/behavior-rule.schema.d.ts → dist/package-schemas/behavior-rule.d.ts} +8 -6
  36. package/dist/package-schemas/behavior-rule.js +35 -0
  37. package/dist/package-schemas/execution-plan-v1.cjs +69 -0
  38. package/{.smartergpt/schemas → dist/package-schemas}/execution-plan-v1.d.ts +7 -5
  39. package/dist/package-schemas/execution-plan-v1.js +42 -0
  40. package/dist/package-schemas/gates.cjs +45 -0
  41. package/{.smartergpt/schemas/gates.schema.d.ts → dist/package-schemas/gates.d.ts} +7 -5
  42. package/dist/package-schemas/gates.js +19 -0
  43. package/dist/package-schemas/runner-scope.cjs +50 -0
  44. package/{.smartergpt/schemas/runner.scope.schema.d.ts → dist/package-schemas/runner-scope.d.ts} +8 -6
  45. package/dist/package-schemas/runner-scope.js +24 -0
  46. package/dist/package-schemas/runner-stack.cjs +46 -0
  47. package/{.smartergpt/schemas/runner.stack.schema.d.ts → dist/package-schemas/runner-stack.d.ts} +7 -5
  48. package/dist/package-schemas/runner-stack.js +20 -0
  49. package/dist/{planDiff-QOK6KNB7.js → planDiff-IHLFNZUT.js} +1 -1
  50. package/dist/{planHistory-DQRSB2Y7.js → planHistory-GLRI356L.js} +1 -1
  51. package/dist/{planReview-7VB3OYKZ.js → planReview-LQM6AUBE.js} +4 -3
  52. package/dist/{planViewer-UIPOSRVW.js → planViewer-57DTN5YT.js} +4 -3
  53. package/dist/{sarif-XIREI5B5.js → sarif-2C6RKOUX.js} +1 -1
  54. package/dist/sdk/index.cjs +556 -0
  55. package/dist/sdk/index.d.ts +1277 -0
  56. package/dist/sdk/index.js +503 -0
  57. package/dist/{security-YDLHSMVY.js → security-BKLPEVOC.js} +2 -2
  58. package/dist/{signing-JJJOUGCW.js → signing-KLZYZZMP.js} +1 -1
  59. package/dist/types-CYMIAhy8.d.ts +266 -0
  60. package/dist/{verify-SCUHB3SA.js → verify-3UVMA62I.js} +1 -1
  61. package/mcp-server.mjs +298 -336
  62. package/package.json +52 -22
  63. package/.changes/ci-debug-added.txt +0 -1
  64. package/.changeset/tsconfig-solution-build.md +0 -5
  65. package/.editorconfig +0 -9
  66. package/.env.example +0 -8
  67. package/.github/COST_EFFICIENCY.md +0 -60
  68. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
  69. package/.github/ISSUE_TEMPLATE/epic.yml +0 -123
  70. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
  71. package/.github/ISSUE_TEMPLATE/issue-A1-gate-input-validation.md +0 -380
  72. package/.github/ISSUE_TEMPLATE/issue-B1-scope-validation.md +0 -509
  73. package/.github/ISSUE_TEMPLATE/issue-C1-command-whitelist.md +0 -463
  74. package/.github/ISSUE_TEMPLATE/subtask.yml +0 -153
  75. package/.github/PULL_REQUEST_TEMPLATE.md +0 -9
  76. package/.github/copilot-instructions-old.md +0 -429
  77. package/.github/copilot-instructions.md +0 -33
  78. package/.github/instructions/tests.instructions.md +0 -10
  79. package/.github/workflows/auto-delete-merged-branches.yml +0 -103
  80. package/.github/workflows/benchmarks.yml +0 -72
  81. package/.github/workflows/ci-debug.yml +0 -33
  82. package/.github/workflows/ci.yml +0 -167
  83. package/.github/workflows/cli-smoke-test.yml +0 -345
  84. package/.github/workflows/copilot-setup-steps.yml +0 -20
  85. package/.github/workflows/frame-emission-gate.yml +0 -242
  86. package/.github/workflows/project-auto.yml +0 -24
  87. package/.github/workflows/release.yml +0 -260
  88. package/.github/workflows/slow-cli-tests.yml +0 -37
  89. package/.github/workflows/tag-guard.yml +0 -44
  90. package/.husky/pre-commit +0 -1
  91. package/.nvmrc +0 -2
  92. package/.prettierignore +0 -28
  93. package/.prettierrc.json +0 -10
  94. package/.smartergpt/CONTROL_DECK_VISION.md +0 -226
  95. package/.smartergpt/allowed-commands.json +0 -41
  96. package/.smartergpt/allowed-commands.strict.json +0 -56
  97. package/.smartergpt/deliverables/.live.md +0 -426
  98. package/.smartergpt/deliverables/ISSUE_STATUS_2025-12-28.md +0 -193
  99. package/.smartergpt/deliverables/_research/snapshot-contract-feedback/ADR_DISCUSSION.md +0 -379
  100. package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_claude-haiku.md +0 -109
  101. package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_gemini-flash.md +0 -42
  102. package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_gpt-codex-mini.md +0 -19
  103. package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_raptor-mini.md +0 -37
  104. package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Question.md +0 -37
  105. package/.smartergpt/deliverables/merge-weave-04469e41-24ba-4ed5-b0ff-13c7ea12858d.ndjson +0 -2
  106. package/.smartergpt/deps.yml +0 -3
  107. package/.smartergpt/docs/fanout-templates.md +0 -213
  108. package/.smartergpt/docs/merge-weave-interventions.md +0 -261
  109. package/.smartergpt/docs/test-fix-patterns.md +0 -240
  110. package/.smartergpt/fanout-templates.yml +0 -263
  111. package/.smartergpt/gates.yml +0 -9
  112. package/.smartergpt/intent.md +0 -1
  113. package/.smartergpt/issues/QOL-001-analysis-script-filtering.md +0 -36
  114. package/.smartergpt/issues/QOL-002-log-retention-policy.md +0 -92
  115. package/.smartergpt/issues/QOL-003-realtime-console-feedback.md +0 -44
  116. package/.smartergpt/issues/QOL-004-governance-report-cli.md +0 -44
  117. package/.smartergpt/issues/QOL-005-schema-versioning.md +0 -46
  118. package/.smartergpt/issues/QOL-006-debug-verbose-mode.md +0 -45
  119. package/.smartergpt/issues/QOL-COMPLETION-REPORT.md +0 -359
  120. package/.smartergpt/issues/QOL-REVIEW-SUMMARY.md +0 -111
  121. package/.smartergpt/issues/QOL-ROADMAP.md +0 -71
  122. package/.smartergpt/merge-policy.yml +0 -41
  123. package/.smartergpt/merge-weave-policy.yml +0 -255
  124. package/.smartergpt/o1.json +0 -0
  125. package/.smartergpt/o2.json +0 -0
  126. package/.smartergpt/personas/eager-pm.md +0 -123
  127. package/.smartergpt/personas/example.md +0 -81
  128. package/.smartergpt/personas/senior-dev.md +0 -107
  129. package/.smartergpt/profile.yml +0 -2
  130. package/.smartergpt/prompts/create-project.md +0 -112
  131. package/.smartergpt/prompts/idea.md +0 -64
  132. package/.smartergpt/pull-request-template.md +0 -25
  133. package/.smartergpt/schemas/behavior-rule.schema.js +0 -56
  134. package/.smartergpt/schemas/behavior-rule.schema.json +0 -105
  135. package/.smartergpt/schemas/behavior-rule.schema.ts +0 -60
  136. package/.smartergpt/schemas/execution-plan-v1.js +0 -22
  137. package/.smartergpt/schemas/execution-plan-v1.json +0 -113
  138. package/.smartergpt/schemas/execution-plan-v1.ts +0 -32
  139. package/.smartergpt/schemas/execution-plan.schema.json +0 -116
  140. package/.smartergpt/schemas/feature-spec-v0.d.ts +0 -13
  141. package/.smartergpt/schemas/feature-spec-v0.js +0 -12
  142. package/.smartergpt/schemas/feature-spec-v0.json +0 -58
  143. package/.smartergpt/schemas/feature-spec-v0.ts +0 -16
  144. package/.smartergpt/schemas/feature-spec.schema.json +0 -111
  145. package/.smartergpt/schemas/gates.schema.js +0 -20
  146. package/.smartergpt/schemas/gates.schema.json +0 -47
  147. package/.smartergpt/schemas/gates.schema.ts +0 -26
  148. package/.smartergpt/schemas/idea.schema.json +0 -81
  149. package/.smartergpt/schemas/runner.scope.schema.js +0 -28
  150. package/.smartergpt/schemas/runner.scope.schema.json +0 -75
  151. package/.smartergpt/schemas/runner.scope.schema.ts +0 -36
  152. package/.smartergpt/schemas/runner.stack.schema.js +0 -21
  153. package/.smartergpt/schemas/runner.stack.schema.json +0 -51
  154. package/.smartergpt/schemas/runner.stack.schema.ts +0 -27
  155. package/.smartergpt/scope.yml +0 -11
  156. package/.smartergpt/stack.yml +0 -16
  157. package/.smartergpt/test-fix-patterns.yml +0 -106
  158. package/.tool-versions +0 -13
  159. package/AGENTS.md +0 -402
  160. package/CLAUDE.md +0 -484
  161. package/CONTRIBUTING.md +0 -345
  162. package/EAGER_PM_FANOUT_ANALYSIS.md +0 -283
  163. package/FAQ.md +0 -292
  164. package/FIXTURE_LIBRARY_SUMMARY.md +0 -327
  165. package/IMPLEMENTATION_SUMMARY.md +0 -222
  166. package/LICENSE +0 -21
  167. package/MANUAL_TEST_GUIDE.md +0 -229
  168. package/MCP-ALIGNMENT-SUMMARY.md +0 -261
  169. package/MCP-CONFIG.md +0 -125
  170. package/MERGE_WEAVE_QUICKSTART.md +0 -450
  171. package/MERGE_WEAVE_SUMMARY.md +0 -259
  172. package/MERGE_WEAVE_USAGE_GUIDE.md +0 -368
  173. package/TEST_INFRASTRUCTURE_ASSESSMENT.md +0 -225
  174. package/bootstrap-lexrunner.sh +0 -396
  175. package/dist/api-U3X2WA6D.js +0 -15
  176. package/dist/audit-5HH5BMKI.js +0 -60
  177. package/dist/audit-6K5K333I.js +0 -60
  178. package/dist/audit-DYQWS57J.js +0 -60
  179. package/dist/audit-JBWZ2GZ2.js +0 -60
  180. package/dist/audit-SJF3434D.js +0 -60
  181. package/dist/audit-TICGGVX5.js +0 -60
  182. package/dist/audit-YOBB27PY.js +0 -60
  183. package/dist/autopilot-3GAVXWWC.js +0 -45
  184. package/dist/autopilot-43NOYVQA.js +0 -45
  185. package/dist/autopilot-4UA3OWLU.js +0 -45
  186. package/dist/autopilot-54TK5CCG.js +0 -45
  187. package/dist/autopilot-5BHC2UQT.js +0 -45
  188. package/dist/autopilot-ABZUCVGY.js +0 -45
  189. package/dist/autopilot-ACJZP47Y.js +0 -45
  190. package/dist/autopilot-BO67FWUC.js +0 -45
  191. package/dist/autopilot-BR6W4GEX.js +0 -45
  192. package/dist/autopilot-FOR2UKRY.js +0 -45
  193. package/dist/autopilot-GDTTXHEQ.js +0 -45
  194. package/dist/autopilot-GEAMFZBM.js +0 -45
  195. package/dist/autopilot-HDMBRZE6.js +0 -45
  196. package/dist/autopilot-IKI2Y6S4.js +0 -44
  197. package/dist/autopilot-ILTBWWOL.js +0 -46
  198. package/dist/autopilot-KI3MXIFI.js +0 -44
  199. package/dist/autopilot-LWNPZC3J.js +0 -45
  200. package/dist/autopilot-LXPJ4ZXF.js +0 -45
  201. package/dist/autopilot-MDIFIONK.js +0 -46
  202. package/dist/autopilot-NW3LDP6M.js +0 -45
  203. package/dist/autopilot-OKTSCG35.js +0 -45
  204. package/dist/autopilot-OR5PF5PD.js +0 -45
  205. package/dist/autopilot-PE65SBGN.js +0 -45
  206. package/dist/autopilot-PW7I4B6W.js +0 -45
  207. package/dist/autopilot-QMLBL5P6.js +0 -45
  208. package/dist/autopilot-QSN6ZU5O.js +0 -45
  209. package/dist/autopilot-R7EZJOGI.js +0 -46
  210. package/dist/autopilot-T544CPPD.js +0 -44
  211. package/dist/autopilot-TNQB6VGJ.js +0 -44
  212. package/dist/autopilot-UVIYCR6K.js +0 -45
  213. package/dist/autopilot-W3ZTTSH3.js +0 -45
  214. package/dist/autopilot-XPKWOFXO.js +0 -44
  215. package/dist/autopilot-XRX4QWRM.js +0 -44
  216. package/dist/autopilot-Y3BAGNI5.js +0 -44
  217. package/dist/autopilot-ZE64XW2K.js +0 -44
  218. package/dist/chunk-2VR554P7.js +0 -668
  219. package/dist/chunk-37DOWIVT.js +0 -1084
  220. package/dist/chunk-3DU2DWUP.js +0 -400
  221. package/dist/chunk-3DVXIZFM.js +0 -11166
  222. package/dist/chunk-3FABZF4V.js +0 -811
  223. package/dist/chunk-4GEC4HC3.js +0 -11221
  224. package/dist/chunk-5CGWZH5X.js +0 -340
  225. package/dist/chunk-5QKWKK4M.js +0 -11794
  226. package/dist/chunk-5Z3XHND7.js +0 -11755
  227. package/dist/chunk-6YC2VSLE.js +0 -11252
  228. package/dist/chunk-7C4K2SHD.js +0 -668
  229. package/dist/chunk-ANXY4RGA.js +0 -11091
  230. package/dist/chunk-ASHKNUBR.js +0 -11312
  231. package/dist/chunk-B3OYDPOP.js +0 -11793
  232. package/dist/chunk-DBH7SQ2S.js +0 -1084
  233. package/dist/chunk-DEI7A5B4.js +0 -11449
  234. package/dist/chunk-EQKFCZLH.js +0 -9823
  235. package/dist/chunk-FAIJPBT5.js +0 -40
  236. package/dist/chunk-FDDKUDXR.js +0 -11166
  237. package/dist/chunk-FEAR6ETG.js +0 -438
  238. package/dist/chunk-FXL74C73.js +0 -523
  239. package/dist/chunk-GLJEDX4L.js +0 -10247
  240. package/dist/chunk-HIHH7IVO.js +0 -10557
  241. package/dist/chunk-I3VXUVCB.js +0 -10474
  242. package/dist/chunk-I6BIFVWI.js +0 -10519
  243. package/dist/chunk-I72TRUTJ.js +0 -1084
  244. package/dist/chunk-J5B5KT2F.js +0 -368
  245. package/dist/chunk-JMTULZ66.js +0 -11743
  246. package/dist/chunk-JXIQ7HCK.js +0 -11166
  247. package/dist/chunk-K6HVPBDP.js +0 -10692
  248. package/dist/chunk-KBT5Y666.js +0 -521
  249. package/dist/chunk-LETPROKG.js +0 -11092
  250. package/dist/chunk-LLMY2BZF.js +0 -1084
  251. package/dist/chunk-NMNL4US2.js +0 -1084
  252. package/dist/chunk-O2XRP7JK.js +0 -10247
  253. package/dist/chunk-OGPWLFFO.js +0 -11201
  254. package/dist/chunk-OQJUWTZV.js +0 -51
  255. package/dist/chunk-PJRWPLQ6.js +0 -669
  256. package/dist/chunk-PYRVUCJR.js +0 -370
  257. package/dist/chunk-QF7DM5VW.js +0 -106
  258. package/dist/chunk-QGM4M3NI.js +0 -37
  259. package/dist/chunk-QIIELFTL.js +0 -1107
  260. package/dist/chunk-QUW6N7GR.js +0 -10264
  261. package/dist/chunk-QZASNLQX.js +0 -11223
  262. package/dist/chunk-RMN4IAWO.js +0 -11808
  263. package/dist/chunk-RN5NHU37.js +0 -11465
  264. package/dist/chunk-RNG3RILO.js +0 -11755
  265. package/dist/chunk-RSA6DEB4.js +0 -9748
  266. package/dist/chunk-RURYWSMX.js +0 -10524
  267. package/dist/chunk-SUEXK5U7.js +0 -11201
  268. package/dist/chunk-TVUF55OH.js +0 -11807
  269. package/dist/chunk-U62I2R2D.js +0 -434
  270. package/dist/chunk-UNZBDSEU.js +0 -11166
  271. package/dist/chunk-VP37GLU6.js +0 -1084
  272. package/dist/chunk-W6WDKBWO.js +0 -11453
  273. package/dist/chunk-XBKUFNVF.js +0 -10745
  274. package/dist/chunk-XOLVQTIE.js +0 -670
  275. package/dist/chunk-YABA7DB6.js +0 -11091
  276. package/dist/chunk-YWCJX5KL.js +0 -10557
  277. package/dist/chunk-Z5GP7FSR.js +0 -309
  278. package/dist/chunk-ZBT3DATZ.js +0 -296
  279. package/dist/chunk-ZDBAZXUQ.js +0 -11201
  280. package/dist/chunk-ZEMABYS4.js +0 -92
  281. package/dist/chunk-ZOA4HT7P.js +0 -662
  282. package/dist/cli.d.cts +0 -2709
  283. package/dist/commandValidator-42OUDFZ4.js +0 -140
  284. package/dist/commandValidator-7LQHTYL5.js +0 -140
  285. package/dist/commandValidator-DH3CX2OW.js +0 -140
  286. package/dist/commandValidator-GCQC7H4A.js +0 -140
  287. package/dist/commandValidator-K6VWB6O3.js +0 -140
  288. package/dist/commandValidator-L6WNDBYB.js +0 -129
  289. package/dist/commandValidator-O3KSNXD2.js +0 -140
  290. package/dist/commandValidator-ZHMUA5RQ.js +0 -140
  291. package/dist/dist-CSOR2BL2.js +0 -1144
  292. package/dist/dist-PKOIS5NZ.js +0 -1144
  293. package/dist/fileAnalysis-3VMDDJ6I.js +0 -9
  294. package/dist/fileAnalysis-4QLHUT44.js +0 -9
  295. package/dist/fileAnalysis-H6M2Z7ZC.js +0 -9
  296. package/dist/fileAnalysis-HMI7IL6S.js +0 -9
  297. package/dist/fileAnalysis-JHABOPUQ.js +0 -9
  298. package/dist/mergeTreeSimulator-ATOPJ3DU.js +0 -11
  299. package/dist/mergeTreeSimulator-AYUK4TZT.js +0 -11
  300. package/dist/mergeTreeSimulator-BBWJUQBK.js +0 -11
  301. package/dist/mergeTreeSimulator-DJJDRB5N.js +0 -11
  302. package/dist/planDiff-37QHCPKO.js +0 -109
  303. package/dist/planDiff-BQHIUARB.js +0 -109
  304. package/dist/planDiff-RXR4CWFS.js +0 -109
  305. package/dist/planDiff-W2BTH2MU.js +0 -109
  306. package/dist/planHistory-4J3Q6AJ3.js +0 -126
  307. package/dist/planHistory-GLCXP6AB.js +0 -126
  308. package/dist/planHistory-SMNRLEKG.js +0 -126
  309. package/dist/planHistory-UO4WZ6GO.js +0 -126
  310. package/dist/planReview-7BWVLABC.js +0 -377
  311. package/dist/planReview-FAIBIAE6.js +0 -377
  312. package/dist/planReview-FXQBDNKJ.js +0 -376
  313. package/dist/planReview-HO4YYETA.js +0 -377
  314. package/dist/planReview-I26EKCUK.js +0 -376
  315. package/dist/planReview-JBOAJHSU.js +0 -377
  316. package/dist/planReview-SCNZWC6B.js +0 -376
  317. package/dist/planReview-TU7LMZIY.js +0 -376
  318. package/dist/planViewer-2YZCPVDM.js +0 -155
  319. package/dist/planViewer-72WZFUTU.js +0 -154
  320. package/dist/planViewer-G546TVHV.js +0 -154
  321. package/dist/planViewer-I7ZHNJQF.js +0 -150
  322. package/dist/planViewer-IRXHOY5U.js +0 -155
  323. package/dist/planViewer-IX2ICW45.js +0 -154
  324. package/dist/planViewer-PDWPUOP6.js +0 -155
  325. package/dist/planViewer-PEOADAGZ.js +0 -155
  326. package/dist/planViewer-PFYDEG6V.js +0 -150
  327. package/dist/planViewer-V2JUKV7Q.js +0 -154
  328. package/dist/sarif-46TKOOJZ.js +0 -9
  329. package/dist/sarif-63JKTFFI.js +0 -9
  330. package/dist/sarif-CIYIWUNC.js +0 -9
  331. package/dist/sarif-OGAGDL6B.js +0 -9
  332. package/dist/security-3V6FKJDA.js +0 -423
  333. package/dist/security-4JMEUM56.js +0 -423
  334. package/dist/security-QHPEWY5G.js +0 -423
  335. package/dist/security-V2LAL5TP.js +0 -415
  336. package/dist/security-WTASK6T6.js +0 -423
  337. package/dist/security-XE4GHVJD.js +0 -423
  338. package/dist/security-XLXM3UHT.js +0 -423
  339. package/dist/security-ZDAEZF7D.js +0 -423
  340. package/dist/signing-3EI734L4.js +0 -14
  341. package/dist/signing-5G7K6JXJ.js +0 -14
  342. package/dist/signing-7DK7SABM.js +0 -14
  343. package/dist/signing-OAJ3MXGA.js +0 -14
  344. package/dist/verify-5F6PUXUQ.js +0 -62
  345. package/dist/verify-5ILURHV2.js +0 -62
  346. package/dist/verify-MRDZJUGO.js +0 -62
  347. package/dist/verify-YZRHN2D3.js +0 -62
  348. package/docs/1.0.0-vertical-slice.md +0 -214
  349. package/docs/ADR-007-INTEGRATION-SUMMARY.md +0 -232
  350. package/docs/ALIASING_FOR_LEXRUNNER.md +0 -709
  351. package/docs/ALIASING_FOR_RUNNER.md +0 -552
  352. package/docs/AX.md +0 -317
  353. package/docs/CHECKPOINT_RESUME.md +0 -208
  354. package/docs/CLI_VERBS.md +0 -219
  355. package/docs/CONFLICT_DETECTION.md +0 -198
  356. package/docs/DISCIPLINED_FAILURE.md +0 -224
  357. package/docs/ENVIRONMENT_QUALITY.md +0 -155
  358. package/docs/ERROR_CODES.md +0 -528
  359. package/docs/EVENT_SCHEMA.md +0 -659
  360. package/docs/EXE-012-investigation-summary.md +0 -300
  361. package/docs/GATE_ATTESTATION_GUIDE.md +0 -237
  362. package/docs/JSON_OUTPUT_SCHEMAS.md +0 -347
  363. package/docs/LEXRUNNER_ALIASING.md +0 -444
  364. package/docs/LEX_INTEGRATION.md +0 -83
  365. package/docs/LEX_PUBLIC_API.md +0 -306
  366. package/docs/LICENSING.md +0 -119
  367. package/docs/MCP-CLI-PARITY.md +0 -410
  368. package/docs/MCP-MIGRATION.md +0 -258
  369. package/docs/MCP-PARITY.md +0 -234
  370. package/docs/MEMORY_TOOLS.md +0 -278
  371. package/docs/MERGE_WEAVE_SETUP.md +0 -643
  372. package/docs/MIGRATION_v0.1.md +0 -760
  373. package/docs/NAMING_CONVENTIONS.md +0 -82
  374. package/docs/PERSONA_FOUNDATION.md +0 -124
  375. package/docs/PHASE3_MEMORY_GUIDE.md +0 -122
  376. package/docs/PLAN_LOCK.md +0 -114
  377. package/docs/README.md +0 -289
  378. package/docs/RUNNER_LIFECYCLE.md +0 -257
  379. package/docs/SAFETY_MECHANISMS.md +0 -325
  380. package/docs/SECURITY_IMPLEMENTATION.md +0 -535
  381. package/docs/TERMS.md +0 -34
  382. package/docs/TOKEN_TRACKING.md +0 -162
  383. package/docs/WORKFLOW_GUIDANCE.md +0 -277
  384. package/docs/adr/ADR-000-product-naming-and-branding.md +0 -115
  385. package/docs/adr/ADR-001-plan-json-frozen-input.md +0 -68
  386. package/docs/adr/ADR-002-two-track-separation.md +0 -84
  387. package/docs/adr/ADR-003-gate-uniform-execution.md +0 -69
  388. package/docs/adr/ADR-004-runner-state-model.md +0 -75
  389. package/docs/adr/ADR-005-merge-pyramid-ordering.md +0 -87
  390. package/docs/adr/ADR-006-schema-versioning-semver.md +0 -81
  391. package/docs/adr/ADR-007-task-snapshot-contract.md +0 -503
  392. package/docs/adr/ADR-008-lex-packaging.md +0 -243
  393. package/docs/adr/ADR-009-ax-test-output-adapters.md +0 -440
  394. package/docs/adr/README.md +0 -32
  395. package/docs/advanced-cli.md +0 -436
  396. package/docs/agent-stall-detection.md +0 -278
  397. package/docs/architecture/executors.md +0 -190
  398. package/docs/architecture.md +0 -316
  399. package/docs/attestation/AX-SHARED-PLEDGE.md +0 -83
  400. package/docs/attestation/AX-SHARED-PLEDGE_v1.0.0.md +0 -99
  401. package/docs/attestation/AX-SHARED-PLEDGE_v1.0.0_VERIFICATION.md +0 -115
  402. package/docs/attestation/Lex_Guff_Version_Contract_Pact_v1.0.0.md +0 -181
  403. package/docs/attestation/README.md +0 -87
  404. package/docs/attestation/ax_pledge_2025-12-02.ots +0 -0
  405. package/docs/attestation/ax_pledge_timestamp_response.tsr +0 -0
  406. package/docs/attestation/copilot_summarization_2025-12-01.ots +0 -0
  407. package/docs/attestation/copilot_summarization_2025-12-01_VERIFICATION.md +0 -100
  408. package/docs/attestation/copilot_summarization_behavior_observation_2025-12-01.md +0 -85
  409. package/docs/attestation/copilot_summarization_screenshot_2025-12-01.png +0 -0
  410. package/docs/attestation/employment_separation_2025-11-26.ots +0 -0
  411. package/docs/attestation/employment_timestamp_response.tsr +0 -0
  412. package/docs/attestation/freetsa_cacert.pem +0 -45
  413. package/docs/attestation/freetsa_tsa.crt +0 -45
  414. package/docs/attestation/lex_employment_separation_2025-11-26.md +0 -85
  415. package/docs/attestation/lex_employment_separation_2025-11-26_VERIFICATION.md +0 -126
  416. package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft.md +0 -350
  417. package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft.md.ots +0 -0
  418. package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft_VERIFICATION.md +0 -130
  419. package/docs/attestation/patent/README.md +0 -75
  420. package/docs/attestation/patent/fig1_write_path.svg +0 -58
  421. package/docs/attestation/patent/fig2_read_normalize_rollup.svg +0 -92
  422. package/docs/attestation/timestamp_response.tsr +0 -0
  423. package/docs/attribution-README.md +0 -264
  424. package/docs/audit-compliance.md +0 -283
  425. package/docs/audit-outputs.md +0 -1213
  426. package/docs/audit-sdk.md +0 -1134
  427. package/docs/autopilot-levels.md +0 -368
  428. package/docs/autopilot.md +0 -288
  429. package/docs/ci-cd-integration.md +0 -580
  430. package/docs/ci-integration-guide.md +0 -369
  431. package/docs/ci-version-validation.md +0 -198
  432. package/docs/cli-mcp-weave-reporting.md +0 -462
  433. package/docs/cli.md +0 -2262
  434. package/docs/cluster-gates-rollback.md +0 -222
  435. package/docs/command-creation-guide.md +0 -485
  436. package/docs/command-whitelist.md +0 -490
  437. package/docs/commands/idea.md +0 -253
  438. package/docs/config.md +0 -245
  439. package/docs/conflict-clustering.md +0 -225
  440. package/docs/conflict-predictor.md +0 -359
  441. package/docs/context-diet.md +0 -249
  442. package/docs/counter-examples.md +0 -199
  443. package/docs/create-project.md +0 -211
  444. package/docs/deliverables-generator.md +0 -299
  445. package/docs/deliverables-management.md +0 -474
  446. package/docs/dependency-parser.md +0 -354
  447. package/docs/determinism.md +0 -299
  448. package/docs/diffgraph-planner.md +0 -1211
  449. package/docs/dogfood/README.md +0 -33
  450. package/docs/dogfood/wave-3-results.md +0 -303
  451. package/docs/dogfood-merge-weave-script.md +0 -224
  452. package/docs/enterprise-onboarding.md +0 -291
  453. package/docs/environment-variables.md +0 -625
  454. package/docs/error-recovery.md +0 -466
  455. package/docs/errors.md +0 -288
  456. package/docs/executor-authoring.md +0 -854
  457. package/docs/executor-decoupling.md +0 -410
  458. package/docs/front-end-capture-pipeline.md +0 -312
  459. package/docs/gate-report-examples.md +0 -380
  460. package/docs/gates.md +0 -319
  461. package/docs/github-automation.md +0 -128
  462. package/docs/governance-metrics.md +0 -368
  463. package/docs/integrations/README.md +0 -588
  464. package/docs/interactive-plan-review.md +0 -493
  465. package/docs/issue-orchestration.md +0 -256
  466. package/docs/lex_ax_session_key_rememberings_v0.1.md +0 -195
  467. package/docs/lexrunner-v1-summary.md +0 -246
  468. package/docs/lexrunner-v2-contract.md +0 -404
  469. package/docs/lexrunner-v2-migration-plan.md +0 -388
  470. package/docs/lexrunner-v2-salvage-map.md +0 -355
  471. package/docs/lexsona-rules.md +0 -154
  472. package/docs/merge-weave-analysis.md +0 -403
  473. package/docs/merge-weave-quickstart.md +0 -770
  474. package/docs/merge-weave-state-machine.md +0 -390
  475. package/docs/migration-guide.md +0 -529
  476. package/docs/monitoring-examples.md +0 -470
  477. package/docs/monitoring-implementation.md +0 -252
  478. package/docs/orchestration.md +0 -234
  479. package/docs/performance-scale.md +0 -359
  480. package/docs/plan-generation.md +0 -407
  481. package/docs/profile-resolution.md +0 -455
  482. package/docs/prompts.md +0 -427
  483. package/docs/quickstart.md +0 -546
  484. package/docs/release-process.md +0 -310
  485. package/docs/sample-prompts/merge-weave/cli-merge-weave-kickoff.md +0 -274
  486. package/docs/sample-prompts/merge-weave/mcp-merge-weave-kickoff.md +0 -480
  487. package/docs/sample-prompts/merge-weave/standalone-merge-weave-kickoff.md +0 -237
  488. package/docs/schemas.md +0 -359
  489. package/docs/scope-validation.md +0 -444
  490. package/docs/security/rotation-guide.md +0 -325
  491. package/docs/specs/Meeting_Control_Stack_Concept_v0.1.0.md +0 -417
  492. package/docs/specs/git-feature-flag-redesign.md +0 -321
  493. package/docs/specs/lex-pr-brief-behavior.md +0 -269
  494. package/docs/specs/smartergpt-structure-v1.md +0 -705
  495. package/docs/specs/task-brief-v0.1.md +0 -224
  496. package/docs/store-architecture.md +0 -61
  497. package/docs/templates/CONTRIBUTING-merge-weave-section.md +0 -33
  498. package/docs/templates/gates.example.yml +0 -109
  499. package/docs/templates/plan.example.json +0 -77
  500. package/docs/thesis/00-EVOLUTION-NOTES.md +0 -383
  501. package/docs/thesis/01-CORE-THESIS.md +0 -285
  502. package/docs/thesis/02-TURN-COST.md +0 -498
  503. package/docs/thesis/03-PERMISSION-TO-FAIL.md +0 -581
  504. package/docs/thesis/04-CROSS-MODEL-CONTINUITY.md +0 -517
  505. package/docs/thesis/05-RULE-FILE-SPEC.md +0 -732
  506. package/docs/thesis/06-CAPABILITY-TIERS.md +0 -723
  507. package/docs/thesis/07-ROBERT-FIELD-REPORT.md +0 -433
  508. package/docs/thesis/08-IMPLEMENTATION-GUIDE.md +0 -1093
  509. package/docs/thesis/09-METRICS-AND-TELEMETRY.md +0 -793
  510. package/docs/thesis/10-FAILURE-MODES.md +0 -716
  511. package/docs/thesis/README.md +0 -151
  512. package/docs/thesis/lex_governance-collab_systems_paper_draft.md +0 -952
  513. package/docs/thesis/lex_governance-collab_systems_paper_draft.pdf +0 -0
  514. package/docs/tool-grounded/READINESS_ANALYSIS.md +0 -527
  515. package/docs/tool-grounded/enforcement.md +0 -361
  516. package/docs/tool-grounded/tool-grounded-a-view-from-the-inside.md +0 -437
  517. package/docs/tool-grounded/tool-grounded-prompt.md +0 -122
  518. package/docs/tool-grounded/tool-grounded-run-centric.md +0 -474
  519. package/docs/troubleshooting-planner.md +0 -910
  520. package/docs/troubleshooting.md +0 -745
  521. package/docs/tutorials/README.md +0 -201
  522. package/docs/tutorials/diffgraph-planner/01-simple-stack.md +0 -460
  523. package/docs/tutorials/diffgraph-planner/02-diamond-pattern.md +0 -431
  524. package/docs/tutorials/diffgraph-planner/03-large-batch.md +0 -525
  525. package/docs/tutorials/diffgraph-planner/04-fixing-cycles.md +0 -526
  526. package/docs/tutorials/diffgraph-planner/05-hybrid-workflow.md +0 -555
  527. package/docs/tutorials/quick-merge-pyramid.md +0 -364
  528. package/docs/tutorials/video-scripts/01-getting-started.md +0 -286
  529. package/docs/tutorials/video-scripts/02-understanding-dependencies.md +0 -376
  530. package/docs/weave-contract.md +0 -116
  531. package/docs/weave-execution-log.md +0 -153
  532. package/docs/workflows/README.md +0 -139
  533. package/docs/workflows/enterprise.md +0 -545
  534. package/docs/workflows/small-team.md +0 -398
  535. package/docs/workflows/solo-developer.md +0 -419
  536. package/dogfood-merge-weave.sh +0 -122
  537. package/examples/README.md +0 -22
  538. package/examples/WORKING_EXAMPLE.md +0 -309
  539. package/examples/analyze-pr-files.js +0 -100
  540. package/examples/autopilot-level4-example.md +0 -234
  541. package/examples/cluster-gates-demo.sh +0 -178
  542. package/examples/complete-security-workflow.ts +0 -248
  543. package/examples/error-recovery/README.md +0 -202
  544. package/examples/executor-manifest.example.yaml +0 -81
  545. package/examples/front-end-capture-pipeline/README.md +0 -99
  546. package/examples/front-end-capture-pipeline/create-project-example.sh +0 -83
  547. package/examples/front-end-capture-pipeline/idea-dark-mode.json +0 -14
  548. package/examples/front-end-capture-pipeline/idea-example.sh +0 -57
  549. package/examples/front-end-capture-pipeline/manual-test-checklist.md +0 -426
  550. package/examples/gates/README.md +0 -165
  551. package/examples/gates/lint-gate.sh +0 -40
  552. package/examples/gates/lint-gate.ts +0 -99
  553. package/examples/gates/test-runner.ts +0 -113
  554. package/examples/gates/vuln-scanner.ts +0 -95
  555. package/examples/github-integration/README.md +0 -111
  556. package/examples/github-integration/example-plan.json +0 -95
  557. package/examples/performance-config.md +0 -388
  558. package/examples/profile-setup/.gitignore.template +0 -66
  559. package/examples/profile-setup/.smartergpt-example/README.md +0 -190
  560. package/examples/profile-setup/.smartergpt.local-example/README.md +0 -365
  561. package/examples/profile-setup/README.md +0 -492
  562. package/examples/profile-setup/cross-repo-prompts/README.md +0 -606
  563. package/examples/safety-framework-demo.ts +0 -130
  564. package/examples/safety-mechanisms-example.ts +0 -191
  565. package/examples/sample-plan.json +0 -87
  566. package/examples/sample-stack.yml +0 -66
  567. package/examples/sarif/README.md +0 -224
  568. package/examples/scope-validation-demo.ts +0 -199
  569. package/examples/security-integration.ts +0 -293
  570. package/examples/token-tracking-example.ts +0 -71
  571. package/executors/senior-dev/ARCHITECTURE.md +0 -182
  572. package/executors/senior-dev/MEMORY_INTEGRATION.md +0 -236
  573. package/executors/senior-dev/QUICK_START.md +0 -145
  574. package/executors/senior-dev/README.md +0 -76
  575. package/executors/senior-dev/examples/sample-review-session.md +0 -228
  576. package/executors/senior-dev/executor-manifest.yaml +0 -79
  577. package/executors/senior-dev/prompts/code-review.prompt.md +0 -78
  578. package/executors/senior-dev/prompts/mentorship-feedback.prompt.md +0 -97
  579. package/executors/senior-dev/prompts/pattern-recognition.prompt.md +0 -80
  580. package/executors/senior-dev/prompts/pr-analysis.prompt.md +0 -75
  581. package/executors/senior-dev/scripts/capture-review-frame.sh +0 -129
  582. package/executors/senior-dev/scripts/prepare-review-context.sh +0 -61
  583. package/executors/senior-dev/scripts/recall-context.sh +0 -87
  584. package/lexrunner-launcher.sh +0 -12
  585. package/mcp-config-example.json +0 -14
  586. package/merge-weave-current-prs.md +0 -170
  587. package/merge-weave-dogfood.json +0 -46
  588. package/merge-weave-plan.json +0 -56
  589. package/procedures/merge-weave-main.yaml +0 -90
  590. package/procedures/pr-review.yaml +0 -68
  591. package/project/README.md +0 -50
  592. package/prompts/tool-grounded-mode.md +0 -185
  593. package/scripts/README.md +0 -354
  594. package/scripts/analyze-governance-logs.mjs +0 -51
  595. package/scripts/benchmark-ci.ts +0 -339
  596. package/scripts/check-determinism.sh +0 -23
  597. package/scripts/check-license-compliance.mjs +0 -319
  598. package/scripts/check-release-drift.mjs +0 -81
  599. package/scripts/ci-debug.sh +0 -24
  600. package/scripts/ci-smoke.mjs +0 -304
  601. package/scripts/create-sample-repo.sh +0 -245
  602. package/scripts/dogfood-merge-weave.sh +0 -552
  603. package/scripts/gen_mcp_servers.py +0 -252
  604. package/scripts/generate-executor-manifest-schema.ts +0 -30
  605. package/scripts/generate-flake-schema.ts +0 -32
  606. package/scripts/generate-gate-schema.ts +0 -32
  607. package/scripts/generate-plan-schema.ts +0 -30
  608. package/scripts/generate-run-schemas.ts +0 -69
  609. package/scripts/load-prompt.mjs +0 -147
  610. package/scripts/merge-weave-wrapper.sh +0 -445
  611. package/scripts/merge-weave.sh +0 -489
  612. package/scripts/metrics-template.ts +0 -134
  613. package/scripts/package-lex.sh +0 -267
  614. package/scripts/quick-start-merge-weave.sh +0 -218
  615. package/scripts/release-prepare.ts +0 -350
  616. package/scripts/rotate-secrets-example.ts +0 -134
  617. package/scripts/test-lexsona-shadow.mjs +0 -100
  618. package/scripts/validate-manifests.ts +0 -188
  619. package/scripts/verify-audit-phase2.js +0 -175
  620. package/src/ai/README.md +0 -456
  621. package/src/ai/conflictStrategy.ts +0 -223
  622. package/src/ai/conflictStrategyCache.ts +0 -164
  623. package/src/ai/conflictStrategyPrompt.ts +0 -128
  624. package/src/ai/conflictStrategySchema.ts +0 -165
  625. package/src/ai/heuristicFallback.ts +0 -162
  626. package/src/ai/index.ts +0 -64
  627. package/src/ai/riskScoring.ts +0 -174
  628. package/src/aliases/index.ts +0 -16
  629. package/src/aliases/resolver.ts +0 -212
  630. package/src/audit/context.ts +0 -284
  631. package/src/audit/emitter.ts +0 -685
  632. package/src/audit/events.ts +0 -210
  633. package/src/audit/gateMatrix.ts +0 -158
  634. package/src/audit/index.ts +0 -44
  635. package/src/audit/manifest.ts +0 -78
  636. package/src/audit/profiles.ts +0 -93
  637. package/src/audit/redaction.ts +0 -216
  638. package/src/audit/sarif.ts +0 -213
  639. package/src/audit/schema/events.ts +0 -366
  640. package/src/audit/schema/manifest.ts +0 -47
  641. package/src/audit/schema.ts +0 -159
  642. package/src/audit/sdk/index.ts +0 -145
  643. package/src/audit/sdk/types.ts +0 -88
  644. package/src/audit/sidecar.ts +0 -111
  645. package/src/audit/signing.ts +0 -521
  646. package/src/autopilot/README.md +0 -113
  647. package/src/autopilot/artifacts.ts +0 -287
  648. package/src/autopilot/base.ts +0 -132
  649. package/src/autopilot/deliverables.ts +0 -392
  650. package/src/autopilot/index.ts +0 -29
  651. package/src/autopilot/level1.ts +0 -187
  652. package/src/autopilot/level2.ts +0 -262
  653. package/src/autopilot/level3.ts +0 -263
  654. package/src/autopilot/level4.ts +0 -393
  655. package/src/autopilot/safety/README.md +0 -512
  656. package/src/autopilot/safety/SafetyFramework.ts +0 -634
  657. package/src/autopilot/safety/index.ts +0 -16
  658. package/src/autopilot/types.ts +0 -250
  659. package/src/budget/index.ts +0 -56
  660. package/src/budget/manager.ts +0 -547
  661. package/src/budget/schema.ts +0 -305
  662. package/src/budget/tracker.ts +0 -155
  663. package/src/cache/issue-cache.ts +0 -150
  664. package/src/cli/command-map.ts +0 -221
  665. package/src/cli/commands/gate/test.ts +0 -214
  666. package/src/cli/exitHandler.ts +0 -98
  667. package/src/cli/flags.ts +0 -123
  668. package/src/cli/formatSuggestions.ts +0 -202
  669. package/src/cli/formatters.ts +0 -294
  670. package/src/cli/jsonEnvelope.ts +0 -152
  671. package/src/cli/output.ts +0 -61
  672. package/src/cli/runnerLifecycle.ts +0 -118
  673. package/src/cli-audit.ts +0 -76
  674. package/src/cli-security.ts +0 -114
  675. package/src/cli.ts +0 -1231
  676. package/src/commands/audit/index.ts +0 -5
  677. package/src/commands/audit/verify.ts +0 -87
  678. package/src/commands/autopilot.ts +0 -131
  679. package/src/commands/budget.ts +0 -327
  680. package/src/commands/bulkOps.ts +0 -204
  681. package/src/commands/completion.ts +0 -287
  682. package/src/commands/config/validate.ts +0 -428
  683. package/src/commands/config.ts +0 -368
  684. package/src/commands/counterExamples.ts +0 -104
  685. package/src/commands/create-project.ts +0 -338
  686. package/src/commands/discover.ts +0 -192
  687. package/src/commands/doctor.ts +0 -436
  688. package/src/commands/execute.ts +0 -558
  689. package/src/commands/explain.ts +0 -157
  690. package/src/commands/fanout-analyze.ts +0 -684
  691. package/src/commands/fanout-harvest.ts +0 -328
  692. package/src/commands/fanout-monitor.ts +0 -224
  693. package/src/commands/gateAttest.ts +0 -95
  694. package/src/commands/gateImport.ts +0 -142
  695. package/src/commands/gateImportChecks.ts +0 -208
  696. package/src/commands/gateReport.ts +0 -184
  697. package/src/commands/governanceCleanup.ts +0 -171
  698. package/src/commands/governanceReport.ts +0 -497
  699. package/src/commands/guards.ts +0 -50
  700. package/src/commands/idea.ts +0 -281
  701. package/src/commands/init.ts +0 -414
  702. package/src/commands/issues.ts +0 -165
  703. package/src/commands/merge.ts +0 -677
  704. package/src/commands/mergeOrder.ts +0 -68
  705. package/src/commands/metrics.ts +0 -232
  706. package/src/commands/migrateProfile.ts +0 -187
  707. package/src/commands/orchestrate/analyze-issues.ts +0 -203
  708. package/src/commands/orchestrate/assign-batch.ts +0 -204
  709. package/src/commands/orchestrate/generate-deliverables.ts +0 -66
  710. package/src/commands/orchestrate/pinToolchain.ts +0 -102
  711. package/src/commands/orchestrate/plan-batch.ts +0 -119
  712. package/src/commands/orchestrate/predict-conflicts.ts +0 -210
  713. package/src/commands/orchestrate.ts +0 -186
  714. package/src/commands/plan.ts +0 -403
  715. package/src/commands/planDiff.ts +0 -56
  716. package/src/commands/planReview.ts +0 -112
  717. package/src/commands/planViewer.ts +0 -180
  718. package/src/commands/preview-constraints.ts +0 -97
  719. package/src/commands/query.ts +0 -313
  720. package/src/commands/report.ts +0 -56
  721. package/src/commands/retry.ts +0 -60
  722. package/src/commands/schema.ts +0 -128
  723. package/src/commands/security.ts +0 -140
  724. package/src/commands/seniorDev.ts +0 -326
  725. package/src/commands/status.ts +0 -97
  726. package/src/commands/tokenReport.ts +0 -167
  727. package/src/commands/validation.ts +0 -66
  728. package/src/commands/weave-checkpoints.ts +0 -145
  729. package/src/commands/weave-fanout.ts +0 -273
  730. package/src/commands/weave-policy.ts +0 -277
  731. package/src/commands/weave.ts +0 -518
  732. package/src/config/localOverlay.ts +0 -167
  733. package/src/config/pathResolver.ts +0 -106
  734. package/src/config/profileResolver.ts +0 -194
  735. package/src/config/promptsResolver.ts +0 -312
  736. package/src/config/rulesResolver.ts +0 -257
  737. package/src/config/schemas.ts +0 -142
  738. package/src/core/bootstrap.ts +0 -287
  739. package/src/core/enterprise.ts +0 -453
  740. package/src/core/errorRecovery.ts +0 -509
  741. package/src/core/githubPlan.ts +0 -282
  742. package/src/core/inputs.ts +0 -314
  743. package/src/core/multiRepoPlan.ts +0 -353
  744. package/src/core/plan.ts +0 -106
  745. package/src/core/snapshot.ts +0 -189
  746. package/src/errors/adapters.ts +0 -897
  747. package/src/errors/index.ts +0 -231
  748. package/src/executionState.ts +0 -356
  749. package/src/executors/README_FRAME_CONTRACT.md +0 -446
  750. package/src/executors/frameContract.ts +0 -270
  751. package/src/executors/guardrailEnforcement.ts +0 -294
  752. package/src/executors/seniorDev/core.ts +0 -548
  753. package/src/executors/seniorDev/index.ts +0 -30
  754. package/src/executors/seniorDev/types.ts +0 -176
  755. package/src/executors/toolBudget.ts +0 -194
  756. package/src/fanout/analyzer.ts +0 -735
  757. package/src/fanout/github-adapter.ts +0 -262
  758. package/src/fanout/harvest.ts +0 -517
  759. package/src/fanout/monitor.ts +0 -350
  760. package/src/fanout/types.ts +0 -428
  761. package/src/frames/controller.ts +0 -160
  762. package/src/frames/emitter.ts +0 -455
  763. package/src/frames/index.ts +0 -58
  764. package/src/frames/storage.ts +0 -203
  765. package/src/frames/types.ts +0 -258
  766. package/src/gates/checkRunConverter.ts +0 -91
  767. package/src/gates/test/adapters/errors.ts +0 -32
  768. package/src/gates/test/adapters/index.ts +0 -36
  769. package/src/gates/test/adapters/interface.ts +0 -63
  770. package/src/gates/test/adapters/jest-json.ts +0 -370
  771. package/src/gates/test/adapters/junit-xml.ts +0 -400
  772. package/src/gates/test/adapters/registry.ts +0 -149
  773. package/src/gates/test/adapters/vitest-json.ts +0 -339
  774. package/src/gates/test/enrichment/failureId.ts +0 -74
  775. package/src/gates/test/enrichment/index.ts +0 -25
  776. package/src/gates/test/enrichment/nextActions.ts +0 -322
  777. package/src/gates/test/enrichment/rerunTemplates.ts +0 -105
  778. package/src/gates/test/enrichment/signature.ts +0 -58
  779. package/src/gates/test/enrichment/stackParser.ts +0 -149
  780. package/src/gates/test/enrichment/types.ts +0 -67
  781. package/src/gates/test/formatters/markdown.spec.ts +0 -942
  782. package/src/gates/test/formatters/markdown.ts +0 -296
  783. package/src/gates/test/index.ts +0 -54
  784. package/src/gates/test/schema.spec.ts +0 -372
  785. package/src/gates/test/schema.ts +0 -327
  786. package/src/gates/validator.ts +0 -92
  787. package/src/gates.ts +0 -1022
  788. package/src/git/operations.ts +0 -592
  789. package/src/git/parseRemote.ts +0 -22
  790. package/src/github/api.ts +0 -584
  791. package/src/github/batch-ops.ts +0 -215
  792. package/src/github/client.ts +0 -647
  793. package/src/github/contextDiet.ts +0 -205
  794. package/src/github/diffHunks.ts +0 -285
  795. package/src/github/index.ts +0 -11
  796. package/src/github/minimalContext.ts +0 -212
  797. package/src/github/minimalContextClient.ts +0 -105
  798. package/src/github/symbolMap.ts +0 -370
  799. package/src/github/types.ts +0 -166
  800. package/src/governance/index.ts +0 -42
  801. package/src/governance/mcpStatus.ts +0 -258
  802. package/src/governance/timeoutAdjustment.ts +0 -149
  803. package/src/governance/turnCostSummary.ts +0 -182
  804. package/src/hooks/events.ts +0 -374
  805. package/src/hooks/index.ts +0 -8
  806. package/src/hostility/checks.ts +0 -408
  807. package/src/hostility/index.ts +0 -108
  808. package/src/hostility/score.ts +0 -143
  809. package/src/interactive/planDiff.ts +0 -168
  810. package/src/interactive/planHistory.ts +0 -205
  811. package/src/interactive/planReview.ts +0 -531
  812. package/src/learning/counter-example.ts +0 -174
  813. package/src/learning/prompts.ts +0 -107
  814. package/src/learning/storage.ts +0 -230
  815. package/src/lexsona/client.ts +0 -367
  816. package/src/lexsona/index.ts +0 -44
  817. package/src/lexsona/logger.ts +0 -408
  818. package/src/lexsona/types.ts +0 -177
  819. package/src/mcp/DEPRECATED.md +0 -33
  820. package/src/mcp/server.ts +0 -3587
  821. package/src/mcp/types/guided-response.ts +0 -95
  822. package/src/mcp/types.ts +0 -468
  823. package/src/mcp/workflow/state-machine.ts +0 -277
  824. package/src/mergeEligibility.ts +0 -355
  825. package/src/mergeOrder.ts +0 -170
  826. package/src/metrics/export.ts +0 -472
  827. package/src/metrics/index.ts +0 -35
  828. package/src/metrics/turncost.ts +0 -284
  829. package/src/monitoring/README.md +0 -222
  830. package/src/monitoring/audit.ts +0 -98
  831. package/src/monitoring/cache.ts +0 -121
  832. package/src/monitoring/dashboards/grafana-dashboard.json +0 -172
  833. package/src/monitoring/errorRecovery.ts +0 -334
  834. package/src/monitoring/errors.ts +0 -105
  835. package/src/monitoring/fileLogger.ts +0 -194
  836. package/src/monitoring/hallucinations.ts +0 -45
  837. package/src/monitoring/health.ts +0 -171
  838. package/src/monitoring/index.ts +0 -16
  839. package/src/monitoring/lock.ts +0 -158
  840. package/src/monitoring/logger.ts +0 -178
  841. package/src/monitoring/profiler.ts +0 -156
  842. package/src/monitoring/tokenLogger.ts +0 -141
  843. package/src/orchestrate/analyzer.ts +0 -461
  844. package/src/orchestrate/index.ts +0 -6
  845. package/src/orchestrate/types.ts +0 -65
  846. package/src/orchestration/README.md +0 -480
  847. package/src/orchestration/agentAssigner.ts +0 -206
  848. package/src/orchestration/batchPlanner.ts +0 -201
  849. package/src/orchestration/conflictClustering.ts +0 -344
  850. package/src/orchestration/conflictGraph.ts +0 -63
  851. package/src/orchestration/conflictPredictor.ts +0 -170
  852. package/src/orchestration/deliverablesGenerator.ts +0 -345
  853. package/src/orchestration/determinism.ts +0 -232
  854. package/src/orchestration/index.ts +0 -45
  855. package/src/orchestration/mergeTreeSimulator.ts +0 -137
  856. package/src/orchestration/mis.ts +0 -123
  857. package/src/orchestration/toolchainManifest.ts +0 -169
  858. package/src/orchestration/types.ts +0 -103
  859. package/src/performance.README.md +0 -99
  860. package/src/performance.ts +0 -279
  861. package/src/planner/README.md +0 -215
  862. package/src/planner/dependencyParser.ts +0 -404
  863. package/src/planner/dependencyScoring.ts +0 -346
  864. package/src/planner/fileAnalysis.ts +0 -693
  865. package/src/planner/index.ts +0 -41
  866. package/src/planner/scopeValidator.ts +0 -308
  867. package/src/planner/types.ts +0 -80
  868. package/src/planner/validation.ts +0 -493
  869. package/src/preview/constraints.ts +0 -333
  870. package/src/procedures/index.ts +0 -47
  871. package/src/procedures/loader.ts +0 -252
  872. package/src/procedures/schema.ts +0 -191
  873. package/src/procedures/stateMachine.ts +0 -160
  874. package/src/procedures/types.ts +0 -178
  875. package/src/receipts/emit.ts +0 -354
  876. package/src/receipts/index.ts +0 -48
  877. package/src/receipts/schema.ts +0 -227
  878. package/src/report/aggregate.ts +0 -160
  879. package/src/runs/artifacts.ts +0 -315
  880. package/src/runs/attribution.ts +0 -132
  881. package/src/runs/context.ts +0 -54
  882. package/src/runs/decisions.ts +0 -407
  883. package/src/runs/enforcement.ts +0 -395
  884. package/src/runs/failures.ts +0 -517
  885. package/src/runs/index.ts +0 -141
  886. package/src/runs/manager.ts +0 -910
  887. package/src/runs/statusBuilder.ts +0 -233
  888. package/src/runs/storage.ts +0 -290
  889. package/src/runs/types.ts +0 -216
  890. package/src/schema/flakeReport.ts +0 -74
  891. package/src/schema/gateMapping.ts +0 -107
  892. package/src/schema/gateReport.ts +0 -236
  893. package/src/schema/weaveLock.ts +0 -51
  894. package/src/schema.ts +0 -313
  895. package/src/schemas/executorManifest.ts +0 -204
  896. package/src/schemas/feature-spec-v0.ts +0 -40
  897. package/src/schemas/persona.ts +0 -162
  898. package/src/schemas/project.ts +0 -91
  899. package/src/schemas/runCentric.ts +0 -402
  900. package/src/schemas/task-contract.ts +0 -626
  901. package/src/schemas/vacuumReadyPrompt.ts +0 -128
  902. package/src/sdk/index.ts +0 -113
  903. package/src/sdk/parser.ts +0 -101
  904. package/src/sdk/query.ts +0 -315
  905. package/src/sdk/validator.ts +0 -114
  906. package/src/security/README.md +0 -496
  907. package/src/security/authentication.ts +0 -173
  908. package/src/security/authorization.ts +0 -348
  909. package/src/security/commandValidator.ts +0 -195
  910. package/src/security/compliance.ts +0 -688
  911. package/src/security/index.ts +0 -85
  912. package/src/security/policy.ts +0 -399
  913. package/src/security/sarif.ts +0 -179
  914. package/src/security/scanning.ts +0 -362
  915. package/src/security/secrets.ts +0 -520
  916. package/src/shared/git/index.ts +0 -30
  917. package/src/shared/git/runGit.ts +0 -281
  918. package/src/shared/git/runtime.ts +0 -66
  919. package/src/snapshot/builder.ts +0 -229
  920. package/src/snapshot/index.ts +0 -8
  921. package/src/store/CONTRACT.md +0 -189
  922. package/src/store/README.md +0 -22
  923. package/src/store/index.ts +0 -99
  924. package/src/store/inmemory/index.ts +0 -10
  925. package/src/store/inmemory/run-store.ts +0 -268
  926. package/src/store/postgres/.gitkeep +0 -0
  927. package/src/store/run-store.ts +0 -405
  928. package/src/store/sqlite/index.ts +0 -7
  929. package/src/store/sqlite/run-store.ts +0 -525
  930. package/src/store/sqlite/schema.sql +0 -67
  931. package/src/telemetry/frames.ts +0 -179
  932. package/src/telemetry/index.ts +0 -5
  933. package/src/tiers/index.ts +0 -34
  934. package/src/tiers/metrics.ts +0 -156
  935. package/src/tiers/schema.ts +0 -95
  936. package/src/tiers/suggest.ts +0 -183
  937. package/src/types/guardrails.ts +0 -452
  938. package/src/types/index.ts +0 -42
  939. package/src/util/canonicalJson.ts +0 -29
  940. package/src/util/colorControl.ts +0 -46
  941. package/src/util/envUtils.ts +0 -139
  942. package/src/util/hash.ts +0 -69
  943. package/src/util/lockHash.ts +0 -90
  944. package/src/util/minHeap.ts +0 -108
  945. package/src/util/progress.ts +0 -89
  946. package/src/util/tokenEstimator.ts +0 -55
  947. package/src/utils/fingerprint.ts +0 -105
  948. package/src/utils/paths.ts +0 -209
  949. package/src/utils/tokens.ts +0 -151
  950. package/src/utils/validation.ts +0 -53
  951. package/src/verification/diff-applier.ts +0 -60
  952. package/src/verification/engine-verifier.ts +0 -171
  953. package/src/verification/errors.ts +0 -30
  954. package/src/verification/index.ts +0 -13
  955. package/src/weave/audit/index.ts +0 -17
  956. package/src/weave/audit/logger.ts +0 -206
  957. package/src/weave/authority/evaluator.ts +0 -660
  958. package/src/weave/authority/index.ts +0 -30
  959. package/src/weave/authority/schema.ts +0 -292
  960. package/src/weave/checkpoint/index.ts +0 -7
  961. package/src/weave/checkpoint/storage.ts +0 -223
  962. package/src/weave/checkpoint/types.ts +0 -121
  963. package/src/weave/checkpoint/utils.ts +0 -207
  964. package/src/weave/clusterGates.ts +0 -366
  965. package/src/weave/draftPR.ts +0 -214
  966. package/src/weave/executor/d1-executor.ts +0 -822
  967. package/src/weave/executor/d2-executor.ts +0 -381
  968. package/src/weave/executor/index.ts +0 -24
  969. package/src/weave/executor/types.ts +0 -135
  970. package/src/weave/fanout/generator.ts +0 -186
  971. package/src/weave/fanout/index.ts +0 -51
  972. package/src/weave/fanout/loader.ts +0 -134
  973. package/src/weave/fanout/matcher.ts +0 -239
  974. package/src/weave/fanout/schema.ts +0 -178
  975. package/src/weave/frameHelper.ts +0 -126
  976. package/src/weave/gateFailureHandler.ts +0 -405
  977. package/src/weave/index.ts +0 -89
  978. package/src/weave/lockFile.ts +0 -193
  979. package/src/weave/mergeHelpers.ts +0 -377
  980. package/src/weave/mergeWeaveSequential.ts +0 -282
  981. package/src/weave/metrics/calculator.ts +0 -362
  982. package/src/weave/metrics/index.ts +0 -44
  983. package/src/weave/metrics/logger.ts +0 -291
  984. package/src/weave/metrics/schema.ts +0 -505
  985. package/src/weave/planner/index.ts +0 -23
  986. package/src/weave/planner/planner.ts +0 -411
  987. package/src/weave/planner/types.ts +0 -181
  988. package/src/weave/policy/index.ts +0 -63
  989. package/src/weave/policy/loader.ts +0 -148
  990. package/src/weave/policy/schema.ts +0 -290
  991. package/src/weave/post-merge-checks.ts +0 -220
  992. package/src/weave/preflightConflicts.ts +0 -375
  993. package/src/weave/receiptHelper.ts +0 -287
  994. package/src/weave/recovery.ts +0 -232
  995. package/src/weave/resolutionGuidance.ts +0 -173
  996. package/src/weave/stateMachine.ts +0 -426
  997. package/src/weave/testfix/applier.ts +0 -195
  998. package/src/weave/testfix/index.ts +0 -18
  999. package/src/weave/testfix/loader.ts +0 -116
  1000. package/src/weave/testfix/matcher.ts +0 -158
  1001. package/src/weave/testfix/schema.ts +0 -218
  1002. package/src/weave/types.ts +0 -305
  1003. package/src/weave/utils/copilot-completion.ts +0 -76
  1004. package/test-mcp-dogfood.mjs +0 -128
  1005. package/test-mcp.mjs +0 -116
  1006. package/tests/README.md +0 -155
  1007. package/tests/advanced-cli-e2e.spec.ts +0 -218
  1008. package/tests/agentAssigner.spec.ts +0 -261
  1009. package/tests/ai-conflict-strategy-cache.spec.ts +0 -254
  1010. package/tests/ai-conflict-strategy-risk.spec.ts +0 -287
  1011. package/tests/ai-conflict-strategy-schema.spec.ts +0 -252
  1012. package/tests/ai-conflict-strategy.spec.ts +0 -442
  1013. package/tests/aliases/resolver.spec.ts +0 -238
  1014. package/tests/audit/context.spec.ts +0 -283
  1015. package/tests/audit/emitter.spec.ts +0 -347
  1016. package/tests/audit/gateMatrix.spec.ts +0 -335
  1017. package/tests/audit/integration.spec.ts +0 -236
  1018. package/tests/audit/redaction.spec.ts +0 -290
  1019. package/tests/audit/sarif-integration.spec.ts +0 -303
  1020. package/tests/audit/sarif.spec.ts +0 -458
  1021. package/tests/audit/schema-events.spec.ts +0 -421
  1022. package/tests/audit/schema.spec.ts +0 -434
  1023. package/tests/audit/sdk-integration.spec.ts +0 -598
  1024. package/tests/audit/sdk.spec.ts +0 -318
  1025. package/tests/audit/signing-integration.spec.ts +0 -276
  1026. package/tests/audit/signing.spec.ts +0 -350
  1027. package/tests/audit-signing.spec.ts +0 -406
  1028. package/tests/audit-verify-cli.spec.ts +0 -176
  1029. package/tests/autopilot-e2e-level3-4.spec.ts +0 -741
  1030. package/tests/autopilot-integration.spec.ts +0 -274
  1031. package/tests/autopilot-level1.spec.ts +0 -449
  1032. package/tests/autopilot-level2.spec.ts +0 -188
  1033. package/tests/autopilot-level3.spec.ts +0 -266
  1034. package/tests/autopilot-level4.spec.ts +0 -454
  1035. package/tests/autopilot.spec.ts +0 -379
  1036. package/tests/ax-error-adapters.spec.ts +0 -580
  1037. package/tests/batch-planner.spec.ts +0 -500
  1038. package/tests/benchmark-infrastructure.spec.ts +0 -445
  1039. package/tests/benchmarks/README.md +0 -103
  1040. package/tests/benchmarks/baselines/baseline.json +0 -127
  1041. package/tests/benchmarks/core/dependencyResolver.bench.ts +0 -128
  1042. package/tests/benchmarks/core/planParser.bench.ts +0 -114
  1043. package/tests/benchmarks/core/topologicalSort.bench.ts +0 -102
  1044. package/tests/benchmarks/index.ts +0 -36
  1045. package/tests/benchmarks/io/fileOperations.bench.ts +0 -132
  1046. package/tests/benchmarks/io/gitOperations.bench.ts +0 -99
  1047. package/tests/benchmarks/utils/graphGenerator.ts +0 -201
  1048. package/tests/benchmarks/utils/reporter.ts +0 -231
  1049. package/tests/benchmarks/workflows/endToEnd.bench.ts +0 -132
  1050. package/tests/bootstrap.test.ts +0 -319
  1051. package/tests/budget-tracker.spec.ts +0 -279
  1052. package/tests/bulkOps.spec.ts +0 -166
  1053. package/tests/bulletproof-determinism.test.ts +0 -223
  1054. package/tests/canonicalJson.test.ts +0 -130
  1055. package/tests/checkRunConverter.spec.ts +0 -357
  1056. package/tests/cli/commands/gate/test.spec.ts +0 -564
  1057. package/tests/cli/emit-frames-flag.spec.ts +0 -117
  1058. package/tests/cli/exitHandler.spec.ts +0 -314
  1059. package/tests/cli/flags.spec.ts +0 -223
  1060. package/tests/cli/formatters.spec.ts +0 -513
  1061. package/tests/cli/output.spec.ts +0 -221
  1062. package/tests/cli-autopilot.spec.ts +0 -170
  1063. package/tests/cli-budget-guards.spec.ts +0 -210
  1064. package/tests/cli-color-control.spec.ts +0 -334
  1065. package/tests/cli-deliverables-generator.spec.ts +0 -185
  1066. package/tests/cli-determinism.spec.ts +0 -496
  1067. package/tests/cli-init-enterprise.spec.ts +0 -294
  1068. package/tests/cli-init-json.spec.ts +0 -154
  1069. package/tests/cli-init-local.spec.ts +0 -159
  1070. package/tests/cli-json-envelope.spec.ts +0 -140
  1071. package/tests/cli-json.spec.ts +0 -408
  1072. package/tests/cli-orchestrate-plan-batch.spec.ts +0 -329
  1073. package/tests/cli-orchestrate.spec.ts +0 -231
  1074. package/tests/cli-plan-generation.spec.ts +0 -367
  1075. package/tests/cli-plan-review.spec.ts +0 -300
  1076. package/tests/cli-progress.spec.ts +0 -193
  1077. package/tests/cli-ux-enhancements.spec.ts +0 -213
  1078. package/tests/cliJsonPurity.spec.ts +0 -437
  1079. package/tests/cliSuggestDeps.spec.ts +0 -360
  1080. package/tests/cluster-gates-rollback.spec.ts +0 -353
  1081. package/tests/command-validator-integration.spec.ts +0 -305
  1082. package/tests/command-validator.spec.ts +0 -380
  1083. package/tests/commands/autopilot.spec.ts +0 -124
  1084. package/tests/commands/config-validate.spec.ts +0 -301
  1085. package/tests/commands/config.spec.ts +0 -311
  1086. package/tests/commands/create-project.spec.ts +0 -90
  1087. package/tests/commands/doctor.spec.ts +0 -57
  1088. package/tests/commands/execute.spec.ts +0 -293
  1089. package/tests/commands/gateAttest.spec.ts +0 -172
  1090. package/tests/commands/gateImport.spec.ts +0 -176
  1091. package/tests/commands/gateReport.spec.ts +0 -130
  1092. package/tests/commands/guards.spec.ts +0 -114
  1093. package/tests/commands/idea.spec.ts +0 -177
  1094. package/tests/commands/merge.spec.ts +0 -166
  1095. package/tests/commands/plan.spec.ts +0 -123
  1096. package/tests/commands/query.spec.ts +0 -294
  1097. package/tests/commands/report.spec.ts +0 -54
  1098. package/tests/commands/retry.spec.ts +0 -300
  1099. package/tests/commands/schema.spec.ts +0 -136
  1100. package/tests/commands/validation.spec.ts +0 -229
  1101. package/tests/completion.spec.ts +0 -133
  1102. package/tests/config-inspect.spec.ts +0 -202
  1103. package/tests/conflictClustering-e2e.spec.ts +0 -278
  1104. package/tests/conflictClustering.spec.ts +0 -550
  1105. package/tests/conflictGraph.spec.ts +0 -126
  1106. package/tests/conflictPredictor.spec.ts +0 -238
  1107. package/tests/deliverables-generator.spec.ts +0 -329
  1108. package/tests/deliverables.spec.ts +0 -381
  1109. package/tests/dependencyParser-github.spec.ts +0 -244
  1110. package/tests/dependencyParser.spec.ts +0 -386
  1111. package/tests/dependencyScoring.spec.ts +0 -668
  1112. package/tests/deterministic-applicable.test.ts +0 -156
  1113. package/tests/deterministic-build.test.ts +0 -172
  1114. package/tests/deterministic-simple.test.ts +0 -32
  1115. package/tests/discover-suggest-integration.spec.ts +0 -340
  1116. package/tests/dogfood-merge-weave-script.spec.ts +0 -150
  1117. package/tests/e2e/planner.spec.ts +0 -596
  1118. package/tests/e2e-comprehensive.test.ts +0 -500
  1119. package/tests/e2e-determinism.test.ts +0 -293
  1120. package/tests/e2e-synthetic-6pr-weave.spec.ts +0 -329
  1121. package/tests/enterprise-init.spec.ts +0 -350
  1122. package/tests/envUtils.spec.ts +0 -267
  1123. package/tests/error-handling.test.ts +0 -104
  1124. package/tests/error-recovery.spec.ts +0 -451
  1125. package/tests/execution-plan-v1.test.ts +0 -257
  1126. package/tests/executionState-loadGateResults.spec.ts +0 -267
  1127. package/tests/executionState.test.ts +0 -169
  1128. package/tests/executors/README.md +0 -100
  1129. package/tests/executors/frameContract-integration.spec.ts +0 -324
  1130. package/tests/executors/frameContract.spec.ts +0 -531
  1131. package/tests/executors/guardrailEnforcement.spec.ts +0 -424
  1132. package/tests/executors/lifecycle.spec.ts +0 -313
  1133. package/tests/executors/toolBudget.spec.ts +0 -473
  1134. package/tests/feature-spec-v0.test.ts +0 -145
  1135. package/tests/fileAnalysis.spec.ts +0 -946
  1136. package/tests/fingerprint.spec.ts +0 -100
  1137. package/tests/fixtures/README.md +0 -380
  1138. package/tests/fixtures/deliverables/batch-example-plan.json +0 -62
  1139. package/tests/fixtures/executors/README.md +0 -57
  1140. package/tests/fixtures/executors/index.ts +0 -9
  1141. package/tests/fixtures/executors/mock-executor.ts +0 -204
  1142. package/tests/fixtures/executors/registry.ts +0 -51
  1143. package/tests/fixtures/executors/types.ts +0 -95
  1144. package/tests/fixtures/fixtures.spec.ts +0 -307
  1145. package/tests/fixtures/gates/configs.ts +0 -234
  1146. package/tests/fixtures/gates/results.ts +0 -234
  1147. package/tests/fixtures/harvest-bundle-fixture.json +0 -87
  1148. package/tests/fixtures/index.ts +0 -219
  1149. package/tests/fixtures/invalid/plans.ts +0 -178
  1150. package/tests/fixtures/jest/all-passing.json +0 -71
  1151. package/tests/fixtures/jest/snapshot-failures.json +0 -66
  1152. package/tests/fixtures/jest/some-failing.json +0 -100
  1153. package/tests/fixtures/jest/with-location.json +0 -84
  1154. package/tests/fixtures/junit/cdata-messages.xml +0 -29
  1155. package/tests/fixtures/junit/multiple-suites.xml +0 -30
  1156. package/tests/fixtures/junit/single-suite.xml +0 -17
  1157. package/tests/fixtures/junit/with-errors.xml +0 -19
  1158. package/tests/fixtures/junit/with-skipped.xml +0 -18
  1159. package/tests/fixtures/npm-audit.json +0 -32
  1160. package/tests/fixtures/plan.bad-schema.json +0 -5
  1161. package/tests/fixtures/plan.bad-unknown-dep.json +0 -10
  1162. package/tests/fixtures/plan.ci-gates.json +0 -36
  1163. package/tests/fixtures/plan.complex-cycle.json +0 -22
  1164. package/tests/fixtures/plan.cycle.json +0 -14
  1165. package/tests/fixtures/plan.deep-chain.json +0 -95
  1166. package/tests/fixtures/plan.dogfood-execute.json +0 -36
  1167. package/tests/fixtures/plan.gates.json +0 -30
  1168. package/tests/fixtures/plan.integration-pyramid.json +0 -56
  1169. package/tests/fixtures/plan.orphans.json +0 -22
  1170. package/tests/fixtures/plan.parallel.json +0 -30
  1171. package/tests/fixtures/plan.tiny.json +0 -18
  1172. package/tests/fixtures/plan.wide-parallel.json +0 -75
  1173. package/tests/fixtures/plan.with-failures.json +0 -26
  1174. package/tests/fixtures/plan.with-vuln.json +0 -25
  1175. package/tests/fixtures/planner/cross-module.json +0 -101
  1176. package/tests/fixtures/planner/cycle-error.json +0 -56
  1177. package/tests/fixtures/planner/diamond-pattern.json +0 -74
  1178. package/tests/fixtures/planner/empty-repo.json +0 -9
  1179. package/tests/fixtures/planner/file-overlap-heavy.json +0 -110
  1180. package/tests/fixtures/planner/invalid-pr.json +0 -25
  1181. package/tests/fixtures/planner/merge-conflicts.json +0 -42
  1182. package/tests/fixtures/planner/mixed-deps.json +0 -101
  1183. package/tests/fixtures/planner/self-dependency.json +0 -24
  1184. package/tests/fixtures/planner/simple-stack.json +0 -79
  1185. package/tests/fixtures/planner/single-pr.json +0 -25
  1186. package/tests/fixtures/planner/stale-pr.json +0 -40
  1187. package/tests/fixtures/plans/complex.ts +0 -201
  1188. package/tests/fixtures/plans/diamond.ts +0 -115
  1189. package/tests/fixtures/plans/linear.ts +0 -74
  1190. package/tests/fixtures/plans/simple.ts +0 -61
  1191. package/tests/fixtures/prs/basic.ts +0 -175
  1192. package/tests/fixtures/prs/withDeps.ts +0 -197
  1193. package/tests/fixtures/scan-results-clean.sarif +0 -15
  1194. package/tests/fixtures/scan-results.sarif +0 -74
  1195. package/tests/fixtures/scenarios/mergeWorkflows.ts +0 -300
  1196. package/tests/fixtures/scenarios/syntheticWeave.ts +0 -351
  1197. package/tests/fixtures/snapshot/package.json +0 -5
  1198. package/tests/fixtures/snapshot/sample.ts +0 -21
  1199. package/tests/fixtures/utils/cleanup.ts +0 -81
  1200. package/tests/fixtures/utils/mockGitHub.ts +0 -219
  1201. package/tests/fixtures/utils/tempDir.ts +0 -109
  1202. package/tests/fixtures/verification/expected-verification.json +0 -16
  1203. package/tests/fixtures/verification/receipt.json +0 -31
  1204. package/tests/fixtures/verification/snapshot.json +0 -44
  1205. package/tests/fixtures/vitest/all-passing.json +0 -67
  1206. package/tests/fixtures/vitest/complex-nested-suites.json +0 -98
  1207. package/tests/fixtures/vitest/some-failing.json +0 -98
  1208. package/tests/fixtures/vitest/with-coverage.json +0 -97
  1209. package/tests/fixtures-usage-examples.spec.ts +0 -304
  1210. package/tests/flakeReport.spec.ts +0 -267
  1211. package/tests/frames/ci-gate-integration.spec.ts +0 -331
  1212. package/tests/frames/controller.spec.ts +0 -165
  1213. package/tests/frames/emitter.spec.ts +0 -371
  1214. package/tests/frames/idempotency.spec.ts +0 -177
  1215. package/tests/frames/storage.spec.ts +0 -346
  1216. package/tests/frames/types.spec.ts +0 -249
  1217. package/tests/frames/v2-schema-integration.spec.ts +0 -435
  1218. package/tests/gate-working-directory.spec.ts +0 -204
  1219. package/tests/gateMapping.spec.ts +0 -161
  1220. package/tests/gateReportIntegration.spec.ts +0 -175
  1221. package/tests/gateReportValidation.spec.ts +0 -452
  1222. package/tests/gates/test/adapters/jest-json.spec.ts +0 -372
  1223. package/tests/gates/test/adapters/junit-xml.spec.ts +0 -421
  1224. package/tests/gates/test/adapters/registry.spec.ts +0 -376
  1225. package/tests/gates/test/adapters/vitest-json.spec.ts +0 -455
  1226. package/tests/gates/test/enrichment/failureId.spec.ts +0 -131
  1227. package/tests/gates/test/enrichment/nextActions.spec.ts +0 -365
  1228. package/tests/gates/test/enrichment/rerunTemplates.spec.ts +0 -187
  1229. package/tests/gates/test/enrichment/signature.spec.ts +0 -163
  1230. package/tests/gates/test/enrichment/stackParser.spec.ts +0 -203
  1231. package/tests/gates/turncost-integration.spec.ts +0 -221
  1232. package/tests/gates/validation-integration.spec.ts +0 -147
  1233. package/tests/gates/validator.spec.ts +0 -200
  1234. package/tests/gates.test.ts +0 -255
  1235. package/tests/gatesWithPolicy.hostilityTimeoutAdjustment.spec.ts +0 -156
  1236. package/tests/git-operations-receipts.spec.ts +0 -121
  1237. package/tests/git-operations.test.ts +0 -152
  1238. package/tests/git-runtime.spec.ts +0 -175
  1239. package/tests/github-api.labels.spec.ts +0 -21
  1240. package/tests/github-api.test.ts +0 -85
  1241. package/tests/github-context-diet.spec.ts +0 -441
  1242. package/tests/github-diff-hunks.spec.ts +0 -387
  1243. package/tests/github-integration.spec.ts +0 -774
  1244. package/tests/github-minimal-context.spec.ts +0 -338
  1245. package/tests/github-symbol-map.spec.ts +0 -414
  1246. package/tests/githubClient.spec.ts +0 -123
  1247. package/tests/governance/mcpStatus.spec.ts +0 -276
  1248. package/tests/governance/timeoutAdjustment.spec.ts +0 -149
  1249. package/tests/governance/turnCostSummary.spec.ts +0 -188
  1250. package/tests/governance-retention.spec.ts +0 -151
  1251. package/tests/governance-wrapper-delegation.spec.ts +0 -148
  1252. package/tests/guardrails.spec.ts +0 -860
  1253. package/tests/hash.test.ts +0 -83
  1254. package/tests/helpers/cli.ts +0 -23
  1255. package/tests/helpers/getStd.ts +0 -1
  1256. package/tests/helpers/makeGate.ts +0 -19
  1257. package/tests/helpers/plannerTestHelpers.ts +0 -314
  1258. package/tests/hooks/events.spec.ts +0 -518
  1259. package/tests/hostility/checks.spec.ts +0 -295
  1260. package/tests/hostility/integration.spec.ts +0 -123
  1261. package/tests/hostility/score.spec.ts +0 -175
  1262. package/tests/init.spec.ts +0 -270
  1263. package/tests/integration/hipaa-encryption.spec.ts +0 -148
  1264. package/tests/integration/lex-smoke-test.spec.ts +0 -328
  1265. package/tests/integration-e2e.test.ts +0 -244
  1266. package/tests/integration-matrix.test.ts +0 -409
  1267. package/tests/interPRConflicts.spec.ts +0 -254
  1268. package/tests/interactive-plan-history.spec.ts +0 -255
  1269. package/tests/interactive-plan-review.spec.ts +0 -287
  1270. package/tests/issue-analyzer.spec.ts +0 -593
  1271. package/tests/lexsona-integration.spec.ts +0 -311
  1272. package/tests/localOverlay.spec.ts +0 -203
  1273. package/tests/lockHash.spec.ts +0 -167
  1274. package/tests/mcp-auth-errors.spec.ts +0 -190
  1275. package/tests/mcp-contracts.spec.ts +0 -290
  1276. package/tests/mcp-gates-external-plan.spec.ts +0 -146
  1277. package/tests/mcp-granular-tools.spec.ts +0 -208
  1278. package/tests/mcp-runstore-integration.spec.ts +0 -334
  1279. package/tests/mcp-scope-integration.spec.ts +0 -318
  1280. package/tests/mcp-task-handoff.spec.ts +0 -320
  1281. package/tests/mcp-workflow-guide.spec.ts +0 -53
  1282. package/tests/mcp.test.ts +0 -151
  1283. package/tests/merge-conflict-detection.spec.ts +0 -260
  1284. package/tests/mergeEligibility.test.ts +0 -201
  1285. package/tests/mergeLockHash.spec.ts +0 -158
  1286. package/tests/mergeOrder-with-fixtures.spec.ts +0 -215
  1287. package/tests/mergeOrder.test.ts +0 -108
  1288. package/tests/mergeTreeSimulator.spec.ts +0 -145
  1289. package/tests/metrics/export.spec.ts +0 -446
  1290. package/tests/metrics/turncost.spec.ts +0 -309
  1291. package/tests/metrics-template.spec.ts +0 -137
  1292. package/tests/migrateProfile.spec.ts +0 -254
  1293. package/tests/mis.spec.ts +0 -202
  1294. package/tests/monitoring-audit.spec.ts +0 -181
  1295. package/tests/monitoring-cache.spec.ts +0 -331
  1296. package/tests/monitoring-error-recovery.spec.ts +0 -236
  1297. package/tests/monitoring-errors.spec.ts +0 -193
  1298. package/tests/monitoring-fileLogger.spec.ts +0 -319
  1299. package/tests/monitoring-health.spec.ts +0 -152
  1300. package/tests/monitoring-lock.spec.ts +0 -308
  1301. package/tests/monitoring-logger.spec.ts +0 -157
  1302. package/tests/monitoring-metrics.spec.ts +0 -158
  1303. package/tests/monitoring-profiler.spec.ts +0 -197
  1304. package/tests/orchestration-determinism.spec.ts +0 -204
  1305. package/tests/parseRemote.spec.ts +0 -25
  1306. package/tests/pathResolver.spec.ts +0 -122
  1307. package/tests/paths.spec.ts +0 -68
  1308. package/tests/performance.spec.ts +0 -322
  1309. package/tests/pipeline-determinism.spec.ts +0 -597
  1310. package/tests/plan-tier-integration.spec.ts +0 -184
  1311. package/tests/precedence-resolution.spec.ts +0 -682
  1312. package/tests/preflightConflicts.spec.ts +0 -205
  1313. package/tests/procedures/keystone-policy.spec.ts +0 -296
  1314. package/tests/procedures/loader.spec.ts +0 -585
  1315. package/tests/procedures/pr-review.spec.ts +0 -321
  1316. package/tests/profileResolver.spec.ts +0 -375
  1317. package/tests/progress-indicators.spec.ts +0 -139
  1318. package/tests/promptsResolver.spec.ts +0 -443
  1319. package/tests/public-api.spec.ts +0 -272
  1320. package/tests/query.spec.ts +0 -170
  1321. package/tests/receipts.spec.ts +0 -463
  1322. package/tests/release-prepare.spec.ts +0 -268
  1323. package/tests/report.test.ts +0 -335
  1324. package/tests/resolutionGuidance.spec.ts +0 -160
  1325. package/tests/rotate-secrets-example.spec.ts +0 -198
  1326. package/tests/rulesResolver.spec.ts +0 -232
  1327. package/tests/runGit.spec.ts +0 -229
  1328. package/tests/runner-lifecycle-integration.spec.ts +0 -283
  1329. package/tests/runs/artifacts.spec.ts +0 -367
  1330. package/tests/runs/decisions.spec.ts +0 -495
  1331. package/tests/runs/enforcement.spec.ts +0 -555
  1332. package/tests/runs/failures.spec.ts +0 -554
  1333. package/tests/runs/manager-runstore-integration.spec.ts +0 -455
  1334. package/tests/runs/manager.spec.ts +0 -678
  1335. package/tests/runs-manager.spec.ts +0 -485
  1336. package/tests/safety-acceptance.spec.ts +0 -278
  1337. package/tests/safety-enhanced.spec.ts +0 -329
  1338. package/tests/safety-framework.spec.ts +0 -427
  1339. package/tests/safety-guards-integration.spec.ts +0 -213
  1340. package/tests/safety-integration.spec.ts +0 -278
  1341. package/tests/sarif-parser.spec.ts +0 -148
  1342. package/tests/schema.test.ts +0 -88
  1343. package/tests/schemas/behavior-rule.spec.ts +0 -366
  1344. package/tests/schemas/executorManifest.spec.ts +0 -441
  1345. package/tests/schemas/persona-integration.spec.ts +0 -62
  1346. package/tests/schemas/persona.spec.ts +0 -172
  1347. package/tests/schemas/project.spec.ts +0 -247
  1348. package/tests/schemas/run-store.spec.ts +0 -553
  1349. package/tests/schemas/runCentric.spec.ts +0 -463
  1350. package/tests/schemas/vacuumReadyPrompt.spec.ts +0 -515
  1351. package/tests/scope-github-auto-detection.spec.ts +0 -200
  1352. package/tests/scopeValidator.spec.ts +0 -497
  1353. package/tests/security-authentication.spec.ts +0 -42
  1354. package/tests/security-authorization.spec.ts +0 -350
  1355. package/tests/security-cli.spec.ts +0 -264
  1356. package/tests/security-compliance.spec.ts +0 -334
  1357. package/tests/security-policy.spec.ts +0 -295
  1358. package/tests/security-scanning.spec.ts +0 -349
  1359. package/tests/security-secrets.spec.ts +0 -401
  1360. package/tests/store/create-run-store.spec.ts +0 -185
  1361. package/tests/store/inmemory/run-store.spec.ts +0 -533
  1362. package/tests/store/sqlite/run-store.spec.ts +0 -849
  1363. package/tests/telemetry/frames.spec.ts +0 -120
  1364. package/tests/tiers.spec.ts +0 -466
  1365. package/tests/token-usage.spec.ts +0 -309
  1366. package/tests/toolchain-manifest.spec.ts +0 -145
  1367. package/tests/unified-budget.spec.ts +0 -713
  1368. package/tests/unit/cache/issue-cache.spec.ts +0 -131
  1369. package/tests/unit/fanout/analyzer-integration.spec.ts +0 -398
  1370. package/tests/unit/fanout/analyzer.spec.ts +0 -605
  1371. package/tests/unit/fanout/github-adapter.spec.ts +0 -203
  1372. package/tests/unit/fanout/harvest.spec.ts +0 -93
  1373. package/tests/unit/fanout/monitor.spec.ts +0 -297
  1374. package/tests/unit/fanout/types.spec.ts +0 -308
  1375. package/tests/unit/github/batch-ops.spec.ts +0 -179
  1376. package/tests/unit/learning/counter-example.spec.ts +0 -168
  1377. package/tests/unit/learning/storage.spec.ts +0 -154
  1378. package/tests/unit/preview/constraints.spec.ts +0 -429
  1379. package/tests/unit/runs/attribution.spec.ts +0 -204
  1380. package/tests/unit/schemas/task-contract.spec.ts +0 -483
  1381. package/tests/unit/snapshot/builder.spec.ts +0 -389
  1382. package/tests/unit/verification/engine-verifier.spec.ts +0 -279
  1383. package/tests/unit/weave/authority-evaluator.spec.ts +0 -404
  1384. package/tests/unit/weave/authority-schema.spec.ts +0 -199
  1385. package/tests/unit/weave/auto-undraft-integration.spec.ts +0 -349
  1386. package/tests/unit/weave/copilot-completion.spec.ts +0 -182
  1387. package/tests/unit/weave/d1-executor.spec.ts +0 -269
  1388. package/tests/unit/weave/d2-executor.spec.ts +0 -334
  1389. package/tests/unit/weave/fanout-generator.spec.ts +0 -365
  1390. package/tests/unit/weave/fanout-matcher.spec.ts +0 -320
  1391. package/tests/unit/weave/fanout-schema.spec.ts +0 -221
  1392. package/tests/unit/weave/mergeWeaveSequential.spec.ts +0 -268
  1393. package/tests/unit/weave/metrics-calculator.spec.ts +0 -212
  1394. package/tests/unit/weave/metrics-logger.spec.ts +0 -233
  1395. package/tests/unit/weave/metrics-schema.spec.ts +0 -383
  1396. package/tests/unit/weave/multi-repo-plan.spec.ts +0 -221
  1397. package/tests/unit/weave/planner.spec.ts +0 -227
  1398. package/tests/unit/weave/post-merge-checks.spec.ts +0 -342
  1399. package/tests/unit/weave/recovery.spec.ts +0 -306
  1400. package/tests/unit/weave/testfix/applier.spec.ts +0 -364
  1401. package/tests/unit/weave/testfix/e2e.spec.ts +0 -273
  1402. package/tests/unit/weave/testfix/integration.spec.ts +0 -128
  1403. package/tests/unit/weave/testfix/matcher.spec.ts +0 -321
  1404. package/tests/unit/weave/testfix/schema.spec.ts +0 -298
  1405. package/tests/utils/fingerprint.spec.ts +0 -251
  1406. package/tests/utils/paths.spec.ts +0 -284
  1407. package/tests/utils/tokens.spec.ts +0 -210
  1408. package/tests/utils/validation.spec.ts +0 -215
  1409. package/tests/utils-validation.spec.ts +0 -80
  1410. package/tests/validate-manifests.spec.ts +0 -231
  1411. package/tests/validation.spec.ts +0 -501
  1412. package/tests/vuln-gate.spec.ts +0 -341
  1413. package/tests/weave/adr007-integration.spec.ts +0 -309
  1414. package/tests/weave/checkpoint/cli-integration.spec.ts +0 -118
  1415. package/tests/weave/checkpoint/storage.spec.ts +0 -302
  1416. package/tests/weave/checkpoint/utils.spec.ts +0 -223
  1417. package/tests/weave/frameHelper.spec.ts +0 -423
  1418. package/tests/weave/gateFailureHandler.spec.ts +0 -249
  1419. package/tests/weave/lockFile.spec.ts +0 -387
  1420. package/tests/weave/mergeHelpers.spec.ts +0 -173
  1421. package/tests/weave/receiptHelper.spec.ts +0 -261
  1422. package/tests/weave/stateMachine.spec.ts +0 -436
  1423. package/tests/weave-contract.test.ts +0 -517
  1424. package/tests/weave-e2e.spec.ts +0 -279
  1425. package/tests/weaveLock.spec.ts +0 -136
  1426. package/tests/workflow-state-machine.spec.ts +0 -274
  1427. package/tests/write-protection.spec.ts +0 -213
  1428. package/tsconfig.json +0 -18
  1429. package/tsup.config.ts +0 -12
  1430. package/vitest.benchmark.config.ts +0 -17
  1431. package/vitest.config.ts +0 -28
  1432. package/vitest.git.config.ts +0 -12
  1433. package/vitest.slow-cli.config.ts +0 -28
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { z } from 'zod';
3
+ import { F as FrameOutcome, a as FrameEmitResult } from './types-CYMIAhy8.js';
4
+ export { m as mcpToolError } from './adapters-DciX_uRh.js';
3
5
  import { Octokit } from '@octokit/rest';
6
+ import '@smartergpt/lex/errors';
4
7
 
5
8
  /**
6
9
  * Gate execution result
@@ -18,6 +21,20 @@ declare const GateResult: z.ZodObject<{
18
21
  duration: z.ZodOptional<z.ZodNumber>;
19
22
  stdout: z.ZodOptional<z.ZodString>;
20
23
  stderr: z.ZodOptional<z.ZodString>;
24
+ failureKind: z.ZodOptional<z.ZodEnum<{
25
+ nonzero_exit: "nonzero_exit";
26
+ spawn_error: "spawn_error";
27
+ timeout: "timeout";
28
+ }>>;
29
+ timeoutCleanup: z.ZodOptional<z.ZodObject<{
30
+ method: z.ZodEnum<{
31
+ "process-group": "process-group";
32
+ taskkill: "taskkill";
33
+ "direct-child": "direct-child";
34
+ }>;
35
+ forceKilled: z.ZodBoolean;
36
+ descendantsReaped: z.ZodBoolean;
37
+ }, z.core.$strip>>;
21
38
  artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
39
  attempts: z.ZodDefault<z.ZodNumber>;
23
40
  lastAttempt: z.ZodOptional<z.ZodString>;
@@ -48,6 +65,20 @@ declare const NodeResult: z.ZodObject<{
48
65
  duration: z.ZodOptional<z.ZodNumber>;
49
66
  stdout: z.ZodOptional<z.ZodString>;
50
67
  stderr: z.ZodOptional<z.ZodString>;
68
+ failureKind: z.ZodOptional<z.ZodEnum<{
69
+ nonzero_exit: "nonzero_exit";
70
+ spawn_error: "spawn_error";
71
+ timeout: "timeout";
72
+ }>>;
73
+ timeoutCleanup: z.ZodOptional<z.ZodObject<{
74
+ method: z.ZodEnum<{
75
+ "process-group": "process-group";
76
+ taskkill: "taskkill";
77
+ "direct-child": "direct-child";
78
+ }>;
79
+ forceKilled: z.ZodBoolean;
80
+ descendantsReaped: z.ZodBoolean;
81
+ }, z.core.$strip>>;
51
82
  artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
83
  attempts: z.ZodDefault<z.ZodNumber>;
53
84
  lastAttempt: z.ZodOptional<z.ZodString>;
@@ -852,6 +883,12 @@ declare class HealthChecker {
852
883
  */
853
884
  declare const healthChecker: HealthChecker;
854
885
 
886
+ interface RegisteredCliCommand {
887
+ path: string;
888
+ kind: "group" | "operation";
889
+ description: string;
890
+ }
891
+
855
892
  /**
856
893
  * Run-Centric Schemas for Tool-Grounded Interactions
857
894
  *
@@ -1139,6 +1176,18 @@ declare function buildStatusResponse(runState: StatusBuilderInput, options?: {
1139
1176
  * Artifacts include plan files, decision logs, failure logs, gate reports, and reports.
1140
1177
  */
1141
1178
 
1179
+ /**
1180
+ * Artifact types with their path patterns
1181
+ */
1182
+ declare const ARTIFACT_TYPES: {
1183
+ readonly plan: "plan.json";
1184
+ readonly decision: "decisions.ndjson";
1185
+ readonly failure: "failures.ndjson";
1186
+ readonly gate: "gates/**/report.json";
1187
+ readonly report: "reports/*.md";
1188
+ readonly log: "logs/*.log";
1189
+ };
1190
+ type ArtifactType = keyof typeof ARTIFACT_TYPES;
1142
1191
  /**
1143
1192
  * Input schema for listArtifacts
1144
1193
  */
@@ -1426,102 +1475,6 @@ interface RunStore {
1426
1475
  close(): Promise<void>;
1427
1476
  }
1428
1477
 
1429
- /**
1430
- * Execution Frame Types
1431
- *
1432
- * Types for capturing workflow execution as Frames for memory integration.
1433
- * Implements AX-005: Frame emission for core workflows.
1434
- *
1435
- * AX Principle: Memory Is a Feature
1436
- */
1437
-
1438
- /**
1439
- * Frame outcome status
1440
- */
1441
- type FrameOutcome = "success" | "failure" | "partial";
1442
- /**
1443
- * Execution Frame schema
1444
- *
1445
- * Represents what was attempted, scope touched, outcome, and recommended next steps.
1446
- */
1447
- declare const ExecutionFrameSchema: z.ZodObject<{
1448
- type: z.ZodEnum<{
1449
- gate: "gate";
1450
- procedure: "procedure";
1451
- execution: "execution";
1452
- "merge-weave": "merge-weave";
1453
- }>;
1454
- reference_point: z.ZodString;
1455
- summary_caption: z.ZodString;
1456
- module_scope: z.ZodArray<z.ZodString>;
1457
- keywords: z.ZodArray<z.ZodString>;
1458
- outcome: z.ZodEnum<{
1459
- success: "success";
1460
- failure: "failure";
1461
- partial: "partial";
1462
- }>;
1463
- next_actions: z.ZodArray<z.ZodString>;
1464
- metadata: z.ZodOptional<z.ZodObject<{
1465
- duration_ms: z.ZodOptional<z.ZodNumber>;
1466
- conflicts_resolved: z.ZodOptional<z.ZodNumber>;
1467
- gates_passed: z.ZodOptional<z.ZodArray<z.ZodString>>;
1468
- gates_failed: z.ZodOptional<z.ZodArray<z.ZodString>>;
1469
- artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1470
- error: z.ZodOptional<z.ZodString>;
1471
- exit_code: z.ZodOptional<z.ZodNumber>;
1472
- run_id: z.ZodOptional<z.ZodString>;
1473
- plan_hash: z.ZodOptional<z.ZodString>;
1474
- turn_cost: z.ZodOptional<z.ZodObject<{
1475
- components: z.ZodObject<{
1476
- latencyMs: z.ZodNumber;
1477
- contextResetTokens: z.ZodNumber;
1478
- renegotiationCount: z.ZodNumber;
1479
- tokenBloat: z.ZodNumber;
1480
- attentionSwitchCount: z.ZodNumber;
1481
- }, z.core.$strip>;
1482
- weightedScore: z.ZodNumber;
1483
- eventCount: z.ZodNumber;
1484
- priorRunScore: z.ZodOptional<z.ZodNumber>;
1485
- improvement: z.ZodOptional<z.ZodString>;
1486
- }, z.core.$strip>>;
1487
- tier_metrics: z.ZodOptional<z.ZodObject<{
1488
- totalTasks: z.ZodNumber;
1489
- byTier: z.ZodObject<{
1490
- senior: z.ZodNumber;
1491
- mid: z.ZodNumber;
1492
- junior: z.ZodNumber;
1493
- }, z.core.$strip>;
1494
- escalations: z.ZodNumber;
1495
- mismatches: z.ZodNumber;
1496
- tierMatchRate: z.ZodNumber;
1497
- escalationRate: z.ZodNumber;
1498
- }, z.core.$strip>>;
1499
- governed_by: z.ZodOptional<z.ZodArray<z.ZodObject<{
1500
- constraintId: z.ZodString;
1501
- source: z.ZodEnum<{
1502
- persona: "persona";
1503
- baseline: "baseline";
1504
- learned: "learned";
1505
- }>;
1506
- action: z.ZodString;
1507
- }, z.core.$strip>>>;
1508
- }, z.core.$strip>>;
1509
- }, z.core.$strip>;
1510
- type ExecutionFrame = z.infer<typeof ExecutionFrameSchema>;
1511
- /**
1512
- * Result of Frame emission
1513
- */
1514
- interface FrameEmitResult {
1515
- /** Whether the Frame was emitted successfully */
1516
- success: boolean;
1517
- /** The emitted Frame (if successful) */
1518
- frame?: ExecutionFrame;
1519
- /** Frame ID (if stored via Lex) */
1520
- frameId?: string;
1521
- /** Error message (if failed) */
1522
- error?: string;
1523
- }
1524
-
1525
1478
  /**
1526
1479
  * Run Lifecycle Manager
1527
1480
  *
@@ -1868,190 +1821,3422 @@ declare class RunManager {
1868
1821
  declare function createRunManager(baseDirOrOptions?: string | RunManagerOptions): RunManager;
1869
1822
 
1870
1823
  /**
1871
- * Compute merge order levels using Kahn's algorithm with deterministic ordering
1872
- * Returns array of levels, where each level contains item names that can be processed in parallel
1873
- */
1874
- declare function computeMergeOrder(plan: Plan): string[][];
1875
-
1876
- /**
1877
- * GitHub API integration for PR discovery and metadata extraction
1878
- * Maintains deterministic ordering and stable output
1879
- * Includes error recovery with retry and circuit breaker patterns
1824
+ * Controller coordination persistence contract.
1825
+ *
1826
+ * This contract is deliberately separate from the frozen RunStore contract.
1827
+ * It coordinates which controller may advance a run and provides optimistic
1828
+ * concurrency control for that run's serialized orchestration state.
1880
1829
  */
1881
-
1882
- interface GitHubPullRequest {
1883
- number: number;
1884
- title: string;
1885
- branch: string;
1886
- sha: string;
1887
- state: "open" | "closed" | "merged";
1888
- labels: string[];
1889
- author: string;
1890
- baseBranch: string;
1891
- createdAt: string;
1892
- updatedAt: string;
1893
- mergeable?: boolean;
1894
- body?: string | null;
1895
- draft?: boolean;
1896
- reviewRequested?: boolean;
1830
+ type JsonPrimitive = string | number | boolean | null;
1831
+ type JsonValue = JsonPrimitive | JsonValue[] | {
1832
+ [key: string]: JsonValue;
1833
+ };
1834
+ interface ControllerLease {
1835
+ runId: string;
1836
+ controllerId: string;
1837
+ leaseId: string;
1838
+ /**
1839
+ * Monotonically increasing token. A controller must present the exact token
1840
+ * on every mutation so a superseded controller cannot write after takeover.
1841
+ */
1842
+ fencingToken: number;
1843
+ acquiredAt: string;
1844
+ renewedAt: string;
1845
+ expiresAt: string;
1897
1846
  }
1898
- interface GitHubConfig {
1899
- token?: string;
1900
- owner: string;
1901
- repo: string;
1847
+ interface ControllerLeaseCredential {
1848
+ runId: string;
1849
+ controllerId: string;
1850
+ leaseId: string;
1851
+ fencingToken: number;
1902
1852
  }
1853
+
1903
1854
  /**
1904
- * GitHub API client for PR operations with error recovery
1855
+ * Agent work protocol contracts.
1856
+ *
1857
+ * These contracts describe the durable boundary between a run controller,
1858
+ * workspace broker, worker, verifier, and human operator. They intentionally
1859
+ * do not replace ADR-007's repair-specific TaskSnapshot/TaskReceipt contract.
1860
+ *
1861
+ * Portable intent lives in AgentTaskPacket_v1. Machine-local paths and runtime
1862
+ * details live exclusively in ExecutionEnvelope_v1.
1905
1863
  */
1906
- declare class GitHubAPI {
1907
- private octokit;
1908
- config: GitHubConfig;
1909
- private circuitBreaker;
1910
- private normalized;
1911
- constructor(config: GitHubConfig);
1912
- /**
1913
- * Get the underlying Octokit instance for advanced operations
1914
- * Use with caution - prefer using typed methods when available
1915
- */
1916
- getOctokit(): Octokit;
1917
- /**
1918
- * Normalize repository owner and name to match GitHub's canonical casing.
1919
- * This handles case-insensitive lookups where git remote URLs may have
1920
- * different casing than the actual GitHub repository.
1921
- */
1922
- private normalizeRepositoryName;
1923
- /**
1924
- * Extract HTTP status code from error object
1925
- */
1926
- private extractErrorStatus;
1927
- /**
1928
- * Discover open pull requests with stable ordering and error recovery
1929
- */
1930
- discoverPullRequests(state?: "open" | "closed" | "all"): Promise<GitHubPullRequest[]>;
1931
- /**
1932
- * Get repository information
1933
- */
1934
- getRepositoryInfo(): Promise<{
1935
- name: string;
1936
- fullName: string;
1937
- defaultBranch: string;
1938
- private: boolean;
1939
- }>;
1940
- /**
1941
- * Check if authentication is working
1942
- */
1943
- checkAuth(): Promise<{
1944
- authenticated: boolean;
1945
- user?: string;
1864
+
1865
+ declare const AGENT_WORK_CONTRACT_VERSION: "1.0.0";
1866
+ /** Breaking receipt-only evolution; the surrounding agent-work v1 contracts remain unchanged. */
1867
+ declare const AGENT_TASK_RECEIPT_V2_VERSION: "2.0.0";
1868
+ /** Reproducible patch-byte profile used by AgentTaskReceipt_v2.patch_hash claims. */
1869
+ declare const AGENT_TASK_RECEIPT_PATCH_PROFILE: "git-diff-binary-v1";
1870
+ /** Breaking verification-only evolution for durable AgentTaskReceipt v2 evidence. */
1871
+ declare const AGENT_ENGINE_VERIFICATION_V2_VERSION: "2.0.0";
1872
+ /** A full Git object ID. Abbreviated SHAs are not safe concurrency preconditions. */
1873
+ declare const GitObjectId: z.ZodString;
1874
+ type GitObjectId = z.infer<typeof GitObjectId>;
1875
+ /** Independent authority lanes; false is an explicit denial. */
1876
+ declare const AuthorityEnvelope: z.ZodObject<{
1877
+ edit: z.ZodBoolean;
1878
+ git_write: z.ZodBoolean;
1879
+ github_write: z.ZodBoolean;
1880
+ external_runtime: z.ZodBoolean;
1881
+ secrets: z.ZodBoolean;
1882
+ signing: z.ZodBoolean;
1883
+ release: z.ZodBoolean;
1884
+ }, z.core.$strict>;
1885
+ type AuthorityEnvelope = z.infer<typeof AuthorityEnvelope>;
1886
+ declare const WorkItem_v1: z.ZodObject<{
1887
+ schema_version: z.ZodLiteral<"1.0.0">;
1888
+ work_item_id: z.ZodString;
1889
+ revision: z.ZodNumber;
1890
+ source: z.ZodObject<{
1891
+ kind: z.ZodEnum<{
1892
+ manual: "manual";
1893
+ github: "github";
1894
+ jira: "jira";
1895
+ }>;
1896
+ external_id: z.ZodString;
1897
+ revision: z.ZodString;
1898
+ url: z.ZodOptional<z.ZodString>;
1899
+ captured_at: z.ZodString;
1900
+ }, z.core.$strict>;
1901
+ repository: z.ZodObject<{
1902
+ id: z.ZodString;
1903
+ remote_url: z.ZodOptional<z.ZodString>;
1904
+ default_branch: z.ZodOptional<z.ZodString>;
1905
+ }, z.core.$strict>;
1906
+ title: z.ZodString;
1907
+ objective: z.ZodString;
1908
+ description: z.ZodString;
1909
+ acceptance_criteria: z.ZodArray<z.ZodObject<{
1910
+ id: z.ZodString;
1911
+ text: z.ZodString;
1912
+ }, z.core.$strict>>;
1913
+ constraints: z.ZodArray<z.ZodString>;
1914
+ labels: z.ZodArray<z.ZodString>;
1915
+ dependencies: z.ZodArray<z.ZodString>;
1916
+ }, z.core.$strict>;
1917
+ type WorkItem_v1 = z.infer<typeof WorkItem_v1>;
1918
+ declare const RunStatus: z.ZodEnum<{
1919
+ created: "created";
1920
+ blocked: "blocked";
1921
+ completed: "completed";
1922
+ planning: "planning";
1923
+ ready: "ready";
1924
+ verifying: "verifying";
1925
+ failed: "failed";
1926
+ paused: "paused";
1927
+ cancelled: "cancelled";
1928
+ executing: "executing";
1929
+ delivering: "delivering";
1930
+ awaiting_human: "awaiting_human";
1931
+ }>;
1932
+ type RunStatus = z.infer<typeof RunStatus>;
1933
+ /** Canonical orchestration state for one immutable WorkItem revision. */
1934
+ declare const Run_v1: z.ZodObject<{
1935
+ schema_version: z.ZodLiteral<"1.0.0">;
1936
+ run_id: z.ZodString;
1937
+ revision: z.ZodNumber;
1938
+ work_item_id: z.ZodString;
1939
+ work_item_revision: z.ZodNumber;
1940
+ control_mode: z.ZodEnum<{
1941
+ assisted: "assisted";
1942
+ headless: "headless";
1946
1943
  }>;
1947
- /**
1948
- * Get a specific pull request by number
1949
- */
1950
- getPullRequest(prNumber: number): Promise<GitHubPullRequest | null>;
1951
- /**
1952
- * Update a pull request (e.g., to undraft it)
1953
- */
1954
- updatePullRequest(owner: string, repo: string, prNumber: number, updates: {
1955
- draft?: boolean;
1956
- title?: string;
1957
- body?: string;
1958
- }): Promise<void>;
1959
- /**
1960
- * Add a label to a pull request
1961
- */
1962
- addLabel(prNumber: number, label: string): Promise<void>;
1963
- /**
1964
- * Remove a label from a pull request
1965
- */
1966
- removeLabel(prNumber: number, label: string): Promise<void>;
1967
- /**
1968
- * Get labels for a pull request
1969
- */
1970
- getLabels(prNumber: number): Promise<string[]>;
1971
- /**
1972
- * Get repository info (for harvest)
1973
- */
1974
- getRepository(): Promise<{
1975
- default_branch: string;
1976
- [key: string]: any;
1944
+ authority_ceiling: z.ZodObject<{
1945
+ edit: z.ZodBoolean;
1946
+ git_write: z.ZodBoolean;
1947
+ github_write: z.ZodBoolean;
1948
+ external_runtime: z.ZodBoolean;
1949
+ secrets: z.ZodBoolean;
1950
+ signing: z.ZodBoolean;
1951
+ release: z.ZodBoolean;
1952
+ }, z.core.$strict>;
1953
+ status: z.ZodEnum<{
1954
+ created: "created";
1955
+ blocked: "blocked";
1956
+ completed: "completed";
1957
+ planning: "planning";
1958
+ ready: "ready";
1959
+ verifying: "verifying";
1960
+ failed: "failed";
1961
+ paused: "paused";
1962
+ cancelled: "cancelled";
1963
+ executing: "executing";
1964
+ delivering: "delivering";
1965
+ awaiting_human: "awaiting_human";
1977
1966
  }>;
1978
- /**
1979
- * Get a git reference (branch/tag SHA)
1980
- */
1981
- getRef(ref: string): Promise<{
1982
- object: {
1983
- sha: string;
1984
- };
1967
+ active_controller_lease_id: z.ZodOptional<z.ZodString>;
1968
+ attempt_ids: z.ZodArray<z.ZodString>;
1969
+ current_attempt_id: z.ZodOptional<z.ZodString>;
1970
+ resume_status: z.ZodOptional<z.ZodEnum<{
1971
+ planning: "planning";
1972
+ ready: "ready";
1973
+ verifying: "verifying";
1974
+ executing: "executing";
1975
+ delivering: "delivering";
1976
+ }>>;
1977
+ created_at: z.ZodString;
1978
+ updated_at: z.ZodString;
1979
+ completed_at: z.ZodOptional<z.ZodString>;
1980
+ }, z.core.$strict>;
1981
+ type Run_v1 = z.infer<typeof Run_v1>;
1982
+ declare const AttemptStatus: z.ZodEnum<{
1983
+ blocked: "blocked";
1984
+ verifying: "verifying";
1985
+ verified: "verified";
1986
+ failed: "failed";
1987
+ cancelled: "cancelled";
1988
+ prepared: "prepared";
1989
+ leased: "leased";
1990
+ launching: "launching";
1991
+ running: "running";
1992
+ receipt_submitted: "receipt_submitted";
1993
+ accepted: "accepted";
1994
+ rejected: "rejected";
1995
+ inconclusive: "inconclusive";
1996
+ launch_failed: "launch_failed";
1997
+ quarantined: "quarantined";
1998
+ }>;
1999
+ type AttemptStatus = z.infer<typeof AttemptStatus>;
2000
+ declare function attemptStatusRequiresReceipt(status: AttemptStatus): boolean;
2001
+ declare function attemptStatusRequiresVerification(status: AttemptStatus): boolean;
2002
+ declare function isTerminalAttemptStatus(status: AttemptStatus): boolean;
2003
+ /** One worker try, bound to one immutable packet and pinned repository base. */
2004
+ declare const Attempt_v1: z.ZodObject<{
2005
+ schema_version: z.ZodLiteral<"1.0.0">;
2006
+ attempt_id: z.ZodString;
2007
+ revision: z.ZodNumber;
2008
+ run_id: z.ZodString;
2009
+ run_revision: z.ZodNumber;
2010
+ work_item_id: z.ZodString;
2011
+ work_item_revision: z.ZodNumber;
2012
+ packet_id: z.ZodString;
2013
+ packet_hash: z.ZodString;
2014
+ base_sha: z.ZodString;
2015
+ workspace_lease_id: z.ZodOptional<z.ZodString>;
2016
+ receipt_id: z.ZodOptional<z.ZodString>;
2017
+ verification_id: z.ZodOptional<z.ZodString>;
2018
+ status: z.ZodEnum<{
2019
+ blocked: "blocked";
2020
+ verifying: "verifying";
2021
+ verified: "verified";
2022
+ failed: "failed";
2023
+ cancelled: "cancelled";
2024
+ prepared: "prepared";
2025
+ leased: "leased";
2026
+ launching: "launching";
2027
+ running: "running";
2028
+ receipt_submitted: "receipt_submitted";
2029
+ accepted: "accepted";
2030
+ rejected: "rejected";
2031
+ inconclusive: "inconclusive";
2032
+ launch_failed: "launch_failed";
2033
+ quarantined: "quarantined";
1985
2034
  }>;
1986
- /**
1987
- * Get check runs for a commit SHA
1988
- */
1989
- getCheckRuns(sha: string): Promise<{
1990
- total_count: number;
1991
- check_runs: Array<{
1992
- status: string;
1993
- conclusion: string | null;
2035
+ created_at: z.ZodString;
2036
+ updated_at: z.ZodString;
2037
+ completed_at: z.ZodOptional<z.ZodString>;
2038
+ }, z.core.$strict>;
2039
+ type Attempt_v1 = z.infer<typeof Attempt_v1>;
2040
+ declare const AttemptRetryDeltaDimension_v1: z.ZodEnum<{
2041
+ strategy: "strategy";
2042
+ environment: "environment";
2043
+ evidence: "evidence";
2044
+ premise: "premise";
2045
+ inputs: "inputs";
2046
+ authority: "authority";
2047
+ worker_runtime: "worker_runtime";
2048
+ }>;
2049
+ type AttemptRetryDeltaDimension_v1 = z.infer<typeof AttemptRetryDeltaDimension_v1>;
2050
+ /** Immutable fail-forward justification for creating a later Attempt. */
2051
+ declare const AttemptRetryDelta_v1: z.ZodObject<{
2052
+ schema_version: z.ZodLiteral<"1.0.0">;
2053
+ previous_attempt_id: z.ZodString;
2054
+ next_attempt_id: z.ZodString;
2055
+ work_item_id: z.ZodString;
2056
+ work_item_revision: z.ZodNumber;
2057
+ changes: z.ZodArray<z.ZodObject<{
2058
+ dimension: z.ZodEnum<{
2059
+ strategy: "strategy";
2060
+ environment: "environment";
2061
+ evidence: "evidence";
2062
+ premise: "premise";
2063
+ inputs: "inputs";
2064
+ authority: "authority";
2065
+ worker_runtime: "worker_runtime";
1994
2066
  }>;
2067
+ before_hash: z.ZodString;
2068
+ after_hash: z.ZodString;
2069
+ }, z.core.$strict>>;
2070
+ inherited_evidence: z.ZodArray<z.ZodObject<{
2071
+ kind: z.ZodEnum<{
2072
+ verification: "verification";
2073
+ receipt: "receipt";
2074
+ fan_in_decision: "fan_in_decision";
2075
+ artifact: "artifact";
2076
+ observation: "observation";
2077
+ deviation: "deviation";
2078
+ }>;
2079
+ id: z.ZodString;
2080
+ hash: z.ZodString;
2081
+ }, z.core.$strict>>;
2082
+ policy_exception: z.ZodOptional<z.ZodObject<{
2083
+ policy_id: z.ZodString;
2084
+ reason: z.ZodString;
2085
+ }, z.core.$strict>>;
2086
+ summary: z.ZodString;
2087
+ created_at: z.ZodString;
2088
+ }, z.core.$strict>;
2089
+ type AttemptRetryDelta_v1 = z.infer<typeof AttemptRetryDelta_v1>;
2090
+ declare const FanoutRationale_v1: z.ZodEnum<{
2091
+ separable_work: "separable_work";
2092
+ hypothesis_diversity: "hypothesis_diversity";
2093
+ independent_review: "independent_review";
2094
+ risk_reduction: "risk_reduction";
2095
+ best_of_n: "best_of_n";
2096
+ }>;
2097
+ type FanoutRationale_v1 = z.infer<typeof FanoutRationale_v1>;
2098
+ declare const FanoutSelectionCriterion_v1: z.ZodEnum<{
2099
+ verification_outcome: "verification_outcome";
2100
+ trust_gap_count: "trust_gap_count";
2101
+ verified_result_identity: "verified_result_identity";
2102
+ }>;
2103
+ type FanoutSelectionCriterion_v1 = z.infer<typeof FanoutSelectionCriterion_v1>;
2104
+ declare const STRICT_FANOUT_SELECTION_CRITERIA: readonly ["verification_outcome", "trust_gap_count", "verified_result_identity"];
2105
+ declare const FanoutPremise_v1: z.ZodObject<{
2106
+ premise_id: z.ZodString;
2107
+ attempt_id: z.ZodString;
2108
+ strategy_hash: z.ZodString;
2109
+ summary: z.ZodString;
2110
+ }, z.core.$strict>;
2111
+ type FanoutPremise_v1 = z.infer<typeof FanoutPremise_v1>;
2112
+ /** Immutable one-level fanout declaration. It is scheduling intent, not acceptance truth. */
2113
+ declare const AgentWorkFanoutPlan_v1: z.ZodPipe<z.ZodObject<{
2114
+ schema_version: z.ZodLiteral<"1.0.0">;
2115
+ fanout_id: z.ZodString;
2116
+ run_id: z.ZodString;
2117
+ work_item_id: z.ZodString;
2118
+ work_item_revision: z.ZodNumber;
2119
+ rationale: z.ZodEnum<{
2120
+ separable_work: "separable_work";
2121
+ hypothesis_diversity: "hypothesis_diversity";
2122
+ independent_review: "independent_review";
2123
+ risk_reduction: "risk_reduction";
2124
+ best_of_n: "best_of_n";
1995
2125
  }>;
1996
- /**
1997
- * Get reviews for a pull request
1998
- */
1999
- getReviews(prNumber: number): Promise<Array<{
2000
- user: {
2001
- login: string;
2002
- } | null;
2003
- state: string;
2126
+ selection_criteria: z.ZodArray<z.ZodEnum<{
2127
+ verification_outcome: "verification_outcome";
2128
+ trust_gap_count: "trust_gap_count";
2129
+ verified_result_identity: "verified_result_identity";
2004
2130
  }>>;
2005
- /**
2006
- * Compare two commits
2007
- */
2008
- compare(base: string, head: string): Promise<{
2009
- merge_base_commit?: {
2010
- sha: string;
2011
- };
2131
+ budget: z.ZodObject<{
2132
+ max_attempts: z.ZodNumber;
2133
+ max_concurrency: z.ZodNumber;
2134
+ max_elapsed_ms: z.ZodNumber;
2135
+ max_context_bytes_per_attempt: z.ZodNumber;
2136
+ max_judging_cost_units: z.ZodNumber;
2137
+ }, z.core.$strict>;
2138
+ premises: z.ZodArray<z.ZodObject<{
2139
+ premise_id: z.ZodString;
2140
+ attempt_id: z.ZodString;
2141
+ strategy_hash: z.ZodString;
2142
+ summary: z.ZodString;
2143
+ }, z.core.$strict>>;
2144
+ direct_worker_communication: z.ZodEnum<{
2145
+ forbidden: "forbidden";
2146
+ brokered: "brokered";
2012
2147
  }>;
2013
- /**
2014
- * List issues (excluding PRs if filtered by caller)
2015
- */
2016
- listIssues(options: {
2017
- state: "open" | "closed" | "all";
2018
- }): Promise<any[]>;
2019
- /**
2020
- * Update a pull request's branch with the latest changes from the base branch
2021
- * This is typically used after merging another PR to keep branches up to date
2022
- */
2023
- updatePullRequestBranch(owner: string, repo: string, prNumber: number): Promise<void>;
2024
- /**
2025
- * Merge a pull request
2026
- */
2027
- mergePullRequest(owner: string, repo: string, prNumber: number, options: {
2028
- method: "squash" | "merge" | "rebase";
2029
- commitTitle?: string;
2030
- }): Promise<boolean>;
2031
- /**
2032
- * Get commit status for a SHA
2033
- */
2034
- getCommitStatus(owner: string, repo: string, ref: string): Promise<{
2035
- state: string;
2036
- statuses: any[];
2148
+ created_at: z.ZodString;
2149
+ }, z.core.$strict>, z.ZodTransform<{
2150
+ selection_criteria: ("verification_outcome" | "trust_gap_count" | "verified_result_identity")[];
2151
+ premises: {
2152
+ premise_id: string;
2153
+ attempt_id: string;
2154
+ strategy_hash: string;
2155
+ summary: string;
2156
+ }[];
2157
+ schema_version: "1.0.0";
2158
+ fanout_id: string;
2159
+ run_id: string;
2160
+ work_item_id: string;
2161
+ work_item_revision: number;
2162
+ rationale: "separable_work" | "hypothesis_diversity" | "independent_review" | "risk_reduction" | "best_of_n";
2163
+ budget: {
2164
+ max_attempts: number;
2165
+ max_concurrency: number;
2166
+ max_elapsed_ms: number;
2167
+ max_context_bytes_per_attempt: number;
2168
+ max_judging_cost_units: number;
2169
+ };
2170
+ direct_worker_communication: "forbidden" | "brokered";
2171
+ created_at: string;
2172
+ }, {
2173
+ schema_version: "1.0.0";
2174
+ fanout_id: string;
2175
+ run_id: string;
2176
+ work_item_id: string;
2177
+ work_item_revision: number;
2178
+ rationale: "separable_work" | "hypothesis_diversity" | "independent_review" | "risk_reduction" | "best_of_n";
2179
+ selection_criteria: ("verification_outcome" | "trust_gap_count" | "verified_result_identity")[];
2180
+ budget: {
2181
+ max_attempts: number;
2182
+ max_concurrency: number;
2183
+ max_elapsed_ms: number;
2184
+ max_context_bytes_per_attempt: number;
2185
+ max_judging_cost_units: number;
2186
+ };
2187
+ premises: {
2188
+ premise_id: string;
2189
+ attempt_id: string;
2190
+ strategy_hash: string;
2191
+ summary: string;
2192
+ }[];
2193
+ direct_worker_communication: "forbidden" | "brokered";
2194
+ created_at: string;
2195
+ }>>;
2196
+ type AgentWorkFanoutPlan_v1 = z.infer<typeof AgentWorkFanoutPlan_v1>;
2197
+ /** Exact plan slot persisted atomically with a sibling Attempt. */
2198
+ declare const FanoutAttemptBinding_v1: z.ZodObject<{
2199
+ schema_version: z.ZodLiteral<"1.0.0">;
2200
+ fanout_id: z.ZodString;
2201
+ fanout_plan_hash: z.ZodString;
2202
+ premise_id: z.ZodString;
2203
+ premise_hash: z.ZodString;
2204
+ attempt_id: z.ZodString;
2205
+ }, z.core.$strict>;
2206
+ type FanoutAttemptBinding_v1 = z.infer<typeof FanoutAttemptBinding_v1>;
2207
+ declare const FanInCandidateConclusion_v1: z.ZodEnum<{
2208
+ rejected: "rejected";
2209
+ selected: "selected";
2210
+ equivalent: "equivalent";
2211
+ unselected: "unselected";
2212
+ missing_evidence: "missing_evidence";
2213
+ }>;
2214
+ type FanInCandidateConclusion_v1 = z.infer<typeof FanInCandidateConclusion_v1>;
2215
+ /** Engine-owned deterministic comparison of a complete bounded fanout evidence set. */
2216
+ declare const AgentWorkFanInDecision_v1: z.ZodPipe<z.ZodObject<{
2217
+ schema_version: z.ZodLiteral<"1.0.0">;
2218
+ decision_id: z.ZodString;
2219
+ fanout_id: z.ZodString;
2220
+ fanout_plan_hash: z.ZodString;
2221
+ run_id: z.ZodString;
2222
+ work_item_id: z.ZodString;
2223
+ work_item_revision: z.ZodNumber;
2224
+ policy_id: z.ZodLiteral<"lexrunner.engine-fanin.strict">;
2225
+ policy_version: z.ZodLiteral<"1.0.0">;
2226
+ selection_criteria: z.ZodArray<z.ZodEnum<{
2227
+ verification_outcome: "verification_outcome";
2228
+ trust_gap_count: "trust_gap_count";
2229
+ verified_result_identity: "verified_result_identity";
2230
+ }>>;
2231
+ decision: z.ZodEnum<{
2232
+ escalated: "escalated";
2233
+ selected: "selected";
2234
+ no_viable_candidate: "no_viable_candidate";
2037
2235
  }>;
2038
- }
2039
- /**
2040
- * Create GitHub API client from environment and config
2041
- */
2042
- declare function createGitHubAPI(): Promise<GitHubAPI | null>;
2043
-
2044
- /**
2045
- * GitHub API integration types
2046
- * Defines data structures for PR metadata and repository information
2047
- */
2048
- interface RepositoryInfo {
2049
- owner: string;
2050
- repo: string;
2051
- defaultBranch: string;
2052
- url: string;
2053
- }
2054
- interface PullRequest {
2236
+ selected_attempt_id: z.ZodOptional<z.ZodString>;
2237
+ candidates: z.ZodArray<z.ZodObject<{
2238
+ attempt_id: z.ZodString;
2239
+ premise_id: z.ZodString;
2240
+ attempt_status: z.ZodEnum<{
2241
+ blocked: "blocked";
2242
+ verifying: "verifying";
2243
+ verified: "verified";
2244
+ failed: "failed";
2245
+ cancelled: "cancelled";
2246
+ prepared: "prepared";
2247
+ leased: "leased";
2248
+ launching: "launching";
2249
+ running: "running";
2250
+ receipt_submitted: "receipt_submitted";
2251
+ accepted: "accepted";
2252
+ rejected: "rejected";
2253
+ inconclusive: "inconclusive";
2254
+ launch_failed: "launch_failed";
2255
+ quarantined: "quarantined";
2256
+ }>;
2257
+ receipt_id: z.ZodOptional<z.ZodString>;
2258
+ receipt_hash: z.ZodOptional<z.ZodString>;
2259
+ verification_id: z.ZodOptional<z.ZodString>;
2260
+ verification_hash: z.ZodOptional<z.ZodString>;
2261
+ verification_outcome: z.ZodOptional<z.ZodEnum<{
2262
+ pass: "pass";
2263
+ fail: "fail";
2264
+ cancelled: "cancelled";
2265
+ inconclusive: "inconclusive";
2266
+ infrastructure_error: "infrastructure_error";
2267
+ }>>;
2268
+ verified_result_identity: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodString]>>;
2269
+ trust_gap_count: z.ZodNumber;
2270
+ conclusion: z.ZodEnum<{
2271
+ rejected: "rejected";
2272
+ selected: "selected";
2273
+ equivalent: "equivalent";
2274
+ unselected: "unselected";
2275
+ missing_evidence: "missing_evidence";
2276
+ }>;
2277
+ reason_codes: z.ZodArray<z.ZodString>;
2278
+ artifact_refs: z.ZodArray<z.ZodString>;
2279
+ }, z.core.$strict>>;
2280
+ conflicts: z.ZodArray<z.ZodString>;
2281
+ uncertainty: z.ZodArray<z.ZodString>;
2282
+ evidence_set_hash: z.ZodString;
2283
+ summary: z.ZodString;
2284
+ created_at: z.ZodString;
2285
+ }, z.core.$strict>, z.ZodTransform<{
2286
+ selection_criteria: ("verification_outcome" | "trust_gap_count" | "verified_result_identity")[];
2287
+ candidates: {
2288
+ attempt_id: string;
2289
+ premise_id: string;
2290
+ attempt_status: "blocked" | "verifying" | "verified" | "failed" | "cancelled" | "prepared" | "leased" | "launching" | "running" | "receipt_submitted" | "accepted" | "rejected" | "inconclusive" | "launch_failed" | "quarantined";
2291
+ trust_gap_count: number;
2292
+ conclusion: "rejected" | "selected" | "equivalent" | "unselected" | "missing_evidence";
2293
+ reason_codes: string[];
2294
+ artifact_refs: string[];
2295
+ receipt_id?: string | undefined;
2296
+ receipt_hash?: string | undefined;
2297
+ verification_id?: string | undefined;
2298
+ verification_hash?: string | undefined;
2299
+ verification_outcome?: "pass" | "fail" | "cancelled" | "inconclusive" | "infrastructure_error" | undefined;
2300
+ verified_result_identity?: string | undefined;
2301
+ }[];
2302
+ conflicts: string[];
2303
+ uncertainty: string[];
2304
+ schema_version: "1.0.0";
2305
+ decision_id: string;
2306
+ fanout_id: string;
2307
+ fanout_plan_hash: string;
2308
+ run_id: string;
2309
+ work_item_id: string;
2310
+ work_item_revision: number;
2311
+ policy_id: "lexrunner.engine-fanin.strict";
2312
+ policy_version: "1.0.0";
2313
+ decision: "escalated" | "selected" | "no_viable_candidate";
2314
+ evidence_set_hash: string;
2315
+ summary: string;
2316
+ created_at: string;
2317
+ selected_attempt_id?: string | undefined;
2318
+ }, {
2319
+ schema_version: "1.0.0";
2320
+ decision_id: string;
2321
+ fanout_id: string;
2322
+ fanout_plan_hash: string;
2323
+ run_id: string;
2324
+ work_item_id: string;
2325
+ work_item_revision: number;
2326
+ policy_id: "lexrunner.engine-fanin.strict";
2327
+ policy_version: "1.0.0";
2328
+ selection_criteria: ("verification_outcome" | "trust_gap_count" | "verified_result_identity")[];
2329
+ decision: "escalated" | "selected" | "no_viable_candidate";
2330
+ candidates: {
2331
+ attempt_id: string;
2332
+ premise_id: string;
2333
+ attempt_status: "blocked" | "verifying" | "verified" | "failed" | "cancelled" | "prepared" | "leased" | "launching" | "running" | "receipt_submitted" | "accepted" | "rejected" | "inconclusive" | "launch_failed" | "quarantined";
2334
+ trust_gap_count: number;
2335
+ conclusion: "rejected" | "selected" | "equivalent" | "unselected" | "missing_evidence";
2336
+ reason_codes: string[];
2337
+ artifact_refs: string[];
2338
+ receipt_id?: string | undefined;
2339
+ receipt_hash?: string | undefined;
2340
+ verification_id?: string | undefined;
2341
+ verification_hash?: string | undefined;
2342
+ verification_outcome?: "pass" | "fail" | "cancelled" | "inconclusive" | "infrastructure_error" | undefined;
2343
+ verified_result_identity?: string | undefined;
2344
+ }[];
2345
+ conflicts: string[];
2346
+ uncertainty: string[];
2347
+ evidence_set_hash: string;
2348
+ summary: string;
2349
+ created_at: string;
2350
+ selected_attempt_id?: string | undefined;
2351
+ }>>;
2352
+ type AgentWorkFanInDecision_v1 = z.infer<typeof AgentWorkFanInDecision_v1>;
2353
+ declare function computeFanInEvidenceSetHash(candidates: AgentWorkFanInDecision_v1["candidates"]): string;
2354
+ /** Portable packet content before LexRunner derives and verifies packet_hash. */
2355
+ declare const AgentTaskPacketHashInput_v1: z.ZodObject<{
2356
+ objective: z.ZodString;
2357
+ run_id: z.ZodString;
2358
+ created_at: z.ZodString;
2359
+ repository: z.ZodObject<{
2360
+ id: z.ZodString;
2361
+ remote_url: z.ZodOptional<z.ZodString>;
2362
+ default_branch: z.ZodOptional<z.ZodString>;
2363
+ base_sha: z.ZodString;
2364
+ }, z.core.$strict>;
2365
+ scope: z.ZodObject<{
2366
+ read_globs: z.ZodArray<z.ZodString>;
2367
+ write_globs: z.ZodArray<z.ZodString>;
2368
+ deny_globs: z.ZodArray<z.ZodString>;
2369
+ cross_repo_allowed: z.ZodBoolean;
2370
+ }, z.core.$strict>;
2371
+ schema_version: z.ZodLiteral<"1.0.0">;
2372
+ budget: z.ZodObject<{
2373
+ max_tokens: z.ZodOptional<z.ZodNumber>;
2374
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
2375
+ max_elapsed_ms: z.ZodOptional<z.ZodNumber>;
2376
+ }, z.core.$strict>;
2377
+ verification: z.ZodArray<z.ZodObject<{
2378
+ id: z.ZodString;
2379
+ argv: z.ZodArray<z.ZodString>;
2380
+ cwd_rel: z.ZodOptional<z.ZodString>;
2381
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
2382
+ expected_exit_codes: z.ZodArray<z.ZodNumber>;
2383
+ }, z.core.$strict>>;
2384
+ acceptance_criteria: z.ZodArray<z.ZodObject<{
2385
+ id: z.ZodString;
2386
+ text: z.ZodString;
2387
+ }, z.core.$strict>>;
2388
+ attempt_id: z.ZodString;
2389
+ packet_id: z.ZodString;
2390
+ authority: z.ZodObject<{
2391
+ edit: z.ZodBoolean;
2392
+ git_write: z.ZodBoolean;
2393
+ github_write: z.ZodBoolean;
2394
+ external_runtime: z.ZodBoolean;
2395
+ secrets: z.ZodBoolean;
2396
+ signing: z.ZodBoolean;
2397
+ release: z.ZodBoolean;
2398
+ }, z.core.$strict>;
2399
+ work_item: z.ZodObject<{
2400
+ work_item_id: z.ZodString;
2401
+ revision: z.ZodNumber;
2402
+ }, z.core.$strict>;
2403
+ instructions: z.ZodArray<z.ZodString>;
2404
+ preparation: z.ZodOptional<z.ZodObject<{
2405
+ policy: z.ZodObject<{
2406
+ network: z.ZodEnum<{
2407
+ forbidden: "forbidden";
2408
+ registry_only: "registry_only";
2409
+ }>;
2410
+ registries: z.ZodArray<z.ZodString>;
2411
+ cache: z.ZodEnum<{
2412
+ disabled: "disabled";
2413
+ read_only: "read_only";
2414
+ read_write: "read_write";
2415
+ }>;
2416
+ lifecycle_scripts: z.ZodEnum<{
2417
+ allowed: "allowed";
2418
+ forbidden: "forbidden";
2419
+ }>;
2420
+ }, z.core.$strict>;
2421
+ steps: z.ZodArray<z.ZodObject<{
2422
+ id: z.ZodString;
2423
+ kind: z.ZodEnum<{
2424
+ build: "build";
2425
+ provision: "provision";
2426
+ }>;
2427
+ argv: z.ZodArray<z.ZodString>;
2428
+ cwd_rel: z.ZodOptional<z.ZodString>;
2429
+ depends_on: z.ZodArray<z.ZodString>;
2430
+ expected_exit_codes: z.ZodArray<z.ZodNumber>;
2431
+ }, z.core.$strict>>;
2432
+ }, z.core.$strict>>;
2433
+ }, z.core.$strict>;
2434
+ declare const AgentTaskPacket_v1: z.ZodObject<{
2435
+ schema_version: z.ZodLiteral<"1.0.0">;
2436
+ packet_id: z.ZodString;
2437
+ run_id: z.ZodString;
2438
+ work_item: z.ZodObject<{
2439
+ work_item_id: z.ZodString;
2440
+ revision: z.ZodNumber;
2441
+ }, z.core.$strict>;
2442
+ attempt_id: z.ZodString;
2443
+ repository: z.ZodObject<{
2444
+ id: z.ZodString;
2445
+ remote_url: z.ZodOptional<z.ZodString>;
2446
+ default_branch: z.ZodOptional<z.ZodString>;
2447
+ base_sha: z.ZodString;
2448
+ }, z.core.$strict>;
2449
+ objective: z.ZodString;
2450
+ acceptance_criteria: z.ZodArray<z.ZodObject<{
2451
+ id: z.ZodString;
2452
+ text: z.ZodString;
2453
+ }, z.core.$strict>>;
2454
+ instructions: z.ZodArray<z.ZodString>;
2455
+ scope: z.ZodObject<{
2456
+ read_globs: z.ZodArray<z.ZodString>;
2457
+ write_globs: z.ZodArray<z.ZodString>;
2458
+ deny_globs: z.ZodArray<z.ZodString>;
2459
+ cross_repo_allowed: z.ZodBoolean;
2460
+ }, z.core.$strict>;
2461
+ authority: z.ZodObject<{
2462
+ edit: z.ZodBoolean;
2463
+ git_write: z.ZodBoolean;
2464
+ github_write: z.ZodBoolean;
2465
+ external_runtime: z.ZodBoolean;
2466
+ secrets: z.ZodBoolean;
2467
+ signing: z.ZodBoolean;
2468
+ release: z.ZodBoolean;
2469
+ }, z.core.$strict>;
2470
+ preparation: z.ZodOptional<z.ZodObject<{
2471
+ policy: z.ZodObject<{
2472
+ network: z.ZodEnum<{
2473
+ forbidden: "forbidden";
2474
+ registry_only: "registry_only";
2475
+ }>;
2476
+ registries: z.ZodArray<z.ZodString>;
2477
+ cache: z.ZodEnum<{
2478
+ disabled: "disabled";
2479
+ read_only: "read_only";
2480
+ read_write: "read_write";
2481
+ }>;
2482
+ lifecycle_scripts: z.ZodEnum<{
2483
+ allowed: "allowed";
2484
+ forbidden: "forbidden";
2485
+ }>;
2486
+ }, z.core.$strict>;
2487
+ steps: z.ZodArray<z.ZodObject<{
2488
+ id: z.ZodString;
2489
+ kind: z.ZodEnum<{
2490
+ build: "build";
2491
+ provision: "provision";
2492
+ }>;
2493
+ argv: z.ZodArray<z.ZodString>;
2494
+ cwd_rel: z.ZodOptional<z.ZodString>;
2495
+ depends_on: z.ZodArray<z.ZodString>;
2496
+ expected_exit_codes: z.ZodArray<z.ZodNumber>;
2497
+ }, z.core.$strict>>;
2498
+ }, z.core.$strict>>;
2499
+ verification: z.ZodArray<z.ZodObject<{
2500
+ id: z.ZodString;
2501
+ argv: z.ZodArray<z.ZodString>;
2502
+ cwd_rel: z.ZodOptional<z.ZodString>;
2503
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
2504
+ expected_exit_codes: z.ZodArray<z.ZodNumber>;
2505
+ }, z.core.$strict>>;
2506
+ budget: z.ZodObject<{
2507
+ max_tokens: z.ZodOptional<z.ZodNumber>;
2508
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
2509
+ max_elapsed_ms: z.ZodOptional<z.ZodNumber>;
2510
+ }, z.core.$strict>;
2511
+ created_at: z.ZodString;
2512
+ packet_hash: z.ZodString;
2513
+ }, z.core.$strict>;
2514
+ type AgentTaskPacket_v1 = z.infer<typeof AgentTaskPacket_v1>;
2515
+ type AgentTaskPacketHashInput = z.infer<typeof AgentTaskPacketHashInput_v1>;
2516
+ declare function computeAgentTaskPacketHash(packet: AgentTaskPacketHashInput): string;
2517
+ declare function createAgentTaskPacket(packet: AgentTaskPacketHashInput): AgentTaskPacket_v1;
2518
+ declare const AgentWorkPreparationReceipt_v1: z.ZodObject<{
2519
+ schema_version: z.ZodLiteral<"1.0.0">;
2520
+ receipt_id: z.ZodString;
2521
+ run_id: z.ZodString;
2522
+ attempt_id: z.ZodString;
2523
+ packet_id: z.ZodString;
2524
+ packet_hash: z.ZodString;
2525
+ preparation_plan_hash: z.ZodString;
2526
+ policy_hash: z.ZodString;
2527
+ outcome: z.ZodEnum<{
2528
+ failed: "failed";
2529
+ passed: "passed";
2530
+ }>;
2531
+ steps: z.ZodArray<z.ZodObject<{
2532
+ id: z.ZodString;
2533
+ outcome: z.ZodEnum<{
2534
+ blocked: "blocked";
2535
+ failed: "failed";
2536
+ passed: "passed";
2537
+ }>;
2538
+ exit_code: z.ZodOptional<z.ZodNumber>;
2539
+ stdout_hash: z.ZodOptional<z.ZodString>;
2540
+ stderr_hash: z.ZodOptional<z.ZodString>;
2541
+ policy_hash: z.ZodOptional<z.ZodString>;
2542
+ }, z.core.$strict>>;
2543
+ started_at: z.ZodString;
2544
+ completed_at: z.ZodString;
2545
+ receipt_hash: z.ZodString;
2546
+ }, z.core.$strict>;
2547
+ type AgentWorkPreparationReceipt_v1 = z.infer<typeof AgentWorkPreparationReceipt_v1>;
2548
+ declare const ExecutionEnvironmentOS: z.ZodEnum<{
2549
+ darwin: "darwin";
2550
+ linux: "linux";
2551
+ other: "other";
2552
+ windows: "windows";
2553
+ }>;
2554
+ type ExecutionEnvironmentOS = z.infer<typeof ExecutionEnvironmentOS>;
2555
+ declare const ExecutionEnvelope_v1: z.ZodObject<{
2556
+ schema_version: z.ZodLiteral<"1.0.0">;
2557
+ envelope_id: z.ZodString;
2558
+ run_id: z.ZodString;
2559
+ attempt_id: z.ZodString;
2560
+ packet_id: z.ZodString;
2561
+ packet_hash: z.ZodString;
2562
+ workspace_lease_id: z.ZodString;
2563
+ workspace_lease_revision: z.ZodNumber;
2564
+ expected_head_sha: z.ZodString;
2565
+ branch: z.ZodOptional<z.ZodString>;
2566
+ runtime: z.ZodObject<{
2567
+ host_id: z.ZodString;
2568
+ os: z.ZodEnum<{
2569
+ darwin: "darwin";
2570
+ linux: "linux";
2571
+ other: "other";
2572
+ windows: "windows";
2573
+ }>;
2574
+ architecture: z.ZodString;
2575
+ worker_runtime: z.ZodString;
2576
+ git_runtime: z.ZodString;
2577
+ }, z.core.$strict>;
2578
+ paths: z.ZodObject<{
2579
+ project_root: z.ZodString;
2580
+ execution_root: z.ZodString;
2581
+ worktree_root: z.ZodString;
2582
+ }, z.core.$strict>;
2583
+ path_mappings: z.ZodArray<z.ZodObject<{
2584
+ runtime: z.ZodString;
2585
+ worktree_root: z.ZodString;
2586
+ }, z.core.$strict>>;
2587
+ exposed_environment_keys: z.ZodArray<z.ZodString>;
2588
+ created_at: z.ZodString;
2589
+ }, z.core.$strict>;
2590
+ type ExecutionEnvelope_v1 = z.infer<typeof ExecutionEnvelope_v1>;
2591
+ declare const ControllerLease_v1: z.ZodObject<{
2592
+ schema_version: z.ZodLiteral<"1.0.0">;
2593
+ lease_id: z.ZodString;
2594
+ run_id: z.ZodString;
2595
+ controller_id: z.ZodString;
2596
+ control_mode: z.ZodEnum<{
2597
+ assisted: "assisted";
2598
+ headless: "headless";
2599
+ }>;
2600
+ fence: z.ZodNumber;
2601
+ revision: z.ZodNumber;
2602
+ run_revision: z.ZodNumber;
2603
+ status: z.ZodEnum<{
2604
+ active: "active";
2605
+ released: "released";
2606
+ expired: "expired";
2607
+ revoked: "revoked";
2608
+ }>;
2609
+ acquired_at: z.ZodString;
2610
+ heartbeat_at: z.ZodString;
2611
+ expires_at: z.ZodString;
2612
+ released_at: z.ZodOptional<z.ZodString>;
2613
+ }, z.core.$strict>;
2614
+ type ControllerLease_v1 = z.infer<typeof ControllerLease_v1>;
2615
+ declare const WorkspaceLeaseStatus: z.ZodEnum<{
2616
+ verifying: "verifying";
2617
+ active: "active";
2618
+ receipt_submitted: "receipt_submitted";
2619
+ quarantined: "quarantined";
2620
+ released: "released";
2621
+ expired: "expired";
2622
+ reserved: "reserved";
2623
+ acquired: "acquired";
2624
+ preserved: "preserved";
2625
+ abandoned: "abandoned";
2626
+ }>;
2627
+ type WorkspaceLeaseStatus = z.infer<typeof WorkspaceLeaseStatus>;
2628
+ declare const WorkspaceCleanupDisposition: z.ZodEnum<{
2629
+ preserved: "preserved";
2630
+ abandoned: "abandoned";
2631
+ integrated: "integrated";
2632
+ discarded: "discarded";
2633
+ }>;
2634
+ type WorkspaceCleanupDisposition = z.infer<typeof WorkspaceCleanupDisposition>;
2635
+ declare const WorkspaceLease_v1: z.ZodObject<{
2636
+ schema_version: z.ZodLiteral<"1.0.0">;
2637
+ lease_id: z.ZodString;
2638
+ revision: z.ZodNumber;
2639
+ run_id: z.ZodString;
2640
+ run_revision: z.ZodNumber;
2641
+ work_item_id: z.ZodString;
2642
+ work_item_revision: z.ZodNumber;
2643
+ attempt_id: z.ZodString;
2644
+ controller_lease_id: z.ZodString;
2645
+ controller_fence: z.ZodNumber;
2646
+ packet_id: z.ZodString;
2647
+ packet_hash: z.ZodString;
2648
+ repository: z.ZodObject<{
2649
+ id: z.ZodString;
2650
+ remote_url: z.ZodOptional<z.ZodString>;
2651
+ default_branch: z.ZodOptional<z.ZodString>;
2652
+ }, z.core.$strict>;
2653
+ base_sha: z.ZodString;
2654
+ branch: z.ZodString;
2655
+ scope: z.ZodObject<{
2656
+ read_globs: z.ZodArray<z.ZodString>;
2657
+ write_globs: z.ZodArray<z.ZodString>;
2658
+ deny_globs: z.ZodArray<z.ZodString>;
2659
+ cross_repo_allowed: z.ZodBoolean;
2660
+ }, z.core.$strict>;
2661
+ authority: z.ZodObject<{
2662
+ edit: z.ZodBoolean;
2663
+ git_write: z.ZodBoolean;
2664
+ github_write: z.ZodBoolean;
2665
+ external_runtime: z.ZodBoolean;
2666
+ secrets: z.ZodBoolean;
2667
+ signing: z.ZodBoolean;
2668
+ release: z.ZodBoolean;
2669
+ }, z.core.$strict>;
2670
+ status: z.ZodEnum<{
2671
+ verifying: "verifying";
2672
+ active: "active";
2673
+ receipt_submitted: "receipt_submitted";
2674
+ quarantined: "quarantined";
2675
+ released: "released";
2676
+ expired: "expired";
2677
+ reserved: "reserved";
2678
+ acquired: "acquired";
2679
+ preserved: "preserved";
2680
+ abandoned: "abandoned";
2681
+ }>;
2682
+ acquired_at: z.ZodString;
2683
+ heartbeat_at: z.ZodString;
2684
+ expires_at: z.ZodString;
2685
+ released_at: z.ZodOptional<z.ZodString>;
2686
+ cleanup_disposition: z.ZodOptional<z.ZodEnum<{
2687
+ preserved: "preserved";
2688
+ abandoned: "abandoned";
2689
+ integrated: "integrated";
2690
+ discarded: "discarded";
2691
+ }>>;
2692
+ }, z.core.$strict>;
2693
+ type WorkspaceLease_v1 = z.infer<typeof WorkspaceLease_v1>;
2694
+ declare const WorkspaceAllocationStatus: z.ZodEnum<{
2695
+ active: "active";
2696
+ quarantined: "quarantined";
2697
+ released: "released";
2698
+ allocated: "allocated";
2699
+ }>;
2700
+ type WorkspaceAllocationStatus = z.infer<typeof WorkspaceAllocationStatus>;
2701
+ declare const WorkspaceAllocation_v1: z.ZodObject<{
2702
+ schema_version: z.ZodLiteral<"1.0.0">;
2703
+ allocation_id: z.ZodString;
2704
+ revision: z.ZodNumber;
2705
+ run_id: z.ZodString;
2706
+ attempt_id: z.ZodString;
2707
+ workspace_lease_id: z.ZodString;
2708
+ repository: z.ZodObject<{
2709
+ id: z.ZodString;
2710
+ remote_url: z.ZodOptional<z.ZodString>;
2711
+ default_branch: z.ZodOptional<z.ZodString>;
2712
+ }, z.core.$strict>;
2713
+ base_sha: z.ZodString;
2714
+ branch: z.ZodString;
2715
+ host_id: z.ZodString;
2716
+ git_runtime: z.ZodString;
2717
+ paths: z.ZodObject<{
2718
+ project_root: z.ZodString;
2719
+ worktree_root: z.ZodString;
2720
+ repository_git_common_dir: z.ZodString;
2721
+ worktree_git_dir: z.ZodString;
2722
+ }, z.core.$strict>;
2723
+ status: z.ZodEnum<{
2724
+ active: "active";
2725
+ quarantined: "quarantined";
2726
+ released: "released";
2727
+ allocated: "allocated";
2728
+ }>;
2729
+ observation: z.ZodOptional<z.ZodObject<{
2730
+ registration: z.ZodEnum<{
2731
+ missing: "missing";
2732
+ registered: "registered";
2733
+ unregistered: "unregistered";
2734
+ wrong_repository: "wrong_repository";
2735
+ wrong_branch: "wrong_branch";
2736
+ }>;
2737
+ cleanliness: z.ZodEnum<{
2738
+ unknown: "unknown";
2739
+ clean: "clean";
2740
+ dirty: "dirty";
2741
+ }>;
2742
+ observed_branch: z.ZodOptional<z.ZodString>;
2743
+ observed_head_sha: z.ZodOptional<z.ZodString>;
2744
+ observed_at: z.ZodString;
2745
+ }, z.core.$strict>>;
2746
+ quarantine_reason: z.ZodOptional<z.ZodEnum<{
2747
+ other: "other";
2748
+ missing: "missing";
2749
+ dirty: "dirty";
2750
+ expired: "expired";
2751
+ unregistered: "unregistered";
2752
+ wrong_repository: "wrong_repository";
2753
+ wrong_branch: "wrong_branch";
2754
+ identity_ambiguous: "identity_ambiguous";
2755
+ }>>;
2756
+ quarantine_evidence: z.ZodOptional<z.ZodArray<z.ZodString>>;
2757
+ allocated_at: z.ZodString;
2758
+ updated_at: z.ZodString;
2759
+ released_at: z.ZodOptional<z.ZodString>;
2760
+ quarantined_at: z.ZodOptional<z.ZodString>;
2761
+ }, z.core.$strict>;
2762
+ type WorkspaceAllocation_v1 = z.infer<typeof WorkspaceAllocation_v1>;
2763
+ declare const WorkerSessionBackend: z.ZodEnum<{
2764
+ external: "external";
2765
+ "host-subagent": "host-subagent";
2766
+ "codex-cli": "codex-cli";
2767
+ }>;
2768
+ type WorkerSessionBackend = z.infer<typeof WorkerSessionBackend>;
2769
+ declare const WorkerSessionStatus: z.ZodEnum<{
2770
+ completed: "completed";
2771
+ failed: "failed";
2772
+ cancelled: "cancelled";
2773
+ awaiting_human: "awaiting_human";
2774
+ running: "running";
2775
+ starting: "starting";
2776
+ lost: "lost";
2777
+ }>;
2778
+ type WorkerSessionStatus = z.infer<typeof WorkerSessionStatus>;
2779
+ declare const WorkerSession_v1: z.ZodObject<{
2780
+ schema_version: z.ZodLiteral<"1.0.0">;
2781
+ session_id: z.ZodString;
2782
+ run_id: z.ZodString;
2783
+ attempt_id: z.ZodString;
2784
+ packet_id: z.ZodString;
2785
+ packet_hash: z.ZodString;
2786
+ workspace_lease_id: z.ZodString;
2787
+ workspace_lease_revision: z.ZodNumber;
2788
+ execution_envelope_id: z.ZodString;
2789
+ worker: z.ZodObject<{
2790
+ backend: z.ZodEnum<{
2791
+ external: "external";
2792
+ "host-subagent": "host-subagent";
2793
+ "codex-cli": "codex-cli";
2794
+ }>;
2795
+ worker_id: z.ZodString;
2796
+ model: z.ZodOptional<z.ZodString>;
2797
+ }, z.core.$strict>;
2798
+ status: z.ZodEnum<{
2799
+ completed: "completed";
2800
+ failed: "failed";
2801
+ cancelled: "cancelled";
2802
+ awaiting_human: "awaiting_human";
2803
+ running: "running";
2804
+ starting: "starting";
2805
+ lost: "lost";
2806
+ }>;
2807
+ started_at: z.ZodString;
2808
+ heartbeat_at: z.ZodString;
2809
+ ended_at: z.ZodOptional<z.ZodString>;
2810
+ }, z.core.$strict>;
2811
+ type WorkerSession_v1 = z.infer<typeof WorkerSession_v1>;
2812
+ declare const ClaimedCheckOutcome: z.ZodEnum<{
2813
+ pass: "pass";
2814
+ fail: "fail";
2815
+ not_run: "not_run";
2816
+ }>;
2817
+ type ClaimedCheckOutcome = z.infer<typeof ClaimedCheckOutcome>;
2818
+ declare const AgentTaskReceiptOutcome: z.ZodEnum<{
2819
+ blocked: "blocked";
2820
+ completed: "completed";
2821
+ failed: "failed";
2822
+ cancelled: "cancelled";
2823
+ }>;
2824
+ type AgentTaskReceiptOutcome = z.infer<typeof AgentTaskReceiptOutcome>;
2825
+ declare const AgentTaskReceipt_v1: z.ZodObject<{
2826
+ schema_version: z.ZodLiteral<"1.0.0">;
2827
+ receipt_id: z.ZodString;
2828
+ run_id: z.ZodString;
2829
+ work_item_id: z.ZodString;
2830
+ attempt_id: z.ZodString;
2831
+ packet_id: z.ZodString;
2832
+ packet_hash: z.ZodString;
2833
+ workspace_lease_id: z.ZodString;
2834
+ workspace_lease_revision: z.ZodNumber;
2835
+ worker_session_id: z.ZodString;
2836
+ base_sha: z.ZodString;
2837
+ final_head_sha: z.ZodOptional<z.ZodString>;
2838
+ outcome: z.ZodEnum<{
2839
+ blocked: "blocked";
2840
+ completed: "completed";
2841
+ failed: "failed";
2842
+ cancelled: "cancelled";
2843
+ }>;
2844
+ summary: z.ZodString;
2845
+ files_touched: z.ZodArray<z.ZodString>;
2846
+ commits: z.ZodArray<z.ZodString>;
2847
+ acceptance_criteria_addressed: z.ZodArray<z.ZodString>;
2848
+ claimed_checks: z.ZodArray<z.ZodObject<{
2849
+ id: z.ZodString;
2850
+ outcome: z.ZodEnum<{
2851
+ pass: "pass";
2852
+ fail: "fail";
2853
+ not_run: "not_run";
2854
+ }>;
2855
+ exit_code: z.ZodOptional<z.ZodNumber>;
2856
+ output_snippet: z.ZodOptional<z.ZodString>;
2857
+ }, z.core.$strict>>;
2858
+ assumptions: z.ZodArray<z.ZodString>;
2859
+ blockers: z.ZodArray<z.ZodString>;
2860
+ human_action_request_ids: z.ZodArray<z.ZodString>;
2861
+ cost: z.ZodObject<{
2862
+ input_tokens: z.ZodOptional<z.ZodNumber>;
2863
+ output_tokens: z.ZodOptional<z.ZodNumber>;
2864
+ tool_calls: z.ZodOptional<z.ZodNumber>;
2865
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
2866
+ }, z.core.$strict>;
2867
+ submitted_at: z.ZodString;
2868
+ }, z.core.$strict>;
2869
+ type AgentTaskReceipt_v1 = z.infer<typeof AgentTaskReceipt_v1>;
2870
+ /**
2871
+ * Complete general-work receipt claim for durable ingestion.
2872
+ *
2873
+ * Every result carries a content identity even when the coordinator, rather
2874
+ * than the worker, owns Git commits. Claimed checks and result hashes remain
2875
+ * worker assertions; only AgentEngineVerification may establish truth.
2876
+ */
2877
+ declare const AgentTaskReceipt_v2: z.ZodPipe<z.ZodObject<{
2878
+ schema_version: z.ZodLiteral<"2.0.0">;
2879
+ receipt_id: z.ZodString;
2880
+ run_id: z.ZodString;
2881
+ work_item_id: z.ZodString;
2882
+ work_item_revision: z.ZodNumber;
2883
+ attempt_id: z.ZodString;
2884
+ packet_id: z.ZodString;
2885
+ packet_hash: z.ZodString;
2886
+ workspace_lease_id: z.ZodString;
2887
+ workspace_lease_revision: z.ZodNumber;
2888
+ worker_runtime: z.ZodString;
2889
+ worker_session_id: z.ZodString;
2890
+ observed_base_sha: z.ZodString;
2891
+ final_head_sha: z.ZodOptional<z.ZodString>;
2892
+ patch_hash: z.ZodOptional<z.ZodString>;
2893
+ outcome: z.ZodEnum<{
2894
+ blocked: "blocked";
2895
+ completed: "completed";
2896
+ failed: "failed";
2897
+ cancelled: "cancelled";
2898
+ }>;
2899
+ exit_reason: z.ZodString;
2900
+ summary: z.ZodString;
2901
+ files_touched: z.ZodArray<z.ZodString>;
2902
+ commits: z.ZodArray<z.ZodString>;
2903
+ acceptance_criteria_addressed: z.ZodArray<z.ZodString>;
2904
+ claimed_checks: z.ZodArray<z.ZodObject<{
2905
+ id: z.ZodString;
2906
+ outcome: z.ZodEnum<{
2907
+ pass: "pass";
2908
+ fail: "fail";
2909
+ not_run: "not_run";
2910
+ }>;
2911
+ exit_code: z.ZodOptional<z.ZodNumber>;
2912
+ output_snippet: z.ZodOptional<z.ZodString>;
2913
+ }, z.core.$strict>>;
2914
+ assumptions: z.ZodArray<z.ZodString>;
2915
+ blockers: z.ZodArray<z.ZodString>;
2916
+ human_action_request_ids: z.ZodArray<z.ZodString>;
2917
+ cost: z.ZodObject<{
2918
+ input_tokens: z.ZodOptional<z.ZodNumber>;
2919
+ output_tokens: z.ZodOptional<z.ZodNumber>;
2920
+ tool_calls: z.ZodOptional<z.ZodNumber>;
2921
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
2922
+ }, z.core.$strict>;
2923
+ worker_started_at: z.ZodString;
2924
+ worker_completed_at: z.ZodString;
2925
+ submitted_at: z.ZodString;
2926
+ }, z.core.$strict>, z.ZodTransform<{
2927
+ files_touched: string[];
2928
+ acceptance_criteria_addressed: string[];
2929
+ claimed_checks: {
2930
+ id: string;
2931
+ outcome: "pass" | "fail" | "not_run";
2932
+ exit_code?: number | undefined;
2933
+ output_snippet?: string | undefined;
2934
+ }[];
2935
+ assumptions: string[];
2936
+ blockers: string[];
2937
+ human_action_request_ids: string[];
2938
+ schema_version: "2.0.0";
2939
+ receipt_id: string;
2940
+ run_id: string;
2941
+ work_item_id: string;
2942
+ work_item_revision: number;
2943
+ attempt_id: string;
2944
+ packet_id: string;
2945
+ packet_hash: string;
2946
+ workspace_lease_id: string;
2947
+ workspace_lease_revision: number;
2948
+ worker_runtime: string;
2949
+ worker_session_id: string;
2950
+ observed_base_sha: string;
2951
+ outcome: "blocked" | "completed" | "failed" | "cancelled";
2952
+ exit_reason: string;
2953
+ summary: string;
2954
+ commits: string[];
2955
+ cost: {
2956
+ input_tokens?: number | undefined;
2957
+ output_tokens?: number | undefined;
2958
+ tool_calls?: number | undefined;
2959
+ elapsed_ms?: number | undefined;
2960
+ };
2961
+ worker_started_at: string;
2962
+ worker_completed_at: string;
2963
+ submitted_at: string;
2964
+ final_head_sha?: string | undefined;
2965
+ patch_hash?: string | undefined;
2966
+ }, {
2967
+ schema_version: "2.0.0";
2968
+ receipt_id: string;
2969
+ run_id: string;
2970
+ work_item_id: string;
2971
+ work_item_revision: number;
2972
+ attempt_id: string;
2973
+ packet_id: string;
2974
+ packet_hash: string;
2975
+ workspace_lease_id: string;
2976
+ workspace_lease_revision: number;
2977
+ worker_runtime: string;
2978
+ worker_session_id: string;
2979
+ observed_base_sha: string;
2980
+ outcome: "blocked" | "completed" | "failed" | "cancelled";
2981
+ exit_reason: string;
2982
+ summary: string;
2983
+ files_touched: string[];
2984
+ commits: string[];
2985
+ acceptance_criteria_addressed: string[];
2986
+ claimed_checks: {
2987
+ id: string;
2988
+ outcome: "pass" | "fail" | "not_run";
2989
+ exit_code?: number | undefined;
2990
+ output_snippet?: string | undefined;
2991
+ }[];
2992
+ assumptions: string[];
2993
+ blockers: string[];
2994
+ human_action_request_ids: string[];
2995
+ cost: {
2996
+ input_tokens?: number | undefined;
2997
+ output_tokens?: number | undefined;
2998
+ tool_calls?: number | undefined;
2999
+ elapsed_ms?: number | undefined;
3000
+ };
3001
+ worker_started_at: string;
3002
+ worker_completed_at: string;
3003
+ submitted_at: string;
3004
+ final_head_sha?: string | undefined;
3005
+ patch_hash?: string | undefined;
3006
+ }>>;
3007
+ type AgentTaskReceipt_v2 = z.infer<typeof AgentTaskReceipt_v2>;
3008
+ /**
3009
+ * Validate set membership that only the authoritative packet snapshot can establish.
3010
+ *
3011
+ * AgentTaskReceipt_v2 has no extra-check lane: every claimed check must name one
3012
+ * packet-declared verification. A future extra-check lane requires a versioned
3013
+ * contract rather than overloading the declared-check namespace.
3014
+ */
3015
+ declare function validateAgentTaskReceiptV2PacketReferences(packet: AgentTaskPacket_v1, receipt: AgentTaskReceipt_v2): {
3016
+ valid: boolean;
3017
+ errors: string[];
3018
+ };
3019
+ declare const VerificationOutcome: z.ZodEnum<{
3020
+ pass: "pass";
3021
+ fail: "fail";
3022
+ cancelled: "cancelled";
3023
+ inconclusive: "inconclusive";
3024
+ infrastructure_error: "infrastructure_error";
3025
+ }>;
3026
+ type VerificationOutcome = z.infer<typeof VerificationOutcome>;
3027
+ declare const AgentEngineVerification_v1: z.ZodObject<{
3028
+ schema_version: z.ZodLiteral<"1.0.0">;
3029
+ verification_id: z.ZodString;
3030
+ run_id: z.ZodString;
3031
+ work_item_id: z.ZodString;
3032
+ attempt_id: z.ZodString;
3033
+ packet_id: z.ZodString;
3034
+ packet_hash: z.ZodString;
3035
+ workspace_lease_id: z.ZodString;
3036
+ workspace_lease_revision: z.ZodNumber;
3037
+ worker_session_id: z.ZodString;
3038
+ receipt_id: z.ZodString;
3039
+ receipt_hash: z.ZodString;
3040
+ base_sha: z.ZodString;
3041
+ verified_head_sha: z.ZodOptional<z.ZodString>;
3042
+ outcome: z.ZodEnum<{
3043
+ pass: "pass";
3044
+ fail: "fail";
3045
+ cancelled: "cancelled";
3046
+ inconclusive: "inconclusive";
3047
+ infrastructure_error: "infrastructure_error";
3048
+ }>;
3049
+ summary: z.ZodString;
3050
+ checks: z.ZodArray<z.ZodObject<{
3051
+ id: z.ZodString;
3052
+ outcome: z.ZodEnum<{
3053
+ pass: "pass";
3054
+ fail: "fail";
3055
+ cancelled: "cancelled";
3056
+ inconclusive: "inconclusive";
3057
+ infrastructure_error: "infrastructure_error";
3058
+ }>;
3059
+ exit_code: z.ZodOptional<z.ZodNumber>;
3060
+ stdout_snippet: z.ZodOptional<z.ZodString>;
3061
+ stderr_snippet: z.ZodOptional<z.ZodString>;
3062
+ artifact_refs: z.ZodArray<z.ZodString>;
3063
+ }, z.core.$strict>>;
3064
+ failures: z.ZodArray<z.ZodString>;
3065
+ trust_gap: z.ZodBoolean;
3066
+ verifier_id: z.ZodString;
3067
+ started_at: z.ZodString;
3068
+ completed_at: z.ZodString;
3069
+ }, z.core.$strict>;
3070
+ type AgentEngineVerification_v1 = z.infer<typeof AgentEngineVerification_v1>;
3071
+ declare const EngineVerificationCheckSource_v2: z.ZodEnum<{
3072
+ packet: "packet";
3073
+ engine_extra: "engine_extra";
3074
+ }>;
3075
+ type EngineVerificationCheckSource_v2 = z.infer<typeof EngineVerificationCheckSource_v2>;
3076
+ declare const EngineVerificationDeterminism_v2: z.ZodEnum<{
3077
+ unknown: "unknown";
3078
+ deterministic: "deterministic";
3079
+ externally_nondeterministic: "externally_nondeterministic";
3080
+ }>;
3081
+ type EngineVerificationDeterminism_v2 = z.infer<typeof EngineVerificationDeterminism_v2>;
3082
+ declare const EngineVerificationTrustGapReason_v2: z.ZodEnum<{
3083
+ worker_outcome_disagrees: "worker_outcome_disagrees";
3084
+ head_identity_disagrees: "head_identity_disagrees";
3085
+ patch_identity_disagrees: "patch_identity_disagrees";
3086
+ claimed_check_disagrees: "claimed_check_disagrees";
3087
+ authority_deviation: "authority_deviation";
3088
+ }>;
3089
+ type EngineVerificationTrustGapReason_v2 = z.infer<typeof EngineVerificationTrustGapReason_v2>;
3090
+ /** Immutable engine-observed evidence for one durable AgentTaskReceipt v2. */
3091
+ declare const AgentEngineVerification_v2: z.ZodPipe<z.ZodObject<{
3092
+ schema_version: z.ZodLiteral<"2.0.0">;
3093
+ verification_id: z.ZodString;
3094
+ run_id: z.ZodString;
3095
+ work_item_id: z.ZodString;
3096
+ work_item_revision: z.ZodNumber;
3097
+ attempt_id: z.ZodString;
3098
+ packet_id: z.ZodString;
3099
+ packet_hash: z.ZodString;
3100
+ workspace_lease_id: z.ZodString;
3101
+ workspace_lease_revision: z.ZodNumber;
3102
+ worker_session_id: z.ZodString;
3103
+ worker_session_revision: z.ZodNumber;
3104
+ receipt_id: z.ZodString;
3105
+ receipt_hash: z.ZodString;
3106
+ observed_base_sha: z.ZodString;
3107
+ verified_head_sha: z.ZodOptional<z.ZodString>;
3108
+ verified_patch_hash: z.ZodOptional<z.ZodString>;
3109
+ workspace_observation_hash: z.ZodString;
3110
+ outcome: z.ZodEnum<{
3111
+ pass: "pass";
3112
+ fail: "fail";
3113
+ cancelled: "cancelled";
3114
+ inconclusive: "inconclusive";
3115
+ infrastructure_error: "infrastructure_error";
3116
+ }>;
3117
+ summary: z.ZodString;
3118
+ checks: z.ZodArray<z.ZodObject<{
3119
+ id: z.ZodString;
3120
+ source: z.ZodEnum<{
3121
+ packet: "packet";
3122
+ engine_extra: "engine_extra";
3123
+ }>;
3124
+ outcome: z.ZodEnum<{
3125
+ pass: "pass";
3126
+ fail: "fail";
3127
+ cancelled: "cancelled";
3128
+ inconclusive: "inconclusive";
3129
+ infrastructure_error: "infrastructure_error";
3130
+ }>;
3131
+ command_hash: z.ZodString;
3132
+ cwd_rel: z.ZodOptional<z.ZodString>;
3133
+ environment_fingerprint: z.ZodString;
3134
+ exit_code: z.ZodOptional<z.ZodNumber>;
3135
+ stdout_hash: z.ZodOptional<z.ZodString>;
3136
+ stderr_hash: z.ZodOptional<z.ZodString>;
3137
+ stdout_snippet: z.ZodOptional<z.ZodString>;
3138
+ stderr_snippet: z.ZodOptional<z.ZodString>;
3139
+ duration_ms: z.ZodNumber;
3140
+ retry_count: z.ZodNumber;
3141
+ artifact_refs: z.ZodArray<z.ZodString>;
3142
+ determinism: z.ZodEnum<{
3143
+ unknown: "unknown";
3144
+ deterministic: "deterministic";
3145
+ externally_nondeterministic: "externally_nondeterministic";
3146
+ }>;
3147
+ }, z.core.$strict>>;
3148
+ failures: z.ZodArray<z.ZodString>;
3149
+ trust_gap_reasons: z.ZodArray<z.ZodEnum<{
3150
+ worker_outcome_disagrees: "worker_outcome_disagrees";
3151
+ head_identity_disagrees: "head_identity_disagrees";
3152
+ patch_identity_disagrees: "patch_identity_disagrees";
3153
+ claimed_check_disagrees: "claimed_check_disagrees";
3154
+ authority_deviation: "authority_deviation";
3155
+ }>>;
3156
+ verifier_id: z.ZodString;
3157
+ verifier_version: z.ZodString;
3158
+ started_at: z.ZodString;
3159
+ completed_at: z.ZodString;
3160
+ }, z.core.$strict>, z.ZodTransform<{
3161
+ checks: {
3162
+ artifact_refs: string[];
3163
+ id: string;
3164
+ source: "packet" | "engine_extra";
3165
+ outcome: "pass" | "fail" | "cancelled" | "inconclusive" | "infrastructure_error";
3166
+ command_hash: string;
3167
+ environment_fingerprint: string;
3168
+ duration_ms: number;
3169
+ retry_count: number;
3170
+ determinism: "unknown" | "deterministic" | "externally_nondeterministic";
3171
+ cwd_rel?: string | undefined;
3172
+ exit_code?: number | undefined;
3173
+ stdout_hash?: string | undefined;
3174
+ stderr_hash?: string | undefined;
3175
+ stdout_snippet?: string | undefined;
3176
+ stderr_snippet?: string | undefined;
3177
+ }[];
3178
+ failures: string[];
3179
+ trust_gap_reasons: ("worker_outcome_disagrees" | "head_identity_disagrees" | "patch_identity_disagrees" | "claimed_check_disagrees" | "authority_deviation")[];
3180
+ schema_version: "2.0.0";
3181
+ verification_id: string;
3182
+ run_id: string;
3183
+ work_item_id: string;
3184
+ work_item_revision: number;
3185
+ attempt_id: string;
3186
+ packet_id: string;
3187
+ packet_hash: string;
3188
+ workspace_lease_id: string;
3189
+ workspace_lease_revision: number;
3190
+ worker_session_id: string;
3191
+ worker_session_revision: number;
3192
+ receipt_id: string;
3193
+ receipt_hash: string;
3194
+ observed_base_sha: string;
3195
+ workspace_observation_hash: string;
3196
+ outcome: "pass" | "fail" | "cancelled" | "inconclusive" | "infrastructure_error";
3197
+ summary: string;
3198
+ verifier_id: string;
3199
+ verifier_version: string;
3200
+ started_at: string;
3201
+ completed_at: string;
3202
+ verified_head_sha?: string | undefined;
3203
+ verified_patch_hash?: string | undefined;
3204
+ }, {
3205
+ schema_version: "2.0.0";
3206
+ verification_id: string;
3207
+ run_id: string;
3208
+ work_item_id: string;
3209
+ work_item_revision: number;
3210
+ attempt_id: string;
3211
+ packet_id: string;
3212
+ packet_hash: string;
3213
+ workspace_lease_id: string;
3214
+ workspace_lease_revision: number;
3215
+ worker_session_id: string;
3216
+ worker_session_revision: number;
3217
+ receipt_id: string;
3218
+ receipt_hash: string;
3219
+ observed_base_sha: string;
3220
+ workspace_observation_hash: string;
3221
+ outcome: "pass" | "fail" | "cancelled" | "inconclusive" | "infrastructure_error";
3222
+ summary: string;
3223
+ checks: {
3224
+ id: string;
3225
+ source: "packet" | "engine_extra";
3226
+ outcome: "pass" | "fail" | "cancelled" | "inconclusive" | "infrastructure_error";
3227
+ command_hash: string;
3228
+ environment_fingerprint: string;
3229
+ duration_ms: number;
3230
+ retry_count: number;
3231
+ artifact_refs: string[];
3232
+ determinism: "unknown" | "deterministic" | "externally_nondeterministic";
3233
+ cwd_rel?: string | undefined;
3234
+ exit_code?: number | undefined;
3235
+ stdout_hash?: string | undefined;
3236
+ stderr_hash?: string | undefined;
3237
+ stdout_snippet?: string | undefined;
3238
+ stderr_snippet?: string | undefined;
3239
+ }[];
3240
+ failures: string[];
3241
+ trust_gap_reasons: ("worker_outcome_disagrees" | "head_identity_disagrees" | "patch_identity_disagrees" | "claimed_check_disagrees" | "authority_deviation")[];
3242
+ verifier_id: string;
3243
+ verifier_version: string;
3244
+ started_at: string;
3245
+ completed_at: string;
3246
+ verified_head_sha?: string | undefined;
3247
+ verified_patch_hash?: string | undefined;
3248
+ }>>;
3249
+ type AgentEngineVerification_v2 = z.infer<typeof AgentEngineVerification_v2>;
3250
+ declare function computeAgentEngineVerificationV2Hash(verification: AgentEngineVerification_v2): string;
3251
+ /** Validate the packet-declared check lane without conflating explicit engine extras. */
3252
+ declare function validateAgentEngineVerificationV2PacketReferences(packet: AgentTaskPacket_v1, verification: AgentEngineVerification_v2): {
3253
+ valid: boolean;
3254
+ errors: string[];
3255
+ };
3256
+ interface AgentTaskReceiptBindingContext {
3257
+ packet: AgentTaskPacket_v1;
3258
+ lease: WorkspaceLease_v1;
3259
+ session: WorkerSession_v1;
3260
+ }
3261
+ interface AgentTaskReceiptV2BindingContext {
3262
+ packet: AgentTaskPacket_v1;
3263
+ lease: WorkspaceLease_v1;
3264
+ session: WorkerSession_v1;
3265
+ /** Runtime identity persisted with the exact WorkerSession attachment. */
3266
+ workerRuntime: string;
3267
+ }
3268
+ /** Verify that a worker receipt belongs to one exact attempt and workspace. */
3269
+ declare function validateAgentTaskReceiptBinding(context: AgentTaskReceiptBindingContext, receipt: AgentTaskReceipt_v1): {
3270
+ valid: boolean;
3271
+ errors: string[];
3272
+ };
3273
+ /** Validate v2 claim identity only; this deliberately does not verify result truth. */
3274
+ declare function validateAgentTaskReceiptV2Binding(context: AgentTaskReceiptV2BindingContext, receipt: AgentTaskReceipt_v2): {
3275
+ valid: boolean;
3276
+ errors: string[];
3277
+ };
3278
+ declare const HumanActionPreconditions: z.ZodObject<{
3279
+ run_revision: z.ZodNumber;
3280
+ workspace_lease_revision: z.ZodNumber;
3281
+ expected_head_sha: z.ZodString;
3282
+ }, z.core.$strict>;
3283
+ type HumanActionPreconditions = z.infer<typeof HumanActionPreconditions>;
3284
+ declare const HumanActionRequest_v1: z.ZodObject<{
3285
+ schema_version: z.ZodLiteral<"1.0.0">;
3286
+ request_id: z.ZodString;
3287
+ run_id: z.ZodString;
3288
+ attempt_id: z.ZodString;
3289
+ workspace_lease_id: z.ZodString;
3290
+ worker_session_id: z.ZodString;
3291
+ action: z.ZodEnum<{
3292
+ other: "other";
3293
+ approve_scope: "approve_scope";
3294
+ sign_commit: "sign_commit";
3295
+ authenticate: "authenticate";
3296
+ approve_push: "approve_push";
3297
+ approve_merge: "approve_merge";
3298
+ }>;
3299
+ summary: z.ZodString;
3300
+ instructions: z.ZodArray<z.ZodString>;
3301
+ suggested_commands: z.ZodArray<z.ZodString>;
3302
+ preconditions: z.ZodObject<{
3303
+ run_revision: z.ZodNumber;
3304
+ workspace_lease_revision: z.ZodNumber;
3305
+ expected_head_sha: z.ZodString;
3306
+ }, z.core.$strict>;
3307
+ requested_at: z.ZodString;
3308
+ expires_at: z.ZodOptional<z.ZodString>;
3309
+ }, z.core.$strict>;
3310
+ type HumanActionRequest_v1 = z.infer<typeof HumanActionRequest_v1>;
3311
+ declare const HumanActionReceipt_v1: z.ZodObject<{
3312
+ schema_version: z.ZodLiteral<"1.0.0">;
3313
+ receipt_id: z.ZodString;
3314
+ request_id: z.ZodString;
3315
+ run_id: z.ZodString;
3316
+ attempt_id: z.ZodString;
3317
+ workspace_lease_id: z.ZodString;
3318
+ worker_session_id: z.ZodString;
3319
+ observed_preconditions: z.ZodObject<{
3320
+ run_revision: z.ZodNumber;
3321
+ workspace_lease_revision: z.ZodNumber;
3322
+ expected_head_sha: z.ZodString;
3323
+ }, z.core.$strict>;
3324
+ outcome: z.ZodEnum<{
3325
+ completed: "completed";
3326
+ failed: "failed";
3327
+ expired: "expired";
3328
+ declined: "declined";
3329
+ }>;
3330
+ actor_id: z.ZodString;
3331
+ summary: z.ZodString;
3332
+ resulting_head_sha: z.ZodOptional<z.ZodString>;
3333
+ completed_at: z.ZodString;
3334
+ }, z.core.$strict>;
3335
+ type HumanActionReceipt_v1 = z.infer<typeof HumanActionReceipt_v1>;
3336
+ /** Refuse stale or cross-attempt human approvals. */
3337
+ declare function validateHumanActionReceiptBinding(request: HumanActionRequest_v1, receipt: HumanActionReceipt_v1): {
3338
+ valid: boolean;
3339
+ errors: string[];
3340
+ };
3341
+ declare function parseWorkItem(data: unknown): WorkItem_v1;
3342
+ declare function parseRun(data: unknown): Run_v1;
3343
+ declare function parseAttempt(data: unknown): Attempt_v1;
3344
+ declare function parseAgentTaskPacket(data: unknown): AgentTaskPacket_v1;
3345
+ declare function parseExecutionEnvelope(data: unknown): ExecutionEnvelope_v1;
3346
+ declare function parseControllerLease(data: unknown): ControllerLease_v1;
3347
+ declare function parseWorkspaceLease(data: unknown): WorkspaceLease_v1;
3348
+ declare function parseWorkspaceAllocation(data: unknown): WorkspaceAllocation_v1;
3349
+ declare function parseWorkerSession(data: unknown): WorkerSession_v1;
3350
+ declare function parseAgentTaskReceipt(data: unknown): AgentTaskReceipt_v1;
3351
+ declare function parseAgentTaskReceiptV2(data: unknown): AgentTaskReceipt_v2;
3352
+ declare function parseAgentEngineVerification(data: unknown): AgentEngineVerification_v1;
3353
+ declare function parseAgentEngineVerificationV2(data: unknown): AgentEngineVerification_v2;
3354
+ declare function parseHumanActionRequest(data: unknown): HumanActionRequest_v1;
3355
+ declare function parseHumanActionReceipt(data: unknown): HumanActionReceipt_v1;
3356
+
3357
+ declare const WorkspaceLifecycleLeaseStatus: z.ZodEnum<{
3358
+ active: "active";
3359
+ quarantined: "quarantined";
3360
+ released: "released";
3361
+ reserved: "reserved";
3362
+ preserved: "preserved";
3363
+ abandoned: "abandoned";
3364
+ }>;
3365
+ type WorkspaceLifecycleLeaseStatus = z.infer<typeof WorkspaceLifecycleLeaseStatus>;
3366
+ declare const ReleaseWorkspaceDisposition: z.ZodEnum<{
3367
+ integrated: "integrated";
3368
+ discarded: "discarded";
3369
+ }>;
3370
+ type ReleaseWorkspaceDisposition = z.infer<typeof ReleaseWorkspaceDisposition>;
3371
+ declare const WorkspaceReconciliationAction: z.ZodEnum<{
3372
+ resume: "resume";
3373
+ release: "release";
3374
+ preserve: "preserve";
3375
+ abandon: "abandon";
3376
+ }>;
3377
+ type WorkspaceReconciliationAction = z.infer<typeof WorkspaceReconciliationAction>;
3378
+ declare const WorkspaceLifecycleEventType: z.ZodEnum<{
3379
+ attempt_created: "attempt_created";
3380
+ attempt_transitioned: "attempt_transitioned";
3381
+ workspace_acquired: "workspace_acquired";
3382
+ workspace_heartbeat: "workspace_heartbeat";
3383
+ workspace_released: "workspace_released";
3384
+ workspace_reconciled: "workspace_reconciled";
3385
+ workspace_quarantined: "workspace_quarantined";
3386
+ }>;
3387
+ type WorkspaceLifecycleEventType = z.infer<typeof WorkspaceLifecycleEventType>;
3388
+ declare const WorkerSessionEventType: z.ZodEnum<{
3389
+ worker_session_attached: "worker_session_attached";
3390
+ worker_session_heartbeat: "worker_session_heartbeat";
3391
+ worker_session_ended: "worker_session_ended";
3392
+ }>;
3393
+ type WorkerSessionEventType = z.infer<typeof WorkerSessionEventType>;
3394
+ declare const AttemptReceiptDisposition: z.ZodEnum<{
3395
+ verification_pending: "verification_pending";
3396
+ retained_late: "retained_late";
3397
+ }>;
3398
+ type AttemptReceiptDisposition = z.infer<typeof AttemptReceiptDisposition>;
3399
+ declare const AttemptReceiptEventType: z.ZodEnum<{
3400
+ attempt_receipt_submitted: "attempt_receipt_submitted";
3401
+ attempt_receipt_retained_late: "attempt_receipt_retained_late";
3402
+ attempt_receipt_replayed: "attempt_receipt_replayed";
3403
+ }>;
3404
+ type AttemptReceiptEventType = z.infer<typeof AttemptReceiptEventType>;
3405
+ declare const AttemptVerificationEventType: z.ZodEnum<{
3406
+ attempt_verification_started: "attempt_verification_started";
3407
+ attempt_verification_recorded: "attempt_verification_recorded";
3408
+ attempt_verification_replayed: "attempt_verification_replayed";
3409
+ }>;
3410
+ type AttemptVerificationEventType = z.infer<typeof AttemptVerificationEventType>;
3411
+ declare const WorkspaceMutationFailureReason: z.ZodEnum<{
3412
+ not_found: "not_found";
3413
+ no_active_lease: "no_active_lease";
3414
+ lease_mismatch: "lease_mismatch";
3415
+ stale_fence: "stale_fence";
3416
+ lease_expired: "lease_expired";
3417
+ mutation_conflict: "mutation_conflict";
3418
+ stale_run_revision: "stale_run_revision";
3419
+ workspace_expired: "workspace_expired";
3420
+ invalid_time: "invalid_time";
3421
+ stale_attempt_revision: "stale_attempt_revision";
3422
+ stale_workspace_revision: "stale_workspace_revision";
3423
+ attempt_not_live: "attempt_not_live";
3424
+ workspace_not_active: "workspace_not_active";
3425
+ live_attempt_conflict: "live_attempt_conflict";
3426
+ branch_conflict: "branch_conflict";
3427
+ worktree_conflict: "worktree_conflict";
3428
+ identity_mismatch: "identity_mismatch";
3429
+ dirty_workspace: "dirty_workspace";
3430
+ invalid_reconciliation: "invalid_reconciliation";
3431
+ invalid_attempt_transition: "invalid_attempt_transition";
3432
+ evidence_mismatch: "evidence_mismatch";
3433
+ retry_delta_required: "retry_delta_required";
3434
+ retry_delta_invalid: "retry_delta_invalid";
3435
+ fanout_invalid: "fanout_invalid";
3436
+ }>;
3437
+ type WorkspaceMutationFailureReason = z.infer<typeof WorkspaceMutationFailureReason>;
3438
+ declare const WorkerSessionMutationFailureReason: z.ZodEnum<{
3439
+ not_found: "not_found";
3440
+ no_active_lease: "no_active_lease";
3441
+ lease_mismatch: "lease_mismatch";
3442
+ stale_fence: "stale_fence";
3443
+ lease_expired: "lease_expired";
3444
+ mutation_conflict: "mutation_conflict";
3445
+ stale_run_revision: "stale_run_revision";
3446
+ workspace_expired: "workspace_expired";
3447
+ invalid_time: "invalid_time";
3448
+ stale_attempt_revision: "stale_attempt_revision";
3449
+ stale_workspace_revision: "stale_workspace_revision";
3450
+ attempt_not_live: "attempt_not_live";
3451
+ workspace_not_active: "workspace_not_active";
3452
+ live_attempt_conflict: "live_attempt_conflict";
3453
+ branch_conflict: "branch_conflict";
3454
+ worktree_conflict: "worktree_conflict";
3455
+ identity_mismatch: "identity_mismatch";
3456
+ dirty_workspace: "dirty_workspace";
3457
+ invalid_reconciliation: "invalid_reconciliation";
3458
+ invalid_attempt_transition: "invalid_attempt_transition";
3459
+ evidence_mismatch: "evidence_mismatch";
3460
+ retry_delta_required: "retry_delta_required";
3461
+ retry_delta_invalid: "retry_delta_invalid";
3462
+ fanout_invalid: "fanout_invalid";
3463
+ stale_session_revision: "stale_session_revision";
3464
+ worker_session_not_active: "worker_session_not_active";
3465
+ worker_session_conflict: "worker_session_conflict";
3466
+ }>;
3467
+ type WorkerSessionMutationFailureReason = z.infer<typeof WorkerSessionMutationFailureReason>;
3468
+ declare const AttemptReceiptFailureReason: z.ZodEnum<{
3469
+ not_found: "not_found";
3470
+ no_active_lease: "no_active_lease";
3471
+ lease_mismatch: "lease_mismatch";
3472
+ stale_fence: "stale_fence";
3473
+ lease_expired: "lease_expired";
3474
+ mutation_conflict: "mutation_conflict";
3475
+ stale_run_revision: "stale_run_revision";
3476
+ workspace_expired: "workspace_expired";
3477
+ invalid_time: "invalid_time";
3478
+ stale_attempt_revision: "stale_attempt_revision";
3479
+ stale_workspace_revision: "stale_workspace_revision";
3480
+ attempt_not_live: "attempt_not_live";
3481
+ workspace_not_active: "workspace_not_active";
3482
+ live_attempt_conflict: "live_attempt_conflict";
3483
+ branch_conflict: "branch_conflict";
3484
+ worktree_conflict: "worktree_conflict";
3485
+ identity_mismatch: "identity_mismatch";
3486
+ dirty_workspace: "dirty_workspace";
3487
+ invalid_reconciliation: "invalid_reconciliation";
3488
+ invalid_attempt_transition: "invalid_attempt_transition";
3489
+ evidence_mismatch: "evidence_mismatch";
3490
+ retry_delta_required: "retry_delta_required";
3491
+ retry_delta_invalid: "retry_delta_invalid";
3492
+ fanout_invalid: "fanout_invalid";
3493
+ stale_session_revision: "stale_session_revision";
3494
+ worker_session_not_active: "worker_session_not_active";
3495
+ receipt_conflict: "receipt_conflict";
3496
+ }>;
3497
+ type AttemptReceiptFailureReason = z.infer<typeof AttemptReceiptFailureReason>;
3498
+ declare const AttemptVerificationFailureReason: z.ZodEnum<{
3499
+ not_found: "not_found";
3500
+ no_active_lease: "no_active_lease";
3501
+ lease_mismatch: "lease_mismatch";
3502
+ stale_fence: "stale_fence";
3503
+ lease_expired: "lease_expired";
3504
+ mutation_conflict: "mutation_conflict";
3505
+ stale_run_revision: "stale_run_revision";
3506
+ workspace_expired: "workspace_expired";
3507
+ invalid_time: "invalid_time";
3508
+ stale_attempt_revision: "stale_attempt_revision";
3509
+ stale_workspace_revision: "stale_workspace_revision";
3510
+ attempt_not_live: "attempt_not_live";
3511
+ workspace_not_active: "workspace_not_active";
3512
+ live_attempt_conflict: "live_attempt_conflict";
3513
+ branch_conflict: "branch_conflict";
3514
+ worktree_conflict: "worktree_conflict";
3515
+ identity_mismatch: "identity_mismatch";
3516
+ dirty_workspace: "dirty_workspace";
3517
+ invalid_reconciliation: "invalid_reconciliation";
3518
+ invalid_attempt_transition: "invalid_attempt_transition";
3519
+ evidence_mismatch: "evidence_mismatch";
3520
+ retry_delta_required: "retry_delta_required";
3521
+ retry_delta_invalid: "retry_delta_invalid";
3522
+ fanout_invalid: "fanout_invalid";
3523
+ stale_session_revision: "stale_session_revision";
3524
+ verification_conflict: "verification_conflict";
3525
+ }>;
3526
+ type AttemptVerificationFailureReason = z.infer<typeof AttemptVerificationFailureReason>;
3527
+ declare const WorkspaceObservation: z.ZodObject<{
3528
+ exists: z.ZodBoolean;
3529
+ registered: z.ZodBoolean;
3530
+ repositoryId: z.ZodNullable<z.ZodString>;
3531
+ hostId: z.ZodString;
3532
+ gitRuntime: z.ZodString;
3533
+ projectRoot: z.ZodNullable<z.ZodString>;
3534
+ branch: z.ZodNullable<z.ZodString>;
3535
+ worktreePath: z.ZodString;
3536
+ attemptId: z.ZodNullable<z.ZodString>;
3537
+ headSha: z.ZodNullable<z.ZodString>;
3538
+ cleanliness: z.ZodEnum<{
3539
+ clean: "clean";
3540
+ dirty: "dirty";
3541
+ }>;
3542
+ dirtyPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
3543
+ reason: z.ZodOptional<z.ZodString>;
3544
+ }, z.core.$strict>;
3545
+ type WorkspaceObservation = z.infer<typeof WorkspaceObservation>;
3546
+
3547
+ /** Durable attempt state. Attempts exist before a workspace is allocated. */
3548
+ interface AttemptRecord {
3549
+ attemptId: string;
3550
+ runId: string;
3551
+ runRevision: number;
3552
+ workItemId: string;
3553
+ workItemRevision: number;
3554
+ packetId: string;
3555
+ packetHash: string;
3556
+ baseSha: string;
3557
+ revision: number;
3558
+ status: AttemptStatus;
3559
+ workspaceLeaseId: string | null;
3560
+ receiptId: string | null;
3561
+ verificationId: string | null;
3562
+ createdAt: string;
3563
+ updatedAt: string;
3564
+ completedAt: string | null;
3565
+ }
3566
+ /** Canonical immutable retry delta persisted atomically with its new Attempt. */
3567
+ interface AttemptRetryDeltaRecord {
3568
+ attemptId: string;
3569
+ previousAttemptId: string;
3570
+ deltaHash: string;
3571
+ deltaJson: string;
3572
+ createdAt: string;
3573
+ }
3574
+ /** Canonical immutable declaration for one bounded parallel comparison. */
3575
+ interface FanoutPlanRecord {
3576
+ fanoutId: string;
3577
+ runId: string;
3578
+ workItemId: string;
3579
+ workItemRevision: number;
3580
+ planHash: string;
3581
+ planJson: string;
3582
+ controllerId: string;
3583
+ controllerLeaseId: string;
3584
+ fencingToken: number;
3585
+ createdAt: string;
3586
+ }
3587
+ /** Exact declared premise occupied by an Attempt. */
3588
+ interface FanoutAttemptBindingRecord {
3589
+ fanoutId: string;
3590
+ attemptId: string;
3591
+ premiseId: string;
3592
+ premiseHash: string;
3593
+ planHash: string;
3594
+ createdAt: string;
3595
+ }
3596
+ /** Immutable engine-owned fan-in comparison. */
3597
+ interface FanInDecisionRecord {
3598
+ decisionId: string;
3599
+ fanoutId: string;
3600
+ runId: string;
3601
+ workItemId: string;
3602
+ workItemRevision: number;
3603
+ decisionHash: string;
3604
+ decisionJson: string;
3605
+ selectedAttemptId: string | null;
3606
+ outcome: AgentWorkFanInDecision_v1["decision"];
3607
+ controllerId: string;
3608
+ controllerLeaseId: string;
3609
+ fencingToken: number;
3610
+ createdAt: string;
3611
+ }
3612
+ interface WorkspaceIdentity {
3613
+ repositoryId: string;
3614
+ hostId: string;
3615
+ gitRuntime: string;
3616
+ projectRoot: string;
3617
+ branch: string;
3618
+ worktreePath: string;
3619
+ attemptId: string;
3620
+ }
3621
+ /**
3622
+ * Controller-local persistence for workspace ownership and reconciliation.
3623
+ * This is deliberately distinct from the portable `WorkspaceLease_v1`
3624
+ * protocol contract: the broker later combines this machine-local state with
3625
+ * the immutable scope and authority from the task packet.
3626
+ */
3627
+ interface WorkspaceLifecycleLeaseRecord extends WorkspaceIdentity {
3628
+ leaseId: string;
3629
+ runId: string;
3630
+ runRevision: number;
3631
+ workItemId: string;
3632
+ workItemRevision: number;
3633
+ packetId: string;
3634
+ packetHash: string;
3635
+ revision: number;
3636
+ controllerId: string;
3637
+ controllerLeaseId: string;
3638
+ fencingToken: number;
3639
+ baseSha: string;
3640
+ status: WorkspaceLifecycleLeaseStatus;
3641
+ acquiredAt: string;
3642
+ heartbeatAt: string;
3643
+ expiresAt: string;
3644
+ releasedAt?: string;
3645
+ cleanupDisposition?: WorkspaceCleanupDisposition;
3646
+ lastObservation?: WorkspaceObservation;
3647
+ }
3648
+ interface WorkspaceLifecycleEvent {
3649
+ runId: string;
3650
+ attemptId: string;
3651
+ mutationId: string;
3652
+ sequence: number;
3653
+ attemptRevision: number;
3654
+ workspaceLeaseRevision: number | null;
3655
+ controllerId: string;
3656
+ controllerLeaseId: string;
3657
+ fencingToken: number;
3658
+ type: WorkspaceLifecycleEventType;
3659
+ payload: JsonValue;
3660
+ createdAt: string;
3661
+ }
3662
+ /** Durable identity and observed lifecycle for one native worker attached to an Attempt. */
3663
+ interface WorkerSessionRecord {
3664
+ sessionId: string;
3665
+ revision: number;
3666
+ runId: string;
3667
+ attemptId: string;
3668
+ packetId: string;
3669
+ packetHash: string;
3670
+ workspaceLeaseId: string;
3671
+ workspaceLeaseRevision: number;
3672
+ executionEnvelopeId: string;
3673
+ executionEnvelopeHash: string;
3674
+ hostId: string;
3675
+ workerRuntime: string;
3676
+ gitRuntime: string;
3677
+ backend: WorkerSessionBackend;
3678
+ workerId: string;
3679
+ model?: string;
3680
+ status: WorkerSessionStatus;
3681
+ startedAt: string;
3682
+ heartbeatAt: string;
3683
+ endedAt?: string;
3684
+ exitReason?: string;
3685
+ exitCode?: number;
3686
+ exitSummary?: string;
3687
+ }
3688
+ /** Immutable adapter/enforcement identity negotiated before a worker session is attached. */
3689
+ interface WorkerAdapterBindingRecord {
3690
+ sessionId: string;
3691
+ adapterId: string;
3692
+ adapterVersion: string;
3693
+ enforcementSummaryHash: string;
3694
+ trustGapDimensions: string[];
3695
+ createdAt: string;
3696
+ }
3697
+ interface WorkerSessionEvent {
3698
+ runId: string;
3699
+ attemptId: string;
3700
+ sessionId: string;
3701
+ mutationId: string;
3702
+ sequence: number;
3703
+ attemptRevision: number;
3704
+ workspaceLeaseRevision: number;
3705
+ sessionRevision: number;
3706
+ controllerId: string;
3707
+ controllerLeaseId: string;
3708
+ fencingToken: number;
3709
+ type: WorkerSessionEventType;
3710
+ payload: JsonValue;
3711
+ createdAt: string;
3712
+ }
3713
+ interface AuthenticatedMutationInput {
3714
+ runId: string;
3715
+ expectedRunRevision: number;
3716
+ controller: ControllerLeaseCredential;
3717
+ mutationId: string;
3718
+ now: string;
3719
+ }
3720
+ interface AttemptReceiptRecord {
3721
+ receiptId: string;
3722
+ receiptHash: string;
3723
+ receiptJson: string;
3724
+ runId: string;
3725
+ workItemId: string;
3726
+ workItemRevision: number;
3727
+ attemptId: string;
3728
+ packetId: string;
3729
+ packetHash: string;
3730
+ workspaceLeaseId: string;
3731
+ workspaceLeaseRevision: number;
3732
+ workerSessionId: string;
3733
+ workerSessionRevision: number;
3734
+ workerRuntime: string;
3735
+ observedBaseSha: string;
3736
+ finalHeadSha?: string;
3737
+ patchHash?: string;
3738
+ outcome: AgentTaskReceiptOutcome;
3739
+ disposition: AttemptReceiptDisposition;
3740
+ submittedAt: string;
3741
+ recordedAt: string;
3742
+ controllerId: string;
3743
+ controllerLeaseId: string;
3744
+ fencingToken: number;
3745
+ resultingAttemptRevision: number;
3746
+ resultingAttemptStatus: AttemptStatus;
3747
+ }
3748
+ interface AttemptReceiptEvent {
3749
+ runId: string;
3750
+ attemptId: string;
3751
+ receiptId: string;
3752
+ receiptHash: string;
3753
+ mutationId: string;
3754
+ sequence: number;
3755
+ attemptRevision: number;
3756
+ workspaceLeaseRevision: number;
3757
+ workerSessionRevision: number;
3758
+ controllerId: string;
3759
+ controllerLeaseId: string;
3760
+ fencingToken: number;
3761
+ type: AttemptReceiptEventType;
3762
+ disposition: AttemptReceiptDisposition;
3763
+ outcome: AgentTaskReceiptOutcome;
3764
+ createdAt: string;
3765
+ }
3766
+ interface SubmitAttemptReceiptInput {
3767
+ runId: string;
3768
+ expectedRunRevision: number;
3769
+ controller: ControllerLeaseCredential;
3770
+ mutationId: string;
3771
+ now: string;
3772
+ attemptId: string;
3773
+ expectedAttemptRevision: number;
3774
+ workspaceLeaseId: string;
3775
+ expectedWorkspaceLeaseRevision: number;
3776
+ workerSessionId: string;
3777
+ expectedWorkerSessionRevision: number;
3778
+ receipt: AgentTaskReceipt_v2;
3779
+ }
3780
+ type AttemptReceiptSubmissionResult = {
3781
+ submitted: true;
3782
+ receipt: AttemptReceiptRecord;
3783
+ attempt: AttemptRecord;
3784
+ event: AttemptReceiptEvent;
3785
+ idempotentReplay: boolean;
3786
+ } | {
3787
+ submitted: false;
3788
+ reason: AttemptReceiptFailureReason;
3789
+ currentAttemptRevision?: number;
3790
+ currentWorkspaceLeaseRevision?: number;
3791
+ currentSessionRevision?: number;
3792
+ currentRunRevision?: number;
3793
+ };
3794
+ interface AttemptVerificationRecord {
3795
+ verificationId: string;
3796
+ verificationHash: string;
3797
+ verificationJson: string;
3798
+ runId: string;
3799
+ workItemId: string;
3800
+ workItemRevision: number;
3801
+ attemptId: string;
3802
+ packetId: string;
3803
+ packetHash: string;
3804
+ workspaceLeaseId: string;
3805
+ workspaceLeaseRevision: number;
3806
+ workerSessionId: string;
3807
+ workerSessionRevision: number;
3808
+ receiptId: string;
3809
+ receiptHash: string;
3810
+ observedBaseSha: string;
3811
+ verifiedHeadSha?: string;
3812
+ verifiedPatchHash?: string;
3813
+ workspaceObservationHash: string;
3814
+ outcome: VerificationOutcome;
3815
+ trustGapReasons: EngineVerificationTrustGapReason_v2[];
3816
+ verifierId: string;
3817
+ verifierVersion: string;
3818
+ startedAt: string;
3819
+ completedAt: string;
3820
+ recordedAt: string;
3821
+ controllerId: string;
3822
+ controllerLeaseId: string;
3823
+ fencingToken: number;
3824
+ resultingAttemptRevision: number;
3825
+ resultingAttemptStatus: AttemptStatus;
3826
+ }
3827
+ interface AttemptVerificationAuthorizationRecord {
3828
+ verificationId: string;
3829
+ runId: string;
3830
+ attemptId: string;
3831
+ attemptRevision: number;
3832
+ workspaceLeaseId: string;
3833
+ workspaceLeaseRevision: number;
3834
+ workerSessionId: string;
3835
+ workerSessionRevision: number;
3836
+ receiptId: string;
3837
+ receiptHash: string;
3838
+ controllerId: string;
3839
+ controllerLeaseId: string;
3840
+ fencingToken: number;
3841
+ startedAt: string;
3842
+ }
3843
+ interface AttemptVerificationEvent {
3844
+ runId: string;
3845
+ attemptId: string;
3846
+ verificationId: string;
3847
+ verificationHash: string | null;
3848
+ receiptId: string;
3849
+ receiptHash: string;
3850
+ mutationId: string;
3851
+ sequence: number;
3852
+ attemptRevision: number;
3853
+ workspaceLeaseRevision: number;
3854
+ workerSessionRevision: number;
3855
+ controllerId: string;
3856
+ controllerLeaseId: string;
3857
+ fencingToken: number;
3858
+ type: AttemptVerificationEventType;
3859
+ outcome: VerificationOutcome | null;
3860
+ resultingAttemptStatus: AttemptStatus;
3861
+ createdAt: string;
3862
+ }
3863
+ interface SubmitAttemptVerificationInput {
3864
+ runId: string;
3865
+ expectedRunRevision: number;
3866
+ controller: ControllerLeaseCredential;
3867
+ mutationId: string;
3868
+ now: string;
3869
+ attemptId: string;
3870
+ expectedAttemptRevision: number;
3871
+ workspaceLeaseId: string;
3872
+ expectedWorkspaceLeaseRevision: number;
3873
+ workerSessionId: string;
3874
+ expectedWorkerSessionRevision: number;
3875
+ receiptId: string;
3876
+ receiptHash: string;
3877
+ verification: AgentEngineVerification_v2;
3878
+ }
3879
+ /** Built-in fail-closed policy used by the first public acceptance surface. */
3880
+ declare const STRICT_ATTEMPT_ACCEPTANCE_POLICY_ID: "lexrunner.strict-pass";
3881
+ declare const STRICT_ATTEMPT_ACCEPTANCE_POLICY_VERSION: "1.0.0";
3882
+ interface BeginAttemptVerificationInput {
3883
+ runId: string;
3884
+ expectedRunRevision: number;
3885
+ controller: ControllerLeaseCredential;
3886
+ mutationId: string;
3887
+ now: string;
3888
+ verificationId: string;
3889
+ attemptId: string;
3890
+ expectedAttemptRevision: number;
3891
+ workspaceLeaseId: string;
3892
+ expectedWorkspaceLeaseRevision: number;
3893
+ workerSessionId: string;
3894
+ expectedWorkerSessionRevision: number;
3895
+ receiptId: string;
3896
+ receiptHash: string;
3897
+ }
3898
+ type AttemptVerificationBeginResult = {
3899
+ started: true;
3900
+ authorization: AttemptVerificationAuthorizationRecord;
3901
+ attempt: AttemptRecord;
3902
+ event: AttemptVerificationEvent;
3903
+ idempotentReplay: boolean;
3904
+ } | {
3905
+ started: false;
3906
+ reason: AttemptVerificationFailureReason;
3907
+ currentAttemptRevision?: number;
3908
+ currentWorkspaceLeaseRevision?: number;
3909
+ currentSessionRevision?: number;
3910
+ currentRunRevision?: number;
3911
+ };
3912
+ type AttemptVerificationSubmissionResult = {
3913
+ recorded: true;
3914
+ verification: AttemptVerificationRecord;
3915
+ attempt: AttemptRecord;
3916
+ event: AttemptVerificationEvent;
3917
+ idempotentReplay: boolean;
3918
+ } | {
3919
+ recorded: false;
3920
+ reason: AttemptVerificationFailureReason;
3921
+ currentAttemptRevision?: number;
3922
+ currentWorkspaceLeaseRevision?: number;
3923
+ currentSessionRevision?: number;
3924
+ currentRunRevision?: number;
3925
+ };
3926
+ type WorkerSessionMutationResult = {
3927
+ updated: true;
3928
+ attempt: AttemptRecord;
3929
+ workerSession: WorkerSessionRecord;
3930
+ event: WorkerSessionEvent;
3931
+ idempotentReplay: boolean;
3932
+ } | {
3933
+ updated: false;
3934
+ reason: WorkerSessionMutationFailureReason;
3935
+ currentAttemptRevision?: number;
3936
+ currentWorkspaceLeaseRevision?: number;
3937
+ currentSessionRevision?: number;
3938
+ currentRunRevision?: number;
3939
+ };
3940
+ interface CreateAttemptInput extends AuthenticatedMutationInput {
3941
+ attemptId: string;
3942
+ workItemId: string;
3943
+ workItemRevision: number;
3944
+ packetId: string;
3945
+ packetHash: string;
3946
+ baseSha: string;
3947
+ retry?: AttemptRetryDelta_v1;
3948
+ fanout?: FanoutAttemptBinding_v1;
3949
+ }
3950
+ interface CreateFanoutPlanInput extends AuthenticatedMutationInput {
3951
+ plan: AgentWorkFanoutPlan_v1;
3952
+ }
3953
+ interface CommitFanInDecisionInput extends AuthenticatedMutationInput {
3954
+ decision: AgentWorkFanInDecision_v1;
3955
+ }
3956
+ type FanoutPlanMutationResult = {
3957
+ created: true;
3958
+ plan: FanoutPlanRecord;
3959
+ idempotentReplay: boolean;
3960
+ } | {
3961
+ created: false;
3962
+ reason: WorkspaceMutationFailureReason | "fanout_conflict" | "fanout_not_found" | "fanout_evidence_mismatch";
3963
+ currentRunRevision?: number;
3964
+ };
3965
+ type FanInDecisionMutationResult = {
3966
+ recorded: true;
3967
+ decision: FanInDecisionRecord;
3968
+ idempotentReplay: boolean;
3969
+ } | {
3970
+ recorded: false;
3971
+ reason: WorkspaceMutationFailureReason | "fanout_conflict" | "fanout_not_found" | "fanout_incomplete" | "fanout_evidence_mismatch";
3972
+ currentRunRevision?: number;
3973
+ };
3974
+ interface AcquireWorkspaceInput extends AuthenticatedMutationInput, WorkspaceIdentity {
3975
+ workspaceLeaseId: string;
3976
+ workItemId: string;
3977
+ baseSha: string;
3978
+ expectedAttemptRevision: number;
3979
+ ttlMs: number;
3980
+ observation?: WorkspaceObservation;
3981
+ }
3982
+ interface TransitionAttemptInput extends AuthenticatedMutationInput {
3983
+ attemptId: string;
3984
+ expectedAttemptRevision: number;
3985
+ status: AttemptStatus;
3986
+ receiptId?: string;
3987
+ verificationId?: string;
3988
+ details?: JsonValue;
3989
+ }
3990
+ interface HeartbeatWorkspaceInput extends AuthenticatedMutationInput {
3991
+ attemptId: string;
3992
+ workspaceLeaseId: string;
3993
+ expectedAttemptRevision: number;
3994
+ expectedWorkspaceLeaseRevision: number;
3995
+ ttlMs: number;
3996
+ observation: WorkspaceObservation;
3997
+ }
3998
+ interface ReleaseWorkspaceInput extends AuthenticatedMutationInput {
3999
+ attemptId: string;
4000
+ workspaceLeaseId: string;
4001
+ expectedAttemptRevision: number;
4002
+ expectedWorkspaceLeaseRevision: number;
4003
+ disposition: ReleaseWorkspaceDisposition;
4004
+ observation: WorkspaceObservation;
4005
+ }
4006
+ interface ReconcileWorkspaceInput extends AuthenticatedMutationInput {
4007
+ attemptId: string;
4008
+ workspaceLeaseId: string;
4009
+ expectedAttemptRevision: number;
4010
+ expectedWorkspaceLeaseRevision: number;
4011
+ action: WorkspaceReconciliationAction;
4012
+ ttlMs?: number;
4013
+ observation: WorkspaceObservation;
4014
+ }
4015
+ interface QuarantineWorkspaceInput extends AuthenticatedMutationInput {
4016
+ attemptId: string;
4017
+ workspaceLeaseId: string;
4018
+ expectedAttemptRevision: number;
4019
+ expectedWorkspaceLeaseRevision: number;
4020
+ reason: string;
4021
+ observation: WorkspaceObservation;
4022
+ }
4023
+ type WorkspaceMutationResult = {
4024
+ updated: true;
4025
+ attempt: AttemptRecord;
4026
+ workspaceLease: WorkspaceLifecycleLeaseRecord | null;
4027
+ event: WorkspaceLifecycleEvent;
4028
+ idempotentReplay: boolean;
4029
+ } | {
4030
+ updated: false;
4031
+ reason: WorkspaceMutationFailureReason;
4032
+ currentAttemptRevision?: number;
4033
+ currentWorkspaceLeaseRevision?: number;
4034
+ currentRunRevision?: number;
4035
+ };
4036
+ interface WorkspaceLifecycleStore {
4037
+ createAttempt(input: CreateAttemptInput): Promise<WorkspaceMutationResult>;
4038
+ transitionAttempt(input: TransitionAttemptInput): Promise<WorkspaceMutationResult>;
4039
+ acquireWorkspace(input: AcquireWorkspaceInput): Promise<WorkspaceMutationResult>;
4040
+ heartbeatWorkspace(input: HeartbeatWorkspaceInput): Promise<WorkspaceMutationResult>;
4041
+ releaseWorkspace(input: ReleaseWorkspaceInput): Promise<WorkspaceMutationResult>;
4042
+ reconcileWorkspace(input: ReconcileWorkspaceInput): Promise<WorkspaceMutationResult>;
4043
+ quarantineWorkspace(input: QuarantineWorkspaceInput): Promise<WorkspaceMutationResult>;
4044
+ getAttempt(attemptId: string): Promise<AttemptRecord | null>;
4045
+ listAttempts(runId: string): Promise<AttemptRecord[]>;
4046
+ getAttemptRetryDelta(attemptId: string): Promise<AttemptRetryDeltaRecord | null>;
4047
+ getWorkspaceLease(leaseId: string): Promise<WorkspaceLifecycleLeaseRecord | null>;
4048
+ listWorkspaceLeases(runId: string): Promise<WorkspaceLifecycleLeaseRecord[]>;
4049
+ listWorkspaceLifecycleEvents(runId: string): Promise<WorkspaceLifecycleEvent[]>;
4050
+ }
4051
+ /** Durable planning and comparison port for one-level bounded parallel Attempts. */
4052
+ interface AgentWorkFanoutStore {
4053
+ createFanoutPlan(input: CreateFanoutPlanInput): Promise<FanoutPlanMutationResult>;
4054
+ getFanoutPlan(fanoutId: string): Promise<FanoutPlanRecord | null>;
4055
+ getAttemptFanoutBinding(attemptId: string): Promise<FanoutAttemptBindingRecord | null>;
4056
+ listFanoutAttemptBindings(fanoutId: string): Promise<FanoutAttemptBindingRecord[]>;
4057
+ commitFanInDecision(input: CommitFanInDecisionInput): Promise<FanInDecisionMutationResult>;
4058
+ getFanInDecision(decisionId: string): Promise<FanInDecisionRecord | null>;
4059
+ getFanInDecisionForFanout(fanoutId: string): Promise<FanInDecisionRecord | null>;
4060
+ }
4061
+ /** Additive immutable AgentTaskReceipt v2 persistence port. */
4062
+ interface AttemptReceiptStore {
4063
+ submitAttemptReceipt(input: SubmitAttemptReceiptInput): Promise<AttemptReceiptSubmissionResult>;
4064
+ getAttemptReceipt(receiptId: string): Promise<AttemptReceiptRecord | null>;
4065
+ getAttemptReceiptForAttempt(attemptId: string): Promise<AttemptReceiptRecord | null>;
4066
+ getAttemptReceiptByHash(receiptHash: string): Promise<AttemptReceiptRecord | null>;
4067
+ listAttemptReceiptEvents(runId: string): Promise<AttemptReceiptEvent[]>;
4068
+ }
4069
+ /** Additive immutable AgentEngineVerification v2 persistence port. */
4070
+ interface AttemptVerificationStore {
4071
+ beginAttemptVerification(input: BeginAttemptVerificationInput): Promise<AttemptVerificationBeginResult>;
4072
+ submitAttemptVerification(input: SubmitAttemptVerificationInput): Promise<AttemptVerificationSubmissionResult>;
4073
+ getAttemptVerification(verificationId: string): Promise<AttemptVerificationRecord | null>;
4074
+ getAttemptVerificationForAttempt(attemptId: string): Promise<AttemptVerificationRecord | null>;
4075
+ getAttemptVerificationByHash(verificationHash: string): Promise<AttemptVerificationRecord | null>;
4076
+ getAttemptVerificationAuthorization(verificationId: string): Promise<AttemptVerificationAuthorizationRecord | null>;
4077
+ getAttemptVerificationAuthorizationForAttempt(attemptId: string): Promise<AttemptVerificationAuthorizationRecord | null>;
4078
+ listAttemptVerificationEvents(runId: string): Promise<AttemptVerificationEvent[]>;
4079
+ }
4080
+
4081
+ type LifecyclePhase = "controller" | "attempt_create" | "workspace_allocate" | "workspace_resume" | "launch_authorize";
4082
+ type LifecycleFailureReason = "controller_held" | "store_rejected" | "workspace_rejected" | "identity_mismatch" | "inactive_workspace" | "stale_authority" | "expired_workspace" | "reconciliation_required";
4083
+ interface AgentWorkLifecycleSuccess {
4084
+ ok: true;
4085
+ outcome: "launch_authorized";
4086
+ controllerLease: ControllerLease;
4087
+ run: BoundedRunStatus;
4088
+ attempt: BoundedAttemptStatus;
4089
+ workspace: BoundedWorkspaceStatus;
4090
+ idempotentReplay: boolean;
4091
+ }
4092
+ interface AgentWorkLifecycleFailure {
4093
+ ok: false;
4094
+ phase: LifecyclePhase;
4095
+ reason: LifecycleFailureReason;
4096
+ reconciliationRequired: boolean;
4097
+ status?: AgentWorkStatus;
4098
+ storeReason?: WorkspaceMutationFailureReason;
4099
+ }
4100
+ type AgentWorkLifecycleResult = AgentWorkLifecycleSuccess | AgentWorkLifecycleFailure;
4101
+ interface BoundedRunStatus {
4102
+ runId: string;
4103
+ revision: number;
4104
+ state: string | null;
4105
+ updatedAt: string | null;
4106
+ controller: {
4107
+ controllerId: string;
4108
+ leaseId: string;
4109
+ fencingToken: number;
4110
+ expiresAt: string;
4111
+ } | null;
4112
+ }
4113
+ interface BoundedAttemptStatus {
4114
+ attemptId: string;
4115
+ revision: number;
4116
+ status: AttemptRecord["status"];
4117
+ workItemId: string;
4118
+ workItemRevision: number;
4119
+ packetId: string;
4120
+ packetHash: string;
4121
+ baseSha: string;
4122
+ workspaceLeaseId: string | null;
4123
+ updatedAt: string;
4124
+ completedAt: string | null;
4125
+ }
4126
+ interface BoundedWorkspaceStatus {
4127
+ leaseId: string;
4128
+ revision: number;
4129
+ status: WorkspaceLifecycleLeaseRecord["status"];
4130
+ repositoryId: string;
4131
+ hostId: string;
4132
+ gitRuntime: string;
4133
+ branch: string;
4134
+ worktreePath: string;
4135
+ baseSha: string;
4136
+ heartbeatAt: string;
4137
+ expiresAt: string;
4138
+ cleanupDisposition: WorkspaceLifecycleLeaseRecord["cleanupDisposition"] | null;
4139
+ observation: {
4140
+ exists: boolean;
4141
+ registered: boolean;
4142
+ headSha: string | null;
4143
+ cleanliness: WorkspaceObservation["cleanliness"];
4144
+ dirtyPathCount: number;
4145
+ reason: string | null;
4146
+ } | null;
4147
+ }
4148
+ interface AgentWorkStatus {
4149
+ run: BoundedRunStatus | null;
4150
+ attempt: BoundedAttemptStatus | null;
4151
+ workspace: BoundedWorkspaceStatus | null;
4152
+ launch: BoundedLaunchStatus | null;
4153
+ }
4154
+ interface BoundedLaunchStatus {
4155
+ state: "not_authorized" | "binding_missing" | "binding_stale" | "bound" | "failed_closed" | "inconsistent";
4156
+ reconciliationRequired: boolean;
4157
+ }
4158
+
4159
+ interface WorkerSessionStatusResult {
4160
+ workerSession: WorkerSessionRecord | null;
4161
+ adapter: BoundedWorkerAdapterStatus | null;
4162
+ }
4163
+ interface BoundedWorkerAdapterStatus extends WorkerAdapterBindingRecord {
4164
+ enforcement: "enforced" | "trust_gap";
4165
+ }
4166
+
4167
+ interface AttemptLaunchBundleSuccess {
4168
+ ok: true;
4169
+ outcome: "launch_bundle_ready";
4170
+ lifecycle: AgentWorkLifecycleSuccess;
4171
+ packet: AgentTaskPacket_v1;
4172
+ envelope: ExecutionEnvelope_v1;
4173
+ }
4174
+ type AttemptLaunchBundleResult = AttemptLaunchBundleSuccess | AgentWorkLifecycleFailure;
4175
+
4176
+ declare const AttemptStartRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4177
+ runtime: z.ZodObject<{
4178
+ databasePath: z.ZodString;
4179
+ repositoryId: z.ZodString;
4180
+ repositoryRoot: z.ZodString;
4181
+ worktreeRoot: z.ZodString;
4182
+ hostId: z.ZodString;
4183
+ gitRuntime: z.ZodString;
4184
+ pathComparison: z.ZodEnum<{
4185
+ "case-sensitive": "case-sensitive";
4186
+ "case-insensitive": "case-insensitive";
4187
+ }>;
4188
+ gitExecutable: z.ZodOptional<z.ZodString>;
4189
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
4190
+ maxDirtyPaths: z.ZodOptional<z.ZodNumber>;
4191
+ }, z.core.$strict>;
4192
+ attempt: z.ZodObject<{
4193
+ runId: z.ZodString;
4194
+ initialRunState: z.ZodObject<{
4195
+ runId: z.ZodString;
4196
+ mode: z.ZodString;
4197
+ procedure: z.ZodString;
4198
+ repo: z.ZodString;
4199
+ task: z.ZodOptional<z.ZodString>;
4200
+ state: z.ZodString;
4201
+ createdAt: z.ZodString;
4202
+ updatedAt: z.ZodString;
4203
+ completedAt: z.ZodOptional<z.ZodString>;
4204
+ completedSteps: z.ZodArray<z.ZodString>;
4205
+ currentStep: z.ZodNullable<z.ZodString>;
4206
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4207
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4208
+ persona: z.ZodOptional<z.ZodObject<{
4209
+ mode: z.ZodString;
4210
+ forbidden: z.ZodArray<z.ZodString>;
4211
+ completionGates: z.ZodArray<z.ZodString>;
4212
+ decisionStyle: z.ZodOptional<z.ZodObject<{
4213
+ preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
4214
+ requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
4215
+ escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
4216
+ }, z.core.$strip>>;
4217
+ outputFormat: z.ZodOptional<z.ZodObject<{
4218
+ severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
4219
+ requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
4220
+ }, z.core.$strip>>;
4221
+ }, z.core.$strip>>;
4222
+ }, z.core.$strip>;
4223
+ controller: z.ZodObject<{
4224
+ controllerId: z.ZodString;
4225
+ leaseId: z.ZodString;
4226
+ now: z.ZodString;
4227
+ ttlMs: z.ZodNumber;
4228
+ }, z.core.$strict>;
4229
+ attempt: z.ZodObject<{
4230
+ attemptId: z.ZodString;
4231
+ workItemId: z.ZodString;
4232
+ workItemRevision: z.ZodNumber;
4233
+ packetId: z.ZodString;
4234
+ packetHash: z.ZodString;
4235
+ baseSha: z.ZodString;
4236
+ }, z.core.$strict>;
4237
+ workspace: z.ZodObject<{
4238
+ workspaceLeaseId: z.ZodString;
4239
+ repositoryId: z.ZodString;
4240
+ hostId: z.ZodString;
4241
+ gitRuntime: z.ZodString;
4242
+ projectRoot: z.ZodString;
4243
+ branch: z.ZodString;
4244
+ worktreePath: z.ZodString;
4245
+ ttlMs: z.ZodNumber;
4246
+ }, z.core.$strict>;
4247
+ mutations: z.ZodObject<{
4248
+ createAttempt: z.ZodObject<{
4249
+ mutationId: z.ZodString;
4250
+ now: z.ZodString;
4251
+ }, z.core.$strict>;
4252
+ reserveWorkspace: z.ZodObject<{
4253
+ mutationId: z.ZodString;
4254
+ now: z.ZodString;
4255
+ }, z.core.$strict>;
4256
+ activateWorkspace: z.ZodObject<{
4257
+ mutationId: z.ZodString;
4258
+ now: z.ZodString;
4259
+ }, z.core.$strict>;
4260
+ resumeWorkspace: z.ZodObject<{
4261
+ mutationId: z.ZodString;
4262
+ now: z.ZodString;
4263
+ }, z.core.$strict>;
4264
+ quarantineWorkspace: z.ZodObject<{
4265
+ mutationId: z.ZodString;
4266
+ now: z.ZodString;
4267
+ }, z.core.$strict>;
4268
+ authorizeLaunch: z.ZodObject<{
4269
+ mutationId: z.ZodString;
4270
+ now: z.ZodString;
4271
+ }, z.core.$strict>;
4272
+ }, z.core.$strict>;
4273
+ broker: z.ZodOptional<z.ZodObject<{
4274
+ timeoutMs: z.ZodNumber;
4275
+ }, z.core.$strict>>;
4276
+ }, z.core.$strict>;
4277
+ }, z.core.$strict>>;
4278
+ declare const AttemptPrepareRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4279
+ runtime: z.ZodObject<{
4280
+ databasePath: z.ZodString;
4281
+ repositoryId: z.ZodString;
4282
+ repositoryRoot: z.ZodString;
4283
+ worktreeRoot: z.ZodString;
4284
+ hostId: z.ZodString;
4285
+ gitRuntime: z.ZodString;
4286
+ pathComparison: z.ZodEnum<{
4287
+ "case-sensitive": "case-sensitive";
4288
+ "case-insensitive": "case-insensitive";
4289
+ }>;
4290
+ gitExecutable: z.ZodOptional<z.ZodString>;
4291
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
4292
+ maxDirtyPaths: z.ZodOptional<z.ZodNumber>;
4293
+ }, z.core.$strict>;
4294
+ workItem: z.ZodObject<{
4295
+ schema_version: z.ZodLiteral<"1.0.0">;
4296
+ work_item_id: z.ZodString;
4297
+ revision: z.ZodNumber;
4298
+ source: z.ZodObject<{
4299
+ kind: z.ZodEnum<{
4300
+ manual: "manual";
4301
+ github: "github";
4302
+ jira: "jira";
4303
+ }>;
4304
+ external_id: z.ZodString;
4305
+ revision: z.ZodString;
4306
+ url: z.ZodOptional<z.ZodString>;
4307
+ captured_at: z.ZodString;
4308
+ }, z.core.$strict>;
4309
+ repository: z.ZodObject<{
4310
+ id: z.ZodString;
4311
+ remote_url: z.ZodOptional<z.ZodString>;
4312
+ default_branch: z.ZodOptional<z.ZodString>;
4313
+ }, z.core.$strict>;
4314
+ title: z.ZodString;
4315
+ objective: z.ZodString;
4316
+ description: z.ZodString;
4317
+ acceptance_criteria: z.ZodArray<z.ZodObject<{
4318
+ id: z.ZodString;
4319
+ text: z.ZodString;
4320
+ }, z.core.$strict>>;
4321
+ constraints: z.ZodArray<z.ZodString>;
4322
+ labels: z.ZodArray<z.ZodString>;
4323
+ dependencies: z.ZodArray<z.ZodString>;
4324
+ }, z.core.$strict>;
4325
+ identity: z.ZodObject<{
4326
+ runId: z.ZodString;
4327
+ attemptId: z.ZodString;
4328
+ baseSha: z.ZodString;
4329
+ }, z.core.$strict>;
4330
+ packet: z.ZodObject<{
4331
+ scope: z.ZodObject<{
4332
+ read_globs: z.ZodArray<z.ZodString>;
4333
+ write_globs: z.ZodArray<z.ZodString>;
4334
+ deny_globs: z.ZodArray<z.ZodString>;
4335
+ cross_repo_allowed: z.ZodBoolean;
4336
+ }, z.core.$strict>;
4337
+ budget: z.ZodObject<{
4338
+ max_tokens: z.ZodOptional<z.ZodNumber>;
4339
+ max_tool_calls: z.ZodOptional<z.ZodNumber>;
4340
+ max_elapsed_ms: z.ZodOptional<z.ZodNumber>;
4341
+ }, z.core.$strict>;
4342
+ verification: z.ZodArray<z.ZodObject<{
4343
+ id: z.ZodString;
4344
+ argv: z.ZodArray<z.ZodString>;
4345
+ cwd_rel: z.ZodOptional<z.ZodString>;
4346
+ depends_on: z.ZodOptional<z.ZodArray<z.ZodString>>;
4347
+ expected_exit_codes: z.ZodArray<z.ZodNumber>;
4348
+ }, z.core.$strict>>;
4349
+ authority: z.ZodObject<{
4350
+ edit: z.ZodBoolean;
4351
+ git_write: z.ZodBoolean;
4352
+ github_write: z.ZodBoolean;
4353
+ external_runtime: z.ZodBoolean;
4354
+ secrets: z.ZodBoolean;
4355
+ signing: z.ZodBoolean;
4356
+ release: z.ZodBoolean;
4357
+ }, z.core.$strict>;
4358
+ instructions: z.ZodArray<z.ZodString>;
4359
+ packetId: z.ZodString;
4360
+ createdAt: z.ZodString;
4361
+ }, z.core.$strict>;
4362
+ envelope: z.ZodObject<{
4363
+ envelopeId: z.ZodString;
4364
+ os: z.ZodEnum<{
4365
+ darwin: "darwin";
4366
+ linux: "linux";
4367
+ other: "other";
4368
+ windows: "windows";
4369
+ }>;
4370
+ architecture: z.ZodString;
4371
+ workerRuntime: z.ZodString;
4372
+ projectRoot: z.ZodString;
4373
+ executionRoot: z.ZodString;
4374
+ exposedEnvironmentKeys: z.ZodArray<z.ZodString>;
4375
+ createdAt: z.ZodString;
4376
+ }, z.core.$strict>;
4377
+ attempt: z.ZodObject<{
4378
+ controller: z.ZodObject<{
4379
+ controllerId: z.ZodString;
4380
+ leaseId: z.ZodString;
4381
+ now: z.ZodString;
4382
+ ttlMs: z.ZodNumber;
4383
+ }, z.core.$strict>;
4384
+ broker: z.ZodOptional<z.ZodObject<{
4385
+ timeoutMs: z.ZodNumber;
4386
+ }, z.core.$strict>>;
4387
+ initialRunState: z.ZodObject<{
4388
+ runId: z.ZodString;
4389
+ mode: z.ZodString;
4390
+ procedure: z.ZodString;
4391
+ repo: z.ZodString;
4392
+ task: z.ZodOptional<z.ZodString>;
4393
+ state: z.ZodString;
4394
+ createdAt: z.ZodString;
4395
+ updatedAt: z.ZodString;
4396
+ completedAt: z.ZodOptional<z.ZodString>;
4397
+ completedSteps: z.ZodArray<z.ZodString>;
4398
+ currentStep: z.ZodNullable<z.ZodString>;
4399
+ params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4400
+ metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
4401
+ persona: z.ZodOptional<z.ZodObject<{
4402
+ mode: z.ZodString;
4403
+ forbidden: z.ZodArray<z.ZodString>;
4404
+ completionGates: z.ZodArray<z.ZodString>;
4405
+ decisionStyle: z.ZodOptional<z.ZodObject<{
4406
+ preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
4407
+ requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
4408
+ escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
4409
+ }, z.core.$strip>>;
4410
+ outputFormat: z.ZodOptional<z.ZodObject<{
4411
+ severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
4412
+ requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
4413
+ }, z.core.$strip>>;
4414
+ }, z.core.$strip>>;
4415
+ }, z.core.$strip>;
4416
+ mutations: z.ZodObject<{
4417
+ createAttempt: z.ZodObject<{
4418
+ mutationId: z.ZodString;
4419
+ now: z.ZodString;
4420
+ }, z.core.$strict>;
4421
+ reserveWorkspace: z.ZodObject<{
4422
+ mutationId: z.ZodString;
4423
+ now: z.ZodString;
4424
+ }, z.core.$strict>;
4425
+ activateWorkspace: z.ZodObject<{
4426
+ mutationId: z.ZodString;
4427
+ now: z.ZodString;
4428
+ }, z.core.$strict>;
4429
+ resumeWorkspace: z.ZodObject<{
4430
+ mutationId: z.ZodString;
4431
+ now: z.ZodString;
4432
+ }, z.core.$strict>;
4433
+ quarantineWorkspace: z.ZodObject<{
4434
+ mutationId: z.ZodString;
4435
+ now: z.ZodString;
4436
+ }, z.core.$strict>;
4437
+ authorizeLaunch: z.ZodObject<{
4438
+ mutationId: z.ZodString;
4439
+ now: z.ZodString;
4440
+ }, z.core.$strict>;
4441
+ }, z.core.$strict>;
4442
+ workspace: z.ZodObject<{
4443
+ branch: z.ZodString;
4444
+ worktreePath: z.ZodString;
4445
+ ttlMs: z.ZodNumber;
4446
+ workspaceLeaseId: z.ZodString;
4447
+ }, z.core.$strict>;
4448
+ }, z.core.$strict>;
4449
+ }, z.core.$strict>>;
4450
+ declare const AttemptStatusInputJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4451
+ databasePath: z.ZodString;
4452
+ runId: z.ZodString;
4453
+ attemptId: z.ZodString;
4454
+ }, z.core.$strict>>;
4455
+ interface AdapterInputError {
4456
+ code: "invalid_input";
4457
+ message: string;
4458
+ issues: Array<{
4459
+ path: string;
4460
+ message: string;
4461
+ }>;
4462
+ }
4463
+ interface AdapterOperationError {
4464
+ code: "operation_failed";
4465
+ message: string;
4466
+ }
4467
+ type AdapterError = AdapterInputError | AdapterOperationError;
4468
+ type AgentWorkHandlerResult<T> = {
4469
+ ok: true;
4470
+ result: T;
4471
+ } | {
4472
+ ok: false;
4473
+ error: AdapterError;
4474
+ };
4475
+ interface AttemptLifecycleHandlers {
4476
+ start(request: unknown): Promise<AgentWorkHandlerResult<AgentWorkLifecycleResult>>;
4477
+ status(request: unknown): Promise<AgentWorkHandlerResult<AgentWorkStatus>>;
4478
+ }
4479
+ interface AttemptPreparationHandler {
4480
+ prepare(request: unknown): Promise<AgentWorkHandlerResult<AttemptLaunchBundleResult>>;
4481
+ }
4482
+ /** Top-level lifecycle seam. Every request owns and closes its SQLite connection. */
4483
+ declare function createAttemptLifecycleHandlers(): AttemptLifecycleHandlers & AttemptPreparationHandler;
4484
+
4485
+ declare const AttemptWorkerAttachRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4486
+ runtime: z.ZodObject<{
4487
+ databasePath: z.ZodString;
4488
+ repositoryId: z.ZodString;
4489
+ repositoryRoot: z.ZodString;
4490
+ worktreeRoot: z.ZodString;
4491
+ hostId: z.ZodString;
4492
+ gitRuntime: z.ZodString;
4493
+ pathComparison: z.ZodEnum<{
4494
+ "case-sensitive": "case-sensitive";
4495
+ "case-insensitive": "case-insensitive";
4496
+ }>;
4497
+ gitExecutable: z.ZodOptional<z.ZodString>;
4498
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
4499
+ maxDirtyPaths: z.ZodOptional<z.ZodNumber>;
4500
+ }, z.core.$strict>;
4501
+ attach: z.ZodObject<{
4502
+ envelope: z.ZodObject<{
4503
+ schema_version: z.ZodLiteral<"1.0.0">;
4504
+ envelope_id: z.ZodString;
4505
+ run_id: z.ZodString;
4506
+ attempt_id: z.ZodString;
4507
+ packet_id: z.ZodString;
4508
+ packet_hash: z.ZodString;
4509
+ workspace_lease_id: z.ZodString;
4510
+ workspace_lease_revision: z.ZodNumber;
4511
+ expected_head_sha: z.ZodString;
4512
+ branch: z.ZodString;
4513
+ runtime: z.ZodObject<{
4514
+ host_id: z.ZodString;
4515
+ os: z.ZodEnum<{
4516
+ darwin: "darwin";
4517
+ linux: "linux";
4518
+ other: "other";
4519
+ windows: "windows";
4520
+ }>;
4521
+ architecture: z.ZodString;
4522
+ worker_runtime: z.ZodString;
4523
+ git_runtime: z.ZodString;
4524
+ }, z.core.$strict>;
4525
+ paths: z.ZodObject<{
4526
+ project_root: z.ZodString;
4527
+ execution_root: z.ZodString;
4528
+ worktree_root: z.ZodString;
4529
+ }, z.core.$strict>;
4530
+ path_mappings: z.ZodArray<z.ZodObject<{
4531
+ runtime: z.ZodString;
4532
+ worktree_root: z.ZodString;
4533
+ }, z.core.$strict>>;
4534
+ exposed_environment_keys: z.ZodArray<z.ZodString>;
4535
+ created_at: z.ZodString;
4536
+ }, z.core.$strict>;
4537
+ worker: z.ZodObject<{
4538
+ backend: z.ZodEnum<{
4539
+ external: "external";
4540
+ "host-subagent": "host-subagent";
4541
+ "codex-cli": "codex-cli";
4542
+ }>;
4543
+ workerId: z.ZodString;
4544
+ model: z.ZodOptional<z.ZodString>;
4545
+ startedAt: z.ZodString;
4546
+ }, z.core.$strict>;
4547
+ adapter: z.ZodObject<{
4548
+ schema_version: z.ZodLiteral<"1.0.0">;
4549
+ adapter_id: z.ZodString;
4550
+ adapter_version: z.ZodString;
4551
+ mode: z.ZodEnum<{
4552
+ launch: "launch";
4553
+ assisted_attach: "assisted_attach";
4554
+ }>;
4555
+ accepted_trust_gaps: z.ZodArray<z.ZodEnum<{
4556
+ network: "network";
4557
+ release: "release";
4558
+ git_write: "git_write";
4559
+ github_write: "github_write";
4560
+ external_runtime: "external_runtime";
4561
+ secrets: "secrets";
4562
+ signing: "signing";
4563
+ filesystem_read: "filesystem_read";
4564
+ filesystem_write: "filesystem_write";
4565
+ nested_delegation: "nested_delegation";
4566
+ }>>;
4567
+ }, z.core.$strict>;
4568
+ runId: z.ZodString;
4569
+ expectedRunRevision: z.ZodNumber;
4570
+ controller: z.ZodObject<{
4571
+ runId: z.ZodString;
4572
+ controllerId: z.ZodString;
4573
+ leaseId: z.ZodString;
4574
+ fencingToken: z.ZodNumber;
4575
+ }, z.core.$strict>;
4576
+ attemptId: z.ZodString;
4577
+ expectedAttemptRevision: z.ZodNumber;
4578
+ workspaceLeaseId: z.ZodString;
4579
+ expectedWorkspaceLeaseRevision: z.ZodNumber;
4580
+ workerSessionId: z.ZodString;
4581
+ mutation: z.ZodObject<{
4582
+ mutationId: z.ZodString;
4583
+ now: z.ZodString;
4584
+ }, z.core.$strict>;
4585
+ }, z.core.$strict>;
4586
+ }, z.core.$strict>>;
4587
+ declare const AttemptWorkerHeartbeatRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4588
+ databasePath: z.ZodString;
4589
+ heartbeat: z.ZodObject<{
4590
+ expectedWorkerSessionRevision: z.ZodNumber;
4591
+ status: z.ZodOptional<z.ZodEnum<{
4592
+ awaiting_human: "awaiting_human";
4593
+ running: "running";
4594
+ }>>;
4595
+ runId: z.ZodString;
4596
+ expectedRunRevision: z.ZodNumber;
4597
+ controller: z.ZodObject<{
4598
+ runId: z.ZodString;
4599
+ controllerId: z.ZodString;
4600
+ leaseId: z.ZodString;
4601
+ fencingToken: z.ZodNumber;
4602
+ }, z.core.$strict>;
4603
+ attemptId: z.ZodString;
4604
+ expectedAttemptRevision: z.ZodNumber;
4605
+ workspaceLeaseId: z.ZodString;
4606
+ expectedWorkspaceLeaseRevision: z.ZodNumber;
4607
+ workerSessionId: z.ZodString;
4608
+ mutation: z.ZodObject<{
4609
+ mutationId: z.ZodString;
4610
+ now: z.ZodString;
4611
+ }, z.core.$strict>;
4612
+ }, z.core.$strict>;
4613
+ }, z.core.$strict>>;
4614
+ declare const AttemptWorkerEndRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4615
+ databasePath: z.ZodString;
4616
+ end: z.ZodObject<{
4617
+ expectedWorkerSessionRevision: z.ZodNumber;
4618
+ status: z.ZodEnum<{
4619
+ completed: "completed";
4620
+ failed: "failed";
4621
+ cancelled: "cancelled";
4622
+ lost: "lost";
4623
+ }>;
4624
+ exit: z.ZodObject<{
4625
+ code: z.ZodOptional<z.ZodNumber>;
4626
+ signal: z.ZodOptional<z.ZodString>;
4627
+ summary: z.ZodOptional<z.ZodString>;
4628
+ }, z.core.$strict>;
4629
+ runId: z.ZodString;
4630
+ expectedRunRevision: z.ZodNumber;
4631
+ controller: z.ZodObject<{
4632
+ runId: z.ZodString;
4633
+ controllerId: z.ZodString;
4634
+ leaseId: z.ZodString;
4635
+ fencingToken: z.ZodNumber;
4636
+ }, z.core.$strict>;
4637
+ attemptId: z.ZodString;
4638
+ expectedAttemptRevision: z.ZodNumber;
4639
+ workspaceLeaseId: z.ZodString;
4640
+ expectedWorkspaceLeaseRevision: z.ZodNumber;
4641
+ workerSessionId: z.ZodString;
4642
+ mutation: z.ZodObject<{
4643
+ mutationId: z.ZodString;
4644
+ now: z.ZodString;
4645
+ }, z.core.$strict>;
4646
+ }, z.core.$strict>;
4647
+ }, z.core.$strict>>;
4648
+ declare const AttemptWorkerStatusRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4649
+ databasePath: z.ZodString;
4650
+ runId: z.ZodString;
4651
+ attemptId: z.ZodString;
4652
+ }, z.core.$strict>>;
4653
+ interface AttemptWorkerHandlers {
4654
+ attach(request: unknown): Promise<AgentWorkHandlerResult<WorkerSessionMutationResult>>;
4655
+ heartbeat(request: unknown): Promise<AgentWorkHandlerResult<WorkerSessionMutationResult>>;
4656
+ end(request: unknown): Promise<AgentWorkHandlerResult<WorkerSessionMutationResult>>;
4657
+ status(request: unknown): Promise<AgentWorkHandlerResult<WorkerSessionStatusResult>>;
4658
+ }
4659
+ declare function createAttemptWorkerHandlers(): AttemptWorkerHandlers;
4660
+
4661
+ interface VerificationWorkspaceObservation {
4662
+ headSha: string;
4663
+ patchHash: string;
4664
+ observationHash: string;
4665
+ }
4666
+ type VerificationCommandFailureKind = "nonzero_exit" | "spawn_error" | "timeout" | "cancelled" | "output_limit";
4667
+ interface VerificationCommandResult {
4668
+ ok: boolean;
4669
+ failureKind?: VerificationCommandFailureKind;
4670
+ exitCode?: number;
4671
+ stdoutHash?: string;
4672
+ stderrHash?: string;
4673
+ stdoutSnippet?: string;
4674
+ stderrSnippet?: string;
4675
+ durationMs: number;
4676
+ }
4677
+ interface AttemptVerificationRuntime {
4678
+ resolveEnvironment(keys: readonly string[]): Readonly<Record<string, string>>;
4679
+ observe(input: {
4680
+ lease: WorkspaceLifecycleLeaseRecord;
4681
+ receipt: AgentTaskReceipt_v2;
4682
+ }): Promise<VerificationWorkspaceObservation>;
4683
+ runCheck(input: {
4684
+ argv: readonly string[];
4685
+ cwd: string;
4686
+ environment: Readonly<Record<string, string>>;
4687
+ timeoutMs: number;
4688
+ signal?: AbortSignal;
4689
+ }): Promise<VerificationCommandResult>;
4690
+ resolveCheckCwd(worktreePath: string, cwdRel?: string): Promise<string>;
4691
+ }
4692
+
4693
+ type AttemptVerificationRunResult = {
4694
+ recorded: true;
4695
+ verificationId: string;
4696
+ verificationHash: string;
4697
+ attemptId: string;
4698
+ outcome: VerificationOutcome;
4699
+ attemptRevision: number;
4700
+ attemptStatus: AttemptRecord["status"];
4701
+ trustGapCount: number;
4702
+ checkCounts: Record<VerificationOutcome, number>;
4703
+ idempotentReplay: boolean;
4704
+ } | {
4705
+ recorded: false;
4706
+ reason: AttemptVerificationFailureReason;
4707
+ message?: string;
4708
+ currentAttemptRevision?: number;
4709
+ currentWorkspaceLeaseRevision?: number;
4710
+ currentSessionRevision?: number;
4711
+ currentRunRevision?: number;
4712
+ };
4713
+ interface AttemptVerificationStatusResult {
4714
+ verification: null | {
4715
+ verificationId: string;
4716
+ verificationHash: string;
4717
+ attemptId: string;
4718
+ outcome: VerificationOutcome;
4719
+ resultingAttemptRevision: number;
4720
+ resultingAttemptStatus: AttemptRecord["status"];
4721
+ resultIdentity: {
4722
+ headSha?: string;
4723
+ patchHash?: string;
4724
+ };
4725
+ trustGapCount: number;
4726
+ checkCounts: Record<VerificationOutcome, number>;
4727
+ recordedAt: string;
4728
+ diagnostics?: {
4729
+ summary: string;
4730
+ failures: string[];
4731
+ trustGapReasons: EngineVerificationTrustGapReason_v2[];
4732
+ checks: AgentEngineVerification_v2["checks"];
4733
+ };
4734
+ };
4735
+ }
4736
+ type AttemptAcceptanceResult = {
4737
+ applied: true;
4738
+ attemptId: string;
4739
+ decision: "accepted" | "rejected";
4740
+ attemptRevision: number;
4741
+ policyId: typeof STRICT_ATTEMPT_ACCEPTANCE_POLICY_ID;
4742
+ policyVersion: typeof STRICT_ATTEMPT_ACCEPTANCE_POLICY_VERSION;
4743
+ reasonCodes: string[];
4744
+ idempotentReplay: boolean;
4745
+ } | {
4746
+ applied: false;
4747
+ reason: WorkspaceMutationFailureReason;
4748
+ currentAttemptRevision?: number;
4749
+ currentWorkspaceLeaseRevision?: number;
4750
+ currentRunRevision?: number;
4751
+ };
4752
+ interface AttemptAcceptanceStatusResult {
4753
+ acceptance: null | {
4754
+ attemptId: string;
4755
+ decision: "accepted" | "rejected";
4756
+ attemptRevision: number;
4757
+ policyId: typeof STRICT_ATTEMPT_ACCEPTANCE_POLICY_ID;
4758
+ policyVersion: typeof STRICT_ATTEMPT_ACCEPTANCE_POLICY_VERSION;
4759
+ reasonCodes: string[];
4760
+ appliedAt: string;
4761
+ };
4762
+ }
4763
+
4764
+ type FanoutServiceStore = AgentWorkFanoutStore & WorkspaceLifecycleStore & AttemptReceiptStore & AttemptVerificationStore;
4765
+ interface CreateAgentWorkFanoutInput {
4766
+ runId: string;
4767
+ expectedRunRevision: number;
4768
+ controller: ControllerLeaseCredential;
4769
+ mutationId: string;
4770
+ now: string;
4771
+ plan: AgentWorkFanoutPlan_v1;
4772
+ }
4773
+ interface DecideAgentWorkFanInInput {
4774
+ runId: string;
4775
+ expectedRunRevision: number;
4776
+ controller: ControllerLeaseCredential;
4777
+ mutationId: string;
4778
+ now: string;
4779
+ fanoutId: string;
4780
+ decisionId: string;
4781
+ diagnostics?: boolean;
4782
+ }
4783
+ type AgentWorkFanInResult = {
4784
+ recorded: true;
4785
+ decisionId: string;
4786
+ outcome: "selected" | "escalated" | "no_viable_candidate";
4787
+ selectedAttemptId?: string;
4788
+ candidateCount: number;
4789
+ evidenceSetHash: string;
4790
+ idempotentReplay: boolean;
4791
+ diagnostics?: {
4792
+ conflicts: string[];
4793
+ uncertainty: string[];
4794
+ summary: string;
4795
+ };
4796
+ } | {
4797
+ recorded: false;
4798
+ reason: Extract<FanInDecisionMutationResult, {
4799
+ recorded: false;
4800
+ }>["reason"];
4801
+ };
4802
+ /** Shared application boundary for bounded fanout declarations and deterministic engine fan-in. */
4803
+ declare class AgentWorkFanoutService {
4804
+ private readonly store;
4805
+ constructor(store: FanoutServiceStore);
4806
+ create(input: CreateAgentWorkFanoutInput): Promise<FanoutPlanMutationResult>;
4807
+ binding(fanoutId: string, attemptId: string): Promise<ReturnType<typeof FanoutAttemptBinding_v1.parse> | null>;
4808
+ decide(input: DecideAgentWorkFanInInput): Promise<AgentWorkFanInResult>;
4809
+ }
4810
+
4811
+ type Preparation = NonNullable<AgentTaskPacket_v1["preparation"]>;
4812
+ type PreparationStep = Preparation["steps"][number];
4813
+ interface AgentWorkPreparationCommandResult {
4814
+ exitCode: number;
4815
+ stdout: string;
4816
+ stderr: string;
4817
+ /** The adapter must attest that it enforced the exact packet-owned policy. */
4818
+ policyHash: string;
4819
+ }
4820
+ interface AgentWorkPreparationCommandRunner {
4821
+ run(input: {
4822
+ argv: string[];
4823
+ cwd: string;
4824
+ policy: Preparation["policy"];
4825
+ policyHash: string;
4826
+ }): Promise<AgentWorkPreparationCommandResult>;
4827
+ }
4828
+ interface ExecuteAgentWorkPreparationInput {
4829
+ packet: AgentTaskPacket_v1;
4830
+ worktreeRoot: string;
4831
+ receiptId: string;
4832
+ runner: AgentWorkPreparationCommandRunner;
4833
+ now(): string;
4834
+ }
4835
+ interface AgentWorkPreparationResult {
4836
+ ok: boolean;
4837
+ receipt: AgentWorkPreparationReceipt_v1;
4838
+ failedStepId?: string;
4839
+ }
4840
+ /** Stable dependency order for packet-owned preparation steps. */
4841
+ declare function orderAgentWorkPreparationSteps(preparation: Preparation): PreparationStep[];
4842
+ /** Executes only the explicit preparation phase and emits hashes, never command logs. */
4843
+ declare function executeAgentWorkPreparation(input: ExecuteAgentWorkPreparationInput): Promise<AgentWorkPreparationResult>;
4844
+
4845
+ interface AttemptReceiptStatusResult {
4846
+ receipt: AttemptReceiptStatusProjection | null;
4847
+ }
4848
+ type AttemptReceiptSubmissionAcknowledgement = {
4849
+ submitted: true;
4850
+ receiptId: string;
4851
+ receiptHash: string;
4852
+ attemptId: string;
4853
+ outcome: AgentTaskReceiptOutcome;
4854
+ disposition: AttemptReceiptDisposition;
4855
+ attemptRevision: number;
4856
+ attemptStatus: AttemptStatus;
4857
+ event: {
4858
+ type: AttemptReceiptEventType;
4859
+ sequence: number;
4860
+ createdAt: string;
4861
+ };
4862
+ idempotentReplay: boolean;
4863
+ } | Extract<AttemptReceiptSubmissionResult, {
4864
+ submitted: false;
4865
+ }>;
4866
+ /** Prompt-safe metadata for a durable worker claim; receipt JSON stays in the store. */
4867
+ interface AttemptReceiptStatusProjection {
4868
+ receiptId: string;
4869
+ receiptHash: string;
4870
+ schemaVersion: string;
4871
+ runId: string;
4872
+ workItemId: string;
4873
+ workItemRevision: number;
4874
+ attemptId: string;
4875
+ packetId: string;
4876
+ packetHash: string;
4877
+ workspaceLeaseId: string;
4878
+ workspaceLeaseRevision: number;
4879
+ workerSessionId: string;
4880
+ workerSessionRevision: number;
4881
+ workerRuntime: string;
4882
+ observedBaseSha: string;
4883
+ finalHeadSha?: string;
4884
+ patchHash?: string;
4885
+ outcome: AgentTaskReceiptOutcome;
4886
+ disposition: AttemptReceiptDisposition;
4887
+ summary: string;
4888
+ workerStartedAt: string;
4889
+ workerCompletedAt: string;
4890
+ submittedAt: string;
4891
+ recordedAt: string;
4892
+ counts: {
4893
+ filesTouched: number;
4894
+ commits: number;
4895
+ claimedChecks: number;
4896
+ blockers: number;
4897
+ };
4898
+ }
4899
+
4900
+ declare const AttemptReceiptSubmitRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4901
+ databasePath: z.ZodString;
4902
+ submission: z.ZodObject<{
4903
+ runId: z.ZodString;
4904
+ expectedRunRevision: z.ZodNumber;
4905
+ controller: z.ZodObject<{
4906
+ runId: z.ZodString;
4907
+ controllerId: z.ZodString;
4908
+ leaseId: z.ZodString;
4909
+ fencingToken: z.ZodNumber;
4910
+ }, z.core.$strict>;
4911
+ attemptId: z.ZodString;
4912
+ expectedAttemptRevision: z.ZodNumber;
4913
+ workspaceLeaseId: z.ZodString;
4914
+ expectedWorkspaceLeaseRevision: z.ZodNumber;
4915
+ workerSessionId: z.ZodString;
4916
+ expectedWorkerSessionRevision: z.ZodNumber;
4917
+ receipt: z.ZodObject<{
4918
+ schema_version: z.ZodLiteral<"2.0.0">;
4919
+ receipt_id: z.ZodString;
4920
+ run_id: z.ZodString;
4921
+ work_item_id: z.ZodString;
4922
+ work_item_revision: z.ZodNumber;
4923
+ attempt_id: z.ZodString;
4924
+ packet_id: z.ZodString;
4925
+ packet_hash: z.ZodString;
4926
+ workspace_lease_id: z.ZodString;
4927
+ workspace_lease_revision: z.ZodNumber;
4928
+ worker_runtime: z.ZodString;
4929
+ worker_session_id: z.ZodString;
4930
+ observed_base_sha: z.ZodString;
4931
+ final_head_sha: z.ZodOptional<z.ZodString>;
4932
+ patch_hash: z.ZodOptional<z.ZodString>;
4933
+ outcome: z.ZodEnum<{
4934
+ blocked: "blocked";
4935
+ completed: "completed";
4936
+ failed: "failed";
4937
+ cancelled: "cancelled";
4938
+ }>;
4939
+ exit_reason: z.ZodString;
4940
+ summary: z.ZodString;
4941
+ files_touched: z.ZodArray<z.ZodString>;
4942
+ commits: z.ZodArray<z.ZodString>;
4943
+ acceptance_criteria_addressed: z.ZodArray<z.ZodString>;
4944
+ claimed_checks: z.ZodArray<z.ZodObject<{
4945
+ id: z.ZodString;
4946
+ outcome: z.ZodEnum<{
4947
+ pass: "pass";
4948
+ fail: "fail";
4949
+ not_run: "not_run";
4950
+ }>;
4951
+ exit_code: z.ZodOptional<z.ZodNumber>;
4952
+ output_snippet: z.ZodOptional<z.ZodString>;
4953
+ }, z.core.$strict>>;
4954
+ assumptions: z.ZodArray<z.ZodString>;
4955
+ blockers: z.ZodArray<z.ZodString>;
4956
+ human_action_request_ids: z.ZodArray<z.ZodString>;
4957
+ cost: z.ZodObject<{
4958
+ input_tokens: z.ZodOptional<z.ZodNumber>;
4959
+ output_tokens: z.ZodOptional<z.ZodNumber>;
4960
+ tool_calls: z.ZodOptional<z.ZodNumber>;
4961
+ elapsed_ms: z.ZodOptional<z.ZodNumber>;
4962
+ }, z.core.$strict>;
4963
+ worker_started_at: z.ZodString;
4964
+ worker_completed_at: z.ZodString;
4965
+ submitted_at: z.ZodString;
4966
+ }, z.core.$strict>;
4967
+ mutation: z.ZodObject<{
4968
+ mutationId: z.ZodString;
4969
+ now: z.ZodString;
4970
+ }, z.core.$strict>;
4971
+ }, z.core.$strict>;
4972
+ }, z.core.$strict>>;
4973
+ declare const AttemptReceiptStatusRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4974
+ databasePath: z.ZodString;
4975
+ runId: z.ZodString;
4976
+ attemptId: z.ZodString;
4977
+ }, z.core.$strict>>;
4978
+ interface AttemptReceiptHandlers {
4979
+ submit(request: unknown): Promise<AgentWorkHandlerResult<AttemptReceiptSubmissionAcknowledgement>>;
4980
+ status(request: unknown): Promise<AgentWorkHandlerResult<AttemptReceiptStatusResult>>;
4981
+ }
4982
+ declare function createAttemptReceiptHandlers(): AttemptReceiptHandlers;
4983
+
4984
+ declare const AttemptVerificationRunRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
4985
+ databasePath: z.ZodString;
4986
+ verification: z.ZodObject<{
4987
+ beginMutationId: z.ZodString;
4988
+ completeMutationId: z.ZodString;
4989
+ runId: z.ZodString;
4990
+ expectedRunRevision: z.ZodNumber;
4991
+ controller: z.ZodObject<{
4992
+ runId: z.ZodString;
4993
+ controllerId: z.ZodString;
4994
+ leaseId: z.ZodString;
4995
+ fencingToken: z.ZodNumber;
4996
+ }, z.core.$strict>;
4997
+ verificationId: z.ZodString;
4998
+ attemptId: z.ZodString;
4999
+ expectedAttemptRevision: z.ZodNumber;
5000
+ workspaceLeaseId: z.ZodString;
5001
+ expectedWorkspaceLeaseRevision: z.ZodNumber;
5002
+ workerSessionId: z.ZodString;
5003
+ expectedWorkerSessionRevision: z.ZodNumber;
5004
+ receiptId: z.ZodString;
5005
+ receiptHash: z.ZodString;
5006
+ }, z.core.$strict>;
5007
+ }, z.core.$strict>>;
5008
+ declare const AttemptVerificationStatusRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
5009
+ databasePath: z.ZodString;
5010
+ runId: z.ZodString;
5011
+ attemptId: z.ZodString;
5012
+ diagnostics: z.ZodOptional<z.ZodBoolean>;
5013
+ }, z.core.$strict>>;
5014
+ declare const AttemptAcceptanceApplyRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
5015
+ databasePath: z.ZodString;
5016
+ acceptance: z.ZodObject<{
5017
+ verificationHash: z.ZodString;
5018
+ mutationId: z.ZodString;
5019
+ runId: z.ZodString;
5020
+ expectedRunRevision: z.ZodNumber;
5021
+ controller: z.ZodObject<{
5022
+ runId: z.ZodString;
5023
+ controllerId: z.ZodString;
5024
+ leaseId: z.ZodString;
5025
+ fencingToken: z.ZodNumber;
5026
+ }, z.core.$strict>;
5027
+ verificationId: z.ZodString;
5028
+ attemptId: z.ZodString;
5029
+ expectedAttemptRevision: z.ZodNumber;
5030
+ workspaceLeaseId: z.ZodString;
5031
+ expectedWorkspaceLeaseRevision: z.ZodNumber;
5032
+ workerSessionId: z.ZodString;
5033
+ expectedWorkerSessionRevision: z.ZodNumber;
5034
+ receiptId: z.ZodString;
5035
+ receiptHash: z.ZodString;
5036
+ }, z.core.$strict>;
5037
+ }, z.core.$strict>>;
5038
+ declare const AttemptAcceptanceStatusRequestJsonSchema: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
5039
+ databasePath: z.ZodString;
5040
+ runId: z.ZodString;
5041
+ attemptId: z.ZodString;
5042
+ }, z.core.$strict>>;
5043
+ interface AttemptVerificationHandlers {
5044
+ run(request: unknown): Promise<AgentWorkHandlerResult<AttemptVerificationRunResult>>;
5045
+ status(request: unknown): Promise<AgentWorkHandlerResult<AttemptVerificationStatusResult>>;
5046
+ applyAcceptance(request: unknown): Promise<AgentWorkHandlerResult<AttemptAcceptanceResult>>;
5047
+ acceptanceStatus(request: unknown): Promise<AgentWorkHandlerResult<AttemptAcceptanceStatusResult>>;
5048
+ }
5049
+ interface AttemptVerificationHandlerOptions {
5050
+ runtime?: AttemptVerificationRuntime;
5051
+ now?: () => string;
5052
+ }
5053
+ declare function createAttemptVerificationHandlers(options?: AttemptVerificationHandlerOptions): AttemptVerificationHandlers;
5054
+
5055
+ /**
5056
+ * Compute merge order levels using Kahn's algorithm with deterministic ordering
5057
+ * Returns array of levels, where each level contains item names that can be processed in parallel
5058
+ */
5059
+ declare function computeMergeOrder(plan: Plan): string[][];
5060
+
5061
+ /**
5062
+ * GitHub API integration for PR discovery and metadata extraction
5063
+ * Maintains deterministic ordering and stable output
5064
+ * Includes error recovery with retry and circuit breaker patterns
5065
+ */
5066
+
5067
+ interface GitHubPullRequest {
5068
+ number: number;
5069
+ title: string;
5070
+ branch: string;
5071
+ sha: string;
5072
+ state: "open" | "closed" | "merged";
5073
+ labels: string[];
5074
+ author: string;
5075
+ baseBranch: string;
5076
+ createdAt: string;
5077
+ updatedAt: string;
5078
+ mergeable?: boolean;
5079
+ body?: string | null;
5080
+ draft?: boolean;
5081
+ reviewRequested?: boolean;
5082
+ }
5083
+ interface GitHubConfig {
5084
+ token?: string;
5085
+ owner: string;
5086
+ repo: string;
5087
+ }
5088
+ /**
5089
+ * GitHub API client for PR operations with error recovery
5090
+ */
5091
+ declare class GitHubAPI {
5092
+ private octokit;
5093
+ config: GitHubConfig;
5094
+ private circuitBreaker;
5095
+ private normalized;
5096
+ constructor(config: GitHubConfig);
5097
+ /**
5098
+ * Get the underlying Octokit instance for advanced operations
5099
+ * Use with caution - prefer using typed methods when available
5100
+ */
5101
+ getOctokit(): Octokit;
5102
+ /**
5103
+ * Normalize repository owner and name to match GitHub's canonical casing.
5104
+ * This handles case-insensitive lookups where git remote URLs may have
5105
+ * different casing than the actual GitHub repository.
5106
+ */
5107
+ private normalizeRepositoryName;
5108
+ /**
5109
+ * Extract HTTP status code from error object
5110
+ */
5111
+ private extractErrorStatus;
5112
+ /**
5113
+ * Discover open pull requests with stable ordering and error recovery
5114
+ */
5115
+ discoverPullRequests(state?: "open" | "closed" | "all"): Promise<GitHubPullRequest[]>;
5116
+ /**
5117
+ * Get repository information
5118
+ */
5119
+ getRepositoryInfo(): Promise<{
5120
+ name: string;
5121
+ fullName: string;
5122
+ defaultBranch: string;
5123
+ private: boolean;
5124
+ }>;
5125
+ /**
5126
+ * Check if authentication is working
5127
+ */
5128
+ checkAuth(): Promise<{
5129
+ authenticated: boolean;
5130
+ user?: string;
5131
+ }>;
5132
+ /**
5133
+ * Get a specific pull request by number
5134
+ */
5135
+ getPullRequest(prNumber: number): Promise<GitHubPullRequest | null>;
5136
+ /**
5137
+ * Update a pull request (e.g., to undraft it)
5138
+ */
5139
+ updatePullRequest(owner: string, repo: string, prNumber: number, updates: {
5140
+ draft?: boolean;
5141
+ title?: string;
5142
+ body?: string;
5143
+ }): Promise<void>;
5144
+ /**
5145
+ * Add a label to a pull request
5146
+ */
5147
+ addLabel(prNumber: number, label: string): Promise<void>;
5148
+ /**
5149
+ * Remove a label from a pull request
5150
+ */
5151
+ removeLabel(prNumber: number, label: string): Promise<void>;
5152
+ /**
5153
+ * Get labels for a pull request
5154
+ */
5155
+ getLabels(prNumber: number): Promise<string[]>;
5156
+ /**
5157
+ * Get repository info (for harvest)
5158
+ */
5159
+ getRepository(): Promise<{
5160
+ default_branch: string;
5161
+ [key: string]: any;
5162
+ }>;
5163
+ /**
5164
+ * Get a git reference (branch/tag SHA)
5165
+ */
5166
+ getRef(ref: string): Promise<{
5167
+ object: {
5168
+ sha: string;
5169
+ };
5170
+ }>;
5171
+ /**
5172
+ * Get check runs for a commit SHA
5173
+ */
5174
+ getCheckRuns(sha: string): Promise<{
5175
+ total_count: number;
5176
+ check_runs: Array<{
5177
+ status: string;
5178
+ conclusion: string | null;
5179
+ }>;
5180
+ }>;
5181
+ /**
5182
+ * Get reviews for a pull request
5183
+ */
5184
+ getReviews(prNumber: number): Promise<Array<{
5185
+ user: {
5186
+ login: string;
5187
+ } | null;
5188
+ state: string;
5189
+ }>>;
5190
+ /**
5191
+ * Compare two commits
5192
+ */
5193
+ compare(base: string, head: string): Promise<{
5194
+ merge_base_commit?: {
5195
+ sha: string;
5196
+ };
5197
+ }>;
5198
+ /**
5199
+ * List issues (excluding PRs if filtered by caller)
5200
+ */
5201
+ listIssues(options: {
5202
+ state: "open" | "closed" | "all";
5203
+ }): Promise<any[]>;
5204
+ /**
5205
+ * Update a pull request's branch with the latest changes from the base branch
5206
+ * This is typically used after merging another PR to keep branches up to date
5207
+ */
5208
+ updatePullRequestBranch(owner: string, repo: string, prNumber: number): Promise<void>;
5209
+ /**
5210
+ * Merge a pull request
5211
+ */
5212
+ mergePullRequest(owner: string, repo: string, prNumber: number, options: {
5213
+ method: "squash" | "merge" | "rebase";
5214
+ commitTitle?: string;
5215
+ }): Promise<boolean>;
5216
+ /**
5217
+ * Get commit status for a SHA
5218
+ */
5219
+ getCommitStatus(owner: string, repo: string, ref: string): Promise<{
5220
+ state: string;
5221
+ statuses: any[];
5222
+ }>;
5223
+ }
5224
+ /**
5225
+ * Create GitHub API client from environment and config
5226
+ */
5227
+ declare function createGitHubAPI(): Promise<GitHubAPI | null>;
5228
+
5229
+ /**
5230
+ * GitHub API integration types
5231
+ * Defines data structures for PR metadata and repository information
5232
+ */
5233
+ interface RepositoryInfo {
5234
+ owner: string;
5235
+ repo: string;
5236
+ defaultBranch: string;
5237
+ url: string;
5238
+ }
5239
+ interface PullRequest {
2055
5240
  number: number;
2056
5241
  title: string;
2057
5242
  body: string | null;
@@ -2455,7 +5640,7 @@ declare function createFileAnalyzer(octokit: Octokit, owner: string, repo: strin
2455
5640
  * Auto-discovers PRs and generates plan.json from GitHub metadata
2456
5641
  */
2457
5642
 
2458
- interface GitHubPlanOptions {
5643
+ interface GitHubPlanOptions$1 {
2459
5644
  query?: string;
2460
5645
  labels?: string[];
2461
5646
  excludePRs?: number[];
@@ -2470,7 +5655,7 @@ interface GitHubPlanOptions {
2470
5655
  /**
2471
5656
  * Generate plan from GitHub PRs with automatic dependency resolution
2472
5657
  */
2473
- declare function generatePlanFromGitHub(client: GitHubClient, options?: GitHubPlanOptions): Promise<Plan>;
5658
+ declare function generatePlanFromGitHub(client: GitHubClient, options?: GitHubPlanOptions$1): Promise<Plan>;
2474
5659
 
2475
5660
  /**
2476
5661
  * Multi-Repo Plan Generation
@@ -2493,7 +5678,7 @@ interface RepoTarget {
2493
5678
  /**
2494
5679
  * Options for multi-repo plan generation
2495
5680
  */
2496
- interface MultiRepoPlanOptions {
5681
+ interface MultiRepoPlanOptions$1 {
2497
5682
  query?: string;
2498
5683
  labels?: string[];
2499
5684
  excludePRs?: number[];
@@ -2527,7 +5712,7 @@ interface MultiRepoPlanOptions {
2527
5712
  * });
2528
5713
  * ```
2529
5714
  */
2530
- declare function generateMultiRepoPlan(repos: RepoTarget[], options?: MultiRepoPlanOptions): Promise<Plan>;
5715
+ declare function generateMultiRepoPlan(repos: RepoTarget[], options?: MultiRepoPlanOptions$1): Promise<Plan>;
2531
5716
 
2532
5717
  /**
2533
5718
  * Git operations for merge pyramid execution
@@ -2560,6 +5745,8 @@ declare class GitOperations {
2560
5745
  private git;
2561
5746
  private workingDir;
2562
5747
  constructor(workingDir?: string);
5748
+ /** Repository-local execution root owned by this Git operations instance. */
5749
+ getWorkingDirectory(): string;
2563
5750
  /**
2564
5751
  * Check if git repository is in a clean state
2565
5752
  */
@@ -2641,6 +5828,572 @@ declare function detectProjectType(baseDir?: string): string;
2641
5828
  */
2642
5829
  declare function getEnvironmentSuggestions(): string[];
2643
5830
 
5831
+ type GateExecutor = typeof executeGatesWithPolicy;
5832
+ interface GateExecutionServiceInput {
5833
+ plan: Plan;
5834
+ artifactDir: string;
5835
+ timeoutMs?: number;
5836
+ progressReporter?: Parameters<GateExecutor>[4];
5837
+ skipValidation?: boolean;
5838
+ repoRoot?: string;
5839
+ options?: Parameters<GateExecutor>[7];
5840
+ onlyItem?: string;
5841
+ onlyGate?: string;
5842
+ executionState?: ExecutionState;
5843
+ }
5844
+ interface BoundedGateRunResult {
5845
+ contract: "bounded-ax-v1";
5846
+ items: Array<{
5847
+ name: string;
5848
+ status: string;
5849
+ gates: Array<{
5850
+ name: string;
5851
+ status: string;
5852
+ failureKind?: "nonzero_exit" | "spawn_error" | "timeout";
5853
+ timeoutCleanup?: {
5854
+ method: "process-group" | "taskkill" | "direct-child";
5855
+ forceKilled: boolean;
5856
+ descendantsReaped: boolean;
5857
+ };
5858
+ }>;
5859
+ }>;
5860
+ allGreen: boolean;
5861
+ artifactRefs: Array<{
5862
+ kind: "gate-results-directory";
5863
+ path: string;
5864
+ }>;
5865
+ }
5866
+ interface GateExecutionServiceResult {
5867
+ summary: BoundedGateRunResult;
5868
+ executionState: ExecutionState;
5869
+ }
5870
+ declare class GateExecutionServiceError extends Error {
5871
+ readonly code: "GATE_EXECUTION_FAILED" | "GATE_RESULT_LIMIT_EXCEEDED";
5872
+ constructor(code: "GATE_EXECUTION_FAILED" | "GATE_RESULT_LIMIT_EXCEEDED", message: string);
5873
+ }
5874
+ /** One bounded transport-neutral owner for canonical CLI and MCP gate execution. */
5875
+ declare class GateExecutionService {
5876
+ private readonly execute;
5877
+ constructor(execute?: GateExecutor);
5878
+ run(input: GateExecutionServiceInput): Promise<GateExecutionServiceResult>;
5879
+ }
5880
+
5881
+ declare const GATE_IMPACT_MODEL: {
5882
+ readonly version: "1.0.0";
5883
+ readonly docsPrefixes: readonly ["docs/"];
5884
+ readonly docsFiles: readonly ["README.md", "README.mcp.md"];
5885
+ readonly fullSuitePrefixes: readonly [".github/", "schemas/", "scripts/", "src/mcp/", "src/sdk/", "src/store/", "tests/fixtures/", "tests/helpers/"];
5886
+ readonly fullSuiteFiles: readonly ["mcp-server.mjs", ".npmrc", "CHANGELOG.md", "LICENSE.md", "NOTICE.md", "package.json", "package-lock.json", "src/cli.ts", "src/schema.ts", "tsconfig.json", "tsup.config.ts", "vitest.config.ts", "vitest.git.config.ts"];
5887
+ readonly adjacentOwners: Record<string, string[]>;
5888
+ };
5889
+ type GateImpactMode = "focused" | "docs" | "full";
5890
+ interface GateImpactSelection {
5891
+ schemaVersion: "1.0.0";
5892
+ contract: "bounded-ax-v1";
5893
+ modelVersion: string;
5894
+ baseSha: string;
5895
+ headSha: string;
5896
+ mode: GateImpactMode;
5897
+ changedFiles: string[];
5898
+ selectedTests: Array<{
5899
+ path: string;
5900
+ rationale: string[];
5901
+ }>;
5902
+ staticCommands: string[];
5903
+ testCommand: string;
5904
+ documentationCommand?: string;
5905
+ fallbackReason?: string;
5906
+ }
5907
+ declare class GateImpactServiceError extends Error {
5908
+ readonly code: "GATE_IMPACT_INVALID_INPUT" | "GATE_IMPACT_DIFF_FAILED" | "GATE_IMPACT_RESULT_LIMIT_EXCEEDED";
5909
+ constructor(code: "GATE_IMPACT_INVALID_INPUT" | "GATE_IMPACT_DIFF_FAILED" | "GATE_IMPACT_RESULT_LIMIT_EXCEEDED", message: string);
5910
+ }
5911
+ type ChangedFileLoader = (repoRoot: string, baseSha: string, headSha: string) => Promise<string[]>;
5912
+ /** Resolve a deterministic, conservative implementation-gate test selection. */
5913
+ declare class GateImpactService {
5914
+ private readonly loadChangedFiles;
5915
+ constructor(loadChangedFiles?: ChangedFileLoader);
5916
+ select(input: {
5917
+ repoRoot: string;
5918
+ baseSha: string;
5919
+ headSha: string;
5920
+ }): Promise<GateImpactSelection>;
5921
+ }
5922
+ declare function applyGateImpactSelection(plan: Plan, selection: GateImpactSelection): Plan;
5923
+ declare function writeGateImpactReceipt(selection: GateImpactSelection, artifactDir: string): string;
5924
+
5925
+ declare class IntegrationQueryServiceError extends Error {
5926
+ readonly code: "QUERY_RESULT_LIMIT_EXCEEDED" | "PLAN_GENERATION_FAILED";
5927
+ constructor(code: "QUERY_RESULT_LIMIT_EXCEEDED" | "PLAN_GENERATION_FAILED", message: string);
5928
+ }
5929
+ interface BoundedDiscoveryResult {
5930
+ contract: "bounded-ax-v1";
5931
+ pullRequests: Array<Omit<GitHubPullRequest, "body">>;
5932
+ suggestions?: unknown[];
5933
+ total: number;
5934
+ suggestionsCount?: number;
5935
+ authenticated: boolean;
5936
+ user?: string;
5937
+ }
5938
+ declare class DiscoveryQueryService {
5939
+ run(input: {
5940
+ github: GitHubAPI;
5941
+ state: "open" | "closed" | "all";
5942
+ suggest?: boolean;
5943
+ }): Promise<BoundedDiscoveryResult>;
5944
+ }
5945
+ type GitHubPlanOptions = Parameters<typeof generatePlanFromGitHub>[1];
5946
+ type MultiRepoPlanOptions = Parameters<typeof generateMultiRepoPlan>[1];
5947
+ declare class PlanCreationService {
5948
+ fromGitHub(client: GitHubClient, options: GitHubPlanOptions): Promise<Plan>;
5949
+ fromMultipleRepositories(repositories: RepoTarget[], options: MultiRepoPlanOptions): Promise<Plan>;
5950
+ fromInputs(inputs: InputConfig, options?: {
5951
+ tierOverrides?: TierOverride[];
5952
+ preserveEmptyPlan?: boolean;
5953
+ }): Plan;
5954
+ }
5955
+ interface BoundedIntegrationStatus {
5956
+ contract: "bounded-ax-v1";
5957
+ plan: {
5958
+ schemaVersion: string;
5959
+ target: string;
5960
+ itemCount: number;
5961
+ policy?: Plan["policy"];
5962
+ };
5963
+ mergeSummary: ReturnType<MergeEligibilityEvaluator["getMergeSummary"]>;
5964
+ }
5965
+ declare class IntegrationStatusQueryService {
5966
+ run(plan: Plan): BoundedIntegrationStatus;
5967
+ }
5968
+ interface BoundedMergeOrderResult {
5969
+ contract: "bounded-ax-v1";
5970
+ levels: string[][];
5971
+ totalItems: number;
5972
+ maxParallelism: number;
5973
+ }
5974
+ declare class MergeOrderQueryService {
5975
+ run(plan: Plan): BoundedMergeOrderResult;
5976
+ }
5977
+
5978
+ /**
5979
+ * Checkpoint types for merge-weave resume support
5980
+ */
5981
+
5982
+ type ResumeOperationStatus = "pending" | "in_progress" | "completed" | "failed";
5983
+ /** One durable, independently reconcilable operation in a resumable weave. */
5984
+ interface ResumeOperation {
5985
+ id: string;
5986
+ phase: "gate" | "merge" | "post_check";
5987
+ item: string;
5988
+ status: ResumeOperationStatus;
5989
+ attempts: number;
5990
+ startedAt?: string;
5991
+ completedAt?: string;
5992
+ result?: {
5993
+ outcome: "executed" | "observed";
5994
+ externalId?: string;
5995
+ };
5996
+ error?: string;
5997
+ }
5998
+
5999
+ type ResumeWeaveResult = {
6000
+ ok: true;
6001
+ outcome: "completed" | "paused";
6002
+ runId: string;
6003
+ revision: number;
6004
+ completed: number;
6005
+ pending: number;
6006
+ failed: number;
6007
+ } | {
6008
+ ok: false;
6009
+ code: "checkpoint_busy" | "checkpoint_invalid" | "external_state_mismatch" | "ambiguous_external_state" | "operation_failed";
6010
+ runId: string;
6011
+ reason: string;
6012
+ operationId?: string;
6013
+ };
6014
+
6015
+ type MergeApplicationFailureCode = "MERGE_MUTATION_DENIED" | "MERGE_STALE_INPUT" | "MERGE_CONFLICT" | "MERGE_APPLICATION_FAILED";
6016
+ declare class MergeApplicationServiceError extends Error {
6017
+ readonly code: MergeApplicationFailureCode;
6018
+ constructor(code: MergeApplicationFailureCode, message: string);
6019
+ }
6020
+ interface BoundedMergeApplicationResult {
6021
+ contract: "bounded-ax-v1";
6022
+ mode: "dry-run" | "execute";
6023
+ /** Compatibility projection retained for existing CLI/MCP JSON consumers. */
6024
+ dryRun: boolean;
6025
+ ok: boolean;
6026
+ status: "preview" | "completed" | "paused" | "failed";
6027
+ totalItems: number;
6028
+ levels?: string[][];
6029
+ maxParallelism?: number;
6030
+ runId?: string;
6031
+ operations?: Array<{
6032
+ id: string;
6033
+ phase: string;
6034
+ item: string;
6035
+ status: string;
6036
+ evidenceRef?: string;
6037
+ }>;
6038
+ artifactRefs: Array<{
6039
+ kind: "weave-checkpoint";
6040
+ id: string;
6041
+ }>;
6042
+ failureCode?: MergeApplicationFailureCode;
6043
+ }
6044
+ interface MergeApplicationExecution {
6045
+ result: ResumeWeaveResult;
6046
+ operations: ResumeOperation[];
6047
+ }
6048
+ interface MergeApplicationRuntime {
6049
+ isClean(workingDir: string): Promise<boolean>;
6050
+ prepare(plan: Plan, workingDir: string): Promise<string>;
6051
+ resume(runId: string, workingDir: string): Promise<MergeApplicationExecution>;
6052
+ }
6053
+ declare class MergeApplicationService {
6054
+ private readonly runtime;
6055
+ constructor(runtime?: MergeApplicationRuntime);
6056
+ run(input: {
6057
+ plan: Plan;
6058
+ workingDir: string;
6059
+ dryRun: boolean;
6060
+ mutationAuthorized: boolean;
6061
+ }): Promise<{
6062
+ summary: BoundedMergeApplicationResult;
6063
+ execution?: MergeApplicationExecution;
6064
+ }>;
6065
+ executePrepared(input: {
6066
+ plan: Plan;
6067
+ workingDir: string;
6068
+ runId: string;
6069
+ }): Promise<{
6070
+ summary: BoundedMergeApplicationResult;
6071
+ execution: MergeApplicationExecution;
6072
+ }>;
6073
+ }
6074
+
6075
+ /**
6076
+ * Environmental Hostility Scoring
6077
+ *
6078
+ * Implements Definition 3.2 (Environmental Hostility) from the governance thesis:
6079
+ * The degree to which an environment impedes effective agent operation through:
6080
+ * - Unclear or implicit constraints
6081
+ * - Opaque requirements (unstated expectations)
6082
+ * - Unbounded problem surfaces
6083
+ * - Missing receipts and traceability
6084
+ * - Punitive error dynamics
6085
+ * - Fragmented state
6086
+ * - Model switches without continuity protocols
6087
+ */
6088
+
6089
+ /**
6090
+ * Schema for the complete hostility score with all component breakdowns.
6091
+ */
6092
+ declare const HostilityScoreSchema: z.ZodObject<{
6093
+ total: z.ZodNumber;
6094
+ status: z.ZodEnum<{
6095
+ high: "high";
6096
+ medium: "medium";
6097
+ low: "low";
6098
+ }>;
6099
+ components: z.ZodObject<{
6100
+ constraintClarity: z.ZodObject<{
6101
+ score: z.ZodNumber;
6102
+ status: z.ZodEnum<{
6103
+ critical: "critical";
6104
+ warning: "warning";
6105
+ good: "good";
6106
+ }>;
6107
+ details: z.ZodString;
6108
+ recommendation: z.ZodOptional<z.ZodString>;
6109
+ }, z.core.$strip>;
6110
+ requirementExplicitness: z.ZodObject<{
6111
+ score: z.ZodNumber;
6112
+ status: z.ZodEnum<{
6113
+ critical: "critical";
6114
+ warning: "warning";
6115
+ good: "good";
6116
+ }>;
6117
+ details: z.ZodString;
6118
+ recommendation: z.ZodOptional<z.ZodString>;
6119
+ }, z.core.$strip>;
6120
+ problemBoundedness: z.ZodObject<{
6121
+ score: z.ZodNumber;
6122
+ status: z.ZodEnum<{
6123
+ critical: "critical";
6124
+ warning: "warning";
6125
+ good: "good";
6126
+ }>;
6127
+ details: z.ZodString;
6128
+ recommendation: z.ZodOptional<z.ZodString>;
6129
+ }, z.core.$strip>;
6130
+ receiptCompleteness: z.ZodObject<{
6131
+ score: z.ZodNumber;
6132
+ status: z.ZodEnum<{
6133
+ critical: "critical";
6134
+ warning: "warning";
6135
+ good: "good";
6136
+ }>;
6137
+ details: z.ZodString;
6138
+ recommendation: z.ZodOptional<z.ZodString>;
6139
+ }, z.core.$strip>;
6140
+ errorRecoverability: z.ZodObject<{
6141
+ score: z.ZodNumber;
6142
+ status: z.ZodEnum<{
6143
+ critical: "critical";
6144
+ warning: "warning";
6145
+ good: "good";
6146
+ }>;
6147
+ details: z.ZodString;
6148
+ recommendation: z.ZodOptional<z.ZodString>;
6149
+ }, z.core.$strip>;
6150
+ stateCoherence: z.ZodObject<{
6151
+ score: z.ZodNumber;
6152
+ status: z.ZodEnum<{
6153
+ critical: "critical";
6154
+ warning: "warning";
6155
+ good: "good";
6156
+ }>;
6157
+ details: z.ZodString;
6158
+ recommendation: z.ZodOptional<z.ZodString>;
6159
+ }, z.core.$strip>;
6160
+ modelContinuity: z.ZodObject<{
6161
+ score: z.ZodNumber;
6162
+ status: z.ZodEnum<{
6163
+ critical: "critical";
6164
+ warning: "warning";
6165
+ good: "good";
6166
+ }>;
6167
+ details: z.ZodString;
6168
+ recommendation: z.ZodOptional<z.ZodString>;
6169
+ }, z.core.$strip>;
6170
+ }, z.core.$strip>;
6171
+ recommendations: z.ZodArray<z.ZodString>;
6172
+ }, z.core.$strip>;
6173
+ type HostilityScore = z.infer<typeof HostilityScoreSchema>;
6174
+
6175
+ /**
6176
+ * Environmental Hostility Checks
6177
+ *
6178
+ * Individual check functions for each hostility component.
6179
+ * Each check examines a specific aspect of environment quality.
6180
+ */
6181
+
6182
+ /**
6183
+ * Options for running hostility checks
6184
+ */
6185
+ interface CheckOptions {
6186
+ /** Current working directory for checks */
6187
+ cwd?: string;
6188
+ /** Path to plan.json file */
6189
+ planPath?: string;
6190
+ /** Profile directory path */
6191
+ profileDir?: string;
6192
+ }
6193
+
6194
+ /**
6195
+ * Environmental Hostility Scoring Module
6196
+ *
6197
+ * Implements the Environmental De-hostilization concept from the coordination
6198
+ * cost compression thesis (Definition 3.2).
6199
+ *
6200
+ * @module hostility
6201
+ */
6202
+
6203
+ /**
6204
+ * Run a complete environment quality check and return the hostility score.
6205
+ *
6206
+ * @param options - Check options including cwd, planPath, and profileDir
6207
+ * @returns Complete hostility score with component breakdown
6208
+ */
6209
+ declare function runEnvironmentQualityCheck(options?: CheckOptions): HostilityScore;
6210
+
6211
+ type WorkspaceConfigFailureCode = "WORKSPACE_INIT_FAILED" | "WORKSPACE_DIAGNOSTICS_FAILED" | "CONFIG_KEY_NOT_FOUND" | "CONFIG_RESULT_LIMIT_EXCEEDED" | "PROFILE_RESOLUTION_FAILED";
6212
+ declare class WorkspaceConfigServiceError extends Error {
6213
+ readonly code: WorkspaceConfigFailureCode;
6214
+ constructor(code: WorkspaceConfigFailureCode, message: string);
6215
+ }
6216
+ interface ConfigSourceLevel {
6217
+ level: string;
6218
+ path?: string;
6219
+ checked: boolean;
6220
+ found: boolean;
6221
+ overridden?: boolean;
6222
+ }
6223
+ interface BoundedConfigValue {
6224
+ key: string;
6225
+ value: unknown;
6226
+ source: string;
6227
+ overrides?: {
6228
+ source: string;
6229
+ value: unknown;
6230
+ };
6231
+ precedence: ConfigSourceLevel[];
6232
+ }
6233
+ interface BoundedConfigResult {
6234
+ contract: "bounded-ax-v1";
6235
+ precedenceChain: Array<{
6236
+ level: string;
6237
+ source?: string;
6238
+ path?: string;
6239
+ }>;
6240
+ configuration: BoundedConfigValue[];
6241
+ }
6242
+ interface BoundedWorkspaceInitResult extends LocalOverlayResult {
6243
+ contract: "bounded-ax-v1";
6244
+ }
6245
+ interface BoundedProfileResult {
6246
+ contract: "bounded-ax-v1";
6247
+ path: string;
6248
+ source: string;
6249
+ manifest: ResolvedProfile["manifest"];
6250
+ }
6251
+ interface BoundedDoctorResult {
6252
+ contract: "bounded-ax-v1";
6253
+ hasErrors: boolean;
6254
+ issues: string[];
6255
+ suggestions: string[];
6256
+ nodejs: {
6257
+ status: "ok" | "mismatch" | "no_constraint";
6258
+ current: string;
6259
+ required: string;
6260
+ expected?: string;
6261
+ };
6262
+ configuration: ReturnType<typeof bootstrapWorkspace>;
6263
+ projectType: string;
6264
+ environmentSuggestions: string[];
6265
+ github?: {
6266
+ detected: boolean;
6267
+ authenticated?: boolean;
6268
+ user?: string;
6269
+ error?: string;
6270
+ };
6271
+ git?: {
6272
+ status: "ok" | "error";
6273
+ isClean?: boolean;
6274
+ currentBranch?: string;
6275
+ error?: string;
6276
+ };
6277
+ environmentQuality?: ReturnType<typeof runEnvironmentQualityCheck>;
6278
+ }
6279
+ /** Transport-neutral owner for deterministic workspace initialization. */
6280
+ declare class WorkspaceInitializationService {
6281
+ run(input: {
6282
+ baseDir: string;
6283
+ force?: boolean;
6284
+ }): BoundedWorkspaceInitResult;
6285
+ }
6286
+ /** Transport-neutral owner for workspace and environment diagnostics. */
6287
+ declare class WorkspaceDiagnosticsService {
6288
+ run(input: {
6289
+ baseDir: string;
6290
+ environmentQuality?: boolean;
6291
+ }): Promise<BoundedDoctorResult>;
6292
+ }
6293
+ /** Transport-neutral owner for configuration and profile queries. */
6294
+ declare class ConfigurationQueryService {
6295
+ show(input: {
6296
+ baseDir: string;
6297
+ key?: string;
6298
+ }): BoundedConfigResult;
6299
+ resolveProfile(input: {
6300
+ baseDir: string;
6301
+ profileDir?: string;
6302
+ }): BoundedProfileResult;
6303
+ }
6304
+
6305
+ declare const INTEGRATION_RECORD_REMOVAL_VERSION: "2.0.0";
6306
+ declare const INTEGRATION_RECORD_REPLACEMENTS: {
6307
+ readonly "lexrunner.startRun": "plan.create, gates.run, or merge.apply for integration; start_attempt for ADR-010 orchestration";
6308
+ readonly "lexrunner.getStatus": "status for integration; get_attempt_status for ADR-010 orchestration";
6309
+ readonly "lexrunner.listArtifacts": "bounded artifact references from the owning plan.create, gates.run, or merge.apply operation";
6310
+ };
6311
+ type IntegrationRecordCompatibilityTool = keyof typeof INTEGRATION_RECORD_REPLACEMENTS;
6312
+ type IntegrationRecordCompatibilityFailureCode = "INTEGRATION_RECORD_INVALID_INPUT" | "INTEGRATION_RECORD_NOT_FOUND" | "INTEGRATION_RECORD_RESULT_LIMIT_EXCEEDED" | "INTEGRATION_RECORD_OPERATION_FAILED";
6313
+ declare class IntegrationRecordCompatibilityError extends Error {
6314
+ readonly code: IntegrationRecordCompatibilityFailureCode;
6315
+ constructor(code: IntegrationRecordCompatibilityFailureCode, message: string);
6316
+ }
6317
+ interface StartIntegrationRecordInput {
6318
+ mode: string;
6319
+ procedure: string;
6320
+ repo: string;
6321
+ task?: string;
6322
+ params?: Record<string, unknown>;
6323
+ }
6324
+ interface ListIntegrationArtifactsInput {
6325
+ runId: string;
6326
+ type?: ArtifactType;
6327
+ path?: string;
6328
+ latestOnly?: boolean;
6329
+ inline?: boolean;
6330
+ }
6331
+ interface CompatibilityMetadata {
6332
+ contract: "bounded-ax-v1";
6333
+ kind: "IntegrationRun";
6334
+ authority: "integration-record-only";
6335
+ deprecation: {
6336
+ tool: IntegrationRecordCompatibilityTool;
6337
+ replacement: string;
6338
+ removeIn: typeof INTEGRATION_RECORD_REMOVAL_VERSION;
6339
+ };
6340
+ }
6341
+ /**
6342
+ * Bounded retirement adapter for the legacy lexrunner.* integration-record tools.
6343
+ * It never receives a CoordinationStore and cannot advance ADR-010 WorkItem/Run/Attempt state.
6344
+ */
6345
+ declare class IntegrationRecordCompatibilityService {
6346
+ private readonly manager;
6347
+ constructor(baseDir?: string);
6348
+ start(input: StartIntegrationRecordInput): CompatibilityMetadata & {
6349
+ runId: string;
6350
+ status: string;
6351
+ message: string;
6352
+ initialStatus: {
6353
+ runId: string;
6354
+ state: string;
6355
+ mode: string;
6356
+ procedure: string;
6357
+ summary: string;
6358
+ progress: unknown;
6359
+ nextOptions: unknown[];
6360
+ };
6361
+ };
6362
+ getStatus(input: {
6363
+ runId: string;
6364
+ }): CompatibilityMetadata & ReturnType<typeof projectStatus>;
6365
+ listArtifacts(input: ListIntegrationArtifactsInput): CompatibilityMetadata & {
6366
+ artifacts: Array<{
6367
+ path: string;
6368
+ type: ArtifactType;
6369
+ size: number;
6370
+ createdAt: string;
6371
+ modifiedAt: string;
6372
+ }>;
6373
+ totalCount: number;
6374
+ returnedCount: number;
6375
+ truncated: boolean;
6376
+ inlineContentRetired: true;
6377
+ };
6378
+ }
6379
+ declare function projectStatus(status: {
6380
+ runId: string;
6381
+ state: string;
6382
+ mode: string;
6383
+ procedure: string;
6384
+ summary: string;
6385
+ progress?: unknown;
6386
+ nextOptions?: unknown[];
6387
+ }): {
6388
+ runId: string;
6389
+ state: string;
6390
+ mode: string;
6391
+ procedure: string;
6392
+ summary: string;
6393
+ progress: unknown;
6394
+ nextOptions: unknown[];
6395
+ };
6396
+
2644
6397
  /**
2645
6398
  * Guided workflow response types for MCP server
2646
6399
  *
@@ -2704,6 +6457,8 @@ type WorkflowPhase = "initial" | "post-plan-creation" | "post-gates-run" | "pre-
2704
6457
  */
2705
6458
  declare function createWorkflowGuide(phase: WorkflowPhase): WorkflowGuide;
2706
6459
 
6460
+ /** Architecture-test hook; returns metadata only and never executes a command. */
6461
+ declare function inspectRegisteredCliSurface(): RegisteredCliCommand[];
2707
6462
  declare function main(argv?: string[]): Promise<void>;
2708
6463
 
2709
- export { ExecutionState, GitHubAPI, MergeEligibilityEvaluator, type MultiRepoPlanOptions, type RepoTarget, bootstrapWorkspace, canonicalJSONStringify, computeMergeOrder, createFileAnalyzer, createGitHubAPI, createGitHubClient, createGitOperations, createRunManager, createWorkflowGuide, detectProjectType, executeGatesWithPolicy, generateGitHubSnapshot, generateMultiRepoPlan, generatePlan, generatePlanFromGitHub, generateSnapshot, getEnvironmentSuggestions, healthChecker, initLocalOverlay, loadInputs, loadPlan, main, resolveProfile };
6464
+ export { AGENT_ENGINE_VERIFICATION_V2_VERSION, AGENT_TASK_RECEIPT_PATCH_PROFILE, AGENT_TASK_RECEIPT_V2_VERSION, AGENT_WORK_CONTRACT_VERSION, AgentEngineVerification_v1, AgentEngineVerification_v2, type AgentTaskPacketHashInput, AgentTaskPacketHashInput_v1, AgentTaskPacket_v1, type AgentTaskReceiptBindingContext, AgentTaskReceiptOutcome, type AgentTaskReceiptV2BindingContext, AgentTaskReceipt_v1, AgentTaskReceipt_v2, AgentWorkFanInDecision_v1, type AgentWorkFanInResult, AgentWorkFanoutPlan_v1, AgentWorkFanoutService, type AgentWorkPreparationCommandResult, type AgentWorkPreparationCommandRunner, AgentWorkPreparationReceipt_v1, type AgentWorkPreparationResult, AttemptAcceptanceApplyRequestJsonSchema, AttemptAcceptanceStatusRequestJsonSchema, AttemptPrepareRequestJsonSchema, AttemptReceiptStatusRequestJsonSchema, AttemptReceiptSubmitRequestJsonSchema, AttemptRetryDeltaDimension_v1, AttemptRetryDelta_v1, AttemptStartRequestJsonSchema, AttemptStatus, AttemptStatusInputJsonSchema, AttemptVerificationRunRequestJsonSchema, AttemptVerificationStatusRequestJsonSchema, AttemptWorkerAttachRequestJsonSchema, AttemptWorkerEndRequestJsonSchema, AttemptWorkerHeartbeatRequestJsonSchema, AttemptWorkerStatusRequestJsonSchema, Attempt_v1, AuthorityEnvelope, type BoundedDiscoveryResult, type BoundedGateRunResult, type BoundedIntegrationStatus, type BoundedMergeApplicationResult, type BoundedMergeOrderResult, ClaimedCheckOutcome, ConfigurationQueryService, ControllerLease_v1, type CreateAgentWorkFanoutInput, type DecideAgentWorkFanInInput, DiscoveryQueryService, EngineVerificationCheckSource_v2, EngineVerificationDeterminism_v2, EngineVerificationTrustGapReason_v2, type ExecuteAgentWorkPreparationInput, ExecutionEnvelope_v1, ExecutionEnvironmentOS, ExecutionState, FanInCandidateConclusion_v1, FanoutAttemptBinding_v1, FanoutPremise_v1, FanoutRationale_v1, FanoutSelectionCriterion_v1, GATE_IMPACT_MODEL, GateExecutionService, GateExecutionServiceError, type GateExecutionServiceInput, type GateExecutionServiceResult, GateImpactService, GateImpactServiceError, GitHubAPI, GitObjectId, HumanActionPreconditions, HumanActionReceipt_v1, HumanActionRequest_v1, INTEGRATION_RECORD_REMOVAL_VERSION, INTEGRATION_RECORD_REPLACEMENTS, IntegrationQueryServiceError, IntegrationRecordCompatibilityError, IntegrationRecordCompatibilityService, IntegrationStatusQueryService, type MergeApplicationExecution, type MergeApplicationFailureCode, type MergeApplicationRuntime, MergeApplicationService, MergeApplicationServiceError, MergeEligibilityEvaluator, MergeOrderQueryService, type MultiRepoPlanOptions$1 as MultiRepoPlanOptions, PlanCreationService, type RepoTarget, RunStatus, Run_v1, STRICT_FANOUT_SELECTION_CRITERIA, VerificationOutcome, WorkItem_v1, WorkerSessionBackend, WorkerSessionStatus, WorkerSession_v1, WorkspaceAllocationStatus, WorkspaceAllocation_v1, WorkspaceCleanupDisposition, WorkspaceConfigServiceError, WorkspaceDiagnosticsService, WorkspaceInitializationService, WorkspaceLeaseStatus, WorkspaceLease_v1, applyGateImpactSelection, attemptStatusRequiresReceipt, attemptStatusRequiresVerification, bootstrapWorkspace, canonicalJSONStringify, computeAgentEngineVerificationV2Hash, computeAgentTaskPacketHash, computeFanInEvidenceSetHash, computeMergeOrder, createAgentTaskPacket, createAttemptLifecycleHandlers, createAttemptReceiptHandlers, createAttemptVerificationHandlers, createAttemptWorkerHandlers, createFileAnalyzer, createGitHubAPI, createGitHubClient, createGitOperations, createRunManager, createWorkflowGuide, detectProjectType, executeAgentWorkPreparation, executeGatesWithPolicy, generateGitHubSnapshot, generateMultiRepoPlan, generatePlan, generatePlanFromGitHub, generateSnapshot, getEnvironmentSuggestions, healthChecker, initLocalOverlay, inspectRegisteredCliSurface, isTerminalAttemptStatus, loadInputs, loadPlan, main, orderAgentWorkPreparationSteps, parseAgentEngineVerification, parseAgentEngineVerificationV2, parseAgentTaskPacket, parseAgentTaskReceipt, parseAgentTaskReceiptV2, parseAttempt, parseControllerLease, parseExecutionEnvelope, parseHumanActionReceipt, parseHumanActionRequest, parseRun, parseWorkItem, parseWorkerSession, parseWorkspaceAllocation, parseWorkspaceLease, resolveProfile, validateAgentEngineVerificationV2PacketReferences, validateAgentTaskReceiptBinding, validateAgentTaskReceiptV2Binding, validateAgentTaskReceiptV2PacketReferences, validateHumanActionReceiptBinding, writeGateImpactReceipt };