@smartergpt/lexrunner 1.0.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1433) hide show
  1. package/CHANGELOG.md +109 -1
  2. package/LICENSE.md +110 -0
  3. package/README.mcp.md +89 -17
  4. package/README.md +133 -1012
  5. package/dist/adapters-r7_TjMwo.d.ts +333 -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-JXO4MZ6H.js} +7 -6
  9. package/dist/{chunk-UZFYNSMJ.js → chunk-26SCN2LJ.js} +445 -136
  10. package/{src/monitoring/metrics.ts → dist/chunk-AXOAVRTU.js} +35 -100
  11. package/dist/{chunk-GTP4OHD7.js → chunk-R4DWK6FE.js} +2 -2
  12. package/dist/chunk-TPVORFSN.js +629 -0
  13. package/dist/{chunk-2ESYSVXG.js → chunk-V3BU2VDU.js} +7 -17
  14. package/dist/{chunk-Q6Y524KH.js → chunk-VAGHAQT2.js} +5 -179
  15. package/dist/{chunk-4RVZNLD4.js → chunk-WFN4JTZI.js} +0 -88
  16. package/dist/chunk-WSJEPY7T.js +5633 -0
  17. package/dist/cli.cjs +56133 -33969
  18. package/dist/cli.d.ts +6045 -259
  19. package/dist/cli.js +31588 -15155
  20. package/dist/{commandValidator-AT5OYZFC.js → commandValidator-LVEMJTZP.js} +2 -2
  21. package/dist/{constraints-M52FVL2X.js → constraints-V4VWCWR5.js} +2 -2
  22. package/dist/errors/index.cjs +879 -0
  23. package/dist/errors/index.d.ts +121 -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-UUMCGZJ6.js} +4 -3
  52. package/dist/{planViewer-UIPOSRVW.js → planViewer-TRSQVMH4.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-OE4VLUFK.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 +402 -385
  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.cts DELETED
@@ -1,2709 +0,0 @@
1
- #!/usr/bin/env node
2
- import { z } from 'zod';
3
- import { Octokit } from '@octokit/rest';
4
-
5
- /**
6
- * Gate execution result
7
- */
8
- declare const GateResult: z.ZodObject<{
9
- gate: z.ZodString;
10
- status: z.ZodEnum<{
11
- pass: "pass";
12
- fail: "fail";
13
- blocked: "blocked";
14
- skipped: "skipped";
15
- retrying: "retrying";
16
- }>;
17
- exitCode: z.ZodOptional<z.ZodNumber>;
18
- duration: z.ZodOptional<z.ZodNumber>;
19
- stdout: z.ZodOptional<z.ZodString>;
20
- stderr: z.ZodOptional<z.ZodString>;
21
- artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
- attempts: z.ZodDefault<z.ZodNumber>;
23
- lastAttempt: z.ZodOptional<z.ZodString>;
24
- }, z.core.$strip>;
25
- type GateResult = z.infer<typeof GateResult>;
26
- /**
27
- * Node execution state
28
- */
29
- declare const NodeResult: z.ZodObject<{
30
- name: z.ZodString;
31
- status: z.ZodEnum<{
32
- pass: "pass";
33
- fail: "fail";
34
- blocked: "blocked";
35
- skipped: "skipped";
36
- retrying: "retrying";
37
- }>;
38
- gates: z.ZodDefault<z.ZodArray<z.ZodObject<{
39
- gate: z.ZodString;
40
- status: z.ZodEnum<{
41
- pass: "pass";
42
- fail: "fail";
43
- blocked: "blocked";
44
- skipped: "skipped";
45
- retrying: "retrying";
46
- }>;
47
- exitCode: z.ZodOptional<z.ZodNumber>;
48
- duration: z.ZodOptional<z.ZodNumber>;
49
- stdout: z.ZodOptional<z.ZodString>;
50
- stderr: z.ZodOptional<z.ZodString>;
51
- artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
- attempts: z.ZodDefault<z.ZodNumber>;
53
- lastAttempt: z.ZodOptional<z.ZodString>;
54
- }, z.core.$strip>>>;
55
- blockedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
56
- eligibleForMerge: z.ZodDefault<z.ZodBoolean>;
57
- }, z.core.$strip>;
58
- type NodeResult = z.infer<typeof NodeResult>;
59
- /**
60
- * Plan item with dependencies resolved by name.
61
- * Note: Input generator defaults name := id when name is unset.
62
- * All deps references must match item names in the final plan.
63
- */
64
- declare const PlanItem: z.ZodObject<{
65
- name: z.ZodString;
66
- deps: z.ZodDefault<z.ZodArray<z.ZodString>>;
67
- gates: z.ZodDefault<z.ZodArray<z.ZodObject<{
68
- name: z.ZodString;
69
- run: z.ZodString;
70
- cwd: z.ZodOptional<z.ZodString>;
71
- env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
72
- runtime: z.ZodDefault<z.ZodEnum<{
73
- local: "local";
74
- container: "container";
75
- "ci-service": "ci-service";
76
- }>>;
77
- container: z.ZodOptional<z.ZodObject<{
78
- image: z.ZodString;
79
- entrypoint: z.ZodOptional<z.ZodArray<z.ZodString>>;
80
- mounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
81
- source: z.ZodString;
82
- target: z.ZodString;
83
- type: z.ZodDefault<z.ZodEnum<{
84
- bind: "bind";
85
- volume: "volume";
86
- }>>;
87
- }, z.core.$strip>>>;
88
- }, z.core.$strip>>;
89
- artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
90
- input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
91
- }, z.core.$strict>>>;
92
- tier: z.ZodOptional<z.ZodObject<{
93
- suggested: z.ZodEnum<{
94
- senior: "senior";
95
- mid: "mid";
96
- junior: "junior";
97
- }>;
98
- actual: z.ZodOptional<z.ZodEnum<{
99
- senior: "senior";
100
- mid: "mid";
101
- junior: "junior";
102
- }>>;
103
- escalated: z.ZodDefault<z.ZodBoolean>;
104
- escalationReason: z.ZodOptional<z.ZodString>;
105
- mismatch: z.ZodOptional<z.ZodBoolean>;
106
- }, z.core.$strip>>;
107
- }, z.core.$strict>;
108
- type PlanItem = z.infer<typeof PlanItem>;
109
- declare const Plan: z.ZodObject<{
110
- schemaVersion: z.ZodString;
111
- target: z.ZodDefault<z.ZodString>;
112
- policy: z.ZodOptional<z.ZodObject<{
113
- requiredGates: z.ZodDefault<z.ZodArray<z.ZodString>>;
114
- optionalGates: z.ZodDefault<z.ZodArray<z.ZodString>>;
115
- maxWorkers: z.ZodDefault<z.ZodNumber>;
116
- retries: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
117
- maxAttempts: z.ZodDefault<z.ZodNumber>;
118
- backoffSeconds: z.ZodDefault<z.ZodNumber>;
119
- }, z.core.$strip>>>;
120
- overrides: z.ZodDefault<z.ZodObject<{
121
- adminGreen: z.ZodOptional<z.ZodObject<{
122
- allowedUsers: z.ZodOptional<z.ZodArray<z.ZodString>>;
123
- requireReason: z.ZodDefault<z.ZodBoolean>;
124
- }, z.core.$strip>>;
125
- }, z.core.$strip>>;
126
- blockOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
127
- mergeRule: z.ZodDefault<z.ZodObject<{
128
- type: z.ZodDefault<z.ZodEnum<{
129
- "strict-required": "strict-required";
130
- }>>;
131
- }, z.core.$strip>>;
132
- performance: z.ZodOptional<z.ZodDefault<z.ZodObject<{
133
- maxMemoryMB: z.ZodOptional<z.ZodNumber>;
134
- batchSize: z.ZodDefault<z.ZodNumber>;
135
- cacheTTLSeconds: z.ZodDefault<z.ZodNumber>;
136
- enableCaching: z.ZodDefault<z.ZodBoolean>;
137
- throttleOnMemory: z.ZodDefault<z.ZodBoolean>;
138
- memoryThresholdPercent: z.ZodDefault<z.ZodNumber>;
139
- }, z.core.$strip>>>;
140
- security: z.ZodOptional<z.ZodDefault<z.ZodObject<{
141
- blockCritical: z.ZodDefault<z.ZodBoolean>;
142
- blockHigh: z.ZodDefault<z.ZodBoolean>;
143
- maxMedium: z.ZodDefault<z.ZodNumber>;
144
- maxLow: z.ZodDefault<z.ZodNumber>;
145
- }, z.core.$strip>>>;
146
- }, z.core.$strip>>;
147
- items: z.ZodDefault<z.ZodArray<z.ZodObject<{
148
- name: z.ZodString;
149
- deps: z.ZodDefault<z.ZodArray<z.ZodString>>;
150
- gates: z.ZodDefault<z.ZodArray<z.ZodObject<{
151
- name: z.ZodString;
152
- run: z.ZodString;
153
- cwd: z.ZodOptional<z.ZodString>;
154
- env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
155
- runtime: z.ZodDefault<z.ZodEnum<{
156
- local: "local";
157
- container: "container";
158
- "ci-service": "ci-service";
159
- }>>;
160
- container: z.ZodOptional<z.ZodObject<{
161
- image: z.ZodString;
162
- entrypoint: z.ZodOptional<z.ZodArray<z.ZodString>>;
163
- mounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
164
- source: z.ZodString;
165
- target: z.ZodString;
166
- type: z.ZodDefault<z.ZodEnum<{
167
- bind: "bind";
168
- volume: "volume";
169
- }>>;
170
- }, z.core.$strip>>>;
171
- }, z.core.$strip>>;
172
- artifacts: z.ZodDefault<z.ZodArray<z.ZodString>>;
173
- input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
174
- }, z.core.$strict>>>;
175
- tier: z.ZodOptional<z.ZodObject<{
176
- suggested: z.ZodEnum<{
177
- senior: "senior";
178
- mid: "mid";
179
- junior: "junior";
180
- }>;
181
- actual: z.ZodOptional<z.ZodEnum<{
182
- senior: "senior";
183
- mid: "mid";
184
- junior: "junior";
185
- }>>;
186
- escalated: z.ZodDefault<z.ZodBoolean>;
187
- escalationReason: z.ZodOptional<z.ZodString>;
188
- mismatch: z.ZodOptional<z.ZodBoolean>;
189
- }, z.core.$strip>>;
190
- }, z.core.$strict>>>;
191
- }, z.core.$strict>;
192
- type Plan = z.infer<typeof Plan>;
193
- /**
194
- * Load and validate a plan.json file
195
- */
196
- declare function loadPlan(planContent: string): Plan;
197
-
198
- /**
199
- * Error Recovery and Resilience Framework
200
- *
201
- * Implements:
202
- * - Error classification (transient vs permanent)
203
- * - Exponential backoff retry mechanism
204
- * - Circuit breaker pattern for external services
205
- * - Graceful degradation strategies
206
- * - Detailed error diagnostics and recovery guidance
207
- */
208
- /**
209
- * Error classification types
210
- */
211
- declare enum ErrorType {
212
- /** Transient errors that may succeed on retry (network, rate limits, temporary service outages) */
213
- Transient = "transient",
214
- /** Permanent errors that won't succeed on retry (validation, auth, not found) */
215
- Permanent = "permanent",
216
- /** Unknown error classification */
217
- Unknown = "unknown"
218
- }
219
- /**
220
- * Error severity levels for prioritization and alerting
221
- */
222
- declare enum ErrorSeverity {
223
- /** Critical errors that prevent operation continuation */
224
- Critical = "critical",
225
- /** High severity errors that impact functionality */
226
- High = "high",
227
- /** Medium severity errors with workarounds available */
228
- Medium = "medium",
229
- /** Low severity errors or warnings */
230
- Low = "low"
231
- }
232
- /**
233
- * Classified error with context and recovery information
234
- */
235
- interface ClassifiedError {
236
- /** Original error */
237
- error: Error;
238
- /** Error classification type */
239
- type: ErrorType;
240
- /** Severity level */
241
- severity: ErrorSeverity;
242
- /** Human-readable context */
243
- context: string;
244
- /** Suggested recovery actions */
245
- recoveryActions: string[];
246
- /** Whether this error is retryable */
247
- retryable: boolean;
248
- /** Error code for automation */
249
- code: string;
250
- /** Metadata for diagnostics */
251
- metadata?: Record<string, any>;
252
- }
253
-
254
- /**
255
- * Execution state management for the lexrunner
256
- * Handles status tracking, propagation, and merge eligibility
257
- * Includes error diagnostics and recovery tracking
258
- */
259
-
260
- /**
261
- * Error diagnostic information
262
- */
263
- interface ErrorDiagnostic {
264
- nodeName: string;
265
- gateName: string;
266
- classified: ClassifiedError;
267
- timestamp: string;
268
- attemptNumber: number;
269
- }
270
- /**
271
- * Execution state manager with error tracking
272
- */
273
- declare class ExecutionState {
274
- private results;
275
- private plan;
276
- private policy;
277
- private errorDiagnostics;
278
- constructor(plan: Plan);
279
- /**
280
- * Record error diagnostic for troubleshooting
281
- */
282
- recordErrorDiagnostic(nodeName: string, gateName: string, error: Error, attemptNumber: number): void;
283
- /**
284
- * Get error diagnostics
285
- */
286
- getErrorDiagnostics(): ErrorDiagnostic[];
287
- /**
288
- * Get summary of errors by type
289
- */
290
- getErrorSummary(): {
291
- transient: number;
292
- permanent: number;
293
- unknown: number;
294
- };
295
- /**
296
- * Update gate result for a node
297
- */
298
- updateGateResult(nodeName: string, gateResult: GateResult): void;
299
- /**
300
- * Update node status based on its gate results and policy
301
- */
302
- private updateNodeStatus;
303
- /**
304
- * Propagate blocked status to dependent nodes
305
- */
306
- propagateBlockedStatus(): void;
307
- /**
308
- * Get required gates for a node based on policy and node configuration
309
- */
310
- private getRequiredGatesForNode;
311
- /**
312
- * Build dependency map for the plan
313
- */
314
- private buildDependencyMap;
315
- /**
316
- * Get current results
317
- */
318
- getResults(): Map<string, NodeResult>;
319
- /**
320
- * Get result for specific node
321
- */
322
- getNodeResult(nodeName: string): NodeResult | undefined;
323
- /**
324
- * Get nodes eligible for merge
325
- */
326
- getEligibleNodes(): string[];
327
- /**
328
- * Check if all nodes are complete (passed, failed, or blocked)
329
- */
330
- isExecutionComplete(): boolean;
331
- /**
332
- * Load gate results from a directory and populate execution state
333
- * This allows importing results from external runs (manual gates, CI, etc.)
334
- *
335
- * @param gateResultsDir Directory containing gate result JSON files
336
- * @returns Number of gate results loaded
337
- */
338
- loadGateResultsFromDirectory(gateResultsDir: string): number;
339
- }
340
-
341
- /**
342
- * Progress indicators for human mode CLI output
343
- * Provides timing and progress ticks for long operations
344
- */
345
- interface ProgressOptions {
346
- /** Whether to show progress indicators (disabled in JSON mode) */
347
- enabled: boolean;
348
- }
349
- /**
350
- * Progress reporter for long-running operations
351
- */
352
- declare class ProgressReporter {
353
- private enabled;
354
- private startTimes;
355
- constructor(options?: ProgressOptions);
356
- /**
357
- * Mark the start of a level
358
- */
359
- levelStart(level: number, items: string[]): void;
360
- /**
361
- * Mark the completion of a level
362
- */
363
- levelComplete(level: number): void;
364
- /**
365
- * Mark the start of a node/item
366
- */
367
- nodeStart(name: string): void;
368
- /**
369
- * Mark the completion of a node/item (only if >2s threshold)
370
- */
371
- nodeComplete(name: string, success?: boolean): void;
372
- /**
373
- * Format duration in human-readable format
374
- */
375
- private formatDuration;
376
- }
377
-
378
- /**
379
- * Turn Cost Tracking for Merge-Weave Operations
380
- *
381
- * Implements Turn Cost tracking per the coordination cost compression thesis:
382
- * Turn Cost = λL + γC + ρR + τT + αA
383
- *
384
- * Where:
385
- * - L: Latency (API response time, gate execution, merge time)
386
- * - C: Context Reset tokens (N/A for deterministic runner)
387
- * - R: Renegotiation (conflict resolution retries, clarification turns)
388
- * - T: Token Bloat (excess tokens beyond expected)
389
- * - A: Attention Switch (human interventions, manual conflict resolutions)
390
- */
391
- /**
392
- * Default weights for Turn Cost calculation
393
- */
394
- declare const DEFAULT_TURN_COST_WEIGHTS: {
395
- /** Weight for latency (λ) - normalized to seconds */
396
- readonly lambda: 0.1;
397
- /** Weight for context reset tokens (γ) */
398
- readonly gamma: 0.1;
399
- /** Weight for renegotiation count (ρ) */
400
- readonly rho: 0.3;
401
- /** Weight for token bloat (τ) */
402
- readonly tau: 0.2;
403
- /** Weight for attention switch count (α) */
404
- readonly alpha: 0.3;
405
- };
406
- type TurnCostWeights = typeof DEFAULT_TURN_COST_WEIGHTS;
407
- /**
408
- * Turn Cost components tracked during merge-weave operations
409
- */
410
- interface TurnCostComponents {
411
- /** Total latency in milliseconds */
412
- latencyMs: number;
413
- /** Context reset tokens (N/A for deterministic runner, always 0) */
414
- contextResetTokens: number;
415
- /** Number of renegotiation events (conflict retries, clarifications) */
416
- renegotiationCount: number;
417
- /** Token bloat (actual - expected tokens used) */
418
- tokenBloat: number;
419
- /** Number of attention switches (human interventions) */
420
- attentionSwitchCount: number;
421
- }
422
- /**
423
- * Event recorded during Turn Cost tracking
424
- */
425
- interface TurnCostEvent {
426
- /** Type of event */
427
- type: "latency" | "renegotiation" | "token_bloat" | "attention_switch";
428
- /** Timestamp of the event */
429
- timestamp: string;
430
- /** Event-specific details */
431
- details: {
432
- /** Reason for the event */
433
- reason?: string;
434
- /** Duration in milliseconds (for latency events) */
435
- durationMs?: number;
436
- /** Expected token count (for token bloat events) */
437
- expectedTokens?: number;
438
- /** Actual token count (for token bloat events) */
439
- actualTokens?: number;
440
- /** Item name associated with the event */
441
- itemName?: string;
442
- };
443
- }
444
- /**
445
- * Turn Cost summary for output
446
- */
447
- interface TurnCostSummary {
448
- /** Component values */
449
- components: TurnCostComponents;
450
- /** Weighted score using default weights */
451
- weightedScore: number;
452
- /** Number of events recorded */
453
- eventCount: number;
454
- /** Optional prior run score for comparison */
455
- priorRunScore?: number;
456
- /** Optional improvement percentage (negative = improvement) */
457
- improvement?: string;
458
- }
459
- /**
460
- * MergeWeaveTurnCost tracks coordination costs during merge-weave operations.
461
- *
462
- * Usage:
463
- * ```typescript
464
- * const turnCost = new MergeWeaveTurnCost();
465
- *
466
- * // Track latency for operations
467
- * const start = performance.now();
468
- * await someOperation();
469
- * turnCost.recordLatency(performance.now() - start);
470
- *
471
- * // Track renegotiation events
472
- * turnCost.recordRenegotiation('conflict in feature-branch');
473
- *
474
- * // Track token bloat
475
- * turnCost.recordTokenBloat(1000, 1500); // expected, actual
476
- *
477
- * // Track attention switches
478
- * turnCost.recordAttentionSwitch('manual conflict resolution required');
479
- *
480
- * // Get summary
481
- * const summary = turnCost.toJSON();
482
- * ```
483
- */
484
- declare class MergeWeaveTurnCost {
485
- private components;
486
- private events;
487
- private weights;
488
- constructor(weights?: TurnCostWeights);
489
- /**
490
- * Record latency from an operation.
491
- * @param durationMs Duration in milliseconds
492
- * @param itemName Optional item name for context
493
- */
494
- recordLatency(durationMs: number, itemName?: string): void;
495
- /**
496
- * Record a renegotiation event (conflict resolution retry, clarification).
497
- * @param reason Reason for the renegotiation
498
- * @param itemName Optional item name for context
499
- */
500
- recordRenegotiation(reason: string, itemName?: string): void;
501
- /**
502
- * Record token bloat (excess tokens used beyond expected).
503
- * @param expected Expected token count
504
- * @param actual Actual token count
505
- * @param itemName Optional item name for context
506
- */
507
- recordTokenBloat(expected: number, actual: number, itemName?: string): void;
508
- /**
509
- * Record an attention switch (human intervention required).
510
- * @param reason Reason for the attention switch
511
- * @param itemName Optional item name for context
512
- */
513
- recordAttentionSwitch(reason: string, itemName?: string): void;
514
- /**
515
- * Get the current Turn Cost components.
516
- */
517
- getComponents(): TurnCostComponents;
518
- /**
519
- * Get all recorded events.
520
- */
521
- getEvents(): TurnCostEvent[];
522
- /**
523
- * Calculate the weighted Turn Cost score.
524
- * @param weights Optional custom weights (uses default if not provided)
525
- */
526
- getWeightedScore(weights?: TurnCostWeights): number;
527
- /**
528
- * Get Turn Cost summary for output.
529
- * @param priorRunScore Optional prior run score for comparison
530
- */
531
- toJSON(priorRunScore?: number): TurnCostSummary;
532
- /**
533
- * Reset all tracked values.
534
- */
535
- reset(): void;
536
- /**
537
- * Merge another TurnCost tracker into this one.
538
- * Useful for aggregating per-item costs into a total.
539
- */
540
- merge(other: MergeWeaveTurnCost): void;
541
- }
542
-
543
- /**
544
- * Execute gates for multiple items with concurrency control and dependency ordering
545
- */
546
- declare function executeGatesWithPolicy(plan: Plan, executionState: ExecutionState, artifactDir: string, timeoutMs?: number, progressReporter?: ProgressReporter, skipValidation?: boolean, repoRoot?: string, options?: {
547
- runId?: string;
548
- baseDir?: string;
549
- turnCostTracker?: MergeWeaveTurnCost;
550
- }): Promise<void>;
551
-
552
- /**
553
- * Merge eligibility and decision logic for lexrunner
554
- * Implements policy-based merge decisions, short-circuiting, and manual overrides
555
- */
556
-
557
- /**
558
- * Merge decision result
559
- */
560
- interface MergeDecision {
561
- nodeName: string;
562
- eligible: boolean;
563
- reason: string;
564
- requiresOverride: boolean;
565
- blockedBy?: string[];
566
- }
567
- /**
568
- * Override request for manual merge approval
569
- */
570
- interface OverrideRequest {
571
- nodeName: string;
572
- requestedBy: string;
573
- reason: string;
574
- timestamp: string;
575
- }
576
- /**
577
- * Merge eligibility evaluator
578
- */
579
- declare class MergeEligibilityEvaluator {
580
- private plan;
581
- private policy;
582
- private executionState;
583
- private overrides;
584
- constructor(plan: Plan, executionState: ExecutionState);
585
- /**
586
- * Get default policy if none specified
587
- */
588
- private getDefaultPolicy;
589
- /**
590
- * Evaluate merge eligibility for all nodes
591
- */
592
- evaluateAllNodes(): Map<string, MergeDecision>;
593
- /**
594
- * Evaluate merge eligibility for a specific node
595
- */
596
- evaluateNode(nodeName: string): MergeDecision;
597
- /**
598
- * Evaluate strict-required merge rule
599
- */
600
- private evaluateStrictRequired;
601
- /**
602
- * Check status of all dependencies
603
- */
604
- private checkDependencyStatus;
605
- /**
606
- * Request manual override for a node
607
- */
608
- requestOverride(nodeName: string, requestedBy: string, reason: string): boolean;
609
- /**
610
- * Check if an override is valid
611
- */
612
- private isValidOverride;
613
- /**
614
- * Get nodes ready for merge (eligible and all dependencies merged)
615
- */
616
- getNodesReadyForMerge(): string[];
617
- /**
618
- * Get merge summary for reporting
619
- */
620
- getMergeSummary(): {
621
- eligible: string[];
622
- blocked: string[];
623
- pending: string[];
624
- failed: string[];
625
- overrides: OverrideRequest[];
626
- };
627
- /**
628
- * Clear all overrides (for testing or reset)
629
- */
630
- clearOverrides(): void;
631
- }
632
-
633
- /**
634
- * Core inputs processing - reads and normalizes configuration sources
635
- * Maintains deterministic ordering and stable output
636
- */
637
- /**
638
- * Configuration source types
639
- */
640
- interface ConfigSource {
641
- file: string;
642
- content: unknown;
643
- exists: boolean;
644
- }
645
- /**
646
- * Provenance map tracking source file for each configuration key
647
- */
648
- interface ProvenanceMap {
649
- [key: string]: string;
650
- }
651
- /**
652
- * Normalized input configuration
653
- */
654
- interface InputConfig {
655
- version: number;
656
- target: string;
657
- items: InputItem[];
658
- sources: ConfigSource[];
659
- provenance?: ProvenanceMap;
660
- }
661
- interface InputItem {
662
- id?: string;
663
- name: string;
664
- branch?: string;
665
- sha?: string;
666
- deps: string[];
667
- strategy: "rebase-weave" | "merge-weave" | "squash-weave";
668
- gates?: InputGate[];
669
- }
670
- interface InputGate {
671
- name: string;
672
- run: string;
673
- cwd?: string;
674
- env?: Record<string, string>;
675
- runtime?: "local" | "container" | "ci-service";
676
- artifacts?: string[];
677
- }
678
- /**
679
- * Load configuration from file system with deterministic precedence
680
- * Returns normalized configuration with stable ordering
681
- */
682
- declare function loadInputs(baseDir?: string): InputConfig;
683
-
684
- /**
685
- * Capability Tier Schema
686
- *
687
- * Defines tier types for task assignment governance.
688
- * Implements Claim 3.4: Matching task tier to model capability
689
- * reduces overall Turn Cost by avoiding over/under-allocation.
690
- */
691
-
692
- /**
693
- * Tier override specification from CLI
694
- * Format: "item-name=tier" (e.g., "PR-123=senior")
695
- */
696
- declare const TierOverride: z.ZodObject<{
697
- itemName: z.ZodString;
698
- tier: z.ZodEnum<{
699
- senior: "senior";
700
- mid: "mid";
701
- junior: "junior";
702
- }>;
703
- }, z.core.$strip>;
704
- type TierOverride = z.infer<typeof TierOverride>;
705
-
706
- /**
707
- * Core plan generation - transforms inputs to normalized plan
708
- * Maintains deterministic ordering and canonical structure
709
- */
710
-
711
- /**
712
- * Generate normalized plan from input configuration
713
- * Ensures deterministic output with stable ordering
714
- */
715
- declare function generatePlan(inputs: InputConfig, options?: {
716
- tierOverrides?: TierOverride[];
717
- }): Plan;
718
-
719
- /**
720
- * Core snapshot generation - creates deterministic snapshot.md with metadata
721
- * Includes plan hash, environment fingerprint, and stable metadata
722
- */
723
-
724
- /**
725
- * Generate deterministic snapshot.md with plan metadata
726
- */
727
- declare function generateSnapshot(plan: Plan, inputs: InputConfig): string;
728
- /**
729
- * Generate snapshot.md for GitHub-generated plans
730
- */
731
- declare function generateGitHubSnapshot(plan: Plan): string;
732
-
733
- /**
734
- * Serialize any value to canonical JSON with deterministic key ordering
735
- * Arrays keep authored order, objects get keys sorted recursively
736
- * Always ends with newline for consistent file artifacts
737
- */
738
- declare function canonicalJSONStringify(input: unknown): string;
739
-
740
- /**
741
- * Local overlay setup and initialization
742
- * Auto-detects project type and creates .smartergpt.local/ directory
743
- */
744
- interface LocalOverlayConfig {
745
- role: string;
746
- projectType: string;
747
- name?: string;
748
- version?: string;
749
- }
750
- interface LocalOverlayResult {
751
- created: boolean;
752
- path: string;
753
- config: LocalOverlayConfig;
754
- copiedFiles: string[];
755
- }
756
- /**
757
- * Initialize local overlay directory with auto-detected project configuration
758
- *
759
- * @param baseDir - Base directory for workspace (default: current working directory)
760
- * @param force - Force recreation even if local overlay exists
761
- * @returns Result of initialization
762
- */
763
- declare function initLocalOverlay(baseDir?: string, force?: boolean): LocalOverlayResult;
764
-
765
- /**
766
- * Profile resolver with manifest support
767
- * Implements precedence chain: --profile-dir → LEX_PR_PROFILE_DIR → .smartergpt.local/ → .smartergpt/
768
- */
769
- /**
770
- * Profile manifest schema
771
- */
772
- interface ProfileManifest {
773
- role: string;
774
- name?: string;
775
- version?: string;
776
- }
777
- /**
778
- * Resolved profile information
779
- */
780
- interface ResolvedProfile {
781
- path: string;
782
- source: string;
783
- manifest: ProfileManifest;
784
- }
785
- /**
786
- * Resolve profile directory with precedence chain
787
- *
788
- * Precedence order:
789
- * 1. --profile-dir flag (passed as parameter)
790
- * 2. LEX_PR_PROFILE_DIR environment variable
791
- * 3. .smartergpt.local/ (local override, not tracked)
792
- * 4. .smartergpt/ (tracked example profile)
793
- *
794
- * @param profileDirFlag - Profile directory from CLI flag (optional)
795
- * @param baseDir - Base directory to resolve relative paths (default: current working directory)
796
- * @returns Resolved profile with absolute path and manifest
797
- */
798
- declare function resolveProfile(profileDirFlag?: string, baseDir?: string): ResolvedProfile;
799
-
800
- /**
801
- * Health check endpoint for MCP server and general system health
802
- */
803
- interface HealthStatus {
804
- status: "healthy" | "degraded" | "unhealthy";
805
- timestamp: string;
806
- uptime: number;
807
- version: string;
808
- checks: {
809
- memory: HealthCheck;
810
- activeOperations: HealthCheck;
811
- errorRate: HealthCheck;
812
- };
813
- metrics?: {
814
- memory: NodeJS.MemoryUsage;
815
- activeProfiles: number;
816
- errorSummary: {
817
- totalErrors: number;
818
- uniqueErrors: number;
819
- };
820
- };
821
- }
822
- interface HealthCheck {
823
- status: "pass" | "warn" | "fail";
824
- message?: string;
825
- value?: any;
826
- }
827
- /**
828
- * Health checker for system monitoring
829
- */
830
- declare class HealthChecker {
831
- private startTime;
832
- constructor();
833
- /**
834
- * Get current health status
835
- */
836
- getHealth(includeMetrics?: boolean): HealthStatus;
837
- /**
838
- * Check memory usage
839
- */
840
- private checkMemory;
841
- /**
842
- * Check active operations
843
- */
844
- private checkActiveOperations;
845
- /**
846
- * Check error rate
847
- */
848
- private checkErrorRate;
849
- }
850
- /**
851
- * Global health checker instance
852
- */
853
- declare const healthChecker: HealthChecker;
854
-
855
- /**
856
- * Run-Centric Schemas for Tool-Grounded Interactions
857
- *
858
- * This module defines the canonical Zod schemas for StatusResponse and NextOption,
859
- * which structure all tool-grounded interactions in the lexrunner system.
860
- *
861
- * Key invariants:
862
- * - `nextOptions` is the ONLY canonical source of allowed next actions
863
- * - Models should never invent actions outside of `nextOptions`
864
- * - `summary` must be a single sentence that orients quickly
865
- */
866
-
867
- /**
868
- * PersonaSnapshot Schema
869
- *
870
- * Captures the current persona mode and its constraints at a point in time.
871
- *
872
- * @example
873
- * ```typescript
874
- * const snapshot: PersonaSnapshot = {
875
- * mode: "senior-dev",
876
- * forbidden: ["force-push", "delete-branch"],
877
- * completionGates: ["lint", "test", "build"],
878
- * decisionStyle: {
879
- * preferSmallDiffs: true,
880
- * requireRationaleForSkips: true,
881
- * escalateSecurityFindings: true
882
- * }
883
- * };
884
- * ```
885
- */
886
- declare const PersonaSnapshotSchema: z.ZodObject<{
887
- mode: z.ZodString;
888
- forbidden: z.ZodArray<z.ZodString>;
889
- completionGates: z.ZodArray<z.ZodString>;
890
- decisionStyle: z.ZodOptional<z.ZodObject<{
891
- preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
892
- requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
893
- escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
894
- }, z.core.$strip>>;
895
- outputFormat: z.ZodOptional<z.ZodObject<{
896
- severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
897
- requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
898
- }, z.core.$strip>>;
899
- }, z.core.$strip>;
900
- /**
901
- * StatusResponse Schema
902
- *
903
- * The canonical response format for run status queries.
904
- * Contains full context for orientation and available actions.
905
- *
906
- * @example
907
- * ```typescript
908
- * const status: StatusResponse = {
909
- * runId: "01HXYZ123ABC",
910
- * state: "gated",
911
- * mode: "senior-dev",
912
- * procedure: "merge-weave-main",
913
- * summary: "Waiting for lint gate to pass on PR #42.",
914
- * progress: {
915
- * completed: ["fetch-prs", "analyze-deps"],
916
- * current: "run-gates",
917
- * remaining: ["merge-prs", "cleanup"]
918
- * },
919
- * nextOptions: [
920
- * {
921
- * action: "retry_gate",
922
- * description: "Retry the failing lint gate.",
923
- * riskLevel: "low"
924
- * },
925
- * {
926
- * action: "skip_gate",
927
- * description: "Skip the lint gate and continue.",
928
- * requiresLLMDecision: true,
929
- * prompt: "Provide rationale for skipping the lint gate.",
930
- * riskLevel: "medium"
931
- * }
932
- * ],
933
- * blockers: ["lint gate failing"],
934
- * riskFlags: ["unstable-ci"]
935
- * };
936
- * ```
937
- */
938
- declare const StatusResponseSchema: z.ZodObject<{
939
- runId: z.ZodString;
940
- state: z.ZodString;
941
- mode: z.ZodString;
942
- procedure: z.ZodString;
943
- summary: z.ZodString;
944
- progress: z.ZodOptional<z.ZodObject<{
945
- completed: z.ZodArray<z.ZodString>;
946
- current: z.ZodNullable<z.ZodString>;
947
- remaining: z.ZodArray<z.ZodString>;
948
- }, z.core.$strip>>;
949
- nextOptions: z.ZodArray<z.ZodObject<{
950
- action: z.ZodString;
951
- description: z.ZodString;
952
- requiresLLMDecision: z.ZodOptional<z.ZodBoolean>;
953
- prompt: z.ZodOptional<z.ZodString>;
954
- responseSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
955
- objective: z.ZodOptional<z.ZodString>;
956
- constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
957
- style: z.ZodOptional<z.ZodEnum<{
958
- brief: "brief";
959
- detailed: "detailed";
960
- }>>;
961
- riskLevel: z.ZodOptional<z.ZodEnum<{
962
- high: "high";
963
- medium: "medium";
964
- low: "low";
965
- }>>;
966
- }, z.core.$strip>>;
967
- context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
968
- riskFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
969
- blockers: z.ZodOptional<z.ZodArray<z.ZodString>>;
970
- persona: z.ZodOptional<z.ZodObject<{
971
- mode: z.ZodString;
972
- forbidden: z.ZodArray<z.ZodString>;
973
- completionGates: z.ZodArray<z.ZodString>;
974
- decisionStyle: z.ZodOptional<z.ZodObject<{
975
- preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
976
- requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
977
- escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
978
- }, z.core.$strip>>;
979
- outputFormat: z.ZodOptional<z.ZodObject<{
980
- severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
981
- requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
982
- }, z.core.$strip>>;
983
- }, z.core.$strip>>;
984
- }, z.core.$strip>;
985
- type StatusResponse = z.infer<typeof StatusResponseSchema>;
986
-
987
- /**
988
- * Run Lifecycle Types
989
- *
990
- * Core types for the run lifecycle manager, including RunState, RunFilter,
991
- * and related interfaces for tracking tool-grounded execution runs.
992
- */
993
-
994
- /**
995
- * Run State Schema
996
- *
997
- * Represents the complete state of a run at any point in time.
998
- * Persisted to .lexrunner/runs/{runId}.json
999
- */
1000
- declare const RunStateSchema$1: z.ZodObject<{
1001
- runId: z.ZodString;
1002
- mode: z.ZodString;
1003
- procedure: z.ZodString;
1004
- repo: z.ZodString;
1005
- task: z.ZodOptional<z.ZodString>;
1006
- state: z.ZodString;
1007
- createdAt: z.ZodString;
1008
- updatedAt: z.ZodString;
1009
- completedAt: z.ZodOptional<z.ZodString>;
1010
- completedSteps: z.ZodArray<z.ZodString>;
1011
- currentStep: z.ZodNullable<z.ZodString>;
1012
- params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1013
- metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1014
- persona: z.ZodOptional<z.ZodObject<{
1015
- mode: z.ZodString;
1016
- forbidden: z.ZodArray<z.ZodString>;
1017
- completionGates: z.ZodArray<z.ZodString>;
1018
- decisionStyle: z.ZodOptional<z.ZodObject<{
1019
- preferSmallDiffs: z.ZodOptional<z.ZodBoolean>;
1020
- requireRationaleForSkips: z.ZodOptional<z.ZodBoolean>;
1021
- escalateSecurityFindings: z.ZodOptional<z.ZodBoolean>;
1022
- }, z.core.$strip>>;
1023
- outputFormat: z.ZodOptional<z.ZodObject<{
1024
- severityLevels: z.ZodOptional<z.ZodArray<z.ZodString>>;
1025
- requireSeverityOnFindings: z.ZodOptional<z.ZodBoolean>;
1026
- }, z.core.$strip>>;
1027
- }, z.core.$strip>>;
1028
- }, z.core.$strip>;
1029
- type RunState$1 = z.infer<typeof RunStateSchema$1>;
1030
- /**
1031
- * Parameters for creating a new run
1032
- */
1033
- interface CreateRunParams {
1034
- /** Persona mode, e.g. "senior-dev", "eager-pm" */
1035
- mode: string;
1036
- /** Procedure being executed, e.g. "merge-weave-main", "pr-review" */
1037
- procedure: string;
1038
- /** Repository identifier (owner/repo or path) */
1039
- repo: string;
1040
- /** Optional task description */
1041
- task?: string;
1042
- /** Initial state in procedure state machine */
1043
- initialState?: string;
1044
- /** Runtime parameters for the run */
1045
- params?: Record<string, unknown>;
1046
- /** Additional metadata for the run */
1047
- metadata?: Record<string, unknown>;
1048
- /** Persona snapshot to freeze for the run */
1049
- persona?: z.infer<typeof PersonaSnapshotSchema>;
1050
- }
1051
- /**
1052
- * Filter options for listing runs
1053
- */
1054
- interface RunFilter {
1055
- /** Filter by state */
1056
- state?: string;
1057
- /** Filter by procedure */
1058
- procedure?: string;
1059
- /** Filter by mode */
1060
- mode?: string;
1061
- /** Filter by creation date (ISO 8601 timestamp) - runs created after this date */
1062
- since?: string;
1063
- /** Filter by creation date (ISO 8601 timestamp) - runs created before this date */
1064
- until?: string;
1065
- /** Maximum number of runs to return */
1066
- limit?: number;
1067
- }
1068
- /**
1069
- * Input parameters for starting a run (MCP tool)
1070
- */
1071
- declare const StartRunInputSchema: z.ZodObject<{
1072
- mode: z.ZodString;
1073
- procedure: z.ZodString;
1074
- repo: z.ZodString;
1075
- task: z.ZodOptional<z.ZodString>;
1076
- params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1077
- }, z.core.$strip>;
1078
- type StartRunInput = z.infer<typeof StartRunInputSchema>;
1079
- /**
1080
- * Input for getStatus (MCP tool)
1081
- */
1082
- declare const GetStatusInputSchema: z.ZodObject<{
1083
- runId: z.ZodString;
1084
- }, z.core.$strip>;
1085
- type GetStatusInput = z.infer<typeof GetStatusInputSchema>;
1086
- /**
1087
- * RunStateFile - Lenient type for testing and backwards compatibility
1088
- *
1089
- * This is a partial RunState that allows optional fields like completedSteps.
1090
- * Used primarily for test fixtures and backwards compatibility with LR-060 tests.
1091
- */
1092
- interface RunStateFile {
1093
- runId: string;
1094
- mode: string;
1095
- procedure: string;
1096
- repo: string;
1097
- state: string;
1098
- createdAt: string;
1099
- updatedAt: string;
1100
- task?: string;
1101
- completedAt?: string;
1102
- completedSteps?: string[];
1103
- currentStep?: string | null;
1104
- params?: Record<string, unknown>;
1105
- metadata?: Record<string, unknown>;
1106
- /** Optional blockers for status display */
1107
- blockers?: string[];
1108
- /** Optional progress info for status display */
1109
- progress?: {
1110
- current: number;
1111
- total: number;
1112
- phase?: string;
1113
- };
1114
- /** Optional context for status display */
1115
- context?: Record<string, unknown>;
1116
- }
1117
-
1118
- /**
1119
- * Status builder for constructing StatusResponse from run state
1120
- *
1121
- * Derives nextOptions from current state and builds rich context for model orientation.
1122
- */
1123
-
1124
- /**
1125
- * Input type for statusBuilder - accepts both RunState and lenient RunStateFile
1126
- */
1127
- type StatusBuilderInput = RunState$1 | RunStateFile;
1128
- /**
1129
- * Build a StatusResponse from run state
1130
- */
1131
- declare function buildStatusResponse(runState: StatusBuilderInput, options?: {
1132
- baseDir?: string;
1133
- }): StatusResponse;
1134
-
1135
- /**
1136
- * Artifact Discovery and Metadata
1137
- *
1138
- * Provides functionality to list and inspect artifacts and receipts for a run.
1139
- * Artifacts include plan files, decision logs, failure logs, gate reports, and reports.
1140
- */
1141
-
1142
- /**
1143
- * Input schema for listArtifacts
1144
- */
1145
- declare const ListArtifactsInputSchema: z.ZodObject<{
1146
- runId: z.ZodString;
1147
- type: z.ZodOptional<z.ZodEnum<{
1148
- gate: "gate";
1149
- failure: "failure";
1150
- log: "log";
1151
- decision: "decision";
1152
- report: "report";
1153
- plan: "plan";
1154
- }>>;
1155
- path: z.ZodOptional<z.ZodString>;
1156
- latestOnly: z.ZodOptional<z.ZodBoolean>;
1157
- inline: z.ZodOptional<z.ZodBoolean>;
1158
- }, z.core.$strip>;
1159
- type ListArtifactsInput = z.infer<typeof ListArtifactsInputSchema>;
1160
- /**
1161
- * Output schema for listArtifacts
1162
- */
1163
- declare const ListArtifactsOutputSchema: z.ZodObject<{
1164
- artifacts: z.ZodArray<z.ZodObject<{
1165
- path: z.ZodString;
1166
- type: z.ZodEnum<{
1167
- gate: "gate";
1168
- failure: "failure";
1169
- log: "log";
1170
- decision: "decision";
1171
- report: "report";
1172
- plan: "plan";
1173
- }>;
1174
- size: z.ZodNumber;
1175
- createdAt: z.ZodString;
1176
- modifiedAt: z.ZodString;
1177
- content: z.ZodOptional<z.ZodString>;
1178
- }, z.core.$strip>>;
1179
- totalCount: z.ZodNumber;
1180
- }, z.core.$strip>;
1181
- type ListArtifactsOutput = z.infer<typeof ListArtifactsOutputSchema>;
1182
-
1183
- /**
1184
- * RunStore — Persistence Contract for Run Lifecycle
1185
- *
1186
- * This module defines the canonical interfaces and Zod schemas for run lifecycle persistence.
1187
- * It is the interface layer for the Store Layer 1.0.0 persistence abstraction.
1188
- *
1189
- * Key Design Decisions:
1190
- * - ID Naming: `runId`, `stepId`, `receiptId` (not generic `id`)
1191
- * - ID Ownership: Caller (orchestration) generates IDs, store is dumb persistence
1192
- * - Timestamps: UTC ISO 8601 strings (YYYY-MM-DDTHH:mm:ss.sssZ) for serialization
1193
- * - NDJSON Coexistence: RunStore does NOT replace audit logs; they remain human-friendly traces
1194
- *
1195
- * @module store/run-store
1196
- */
1197
-
1198
- /**
1199
- * Run state machine states.
1200
- *
1201
- * @example
1202
- * ```typescript
1203
- * const state: RunState = "running";
1204
- * ```
1205
- */
1206
- declare const RunStateSchema: z.ZodEnum<{
1207
- completed: "completed";
1208
- failed: "failed";
1209
- pending: "pending";
1210
- aborted: "aborted";
1211
- running: "running";
1212
- }>;
1213
- type RunState = z.infer<typeof RunStateSchema>;
1214
- /**
1215
- * A single run record.
1216
- *
1217
- * ID Ownership: `runId` MUST be pre-generated by the caller (orchestration layer).
1218
- * The same runId appears in artifacts, NDJSON logs, and MCP status responses.
1219
- * The store is responsible for persistence, not identity generation.
1220
- *
1221
- * Timestamps: All timestamps MUST be UTC ISO 8601 strings (YYYY-MM-DDTHH:mm:ss.sssZ).
1222
- *
1223
- * @example
1224
- * ```typescript
1225
- * const run: RunRecord = {
1226
- * runId: "01HXYZ123ABC",
1227
- * planHash: "sha256:abc123...",
1228
- * state: "running",
1229
- * startedAt: "2024-01-15T10:30:00.000Z",
1230
- * metadata: { prNumber: 42 }
1231
- * };
1232
- * ```
1233
- */
1234
- declare const RunRecordSchema: z.ZodObject<{
1235
- runId: z.ZodString;
1236
- planHash: z.ZodString;
1237
- state: z.ZodEnum<{
1238
- completed: "completed";
1239
- failed: "failed";
1240
- pending: "pending";
1241
- aborted: "aborted";
1242
- running: "running";
1243
- }>;
1244
- startedAt: z.ZodString;
1245
- completedAt: z.ZodOptional<z.ZodString>;
1246
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1247
- }, z.core.$strip>;
1248
- type RunRecord = z.infer<typeof RunRecordSchema>;
1249
- /**
1250
- * A single step within a run.
1251
- *
1252
- * Timestamps: MUST be UTC ISO 8601 strings.
1253
- *
1254
- * @example
1255
- * ```typescript
1256
- * const step: StepOutcome = {
1257
- * stepId: "step-001",
1258
- * runId: "01HXYZ123ABC",
1259
- * nodeId: "pr-42",
1260
- * gateName: "lint",
1261
- * status: "pass",
1262
- * durationMs: 1234,
1263
- * timestamp: "2024-01-15T10:30:05.000Z"
1264
- * };
1265
- * ```
1266
- */
1267
- declare const StepOutcomeSchema: z.ZodObject<{
1268
- stepId: z.ZodString;
1269
- runId: z.ZodString;
1270
- nodeId: z.ZodString;
1271
- gateName: z.ZodString;
1272
- status: z.ZodEnum<{
1273
- pass: "pass";
1274
- fail: "fail";
1275
- blocked: "blocked";
1276
- skipped: "skipped";
1277
- }>;
1278
- durationMs: z.ZodNumber;
1279
- logs: z.ZodOptional<z.ZodString>;
1280
- artifacts: z.ZodOptional<z.ZodArray<z.ZodString>>;
1281
- timestamp: z.ZodString;
1282
- }, z.core.$strip>;
1283
- type StepOutcome = z.infer<typeof StepOutcomeSchema>;
1284
- /**
1285
- * A receipt recording scope/risk changes requiring human approval.
1286
- *
1287
- * Timestamps: MUST be UTC ISO 8601 strings.
1288
- *
1289
- * @example
1290
- * ```typescript
1291
- * const receipt: Receipt = {
1292
- * receiptId: "receipt-001",
1293
- * runId: "01HXYZ123ABC",
1294
- * reason: "Scope expanded beyond initial plan",
1295
- * approver: "alice@example.com",
1296
- * timestamp: "2024-01-15T10:31:00.000Z"
1297
- * };
1298
- * ```
1299
- */
1300
- declare const ReceiptSchema: z.ZodObject<{
1301
- receiptId: z.ZodString;
1302
- runId: z.ZodString;
1303
- reason: z.ZodString;
1304
- approver: z.ZodOptional<z.ZodString>;
1305
- timestamp: z.ZodString;
1306
- }, z.core.$strip>;
1307
- type Receipt = z.infer<typeof ReceiptSchema>;
1308
- /**
1309
- * Options for listing runs.
1310
- */
1311
- interface ListRunsOptions {
1312
- /** Maximum number of runs to return. */
1313
- limit?: number;
1314
- /** Number of runs to skip (for pagination). */
1315
- offset?: number;
1316
- /** Filter by run state. */
1317
- state?: RunState;
1318
- }
1319
- /**
1320
- * RunStore — persistence contract for run lifecycle.
1321
- *
1322
- * Default: InMemoryRunStore (CLI).
1323
- * Future: SqliteRunStore, PostgresRunStore.
1324
- *
1325
- * Note: RunStore provides structured access to runs/steps/receipts.
1326
- * It does NOT replace NDJSON audit logs — those remain the human-friendly trace.
1327
- *
1328
- * @example
1329
- * ```typescript
1330
- * // Create a run
1331
- * await store.createRun({
1332
- * runId: "run-001",
1333
- * planHash: "sha256:abc123",
1334
- * state: "pending",
1335
- * startedAt: new Date().toISOString()
1336
- * });
1337
- *
1338
- * // Update run state
1339
- * await store.updateRun("run-001", { state: "running" });
1340
- *
1341
- * // Append step outcomes
1342
- * await store.appendStep({
1343
- * stepId: "step-001",
1344
- * runId: "run-001",
1345
- * nodeId: "pr-42",
1346
- * gateName: "lint",
1347
- * status: "pass",
1348
- * durationMs: 1234,
1349
- * timestamp: new Date().toISOString()
1350
- * });
1351
- *
1352
- * // Get run details
1353
- * const run = await store.getRun("run-001");
1354
- *
1355
- * // Clean up
1356
- * await store.close();
1357
- * ```
1358
- */
1359
- interface RunStore {
1360
- /**
1361
- * Create a new run record.
1362
- *
1363
- * @param run - The run record to create (runId must be pre-generated by caller)
1364
- * @throws If run with same runId already exists
1365
- */
1366
- createRun(run: RunRecord): Promise<void>;
1367
- /**
1368
- * Update an existing run record.
1369
- *
1370
- * @param runId - The run identifier to update
1371
- * @param updates - Partial updates to apply (runId cannot be changed)
1372
- * @throws If run with given runId does not exist
1373
- */
1374
- updateRun(runId: string, updates: Partial<Omit<RunRecord, "runId">>): Promise<void>;
1375
- /**
1376
- * Get a run record by ID.
1377
- *
1378
- * @param runId - The run identifier
1379
- * @returns The run record, or null if not found
1380
- */
1381
- getRun(runId: string): Promise<RunRecord | null>;
1382
- /**
1383
- * List run records with optional filtering and pagination.
1384
- *
1385
- * @param options - Optional filtering and pagination options
1386
- * @returns Array of run records matching the criteria
1387
- */
1388
- listRuns(options?: ListRunsOptions): Promise<RunRecord[]>;
1389
- /**
1390
- * Append a step outcome to a run.
1391
- *
1392
- * @param step - The step outcome to append
1393
- */
1394
- appendStep(step: StepOutcome): Promise<void>;
1395
- /**
1396
- * Get all step outcomes for a run.
1397
- *
1398
- * @param runId - The run identifier
1399
- * @returns Array of step outcomes for the run
1400
- */
1401
- getStepsForRun(runId: string): Promise<StepOutcome[]>;
1402
- /**
1403
- * Save a receipt for scope/risk escalation.
1404
- *
1405
- * @param receipt - The receipt to save
1406
- */
1407
- saveReceipt(receipt: Receipt): Promise<void>;
1408
- /**
1409
- * Get all receipts for a run.
1410
- *
1411
- * @param runId - The run identifier
1412
- * @returns Array of receipts for the run
1413
- */
1414
- getReceiptsForRun(runId: string): Promise<Receipt[]>;
1415
- /**
1416
- * Get the count of runs, optionally filtered by state.
1417
- *
1418
- * @param state - Optional state filter
1419
- * @returns Number of runs matching the criteria
1420
- */
1421
- getRunCount(state?: RunState): Promise<number>;
1422
- /**
1423
- * Close the store and release any resources.
1424
- * Should be called when the store is no longer needed.
1425
- */
1426
- close(): Promise<void>;
1427
- }
1428
-
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
- /**
1526
- * Run Lifecycle Manager
1527
- *
1528
- * Core infrastructure for creating, tracking, and persisting run state
1529
- * across the tool-grounded lifecycle.
1530
- *
1531
- * Supports dual-write mode: persists to both NDJSON files (backward compatible)
1532
- * and optional RunStore for structured queries.
1533
- */
1534
-
1535
- /**
1536
- * Options for creating a RunManager
1537
- */
1538
- interface RunManagerOptions {
1539
- /**
1540
- * Base directory for run storage (defaults to cwd)
1541
- */
1542
- baseDir?: string;
1543
- /**
1544
- * Optional RunStore for structured persistence.
1545
- * If provided, step outcomes and receipts will be persisted to this store.
1546
- * NDJSON coexistence is maintained regardless.
1547
- */
1548
- runStore?: RunStore;
1549
- }
1550
- /**
1551
- * RunManager - Core run lifecycle management
1552
- *
1553
- * Handles creation, retrieval, updates, and cleanup of run state.
1554
- * Supports dual-write mode: NDJSON files for backward compatibility,
1555
- * plus optional RunStore for structured queries.
1556
- */
1557
- declare class RunManager {
1558
- private baseDir;
1559
- private runStore;
1560
- /**
1561
- * Create a new RunManager
1562
- *
1563
- * @param baseDirOrOptions - Base directory string (deprecated) or options object
1564
- */
1565
- constructor(baseDirOrOptions?: string | RunManagerOptions);
1566
- /**
1567
- * Get the runs directory path
1568
- *
1569
- * @returns Path to the runs directory
1570
- */
1571
- getRunsDir(): string;
1572
- /**
1573
- * Create a new run
1574
- *
1575
- * Generates a unique runId (ULID), initializes state, and persists to disk.
1576
- *
1577
- * @param params - Run creation parameters
1578
- * @returns The created RunState
1579
- */
1580
- createRun(params: CreateRunParams): Promise<RunState$1>;
1581
- /**
1582
- * Get a run by ID
1583
- *
1584
- * @param runId - The run identifier
1585
- * @returns RunState if found, null if not found
1586
- */
1587
- getRun(runId: string): Promise<RunState$1 | null>;
1588
- /**
1589
- * List runs with optional filtering
1590
- *
1591
- * Note: Filters are applied to the index first, so only matching entries
1592
- * are loaded. Use the `limit` filter to control the number of runs loaded.
1593
- *
1594
- * @param filter - Optional filter criteria
1595
- * @returns Array of RunState objects matching the filter
1596
- */
1597
- listRunStates(filter?: RunFilter): Promise<RunState$1[]>;
1598
- /**
1599
- * List run IDs (synchronous)
1600
- *
1601
- * Returns sorted list of run IDs from the index.
1602
- *
1603
- * @returns Sorted array of run IDs
1604
- */
1605
- listRuns(): string[];
1606
- /**
1607
- * Update a run
1608
- *
1609
- * Applies updates atomically and persists changes.
1610
- *
1611
- * @param runId - The run identifier
1612
- * @param updates - Partial updates to apply
1613
- * @returns Updated RunState
1614
- * @throws Error if run not found
1615
- */
1616
- updateRun(runId: string, updates: Partial<RunState$1>): Promise<RunState$1>;
1617
- /**
1618
- * Transition run state
1619
- *
1620
- * Applies a state transition event and persists the change.
1621
- * Currently does not validate against a state machine - this is
1622
- * intentionally flexible for different procedures.
1623
- *
1624
- * @param runId - The run identifier
1625
- * @param newState - The new state to transition to
1626
- * @returns Updated RunState
1627
- * @throws AXErrorException if run not found
1628
- */
1629
- transitionState(runId: string, newState: string): Promise<RunState$1>;
1630
- /**
1631
- * Mark a step as complete
1632
- *
1633
- * @param runId - The run identifier
1634
- * @param stepId - The step to mark as complete
1635
- * @param nextStep - The next step to set as current (optional)
1636
- * @returns Updated RunState
1637
- */
1638
- completeStep(runId: string, stepId: string, nextStep?: string | null): Promise<RunState$1>;
1639
- /**
1640
- * Log a decision to the run's decision log
1641
- *
1642
- * @param runId - The run identifier
1643
- * @param decision - The decision to log
1644
- */
1645
- logDecision(runId: string, decision: Record<string, unknown>): Promise<void>;
1646
- /**
1647
- * Log a failure to the run's failure log
1648
- *
1649
- * @param runId - The run identifier
1650
- * @param failure - The failure to log
1651
- */
1652
- logFailure(runId: string, failure: Record<string, unknown>): Promise<void>;
1653
- /**
1654
- * Get the RunStore instance (if configured)
1655
- *
1656
- * @returns The RunStore instance, or undefined if not configured
1657
- */
1658
- getRunStore(): RunStore | undefined;
1659
- /**
1660
- * Record a step outcome to the RunStore.
1661
- *
1662
- * Step outcomes are persisted to both:
1663
- * 1. NDJSON log (backward compatible)
1664
- * 2. RunStore (if configured)
1665
- *
1666
- * @param outcome - The step outcome to record
1667
- *
1668
- * @example
1669
- * ```typescript
1670
- * await manager.recordStepOutcome({
1671
- * stepId: "step-001",
1672
- * runId: "run-001",
1673
- * nodeId: "pr-42",
1674
- * gateName: "lint",
1675
- * status: "pass",
1676
- * durationMs: 1234,
1677
- * timestamp: new Date().toISOString()
1678
- * });
1679
- * ```
1680
- */
1681
- recordStepOutcome(outcome: StepOutcome): Promise<void>;
1682
- /**
1683
- * Record a receipt (scope/risk escalation) to the RunStore.
1684
- *
1685
- * Receipts are persisted to both:
1686
- * 1. NDJSON log (backward compatible)
1687
- * 2. RunStore (if configured)
1688
- *
1689
- * @param receipt - The receipt to record
1690
- *
1691
- * @example
1692
- * ```typescript
1693
- * await manager.recordReceipt({
1694
- * receiptId: "receipt-001",
1695
- * runId: "run-001",
1696
- * reason: "Scope expanded beyond initial plan",
1697
- * approver: "alice@example.com",
1698
- * timestamp: new Date().toISOString()
1699
- * });
1700
- * ```
1701
- */
1702
- recordReceipt(receipt: Receipt): Promise<void>;
1703
- /**
1704
- * Get step outcomes for a run.
1705
- *
1706
- * Queries the RunStore if configured, otherwise returns from NDJSON logs.
1707
- *
1708
- * @param runId - The run identifier
1709
- * @returns Array of step outcomes for the run
1710
- */
1711
- getStepOutcomes(runId: string): Promise<StepOutcome[]>;
1712
- /**
1713
- * Get receipts for a run.
1714
- *
1715
- * Queries the RunStore if configured, otherwise returns from NDJSON logs.
1716
- *
1717
- * @param runId - The run identifier
1718
- * @returns Array of receipts for the run
1719
- */
1720
- getReceipts(runId: string): Promise<Receipt[]>;
1721
- /**
1722
- * Get decisions for a run
1723
- *
1724
- * @param runId - The run identifier
1725
- * @returns Array of decision log entries
1726
- */
1727
- getDecisions(runId: string): Promise<Array<Record<string, unknown>>>;
1728
- /**
1729
- * Get failures for a run
1730
- *
1731
- * @param runId - The run identifier
1732
- * @returns Array of failure log entries
1733
- */
1734
- getFailures(runId: string): Promise<Array<Record<string, unknown>>>;
1735
- /**
1736
- * Archive a run (mark as archived in metadata)
1737
- *
1738
- * @param runId - The run identifier
1739
- */
1740
- archiveRun(runId: string): Promise<void>;
1741
- /**
1742
- * Delete a run and all associated data (sync version)
1743
- *
1744
- * @param runId - The run identifier
1745
- * @returns true if run was deleted, false if not found
1746
- */
1747
- deleteRun(runId: string): boolean;
1748
- /**
1749
- * Delete a run and all associated data (async version)
1750
- *
1751
- * @param runId - The run identifier
1752
- */
1753
- deleteRunAsync(runId: string): Promise<void>;
1754
- /**
1755
- * Start a new run (MCP tool interface)
1756
- *
1757
- * Convenience wrapper around createRun for MCP tool usage.
1758
- * Maps StartRunInput to CreateRunParams and returns a structured result.
1759
- *
1760
- * @param input - MCP tool input for starting a run
1761
- * @returns Result object with runId, status, message, and initialStatus
1762
- */
1763
- startRun(input: StartRunInput): {
1764
- runId: string;
1765
- status: string;
1766
- message: string;
1767
- initialStatus: ReturnType<typeof buildStatusResponse>;
1768
- };
1769
- /**
1770
- * Check if a run exists
1771
- *
1772
- * @param runId - The run identifier
1773
- * @returns true if run exists, false otherwise
1774
- */
1775
- runExists(runId: string): boolean;
1776
- /**
1777
- * Load run state (synchronous)
1778
- *
1779
- * @param runId - The run identifier
1780
- * @returns RunState
1781
- * @throws Error if run not found
1782
- */
1783
- loadRunState(runId: string): RunState$1;
1784
- /**
1785
- * Update run state (synchronous)
1786
- *
1787
- * @param runId - The run identifier
1788
- * @param updates - Partial updates to apply
1789
- * @returns Updated RunState
1790
- * @throws Error if run not found
1791
- */
1792
- updateRunState(runId: string, updates: Partial<RunState$1>): RunState$1;
1793
- /**
1794
- * Get status of a run (MCP tool interface)
1795
- *
1796
- * Convenience wrapper around getRun for MCP tool usage.
1797
- * Returns a structured status response.
1798
- *
1799
- * @param input - MCP tool input for getting status
1800
- * @returns Status response object
1801
- * @throws RunNotFoundError if run not found
1802
- */
1803
- getStatus(input: GetStatusInput): ReturnType<typeof buildStatusResponse>;
1804
- /**
1805
- * List artifacts for a run (MCP tool interface)
1806
- *
1807
- * Returns metadata for all artifacts in a run directory,
1808
- * with optional filtering by type, path pattern, and recency.
1809
- *
1810
- * @param input - MCP tool input for listing artifacts
1811
- * @returns ListArtifactsOutput with artifacts array and total count
1812
- * @throws RunNotFoundError if run not found
1813
- */
1814
- listArtifacts(input: ListArtifactsInput): ListArtifactsOutput;
1815
- /**
1816
- * Complete a run and emit a Frame (AX-005)
1817
- *
1818
- * Transitions the run to a terminal state and emits an execution Frame
1819
- * capturing what was attempted, scope touched, outcome, and next steps.
1820
- * The Frame is persisted to .lexrunner/frames/ for audit trail.
1821
- *
1822
- * @param runId - The run identifier
1823
- * @param outcome - The outcome of the run (success/failure/partial)
1824
- * @param nextActions - Recommended next actions
1825
- * @param options - Additional options
1826
- * @returns Updated RunState and FrameEmitResult
1827
- */
1828
- completeRunWithFrame(runId: string, outcome: FrameOutcome, nextActions: string[], options?: {
1829
- artifacts?: string[];
1830
- error?: string;
1831
- planHash?: string;
1832
- }): Promise<{
1833
- runState: RunState$1;
1834
- frameResult: FrameEmitResult;
1835
- }>;
1836
- /**
1837
- * Synchronous version of createRun for MCP compatibility
1838
- *
1839
- * @param params - Run creation parameters
1840
- * @returns The created RunState
1841
- */
1842
- private createRunSync;
1843
- /**
1844
- * Create an index entry from a run state
1845
- */
1846
- private createIndexEntry;
1847
- /**
1848
- * Check if a state is terminal
1849
- */
1850
- private isTerminalState;
1851
- }
1852
- /**
1853
- * Create a new RunManager instance
1854
- *
1855
- * @param baseDirOrOptions - Base directory string or options object
1856
- * @returns A new RunManager instance
1857
- *
1858
- * @example
1859
- * ```typescript
1860
- * // Legacy: string baseDir
1861
- * const manager = createRunManager("/path/to/project");
1862
- *
1863
- * // New: options object with RunStore
1864
- * const store = new InMemoryRunStore();
1865
- * const manager = createRunManager({ baseDir: "/path/to/project", runStore: store });
1866
- * ```
1867
- */
1868
- declare function createRunManager(baseDirOrOptions?: string | RunManagerOptions): RunManager;
1869
-
1870
- /**
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
1880
- */
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;
1897
- }
1898
- interface GitHubConfig {
1899
- token?: string;
1900
- owner: string;
1901
- repo: string;
1902
- }
1903
- /**
1904
- * GitHub API client for PR operations with error recovery
1905
- */
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;
1946
- }>;
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;
1977
- }>;
1978
- /**
1979
- * Get a git reference (branch/tag SHA)
1980
- */
1981
- getRef(ref: string): Promise<{
1982
- object: {
1983
- sha: string;
1984
- };
1985
- }>;
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;
1994
- }>;
1995
- }>;
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;
2004
- }>>;
2005
- /**
2006
- * Compare two commits
2007
- */
2008
- compare(base: string, head: string): Promise<{
2009
- merge_base_commit?: {
2010
- sha: string;
2011
- };
2012
- }>;
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[];
2037
- }>;
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 {
2055
- number: number;
2056
- title: string;
2057
- body: string | null;
2058
- head: {
2059
- ref: string;
2060
- sha: string;
2061
- };
2062
- base: {
2063
- ref: string;
2064
- sha: string;
2065
- };
2066
- state: "open" | "closed" | "merged";
2067
- labels: Array<{
2068
- name: string;
2069
- color: string;
2070
- }>;
2071
- draft: boolean;
2072
- mergeable?: boolean | null;
2073
- user: {
2074
- login: string;
2075
- };
2076
- createdAt: string;
2077
- updatedAt: string;
2078
- }
2079
- interface PullRequestDetails extends PullRequest {
2080
- dependencies: string[];
2081
- tags: string[];
2082
- requiredGates: string[];
2083
- metadata?: {
2084
- priority?: string;
2085
- labels?: string[];
2086
- [key: string]: any;
2087
- };
2088
- gateOverrides?: {
2089
- skip?: string[];
2090
- required?: string[];
2091
- };
2092
- }
2093
- interface PRQueryOptions {
2094
- state?: "open" | "closed" | "all";
2095
- labels?: string[];
2096
- query?: string;
2097
- base?: string;
2098
- head?: string;
2099
- sort?: "created" | "updated" | "popularity" | "long-running";
2100
- direction?: "asc" | "desc";
2101
- per_page?: number;
2102
- page?: number;
2103
- }
2104
- /**
2105
- * GitHub Issue representation
2106
- */
2107
- interface GitHubIssue {
2108
- number: number;
2109
- title: string;
2110
- body: string | null;
2111
- state: "open" | "closed";
2112
- labels: Array<{
2113
- name: string;
2114
- color: string;
2115
- }>;
2116
- user: {
2117
- login: string;
2118
- };
2119
- assignees: Array<{
2120
- login: string;
2121
- }>;
2122
- createdAt: string;
2123
- updatedAt: string;
2124
- }
2125
- /**
2126
- * Query options for listing issues
2127
- */
2128
- interface IssueQueryOptions {
2129
- state?: "open" | "closed" | "all";
2130
- labels?: string[];
2131
- assignee?: string;
2132
- creator?: string;
2133
- mentioned?: string;
2134
- sort?: "created" | "updated" | "comments";
2135
- direction?: "asc" | "desc";
2136
- per_page?: number;
2137
- page?: number;
2138
- }
2139
- /**
2140
- * GitHub Check Run representation
2141
- */
2142
- interface GitHubCheckRun {
2143
- id: number;
2144
- name: string;
2145
- status: "queued" | "in_progress" | "completed";
2146
- conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
2147
- started_at: string | null;
2148
- completed_at: string | null;
2149
- html_url: string;
2150
- app: {
2151
- name: string;
2152
- };
2153
- }
2154
- /**
2155
- * Options for querying check runs
2156
- */
2157
- interface CheckRunsOptions {
2158
- ref?: string;
2159
- check_name?: string;
2160
- status?: "queued" | "in_progress" | "completed";
2161
- filter?: "latest" | "all";
2162
- }
2163
-
2164
- /**
2165
- * GitHub API client for PR discovery and metadata extraction
2166
- * Implements the GitHubClient interface with authentication and rate limiting
2167
- */
2168
-
2169
- interface GitHubClient {
2170
- listOpenPRs(options?: PRQueryOptions): Promise<PullRequest[]>;
2171
- getPRDetails(number: number): Promise<PullRequestDetails>;
2172
- getPRDependencies(pr: PullRequest): Promise<string[]>;
2173
- validateRepository(): Promise<RepositoryInfo>;
2174
- listIssues(options?: IssueQueryOptions): Promise<GitHubIssue[]>;
2175
- getOctokit(): any;
2176
- getOwner(): string;
2177
- getRepo(): string;
2178
- getPRDiff(prNumber: number): Promise<string>;
2179
- getPRFiles(prNumber: number): Promise<Array<{
2180
- path: string;
2181
- content: string;
2182
- }>>;
2183
- getCheckRuns(ref: string, options?: CheckRunsOptions): Promise<GitHubCheckRun[]>;
2184
- updatePullRequestBranch(prNumber: number): Promise<void>;
2185
- }
2186
- /**
2187
- * Factory function to create GitHub client with auto-detection of repository info
2188
- */
2189
- declare function createGitHubClient(options?: {
2190
- token?: string;
2191
- owner?: string;
2192
- repo?: string;
2193
- octokit?: Octokit;
2194
- }): Promise<GitHubClient>;
2195
-
2196
- /**
2197
- * Types for file-change analysis and intersection detection
2198
- */
2199
- /**
2200
- * Represents a file change in a PR
2201
- */
2202
- interface FileChange {
2203
- filename: string;
2204
- status: "added" | "modified" | "removed" | "renamed";
2205
- additions: number;
2206
- deletions: number;
2207
- changes: number;
2208
- patch?: string;
2209
- previousFilename?: string;
2210
- }
2211
- /**
2212
- * Represents an intersection between PRs on specific files
2213
- */
2214
- interface FileIntersection {
2215
- prs: string[];
2216
- files: string[];
2217
- confidence: number;
2218
- }
2219
- /**
2220
- * Heuristic types for dependency detection
2221
- */
2222
- type HeuristicType = "shared-files" | "directory-proximity" | "test-overlap";
2223
- /**
2224
- * Dependency suggestion based on file analysis
2225
- */
2226
- interface DependencySuggestion {
2227
- from: string;
2228
- to: string;
2229
- reason: string;
2230
- confidence: number;
2231
- sharedFiles: string[];
2232
- heuristic?: HeuristicType;
2233
- }
2234
- /**
2235
- * Conflict prediction based on file overlap
2236
- */
2237
- interface ConflictPrediction {
2238
- prs: string[];
2239
- files: string[];
2240
- severity: "low" | "medium" | "high";
2241
- reason: string;
2242
- }
2243
- /**
2244
- * Complete file analysis result
2245
- */
2246
- interface FileAnalysisResult {
2247
- fileIntersections: FileIntersection[];
2248
- suggestions: DependencySuggestion[];
2249
- conflicts: ConflictPrediction[];
2250
- }
2251
-
2252
- /**
2253
- * File-Change Analysis Engine & Intersection Detection
2254
- * Analyzes file changes across PRs to detect implicit dependencies and suggest merge order
2255
- */
2256
-
2257
- /**
2258
- * File analyzer for detecting PR dependencies based on file changes
2259
- */
2260
- declare class FileAnalyzer {
2261
- private cache;
2262
- private octokit;
2263
- private owner;
2264
- private repo;
2265
- constructor(octokit: Octokit, owner: string, repo: string);
2266
- /**
2267
- * Fetch file changes for a specific PR
2268
- */
2269
- getPRFileChanges(prNumber: number, sha?: string): Promise<FileChange[]>;
2270
- /**
2271
- * Build file intersection matrix for multiple PRs
2272
- */
2273
- buildIntersectionMatrix(prs: Array<{
2274
- number: number;
2275
- name: string;
2276
- sha?: string;
2277
- }>): Promise<FileIntersection[]>;
2278
- /**
2279
- * Find files that are modified in both PRs
2280
- */
2281
- private findSharedFiles;
2282
- /**
2283
- * Calculate confidence level for intersection based on change types
2284
- */
2285
- private calculateIntersectionConfidence;
2286
- /**
2287
- * Predict potential conflicts based on file overlaps
2288
- */
2289
- predictConflicts(prs: Array<{
2290
- number: number;
2291
- name: string;
2292
- sha?: string;
2293
- }>): Promise<ConflictPrediction[]>;
2294
- /**
2295
- * Assess severity of potential conflict
2296
- */
2297
- private assessConflictSeverity;
2298
- /**
2299
- * Generate human-readable conflict reason
2300
- */
2301
- private generateConflictReason;
2302
- /**
2303
- * Generate dependency suggestions based on file analysis
2304
- */
2305
- suggestDependencies(prs: Array<{
2306
- number: number;
2307
- name: string;
2308
- sha?: string;
2309
- }>): Promise<DependencySuggestion[]>;
2310
- /**
2311
- * Generate dependency suggestions using multiple heuristics
2312
- */
2313
- suggestDependenciesWithHeuristics(prs: Array<{
2314
- number: number;
2315
- name: string;
2316
- sha?: string;
2317
- }>): Promise<DependencySuggestion[]>;
2318
- /**
2319
- * Heuristic 1: Shared file modifications
2320
- */
2321
- private heuristicSharedFiles;
2322
- /**
2323
- * Heuristic 2: Directory proximity
2324
- * PRs modifying files in the same directory structure likely related
2325
- */
2326
- private heuristicDirectoryProximity;
2327
- /**
2328
- * Heuristic 3: Test overlap
2329
- * PRs that modify the same test files or test the same modules
2330
- */
2331
- private heuristicTestOverlap;
2332
- /**
2333
- * Extract directory path from filename
2334
- */
2335
- private getDirectoryPath;
2336
- /**
2337
- * Check if file is a test file
2338
- */
2339
- private isTestFile;
2340
- /**
2341
- * Extract module name from test file
2342
- */
2343
- private getTestedModule;
2344
- /**
2345
- * Perform complete file analysis on a set of PRs
2346
- */
2347
- analyzeFiles(prs: Array<{
2348
- number: number;
2349
- name: string;
2350
- sha?: string;
2351
- }>): Promise<FileAnalysisResult>;
2352
- /**
2353
- * Clear the cache
2354
- */
2355
- clearCache(): void;
2356
- /**
2357
- * Get cache statistics
2358
- */
2359
- getCacheStats(): {
2360
- size: number;
2361
- entries: string[];
2362
- };
2363
- }
2364
- /**
2365
- * Create a file analyzer for detecting implicit dependencies between PRs
2366
- *
2367
- * Factory function that creates a FileAnalyzer instance with caching,
2368
- * heuristic analysis, and conflict prediction capabilities. The analyzer
2369
- * uses multiple heuristics to suggest dependencies based on file changes.
2370
- *
2371
- * @param octokit - Authenticated Octokit instance for GitHub API access
2372
- * @param owner - Repository owner (username or organization)
2373
- * @param repo - Repository name
2374
- * @returns FileAnalyzer instance with methods for analyzing file changes
2375
- *
2376
- * @example Basic usage
2377
- * ```typescript
2378
- * import { createFileAnalyzer } from "./planner/fileAnalysis.js";
2379
- * import { Octokit } from "@octokit/rest";
2380
- *
2381
- * const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
2382
- * const analyzer = createFileAnalyzer(octokit, "owner", "repo");
2383
- *
2384
- * const analysis = await analyzer.analyzeFiles([
2385
- * { number: 101, name: "PR-101", sha: "abc123" },
2386
- * { number: 102, name: "PR-102", sha: "def456" }
2387
- * ]);
2388
- *
2389
- * console.log("File intersections:", analysis.fileIntersections);
2390
- * console.log("Suggestions:", analysis.suggestions);
2391
- * console.log("Conflicts:", analysis.conflicts);
2392
- * ```
2393
- *
2394
- * @example With caching
2395
- * ```typescript
2396
- * const analyzer = createFileAnalyzer(octokit, "owner", "repo");
2397
- *
2398
- * // First call fetches from GitHub API
2399
- * const analysis1 = await analyzer.analyzeFiles(prs);
2400
- *
2401
- * // Second call uses cache
2402
- * const analysis2 = await analyzer.analyzeFiles(prs);
2403
- *
2404
- * // Check cache statistics
2405
- * const stats = analyzer.getCacheStats();
2406
- * console.log(`Cache size: ${stats.size} entries`);
2407
- *
2408
- * // Clear cache if needed
2409
- * analyzer.clearCache();
2410
- * ```
2411
- *
2412
- * @example Dependency suggestions with heuristics
2413
- * ```typescript
2414
- * const analyzer = createFileAnalyzer(octokit, "owner", "repo");
2415
- *
2416
- * const prs = [
2417
- * { number: 100, name: "PR-100", body: "", sha: "abc" },
2418
- * { number: 101, name: "PR-101", body: "", sha: "def" },
2419
- * { number: 102, name: "PR-102", body: "", sha: "ghi" }
2420
- * ];
2421
- *
2422
- * const suggestions = await analyzer.suggestDependenciesWithHeuristics(prs);
2423
- *
2424
- * // Suggestions are sorted by confidence (high to low)
2425
- * suggestions.forEach(s => {
2426
- * console.log(`${s.from} → ${s.to}`);
2427
- * console.log(` Confidence: ${(s.confidence * 100).toFixed(0)}%`);
2428
- * console.log(` Heuristic: ${s.heuristic}`);
2429
- * console.log(` Reason: ${s.reason}`);
2430
- * console.log(` Shared files: ${s.sharedFiles.join(", ")}`);
2431
- * });
2432
- * ```
2433
- *
2434
- * @example Conflict prediction
2435
- * ```typescript
2436
- * const analyzer = createFileAnalyzer(octokit, "owner", "repo");
2437
- * const analysis = await analyzer.analyzeFiles(prs);
2438
- *
2439
- * const highSeverityConflicts = analysis.conflicts.filter(c => c.severity === "high");
2440
- *
2441
- * highSeverityConflicts.forEach(conflict => {
2442
- * console.error(`Conflict: ${conflict.prs.join(" vs ")}`);
2443
- * console.error(` Files: ${conflict.files.join(", ")}`);
2444
- * console.error(` Severity: ${conflict.severity}`);
2445
- * console.error(` Reason: ${conflict.reason}`);
2446
- * });
2447
- * ```
2448
- *
2449
- * @see {@link ../../../docs/diffgraph-planner.md#file-change-heuristics} for heuristic details
2450
- */
2451
- declare function createFileAnalyzer(octokit: Octokit, owner: string, repo: string): FileAnalyzer;
2452
-
2453
- /**
2454
- * GitHub-powered plan generation
2455
- * Auto-discovers PRs and generates plan.json from GitHub metadata
2456
- */
2457
-
2458
- interface GitHubPlanOptions {
2459
- query?: string;
2460
- labels?: string[];
2461
- excludePRs?: number[];
2462
- includeDrafts?: boolean;
2463
- target?: string;
2464
- policy?: {
2465
- requiredGates?: string[];
2466
- maxWorkers?: number;
2467
- };
2468
- tierOverrides?: TierOverride[];
2469
- }
2470
- /**
2471
- * Generate plan from GitHub PRs with automatic dependency resolution
2472
- */
2473
- declare function generatePlanFromGitHub(client: GitHubClient, options?: GitHubPlanOptions): Promise<Plan>;
2474
-
2475
- /**
2476
- * Multi-Repo Plan Generation
2477
- *
2478
- * Extends GitHub plan generation to support multiple repositories.
2479
- * This enables merge-weave operations across repos like lex, lexsona, and lexrunner.
2480
- *
2481
- * @module
2482
- */
2483
-
2484
- /**
2485
- * Repository target for multi-repo discovery
2486
- */
2487
- interface RepoTarget {
2488
- owner: string;
2489
- repo: string;
2490
- /** Priority for merge ordering (lower = earlier). Default: 1 */
2491
- priority?: number;
2492
- }
2493
- /**
2494
- * Options for multi-repo plan generation
2495
- */
2496
- interface MultiRepoPlanOptions {
2497
- query?: string;
2498
- labels?: string[];
2499
- excludePRs?: number[];
2500
- includeDrafts?: boolean;
2501
- target?: string;
2502
- policy?: {
2503
- requiredGates?: string[];
2504
- maxWorkers?: number;
2505
- };
2506
- tierOverrides?: TierOverride[];
2507
- /** GitHub token for authentication */
2508
- githubToken?: string;
2509
- }
2510
- /**
2511
- * Generate plan from multiple GitHub repositories
2512
- *
2513
- * This function:
2514
- * 1. Discovers PRs from each repository
2515
- * 2. Resolves cross-repo dependencies (owner/repo#123 format)
2516
- * 3. Combines into a single plan with proper ordering
2517
- *
2518
- * @example
2519
- * ```typescript
2520
- * const plan = await generateMultiRepoPlan([
2521
- * { owner: "Guffawaffle", repo: "lex", priority: 1 },
2522
- * { owner: "Guffawaffle", repo: "lexsona", priority: 2 },
2523
- * { owner: "Guffawaffle", repo: "lexrunner", priority: 3 },
2524
- * ], {
2525
- * labels: ["ready-to-merge"],
2526
- * policy: { requiredGates: ["lint", "test"] }
2527
- * });
2528
- * ```
2529
- */
2530
- declare function generateMultiRepoPlan(repos: RepoTarget[], options?: MultiRepoPlanOptions): Promise<Plan>;
2531
-
2532
- /**
2533
- * Git operations for merge pyramid execution
2534
- * Implements weave strategy and conflict detection
2535
- */
2536
-
2537
- interface MergeOperation {
2538
- item: PlanItem;
2539
- targetBranch: string;
2540
- strategy: "rebase-weave" | "merge-weave" | "squash-weave";
2541
- }
2542
- interface WeaveResult {
2543
- success: boolean;
2544
- item: PlanItem;
2545
- conflicts?: string[];
2546
- sha?: string;
2547
- message?: string;
2548
- }
2549
- interface WeaveExecutionResult {
2550
- operations: WeaveResult[];
2551
- successful: number;
2552
- failed: number;
2553
- conflicts: number;
2554
- totalOperations: number;
2555
- }
2556
- /**
2557
- * Git operations manager for merge pyramid execution
2558
- */
2559
- declare class GitOperations {
2560
- private git;
2561
- private workingDir;
2562
- constructor(workingDir?: string);
2563
- /**
2564
- * Check if git repository is in a clean state
2565
- */
2566
- isClean(): Promise<boolean>;
2567
- /**
2568
- * Get current branch name
2569
- */
2570
- getCurrentBranch(): Promise<string>;
2571
- /**
2572
- * Get commit SHA for a branch
2573
- */
2574
- getBranchHead(branchName: string): Promise<string | null>;
2575
- /**
2576
- * Get list of conflicted files using git diff
2577
- * This captures files with unmerged status (UU, AA, DU, UD, etc.)
2578
- */
2579
- getConflictedFiles(): Promise<string[]>;
2580
- /**
2581
- * Create and checkout a new branch for weave operations
2582
- */
2583
- createWeaveBranch(baseBranch?: string): Promise<string>;
2584
- /**
2585
- * Execute a single merge operation with conflict detection
2586
- */
2587
- executeMergeOperation(operation: MergeOperation): Promise<WeaveResult>;
2588
- /**
2589
- * Execute merge pyramid with dependency ordering
2590
- */
2591
- executeWeave(plan: Plan, levels: string[][], progressReporter?: ProgressReporter): Promise<WeaveExecutionResult>;
2592
- /**
2593
- * Rollback to previous state
2594
- */
2595
- rollback(targetBranch: string): Promise<void>;
2596
- /**
2597
- * Clean up integration branches
2598
- */
2599
- cleanup(branchPattern?: string): Promise<void>;
2600
- /**
2601
- * Get current HEAD commit SHA
2602
- */
2603
- getCurrentHead(): Promise<string>;
2604
- /**
2605
- * Get diff between two commits
2606
- */
2607
- getDiff(baseSha: string, headSha: string): Promise<string>;
2608
- /**
2609
- * Reset repository to a specific commit (hard reset)
2610
- */
2611
- resetHard(targetSha: string): Promise<void>;
2612
- }
2613
- /**
2614
- * Create git operations manager
2615
- */
2616
- declare function createGitOperations(workingDir?: string): GitOperations;
2617
-
2618
- /**
2619
- * Configuration bootstrapping and workspace setup
2620
- * Provides automatic configuration discovery and fallback mechanisms
2621
- */
2622
- interface BootstrapConfig {
2623
- profileDir: string;
2624
- hasConfiguration: boolean;
2625
- missingFiles: string[];
2626
- suggestions: string[];
2627
- }
2628
- /**
2629
- * Bootstrap workspace configuration with intelligent defaults
2630
- *
2631
- * @param baseDir - Base directory for profile resolution
2632
- * @param profileDirFlag - Optional profile directory override (from CLI --profile-dir)
2633
- */
2634
- declare function bootstrapWorkspace(baseDir?: string, profileDirFlag?: string): BootstrapConfig;
2635
- /**
2636
- * Detect project type and suggest appropriate templates
2637
- */
2638
- declare function detectProjectType(baseDir?: string): string;
2639
- /**
2640
- * Get environment-specific configuration suggestions
2641
- */
2642
- declare function getEnvironmentSuggestions(): string[];
2643
-
2644
- /**
2645
- * Guided workflow response types for MCP server
2646
- *
2647
- * These types enable context-aware workflow guidance without modifying
2648
- * existing tool response structures. Per LPR-037 and Guff's Option 1 approach.
2649
- */
2650
- /**
2651
- * Workflow action that can be taken in the current phase
2652
- */
2653
- interface WorkflowAction {
2654
- /** MCP tool command name (e.g., 'gates_run', 'plan_validate') */
2655
- command: string;
2656
- /** Human-readable description of what this action does */
2657
- description: string;
2658
- /** Whether this action must be performed before proceeding */
2659
- required: boolean;
2660
- }
2661
- /**
2662
- * Common issue and its resolution in a workflow phase
2663
- */
2664
- interface CommonIssue {
2665
- /** Symptom or error message pattern */
2666
- symptom: string;
2667
- /** Recommended solution or next step */
2668
- solution: string;
2669
- }
2670
- /**
2671
- * Guided workflow response from the workflow_guide tool
2672
- */
2673
- interface WorkflowGuide {
2674
- /** Current workflow phase identifier */
2675
- phase: string;
2676
- /** Available next steps in this phase */
2677
- nextSteps: WorkflowAction[];
2678
- /** Common issues that occur in this phase */
2679
- commonIssues: CommonIssue[];
2680
- /** Link to relevant documentation */
2681
- documentation?: string;
2682
- /** Whether agent can proceed to next phase */
2683
- canProceed: boolean;
2684
- /** Optional recommendation for the most common next action */
2685
- recommendedAction?: string;
2686
- }
2687
-
2688
- /**
2689
- * Workflow state machine for guided MCP workflows
2690
- *
2691
- * Tracks workflow phases and valid transitions for deterministic guidance.
2692
- * Per LPR-037 implementation.
2693
- */
2694
-
2695
- /**
2696
- * Valid workflow phases
2697
- */
2698
- type WorkflowPhase = "initial" | "post-plan-creation" | "post-gates-run" | "pre-merge" | "post-merge" | "error-recovery";
2699
- /**
2700
- * Create a workflow guide for a given phase without managing state
2701
- *
2702
- * This is a stateless helper for the MCP server that doesn't require
2703
- * maintaining a state machine instance.
2704
- */
2705
- declare function createWorkflowGuide(phase: WorkflowPhase): WorkflowGuide;
2706
-
2707
- declare function main(argv?: string[]): Promise<void>;
2708
-
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 };