@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.
- package/CHANGELOG.md +109 -1
- package/LICENSE.md +110 -0
- package/README.mcp.md +89 -17
- package/README.md +133 -1012
- package/dist/adapters-r7_TjMwo.d.ts +333 -0
- package/dist/{api-7H7SJZIX.js → api-QBPBKYOC.js} +1 -1
- package/dist/{audit-2TZ2LU72.js → audit-5ZUBPZZX.js} +2 -2
- package/dist/{autopilot-AL5F5AUS.js → autopilot-JXO4MZ6H.js} +7 -6
- package/dist/{chunk-UZFYNSMJ.js → chunk-26SCN2LJ.js} +445 -136
- package/{src/monitoring/metrics.ts → dist/chunk-AXOAVRTU.js} +35 -100
- package/dist/{chunk-GTP4OHD7.js → chunk-R4DWK6FE.js} +2 -2
- package/dist/chunk-TPVORFSN.js +629 -0
- package/dist/{chunk-2ESYSVXG.js → chunk-V3BU2VDU.js} +7 -17
- package/dist/{chunk-Q6Y524KH.js → chunk-VAGHAQT2.js} +5 -179
- package/dist/{chunk-4RVZNLD4.js → chunk-WFN4JTZI.js} +0 -88
- package/dist/chunk-WSJEPY7T.js +5633 -0
- package/dist/cli.cjs +56133 -33969
- package/dist/cli.d.ts +6045 -259
- package/dist/cli.js +31588 -15155
- package/dist/{commandValidator-AT5OYZFC.js → commandValidator-LVEMJTZP.js} +2 -2
- package/dist/{constraints-M52FVL2X.js → constraints-V4VWCWR5.js} +2 -2
- package/dist/errors/index.cjs +879 -0
- package/dist/errors/index.d.ts +121 -0
- package/dist/errors/index.js +73 -0
- package/dist/frames/index.cjs +11992 -0
- package/dist/frames/index.d.ts +278 -0
- package/dist/frames/index.js +51 -0
- package/dist/{gateMapping-E5MGNJH5.js → gateMapping-R3RJYKMS.js} +1 -1
- package/dist/hooks/events.cjs +288 -0
- package/dist/hooks/events.d.ts +497 -0
- package/dist/hooks/events.js +242 -0
- package/dist/{jsonEnvelope-R4SWKX2N.js → jsonEnvelope-K2U5CWKU.js} +1 -1
- package/dist/{mergeTreeSimulator-X4BA647P.js → mergeTreeSimulator-QCFSOU25.js} +1 -1
- package/dist/package-schemas/behavior-rule.cjs +61 -0
- package/{.smartergpt/schemas/behavior-rule.schema.d.ts → dist/package-schemas/behavior-rule.d.ts} +8 -6
- package/dist/package-schemas/behavior-rule.js +35 -0
- package/dist/package-schemas/execution-plan-v1.cjs +69 -0
- package/{.smartergpt/schemas → dist/package-schemas}/execution-plan-v1.d.ts +7 -5
- package/dist/package-schemas/execution-plan-v1.js +42 -0
- package/dist/package-schemas/gates.cjs +45 -0
- package/{.smartergpt/schemas/gates.schema.d.ts → dist/package-schemas/gates.d.ts} +7 -5
- package/dist/package-schemas/gates.js +19 -0
- package/dist/package-schemas/runner-scope.cjs +50 -0
- package/{.smartergpt/schemas/runner.scope.schema.d.ts → dist/package-schemas/runner-scope.d.ts} +8 -6
- package/dist/package-schemas/runner-scope.js +24 -0
- package/dist/package-schemas/runner-stack.cjs +46 -0
- package/{.smartergpt/schemas/runner.stack.schema.d.ts → dist/package-schemas/runner-stack.d.ts} +7 -5
- package/dist/package-schemas/runner-stack.js +20 -0
- package/dist/{planDiff-QOK6KNB7.js → planDiff-IHLFNZUT.js} +1 -1
- package/dist/{planHistory-DQRSB2Y7.js → planHistory-GLRI356L.js} +1 -1
- package/dist/{planReview-7VB3OYKZ.js → planReview-UUMCGZJ6.js} +4 -3
- package/dist/{planViewer-UIPOSRVW.js → planViewer-TRSQVMH4.js} +4 -3
- package/dist/{sarif-XIREI5B5.js → sarif-2C6RKOUX.js} +1 -1
- package/dist/sdk/index.cjs +556 -0
- package/dist/sdk/index.d.ts +1277 -0
- package/dist/sdk/index.js +503 -0
- package/dist/{security-YDLHSMVY.js → security-OE4VLUFK.js} +2 -2
- package/dist/{signing-JJJOUGCW.js → signing-KLZYZZMP.js} +1 -1
- package/dist/types-CYMIAhy8.d.ts +266 -0
- package/dist/{verify-SCUHB3SA.js → verify-3UVMA62I.js} +1 -1
- package/mcp-server.mjs +402 -385
- package/package.json +52 -22
- package/.changes/ci-debug-added.txt +0 -1
- package/.changeset/tsconfig-solution-build.md +0 -5
- package/.editorconfig +0 -9
- package/.env.example +0 -8
- package/.github/COST_EFFICIENCY.md +0 -60
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -28
- package/.github/ISSUE_TEMPLATE/epic.yml +0 -123
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/ISSUE_TEMPLATE/issue-A1-gate-input-validation.md +0 -380
- package/.github/ISSUE_TEMPLATE/issue-B1-scope-validation.md +0 -509
- package/.github/ISSUE_TEMPLATE/issue-C1-command-whitelist.md +0 -463
- package/.github/ISSUE_TEMPLATE/subtask.yml +0 -153
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -9
- package/.github/copilot-instructions-old.md +0 -429
- package/.github/copilot-instructions.md +0 -33
- package/.github/instructions/tests.instructions.md +0 -10
- package/.github/workflows/auto-delete-merged-branches.yml +0 -103
- package/.github/workflows/benchmarks.yml +0 -72
- package/.github/workflows/ci-debug.yml +0 -33
- package/.github/workflows/ci.yml +0 -167
- package/.github/workflows/cli-smoke-test.yml +0 -345
- package/.github/workflows/copilot-setup-steps.yml +0 -20
- package/.github/workflows/frame-emission-gate.yml +0 -242
- package/.github/workflows/project-auto.yml +0 -24
- package/.github/workflows/release.yml +0 -260
- package/.github/workflows/slow-cli-tests.yml +0 -37
- package/.github/workflows/tag-guard.yml +0 -44
- package/.husky/pre-commit +0 -1
- package/.nvmrc +0 -2
- package/.prettierignore +0 -28
- package/.prettierrc.json +0 -10
- package/.smartergpt/CONTROL_DECK_VISION.md +0 -226
- package/.smartergpt/allowed-commands.json +0 -41
- package/.smartergpt/allowed-commands.strict.json +0 -56
- package/.smartergpt/deliverables/.live.md +0 -426
- package/.smartergpt/deliverables/ISSUE_STATUS_2025-12-28.md +0 -193
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/ADR_DISCUSSION.md +0 -379
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_claude-haiku.md +0 -109
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_gemini-flash.md +0 -42
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_gpt-codex-mini.md +0 -19
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_raptor-mini.md +0 -37
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Question.md +0 -37
- package/.smartergpt/deliverables/merge-weave-04469e41-24ba-4ed5-b0ff-13c7ea12858d.ndjson +0 -2
- package/.smartergpt/deps.yml +0 -3
- package/.smartergpt/docs/fanout-templates.md +0 -213
- package/.smartergpt/docs/merge-weave-interventions.md +0 -261
- package/.smartergpt/docs/test-fix-patterns.md +0 -240
- package/.smartergpt/fanout-templates.yml +0 -263
- package/.smartergpt/gates.yml +0 -9
- package/.smartergpt/intent.md +0 -1
- package/.smartergpt/issues/QOL-001-analysis-script-filtering.md +0 -36
- package/.smartergpt/issues/QOL-002-log-retention-policy.md +0 -92
- package/.smartergpt/issues/QOL-003-realtime-console-feedback.md +0 -44
- package/.smartergpt/issues/QOL-004-governance-report-cli.md +0 -44
- package/.smartergpt/issues/QOL-005-schema-versioning.md +0 -46
- package/.smartergpt/issues/QOL-006-debug-verbose-mode.md +0 -45
- package/.smartergpt/issues/QOL-COMPLETION-REPORT.md +0 -359
- package/.smartergpt/issues/QOL-REVIEW-SUMMARY.md +0 -111
- package/.smartergpt/issues/QOL-ROADMAP.md +0 -71
- package/.smartergpt/merge-policy.yml +0 -41
- package/.smartergpt/merge-weave-policy.yml +0 -255
- package/.smartergpt/o1.json +0 -0
- package/.smartergpt/o2.json +0 -0
- package/.smartergpt/personas/eager-pm.md +0 -123
- package/.smartergpt/personas/example.md +0 -81
- package/.smartergpt/personas/senior-dev.md +0 -107
- package/.smartergpt/profile.yml +0 -2
- package/.smartergpt/prompts/create-project.md +0 -112
- package/.smartergpt/prompts/idea.md +0 -64
- package/.smartergpt/pull-request-template.md +0 -25
- package/.smartergpt/schemas/behavior-rule.schema.js +0 -56
- package/.smartergpt/schemas/behavior-rule.schema.json +0 -105
- package/.smartergpt/schemas/behavior-rule.schema.ts +0 -60
- package/.smartergpt/schemas/execution-plan-v1.js +0 -22
- package/.smartergpt/schemas/execution-plan-v1.json +0 -113
- package/.smartergpt/schemas/execution-plan-v1.ts +0 -32
- package/.smartergpt/schemas/execution-plan.schema.json +0 -116
- package/.smartergpt/schemas/feature-spec-v0.d.ts +0 -13
- package/.smartergpt/schemas/feature-spec-v0.js +0 -12
- package/.smartergpt/schemas/feature-spec-v0.json +0 -58
- package/.smartergpt/schemas/feature-spec-v0.ts +0 -16
- package/.smartergpt/schemas/feature-spec.schema.json +0 -111
- package/.smartergpt/schemas/gates.schema.js +0 -20
- package/.smartergpt/schemas/gates.schema.json +0 -47
- package/.smartergpt/schemas/gates.schema.ts +0 -26
- package/.smartergpt/schemas/idea.schema.json +0 -81
- package/.smartergpt/schemas/runner.scope.schema.js +0 -28
- package/.smartergpt/schemas/runner.scope.schema.json +0 -75
- package/.smartergpt/schemas/runner.scope.schema.ts +0 -36
- package/.smartergpt/schemas/runner.stack.schema.js +0 -21
- package/.smartergpt/schemas/runner.stack.schema.json +0 -51
- package/.smartergpt/schemas/runner.stack.schema.ts +0 -27
- package/.smartergpt/scope.yml +0 -11
- package/.smartergpt/stack.yml +0 -16
- package/.smartergpt/test-fix-patterns.yml +0 -106
- package/.tool-versions +0 -13
- package/AGENTS.md +0 -402
- package/CLAUDE.md +0 -484
- package/CONTRIBUTING.md +0 -345
- package/EAGER_PM_FANOUT_ANALYSIS.md +0 -283
- package/FAQ.md +0 -292
- package/FIXTURE_LIBRARY_SUMMARY.md +0 -327
- package/IMPLEMENTATION_SUMMARY.md +0 -222
- package/LICENSE +0 -21
- package/MANUAL_TEST_GUIDE.md +0 -229
- package/MCP-ALIGNMENT-SUMMARY.md +0 -261
- package/MCP-CONFIG.md +0 -125
- package/MERGE_WEAVE_QUICKSTART.md +0 -450
- package/MERGE_WEAVE_SUMMARY.md +0 -259
- package/MERGE_WEAVE_USAGE_GUIDE.md +0 -368
- package/TEST_INFRASTRUCTURE_ASSESSMENT.md +0 -225
- package/bootstrap-lexrunner.sh +0 -396
- package/dist/api-U3X2WA6D.js +0 -15
- package/dist/audit-5HH5BMKI.js +0 -60
- package/dist/audit-6K5K333I.js +0 -60
- package/dist/audit-DYQWS57J.js +0 -60
- package/dist/audit-JBWZ2GZ2.js +0 -60
- package/dist/audit-SJF3434D.js +0 -60
- package/dist/audit-TICGGVX5.js +0 -60
- package/dist/audit-YOBB27PY.js +0 -60
- package/dist/autopilot-3GAVXWWC.js +0 -45
- package/dist/autopilot-43NOYVQA.js +0 -45
- package/dist/autopilot-4UA3OWLU.js +0 -45
- package/dist/autopilot-54TK5CCG.js +0 -45
- package/dist/autopilot-5BHC2UQT.js +0 -45
- package/dist/autopilot-ABZUCVGY.js +0 -45
- package/dist/autopilot-ACJZP47Y.js +0 -45
- package/dist/autopilot-BO67FWUC.js +0 -45
- package/dist/autopilot-BR6W4GEX.js +0 -45
- package/dist/autopilot-FOR2UKRY.js +0 -45
- package/dist/autopilot-GDTTXHEQ.js +0 -45
- package/dist/autopilot-GEAMFZBM.js +0 -45
- package/dist/autopilot-HDMBRZE6.js +0 -45
- package/dist/autopilot-IKI2Y6S4.js +0 -44
- package/dist/autopilot-ILTBWWOL.js +0 -46
- package/dist/autopilot-KI3MXIFI.js +0 -44
- package/dist/autopilot-LWNPZC3J.js +0 -45
- package/dist/autopilot-LXPJ4ZXF.js +0 -45
- package/dist/autopilot-MDIFIONK.js +0 -46
- package/dist/autopilot-NW3LDP6M.js +0 -45
- package/dist/autopilot-OKTSCG35.js +0 -45
- package/dist/autopilot-OR5PF5PD.js +0 -45
- package/dist/autopilot-PE65SBGN.js +0 -45
- package/dist/autopilot-PW7I4B6W.js +0 -45
- package/dist/autopilot-QMLBL5P6.js +0 -45
- package/dist/autopilot-QSN6ZU5O.js +0 -45
- package/dist/autopilot-R7EZJOGI.js +0 -46
- package/dist/autopilot-T544CPPD.js +0 -44
- package/dist/autopilot-TNQB6VGJ.js +0 -44
- package/dist/autopilot-UVIYCR6K.js +0 -45
- package/dist/autopilot-W3ZTTSH3.js +0 -45
- package/dist/autopilot-XPKWOFXO.js +0 -44
- package/dist/autopilot-XRX4QWRM.js +0 -44
- package/dist/autopilot-Y3BAGNI5.js +0 -44
- package/dist/autopilot-ZE64XW2K.js +0 -44
- package/dist/chunk-2VR554P7.js +0 -668
- package/dist/chunk-37DOWIVT.js +0 -1084
- package/dist/chunk-3DU2DWUP.js +0 -400
- package/dist/chunk-3DVXIZFM.js +0 -11166
- package/dist/chunk-3FABZF4V.js +0 -811
- package/dist/chunk-4GEC4HC3.js +0 -11221
- package/dist/chunk-5CGWZH5X.js +0 -340
- package/dist/chunk-5QKWKK4M.js +0 -11794
- package/dist/chunk-5Z3XHND7.js +0 -11755
- package/dist/chunk-6YC2VSLE.js +0 -11252
- package/dist/chunk-7C4K2SHD.js +0 -668
- package/dist/chunk-ANXY4RGA.js +0 -11091
- package/dist/chunk-ASHKNUBR.js +0 -11312
- package/dist/chunk-B3OYDPOP.js +0 -11793
- package/dist/chunk-DBH7SQ2S.js +0 -1084
- package/dist/chunk-DEI7A5B4.js +0 -11449
- package/dist/chunk-EQKFCZLH.js +0 -9823
- package/dist/chunk-FAIJPBT5.js +0 -40
- package/dist/chunk-FDDKUDXR.js +0 -11166
- package/dist/chunk-FEAR6ETG.js +0 -438
- package/dist/chunk-FXL74C73.js +0 -523
- package/dist/chunk-GLJEDX4L.js +0 -10247
- package/dist/chunk-HIHH7IVO.js +0 -10557
- package/dist/chunk-I3VXUVCB.js +0 -10474
- package/dist/chunk-I6BIFVWI.js +0 -10519
- package/dist/chunk-I72TRUTJ.js +0 -1084
- package/dist/chunk-J5B5KT2F.js +0 -368
- package/dist/chunk-JMTULZ66.js +0 -11743
- package/dist/chunk-JXIQ7HCK.js +0 -11166
- package/dist/chunk-K6HVPBDP.js +0 -10692
- package/dist/chunk-KBT5Y666.js +0 -521
- package/dist/chunk-LETPROKG.js +0 -11092
- package/dist/chunk-LLMY2BZF.js +0 -1084
- package/dist/chunk-NMNL4US2.js +0 -1084
- package/dist/chunk-O2XRP7JK.js +0 -10247
- package/dist/chunk-OGPWLFFO.js +0 -11201
- package/dist/chunk-OQJUWTZV.js +0 -51
- package/dist/chunk-PJRWPLQ6.js +0 -669
- package/dist/chunk-PYRVUCJR.js +0 -370
- package/dist/chunk-QF7DM5VW.js +0 -106
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-QIIELFTL.js +0 -1107
- package/dist/chunk-QUW6N7GR.js +0 -10264
- package/dist/chunk-QZASNLQX.js +0 -11223
- package/dist/chunk-RMN4IAWO.js +0 -11808
- package/dist/chunk-RN5NHU37.js +0 -11465
- package/dist/chunk-RNG3RILO.js +0 -11755
- package/dist/chunk-RSA6DEB4.js +0 -9748
- package/dist/chunk-RURYWSMX.js +0 -10524
- package/dist/chunk-SUEXK5U7.js +0 -11201
- package/dist/chunk-TVUF55OH.js +0 -11807
- package/dist/chunk-U62I2R2D.js +0 -434
- package/dist/chunk-UNZBDSEU.js +0 -11166
- package/dist/chunk-VP37GLU6.js +0 -1084
- package/dist/chunk-W6WDKBWO.js +0 -11453
- package/dist/chunk-XBKUFNVF.js +0 -10745
- package/dist/chunk-XOLVQTIE.js +0 -670
- package/dist/chunk-YABA7DB6.js +0 -11091
- package/dist/chunk-YWCJX5KL.js +0 -10557
- package/dist/chunk-Z5GP7FSR.js +0 -309
- package/dist/chunk-ZBT3DATZ.js +0 -296
- package/dist/chunk-ZDBAZXUQ.js +0 -11201
- package/dist/chunk-ZEMABYS4.js +0 -92
- package/dist/chunk-ZOA4HT7P.js +0 -662
- package/dist/cli.d.cts +0 -2709
- package/dist/commandValidator-42OUDFZ4.js +0 -140
- package/dist/commandValidator-7LQHTYL5.js +0 -140
- package/dist/commandValidator-DH3CX2OW.js +0 -140
- package/dist/commandValidator-GCQC7H4A.js +0 -140
- package/dist/commandValidator-K6VWB6O3.js +0 -140
- package/dist/commandValidator-L6WNDBYB.js +0 -129
- package/dist/commandValidator-O3KSNXD2.js +0 -140
- package/dist/commandValidator-ZHMUA5RQ.js +0 -140
- package/dist/dist-CSOR2BL2.js +0 -1144
- package/dist/dist-PKOIS5NZ.js +0 -1144
- package/dist/fileAnalysis-3VMDDJ6I.js +0 -9
- package/dist/fileAnalysis-4QLHUT44.js +0 -9
- package/dist/fileAnalysis-H6M2Z7ZC.js +0 -9
- package/dist/fileAnalysis-HMI7IL6S.js +0 -9
- package/dist/fileAnalysis-JHABOPUQ.js +0 -9
- package/dist/mergeTreeSimulator-ATOPJ3DU.js +0 -11
- package/dist/mergeTreeSimulator-AYUK4TZT.js +0 -11
- package/dist/mergeTreeSimulator-BBWJUQBK.js +0 -11
- package/dist/mergeTreeSimulator-DJJDRB5N.js +0 -11
- package/dist/planDiff-37QHCPKO.js +0 -109
- package/dist/planDiff-BQHIUARB.js +0 -109
- package/dist/planDiff-RXR4CWFS.js +0 -109
- package/dist/planDiff-W2BTH2MU.js +0 -109
- package/dist/planHistory-4J3Q6AJ3.js +0 -126
- package/dist/planHistory-GLCXP6AB.js +0 -126
- package/dist/planHistory-SMNRLEKG.js +0 -126
- package/dist/planHistory-UO4WZ6GO.js +0 -126
- package/dist/planReview-7BWVLABC.js +0 -377
- package/dist/planReview-FAIBIAE6.js +0 -377
- package/dist/planReview-FXQBDNKJ.js +0 -376
- package/dist/planReview-HO4YYETA.js +0 -377
- package/dist/planReview-I26EKCUK.js +0 -376
- package/dist/planReview-JBOAJHSU.js +0 -377
- package/dist/planReview-SCNZWC6B.js +0 -376
- package/dist/planReview-TU7LMZIY.js +0 -376
- package/dist/planViewer-2YZCPVDM.js +0 -155
- package/dist/planViewer-72WZFUTU.js +0 -154
- package/dist/planViewer-G546TVHV.js +0 -154
- package/dist/planViewer-I7ZHNJQF.js +0 -150
- package/dist/planViewer-IRXHOY5U.js +0 -155
- package/dist/planViewer-IX2ICW45.js +0 -154
- package/dist/planViewer-PDWPUOP6.js +0 -155
- package/dist/planViewer-PEOADAGZ.js +0 -155
- package/dist/planViewer-PFYDEG6V.js +0 -150
- package/dist/planViewer-V2JUKV7Q.js +0 -154
- package/dist/sarif-46TKOOJZ.js +0 -9
- package/dist/sarif-63JKTFFI.js +0 -9
- package/dist/sarif-CIYIWUNC.js +0 -9
- package/dist/sarif-OGAGDL6B.js +0 -9
- package/dist/security-3V6FKJDA.js +0 -423
- package/dist/security-4JMEUM56.js +0 -423
- package/dist/security-QHPEWY5G.js +0 -423
- package/dist/security-V2LAL5TP.js +0 -415
- package/dist/security-WTASK6T6.js +0 -423
- package/dist/security-XE4GHVJD.js +0 -423
- package/dist/security-XLXM3UHT.js +0 -423
- package/dist/security-ZDAEZF7D.js +0 -423
- package/dist/signing-3EI734L4.js +0 -14
- package/dist/signing-5G7K6JXJ.js +0 -14
- package/dist/signing-7DK7SABM.js +0 -14
- package/dist/signing-OAJ3MXGA.js +0 -14
- package/dist/verify-5F6PUXUQ.js +0 -62
- package/dist/verify-5ILURHV2.js +0 -62
- package/dist/verify-MRDZJUGO.js +0 -62
- package/dist/verify-YZRHN2D3.js +0 -62
- package/docs/1.0.0-vertical-slice.md +0 -214
- package/docs/ADR-007-INTEGRATION-SUMMARY.md +0 -232
- package/docs/ALIASING_FOR_LEXRUNNER.md +0 -709
- package/docs/ALIASING_FOR_RUNNER.md +0 -552
- package/docs/AX.md +0 -317
- package/docs/CHECKPOINT_RESUME.md +0 -208
- package/docs/CLI_VERBS.md +0 -219
- package/docs/CONFLICT_DETECTION.md +0 -198
- package/docs/DISCIPLINED_FAILURE.md +0 -224
- package/docs/ENVIRONMENT_QUALITY.md +0 -155
- package/docs/ERROR_CODES.md +0 -528
- package/docs/EVENT_SCHEMA.md +0 -659
- package/docs/EXE-012-investigation-summary.md +0 -300
- package/docs/GATE_ATTESTATION_GUIDE.md +0 -237
- package/docs/JSON_OUTPUT_SCHEMAS.md +0 -347
- package/docs/LEXRUNNER_ALIASING.md +0 -444
- package/docs/LEX_INTEGRATION.md +0 -83
- package/docs/LEX_PUBLIC_API.md +0 -306
- package/docs/LICENSING.md +0 -119
- package/docs/MCP-CLI-PARITY.md +0 -410
- package/docs/MCP-MIGRATION.md +0 -258
- package/docs/MCP-PARITY.md +0 -234
- package/docs/MEMORY_TOOLS.md +0 -278
- package/docs/MERGE_WEAVE_SETUP.md +0 -643
- package/docs/MIGRATION_v0.1.md +0 -760
- package/docs/NAMING_CONVENTIONS.md +0 -82
- package/docs/PERSONA_FOUNDATION.md +0 -124
- package/docs/PHASE3_MEMORY_GUIDE.md +0 -122
- package/docs/PLAN_LOCK.md +0 -114
- package/docs/README.md +0 -289
- package/docs/RUNNER_LIFECYCLE.md +0 -257
- package/docs/SAFETY_MECHANISMS.md +0 -325
- package/docs/SECURITY_IMPLEMENTATION.md +0 -535
- package/docs/TERMS.md +0 -34
- package/docs/TOKEN_TRACKING.md +0 -162
- package/docs/WORKFLOW_GUIDANCE.md +0 -277
- package/docs/adr/ADR-000-product-naming-and-branding.md +0 -115
- package/docs/adr/ADR-001-plan-json-frozen-input.md +0 -68
- package/docs/adr/ADR-002-two-track-separation.md +0 -84
- package/docs/adr/ADR-003-gate-uniform-execution.md +0 -69
- package/docs/adr/ADR-004-runner-state-model.md +0 -75
- package/docs/adr/ADR-005-merge-pyramid-ordering.md +0 -87
- package/docs/adr/ADR-006-schema-versioning-semver.md +0 -81
- package/docs/adr/ADR-007-task-snapshot-contract.md +0 -503
- package/docs/adr/ADR-008-lex-packaging.md +0 -243
- package/docs/adr/ADR-009-ax-test-output-adapters.md +0 -440
- package/docs/adr/README.md +0 -32
- package/docs/advanced-cli.md +0 -436
- package/docs/agent-stall-detection.md +0 -278
- package/docs/architecture/executors.md +0 -190
- package/docs/architecture.md +0 -316
- package/docs/attestation/AX-SHARED-PLEDGE.md +0 -83
- package/docs/attestation/AX-SHARED-PLEDGE_v1.0.0.md +0 -99
- package/docs/attestation/AX-SHARED-PLEDGE_v1.0.0_VERIFICATION.md +0 -115
- package/docs/attestation/Lex_Guff_Version_Contract_Pact_v1.0.0.md +0 -181
- package/docs/attestation/README.md +0 -87
- package/docs/attestation/ax_pledge_2025-12-02.ots +0 -0
- package/docs/attestation/ax_pledge_timestamp_response.tsr +0 -0
- package/docs/attestation/copilot_summarization_2025-12-01.ots +0 -0
- package/docs/attestation/copilot_summarization_2025-12-01_VERIFICATION.md +0 -100
- package/docs/attestation/copilot_summarization_behavior_observation_2025-12-01.md +0 -85
- package/docs/attestation/copilot_summarization_screenshot_2025-12-01.png +0 -0
- package/docs/attestation/employment_separation_2025-11-26.ots +0 -0
- package/docs/attestation/employment_timestamp_response.tsr +0 -0
- package/docs/attestation/freetsa_cacert.pem +0 -45
- package/docs/attestation/freetsa_tsa.crt +0 -45
- package/docs/attestation/lex_employment_separation_2025-11-26.md +0 -85
- package/docs/attestation/lex_employment_separation_2025-11-26_VERIFICATION.md +0 -126
- package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft.md +0 -350
- package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft.md.ots +0 -0
- package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft_VERIFICATION.md +0 -130
- package/docs/attestation/patent/README.md +0 -75
- package/docs/attestation/patent/fig1_write_path.svg +0 -58
- package/docs/attestation/patent/fig2_read_normalize_rollup.svg +0 -92
- package/docs/attestation/timestamp_response.tsr +0 -0
- package/docs/attribution-README.md +0 -264
- package/docs/audit-compliance.md +0 -283
- package/docs/audit-outputs.md +0 -1213
- package/docs/audit-sdk.md +0 -1134
- package/docs/autopilot-levels.md +0 -368
- package/docs/autopilot.md +0 -288
- package/docs/ci-cd-integration.md +0 -580
- package/docs/ci-integration-guide.md +0 -369
- package/docs/ci-version-validation.md +0 -198
- package/docs/cli-mcp-weave-reporting.md +0 -462
- package/docs/cli.md +0 -2262
- package/docs/cluster-gates-rollback.md +0 -222
- package/docs/command-creation-guide.md +0 -485
- package/docs/command-whitelist.md +0 -490
- package/docs/commands/idea.md +0 -253
- package/docs/config.md +0 -245
- package/docs/conflict-clustering.md +0 -225
- package/docs/conflict-predictor.md +0 -359
- package/docs/context-diet.md +0 -249
- package/docs/counter-examples.md +0 -199
- package/docs/create-project.md +0 -211
- package/docs/deliverables-generator.md +0 -299
- package/docs/deliverables-management.md +0 -474
- package/docs/dependency-parser.md +0 -354
- package/docs/determinism.md +0 -299
- package/docs/diffgraph-planner.md +0 -1211
- package/docs/dogfood/README.md +0 -33
- package/docs/dogfood/wave-3-results.md +0 -303
- package/docs/dogfood-merge-weave-script.md +0 -224
- package/docs/enterprise-onboarding.md +0 -291
- package/docs/environment-variables.md +0 -625
- package/docs/error-recovery.md +0 -466
- package/docs/errors.md +0 -288
- package/docs/executor-authoring.md +0 -854
- package/docs/executor-decoupling.md +0 -410
- package/docs/front-end-capture-pipeline.md +0 -312
- package/docs/gate-report-examples.md +0 -380
- package/docs/gates.md +0 -319
- package/docs/github-automation.md +0 -128
- package/docs/governance-metrics.md +0 -368
- package/docs/integrations/README.md +0 -588
- package/docs/interactive-plan-review.md +0 -493
- package/docs/issue-orchestration.md +0 -256
- package/docs/lex_ax_session_key_rememberings_v0.1.md +0 -195
- package/docs/lexrunner-v1-summary.md +0 -246
- package/docs/lexrunner-v2-contract.md +0 -404
- package/docs/lexrunner-v2-migration-plan.md +0 -388
- package/docs/lexrunner-v2-salvage-map.md +0 -355
- package/docs/lexsona-rules.md +0 -154
- package/docs/merge-weave-analysis.md +0 -403
- package/docs/merge-weave-quickstart.md +0 -770
- package/docs/merge-weave-state-machine.md +0 -390
- package/docs/migration-guide.md +0 -529
- package/docs/monitoring-examples.md +0 -470
- package/docs/monitoring-implementation.md +0 -252
- package/docs/orchestration.md +0 -234
- package/docs/performance-scale.md +0 -359
- package/docs/plan-generation.md +0 -407
- package/docs/profile-resolution.md +0 -455
- package/docs/prompts.md +0 -427
- package/docs/quickstart.md +0 -546
- package/docs/release-process.md +0 -310
- package/docs/sample-prompts/merge-weave/cli-merge-weave-kickoff.md +0 -274
- package/docs/sample-prompts/merge-weave/mcp-merge-weave-kickoff.md +0 -480
- package/docs/sample-prompts/merge-weave/standalone-merge-weave-kickoff.md +0 -237
- package/docs/schemas.md +0 -359
- package/docs/scope-validation.md +0 -444
- package/docs/security/rotation-guide.md +0 -325
- package/docs/specs/Meeting_Control_Stack_Concept_v0.1.0.md +0 -417
- package/docs/specs/git-feature-flag-redesign.md +0 -321
- package/docs/specs/lex-pr-brief-behavior.md +0 -269
- package/docs/specs/smartergpt-structure-v1.md +0 -705
- package/docs/specs/task-brief-v0.1.md +0 -224
- package/docs/store-architecture.md +0 -61
- package/docs/templates/CONTRIBUTING-merge-weave-section.md +0 -33
- package/docs/templates/gates.example.yml +0 -109
- package/docs/templates/plan.example.json +0 -77
- package/docs/thesis/00-EVOLUTION-NOTES.md +0 -383
- package/docs/thesis/01-CORE-THESIS.md +0 -285
- package/docs/thesis/02-TURN-COST.md +0 -498
- package/docs/thesis/03-PERMISSION-TO-FAIL.md +0 -581
- package/docs/thesis/04-CROSS-MODEL-CONTINUITY.md +0 -517
- package/docs/thesis/05-RULE-FILE-SPEC.md +0 -732
- package/docs/thesis/06-CAPABILITY-TIERS.md +0 -723
- package/docs/thesis/07-ROBERT-FIELD-REPORT.md +0 -433
- package/docs/thesis/08-IMPLEMENTATION-GUIDE.md +0 -1093
- package/docs/thesis/09-METRICS-AND-TELEMETRY.md +0 -793
- package/docs/thesis/10-FAILURE-MODES.md +0 -716
- package/docs/thesis/README.md +0 -151
- package/docs/thesis/lex_governance-collab_systems_paper_draft.md +0 -952
- package/docs/thesis/lex_governance-collab_systems_paper_draft.pdf +0 -0
- package/docs/tool-grounded/READINESS_ANALYSIS.md +0 -527
- package/docs/tool-grounded/enforcement.md +0 -361
- package/docs/tool-grounded/tool-grounded-a-view-from-the-inside.md +0 -437
- package/docs/tool-grounded/tool-grounded-prompt.md +0 -122
- package/docs/tool-grounded/tool-grounded-run-centric.md +0 -474
- package/docs/troubleshooting-planner.md +0 -910
- package/docs/troubleshooting.md +0 -745
- package/docs/tutorials/README.md +0 -201
- package/docs/tutorials/diffgraph-planner/01-simple-stack.md +0 -460
- package/docs/tutorials/diffgraph-planner/02-diamond-pattern.md +0 -431
- package/docs/tutorials/diffgraph-planner/03-large-batch.md +0 -525
- package/docs/tutorials/diffgraph-planner/04-fixing-cycles.md +0 -526
- package/docs/tutorials/diffgraph-planner/05-hybrid-workflow.md +0 -555
- package/docs/tutorials/quick-merge-pyramid.md +0 -364
- package/docs/tutorials/video-scripts/01-getting-started.md +0 -286
- package/docs/tutorials/video-scripts/02-understanding-dependencies.md +0 -376
- package/docs/weave-contract.md +0 -116
- package/docs/weave-execution-log.md +0 -153
- package/docs/workflows/README.md +0 -139
- package/docs/workflows/enterprise.md +0 -545
- package/docs/workflows/small-team.md +0 -398
- package/docs/workflows/solo-developer.md +0 -419
- package/dogfood-merge-weave.sh +0 -122
- package/examples/README.md +0 -22
- package/examples/WORKING_EXAMPLE.md +0 -309
- package/examples/analyze-pr-files.js +0 -100
- package/examples/autopilot-level4-example.md +0 -234
- package/examples/cluster-gates-demo.sh +0 -178
- package/examples/complete-security-workflow.ts +0 -248
- package/examples/error-recovery/README.md +0 -202
- package/examples/executor-manifest.example.yaml +0 -81
- package/examples/front-end-capture-pipeline/README.md +0 -99
- package/examples/front-end-capture-pipeline/create-project-example.sh +0 -83
- package/examples/front-end-capture-pipeline/idea-dark-mode.json +0 -14
- package/examples/front-end-capture-pipeline/idea-example.sh +0 -57
- package/examples/front-end-capture-pipeline/manual-test-checklist.md +0 -426
- package/examples/gates/README.md +0 -165
- package/examples/gates/lint-gate.sh +0 -40
- package/examples/gates/lint-gate.ts +0 -99
- package/examples/gates/test-runner.ts +0 -113
- package/examples/gates/vuln-scanner.ts +0 -95
- package/examples/github-integration/README.md +0 -111
- package/examples/github-integration/example-plan.json +0 -95
- package/examples/performance-config.md +0 -388
- package/examples/profile-setup/.gitignore.template +0 -66
- package/examples/profile-setup/.smartergpt-example/README.md +0 -190
- package/examples/profile-setup/.smartergpt.local-example/README.md +0 -365
- package/examples/profile-setup/README.md +0 -492
- package/examples/profile-setup/cross-repo-prompts/README.md +0 -606
- package/examples/safety-framework-demo.ts +0 -130
- package/examples/safety-mechanisms-example.ts +0 -191
- package/examples/sample-plan.json +0 -87
- package/examples/sample-stack.yml +0 -66
- package/examples/sarif/README.md +0 -224
- package/examples/scope-validation-demo.ts +0 -199
- package/examples/security-integration.ts +0 -293
- package/examples/token-tracking-example.ts +0 -71
- package/executors/senior-dev/ARCHITECTURE.md +0 -182
- package/executors/senior-dev/MEMORY_INTEGRATION.md +0 -236
- package/executors/senior-dev/QUICK_START.md +0 -145
- package/executors/senior-dev/README.md +0 -76
- package/executors/senior-dev/examples/sample-review-session.md +0 -228
- package/executors/senior-dev/executor-manifest.yaml +0 -79
- package/executors/senior-dev/prompts/code-review.prompt.md +0 -78
- package/executors/senior-dev/prompts/mentorship-feedback.prompt.md +0 -97
- package/executors/senior-dev/prompts/pattern-recognition.prompt.md +0 -80
- package/executors/senior-dev/prompts/pr-analysis.prompt.md +0 -75
- package/executors/senior-dev/scripts/capture-review-frame.sh +0 -129
- package/executors/senior-dev/scripts/prepare-review-context.sh +0 -61
- package/executors/senior-dev/scripts/recall-context.sh +0 -87
- package/lexrunner-launcher.sh +0 -12
- package/mcp-config-example.json +0 -14
- package/merge-weave-current-prs.md +0 -170
- package/merge-weave-dogfood.json +0 -46
- package/merge-weave-plan.json +0 -56
- package/procedures/merge-weave-main.yaml +0 -90
- package/procedures/pr-review.yaml +0 -68
- package/project/README.md +0 -50
- package/prompts/tool-grounded-mode.md +0 -185
- package/scripts/README.md +0 -354
- package/scripts/analyze-governance-logs.mjs +0 -51
- package/scripts/benchmark-ci.ts +0 -339
- package/scripts/check-determinism.sh +0 -23
- package/scripts/check-license-compliance.mjs +0 -319
- package/scripts/check-release-drift.mjs +0 -81
- package/scripts/ci-debug.sh +0 -24
- package/scripts/ci-smoke.mjs +0 -304
- package/scripts/create-sample-repo.sh +0 -245
- package/scripts/dogfood-merge-weave.sh +0 -552
- package/scripts/gen_mcp_servers.py +0 -252
- package/scripts/generate-executor-manifest-schema.ts +0 -30
- package/scripts/generate-flake-schema.ts +0 -32
- package/scripts/generate-gate-schema.ts +0 -32
- package/scripts/generate-plan-schema.ts +0 -30
- package/scripts/generate-run-schemas.ts +0 -69
- package/scripts/load-prompt.mjs +0 -147
- package/scripts/merge-weave-wrapper.sh +0 -445
- package/scripts/merge-weave.sh +0 -489
- package/scripts/metrics-template.ts +0 -134
- package/scripts/package-lex.sh +0 -267
- package/scripts/quick-start-merge-weave.sh +0 -218
- package/scripts/release-prepare.ts +0 -350
- package/scripts/rotate-secrets-example.ts +0 -134
- package/scripts/test-lexsona-shadow.mjs +0 -100
- package/scripts/validate-manifests.ts +0 -188
- package/scripts/verify-audit-phase2.js +0 -175
- package/src/ai/README.md +0 -456
- package/src/ai/conflictStrategy.ts +0 -223
- package/src/ai/conflictStrategyCache.ts +0 -164
- package/src/ai/conflictStrategyPrompt.ts +0 -128
- package/src/ai/conflictStrategySchema.ts +0 -165
- package/src/ai/heuristicFallback.ts +0 -162
- package/src/ai/index.ts +0 -64
- package/src/ai/riskScoring.ts +0 -174
- package/src/aliases/index.ts +0 -16
- package/src/aliases/resolver.ts +0 -212
- package/src/audit/context.ts +0 -284
- package/src/audit/emitter.ts +0 -685
- package/src/audit/events.ts +0 -210
- package/src/audit/gateMatrix.ts +0 -158
- package/src/audit/index.ts +0 -44
- package/src/audit/manifest.ts +0 -78
- package/src/audit/profiles.ts +0 -93
- package/src/audit/redaction.ts +0 -216
- package/src/audit/sarif.ts +0 -213
- package/src/audit/schema/events.ts +0 -366
- package/src/audit/schema/manifest.ts +0 -47
- package/src/audit/schema.ts +0 -159
- package/src/audit/sdk/index.ts +0 -145
- package/src/audit/sdk/types.ts +0 -88
- package/src/audit/sidecar.ts +0 -111
- package/src/audit/signing.ts +0 -521
- package/src/autopilot/README.md +0 -113
- package/src/autopilot/artifacts.ts +0 -287
- package/src/autopilot/base.ts +0 -132
- package/src/autopilot/deliverables.ts +0 -392
- package/src/autopilot/index.ts +0 -29
- package/src/autopilot/level1.ts +0 -187
- package/src/autopilot/level2.ts +0 -262
- package/src/autopilot/level3.ts +0 -263
- package/src/autopilot/level4.ts +0 -393
- package/src/autopilot/safety/README.md +0 -512
- package/src/autopilot/safety/SafetyFramework.ts +0 -634
- package/src/autopilot/safety/index.ts +0 -16
- package/src/autopilot/types.ts +0 -250
- package/src/budget/index.ts +0 -56
- package/src/budget/manager.ts +0 -547
- package/src/budget/schema.ts +0 -305
- package/src/budget/tracker.ts +0 -155
- package/src/cache/issue-cache.ts +0 -150
- package/src/cli/command-map.ts +0 -221
- package/src/cli/commands/gate/test.ts +0 -214
- package/src/cli/exitHandler.ts +0 -98
- package/src/cli/flags.ts +0 -123
- package/src/cli/formatSuggestions.ts +0 -202
- package/src/cli/formatters.ts +0 -294
- package/src/cli/jsonEnvelope.ts +0 -152
- package/src/cli/output.ts +0 -61
- package/src/cli/runnerLifecycle.ts +0 -118
- package/src/cli-audit.ts +0 -76
- package/src/cli-security.ts +0 -114
- package/src/cli.ts +0 -1231
- package/src/commands/audit/index.ts +0 -5
- package/src/commands/audit/verify.ts +0 -87
- package/src/commands/autopilot.ts +0 -131
- package/src/commands/budget.ts +0 -327
- package/src/commands/bulkOps.ts +0 -204
- package/src/commands/completion.ts +0 -287
- package/src/commands/config/validate.ts +0 -428
- package/src/commands/config.ts +0 -368
- package/src/commands/counterExamples.ts +0 -104
- package/src/commands/create-project.ts +0 -338
- package/src/commands/discover.ts +0 -192
- package/src/commands/doctor.ts +0 -436
- package/src/commands/execute.ts +0 -558
- package/src/commands/explain.ts +0 -157
- package/src/commands/fanout-analyze.ts +0 -684
- package/src/commands/fanout-harvest.ts +0 -328
- package/src/commands/fanout-monitor.ts +0 -224
- package/src/commands/gateAttest.ts +0 -95
- package/src/commands/gateImport.ts +0 -142
- package/src/commands/gateImportChecks.ts +0 -208
- package/src/commands/gateReport.ts +0 -184
- package/src/commands/governanceCleanup.ts +0 -171
- package/src/commands/governanceReport.ts +0 -497
- package/src/commands/guards.ts +0 -50
- package/src/commands/idea.ts +0 -281
- package/src/commands/init.ts +0 -414
- package/src/commands/issues.ts +0 -165
- package/src/commands/merge.ts +0 -677
- package/src/commands/mergeOrder.ts +0 -68
- package/src/commands/metrics.ts +0 -232
- package/src/commands/migrateProfile.ts +0 -187
- package/src/commands/orchestrate/analyze-issues.ts +0 -203
- package/src/commands/orchestrate/assign-batch.ts +0 -204
- package/src/commands/orchestrate/generate-deliverables.ts +0 -66
- package/src/commands/orchestrate/pinToolchain.ts +0 -102
- package/src/commands/orchestrate/plan-batch.ts +0 -119
- package/src/commands/orchestrate/predict-conflicts.ts +0 -210
- package/src/commands/orchestrate.ts +0 -186
- package/src/commands/plan.ts +0 -403
- package/src/commands/planDiff.ts +0 -56
- package/src/commands/planReview.ts +0 -112
- package/src/commands/planViewer.ts +0 -180
- package/src/commands/preview-constraints.ts +0 -97
- package/src/commands/query.ts +0 -313
- package/src/commands/report.ts +0 -56
- package/src/commands/retry.ts +0 -60
- package/src/commands/schema.ts +0 -128
- package/src/commands/security.ts +0 -140
- package/src/commands/seniorDev.ts +0 -326
- package/src/commands/status.ts +0 -97
- package/src/commands/tokenReport.ts +0 -167
- package/src/commands/validation.ts +0 -66
- package/src/commands/weave-checkpoints.ts +0 -145
- package/src/commands/weave-fanout.ts +0 -273
- package/src/commands/weave-policy.ts +0 -277
- package/src/commands/weave.ts +0 -518
- package/src/config/localOverlay.ts +0 -167
- package/src/config/pathResolver.ts +0 -106
- package/src/config/profileResolver.ts +0 -194
- package/src/config/promptsResolver.ts +0 -312
- package/src/config/rulesResolver.ts +0 -257
- package/src/config/schemas.ts +0 -142
- package/src/core/bootstrap.ts +0 -287
- package/src/core/enterprise.ts +0 -453
- package/src/core/errorRecovery.ts +0 -509
- package/src/core/githubPlan.ts +0 -282
- package/src/core/inputs.ts +0 -314
- package/src/core/multiRepoPlan.ts +0 -353
- package/src/core/plan.ts +0 -106
- package/src/core/snapshot.ts +0 -189
- package/src/errors/adapters.ts +0 -897
- package/src/errors/index.ts +0 -231
- package/src/executionState.ts +0 -356
- package/src/executors/README_FRAME_CONTRACT.md +0 -446
- package/src/executors/frameContract.ts +0 -270
- package/src/executors/guardrailEnforcement.ts +0 -294
- package/src/executors/seniorDev/core.ts +0 -548
- package/src/executors/seniorDev/index.ts +0 -30
- package/src/executors/seniorDev/types.ts +0 -176
- package/src/executors/toolBudget.ts +0 -194
- package/src/fanout/analyzer.ts +0 -735
- package/src/fanout/github-adapter.ts +0 -262
- package/src/fanout/harvest.ts +0 -517
- package/src/fanout/monitor.ts +0 -350
- package/src/fanout/types.ts +0 -428
- package/src/frames/controller.ts +0 -160
- package/src/frames/emitter.ts +0 -455
- package/src/frames/index.ts +0 -58
- package/src/frames/storage.ts +0 -203
- package/src/frames/types.ts +0 -258
- package/src/gates/checkRunConverter.ts +0 -91
- package/src/gates/test/adapters/errors.ts +0 -32
- package/src/gates/test/adapters/index.ts +0 -36
- package/src/gates/test/adapters/interface.ts +0 -63
- package/src/gates/test/adapters/jest-json.ts +0 -370
- package/src/gates/test/adapters/junit-xml.ts +0 -400
- package/src/gates/test/adapters/registry.ts +0 -149
- package/src/gates/test/adapters/vitest-json.ts +0 -339
- package/src/gates/test/enrichment/failureId.ts +0 -74
- package/src/gates/test/enrichment/index.ts +0 -25
- package/src/gates/test/enrichment/nextActions.ts +0 -322
- package/src/gates/test/enrichment/rerunTemplates.ts +0 -105
- package/src/gates/test/enrichment/signature.ts +0 -58
- package/src/gates/test/enrichment/stackParser.ts +0 -149
- package/src/gates/test/enrichment/types.ts +0 -67
- package/src/gates/test/formatters/markdown.spec.ts +0 -942
- package/src/gates/test/formatters/markdown.ts +0 -296
- package/src/gates/test/index.ts +0 -54
- package/src/gates/test/schema.spec.ts +0 -372
- package/src/gates/test/schema.ts +0 -327
- package/src/gates/validator.ts +0 -92
- package/src/gates.ts +0 -1022
- package/src/git/operations.ts +0 -592
- package/src/git/parseRemote.ts +0 -22
- package/src/github/api.ts +0 -584
- package/src/github/batch-ops.ts +0 -215
- package/src/github/client.ts +0 -647
- package/src/github/contextDiet.ts +0 -205
- package/src/github/diffHunks.ts +0 -285
- package/src/github/index.ts +0 -11
- package/src/github/minimalContext.ts +0 -212
- package/src/github/minimalContextClient.ts +0 -105
- package/src/github/symbolMap.ts +0 -370
- package/src/github/types.ts +0 -166
- package/src/governance/index.ts +0 -42
- package/src/governance/mcpStatus.ts +0 -258
- package/src/governance/timeoutAdjustment.ts +0 -149
- package/src/governance/turnCostSummary.ts +0 -182
- package/src/hooks/events.ts +0 -374
- package/src/hooks/index.ts +0 -8
- package/src/hostility/checks.ts +0 -408
- package/src/hostility/index.ts +0 -108
- package/src/hostility/score.ts +0 -143
- package/src/interactive/planDiff.ts +0 -168
- package/src/interactive/planHistory.ts +0 -205
- package/src/interactive/planReview.ts +0 -531
- package/src/learning/counter-example.ts +0 -174
- package/src/learning/prompts.ts +0 -107
- package/src/learning/storage.ts +0 -230
- package/src/lexsona/client.ts +0 -367
- package/src/lexsona/index.ts +0 -44
- package/src/lexsona/logger.ts +0 -408
- package/src/lexsona/types.ts +0 -177
- package/src/mcp/DEPRECATED.md +0 -33
- package/src/mcp/server.ts +0 -3587
- package/src/mcp/types/guided-response.ts +0 -95
- package/src/mcp/types.ts +0 -468
- package/src/mcp/workflow/state-machine.ts +0 -277
- package/src/mergeEligibility.ts +0 -355
- package/src/mergeOrder.ts +0 -170
- package/src/metrics/export.ts +0 -472
- package/src/metrics/index.ts +0 -35
- package/src/metrics/turncost.ts +0 -284
- package/src/monitoring/README.md +0 -222
- package/src/monitoring/audit.ts +0 -98
- package/src/monitoring/cache.ts +0 -121
- package/src/monitoring/dashboards/grafana-dashboard.json +0 -172
- package/src/monitoring/errorRecovery.ts +0 -334
- package/src/monitoring/errors.ts +0 -105
- package/src/monitoring/fileLogger.ts +0 -194
- package/src/monitoring/hallucinations.ts +0 -45
- package/src/monitoring/health.ts +0 -171
- package/src/monitoring/index.ts +0 -16
- package/src/monitoring/lock.ts +0 -158
- package/src/monitoring/logger.ts +0 -178
- package/src/monitoring/profiler.ts +0 -156
- package/src/monitoring/tokenLogger.ts +0 -141
- package/src/orchestrate/analyzer.ts +0 -461
- package/src/orchestrate/index.ts +0 -6
- package/src/orchestrate/types.ts +0 -65
- package/src/orchestration/README.md +0 -480
- package/src/orchestration/agentAssigner.ts +0 -206
- package/src/orchestration/batchPlanner.ts +0 -201
- package/src/orchestration/conflictClustering.ts +0 -344
- package/src/orchestration/conflictGraph.ts +0 -63
- package/src/orchestration/conflictPredictor.ts +0 -170
- package/src/orchestration/deliverablesGenerator.ts +0 -345
- package/src/orchestration/determinism.ts +0 -232
- package/src/orchestration/index.ts +0 -45
- package/src/orchestration/mergeTreeSimulator.ts +0 -137
- package/src/orchestration/mis.ts +0 -123
- package/src/orchestration/toolchainManifest.ts +0 -169
- package/src/orchestration/types.ts +0 -103
- package/src/performance.README.md +0 -99
- package/src/performance.ts +0 -279
- package/src/planner/README.md +0 -215
- package/src/planner/dependencyParser.ts +0 -404
- package/src/planner/dependencyScoring.ts +0 -346
- package/src/planner/fileAnalysis.ts +0 -693
- package/src/planner/index.ts +0 -41
- package/src/planner/scopeValidator.ts +0 -308
- package/src/planner/types.ts +0 -80
- package/src/planner/validation.ts +0 -493
- package/src/preview/constraints.ts +0 -333
- package/src/procedures/index.ts +0 -47
- package/src/procedures/loader.ts +0 -252
- package/src/procedures/schema.ts +0 -191
- package/src/procedures/stateMachine.ts +0 -160
- package/src/procedures/types.ts +0 -178
- package/src/receipts/emit.ts +0 -354
- package/src/receipts/index.ts +0 -48
- package/src/receipts/schema.ts +0 -227
- package/src/report/aggregate.ts +0 -160
- package/src/runs/artifacts.ts +0 -315
- package/src/runs/attribution.ts +0 -132
- package/src/runs/context.ts +0 -54
- package/src/runs/decisions.ts +0 -407
- package/src/runs/enforcement.ts +0 -395
- package/src/runs/failures.ts +0 -517
- package/src/runs/index.ts +0 -141
- package/src/runs/manager.ts +0 -910
- package/src/runs/statusBuilder.ts +0 -233
- package/src/runs/storage.ts +0 -290
- package/src/runs/types.ts +0 -216
- package/src/schema/flakeReport.ts +0 -74
- package/src/schema/gateMapping.ts +0 -107
- package/src/schema/gateReport.ts +0 -236
- package/src/schema/weaveLock.ts +0 -51
- package/src/schema.ts +0 -313
- package/src/schemas/executorManifest.ts +0 -204
- package/src/schemas/feature-spec-v0.ts +0 -40
- package/src/schemas/persona.ts +0 -162
- package/src/schemas/project.ts +0 -91
- package/src/schemas/runCentric.ts +0 -402
- package/src/schemas/task-contract.ts +0 -626
- package/src/schemas/vacuumReadyPrompt.ts +0 -128
- package/src/sdk/index.ts +0 -113
- package/src/sdk/parser.ts +0 -101
- package/src/sdk/query.ts +0 -315
- package/src/sdk/validator.ts +0 -114
- package/src/security/README.md +0 -496
- package/src/security/authentication.ts +0 -173
- package/src/security/authorization.ts +0 -348
- package/src/security/commandValidator.ts +0 -195
- package/src/security/compliance.ts +0 -688
- package/src/security/index.ts +0 -85
- package/src/security/policy.ts +0 -399
- package/src/security/sarif.ts +0 -179
- package/src/security/scanning.ts +0 -362
- package/src/security/secrets.ts +0 -520
- package/src/shared/git/index.ts +0 -30
- package/src/shared/git/runGit.ts +0 -281
- package/src/shared/git/runtime.ts +0 -66
- package/src/snapshot/builder.ts +0 -229
- package/src/snapshot/index.ts +0 -8
- package/src/store/CONTRACT.md +0 -189
- package/src/store/README.md +0 -22
- package/src/store/index.ts +0 -99
- package/src/store/inmemory/index.ts +0 -10
- package/src/store/inmemory/run-store.ts +0 -268
- package/src/store/postgres/.gitkeep +0 -0
- package/src/store/run-store.ts +0 -405
- package/src/store/sqlite/index.ts +0 -7
- package/src/store/sqlite/run-store.ts +0 -525
- package/src/store/sqlite/schema.sql +0 -67
- package/src/telemetry/frames.ts +0 -179
- package/src/telemetry/index.ts +0 -5
- package/src/tiers/index.ts +0 -34
- package/src/tiers/metrics.ts +0 -156
- package/src/tiers/schema.ts +0 -95
- package/src/tiers/suggest.ts +0 -183
- package/src/types/guardrails.ts +0 -452
- package/src/types/index.ts +0 -42
- package/src/util/canonicalJson.ts +0 -29
- package/src/util/colorControl.ts +0 -46
- package/src/util/envUtils.ts +0 -139
- package/src/util/hash.ts +0 -69
- package/src/util/lockHash.ts +0 -90
- package/src/util/minHeap.ts +0 -108
- package/src/util/progress.ts +0 -89
- package/src/util/tokenEstimator.ts +0 -55
- package/src/utils/fingerprint.ts +0 -105
- package/src/utils/paths.ts +0 -209
- package/src/utils/tokens.ts +0 -151
- package/src/utils/validation.ts +0 -53
- package/src/verification/diff-applier.ts +0 -60
- package/src/verification/engine-verifier.ts +0 -171
- package/src/verification/errors.ts +0 -30
- package/src/verification/index.ts +0 -13
- package/src/weave/audit/index.ts +0 -17
- package/src/weave/audit/logger.ts +0 -206
- package/src/weave/authority/evaluator.ts +0 -660
- package/src/weave/authority/index.ts +0 -30
- package/src/weave/authority/schema.ts +0 -292
- package/src/weave/checkpoint/index.ts +0 -7
- package/src/weave/checkpoint/storage.ts +0 -223
- package/src/weave/checkpoint/types.ts +0 -121
- package/src/weave/checkpoint/utils.ts +0 -207
- package/src/weave/clusterGates.ts +0 -366
- package/src/weave/draftPR.ts +0 -214
- package/src/weave/executor/d1-executor.ts +0 -822
- package/src/weave/executor/d2-executor.ts +0 -381
- package/src/weave/executor/index.ts +0 -24
- package/src/weave/executor/types.ts +0 -135
- package/src/weave/fanout/generator.ts +0 -186
- package/src/weave/fanout/index.ts +0 -51
- package/src/weave/fanout/loader.ts +0 -134
- package/src/weave/fanout/matcher.ts +0 -239
- package/src/weave/fanout/schema.ts +0 -178
- package/src/weave/frameHelper.ts +0 -126
- package/src/weave/gateFailureHandler.ts +0 -405
- package/src/weave/index.ts +0 -89
- package/src/weave/lockFile.ts +0 -193
- package/src/weave/mergeHelpers.ts +0 -377
- package/src/weave/mergeWeaveSequential.ts +0 -282
- package/src/weave/metrics/calculator.ts +0 -362
- package/src/weave/metrics/index.ts +0 -44
- package/src/weave/metrics/logger.ts +0 -291
- package/src/weave/metrics/schema.ts +0 -505
- package/src/weave/planner/index.ts +0 -23
- package/src/weave/planner/planner.ts +0 -411
- package/src/weave/planner/types.ts +0 -181
- package/src/weave/policy/index.ts +0 -63
- package/src/weave/policy/loader.ts +0 -148
- package/src/weave/policy/schema.ts +0 -290
- package/src/weave/post-merge-checks.ts +0 -220
- package/src/weave/preflightConflicts.ts +0 -375
- package/src/weave/receiptHelper.ts +0 -287
- package/src/weave/recovery.ts +0 -232
- package/src/weave/resolutionGuidance.ts +0 -173
- package/src/weave/stateMachine.ts +0 -426
- package/src/weave/testfix/applier.ts +0 -195
- package/src/weave/testfix/index.ts +0 -18
- package/src/weave/testfix/loader.ts +0 -116
- package/src/weave/testfix/matcher.ts +0 -158
- package/src/weave/testfix/schema.ts +0 -218
- package/src/weave/types.ts +0 -305
- package/src/weave/utils/copilot-completion.ts +0 -76
- package/test-mcp-dogfood.mjs +0 -128
- package/test-mcp.mjs +0 -116
- package/tests/README.md +0 -155
- package/tests/advanced-cli-e2e.spec.ts +0 -218
- package/tests/agentAssigner.spec.ts +0 -261
- package/tests/ai-conflict-strategy-cache.spec.ts +0 -254
- package/tests/ai-conflict-strategy-risk.spec.ts +0 -287
- package/tests/ai-conflict-strategy-schema.spec.ts +0 -252
- package/tests/ai-conflict-strategy.spec.ts +0 -442
- package/tests/aliases/resolver.spec.ts +0 -238
- package/tests/audit/context.spec.ts +0 -283
- package/tests/audit/emitter.spec.ts +0 -347
- package/tests/audit/gateMatrix.spec.ts +0 -335
- package/tests/audit/integration.spec.ts +0 -236
- package/tests/audit/redaction.spec.ts +0 -290
- package/tests/audit/sarif-integration.spec.ts +0 -303
- package/tests/audit/sarif.spec.ts +0 -458
- package/tests/audit/schema-events.spec.ts +0 -421
- package/tests/audit/schema.spec.ts +0 -434
- package/tests/audit/sdk-integration.spec.ts +0 -598
- package/tests/audit/sdk.spec.ts +0 -318
- package/tests/audit/signing-integration.spec.ts +0 -276
- package/tests/audit/signing.spec.ts +0 -350
- package/tests/audit-signing.spec.ts +0 -406
- package/tests/audit-verify-cli.spec.ts +0 -176
- package/tests/autopilot-e2e-level3-4.spec.ts +0 -741
- package/tests/autopilot-integration.spec.ts +0 -274
- package/tests/autopilot-level1.spec.ts +0 -449
- package/tests/autopilot-level2.spec.ts +0 -188
- package/tests/autopilot-level3.spec.ts +0 -266
- package/tests/autopilot-level4.spec.ts +0 -454
- package/tests/autopilot.spec.ts +0 -379
- package/tests/ax-error-adapters.spec.ts +0 -580
- package/tests/batch-planner.spec.ts +0 -500
- package/tests/benchmark-infrastructure.spec.ts +0 -445
- package/tests/benchmarks/README.md +0 -103
- package/tests/benchmarks/baselines/baseline.json +0 -127
- package/tests/benchmarks/core/dependencyResolver.bench.ts +0 -128
- package/tests/benchmarks/core/planParser.bench.ts +0 -114
- package/tests/benchmarks/core/topologicalSort.bench.ts +0 -102
- package/tests/benchmarks/index.ts +0 -36
- package/tests/benchmarks/io/fileOperations.bench.ts +0 -132
- package/tests/benchmarks/io/gitOperations.bench.ts +0 -99
- package/tests/benchmarks/utils/graphGenerator.ts +0 -201
- package/tests/benchmarks/utils/reporter.ts +0 -231
- package/tests/benchmarks/workflows/endToEnd.bench.ts +0 -132
- package/tests/bootstrap.test.ts +0 -319
- package/tests/budget-tracker.spec.ts +0 -279
- package/tests/bulkOps.spec.ts +0 -166
- package/tests/bulletproof-determinism.test.ts +0 -223
- package/tests/canonicalJson.test.ts +0 -130
- package/tests/checkRunConverter.spec.ts +0 -357
- package/tests/cli/commands/gate/test.spec.ts +0 -564
- package/tests/cli/emit-frames-flag.spec.ts +0 -117
- package/tests/cli/exitHandler.spec.ts +0 -314
- package/tests/cli/flags.spec.ts +0 -223
- package/tests/cli/formatters.spec.ts +0 -513
- package/tests/cli/output.spec.ts +0 -221
- package/tests/cli-autopilot.spec.ts +0 -170
- package/tests/cli-budget-guards.spec.ts +0 -210
- package/tests/cli-color-control.spec.ts +0 -334
- package/tests/cli-deliverables-generator.spec.ts +0 -185
- package/tests/cli-determinism.spec.ts +0 -496
- package/tests/cli-init-enterprise.spec.ts +0 -294
- package/tests/cli-init-json.spec.ts +0 -154
- package/tests/cli-init-local.spec.ts +0 -159
- package/tests/cli-json-envelope.spec.ts +0 -140
- package/tests/cli-json.spec.ts +0 -408
- package/tests/cli-orchestrate-plan-batch.spec.ts +0 -329
- package/tests/cli-orchestrate.spec.ts +0 -231
- package/tests/cli-plan-generation.spec.ts +0 -367
- package/tests/cli-plan-review.spec.ts +0 -300
- package/tests/cli-progress.spec.ts +0 -193
- package/tests/cli-ux-enhancements.spec.ts +0 -213
- package/tests/cliJsonPurity.spec.ts +0 -437
- package/tests/cliSuggestDeps.spec.ts +0 -360
- package/tests/cluster-gates-rollback.spec.ts +0 -353
- package/tests/command-validator-integration.spec.ts +0 -305
- package/tests/command-validator.spec.ts +0 -380
- package/tests/commands/autopilot.spec.ts +0 -124
- package/tests/commands/config-validate.spec.ts +0 -301
- package/tests/commands/config.spec.ts +0 -311
- package/tests/commands/create-project.spec.ts +0 -90
- package/tests/commands/doctor.spec.ts +0 -57
- package/tests/commands/execute.spec.ts +0 -293
- package/tests/commands/gateAttest.spec.ts +0 -172
- package/tests/commands/gateImport.spec.ts +0 -176
- package/tests/commands/gateReport.spec.ts +0 -130
- package/tests/commands/guards.spec.ts +0 -114
- package/tests/commands/idea.spec.ts +0 -177
- package/tests/commands/merge.spec.ts +0 -166
- package/tests/commands/plan.spec.ts +0 -123
- package/tests/commands/query.spec.ts +0 -294
- package/tests/commands/report.spec.ts +0 -54
- package/tests/commands/retry.spec.ts +0 -300
- package/tests/commands/schema.spec.ts +0 -136
- package/tests/commands/validation.spec.ts +0 -229
- package/tests/completion.spec.ts +0 -133
- package/tests/config-inspect.spec.ts +0 -202
- package/tests/conflictClustering-e2e.spec.ts +0 -278
- package/tests/conflictClustering.spec.ts +0 -550
- package/tests/conflictGraph.spec.ts +0 -126
- package/tests/conflictPredictor.spec.ts +0 -238
- package/tests/deliverables-generator.spec.ts +0 -329
- package/tests/deliverables.spec.ts +0 -381
- package/tests/dependencyParser-github.spec.ts +0 -244
- package/tests/dependencyParser.spec.ts +0 -386
- package/tests/dependencyScoring.spec.ts +0 -668
- package/tests/deterministic-applicable.test.ts +0 -156
- package/tests/deterministic-build.test.ts +0 -172
- package/tests/deterministic-simple.test.ts +0 -32
- package/tests/discover-suggest-integration.spec.ts +0 -340
- package/tests/dogfood-merge-weave-script.spec.ts +0 -150
- package/tests/e2e/planner.spec.ts +0 -596
- package/tests/e2e-comprehensive.test.ts +0 -500
- package/tests/e2e-determinism.test.ts +0 -293
- package/tests/e2e-synthetic-6pr-weave.spec.ts +0 -329
- package/tests/enterprise-init.spec.ts +0 -350
- package/tests/envUtils.spec.ts +0 -267
- package/tests/error-handling.test.ts +0 -104
- package/tests/error-recovery.spec.ts +0 -451
- package/tests/execution-plan-v1.test.ts +0 -257
- package/tests/executionState-loadGateResults.spec.ts +0 -267
- package/tests/executionState.test.ts +0 -169
- package/tests/executors/README.md +0 -100
- package/tests/executors/frameContract-integration.spec.ts +0 -324
- package/tests/executors/frameContract.spec.ts +0 -531
- package/tests/executors/guardrailEnforcement.spec.ts +0 -424
- package/tests/executors/lifecycle.spec.ts +0 -313
- package/tests/executors/toolBudget.spec.ts +0 -473
- package/tests/feature-spec-v0.test.ts +0 -145
- package/tests/fileAnalysis.spec.ts +0 -946
- package/tests/fingerprint.spec.ts +0 -100
- package/tests/fixtures/README.md +0 -380
- package/tests/fixtures/deliverables/batch-example-plan.json +0 -62
- package/tests/fixtures/executors/README.md +0 -57
- package/tests/fixtures/executors/index.ts +0 -9
- package/tests/fixtures/executors/mock-executor.ts +0 -204
- package/tests/fixtures/executors/registry.ts +0 -51
- package/tests/fixtures/executors/types.ts +0 -95
- package/tests/fixtures/fixtures.spec.ts +0 -307
- package/tests/fixtures/gates/configs.ts +0 -234
- package/tests/fixtures/gates/results.ts +0 -234
- package/tests/fixtures/harvest-bundle-fixture.json +0 -87
- package/tests/fixtures/index.ts +0 -219
- package/tests/fixtures/invalid/plans.ts +0 -178
- package/tests/fixtures/jest/all-passing.json +0 -71
- package/tests/fixtures/jest/snapshot-failures.json +0 -66
- package/tests/fixtures/jest/some-failing.json +0 -100
- package/tests/fixtures/jest/with-location.json +0 -84
- package/tests/fixtures/junit/cdata-messages.xml +0 -29
- package/tests/fixtures/junit/multiple-suites.xml +0 -30
- package/tests/fixtures/junit/single-suite.xml +0 -17
- package/tests/fixtures/junit/with-errors.xml +0 -19
- package/tests/fixtures/junit/with-skipped.xml +0 -18
- package/tests/fixtures/npm-audit.json +0 -32
- package/tests/fixtures/plan.bad-schema.json +0 -5
- package/tests/fixtures/plan.bad-unknown-dep.json +0 -10
- package/tests/fixtures/plan.ci-gates.json +0 -36
- package/tests/fixtures/plan.complex-cycle.json +0 -22
- package/tests/fixtures/plan.cycle.json +0 -14
- package/tests/fixtures/plan.deep-chain.json +0 -95
- package/tests/fixtures/plan.dogfood-execute.json +0 -36
- package/tests/fixtures/plan.gates.json +0 -30
- package/tests/fixtures/plan.integration-pyramid.json +0 -56
- package/tests/fixtures/plan.orphans.json +0 -22
- package/tests/fixtures/plan.parallel.json +0 -30
- package/tests/fixtures/plan.tiny.json +0 -18
- package/tests/fixtures/plan.wide-parallel.json +0 -75
- package/tests/fixtures/plan.with-failures.json +0 -26
- package/tests/fixtures/plan.with-vuln.json +0 -25
- package/tests/fixtures/planner/cross-module.json +0 -101
- package/tests/fixtures/planner/cycle-error.json +0 -56
- package/tests/fixtures/planner/diamond-pattern.json +0 -74
- package/tests/fixtures/planner/empty-repo.json +0 -9
- package/tests/fixtures/planner/file-overlap-heavy.json +0 -110
- package/tests/fixtures/planner/invalid-pr.json +0 -25
- package/tests/fixtures/planner/merge-conflicts.json +0 -42
- package/tests/fixtures/planner/mixed-deps.json +0 -101
- package/tests/fixtures/planner/self-dependency.json +0 -24
- package/tests/fixtures/planner/simple-stack.json +0 -79
- package/tests/fixtures/planner/single-pr.json +0 -25
- package/tests/fixtures/planner/stale-pr.json +0 -40
- package/tests/fixtures/plans/complex.ts +0 -201
- package/tests/fixtures/plans/diamond.ts +0 -115
- package/tests/fixtures/plans/linear.ts +0 -74
- package/tests/fixtures/plans/simple.ts +0 -61
- package/tests/fixtures/prs/basic.ts +0 -175
- package/tests/fixtures/prs/withDeps.ts +0 -197
- package/tests/fixtures/scan-results-clean.sarif +0 -15
- package/tests/fixtures/scan-results.sarif +0 -74
- package/tests/fixtures/scenarios/mergeWorkflows.ts +0 -300
- package/tests/fixtures/scenarios/syntheticWeave.ts +0 -351
- package/tests/fixtures/snapshot/package.json +0 -5
- package/tests/fixtures/snapshot/sample.ts +0 -21
- package/tests/fixtures/utils/cleanup.ts +0 -81
- package/tests/fixtures/utils/mockGitHub.ts +0 -219
- package/tests/fixtures/utils/tempDir.ts +0 -109
- package/tests/fixtures/verification/expected-verification.json +0 -16
- package/tests/fixtures/verification/receipt.json +0 -31
- package/tests/fixtures/verification/snapshot.json +0 -44
- package/tests/fixtures/vitest/all-passing.json +0 -67
- package/tests/fixtures/vitest/complex-nested-suites.json +0 -98
- package/tests/fixtures/vitest/some-failing.json +0 -98
- package/tests/fixtures/vitest/with-coverage.json +0 -97
- package/tests/fixtures-usage-examples.spec.ts +0 -304
- package/tests/flakeReport.spec.ts +0 -267
- package/tests/frames/ci-gate-integration.spec.ts +0 -331
- package/tests/frames/controller.spec.ts +0 -165
- package/tests/frames/emitter.spec.ts +0 -371
- package/tests/frames/idempotency.spec.ts +0 -177
- package/tests/frames/storage.spec.ts +0 -346
- package/tests/frames/types.spec.ts +0 -249
- package/tests/frames/v2-schema-integration.spec.ts +0 -435
- package/tests/gate-working-directory.spec.ts +0 -204
- package/tests/gateMapping.spec.ts +0 -161
- package/tests/gateReportIntegration.spec.ts +0 -175
- package/tests/gateReportValidation.spec.ts +0 -452
- package/tests/gates/test/adapters/jest-json.spec.ts +0 -372
- package/tests/gates/test/adapters/junit-xml.spec.ts +0 -421
- package/tests/gates/test/adapters/registry.spec.ts +0 -376
- package/tests/gates/test/adapters/vitest-json.spec.ts +0 -455
- package/tests/gates/test/enrichment/failureId.spec.ts +0 -131
- package/tests/gates/test/enrichment/nextActions.spec.ts +0 -365
- package/tests/gates/test/enrichment/rerunTemplates.spec.ts +0 -187
- package/tests/gates/test/enrichment/signature.spec.ts +0 -163
- package/tests/gates/test/enrichment/stackParser.spec.ts +0 -203
- package/tests/gates/turncost-integration.spec.ts +0 -221
- package/tests/gates/validation-integration.spec.ts +0 -147
- package/tests/gates/validator.spec.ts +0 -200
- package/tests/gates.test.ts +0 -255
- package/tests/gatesWithPolicy.hostilityTimeoutAdjustment.spec.ts +0 -156
- package/tests/git-operations-receipts.spec.ts +0 -121
- package/tests/git-operations.test.ts +0 -152
- package/tests/git-runtime.spec.ts +0 -175
- package/tests/github-api.labels.spec.ts +0 -21
- package/tests/github-api.test.ts +0 -85
- package/tests/github-context-diet.spec.ts +0 -441
- package/tests/github-diff-hunks.spec.ts +0 -387
- package/tests/github-integration.spec.ts +0 -774
- package/tests/github-minimal-context.spec.ts +0 -338
- package/tests/github-symbol-map.spec.ts +0 -414
- package/tests/githubClient.spec.ts +0 -123
- package/tests/governance/mcpStatus.spec.ts +0 -276
- package/tests/governance/timeoutAdjustment.spec.ts +0 -149
- package/tests/governance/turnCostSummary.spec.ts +0 -188
- package/tests/governance-retention.spec.ts +0 -151
- package/tests/governance-wrapper-delegation.spec.ts +0 -148
- package/tests/guardrails.spec.ts +0 -860
- package/tests/hash.test.ts +0 -83
- package/tests/helpers/cli.ts +0 -23
- package/tests/helpers/getStd.ts +0 -1
- package/tests/helpers/makeGate.ts +0 -19
- package/tests/helpers/plannerTestHelpers.ts +0 -314
- package/tests/hooks/events.spec.ts +0 -518
- package/tests/hostility/checks.spec.ts +0 -295
- package/tests/hostility/integration.spec.ts +0 -123
- package/tests/hostility/score.spec.ts +0 -175
- package/tests/init.spec.ts +0 -270
- package/tests/integration/hipaa-encryption.spec.ts +0 -148
- package/tests/integration/lex-smoke-test.spec.ts +0 -328
- package/tests/integration-e2e.test.ts +0 -244
- package/tests/integration-matrix.test.ts +0 -409
- package/tests/interPRConflicts.spec.ts +0 -254
- package/tests/interactive-plan-history.spec.ts +0 -255
- package/tests/interactive-plan-review.spec.ts +0 -287
- package/tests/issue-analyzer.spec.ts +0 -593
- package/tests/lexsona-integration.spec.ts +0 -311
- package/tests/localOverlay.spec.ts +0 -203
- package/tests/lockHash.spec.ts +0 -167
- package/tests/mcp-auth-errors.spec.ts +0 -190
- package/tests/mcp-contracts.spec.ts +0 -290
- package/tests/mcp-gates-external-plan.spec.ts +0 -146
- package/tests/mcp-granular-tools.spec.ts +0 -208
- package/tests/mcp-runstore-integration.spec.ts +0 -334
- package/tests/mcp-scope-integration.spec.ts +0 -318
- package/tests/mcp-task-handoff.spec.ts +0 -320
- package/tests/mcp-workflow-guide.spec.ts +0 -53
- package/tests/mcp.test.ts +0 -151
- package/tests/merge-conflict-detection.spec.ts +0 -260
- package/tests/mergeEligibility.test.ts +0 -201
- package/tests/mergeLockHash.spec.ts +0 -158
- package/tests/mergeOrder-with-fixtures.spec.ts +0 -215
- package/tests/mergeOrder.test.ts +0 -108
- package/tests/mergeTreeSimulator.spec.ts +0 -145
- package/tests/metrics/export.spec.ts +0 -446
- package/tests/metrics/turncost.spec.ts +0 -309
- package/tests/metrics-template.spec.ts +0 -137
- package/tests/migrateProfile.spec.ts +0 -254
- package/tests/mis.spec.ts +0 -202
- package/tests/monitoring-audit.spec.ts +0 -181
- package/tests/monitoring-cache.spec.ts +0 -331
- package/tests/monitoring-error-recovery.spec.ts +0 -236
- package/tests/monitoring-errors.spec.ts +0 -193
- package/tests/monitoring-fileLogger.spec.ts +0 -319
- package/tests/monitoring-health.spec.ts +0 -152
- package/tests/monitoring-lock.spec.ts +0 -308
- package/tests/monitoring-logger.spec.ts +0 -157
- package/tests/monitoring-metrics.spec.ts +0 -158
- package/tests/monitoring-profiler.spec.ts +0 -197
- package/tests/orchestration-determinism.spec.ts +0 -204
- package/tests/parseRemote.spec.ts +0 -25
- package/tests/pathResolver.spec.ts +0 -122
- package/tests/paths.spec.ts +0 -68
- package/tests/performance.spec.ts +0 -322
- package/tests/pipeline-determinism.spec.ts +0 -597
- package/tests/plan-tier-integration.spec.ts +0 -184
- package/tests/precedence-resolution.spec.ts +0 -682
- package/tests/preflightConflicts.spec.ts +0 -205
- package/tests/procedures/keystone-policy.spec.ts +0 -296
- package/tests/procedures/loader.spec.ts +0 -585
- package/tests/procedures/pr-review.spec.ts +0 -321
- package/tests/profileResolver.spec.ts +0 -375
- package/tests/progress-indicators.spec.ts +0 -139
- package/tests/promptsResolver.spec.ts +0 -443
- package/tests/public-api.spec.ts +0 -272
- package/tests/query.spec.ts +0 -170
- package/tests/receipts.spec.ts +0 -463
- package/tests/release-prepare.spec.ts +0 -268
- package/tests/report.test.ts +0 -335
- package/tests/resolutionGuidance.spec.ts +0 -160
- package/tests/rotate-secrets-example.spec.ts +0 -198
- package/tests/rulesResolver.spec.ts +0 -232
- package/tests/runGit.spec.ts +0 -229
- package/tests/runner-lifecycle-integration.spec.ts +0 -283
- package/tests/runs/artifacts.spec.ts +0 -367
- package/tests/runs/decisions.spec.ts +0 -495
- package/tests/runs/enforcement.spec.ts +0 -555
- package/tests/runs/failures.spec.ts +0 -554
- package/tests/runs/manager-runstore-integration.spec.ts +0 -455
- package/tests/runs/manager.spec.ts +0 -678
- package/tests/runs-manager.spec.ts +0 -485
- package/tests/safety-acceptance.spec.ts +0 -278
- package/tests/safety-enhanced.spec.ts +0 -329
- package/tests/safety-framework.spec.ts +0 -427
- package/tests/safety-guards-integration.spec.ts +0 -213
- package/tests/safety-integration.spec.ts +0 -278
- package/tests/sarif-parser.spec.ts +0 -148
- package/tests/schema.test.ts +0 -88
- package/tests/schemas/behavior-rule.spec.ts +0 -366
- package/tests/schemas/executorManifest.spec.ts +0 -441
- package/tests/schemas/persona-integration.spec.ts +0 -62
- package/tests/schemas/persona.spec.ts +0 -172
- package/tests/schemas/project.spec.ts +0 -247
- package/tests/schemas/run-store.spec.ts +0 -553
- package/tests/schemas/runCentric.spec.ts +0 -463
- package/tests/schemas/vacuumReadyPrompt.spec.ts +0 -515
- package/tests/scope-github-auto-detection.spec.ts +0 -200
- package/tests/scopeValidator.spec.ts +0 -497
- package/tests/security-authentication.spec.ts +0 -42
- package/tests/security-authorization.spec.ts +0 -350
- package/tests/security-cli.spec.ts +0 -264
- package/tests/security-compliance.spec.ts +0 -334
- package/tests/security-policy.spec.ts +0 -295
- package/tests/security-scanning.spec.ts +0 -349
- package/tests/security-secrets.spec.ts +0 -401
- package/tests/store/create-run-store.spec.ts +0 -185
- package/tests/store/inmemory/run-store.spec.ts +0 -533
- package/tests/store/sqlite/run-store.spec.ts +0 -849
- package/tests/telemetry/frames.spec.ts +0 -120
- package/tests/tiers.spec.ts +0 -466
- package/tests/token-usage.spec.ts +0 -309
- package/tests/toolchain-manifest.spec.ts +0 -145
- package/tests/unified-budget.spec.ts +0 -713
- package/tests/unit/cache/issue-cache.spec.ts +0 -131
- package/tests/unit/fanout/analyzer-integration.spec.ts +0 -398
- package/tests/unit/fanout/analyzer.spec.ts +0 -605
- package/tests/unit/fanout/github-adapter.spec.ts +0 -203
- package/tests/unit/fanout/harvest.spec.ts +0 -93
- package/tests/unit/fanout/monitor.spec.ts +0 -297
- package/tests/unit/fanout/types.spec.ts +0 -308
- package/tests/unit/github/batch-ops.spec.ts +0 -179
- package/tests/unit/learning/counter-example.spec.ts +0 -168
- package/tests/unit/learning/storage.spec.ts +0 -154
- package/tests/unit/preview/constraints.spec.ts +0 -429
- package/tests/unit/runs/attribution.spec.ts +0 -204
- package/tests/unit/schemas/task-contract.spec.ts +0 -483
- package/tests/unit/snapshot/builder.spec.ts +0 -389
- package/tests/unit/verification/engine-verifier.spec.ts +0 -279
- package/tests/unit/weave/authority-evaluator.spec.ts +0 -404
- package/tests/unit/weave/authority-schema.spec.ts +0 -199
- package/tests/unit/weave/auto-undraft-integration.spec.ts +0 -349
- package/tests/unit/weave/copilot-completion.spec.ts +0 -182
- package/tests/unit/weave/d1-executor.spec.ts +0 -269
- package/tests/unit/weave/d2-executor.spec.ts +0 -334
- package/tests/unit/weave/fanout-generator.spec.ts +0 -365
- package/tests/unit/weave/fanout-matcher.spec.ts +0 -320
- package/tests/unit/weave/fanout-schema.spec.ts +0 -221
- package/tests/unit/weave/mergeWeaveSequential.spec.ts +0 -268
- package/tests/unit/weave/metrics-calculator.spec.ts +0 -212
- package/tests/unit/weave/metrics-logger.spec.ts +0 -233
- package/tests/unit/weave/metrics-schema.spec.ts +0 -383
- package/tests/unit/weave/multi-repo-plan.spec.ts +0 -221
- package/tests/unit/weave/planner.spec.ts +0 -227
- package/tests/unit/weave/post-merge-checks.spec.ts +0 -342
- package/tests/unit/weave/recovery.spec.ts +0 -306
- package/tests/unit/weave/testfix/applier.spec.ts +0 -364
- package/tests/unit/weave/testfix/e2e.spec.ts +0 -273
- package/tests/unit/weave/testfix/integration.spec.ts +0 -128
- package/tests/unit/weave/testfix/matcher.spec.ts +0 -321
- package/tests/unit/weave/testfix/schema.spec.ts +0 -298
- package/tests/utils/fingerprint.spec.ts +0 -251
- package/tests/utils/paths.spec.ts +0 -284
- package/tests/utils/tokens.spec.ts +0 -210
- package/tests/utils/validation.spec.ts +0 -215
- package/tests/utils-validation.spec.ts +0 -80
- package/tests/validate-manifests.spec.ts +0 -231
- package/tests/validation.spec.ts +0 -501
- package/tests/vuln-gate.spec.ts +0 -341
- package/tests/weave/adr007-integration.spec.ts +0 -309
- package/tests/weave/checkpoint/cli-integration.spec.ts +0 -118
- package/tests/weave/checkpoint/storage.spec.ts +0 -302
- package/tests/weave/checkpoint/utils.spec.ts +0 -223
- package/tests/weave/frameHelper.spec.ts +0 -423
- package/tests/weave/gateFailureHandler.spec.ts +0 -249
- package/tests/weave/lockFile.spec.ts +0 -387
- package/tests/weave/mergeHelpers.spec.ts +0 -173
- package/tests/weave/receiptHelper.spec.ts +0 -261
- package/tests/weave/stateMachine.spec.ts +0 -436
- package/tests/weave-contract.test.ts +0 -517
- package/tests/weave-e2e.spec.ts +0 -279
- package/tests/weaveLock.spec.ts +0 -136
- package/tests/workflow-state-machine.spec.ts +0 -274
- package/tests/write-protection.spec.ts +0 -213
- package/tsconfig.json +0 -18
- package/tsup.config.ts +0 -12
- package/vitest.benchmark.config.ts +0 -17
- package/vitest.config.ts +0 -28
- package/vitest.git.config.ts +0 -12
- package/vitest.slow-cli.config.ts +0 -28
|
@@ -0,0 +1,879 @@
|
|
|
1
|
+
var __lexrunnerImportMetaUrl = require("node:url").pathToFileURL(__filename).href;
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
|
|
23
|
+
// src/errors/index.ts
|
|
24
|
+
var errors_exports = {};
|
|
25
|
+
__export(errors_exports, {
|
|
26
|
+
AXErrorException: () => AXErrorException,
|
|
27
|
+
AXErrorSchema: () => AXErrorSchema,
|
|
28
|
+
ErrorCodes: () => ErrorCodes,
|
|
29
|
+
configInvalidError: () => configInvalidError,
|
|
30
|
+
createAXError: () => createAXError,
|
|
31
|
+
cycleDetectedError: () => cycleDetectedError,
|
|
32
|
+
gateFailedError: () => gateFailedError,
|
|
33
|
+
gitOperationError: () => gitOperationError,
|
|
34
|
+
githubApiError: () => githubApiError,
|
|
35
|
+
isAXError: () => isAXError,
|
|
36
|
+
isAXErrorException: () => isAXErrorException,
|
|
37
|
+
mcpToolError: () => mcpToolError,
|
|
38
|
+
mergeConflictError: () => mergeConflictError,
|
|
39
|
+
planNotFoundError: () => planNotFoundError,
|
|
40
|
+
planValidationError: () => planValidationError,
|
|
41
|
+
profileNotFoundError: () => profileNotFoundError,
|
|
42
|
+
runNotFoundError: () => runNotFoundError,
|
|
43
|
+
securityAuthFailedError: () => securityAuthFailedError,
|
|
44
|
+
securityCommandBlockedError: () => securityCommandBlockedError,
|
|
45
|
+
securityComplianceViolationError: () => securityComplianceViolationError,
|
|
46
|
+
securitySarifParseError: () => securitySarifParseError,
|
|
47
|
+
securityScanFailedError: () => securityScanFailedError,
|
|
48
|
+
securitySecretDetectedError: () => securitySecretDetectedError,
|
|
49
|
+
securitySecretNotFoundError: () => securitySecretNotFoundError,
|
|
50
|
+
securityUnauthorizedError: () => securityUnauthorizedError,
|
|
51
|
+
throwAXError: () => throwAXError,
|
|
52
|
+
toAXError: () => toAXError,
|
|
53
|
+
toolBudgetExceededError: () => toolBudgetExceededError,
|
|
54
|
+
unknownDependencyError: () => unknownDependencyError,
|
|
55
|
+
weaveLockConflictError: () => weaveLockConflictError,
|
|
56
|
+
weavePreflightFailedError: () => weavePreflightFailedError,
|
|
57
|
+
weaveStateInvalidError: () => weaveStateInvalidError,
|
|
58
|
+
wrapAsAXError: () => wrapAsAXError,
|
|
59
|
+
writeProtectionError: () => writeProtectionError
|
|
60
|
+
});
|
|
61
|
+
module.exports = __toCommonJS(errors_exports);
|
|
62
|
+
|
|
63
|
+
// node_modules/@smartergpt/lex/dist/shared/errors/ax-error.js
|
|
64
|
+
var import_zod = require("zod");
|
|
65
|
+
var AXErrorSchema = import_zod.z.object({
|
|
66
|
+
/**
|
|
67
|
+
* Stable error code in UPPER_SNAKE_CASE
|
|
68
|
+
* Must be unique and documented in error-codes.ts
|
|
69
|
+
*/
|
|
70
|
+
code: import_zod.z.string().regex(/^[A-Z][A-Z0-9_]*$/, "Error code must be UPPER_SNAKE_CASE (e.g., FRAME_NOT_FOUND)"),
|
|
71
|
+
/**
|
|
72
|
+
* Human-readable error message
|
|
73
|
+
* Should be concise but descriptive
|
|
74
|
+
*/
|
|
75
|
+
message: import_zod.z.string().min(1, "Message is required"),
|
|
76
|
+
/**
|
|
77
|
+
* Optional structured context about the error
|
|
78
|
+
* Include relevant IDs, paths, or values that help diagnose
|
|
79
|
+
*/
|
|
80
|
+
context: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).optional(),
|
|
81
|
+
/**
|
|
82
|
+
* Recovery suggestions - at least one required
|
|
83
|
+
* These tell the agent what to try next
|
|
84
|
+
*/
|
|
85
|
+
nextActions: import_zod.z.array(import_zod.z.string().min(1)).min(1, "At least one nextAction is required")
|
|
86
|
+
});
|
|
87
|
+
function isAXError(value) {
|
|
88
|
+
return AXErrorSchema.safeParse(value).success;
|
|
89
|
+
}
|
|
90
|
+
function createAXError(code, message, nextActions, context) {
|
|
91
|
+
return AXErrorSchema.parse({ code, message, nextActions, context });
|
|
92
|
+
}
|
|
93
|
+
function wrapAsAXError(error, code, nextActions, additionalContext) {
|
|
94
|
+
return createAXError(code, error.message, nextActions, {
|
|
95
|
+
originalError: error.name,
|
|
96
|
+
stack: error.stack?.split("\n").slice(0, 5),
|
|
97
|
+
...additionalContext
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
var AXErrorException = class extends Error {
|
|
101
|
+
constructor(code, message, nextActions, context) {
|
|
102
|
+
super(message);
|
|
103
|
+
__publicField(this, "axError");
|
|
104
|
+
this.name = "AXErrorException";
|
|
105
|
+
this.axError = createAXError(code, message, nextActions, context);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get the structured error for JSON output
|
|
109
|
+
*/
|
|
110
|
+
toAXError() {
|
|
111
|
+
return this.axError;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Serialize to JSON (for CLI --json output)
|
|
115
|
+
*/
|
|
116
|
+
toJSON() {
|
|
117
|
+
return this.axError;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
function isAXErrorException(error) {
|
|
121
|
+
return error instanceof AXErrorException;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// node_modules/@smartergpt/lex/dist/shared/errors/error-codes.js
|
|
125
|
+
var CONFIG_ERROR_CODES = {
|
|
126
|
+
/** lex.yaml not found after workspace is initialized */
|
|
127
|
+
CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND",
|
|
128
|
+
/** lex.yaml exists but has invalid YAML syntax */
|
|
129
|
+
CONFIG_PARSE_ERROR: "CONFIG_PARSE_ERROR",
|
|
130
|
+
/** lex.yaml exists but fails schema validation */
|
|
131
|
+
CONFIG_INVALID: "CONFIG_INVALID"
|
|
132
|
+
};
|
|
133
|
+
var POLICY_ERROR_CODES = {
|
|
134
|
+
/** No policy file found in any search path */
|
|
135
|
+
POLICY_NOT_FOUND: "POLICY_NOT_FOUND",
|
|
136
|
+
/** Policy file exists but has invalid JSON */
|
|
137
|
+
POLICY_PARSE_ERROR: "POLICY_PARSE_ERROR",
|
|
138
|
+
/** Policy file fails schema validation */
|
|
139
|
+
POLICY_INVALID: "POLICY_INVALID",
|
|
140
|
+
/** Policy module ID not found */
|
|
141
|
+
POLICY_MODULE_NOT_FOUND: "POLICY_MODULE_NOT_FOUND"
|
|
142
|
+
};
|
|
143
|
+
var STORE_ERROR_CODES = {
|
|
144
|
+
/** Database connection failed */
|
|
145
|
+
DB_CONNECTION_FAILED: "DB_CONNECTION_FAILED",
|
|
146
|
+
/** Database query failed */
|
|
147
|
+
DB_QUERY_FAILED: "DB_QUERY_FAILED",
|
|
148
|
+
/** Database migration failed */
|
|
149
|
+
DB_MIGRATION_FAILED: "DB_MIGRATION_FAILED",
|
|
150
|
+
/** Frame not found by ID */
|
|
151
|
+
FRAME_NOT_FOUND: "FRAME_NOT_FOUND",
|
|
152
|
+
/** Frame validation failed */
|
|
153
|
+
FRAME_INVALID: "FRAME_INVALID",
|
|
154
|
+
/** Frame save operation failed */
|
|
155
|
+
FRAME_SAVE_FAILED: "FRAME_SAVE_FAILED",
|
|
156
|
+
/** Store initialization failed */
|
|
157
|
+
STORE_INIT_FAILED: "STORE_INIT_FAILED"
|
|
158
|
+
};
|
|
159
|
+
var PROMPT_ERROR_CODES = {
|
|
160
|
+
/** Prompt file not found in any search path */
|
|
161
|
+
PROMPT_NOT_FOUND: "PROMPT_NOT_FOUND",
|
|
162
|
+
/** Prompt template has invalid syntax */
|
|
163
|
+
PROMPT_INVALID: "PROMPT_INVALID",
|
|
164
|
+
/** Prompt rendering failed (missing variables, etc.) */
|
|
165
|
+
PROMPT_RENDER_FAILED: "PROMPT_RENDER_FAILED"
|
|
166
|
+
};
|
|
167
|
+
var SCHEMA_ERROR_CODES = {
|
|
168
|
+
/** Schema file not found */
|
|
169
|
+
SCHEMA_NOT_FOUND: "SCHEMA_NOT_FOUND",
|
|
170
|
+
/** Schema file has invalid JSON */
|
|
171
|
+
SCHEMA_PARSE_ERROR: "SCHEMA_PARSE_ERROR",
|
|
172
|
+
/** Data failed schema validation */
|
|
173
|
+
SCHEMA_VALIDATION_FAILED: "SCHEMA_VALIDATION_FAILED"
|
|
174
|
+
};
|
|
175
|
+
var INSTRUCTIONS_ERROR_CODES = {
|
|
176
|
+
/** Canonical instruction file not found */
|
|
177
|
+
INSTRUCTIONS_CANONICAL_NOT_FOUND: "INSTRUCTIONS_CANONICAL_NOT_FOUND",
|
|
178
|
+
/** Target file already exists (without --force) */
|
|
179
|
+
INSTRUCTIONS_TARGET_EXISTS: "INSTRUCTIONS_TARGET_EXISTS",
|
|
180
|
+
/** Invalid projection target specified */
|
|
181
|
+
INSTRUCTIONS_INVALID_TARGET: "INSTRUCTIONS_INVALID_TARGET",
|
|
182
|
+
/** Instruction projections out of sync */
|
|
183
|
+
INSTRUCTIONS_OUT_OF_SYNC: "INSTRUCTIONS_OUT_OF_SYNC"
|
|
184
|
+
};
|
|
185
|
+
var GIT_ERROR_CODES = {
|
|
186
|
+
/** Not in a git repository */
|
|
187
|
+
GIT_NOT_REPO: "GIT_NOT_REPO",
|
|
188
|
+
/** Git command failed */
|
|
189
|
+
GIT_COMMAND_FAILED: "GIT_COMMAND_FAILED",
|
|
190
|
+
/** Git branch not found */
|
|
191
|
+
GIT_BRANCH_NOT_FOUND: "GIT_BRANCH_NOT_FOUND"
|
|
192
|
+
};
|
|
193
|
+
var LEXSONA_ERROR_CODES = {
|
|
194
|
+
/** Rule not found by ID */
|
|
195
|
+
LEXSONA_RULE_NOT_FOUND: "LEXSONA_RULE_NOT_FOUND",
|
|
196
|
+
/** Correction could not be recorded */
|
|
197
|
+
LEXSONA_CORRECTION_FAILED: "LEXSONA_CORRECTION_FAILED",
|
|
198
|
+
/** Persona not found */
|
|
199
|
+
LEXSONA_PERSONA_NOT_FOUND: "LEXSONA_PERSONA_NOT_FOUND"
|
|
200
|
+
};
|
|
201
|
+
var VALIDATION_ERROR_CODES = {
|
|
202
|
+
/** Required field is missing */
|
|
203
|
+
VALIDATION_REQUIRED_FIELD: "VALIDATION_REQUIRED_FIELD",
|
|
204
|
+
/** Field has invalid type */
|
|
205
|
+
VALIDATION_INVALID_TYPE: "VALIDATION_INVALID_TYPE",
|
|
206
|
+
/** Field value is out of range */
|
|
207
|
+
VALIDATION_OUT_OF_RANGE: "VALIDATION_OUT_OF_RANGE",
|
|
208
|
+
/** Module ID format is invalid */
|
|
209
|
+
VALIDATION_INVALID_MODULE_ID: "VALIDATION_INVALID_MODULE_ID"
|
|
210
|
+
};
|
|
211
|
+
var WORKSPACE_AUTHORITY_ERROR_CODES = {
|
|
212
|
+
/** No trusted local binding matched the invocation. */
|
|
213
|
+
WORKSPACE_UNBOUND: "LEX_WORKSPACE_UNBOUND",
|
|
214
|
+
/** Repository declaration, provider, path, or registry evidence disagreed. */
|
|
215
|
+
REPOSITORY_BINDING_MISMATCH: "LEX_REPOSITORY_BINDING_MISMATCH",
|
|
216
|
+
/** The requested workspace selector was not authorized for the principal. */
|
|
217
|
+
WORKSPACE_SELECTOR_UNAUTHORIZED: "LEX_WORKSPACE_SELECTOR_UNAUTHORIZED",
|
|
218
|
+
/** More than one binding matched without deterministic disambiguation. */
|
|
219
|
+
WORKSPACE_BINDING_AMBIGUOUS: "LEX_WORKSPACE_BINDING_AMBIGUOUS",
|
|
220
|
+
/** Cached canonical authority expired before it could be reverified. */
|
|
221
|
+
AUTHORITY_CACHE_EXPIRED: "LEX_AUTHORITY_CACHE_EXPIRED",
|
|
222
|
+
/** Canonical authority revoked the previously verified grant. */
|
|
223
|
+
AUTHORITY_GRANT_REVOKED: "LEX_AUTHORITY_GRANT_REVOKED"
|
|
224
|
+
};
|
|
225
|
+
var LEX_ERROR_CODES = {
|
|
226
|
+
...CONFIG_ERROR_CODES,
|
|
227
|
+
...POLICY_ERROR_CODES,
|
|
228
|
+
...STORE_ERROR_CODES,
|
|
229
|
+
...PROMPT_ERROR_CODES,
|
|
230
|
+
...SCHEMA_ERROR_CODES,
|
|
231
|
+
...INSTRUCTIONS_ERROR_CODES,
|
|
232
|
+
...GIT_ERROR_CODES,
|
|
233
|
+
...LEXSONA_ERROR_CODES,
|
|
234
|
+
...VALIDATION_ERROR_CODES,
|
|
235
|
+
...WORKSPACE_AUTHORITY_ERROR_CODES
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// node_modules/@smartergpt/lex/dist/shared/errors/compact-error.js
|
|
239
|
+
var import_zod2 = require("zod");
|
|
240
|
+
var CompactErrorEnvelopeSchema = import_zod2.z.object({
|
|
241
|
+
err: import_zod2.z.object({
|
|
242
|
+
code: import_zod2.z.string(),
|
|
243
|
+
msg: import_zod2.z.string(),
|
|
244
|
+
retry: import_zod2.z.boolean(),
|
|
245
|
+
hintId: import_zod2.z.string().optional()
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// src/errors/adapters.ts
|
|
250
|
+
function gateFailedError(ctx) {
|
|
251
|
+
const nextActions = [];
|
|
252
|
+
if (ctx.artifactPath) {
|
|
253
|
+
nextActions.push(`Check gate output in ${ctx.artifactPath}`);
|
|
254
|
+
}
|
|
255
|
+
switch (ctx.gate) {
|
|
256
|
+
case "lint":
|
|
257
|
+
nextActions.push("Run 'npm run lint' locally to reproduce");
|
|
258
|
+
nextActions.push("Fix lint errors and push again");
|
|
259
|
+
break;
|
|
260
|
+
case "typecheck":
|
|
261
|
+
nextActions.push("Run 'npm run typecheck' locally to reproduce");
|
|
262
|
+
nextActions.push("Fix TypeScript errors and push again");
|
|
263
|
+
break;
|
|
264
|
+
case "test":
|
|
265
|
+
nextActions.push("Run 'npm test' locally to reproduce");
|
|
266
|
+
nextActions.push("Check for flaky tests or missing test fixtures");
|
|
267
|
+
break;
|
|
268
|
+
default:
|
|
269
|
+
nextActions.push(`Run the '${ctx.gate}' gate locally to reproduce`);
|
|
270
|
+
}
|
|
271
|
+
if (nextActions.length === 0) {
|
|
272
|
+
nextActions.push("Review the gate failure output for details");
|
|
273
|
+
}
|
|
274
|
+
return createAXError(
|
|
275
|
+
ErrorCodes.GATE_FAILED,
|
|
276
|
+
`Gate '${ctx.gate}'${ctx.item ? ` failed for ${ctx.item}` : " failed"}`,
|
|
277
|
+
nextActions,
|
|
278
|
+
{
|
|
279
|
+
...ctx,
|
|
280
|
+
// Default gates to reversible since they don't mutate state
|
|
281
|
+
reversibility: ctx.reversibility ?? "reversible"
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
function mergeConflictError(ctx) {
|
|
286
|
+
const nextActions = ["Resolve conflicts manually in the affected files"];
|
|
287
|
+
if (ctx.targetBranch) {
|
|
288
|
+
nextActions.push(`Rebase ${ctx.item || "the PR"} on ${ctx.targetBranch}`);
|
|
289
|
+
} else {
|
|
290
|
+
nextActions.push("Rebase on the latest target branch");
|
|
291
|
+
}
|
|
292
|
+
if (ctx.files && ctx.files.length > 0) {
|
|
293
|
+
nextActions.push(`Affected files: ${ctx.files.join(", ")}`);
|
|
294
|
+
}
|
|
295
|
+
return createAXError(
|
|
296
|
+
ErrorCodes.MERGE_CONFLICT,
|
|
297
|
+
`Merge conflict${ctx.item ? ` for ${ctx.item}` : ""}`,
|
|
298
|
+
nextActions,
|
|
299
|
+
{
|
|
300
|
+
...ctx,
|
|
301
|
+
// Merges are reversible via git reset or merge --abort
|
|
302
|
+
reversibility: ctx.reversibility ?? "reversible",
|
|
303
|
+
rollbackPath: ctx.rollbackPath ?? "git merge --abort or git reset --hard HEAD~1"
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function cycleDetectedError(ctx) {
|
|
308
|
+
return createAXError(
|
|
309
|
+
ErrorCodes.PLAN_CYCLE_DETECTED,
|
|
310
|
+
`Dependency cycle detected: ${ctx.cycle.join(" \u2192 ")}`,
|
|
311
|
+
[
|
|
312
|
+
"Review the dependency declarations in the affected PRs",
|
|
313
|
+
"Remove or restructure dependencies to break the cycle",
|
|
314
|
+
`Cycle path: ${ctx.cycle.join(" \u2192 ")}`
|
|
315
|
+
],
|
|
316
|
+
{ ...ctx }
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
function unknownDependencyError(ctx) {
|
|
320
|
+
const nextActions = [
|
|
321
|
+
`Check that '${ctx.dependency}' is included in the plan`,
|
|
322
|
+
`Verify the dependency reference in '${ctx.item}'`
|
|
323
|
+
];
|
|
324
|
+
if (ctx.availableItems && ctx.availableItems.length > 0) {
|
|
325
|
+
nextActions.push(`Available items: ${ctx.availableItems.join(", ")}`);
|
|
326
|
+
}
|
|
327
|
+
return createAXError(
|
|
328
|
+
ErrorCodes.UNKNOWN_DEPENDENCY,
|
|
329
|
+
`Item '${ctx.item}' depends on unknown item '${ctx.dependency}'`,
|
|
330
|
+
nextActions,
|
|
331
|
+
{ ...ctx }
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
function githubApiError(ctx) {
|
|
335
|
+
const nextActions = [];
|
|
336
|
+
if (ctx.status === 401 || ctx.status === 403) {
|
|
337
|
+
return createAXError(
|
|
338
|
+
ErrorCodes.GITHUB_AUTH_ERROR,
|
|
339
|
+
ctx.message || "GitHub authentication failed",
|
|
340
|
+
[
|
|
341
|
+
"Check that GITHUB_TOKEN is set and valid",
|
|
342
|
+
"Verify the token has required permissions",
|
|
343
|
+
"Try: gh auth status"
|
|
344
|
+
],
|
|
345
|
+
{ ...ctx }
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
if (ctx.status === 429 || ctx.retryAfter) {
|
|
349
|
+
const waitTime = ctx.retryAfter ? `${ctx.retryAfter} seconds` : "a few minutes";
|
|
350
|
+
return createAXError(
|
|
351
|
+
ErrorCodes.GITHUB_RATE_LIMIT,
|
|
352
|
+
"GitHub API rate limit exceeded",
|
|
353
|
+
[
|
|
354
|
+
`Wait ${waitTime} before retrying`,
|
|
355
|
+
"Consider using a GitHub App token for higher limits",
|
|
356
|
+
"Reduce API call frequency"
|
|
357
|
+
],
|
|
358
|
+
{ ...ctx }
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
nextActions.push("Check the GitHub API status page");
|
|
362
|
+
if (ctx.endpoint) {
|
|
363
|
+
nextActions.push(`Failed endpoint: ${ctx.endpoint}`);
|
|
364
|
+
}
|
|
365
|
+
nextActions.push("Retry the operation after a brief wait");
|
|
366
|
+
return createAXError(
|
|
367
|
+
ErrorCodes.GITHUB_API_ERROR,
|
|
368
|
+
ctx.message || "GitHub API request failed",
|
|
369
|
+
nextActions,
|
|
370
|
+
{ ...ctx }
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
function gitOperationError(ctx) {
|
|
374
|
+
return createAXError(
|
|
375
|
+
ErrorCodes.GIT_OPERATION_FAILED,
|
|
376
|
+
ctx.message || `Git ${ctx.operation} failed`,
|
|
377
|
+
[
|
|
378
|
+
"Check git status for uncommitted changes",
|
|
379
|
+
"Ensure you're on the correct branch",
|
|
380
|
+
ctx.command ? `Command that failed: ${ctx.command}` : "Review git output for details"
|
|
381
|
+
],
|
|
382
|
+
{ ...ctx }
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
function planValidationError(ctx) {
|
|
386
|
+
const nextActions = ["Review the plan file for schema violations"];
|
|
387
|
+
const errorCount = ctx.errorCount ?? ctx.errors.length;
|
|
388
|
+
if (ctx.planPath) {
|
|
389
|
+
nextActions.push(`Plan file: ${ctx.planPath}`);
|
|
390
|
+
}
|
|
391
|
+
if (ctx.errors.length > 0) {
|
|
392
|
+
nextActions.push(`Errors: ${ctx.errors.join("; ")}`);
|
|
393
|
+
}
|
|
394
|
+
if (ctx.errorsTruncated) {
|
|
395
|
+
nextActions.push(
|
|
396
|
+
`Only the first ${ctx.errors.length} of ${errorCount} validation errors are included`
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
return createAXError(
|
|
400
|
+
ErrorCodes.PLAN_VALIDATION_FAILED,
|
|
401
|
+
`Plan validation failed with ${errorCount} error(s)`,
|
|
402
|
+
nextActions,
|
|
403
|
+
{ ...ctx, errorCount, errorsTruncated: ctx.errorsTruncated ?? false }
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
function toAXError(error, code = ErrorCodes.INTERNAL_ERROR, nextActions) {
|
|
407
|
+
return createAXError(
|
|
408
|
+
code,
|
|
409
|
+
error.message,
|
|
410
|
+
nextActions || ["Review the error details and retry", "Check logs for more context"],
|
|
411
|
+
{
|
|
412
|
+
originalError: error.name,
|
|
413
|
+
stack: error.stack?.split("\n").slice(0, 3)
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
function mcpToolError(code, message, ctx, nextActions) {
|
|
418
|
+
const actions = nextActions || [];
|
|
419
|
+
if (actions.length === 0) {
|
|
420
|
+
switch (ctx.tool) {
|
|
421
|
+
case "plan.create":
|
|
422
|
+
actions.push("Check if configuration files exist in the profile directory");
|
|
423
|
+
actions.push("Run 'local.init' to create missing configuration");
|
|
424
|
+
break;
|
|
425
|
+
case "gates.run":
|
|
426
|
+
actions.push("Ensure plan.json exists - run 'plan.create' first");
|
|
427
|
+
actions.push("Check gate commands are valid and available");
|
|
428
|
+
break;
|
|
429
|
+
case "merge.apply":
|
|
430
|
+
actions.push("Set ALLOW_MUTATIONS=true to enable merge operations");
|
|
431
|
+
actions.push("Use dryRun=true to preview without mutations");
|
|
432
|
+
break;
|
|
433
|
+
case "discover":
|
|
434
|
+
actions.push("Check GITHUB_TOKEN is set and valid");
|
|
435
|
+
actions.push("Provide owner and repo parameters explicitly");
|
|
436
|
+
break;
|
|
437
|
+
case "status":
|
|
438
|
+
actions.push("Ensure plan.json exists");
|
|
439
|
+
actions.push("Run 'plan.create' to generate a plan");
|
|
440
|
+
break;
|
|
441
|
+
case "merge-order":
|
|
442
|
+
actions.push("Ensure plan.json exists and is valid");
|
|
443
|
+
actions.push("Check for dependency cycles in the plan");
|
|
444
|
+
break;
|
|
445
|
+
default:
|
|
446
|
+
actions.push("Review the error details and retry");
|
|
447
|
+
actions.push("Check MCP server logs for more context");
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return createAXError(code, message, actions, {
|
|
451
|
+
tool: ctx.tool,
|
|
452
|
+
operation: ctx.operation,
|
|
453
|
+
...ctx.details
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
function planNotFoundError(planFile) {
|
|
457
|
+
return createAXError(
|
|
458
|
+
ErrorCodes.PLAN_NOT_FOUND,
|
|
459
|
+
planFile ? `Plan file not found: ${planFile}` : "No plan found. Run plan.create first.",
|
|
460
|
+
[
|
|
461
|
+
"Run 'plan.create' to generate a plan",
|
|
462
|
+
planFile ? `Check if ${planFile} exists and is accessible` : "Ensure plan.json exists in the profile runner directory"
|
|
463
|
+
],
|
|
464
|
+
{ planFile }
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
function profileNotFoundError(profileDir) {
|
|
468
|
+
return createAXError(
|
|
469
|
+
ErrorCodes.PROFILE_NOT_FOUND,
|
|
470
|
+
profileDir ? `Profile directory not found: ${profileDir}` : "No profile directory found",
|
|
471
|
+
[
|
|
472
|
+
"Run 'local.init' to create a local profile",
|
|
473
|
+
"Set LEX_PR_PROFILE_DIR environment variable",
|
|
474
|
+
"Ensure .smartergpt/ or .smartergpt.local/ exists"
|
|
475
|
+
],
|
|
476
|
+
{ profileDir }
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
function configInvalidError(message, details) {
|
|
480
|
+
return createAXError(
|
|
481
|
+
ErrorCodes.CONFIG_INVALID,
|
|
482
|
+
message,
|
|
483
|
+
[
|
|
484
|
+
"Check configuration file syntax",
|
|
485
|
+
"Ensure all required fields are present",
|
|
486
|
+
"Validate against the schema with 'lex-pr schema validate'"
|
|
487
|
+
],
|
|
488
|
+
details
|
|
489
|
+
);
|
|
490
|
+
}
|
|
491
|
+
function writeProtectionError(message, operation) {
|
|
492
|
+
return createAXError(
|
|
493
|
+
ErrorCodes.WRITE_PROTECTION_ERROR,
|
|
494
|
+
message,
|
|
495
|
+
[
|
|
496
|
+
"Use a local overlay profile (.smartergpt.local/) for write operations",
|
|
497
|
+
"Set role to 'local' or 'ci' in manifest.yaml",
|
|
498
|
+
"Run 'local.init' to create a writable profile"
|
|
499
|
+
],
|
|
500
|
+
{ operation }
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
function runNotFoundError(ctx) {
|
|
504
|
+
return createAXError(
|
|
505
|
+
ErrorCodes.RUN_NOT_FOUND,
|
|
506
|
+
`Run not found: ${ctx.runId}`,
|
|
507
|
+
[
|
|
508
|
+
"List available runs with: lex-pr runs list",
|
|
509
|
+
"Check .lexrunner/runs/ directory for artifacts"
|
|
510
|
+
],
|
|
511
|
+
{ runId: ctx.runId }
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
function throwAXError(axError) {
|
|
515
|
+
throw new AXErrorException(axError.code, axError.message, axError.nextActions, axError.context);
|
|
516
|
+
}
|
|
517
|
+
function weaveLockConflictError(ctx) {
|
|
518
|
+
const nextActions = [];
|
|
519
|
+
const lockFilePath = ctx.lockFile || "weave-lock.json";
|
|
520
|
+
if (ctx.lockFile) {
|
|
521
|
+
nextActions.push(`Remove stale lock with: rm ${ctx.lockFile}`);
|
|
522
|
+
} else {
|
|
523
|
+
nextActions.push("Remove stale lock file: rm weave-lock.json");
|
|
524
|
+
}
|
|
525
|
+
nextActions.push("Wait for other weave operation to complete");
|
|
526
|
+
nextActions.push("Verify no concurrent weave processes are running");
|
|
527
|
+
return createAXError(
|
|
528
|
+
ErrorCodes.WEAVE_LOCK_CONFLICT,
|
|
529
|
+
ctx.originalError || "Lock file conflict detected",
|
|
530
|
+
nextActions,
|
|
531
|
+
{
|
|
532
|
+
...ctx,
|
|
533
|
+
reversibility: ctx.reversibility ?? "reversible",
|
|
534
|
+
rollbackPath: ctx.rollbackPath ?? `rm ${lockFilePath}`
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
function weaveStateInvalidError(ctx) {
|
|
539
|
+
const nextActions = [
|
|
540
|
+
`Check current weave state: '${ctx.currentState}'`,
|
|
541
|
+
"Review available transitions for current state"
|
|
542
|
+
];
|
|
543
|
+
if (ctx.availableEvents && ctx.availableEvents.length > 0) {
|
|
544
|
+
nextActions.push(`Valid events for current state: ${ctx.availableEvents.join(", ")}`);
|
|
545
|
+
}
|
|
546
|
+
nextActions.push("Use 'reset' event to return to idle state if stuck");
|
|
547
|
+
return createAXError(
|
|
548
|
+
ErrorCodes.WEAVE_STATE_INVALID,
|
|
549
|
+
`Invalid transition: cannot apply event '${ctx.event}' in state '${ctx.currentState}'`,
|
|
550
|
+
nextActions,
|
|
551
|
+
{
|
|
552
|
+
...ctx,
|
|
553
|
+
reversibility: ctx.reversibility ?? "reversible",
|
|
554
|
+
rollbackPath: ctx.rollbackPath ?? "Apply 'reset' event to return to idle state"
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
function weavePreflightFailedError(ctx) {
|
|
559
|
+
const nextActions = [`Verify branch '${ctx.itemBranch}' exists locally or on remote`];
|
|
560
|
+
if (ctx.targetBranch) {
|
|
561
|
+
nextActions.push(`Verify target branch '${ctx.targetBranch}' exists`);
|
|
562
|
+
}
|
|
563
|
+
nextActions.push("Run 'git fetch' to update remote references");
|
|
564
|
+
nextActions.push("Check git repository status with 'git status'");
|
|
565
|
+
return createAXError(
|
|
566
|
+
ErrorCodes.WEAVE_PREFLIGHT_FAILED,
|
|
567
|
+
`Failed to simulate merge for ${ctx.itemBranch}${ctx.originalError ? `: ${ctx.originalError}` : ""}`,
|
|
568
|
+
nextActions,
|
|
569
|
+
{
|
|
570
|
+
...ctx,
|
|
571
|
+
// Preflight doesn't change state, so always reversible
|
|
572
|
+
reversibility: ctx.reversibility ?? "reversible"
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
function securityAuthFailedError(message, ctx) {
|
|
577
|
+
return createAXError(
|
|
578
|
+
ErrorCodes.SECURITY_AUTH_FAILED,
|
|
579
|
+
message,
|
|
580
|
+
[
|
|
581
|
+
"Check that GITHUB_TOKEN is set and valid",
|
|
582
|
+
"Verify the token has required permissions",
|
|
583
|
+
"Try: gh auth status"
|
|
584
|
+
],
|
|
585
|
+
{ ...ctx }
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
function securityUnauthorizedError(message, ctx) {
|
|
589
|
+
const nextActions = [];
|
|
590
|
+
if (ctx?.permission) {
|
|
591
|
+
nextActions.push(`Request '${ctx.permission}' permission from an administrator`);
|
|
592
|
+
}
|
|
593
|
+
if (ctx?.roles && ctx.roles.length > 0) {
|
|
594
|
+
nextActions.push(`Current roles: ${ctx.roles.join(", ")}`);
|
|
595
|
+
}
|
|
596
|
+
if (ctx?.level !== void 0 && ctx?.maxLevel !== void 0) {
|
|
597
|
+
nextActions.push(`Maximum allowed level: ${ctx.maxLevel}`);
|
|
598
|
+
}
|
|
599
|
+
if (nextActions.length === 0) {
|
|
600
|
+
nextActions.push("Contact an administrator to request access");
|
|
601
|
+
}
|
|
602
|
+
nextActions.push("Review role definitions in authorization policy");
|
|
603
|
+
return createAXError(ErrorCodes.SECURITY_UNAUTHORIZED, message, nextActions, { ...ctx });
|
|
604
|
+
}
|
|
605
|
+
function securityCommandBlockedError(message, ctx) {
|
|
606
|
+
const nextActions = [];
|
|
607
|
+
switch (ctx.reason) {
|
|
608
|
+
case "not_whitelisted":
|
|
609
|
+
nextActions.push("Add command to .smartergpt/allowed-commands.json if legitimate");
|
|
610
|
+
nextActions.push("Verify the command is safe and necessary");
|
|
611
|
+
break;
|
|
612
|
+
case "dangerous_args":
|
|
613
|
+
nextActions.push("Remove dangerous arguments from the command");
|
|
614
|
+
nextActions.push("Review allowed-commands.json deny_args list");
|
|
615
|
+
break;
|
|
616
|
+
case "shell_operators":
|
|
617
|
+
nextActions.push("Shell operators (|, >, <, &&, ||) are not allowed");
|
|
618
|
+
nextActions.push("Split the command into separate operations");
|
|
619
|
+
break;
|
|
620
|
+
case "too_long":
|
|
621
|
+
nextActions.push("Shorten the command to meet the length limit");
|
|
622
|
+
nextActions.push("Consider using configuration files for long arguments");
|
|
623
|
+
break;
|
|
624
|
+
case "hallucination_threshold":
|
|
625
|
+
nextActions.push(`Hallucination threshold (${ctx.threshold}) reached`);
|
|
626
|
+
nextActions.push("Human review required before resuming");
|
|
627
|
+
nextActions.push("Resume with: lex-pr resume --plan plan.json");
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
return createAXError(ErrorCodes.SECURITY_COMMAND_BLOCKED, message, nextActions, { ...ctx });
|
|
631
|
+
}
|
|
632
|
+
function securityComplianceViolationError(message, ctx) {
|
|
633
|
+
return createAXError(
|
|
634
|
+
ErrorCodes.SECURITY_COMPLIANCE_VIOLATION,
|
|
635
|
+
message,
|
|
636
|
+
[
|
|
637
|
+
"Review the compliance requirement documentation",
|
|
638
|
+
"Ensure signing key is configured if required",
|
|
639
|
+
"Contact security team for guidance"
|
|
640
|
+
],
|
|
641
|
+
{ ...ctx }
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
function securitySecretDetectedError(message, ctx) {
|
|
645
|
+
return createAXError(
|
|
646
|
+
ErrorCodes.SECURITY_SECRET_DETECTED,
|
|
647
|
+
message,
|
|
648
|
+
[
|
|
649
|
+
"Remove or rotate the exposed secret immediately",
|
|
650
|
+
"Use environment variables or a secrets manager instead",
|
|
651
|
+
"Never commit secrets to source control"
|
|
652
|
+
],
|
|
653
|
+
{ ...ctx }
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
function securitySecretNotFoundError(message, ctx) {
|
|
657
|
+
const nextActions = [];
|
|
658
|
+
if (ctx?.secretId) {
|
|
659
|
+
nextActions.push(`Set the '${ctx.secretId}' secret in your environment or secrets manager`);
|
|
660
|
+
}
|
|
661
|
+
nextActions.push("Check that required environment variables are configured");
|
|
662
|
+
nextActions.push("Verify your secrets manager connection if using one");
|
|
663
|
+
nextActions.push("Review the secrets configuration documentation");
|
|
664
|
+
return createAXError(ErrorCodes.SECURITY_SECRET_NOT_FOUND, message, nextActions, { ...ctx });
|
|
665
|
+
}
|
|
666
|
+
function securitySarifParseError(message, ctx) {
|
|
667
|
+
return createAXError(
|
|
668
|
+
ErrorCodes.SECURITY_SARIF_PARSE_ERROR,
|
|
669
|
+
message,
|
|
670
|
+
[
|
|
671
|
+
"Verify the SARIF file is valid JSON",
|
|
672
|
+
"Ensure the file follows SARIF 2.1.0 specification",
|
|
673
|
+
"Check scanner configuration for correct output format"
|
|
674
|
+
],
|
|
675
|
+
{ ...ctx }
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
function securityScanFailedError(message, ctx) {
|
|
679
|
+
const nextActions = [];
|
|
680
|
+
if (ctx?.scanner === "npm-audit") {
|
|
681
|
+
nextActions.push("Run 'npm audit' locally to reproduce");
|
|
682
|
+
nextActions.push("Check if package-lock.json is up to date");
|
|
683
|
+
} else {
|
|
684
|
+
nextActions.push("Verify the scanner is installed and configured correctly");
|
|
685
|
+
}
|
|
686
|
+
if (ctx?.directory) {
|
|
687
|
+
nextActions.push(`Check that directory exists: ${ctx.directory}`);
|
|
688
|
+
}
|
|
689
|
+
nextActions.push("Review scanner logs for more details");
|
|
690
|
+
return createAXError(ErrorCodes.SECURITY_SCAN_FAILED, message, nextActions, { ...ctx });
|
|
691
|
+
}
|
|
692
|
+
function toolBudgetExceededError(message, ctx) {
|
|
693
|
+
const nextActions = [];
|
|
694
|
+
switch (ctx.violation) {
|
|
695
|
+
case "tool_denied":
|
|
696
|
+
nextActions.push(`Tool '${ctx.tool}' is explicitly denied in the executor's tool budget`);
|
|
697
|
+
nextActions.push("Review the executor manifest's toolBudget.denied list");
|
|
698
|
+
if (ctx.denied && ctx.denied.length > 0) {
|
|
699
|
+
nextActions.push(`Denied tools: ${ctx.denied.join(", ")}`);
|
|
700
|
+
}
|
|
701
|
+
break;
|
|
702
|
+
case "tool_not_allowed":
|
|
703
|
+
nextActions.push(`Tool '${ctx.tool}' is not in the executor's allowed tool list`);
|
|
704
|
+
nextActions.push("Add the tool to toolBudget.allowed in the executor manifest");
|
|
705
|
+
if (ctx.allowed && ctx.allowed.length > 0) {
|
|
706
|
+
nextActions.push(`Allowed tools: ${ctx.allowed.join(", ")}`);
|
|
707
|
+
}
|
|
708
|
+
break;
|
|
709
|
+
case "max_calls_exceeded":
|
|
710
|
+
nextActions.push(`Maximum tool calls limit (${ctx.limit}) has been reached`);
|
|
711
|
+
nextActions.push(`Current calls: ${ctx.current}`);
|
|
712
|
+
nextActions.push("Increase toolBudget.limits.maxToolCalls in the executor manifest");
|
|
713
|
+
break;
|
|
714
|
+
case "max_tokens_exceeded":
|
|
715
|
+
nextActions.push(`Maximum token output limit (${ctx.limit}) would be exceeded`);
|
|
716
|
+
nextActions.push(`Current tokens: ${ctx.current}`);
|
|
717
|
+
nextActions.push("Increase toolBudget.limits.maxTokensOut in the executor manifest");
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
return createAXError(ErrorCodes.TOOL_BUDGET_EXCEEDED, message, nextActions, { ...ctx });
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// src/errors/index.ts
|
|
724
|
+
var ErrorCodes = {
|
|
725
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
726
|
+
// Gate-related errors
|
|
727
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
728
|
+
/** A gate failed during execution (lint, test, build, etc.) */
|
|
729
|
+
GATE_FAILED: "GATE_FAILED",
|
|
730
|
+
/** Requested gate was not found in plan */
|
|
731
|
+
GATE_NOT_FOUND: "GATE_NOT_FOUND",
|
|
732
|
+
/** Gate execution timed out */
|
|
733
|
+
GATE_TIMEOUT: "GATE_TIMEOUT",
|
|
734
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
735
|
+
// Merge-related errors
|
|
736
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
737
|
+
/** Git merge conflict detected */
|
|
738
|
+
MERGE_CONFLICT: "MERGE_CONFLICT",
|
|
739
|
+
/** Merge is blocked by policy or dependencies */
|
|
740
|
+
MERGE_BLOCKED: "MERGE_BLOCKED",
|
|
741
|
+
/** Cycle detected in merge dependency graph */
|
|
742
|
+
MERGE_CYCLE_DETECTED: "MERGE_CYCLE_DETECTED",
|
|
743
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
744
|
+
// Plan-related errors
|
|
745
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
746
|
+
/** Plan failed schema validation */
|
|
747
|
+
PLAN_VALIDATION_FAILED: "PLAN_VALIDATION_FAILED",
|
|
748
|
+
/** Plan file not found */
|
|
749
|
+
PLAN_NOT_FOUND: "PLAN_NOT_FOUND",
|
|
750
|
+
/** Explicit plan reference is empty, overlong, or otherwise invalid */
|
|
751
|
+
PLAN_REFERENCE_INVALID: "PLAN_REFERENCE_INVALID",
|
|
752
|
+
/** Plan reference exists but cannot be read as a bounded regular file */
|
|
753
|
+
PLAN_UNREADABLE: "PLAN_UNREADABLE",
|
|
754
|
+
/** Plan exceeds the bounded integration artifact limits */
|
|
755
|
+
PLAN_ARTIFACT_LIMIT_EXCEEDED: "PLAN_ARTIFACT_LIMIT_EXCEEDED",
|
|
756
|
+
/** Cycle detected in plan item dependencies */
|
|
757
|
+
PLAN_CYCLE_DETECTED: "PLAN_CYCLE_DETECTED",
|
|
758
|
+
/** Referenced dependency not found in plan */
|
|
759
|
+
UNKNOWN_DEPENDENCY: "UNKNOWN_DEPENDENCY",
|
|
760
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
761
|
+
// GitHub-related errors
|
|
762
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
763
|
+
/** GitHub API request failed */
|
|
764
|
+
GITHUB_API_ERROR: "GITHUB_API_ERROR",
|
|
765
|
+
/** GitHub API rate limit exceeded */
|
|
766
|
+
GITHUB_RATE_LIMIT: "GITHUB_RATE_LIMIT",
|
|
767
|
+
/** GitHub authentication failed (invalid/expired token) */
|
|
768
|
+
GITHUB_AUTH_ERROR: "GITHUB_AUTH_ERROR",
|
|
769
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
770
|
+
// Git-related errors
|
|
771
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
772
|
+
/** Git operation (checkout, merge, etc.) failed */
|
|
773
|
+
GIT_OPERATION_FAILED: "GIT_OPERATION_FAILED",
|
|
774
|
+
/** Git conflict during operation */
|
|
775
|
+
GIT_CONFLICT: "GIT_CONFLICT",
|
|
776
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
777
|
+
// Weave-related errors
|
|
778
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
779
|
+
/** Lock file conflict detected (stale or in use) */
|
|
780
|
+
WEAVE_LOCK_CONFLICT: "WEAVE_LOCK_CONFLICT",
|
|
781
|
+
/** Invalid state transition in weave state machine */
|
|
782
|
+
WEAVE_STATE_INVALID: "WEAVE_STATE_INVALID",
|
|
783
|
+
/** Preflight merge simulation failed */
|
|
784
|
+
WEAVE_PREFLIGHT_FAILED: "WEAVE_PREFLIGHT_FAILED",
|
|
785
|
+
/** Merge conflict during weave operation */
|
|
786
|
+
WEAVE_MERGE_CONFLICT: "WEAVE_MERGE_CONFLICT",
|
|
787
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
788
|
+
// Configuration errors
|
|
789
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
790
|
+
/** Configuration file is invalid */
|
|
791
|
+
CONFIG_INVALID: "CONFIG_INVALID",
|
|
792
|
+
/** Profile directory not found */
|
|
793
|
+
PROFILE_NOT_FOUND: "PROFILE_NOT_FOUND",
|
|
794
|
+
/** Write operation blocked by profile protection */
|
|
795
|
+
WRITE_PROTECTION_ERROR: "WRITE_PROTECTION_ERROR",
|
|
796
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
797
|
+
// Run lifecycle errors
|
|
798
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
799
|
+
/** Run not found by runId */
|
|
800
|
+
RUN_NOT_FOUND: "RUN_NOT_FOUND",
|
|
801
|
+
/** Run is already complete and cannot be modified */
|
|
802
|
+
RUN_ALREADY_COMPLETE: "RUN_ALREADY_COMPLETE",
|
|
803
|
+
/** Run state is invalid for the requested operation */
|
|
804
|
+
RUN_STATE_INVALID: "RUN_STATE_INVALID",
|
|
805
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
806
|
+
// Resource errors
|
|
807
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
808
|
+
/** Budget limit exceeded */
|
|
809
|
+
BUDGET_EXCEEDED: "BUDGET_EXCEEDED",
|
|
810
|
+
/** Tool budget limit exceeded */
|
|
811
|
+
TOOL_BUDGET_EXCEEDED: "TOOL_BUDGET_EXCEEDED",
|
|
812
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
813
|
+
// Security errors
|
|
814
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
815
|
+
/** Operation violated security policy */
|
|
816
|
+
SECURITY_POLICY_VIOLATION: "SECURITY_POLICY_VIOLATION",
|
|
817
|
+
/** Command failed security validation */
|
|
818
|
+
COMMAND_VALIDATION_FAILED: "COMMAND_VALIDATION_FAILED",
|
|
819
|
+
/** Authentication failed */
|
|
820
|
+
SECURITY_AUTH_FAILED: "SECURITY_AUTH_FAILED",
|
|
821
|
+
/** User is not authorized for operation */
|
|
822
|
+
SECURITY_UNAUTHORIZED: "SECURITY_UNAUTHORIZED",
|
|
823
|
+
/** Command is blocked by security policy */
|
|
824
|
+
SECURITY_COMMAND_BLOCKED: "SECURITY_COMMAND_BLOCKED",
|
|
825
|
+
/** Operation violates compliance requirements */
|
|
826
|
+
SECURITY_COMPLIANCE_VIOLATION: "SECURITY_COMPLIANCE_VIOLATION",
|
|
827
|
+
/** Secret was detected in content */
|
|
828
|
+
SECURITY_SECRET_DETECTED: "SECURITY_SECRET_DETECTED",
|
|
829
|
+
/** Required secret not found */
|
|
830
|
+
SECURITY_SECRET_NOT_FOUND: "SECURITY_SECRET_NOT_FOUND",
|
|
831
|
+
/** SARIF parsing failed */
|
|
832
|
+
SECURITY_SARIF_PARSE_ERROR: "SECURITY_SARIF_PARSE_ERROR",
|
|
833
|
+
/** Security scan failed */
|
|
834
|
+
SECURITY_SCAN_FAILED: "SECURITY_SCAN_FAILED",
|
|
835
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
836
|
+
// Generic errors
|
|
837
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
838
|
+
/** Internal error - unexpected condition */
|
|
839
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
840
|
+
/** Invalid input parameters */
|
|
841
|
+
INVALID_INPUT: "INVALID_INPUT"
|
|
842
|
+
};
|
|
843
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
844
|
+
0 && (module.exports = {
|
|
845
|
+
AXErrorException,
|
|
846
|
+
AXErrorSchema,
|
|
847
|
+
ErrorCodes,
|
|
848
|
+
configInvalidError,
|
|
849
|
+
createAXError,
|
|
850
|
+
cycleDetectedError,
|
|
851
|
+
gateFailedError,
|
|
852
|
+
gitOperationError,
|
|
853
|
+
githubApiError,
|
|
854
|
+
isAXError,
|
|
855
|
+
isAXErrorException,
|
|
856
|
+
mcpToolError,
|
|
857
|
+
mergeConflictError,
|
|
858
|
+
planNotFoundError,
|
|
859
|
+
planValidationError,
|
|
860
|
+
profileNotFoundError,
|
|
861
|
+
runNotFoundError,
|
|
862
|
+
securityAuthFailedError,
|
|
863
|
+
securityCommandBlockedError,
|
|
864
|
+
securityComplianceViolationError,
|
|
865
|
+
securitySarifParseError,
|
|
866
|
+
securityScanFailedError,
|
|
867
|
+
securitySecretDetectedError,
|
|
868
|
+
securitySecretNotFoundError,
|
|
869
|
+
securityUnauthorizedError,
|
|
870
|
+
throwAXError,
|
|
871
|
+
toAXError,
|
|
872
|
+
toolBudgetExceededError,
|
|
873
|
+
unknownDependencyError,
|
|
874
|
+
weaveLockConflictError,
|
|
875
|
+
weavePreflightFailedError,
|
|
876
|
+
weaveStateInvalidError,
|
|
877
|
+
wrapAsAXError,
|
|
878
|
+
writeProtectionError
|
|
879
|
+
});
|