@smartergpt/lexrunner 1.0.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/.changes/ci-debug-added.txt +1 -0
- package/.changeset/tsconfig-solution-build.md +5 -0
- package/.editorconfig +9 -0
- package/.env.example +8 -0
- package/.github/COST_EFFICIENCY.md +60 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
- package/.github/ISSUE_TEMPLATE/epic.yml +123 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +26 -0
- package/.github/ISSUE_TEMPLATE/issue-A1-gate-input-validation.md +380 -0
- package/.github/ISSUE_TEMPLATE/issue-B1-scope-validation.md +509 -0
- package/.github/ISSUE_TEMPLATE/issue-C1-command-whitelist.md +463 -0
- package/.github/ISSUE_TEMPLATE/subtask.yml +153 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +9 -0
- package/.github/copilot-instructions-old.md +429 -0
- package/.github/copilot-instructions.md +33 -0
- package/.github/instructions/tests.instructions.md +10 -0
- package/.github/workflows/auto-delete-merged-branches.yml +103 -0
- package/.github/workflows/benchmarks.yml +72 -0
- package/.github/workflows/ci-debug.yml +33 -0
- package/.github/workflows/ci.yml +167 -0
- package/.github/workflows/cli-smoke-test.yml +345 -0
- package/.github/workflows/copilot-setup-steps.yml +20 -0
- package/.github/workflows/frame-emission-gate.yml +242 -0
- package/.github/workflows/project-auto.yml +24 -0
- package/.github/workflows/release.yml +260 -0
- package/.github/workflows/slow-cli-tests.yml +37 -0
- package/.github/workflows/tag-guard.yml +44 -0
- package/.husky/pre-commit +1 -0
- package/.nvmrc +2 -0
- package/.prettierignore +28 -0
- package/.prettierrc.json +10 -0
- package/.smartergpt/CONTROL_DECK_VISION.md +226 -0
- package/.smartergpt/allowed-commands.json +41 -0
- package/.smartergpt/allowed-commands.strict.json +56 -0
- package/.smartergpt/deliverables/.live.md +426 -0
- package/.smartergpt/deliverables/ISSUE_STATUS_2025-12-28.md +193 -0
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/ADR_DISCUSSION.md +379 -0
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_claude-haiku.md +109 -0
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_gemini-flash.md +42 -0
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_gpt-codex-mini.md +19 -0
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Answer_raptor-mini.md +37 -0
- package/.smartergpt/deliverables/_research/snapshot-contract-feedback/Question.md +37 -0
- package/.smartergpt/deliverables/merge-weave-04469e41-24ba-4ed5-b0ff-13c7ea12858d.ndjson +2 -0
- package/.smartergpt/deps.yml +3 -0
- package/.smartergpt/docs/fanout-templates.md +213 -0
- package/.smartergpt/docs/merge-weave-interventions.md +261 -0
- package/.smartergpt/docs/test-fix-patterns.md +240 -0
- package/.smartergpt/fanout-templates.yml +263 -0
- package/.smartergpt/gates.yml +9 -0
- package/.smartergpt/intent.md +1 -0
- package/.smartergpt/issues/QOL-001-analysis-script-filtering.md +36 -0
- package/.smartergpt/issues/QOL-002-log-retention-policy.md +92 -0
- package/.smartergpt/issues/QOL-003-realtime-console-feedback.md +44 -0
- package/.smartergpt/issues/QOL-004-governance-report-cli.md +44 -0
- package/.smartergpt/issues/QOL-005-schema-versioning.md +46 -0
- package/.smartergpt/issues/QOL-006-debug-verbose-mode.md +45 -0
- package/.smartergpt/issues/QOL-COMPLETION-REPORT.md +359 -0
- package/.smartergpt/issues/QOL-REVIEW-SUMMARY.md +111 -0
- package/.smartergpt/issues/QOL-ROADMAP.md +71 -0
- package/.smartergpt/merge-policy.yml +41 -0
- package/.smartergpt/merge-weave-policy.yml +255 -0
- package/.smartergpt/o1.json +0 -0
- package/.smartergpt/o2.json +0 -0
- package/.smartergpt/personas/eager-pm.md +123 -0
- package/.smartergpt/personas/example.md +81 -0
- package/.smartergpt/personas/senior-dev.md +107 -0
- package/.smartergpt/profile.yml +2 -0
- package/.smartergpt/prompts/create-project.md +112 -0
- package/.smartergpt/prompts/idea.md +64 -0
- package/.smartergpt/pull-request-template.md +25 -0
- package/.smartergpt/schemas/behavior-rule.schema.d.ts +54 -0
- package/.smartergpt/schemas/behavior-rule.schema.js +56 -0
- package/.smartergpt/schemas/behavior-rule.schema.json +105 -0
- package/.smartergpt/schemas/behavior-rule.schema.ts +60 -0
- package/.smartergpt/schemas/execution-plan-v1.d.ts +47 -0
- package/.smartergpt/schemas/execution-plan-v1.js +22 -0
- package/.smartergpt/schemas/execution-plan-v1.json +113 -0
- package/.smartergpt/schemas/execution-plan-v1.ts +32 -0
- package/.smartergpt/schemas/execution-plan.schema.json +116 -0
- package/.smartergpt/schemas/feature-spec-v0.d.ts +13 -0
- package/.smartergpt/schemas/feature-spec-v0.js +12 -0
- package/.smartergpt/schemas/feature-spec-v0.json +58 -0
- package/.smartergpt/schemas/feature-spec-v0.ts +16 -0
- package/.smartergpt/schemas/feature-spec.schema.json +111 -0
- package/.smartergpt/schemas/gates.schema.d.ts +48 -0
- package/.smartergpt/schemas/gates.schema.js +20 -0
- package/.smartergpt/schemas/gates.schema.json +47 -0
- package/.smartergpt/schemas/gates.schema.ts +26 -0
- package/.smartergpt/schemas/idea.schema.json +81 -0
- package/.smartergpt/schemas/runner.scope.schema.d.ts +54 -0
- package/.smartergpt/schemas/runner.scope.schema.js +28 -0
- package/.smartergpt/schemas/runner.scope.schema.json +75 -0
- package/.smartergpt/schemas/runner.scope.schema.ts +36 -0
- package/.smartergpt/schemas/runner.stack.schema.d.ts +40 -0
- package/.smartergpt/schemas/runner.stack.schema.js +21 -0
- package/.smartergpt/schemas/runner.stack.schema.json +51 -0
- package/.smartergpt/schemas/runner.stack.schema.ts +27 -0
- package/.smartergpt/scope.yml +11 -0
- package/.smartergpt/stack.yml +16 -0
- package/.smartergpt/test-fix-patterns.yml +106 -0
- package/.tool-versions +13 -0
- package/AGENTS.md +402 -0
- package/CHANGELOG.md +256 -0
- package/CLAUDE.md +484 -0
- package/CONTRIBUTING.md +345 -0
- package/EAGER_PM_FANOUT_ANALYSIS.md +283 -0
- package/FAQ.md +292 -0
- package/FIXTURE_LIBRARY_SUMMARY.md +327 -0
- package/IMPLEMENTATION_SUMMARY.md +222 -0
- package/LICENSE +21 -0
- package/MANUAL_TEST_GUIDE.md +229 -0
- package/MCP-ALIGNMENT-SUMMARY.md +261 -0
- package/MCP-CONFIG.md +125 -0
- package/MERGE_WEAVE_QUICKSTART.md +450 -0
- package/MERGE_WEAVE_SUMMARY.md +259 -0
- package/MERGE_WEAVE_USAGE_GUIDE.md +368 -0
- package/NOTICE.md +43 -0
- package/README.mcp.md +770 -0
- package/README.md +1069 -0
- package/TEST_INFRASTRUCTURE_ASSESSMENT.md +225 -0
- package/bootstrap-lexrunner.sh +396 -0
- package/dist/api-7H7SJZIX.js +15 -0
- package/dist/api-U3X2WA6D.js +15 -0
- package/dist/audit-2TZ2LU72.js +60 -0
- package/dist/audit-5HH5BMKI.js +60 -0
- package/dist/audit-6K5K333I.js +60 -0
- package/dist/audit-DYQWS57J.js +60 -0
- package/dist/audit-JBWZ2GZ2.js +60 -0
- package/dist/audit-SJF3434D.js +60 -0
- package/dist/audit-TICGGVX5.js +60 -0
- package/dist/audit-YOBB27PY.js +60 -0
- package/dist/autopilot-3GAVXWWC.js +45 -0
- package/dist/autopilot-43NOYVQA.js +45 -0
- package/dist/autopilot-4UA3OWLU.js +45 -0
- package/dist/autopilot-54TK5CCG.js +45 -0
- package/dist/autopilot-5BHC2UQT.js +45 -0
- package/dist/autopilot-ABZUCVGY.js +45 -0
- package/dist/autopilot-ACJZP47Y.js +45 -0
- package/dist/autopilot-AL5F5AUS.js +46 -0
- package/dist/autopilot-BO67FWUC.js +45 -0
- package/dist/autopilot-BR6W4GEX.js +45 -0
- package/dist/autopilot-FOR2UKRY.js +45 -0
- package/dist/autopilot-GDTTXHEQ.js +45 -0
- package/dist/autopilot-GEAMFZBM.js +45 -0
- package/dist/autopilot-HDMBRZE6.js +45 -0
- package/dist/autopilot-IKI2Y6S4.js +44 -0
- package/dist/autopilot-ILTBWWOL.js +46 -0
- package/dist/autopilot-KI3MXIFI.js +44 -0
- package/dist/autopilot-LWNPZC3J.js +45 -0
- package/dist/autopilot-LXPJ4ZXF.js +45 -0
- package/dist/autopilot-MDIFIONK.js +46 -0
- package/dist/autopilot-NW3LDP6M.js +45 -0
- package/dist/autopilot-OKTSCG35.js +45 -0
- package/dist/autopilot-OR5PF5PD.js +45 -0
- package/dist/autopilot-PE65SBGN.js +45 -0
- package/dist/autopilot-PW7I4B6W.js +45 -0
- package/dist/autopilot-QMLBL5P6.js +45 -0
- package/dist/autopilot-QSN6ZU5O.js +45 -0
- package/dist/autopilot-R7EZJOGI.js +46 -0
- package/dist/autopilot-T544CPPD.js +44 -0
- package/dist/autopilot-TNQB6VGJ.js +44 -0
- package/dist/autopilot-UVIYCR6K.js +45 -0
- package/dist/autopilot-W3ZTTSH3.js +45 -0
- package/dist/autopilot-XPKWOFXO.js +44 -0
- package/dist/autopilot-XRX4QWRM.js +44 -0
- package/dist/autopilot-Y3BAGNI5.js +44 -0
- package/dist/autopilot-ZE64XW2K.js +44 -0
- package/dist/chunk-2ESYSVXG.js +48 -0
- package/dist/chunk-2VR554P7.js +668 -0
- package/dist/chunk-37DOWIVT.js +1084 -0
- package/dist/chunk-3DU2DWUP.js +400 -0
- package/dist/chunk-3DVXIZFM.js +11166 -0
- package/dist/chunk-3FABZF4V.js +811 -0
- package/dist/chunk-4FFGNTAV.js +515 -0
- package/dist/chunk-4GEC4HC3.js +11221 -0
- package/dist/chunk-4RVZNLD4.js +628 -0
- package/dist/chunk-55VWJYZY.js +39 -0
- package/dist/chunk-5CGWZH5X.js +340 -0
- package/dist/chunk-5QKWKK4M.js +11794 -0
- package/dist/chunk-5Z3XHND7.js +11755 -0
- package/dist/chunk-6A4IE3TI.js +302 -0
- package/dist/chunk-6KK5JFFE.js +106 -0
- package/dist/chunk-6YC2VSLE.js +11252 -0
- package/dist/chunk-7C4K2SHD.js +668 -0
- package/dist/chunk-ANXY4RGA.js +11091 -0
- package/dist/chunk-ASHKNUBR.js +11312 -0
- package/dist/chunk-B3OYDPOP.js +11793 -0
- package/dist/chunk-DBH7SQ2S.js +1084 -0
- package/dist/chunk-DEI7A5B4.js +11449 -0
- package/dist/chunk-DM4GHY3J.js +92 -0
- package/dist/chunk-EQKFCZLH.js +9823 -0
- package/dist/chunk-FAIJPBT5.js +40 -0
- package/dist/chunk-FDDKUDXR.js +11166 -0
- package/dist/chunk-FEAR6ETG.js +438 -0
- package/dist/chunk-FNBAHK5V.js +72 -0
- package/dist/chunk-FXL74C73.js +523 -0
- package/dist/chunk-GLJEDX4L.js +10247 -0
- package/dist/chunk-GTP4OHD7.js +1107 -0
- package/dist/chunk-HIHH7IVO.js +10557 -0
- package/dist/chunk-I3VXUVCB.js +10474 -0
- package/dist/chunk-I6BIFVWI.js +10519 -0
- package/dist/chunk-I72TRUTJ.js +1084 -0
- package/dist/chunk-J5B5KT2F.js +368 -0
- package/dist/chunk-JMTULZ66.js +11743 -0
- package/dist/chunk-JXIQ7HCK.js +11166 -0
- package/dist/chunk-K6HVPBDP.js +10692 -0
- package/dist/chunk-KBT5Y666.js +521 -0
- package/dist/chunk-LETPROKG.js +11092 -0
- package/dist/chunk-LLMY2BZF.js +1084 -0
- package/dist/chunk-NMNL4US2.js +1084 -0
- package/dist/chunk-O2XRP7JK.js +10247 -0
- package/dist/chunk-OGPWLFFO.js +11201 -0
- package/dist/chunk-OQJUWTZV.js +51 -0
- package/dist/chunk-PJRWPLQ6.js +669 -0
- package/dist/chunk-PYRVUCJR.js +370 -0
- package/dist/chunk-Q6Y524KH.js +669 -0
- package/dist/chunk-QF7DM5VW.js +106 -0
- package/dist/chunk-QGM4M3NI.js +37 -0
- package/dist/chunk-QIIELFTL.js +1107 -0
- package/dist/chunk-QUW6N7GR.js +10264 -0
- package/dist/chunk-QZASNLQX.js +11223 -0
- package/dist/chunk-RMN4IAWO.js +11808 -0
- package/dist/chunk-RN5NHU37.js +11465 -0
- package/dist/chunk-RNG3RILO.js +11755 -0
- package/dist/chunk-RSA6DEB4.js +9748 -0
- package/dist/chunk-RURYWSMX.js +10524 -0
- package/dist/chunk-SUEXK5U7.js +11201 -0
- package/dist/chunk-TVUF55OH.js +11807 -0
- package/dist/chunk-U5MMENCP.js +456 -0
- package/dist/chunk-U62I2R2D.js +434 -0
- package/dist/chunk-UHFMFO54.js +21 -0
- package/dist/chunk-UNZBDSEU.js +11166 -0
- package/dist/chunk-UOATTNQP.js +334 -0
- package/dist/chunk-UZFYNSMJ.js +334 -0
- package/dist/chunk-VP37GLU6.js +1084 -0
- package/dist/chunk-W6WDKBWO.js +11453 -0
- package/dist/chunk-XBKUFNVF.js +10745 -0
- package/dist/chunk-XOLVQTIE.js +670 -0
- package/dist/chunk-XVFTBVDS.js +257 -0
- package/dist/chunk-YABA7DB6.js +11091 -0
- package/dist/chunk-YWCJX5KL.js +10557 -0
- package/dist/chunk-Z5GP7FSR.js +309 -0
- package/dist/chunk-ZBT3DATZ.js +296 -0
- package/dist/chunk-ZDBAZXUQ.js +11201 -0
- package/dist/chunk-ZEMABYS4.js +92 -0
- package/dist/chunk-ZOA4HT7P.js +662 -0
- package/dist/cli.cjs +40431 -0
- package/dist/cli.d.cts +2709 -0
- package/dist/cli.d.ts +2709 -0
- package/dist/cli.js +21149 -0
- package/dist/commandValidator-42OUDFZ4.js +140 -0
- package/dist/commandValidator-7LQHTYL5.js +140 -0
- package/dist/commandValidator-AT5OYZFC.js +142 -0
- package/dist/commandValidator-DH3CX2OW.js +140 -0
- package/dist/commandValidator-GCQC7H4A.js +140 -0
- package/dist/commandValidator-K6VWB6O3.js +140 -0
- package/dist/commandValidator-L6WNDBYB.js +129 -0
- package/dist/commandValidator-O3KSNXD2.js +140 -0
- package/dist/commandValidator-ZHMUA5RQ.js +140 -0
- package/dist/constraints-M52FVL2X.js +11 -0
- package/dist/dist-CSOR2BL2.js +1144 -0
- package/dist/dist-PKOIS5NZ.js +1144 -0
- package/dist/fileAnalysis-3VMDDJ6I.js +9 -0
- package/dist/fileAnalysis-4QLHUT44.js +9 -0
- package/dist/fileAnalysis-H6M2Z7ZC.js +9 -0
- package/dist/fileAnalysis-HMI7IL6S.js +9 -0
- package/dist/fileAnalysis-JHABOPUQ.js +9 -0
- package/dist/gateMapping-E5MGNJH5.js +17 -0
- package/dist/jsonEnvelope-R4SWKX2N.js +62 -0
- package/dist/mergeTreeSimulator-ATOPJ3DU.js +11 -0
- package/dist/mergeTreeSimulator-AYUK4TZT.js +11 -0
- package/dist/mergeTreeSimulator-BBWJUQBK.js +11 -0
- package/dist/mergeTreeSimulator-DJJDRB5N.js +11 -0
- package/dist/mergeTreeSimulator-X4BA647P.js +11 -0
- package/dist/planDiff-37QHCPKO.js +109 -0
- package/dist/planDiff-BQHIUARB.js +109 -0
- package/dist/planDiff-QOK6KNB7.js +111 -0
- package/dist/planDiff-RXR4CWFS.js +109 -0
- package/dist/planDiff-W2BTH2MU.js +109 -0
- package/dist/planHistory-4J3Q6AJ3.js +126 -0
- package/dist/planHistory-DQRSB2Y7.js +118 -0
- package/dist/planHistory-GLCXP6AB.js +126 -0
- package/dist/planHistory-SMNRLEKG.js +126 -0
- package/dist/planHistory-UO4WZ6GO.js +126 -0
- package/dist/planReview-7BWVLABC.js +377 -0
- package/dist/planReview-7VB3OYKZ.js +385 -0
- package/dist/planReview-FAIBIAE6.js +377 -0
- package/dist/planReview-FXQBDNKJ.js +376 -0
- package/dist/planReview-HO4YYETA.js +377 -0
- package/dist/planReview-I26EKCUK.js +376 -0
- package/dist/planReview-JBOAJHSU.js +377 -0
- package/dist/planReview-SCNZWC6B.js +376 -0
- package/dist/planReview-TU7LMZIY.js +376 -0
- package/dist/planViewer-2YZCPVDM.js +155 -0
- package/dist/planViewer-72WZFUTU.js +154 -0
- package/dist/planViewer-G546TVHV.js +154 -0
- package/dist/planViewer-I7ZHNJQF.js +150 -0
- package/dist/planViewer-IRXHOY5U.js +155 -0
- package/dist/planViewer-IX2ICW45.js +154 -0
- package/dist/planViewer-PDWPUOP6.js +155 -0
- package/dist/planViewer-PEOADAGZ.js +155 -0
- package/dist/planViewer-PFYDEG6V.js +150 -0
- package/dist/planViewer-UIPOSRVW.js +151 -0
- package/dist/planViewer-V2JUKV7Q.js +154 -0
- package/dist/sarif-46TKOOJZ.js +9 -0
- package/dist/sarif-63JKTFFI.js +9 -0
- package/dist/sarif-CIYIWUNC.js +9 -0
- package/dist/sarif-OGAGDL6B.js +9 -0
- package/dist/sarif-XIREI5B5.js +9 -0
- package/dist/security-3V6FKJDA.js +423 -0
- package/dist/security-4JMEUM56.js +423 -0
- package/dist/security-QHPEWY5G.js +423 -0
- package/dist/security-V2LAL5TP.js +415 -0
- package/dist/security-WTASK6T6.js +423 -0
- package/dist/security-XE4GHVJD.js +423 -0
- package/dist/security-XLXM3UHT.js +423 -0
- package/dist/security-YDLHSMVY.js +441 -0
- package/dist/security-ZDAEZF7D.js +423 -0
- package/dist/signing-3EI734L4.js +14 -0
- package/dist/signing-5G7K6JXJ.js +14 -0
- package/dist/signing-7DK7SABM.js +14 -0
- package/dist/signing-JJJOUGCW.js +14 -0
- package/dist/signing-OAJ3MXGA.js +14 -0
- package/dist/verify-5F6PUXUQ.js +62 -0
- package/dist/verify-5ILURHV2.js +62 -0
- package/dist/verify-MRDZJUGO.js +62 -0
- package/dist/verify-SCUHB3SA.js +62 -0
- package/dist/verify-YZRHN2D3.js +62 -0
- package/docs/1.0.0-vertical-slice.md +214 -0
- package/docs/ADR-007-INTEGRATION-SUMMARY.md +232 -0
- package/docs/ALIASING_FOR_LEXRUNNER.md +709 -0
- package/docs/ALIASING_FOR_RUNNER.md +552 -0
- package/docs/AX.md +317 -0
- package/docs/CHECKPOINT_RESUME.md +208 -0
- package/docs/CLI_VERBS.md +219 -0
- package/docs/CONFLICT_DETECTION.md +198 -0
- package/docs/DISCIPLINED_FAILURE.md +224 -0
- package/docs/ENVIRONMENT_QUALITY.md +155 -0
- package/docs/ERROR_CODES.md +528 -0
- package/docs/EVENT_SCHEMA.md +659 -0
- package/docs/EXE-012-investigation-summary.md +300 -0
- package/docs/GATE_ATTESTATION_GUIDE.md +237 -0
- package/docs/JSON_OUTPUT_SCHEMAS.md +347 -0
- package/docs/LEXRUNNER_ALIASING.md +444 -0
- package/docs/LEX_INTEGRATION.md +83 -0
- package/docs/LEX_PUBLIC_API.md +306 -0
- package/docs/LICENSING.md +119 -0
- package/docs/MCP-CLI-PARITY.md +410 -0
- package/docs/MCP-MIGRATION.md +258 -0
- package/docs/MCP-PARITY.md +234 -0
- package/docs/MEMORY_TOOLS.md +278 -0
- package/docs/MERGE_WEAVE_SETUP.md +643 -0
- package/docs/MIGRATION_v0.1.md +760 -0
- package/docs/NAMING_CONVENTIONS.md +82 -0
- package/docs/PERSONA_FOUNDATION.md +124 -0
- package/docs/PHASE3_MEMORY_GUIDE.md +122 -0
- package/docs/PLAN_LOCK.md +114 -0
- package/docs/README.md +289 -0
- package/docs/RUNNER_LIFECYCLE.md +257 -0
- package/docs/SAFETY_MECHANISMS.md +325 -0
- package/docs/SECURITY_IMPLEMENTATION.md +535 -0
- package/docs/TERMS.md +34 -0
- package/docs/TOKEN_TRACKING.md +162 -0
- package/docs/WORKFLOW_GUIDANCE.md +277 -0
- package/docs/adr/ADR-000-product-naming-and-branding.md +115 -0
- package/docs/adr/ADR-001-plan-json-frozen-input.md +68 -0
- package/docs/adr/ADR-002-two-track-separation.md +84 -0
- package/docs/adr/ADR-003-gate-uniform-execution.md +69 -0
- package/docs/adr/ADR-004-runner-state-model.md +75 -0
- package/docs/adr/ADR-005-merge-pyramid-ordering.md +87 -0
- package/docs/adr/ADR-006-schema-versioning-semver.md +81 -0
- package/docs/adr/ADR-007-task-snapshot-contract.md +503 -0
- package/docs/adr/ADR-008-lex-packaging.md +243 -0
- package/docs/adr/ADR-009-ax-test-output-adapters.md +440 -0
- package/docs/adr/README.md +32 -0
- package/docs/advanced-cli.md +436 -0
- package/docs/agent-stall-detection.md +278 -0
- package/docs/architecture/executors.md +190 -0
- package/docs/architecture.md +316 -0
- package/docs/attestation/AX-SHARED-PLEDGE.md +83 -0
- package/docs/attestation/AX-SHARED-PLEDGE_v1.0.0.md +99 -0
- package/docs/attestation/AX-SHARED-PLEDGE_v1.0.0_VERIFICATION.md +115 -0
- package/docs/attestation/Lex_Guff_Version_Contract_Pact_v1.0.0.md +181 -0
- package/docs/attestation/README.md +87 -0
- 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 +100 -0
- package/docs/attestation/copilot_summarization_behavior_observation_2025-12-01.md +85 -0
- 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 +45 -0
- package/docs/attestation/freetsa_tsa.crt +45 -0
- package/docs/attestation/lex_employment_separation_2025-11-26.md +85 -0
- package/docs/attestation/lex_employment_separation_2025-11-26_VERIFICATION.md +126 -0
- package/docs/attestation/patent/2025-12-07-shadow-governance-pct-draft.md +350 -0
- 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 +130 -0
- package/docs/attestation/patent/README.md +75 -0
- package/docs/attestation/patent/fig1_write_path.svg +58 -0
- package/docs/attestation/patent/fig2_read_normalize_rollup.svg +92 -0
- package/docs/attestation/timestamp_response.tsr +0 -0
- package/docs/attribution-README.md +264 -0
- package/docs/audit-compliance.md +283 -0
- package/docs/audit-outputs.md +1213 -0
- package/docs/audit-sdk.md +1134 -0
- package/docs/autopilot-levels.md +368 -0
- package/docs/autopilot.md +288 -0
- package/docs/ci-cd-integration.md +580 -0
- package/docs/ci-integration-guide.md +369 -0
- package/docs/ci-version-validation.md +198 -0
- package/docs/cli-mcp-weave-reporting.md +462 -0
- package/docs/cli.md +2262 -0
- package/docs/cluster-gates-rollback.md +222 -0
- package/docs/command-creation-guide.md +485 -0
- package/docs/command-whitelist.md +490 -0
- package/docs/commands/idea.md +253 -0
- package/docs/config.md +245 -0
- package/docs/conflict-clustering.md +225 -0
- package/docs/conflict-predictor.md +359 -0
- package/docs/context-diet.md +249 -0
- package/docs/counter-examples.md +199 -0
- package/docs/create-project.md +211 -0
- package/docs/deliverables-generator.md +299 -0
- package/docs/deliverables-management.md +474 -0
- package/docs/dependency-parser.md +354 -0
- package/docs/determinism.md +299 -0
- package/docs/diffgraph-planner.md +1211 -0
- package/docs/dogfood/README.md +33 -0
- package/docs/dogfood/wave-3-results.md +303 -0
- package/docs/dogfood-merge-weave-script.md +224 -0
- package/docs/enterprise-onboarding.md +291 -0
- package/docs/environment-variables.md +625 -0
- package/docs/error-recovery.md +466 -0
- package/docs/errors.md +288 -0
- package/docs/executor-authoring.md +854 -0
- package/docs/executor-decoupling.md +410 -0
- package/docs/front-end-capture-pipeline.md +312 -0
- package/docs/gate-report-examples.md +380 -0
- package/docs/gates.md +319 -0
- package/docs/github-automation.md +128 -0
- package/docs/governance-metrics.md +368 -0
- package/docs/integrations/README.md +588 -0
- package/docs/interactive-plan-review.md +493 -0
- package/docs/issue-orchestration.md +256 -0
- package/docs/lex_ax_session_key_rememberings_v0.1.md +195 -0
- package/docs/lexrunner-v1-summary.md +246 -0
- package/docs/lexrunner-v2-contract.md +404 -0
- package/docs/lexrunner-v2-migration-plan.md +388 -0
- package/docs/lexrunner-v2-salvage-map.md +355 -0
- package/docs/lexsona-rules.md +154 -0
- package/docs/merge-weave-analysis.md +403 -0
- package/docs/merge-weave-quickstart.md +770 -0
- package/docs/merge-weave-state-machine.md +390 -0
- package/docs/migration-guide.md +529 -0
- package/docs/monitoring-examples.md +470 -0
- package/docs/monitoring-implementation.md +252 -0
- package/docs/orchestration.md +234 -0
- package/docs/performance-scale.md +359 -0
- package/docs/plan-generation.md +407 -0
- package/docs/profile-resolution.md +455 -0
- package/docs/prompts.md +427 -0
- package/docs/quickstart.md +546 -0
- package/docs/release-process.md +310 -0
- package/docs/sample-prompts/merge-weave/cli-merge-weave-kickoff.md +274 -0
- package/docs/sample-prompts/merge-weave/mcp-merge-weave-kickoff.md +480 -0
- package/docs/sample-prompts/merge-weave/standalone-merge-weave-kickoff.md +237 -0
- package/docs/schemas.md +359 -0
- package/docs/scope-validation.md +444 -0
- package/docs/security/rotation-guide.md +325 -0
- package/docs/specs/Meeting_Control_Stack_Concept_v0.1.0.md +417 -0
- package/docs/specs/git-feature-flag-redesign.md +321 -0
- package/docs/specs/lex-pr-brief-behavior.md +269 -0
- package/docs/specs/smartergpt-structure-v1.md +705 -0
- package/docs/specs/task-brief-v0.1.md +224 -0
- package/docs/store-architecture.md +61 -0
- package/docs/templates/CONTRIBUTING-merge-weave-section.md +33 -0
- package/docs/templates/gates.example.yml +109 -0
- package/docs/templates/plan.example.json +77 -0
- package/docs/thesis/00-EVOLUTION-NOTES.md +383 -0
- package/docs/thesis/01-CORE-THESIS.md +285 -0
- package/docs/thesis/02-TURN-COST.md +498 -0
- package/docs/thesis/03-PERMISSION-TO-FAIL.md +581 -0
- package/docs/thesis/04-CROSS-MODEL-CONTINUITY.md +517 -0
- package/docs/thesis/05-RULE-FILE-SPEC.md +732 -0
- package/docs/thesis/06-CAPABILITY-TIERS.md +723 -0
- package/docs/thesis/07-ROBERT-FIELD-REPORT.md +433 -0
- package/docs/thesis/08-IMPLEMENTATION-GUIDE.md +1093 -0
- package/docs/thesis/09-METRICS-AND-TELEMETRY.md +793 -0
- package/docs/thesis/10-FAILURE-MODES.md +716 -0
- package/docs/thesis/README.md +151 -0
- package/docs/thesis/lex_governance-collab_systems_paper_draft.md +952 -0
- package/docs/thesis/lex_governance-collab_systems_paper_draft.pdf +0 -0
- package/docs/tool-grounded/READINESS_ANALYSIS.md +527 -0
- package/docs/tool-grounded/enforcement.md +361 -0
- package/docs/tool-grounded/tool-grounded-a-view-from-the-inside.md +437 -0
- package/docs/tool-grounded/tool-grounded-prompt.md +122 -0
- package/docs/tool-grounded/tool-grounded-run-centric.md +474 -0
- package/docs/troubleshooting-planner.md +910 -0
- package/docs/troubleshooting.md +745 -0
- package/docs/tutorials/README.md +201 -0
- package/docs/tutorials/diffgraph-planner/01-simple-stack.md +460 -0
- package/docs/tutorials/diffgraph-planner/02-diamond-pattern.md +431 -0
- package/docs/tutorials/diffgraph-planner/03-large-batch.md +525 -0
- package/docs/tutorials/diffgraph-planner/04-fixing-cycles.md +526 -0
- package/docs/tutorials/diffgraph-planner/05-hybrid-workflow.md +555 -0
- package/docs/tutorials/quick-merge-pyramid.md +364 -0
- package/docs/tutorials/video-scripts/01-getting-started.md +286 -0
- package/docs/tutorials/video-scripts/02-understanding-dependencies.md +376 -0
- package/docs/weave-contract.md +116 -0
- package/docs/weave-execution-log.md +153 -0
- package/docs/workflows/README.md +139 -0
- package/docs/workflows/enterprise.md +545 -0
- package/docs/workflows/small-team.md +398 -0
- package/docs/workflows/solo-developer.md +419 -0
- package/dogfood-merge-weave.sh +122 -0
- package/examples/README.md +22 -0
- package/examples/WORKING_EXAMPLE.md +309 -0
- package/examples/analyze-pr-files.js +100 -0
- package/examples/autopilot-level4-example.md +234 -0
- package/examples/cluster-gates-demo.sh +178 -0
- package/examples/complete-security-workflow.ts +248 -0
- package/examples/error-recovery/README.md +202 -0
- package/examples/executor-manifest.example.yaml +81 -0
- package/examples/front-end-capture-pipeline/README.md +99 -0
- package/examples/front-end-capture-pipeline/create-project-example.sh +83 -0
- package/examples/front-end-capture-pipeline/idea-dark-mode.json +14 -0
- package/examples/front-end-capture-pipeline/idea-example.sh +57 -0
- package/examples/front-end-capture-pipeline/manual-test-checklist.md +426 -0
- package/examples/gates/README.md +165 -0
- package/examples/gates/lint-gate.sh +40 -0
- package/examples/gates/lint-gate.ts +99 -0
- package/examples/gates/test-runner.ts +113 -0
- package/examples/gates/vuln-scanner.ts +95 -0
- package/examples/github-integration/README.md +111 -0
- package/examples/github-integration/example-plan.json +95 -0
- package/examples/performance-config.md +388 -0
- package/examples/profile-setup/.gitignore.template +66 -0
- package/examples/profile-setup/.smartergpt-example/README.md +190 -0
- package/examples/profile-setup/.smartergpt.local-example/README.md +365 -0
- package/examples/profile-setup/README.md +492 -0
- package/examples/profile-setup/cross-repo-prompts/README.md +606 -0
- package/examples/safety-framework-demo.ts +130 -0
- package/examples/safety-mechanisms-example.ts +191 -0
- package/examples/sample-plan.json +87 -0
- package/examples/sample-stack.yml +66 -0
- package/examples/sarif/README.md +224 -0
- package/examples/scope-validation-demo.ts +199 -0
- package/examples/security-integration.ts +293 -0
- package/examples/token-tracking-example.ts +71 -0
- package/executors/senior-dev/ARCHITECTURE.md +182 -0
- package/executors/senior-dev/MEMORY_INTEGRATION.md +236 -0
- package/executors/senior-dev/QUICK_START.md +145 -0
- package/executors/senior-dev/README.md +76 -0
- package/executors/senior-dev/examples/sample-review-session.md +228 -0
- package/executors/senior-dev/executor-manifest.yaml +79 -0
- package/executors/senior-dev/prompts/code-review.prompt.md +78 -0
- package/executors/senior-dev/prompts/mentorship-feedback.prompt.md +97 -0
- package/executors/senior-dev/prompts/pattern-recognition.prompt.md +80 -0
- package/executors/senior-dev/prompts/pr-analysis.prompt.md +75 -0
- package/executors/senior-dev/scripts/capture-review-frame.sh +129 -0
- package/executors/senior-dev/scripts/prepare-review-context.sh +61 -0
- package/executors/senior-dev/scripts/recall-context.sh +87 -0
- package/lexrunner-launcher.sh +12 -0
- package/mcp-config-example.json +14 -0
- package/mcp-server.mjs +1221 -0
- package/merge-weave-current-prs.md +170 -0
- package/merge-weave-dogfood.json +46 -0
- package/merge-weave-plan.json +56 -0
- package/package.json +140 -0
- package/procedures/merge-weave-main.yaml +90 -0
- package/procedures/pr-review.yaml +68 -0
- package/project/README.md +50 -0
- package/prompts/tool-grounded-mode.md +185 -0
- package/schemas/allowed-commands.schema.json +108 -0
- package/schemas/audit-events.schema.json +138 -0
- package/schemas/audit-events.v1.0.0.schema.json +138 -0
- package/schemas/edit-plan.schema.json +80 -0
- package/schemas/executor-manifest.schema.json +236 -0
- package/schemas/flake-report.schema.json +95 -0
- package/schemas/gate-report.schema.json +85 -0
- package/schemas/gates/build.schema.json +32 -0
- package/schemas/gates/coverage.schema.json +42 -0
- package/schemas/gates/lint.schema.json +34 -0
- package/schemas/gates/security-scan.schema.json +33 -0
- package/schemas/gates/test.schema.json +35 -0
- package/schemas/next-option.schema.json +60 -0
- package/schemas/persona-snapshot.schema.json +66 -0
- package/schemas/plan.schema.json +300 -0
- package/schemas/status-response.schema.json +193 -0
- package/scripts/README.md +354 -0
- package/scripts/analyze-governance-logs.mjs +51 -0
- package/scripts/benchmark-ci.ts +339 -0
- package/scripts/check-determinism.sh +23 -0
- package/scripts/check-license-compliance.mjs +319 -0
- package/scripts/check-release-drift.mjs +81 -0
- package/scripts/ci-debug.sh +24 -0
- package/scripts/ci-smoke.mjs +304 -0
- package/scripts/create-sample-repo.sh +245 -0
- package/scripts/dogfood-merge-weave.sh +552 -0
- package/scripts/gen_mcp_servers.py +252 -0
- package/scripts/generate-executor-manifest-schema.ts +30 -0
- package/scripts/generate-flake-schema.ts +32 -0
- package/scripts/generate-gate-schema.ts +32 -0
- package/scripts/generate-plan-schema.ts +30 -0
- package/scripts/generate-run-schemas.ts +69 -0
- package/scripts/load-prompt.mjs +147 -0
- package/scripts/merge-weave-wrapper.sh +445 -0
- package/scripts/merge-weave.sh +489 -0
- package/scripts/metrics-template.ts +134 -0
- package/scripts/package-lex.sh +267 -0
- package/scripts/quick-start-merge-weave.sh +218 -0
- package/scripts/release-prepare.ts +350 -0
- package/scripts/rotate-secrets-example.ts +134 -0
- package/scripts/test-lexsona-shadow.mjs +100 -0
- package/scripts/validate-manifests.ts +188 -0
- package/scripts/verify-audit-phase2.js +175 -0
- package/src/ai/README.md +456 -0
- package/src/ai/conflictStrategy.ts +223 -0
- package/src/ai/conflictStrategyCache.ts +164 -0
- package/src/ai/conflictStrategyPrompt.ts +128 -0
- package/src/ai/conflictStrategySchema.ts +165 -0
- package/src/ai/heuristicFallback.ts +162 -0
- package/src/ai/index.ts +64 -0
- package/src/ai/riskScoring.ts +174 -0
- package/src/aliases/index.ts +16 -0
- package/src/aliases/resolver.ts +212 -0
- package/src/audit/context.ts +284 -0
- package/src/audit/emitter.ts +685 -0
- package/src/audit/events.ts +210 -0
- package/src/audit/gateMatrix.ts +158 -0
- package/src/audit/index.ts +44 -0
- package/src/audit/manifest.ts +78 -0
- package/src/audit/profiles.ts +93 -0
- package/src/audit/redaction.ts +216 -0
- package/src/audit/sarif.ts +213 -0
- package/src/audit/schema/events.ts +366 -0
- package/src/audit/schema/manifest.ts +47 -0
- package/src/audit/schema.ts +159 -0
- package/src/audit/sdk/index.ts +145 -0
- package/src/audit/sdk/types.ts +88 -0
- package/src/audit/sidecar.ts +111 -0
- package/src/audit/signing.ts +521 -0
- package/src/autopilot/README.md +113 -0
- package/src/autopilot/artifacts.ts +287 -0
- package/src/autopilot/base.ts +132 -0
- package/src/autopilot/deliverables.ts +392 -0
- package/src/autopilot/index.ts +29 -0
- package/src/autopilot/level1.ts +187 -0
- package/src/autopilot/level2.ts +262 -0
- package/src/autopilot/level3.ts +263 -0
- package/src/autopilot/level4.ts +393 -0
- package/src/autopilot/safety/README.md +512 -0
- package/src/autopilot/safety/SafetyFramework.ts +634 -0
- package/src/autopilot/safety/index.ts +16 -0
- package/src/autopilot/types.ts +250 -0
- package/src/budget/index.ts +56 -0
- package/src/budget/manager.ts +547 -0
- package/src/budget/schema.ts +305 -0
- package/src/budget/tracker.ts +155 -0
- package/src/cache/issue-cache.ts +150 -0
- package/src/cli/command-map.ts +221 -0
- package/src/cli/commands/gate/test.ts +214 -0
- package/src/cli/exitHandler.ts +98 -0
- package/src/cli/flags.ts +123 -0
- package/src/cli/formatSuggestions.ts +202 -0
- package/src/cli/formatters.ts +294 -0
- package/src/cli/jsonEnvelope.ts +152 -0
- package/src/cli/output.ts +61 -0
- package/src/cli/runnerLifecycle.ts +118 -0
- package/src/cli-audit.ts +76 -0
- package/src/cli-security.ts +114 -0
- package/src/cli.ts +1231 -0
- package/src/commands/audit/index.ts +5 -0
- package/src/commands/audit/verify.ts +87 -0
- package/src/commands/autopilot.ts +131 -0
- package/src/commands/budget.ts +327 -0
- package/src/commands/bulkOps.ts +204 -0
- package/src/commands/completion.ts +287 -0
- package/src/commands/config/validate.ts +428 -0
- package/src/commands/config.ts +368 -0
- package/src/commands/counterExamples.ts +104 -0
- package/src/commands/create-project.ts +338 -0
- package/src/commands/discover.ts +192 -0
- package/src/commands/doctor.ts +436 -0
- package/src/commands/execute.ts +558 -0
- package/src/commands/explain.ts +157 -0
- package/src/commands/fanout-analyze.ts +684 -0
- package/src/commands/fanout-harvest.ts +328 -0
- package/src/commands/fanout-monitor.ts +224 -0
- package/src/commands/gateAttest.ts +95 -0
- package/src/commands/gateImport.ts +142 -0
- package/src/commands/gateImportChecks.ts +208 -0
- package/src/commands/gateReport.ts +184 -0
- package/src/commands/governanceCleanup.ts +171 -0
- package/src/commands/governanceReport.ts +497 -0
- package/src/commands/guards.ts +50 -0
- package/src/commands/idea.ts +281 -0
- package/src/commands/init.ts +414 -0
- package/src/commands/issues.ts +165 -0
- package/src/commands/merge.ts +677 -0
- package/src/commands/mergeOrder.ts +68 -0
- package/src/commands/metrics.ts +232 -0
- package/src/commands/migrateProfile.ts +187 -0
- package/src/commands/orchestrate/analyze-issues.ts +203 -0
- package/src/commands/orchestrate/assign-batch.ts +204 -0
- package/src/commands/orchestrate/generate-deliverables.ts +66 -0
- package/src/commands/orchestrate/pinToolchain.ts +102 -0
- package/src/commands/orchestrate/plan-batch.ts +119 -0
- package/src/commands/orchestrate/predict-conflicts.ts +210 -0
- package/src/commands/orchestrate.ts +186 -0
- package/src/commands/plan.ts +403 -0
- package/src/commands/planDiff.ts +56 -0
- package/src/commands/planReview.ts +112 -0
- package/src/commands/planViewer.ts +180 -0
- package/src/commands/preview-constraints.ts +97 -0
- package/src/commands/query.ts +313 -0
- package/src/commands/report.ts +56 -0
- package/src/commands/retry.ts +60 -0
- package/src/commands/schema.ts +128 -0
- package/src/commands/security.ts +140 -0
- package/src/commands/seniorDev.ts +326 -0
- package/src/commands/status.ts +97 -0
- package/src/commands/tokenReport.ts +167 -0
- package/src/commands/validation.ts +66 -0
- package/src/commands/weave-checkpoints.ts +145 -0
- package/src/commands/weave-fanout.ts +273 -0
- package/src/commands/weave-policy.ts +277 -0
- package/src/commands/weave.ts +518 -0
- package/src/config/localOverlay.ts +167 -0
- package/src/config/pathResolver.ts +106 -0
- package/src/config/profileResolver.ts +194 -0
- package/src/config/promptsResolver.ts +312 -0
- package/src/config/rulesResolver.ts +257 -0
- package/src/config/schemas.ts +142 -0
- package/src/core/bootstrap.ts +287 -0
- package/src/core/enterprise.ts +453 -0
- package/src/core/errorRecovery.ts +509 -0
- package/src/core/githubPlan.ts +282 -0
- package/src/core/inputs.ts +314 -0
- package/src/core/multiRepoPlan.ts +353 -0
- package/src/core/plan.ts +106 -0
- package/src/core/snapshot.ts +189 -0
- package/src/errors/adapters.ts +897 -0
- package/src/errors/index.ts +231 -0
- package/src/executionState.ts +356 -0
- package/src/executors/README_FRAME_CONTRACT.md +446 -0
- package/src/executors/frameContract.ts +270 -0
- package/src/executors/guardrailEnforcement.ts +294 -0
- package/src/executors/seniorDev/core.ts +548 -0
- package/src/executors/seniorDev/index.ts +30 -0
- package/src/executors/seniorDev/types.ts +176 -0
- package/src/executors/toolBudget.ts +194 -0
- package/src/fanout/analyzer.ts +735 -0
- package/src/fanout/github-adapter.ts +262 -0
- package/src/fanout/harvest.ts +517 -0
- package/src/fanout/monitor.ts +350 -0
- package/src/fanout/types.ts +428 -0
- package/src/frames/controller.ts +160 -0
- package/src/frames/emitter.ts +455 -0
- package/src/frames/index.ts +58 -0
- package/src/frames/storage.ts +203 -0
- package/src/frames/types.ts +258 -0
- package/src/gates/checkRunConverter.ts +91 -0
- package/src/gates/test/adapters/errors.ts +32 -0
- package/src/gates/test/adapters/index.ts +36 -0
- package/src/gates/test/adapters/interface.ts +63 -0
- package/src/gates/test/adapters/jest-json.ts +370 -0
- package/src/gates/test/adapters/junit-xml.ts +400 -0
- package/src/gates/test/adapters/registry.ts +149 -0
- package/src/gates/test/adapters/vitest-json.ts +339 -0
- package/src/gates/test/enrichment/failureId.ts +74 -0
- package/src/gates/test/enrichment/index.ts +25 -0
- package/src/gates/test/enrichment/nextActions.ts +322 -0
- package/src/gates/test/enrichment/rerunTemplates.ts +105 -0
- package/src/gates/test/enrichment/signature.ts +58 -0
- package/src/gates/test/enrichment/stackParser.ts +149 -0
- package/src/gates/test/enrichment/types.ts +67 -0
- package/src/gates/test/formatters/markdown.spec.ts +942 -0
- package/src/gates/test/formatters/markdown.ts +296 -0
- package/src/gates/test/index.ts +54 -0
- package/src/gates/test/schema.spec.ts +372 -0
- package/src/gates/test/schema.ts +327 -0
- package/src/gates/validator.ts +92 -0
- package/src/gates.ts +1022 -0
- package/src/git/operations.ts +592 -0
- package/src/git/parseRemote.ts +22 -0
- package/src/github/api.ts +584 -0
- package/src/github/batch-ops.ts +215 -0
- package/src/github/client.ts +647 -0
- package/src/github/contextDiet.ts +205 -0
- package/src/github/diffHunks.ts +285 -0
- package/src/github/index.ts +11 -0
- package/src/github/minimalContext.ts +212 -0
- package/src/github/minimalContextClient.ts +105 -0
- package/src/github/symbolMap.ts +370 -0
- package/src/github/types.ts +166 -0
- package/src/governance/index.ts +42 -0
- package/src/governance/mcpStatus.ts +258 -0
- package/src/governance/timeoutAdjustment.ts +149 -0
- package/src/governance/turnCostSummary.ts +182 -0
- package/src/hooks/events.ts +374 -0
- package/src/hooks/index.ts +8 -0
- package/src/hostility/checks.ts +408 -0
- package/src/hostility/index.ts +108 -0
- package/src/hostility/score.ts +143 -0
- package/src/interactive/planDiff.ts +168 -0
- package/src/interactive/planHistory.ts +205 -0
- package/src/interactive/planReview.ts +531 -0
- package/src/learning/counter-example.ts +174 -0
- package/src/learning/prompts.ts +107 -0
- package/src/learning/storage.ts +230 -0
- package/src/lexsona/client.ts +367 -0
- package/src/lexsona/index.ts +44 -0
- package/src/lexsona/logger.ts +408 -0
- package/src/lexsona/types.ts +177 -0
- package/src/mcp/DEPRECATED.md +33 -0
- package/src/mcp/server.ts +3587 -0
- package/src/mcp/types/guided-response.ts +95 -0
- package/src/mcp/types.ts +468 -0
- package/src/mcp/workflow/state-machine.ts +277 -0
- package/src/mergeEligibility.ts +355 -0
- package/src/mergeOrder.ts +170 -0
- package/src/metrics/export.ts +472 -0
- package/src/metrics/index.ts +35 -0
- package/src/metrics/turncost.ts +284 -0
- package/src/monitoring/README.md +222 -0
- package/src/monitoring/audit.ts +98 -0
- package/src/monitoring/cache.ts +121 -0
- package/src/monitoring/dashboards/grafana-dashboard.json +172 -0
- package/src/monitoring/errorRecovery.ts +334 -0
- package/src/monitoring/errors.ts +105 -0
- package/src/monitoring/fileLogger.ts +194 -0
- package/src/monitoring/hallucinations.ts +45 -0
- package/src/monitoring/health.ts +171 -0
- package/src/monitoring/index.ts +16 -0
- package/src/monitoring/lock.ts +158 -0
- package/src/monitoring/logger.ts +178 -0
- package/src/monitoring/metrics.ts +245 -0
- package/src/monitoring/profiler.ts +156 -0
- package/src/monitoring/tokenLogger.ts +141 -0
- package/src/orchestrate/analyzer.ts +461 -0
- package/src/orchestrate/index.ts +6 -0
- package/src/orchestrate/types.ts +65 -0
- package/src/orchestration/README.md +480 -0
- package/src/orchestration/agentAssigner.ts +206 -0
- package/src/orchestration/batchPlanner.ts +201 -0
- package/src/orchestration/conflictClustering.ts +344 -0
- package/src/orchestration/conflictGraph.ts +63 -0
- package/src/orchestration/conflictPredictor.ts +170 -0
- package/src/orchestration/deliverablesGenerator.ts +345 -0
- package/src/orchestration/determinism.ts +232 -0
- package/src/orchestration/index.ts +45 -0
- package/src/orchestration/mergeTreeSimulator.ts +137 -0
- package/src/orchestration/mis.ts +123 -0
- package/src/orchestration/toolchainManifest.ts +169 -0
- package/src/orchestration/types.ts +103 -0
- package/src/performance.README.md +99 -0
- package/src/performance.ts +279 -0
- package/src/planner/README.md +215 -0
- package/src/planner/dependencyParser.ts +404 -0
- package/src/planner/dependencyScoring.ts +346 -0
- package/src/planner/fileAnalysis.ts +693 -0
- package/src/planner/index.ts +41 -0
- package/src/planner/scopeValidator.ts +308 -0
- package/src/planner/types.ts +80 -0
- package/src/planner/validation.ts +493 -0
- package/src/preview/constraints.ts +333 -0
- package/src/procedures/index.ts +47 -0
- package/src/procedures/loader.ts +252 -0
- package/src/procedures/schema.ts +191 -0
- package/src/procedures/stateMachine.ts +160 -0
- package/src/procedures/types.ts +178 -0
- package/src/receipts/emit.ts +354 -0
- package/src/receipts/index.ts +48 -0
- package/src/receipts/schema.ts +227 -0
- package/src/report/aggregate.ts +160 -0
- package/src/runs/artifacts.ts +315 -0
- package/src/runs/attribution.ts +132 -0
- package/src/runs/context.ts +54 -0
- package/src/runs/decisions.ts +407 -0
- package/src/runs/enforcement.ts +395 -0
- package/src/runs/failures.ts +517 -0
- package/src/runs/index.ts +141 -0
- package/src/runs/manager.ts +910 -0
- package/src/runs/statusBuilder.ts +233 -0
- package/src/runs/storage.ts +290 -0
- package/src/runs/types.ts +216 -0
- package/src/schema/flakeReport.ts +74 -0
- package/src/schema/gateMapping.ts +107 -0
- package/src/schema/gateReport.ts +236 -0
- package/src/schema/weaveLock.ts +51 -0
- package/src/schema.ts +313 -0
- package/src/schemas/executorManifest.ts +204 -0
- package/src/schemas/feature-spec-v0.ts +40 -0
- package/src/schemas/persona.ts +162 -0
- package/src/schemas/project.ts +91 -0
- package/src/schemas/runCentric.ts +402 -0
- package/src/schemas/task-contract.ts +626 -0
- package/src/schemas/vacuumReadyPrompt.ts +128 -0
- package/src/sdk/index.ts +113 -0
- package/src/sdk/parser.ts +101 -0
- package/src/sdk/query.ts +315 -0
- package/src/sdk/validator.ts +114 -0
- package/src/security/README.md +496 -0
- package/src/security/authentication.ts +173 -0
- package/src/security/authorization.ts +348 -0
- package/src/security/commandValidator.ts +195 -0
- package/src/security/compliance.ts +688 -0
- package/src/security/index.ts +85 -0
- package/src/security/policy.ts +399 -0
- package/src/security/sarif.ts +179 -0
- package/src/security/scanning.ts +362 -0
- package/src/security/secrets.ts +520 -0
- package/src/shared/git/index.ts +30 -0
- package/src/shared/git/runGit.ts +281 -0
- package/src/shared/git/runtime.ts +66 -0
- package/src/snapshot/builder.ts +229 -0
- package/src/snapshot/index.ts +8 -0
- package/src/store/CONTRACT.md +189 -0
- package/src/store/README.md +22 -0
- package/src/store/index.ts +99 -0
- package/src/store/inmemory/index.ts +10 -0
- package/src/store/inmemory/run-store.ts +268 -0
- package/src/store/postgres/.gitkeep +0 -0
- package/src/store/run-store.ts +405 -0
- package/src/store/sqlite/index.ts +7 -0
- package/src/store/sqlite/run-store.ts +525 -0
- package/src/store/sqlite/schema.sql +67 -0
- package/src/telemetry/frames.ts +179 -0
- package/src/telemetry/index.ts +5 -0
- package/src/tiers/index.ts +34 -0
- package/src/tiers/metrics.ts +156 -0
- package/src/tiers/schema.ts +95 -0
- package/src/tiers/suggest.ts +183 -0
- package/src/types/guardrails.ts +452 -0
- package/src/types/index.ts +42 -0
- package/src/util/canonicalJson.ts +29 -0
- package/src/util/colorControl.ts +46 -0
- package/src/util/envUtils.ts +139 -0
- package/src/util/hash.ts +69 -0
- package/src/util/lockHash.ts +90 -0
- package/src/util/minHeap.ts +108 -0
- package/src/util/progress.ts +89 -0
- package/src/util/tokenEstimator.ts +55 -0
- package/src/utils/fingerprint.ts +105 -0
- package/src/utils/paths.ts +209 -0
- package/src/utils/tokens.ts +151 -0
- package/src/utils/validation.ts +53 -0
- package/src/verification/diff-applier.ts +60 -0
- package/src/verification/engine-verifier.ts +171 -0
- package/src/verification/errors.ts +30 -0
- package/src/verification/index.ts +13 -0
- package/src/weave/audit/index.ts +17 -0
- package/src/weave/audit/logger.ts +206 -0
- package/src/weave/authority/evaluator.ts +660 -0
- package/src/weave/authority/index.ts +30 -0
- package/src/weave/authority/schema.ts +292 -0
- package/src/weave/checkpoint/index.ts +7 -0
- package/src/weave/checkpoint/storage.ts +223 -0
- package/src/weave/checkpoint/types.ts +121 -0
- package/src/weave/checkpoint/utils.ts +207 -0
- package/src/weave/clusterGates.ts +366 -0
- package/src/weave/draftPR.ts +214 -0
- package/src/weave/executor/d1-executor.ts +822 -0
- package/src/weave/executor/d2-executor.ts +381 -0
- package/src/weave/executor/index.ts +24 -0
- package/src/weave/executor/types.ts +135 -0
- package/src/weave/fanout/generator.ts +186 -0
- package/src/weave/fanout/index.ts +51 -0
- package/src/weave/fanout/loader.ts +134 -0
- package/src/weave/fanout/matcher.ts +239 -0
- package/src/weave/fanout/schema.ts +178 -0
- package/src/weave/frameHelper.ts +126 -0
- package/src/weave/gateFailureHandler.ts +405 -0
- package/src/weave/index.ts +89 -0
- package/src/weave/lockFile.ts +193 -0
- package/src/weave/mergeHelpers.ts +377 -0
- package/src/weave/mergeWeaveSequential.ts +282 -0
- package/src/weave/metrics/calculator.ts +362 -0
- package/src/weave/metrics/index.ts +44 -0
- package/src/weave/metrics/logger.ts +291 -0
- package/src/weave/metrics/schema.ts +505 -0
- package/src/weave/planner/index.ts +23 -0
- package/src/weave/planner/planner.ts +411 -0
- package/src/weave/planner/types.ts +181 -0
- package/src/weave/policy/index.ts +63 -0
- package/src/weave/policy/loader.ts +148 -0
- package/src/weave/policy/schema.ts +290 -0
- package/src/weave/post-merge-checks.ts +220 -0
- package/src/weave/preflightConflicts.ts +375 -0
- package/src/weave/receiptHelper.ts +287 -0
- package/src/weave/recovery.ts +232 -0
- package/src/weave/resolutionGuidance.ts +173 -0
- package/src/weave/stateMachine.ts +426 -0
- package/src/weave/testfix/applier.ts +195 -0
- package/src/weave/testfix/index.ts +18 -0
- package/src/weave/testfix/loader.ts +116 -0
- package/src/weave/testfix/matcher.ts +158 -0
- package/src/weave/testfix/schema.ts +218 -0
- package/src/weave/types.ts +305 -0
- package/src/weave/utils/copilot-completion.ts +76 -0
- package/test-mcp-dogfood.mjs +128 -0
- package/test-mcp.mjs +116 -0
- package/tests/README.md +155 -0
- package/tests/advanced-cli-e2e.spec.ts +218 -0
- package/tests/agentAssigner.spec.ts +261 -0
- package/tests/ai-conflict-strategy-cache.spec.ts +254 -0
- package/tests/ai-conflict-strategy-risk.spec.ts +287 -0
- package/tests/ai-conflict-strategy-schema.spec.ts +252 -0
- package/tests/ai-conflict-strategy.spec.ts +442 -0
- package/tests/aliases/resolver.spec.ts +238 -0
- package/tests/audit/context.spec.ts +283 -0
- package/tests/audit/emitter.spec.ts +347 -0
- package/tests/audit/gateMatrix.spec.ts +335 -0
- package/tests/audit/integration.spec.ts +236 -0
- package/tests/audit/redaction.spec.ts +290 -0
- package/tests/audit/sarif-integration.spec.ts +303 -0
- package/tests/audit/sarif.spec.ts +458 -0
- package/tests/audit/schema-events.spec.ts +421 -0
- package/tests/audit/schema.spec.ts +434 -0
- package/tests/audit/sdk-integration.spec.ts +598 -0
- package/tests/audit/sdk.spec.ts +318 -0
- package/tests/audit/signing-integration.spec.ts +276 -0
- package/tests/audit/signing.spec.ts +350 -0
- package/tests/audit-signing.spec.ts +406 -0
- package/tests/audit-verify-cli.spec.ts +176 -0
- package/tests/autopilot-e2e-level3-4.spec.ts +741 -0
- package/tests/autopilot-integration.spec.ts +274 -0
- package/tests/autopilot-level1.spec.ts +449 -0
- package/tests/autopilot-level2.spec.ts +188 -0
- package/tests/autopilot-level3.spec.ts +266 -0
- package/tests/autopilot-level4.spec.ts +454 -0
- package/tests/autopilot.spec.ts +379 -0
- package/tests/ax-error-adapters.spec.ts +580 -0
- package/tests/batch-planner.spec.ts +500 -0
- package/tests/benchmark-infrastructure.spec.ts +445 -0
- package/tests/benchmarks/README.md +103 -0
- package/tests/benchmarks/baselines/baseline.json +127 -0
- package/tests/benchmarks/core/dependencyResolver.bench.ts +128 -0
- package/tests/benchmarks/core/planParser.bench.ts +114 -0
- package/tests/benchmarks/core/topologicalSort.bench.ts +102 -0
- package/tests/benchmarks/index.ts +36 -0
- package/tests/benchmarks/io/fileOperations.bench.ts +132 -0
- package/tests/benchmarks/io/gitOperations.bench.ts +99 -0
- package/tests/benchmarks/utils/graphGenerator.ts +201 -0
- package/tests/benchmarks/utils/reporter.ts +231 -0
- package/tests/benchmarks/workflows/endToEnd.bench.ts +132 -0
- package/tests/bootstrap.test.ts +319 -0
- package/tests/budget-tracker.spec.ts +279 -0
- package/tests/bulkOps.spec.ts +166 -0
- package/tests/bulletproof-determinism.test.ts +223 -0
- package/tests/canonicalJson.test.ts +130 -0
- package/tests/checkRunConverter.spec.ts +357 -0
- package/tests/cli/commands/gate/test.spec.ts +564 -0
- package/tests/cli/emit-frames-flag.spec.ts +117 -0
- package/tests/cli/exitHandler.spec.ts +314 -0
- package/tests/cli/flags.spec.ts +223 -0
- package/tests/cli/formatters.spec.ts +513 -0
- package/tests/cli/output.spec.ts +221 -0
- package/tests/cli-autopilot.spec.ts +170 -0
- package/tests/cli-budget-guards.spec.ts +210 -0
- package/tests/cli-color-control.spec.ts +334 -0
- package/tests/cli-deliverables-generator.spec.ts +185 -0
- package/tests/cli-determinism.spec.ts +496 -0
- package/tests/cli-init-enterprise.spec.ts +294 -0
- package/tests/cli-init-json.spec.ts +154 -0
- package/tests/cli-init-local.spec.ts +159 -0
- package/tests/cli-json-envelope.spec.ts +140 -0
- package/tests/cli-json.spec.ts +408 -0
- package/tests/cli-orchestrate-plan-batch.spec.ts +329 -0
- package/tests/cli-orchestrate.spec.ts +231 -0
- package/tests/cli-plan-generation.spec.ts +367 -0
- package/tests/cli-plan-review.spec.ts +300 -0
- package/tests/cli-progress.spec.ts +193 -0
- package/tests/cli-ux-enhancements.spec.ts +213 -0
- package/tests/cliJsonPurity.spec.ts +437 -0
- package/tests/cliSuggestDeps.spec.ts +360 -0
- package/tests/cluster-gates-rollback.spec.ts +353 -0
- package/tests/command-validator-integration.spec.ts +305 -0
- package/tests/command-validator.spec.ts +380 -0
- package/tests/commands/autopilot.spec.ts +124 -0
- package/tests/commands/config-validate.spec.ts +301 -0
- package/tests/commands/config.spec.ts +311 -0
- package/tests/commands/create-project.spec.ts +90 -0
- package/tests/commands/doctor.spec.ts +57 -0
- package/tests/commands/execute.spec.ts +293 -0
- package/tests/commands/gateAttest.spec.ts +172 -0
- package/tests/commands/gateImport.spec.ts +176 -0
- package/tests/commands/gateReport.spec.ts +130 -0
- package/tests/commands/guards.spec.ts +114 -0
- package/tests/commands/idea.spec.ts +177 -0
- package/tests/commands/merge.spec.ts +166 -0
- package/tests/commands/plan.spec.ts +123 -0
- package/tests/commands/query.spec.ts +294 -0
- package/tests/commands/report.spec.ts +54 -0
- package/tests/commands/retry.spec.ts +300 -0
- package/tests/commands/schema.spec.ts +136 -0
- package/tests/commands/validation.spec.ts +229 -0
- package/tests/completion.spec.ts +133 -0
- package/tests/config-inspect.spec.ts +202 -0
- package/tests/conflictClustering-e2e.spec.ts +278 -0
- package/tests/conflictClustering.spec.ts +550 -0
- package/tests/conflictGraph.spec.ts +126 -0
- package/tests/conflictPredictor.spec.ts +238 -0
- package/tests/deliverables-generator.spec.ts +329 -0
- package/tests/deliverables.spec.ts +381 -0
- package/tests/dependencyParser-github.spec.ts +244 -0
- package/tests/dependencyParser.spec.ts +386 -0
- package/tests/dependencyScoring.spec.ts +668 -0
- package/tests/deterministic-applicable.test.ts +156 -0
- package/tests/deterministic-build.test.ts +172 -0
- package/tests/deterministic-simple.test.ts +32 -0
- package/tests/discover-suggest-integration.spec.ts +340 -0
- package/tests/dogfood-merge-weave-script.spec.ts +150 -0
- package/tests/e2e/planner.spec.ts +596 -0
- package/tests/e2e-comprehensive.test.ts +500 -0
- package/tests/e2e-determinism.test.ts +293 -0
- package/tests/e2e-synthetic-6pr-weave.spec.ts +329 -0
- package/tests/enterprise-init.spec.ts +350 -0
- package/tests/envUtils.spec.ts +267 -0
- package/tests/error-handling.test.ts +104 -0
- package/tests/error-recovery.spec.ts +451 -0
- package/tests/execution-plan-v1.test.ts +257 -0
- package/tests/executionState-loadGateResults.spec.ts +267 -0
- package/tests/executionState.test.ts +169 -0
- package/tests/executors/README.md +100 -0
- package/tests/executors/frameContract-integration.spec.ts +324 -0
- package/tests/executors/frameContract.spec.ts +531 -0
- package/tests/executors/guardrailEnforcement.spec.ts +424 -0
- package/tests/executors/lifecycle.spec.ts +313 -0
- package/tests/executors/toolBudget.spec.ts +473 -0
- package/tests/feature-spec-v0.test.ts +145 -0
- package/tests/fileAnalysis.spec.ts +946 -0
- package/tests/fingerprint.spec.ts +100 -0
- package/tests/fixtures/README.md +380 -0
- package/tests/fixtures/deliverables/batch-example-plan.json +62 -0
- package/tests/fixtures/executors/README.md +57 -0
- package/tests/fixtures/executors/index.ts +9 -0
- package/tests/fixtures/executors/mock-executor.ts +204 -0
- package/tests/fixtures/executors/registry.ts +51 -0
- package/tests/fixtures/executors/types.ts +95 -0
- package/tests/fixtures/fixtures.spec.ts +307 -0
- package/tests/fixtures/gates/configs.ts +234 -0
- package/tests/fixtures/gates/results.ts +234 -0
- package/tests/fixtures/harvest-bundle-fixture.json +87 -0
- package/tests/fixtures/index.ts +219 -0
- package/tests/fixtures/invalid/plans.ts +178 -0
- package/tests/fixtures/jest/all-passing.json +71 -0
- package/tests/fixtures/jest/snapshot-failures.json +66 -0
- package/tests/fixtures/jest/some-failing.json +100 -0
- package/tests/fixtures/jest/with-location.json +84 -0
- package/tests/fixtures/junit/cdata-messages.xml +29 -0
- package/tests/fixtures/junit/multiple-suites.xml +30 -0
- package/tests/fixtures/junit/single-suite.xml +17 -0
- package/tests/fixtures/junit/with-errors.xml +19 -0
- package/tests/fixtures/junit/with-skipped.xml +18 -0
- package/tests/fixtures/npm-audit.json +32 -0
- package/tests/fixtures/plan.bad-schema.json +5 -0
- package/tests/fixtures/plan.bad-unknown-dep.json +10 -0
- package/tests/fixtures/plan.ci-gates.json +36 -0
- package/tests/fixtures/plan.complex-cycle.json +22 -0
- package/tests/fixtures/plan.cycle.json +14 -0
- package/tests/fixtures/plan.deep-chain.json +95 -0
- package/tests/fixtures/plan.dogfood-execute.json +36 -0
- package/tests/fixtures/plan.gates.json +30 -0
- package/tests/fixtures/plan.integration-pyramid.json +56 -0
- package/tests/fixtures/plan.orphans.json +22 -0
- package/tests/fixtures/plan.parallel.json +30 -0
- package/tests/fixtures/plan.tiny.json +18 -0
- package/tests/fixtures/plan.wide-parallel.json +75 -0
- package/tests/fixtures/plan.with-failures.json +26 -0
- package/tests/fixtures/plan.with-vuln.json +25 -0
- package/tests/fixtures/planner/cross-module.json +101 -0
- package/tests/fixtures/planner/cycle-error.json +56 -0
- package/tests/fixtures/planner/diamond-pattern.json +74 -0
- package/tests/fixtures/planner/empty-repo.json +9 -0
- package/tests/fixtures/planner/file-overlap-heavy.json +110 -0
- package/tests/fixtures/planner/invalid-pr.json +25 -0
- package/tests/fixtures/planner/merge-conflicts.json +42 -0
- package/tests/fixtures/planner/mixed-deps.json +101 -0
- package/tests/fixtures/planner/self-dependency.json +24 -0
- package/tests/fixtures/planner/simple-stack.json +79 -0
- package/tests/fixtures/planner/single-pr.json +25 -0
- package/tests/fixtures/planner/stale-pr.json +40 -0
- package/tests/fixtures/plans/complex.ts +201 -0
- package/tests/fixtures/plans/diamond.ts +115 -0
- package/tests/fixtures/plans/linear.ts +74 -0
- package/tests/fixtures/plans/simple.ts +61 -0
- package/tests/fixtures/prs/basic.ts +175 -0
- package/tests/fixtures/prs/withDeps.ts +197 -0
- package/tests/fixtures/scan-results-clean.sarif +15 -0
- package/tests/fixtures/scan-results.sarif +74 -0
- package/tests/fixtures/scenarios/mergeWorkflows.ts +300 -0
- package/tests/fixtures/scenarios/syntheticWeave.ts +351 -0
- package/tests/fixtures/snapshot/package.json +5 -0
- package/tests/fixtures/snapshot/sample.ts +21 -0
- package/tests/fixtures/utils/cleanup.ts +81 -0
- package/tests/fixtures/utils/mockGitHub.ts +219 -0
- package/tests/fixtures/utils/tempDir.ts +109 -0
- package/tests/fixtures/verification/expected-verification.json +16 -0
- package/tests/fixtures/verification/receipt.json +31 -0
- package/tests/fixtures/verification/snapshot.json +44 -0
- package/tests/fixtures/vitest/all-passing.json +67 -0
- package/tests/fixtures/vitest/complex-nested-suites.json +98 -0
- package/tests/fixtures/vitest/some-failing.json +98 -0
- package/tests/fixtures/vitest/with-coverage.json +97 -0
- package/tests/fixtures-usage-examples.spec.ts +304 -0
- package/tests/flakeReport.spec.ts +267 -0
- package/tests/frames/ci-gate-integration.spec.ts +331 -0
- package/tests/frames/controller.spec.ts +165 -0
- package/tests/frames/emitter.spec.ts +371 -0
- package/tests/frames/idempotency.spec.ts +177 -0
- package/tests/frames/storage.spec.ts +346 -0
- package/tests/frames/types.spec.ts +249 -0
- package/tests/frames/v2-schema-integration.spec.ts +435 -0
- package/tests/gate-working-directory.spec.ts +204 -0
- package/tests/gateMapping.spec.ts +161 -0
- package/tests/gateReportIntegration.spec.ts +175 -0
- package/tests/gateReportValidation.spec.ts +452 -0
- package/tests/gates/test/adapters/jest-json.spec.ts +372 -0
- package/tests/gates/test/adapters/junit-xml.spec.ts +421 -0
- package/tests/gates/test/adapters/registry.spec.ts +376 -0
- package/tests/gates/test/adapters/vitest-json.spec.ts +455 -0
- package/tests/gates/test/enrichment/failureId.spec.ts +131 -0
- package/tests/gates/test/enrichment/nextActions.spec.ts +365 -0
- package/tests/gates/test/enrichment/rerunTemplates.spec.ts +187 -0
- package/tests/gates/test/enrichment/signature.spec.ts +163 -0
- package/tests/gates/test/enrichment/stackParser.spec.ts +203 -0
- package/tests/gates/turncost-integration.spec.ts +221 -0
- package/tests/gates/validation-integration.spec.ts +147 -0
- package/tests/gates/validator.spec.ts +200 -0
- package/tests/gates.test.ts +255 -0
- package/tests/gatesWithPolicy.hostilityTimeoutAdjustment.spec.ts +156 -0
- package/tests/git-operations-receipts.spec.ts +121 -0
- package/tests/git-operations.test.ts +152 -0
- package/tests/git-runtime.spec.ts +175 -0
- package/tests/github-api.labels.spec.ts +21 -0
- package/tests/github-api.test.ts +85 -0
- package/tests/github-context-diet.spec.ts +441 -0
- package/tests/github-diff-hunks.spec.ts +387 -0
- package/tests/github-integration.spec.ts +774 -0
- package/tests/github-minimal-context.spec.ts +338 -0
- package/tests/github-symbol-map.spec.ts +414 -0
- package/tests/githubClient.spec.ts +123 -0
- package/tests/governance/mcpStatus.spec.ts +276 -0
- package/tests/governance/timeoutAdjustment.spec.ts +149 -0
- package/tests/governance/turnCostSummary.spec.ts +188 -0
- package/tests/governance-retention.spec.ts +151 -0
- package/tests/governance-wrapper-delegation.spec.ts +148 -0
- package/tests/guardrails.spec.ts +860 -0
- package/tests/hash.test.ts +83 -0
- package/tests/helpers/cli.ts +23 -0
- package/tests/helpers/getStd.ts +1 -0
- package/tests/helpers/makeGate.ts +19 -0
- package/tests/helpers/plannerTestHelpers.ts +314 -0
- package/tests/hooks/events.spec.ts +518 -0
- package/tests/hostility/checks.spec.ts +295 -0
- package/tests/hostility/integration.spec.ts +123 -0
- package/tests/hostility/score.spec.ts +175 -0
- package/tests/init.spec.ts +270 -0
- package/tests/integration/hipaa-encryption.spec.ts +148 -0
- package/tests/integration/lex-smoke-test.spec.ts +328 -0
- package/tests/integration-e2e.test.ts +244 -0
- package/tests/integration-matrix.test.ts +409 -0
- package/tests/interPRConflicts.spec.ts +254 -0
- package/tests/interactive-plan-history.spec.ts +255 -0
- package/tests/interactive-plan-review.spec.ts +287 -0
- package/tests/issue-analyzer.spec.ts +593 -0
- package/tests/lexsona-integration.spec.ts +311 -0
- package/tests/localOverlay.spec.ts +203 -0
- package/tests/lockHash.spec.ts +167 -0
- package/tests/mcp-auth-errors.spec.ts +190 -0
- package/tests/mcp-contracts.spec.ts +290 -0
- package/tests/mcp-gates-external-plan.spec.ts +146 -0
- package/tests/mcp-granular-tools.spec.ts +208 -0
- package/tests/mcp-runstore-integration.spec.ts +334 -0
- package/tests/mcp-scope-integration.spec.ts +318 -0
- package/tests/mcp-task-handoff.spec.ts +320 -0
- package/tests/mcp-workflow-guide.spec.ts +53 -0
- package/tests/mcp.test.ts +151 -0
- package/tests/merge-conflict-detection.spec.ts +260 -0
- package/tests/mergeEligibility.test.ts +201 -0
- package/tests/mergeLockHash.spec.ts +158 -0
- package/tests/mergeOrder-with-fixtures.spec.ts +215 -0
- package/tests/mergeOrder.test.ts +108 -0
- package/tests/mergeTreeSimulator.spec.ts +145 -0
- package/tests/metrics/export.spec.ts +446 -0
- package/tests/metrics/turncost.spec.ts +309 -0
- package/tests/metrics-template.spec.ts +137 -0
- package/tests/migrateProfile.spec.ts +254 -0
- package/tests/mis.spec.ts +202 -0
- package/tests/monitoring-audit.spec.ts +181 -0
- package/tests/monitoring-cache.spec.ts +331 -0
- package/tests/monitoring-error-recovery.spec.ts +236 -0
- package/tests/monitoring-errors.spec.ts +193 -0
- package/tests/monitoring-fileLogger.spec.ts +319 -0
- package/tests/monitoring-health.spec.ts +152 -0
- package/tests/monitoring-lock.spec.ts +308 -0
- package/tests/monitoring-logger.spec.ts +157 -0
- package/tests/monitoring-metrics.spec.ts +158 -0
- package/tests/monitoring-profiler.spec.ts +197 -0
- package/tests/orchestration-determinism.spec.ts +204 -0
- package/tests/parseRemote.spec.ts +25 -0
- package/tests/pathResolver.spec.ts +122 -0
- package/tests/paths.spec.ts +68 -0
- package/tests/performance.spec.ts +322 -0
- package/tests/pipeline-determinism.spec.ts +597 -0
- package/tests/plan-tier-integration.spec.ts +184 -0
- package/tests/precedence-resolution.spec.ts +682 -0
- package/tests/preflightConflicts.spec.ts +205 -0
- package/tests/procedures/keystone-policy.spec.ts +296 -0
- package/tests/procedures/loader.spec.ts +585 -0
- package/tests/procedures/pr-review.spec.ts +321 -0
- package/tests/profileResolver.spec.ts +375 -0
- package/tests/progress-indicators.spec.ts +139 -0
- package/tests/promptsResolver.spec.ts +443 -0
- package/tests/public-api.spec.ts +272 -0
- package/tests/query.spec.ts +170 -0
- package/tests/receipts.spec.ts +463 -0
- package/tests/release-prepare.spec.ts +268 -0
- package/tests/report.test.ts +335 -0
- package/tests/resolutionGuidance.spec.ts +160 -0
- package/tests/rotate-secrets-example.spec.ts +198 -0
- package/tests/rulesResolver.spec.ts +232 -0
- package/tests/runGit.spec.ts +229 -0
- package/tests/runner-lifecycle-integration.spec.ts +283 -0
- package/tests/runs/artifacts.spec.ts +367 -0
- package/tests/runs/decisions.spec.ts +495 -0
- package/tests/runs/enforcement.spec.ts +555 -0
- package/tests/runs/failures.spec.ts +554 -0
- package/tests/runs/manager-runstore-integration.spec.ts +455 -0
- package/tests/runs/manager.spec.ts +678 -0
- package/tests/runs-manager.spec.ts +485 -0
- package/tests/safety-acceptance.spec.ts +278 -0
- package/tests/safety-enhanced.spec.ts +329 -0
- package/tests/safety-framework.spec.ts +427 -0
- package/tests/safety-guards-integration.spec.ts +213 -0
- package/tests/safety-integration.spec.ts +278 -0
- package/tests/sarif-parser.spec.ts +148 -0
- package/tests/schema.test.ts +88 -0
- package/tests/schemas/behavior-rule.spec.ts +366 -0
- package/tests/schemas/executorManifest.spec.ts +441 -0
- package/tests/schemas/persona-integration.spec.ts +62 -0
- package/tests/schemas/persona.spec.ts +172 -0
- package/tests/schemas/project.spec.ts +247 -0
- package/tests/schemas/run-store.spec.ts +553 -0
- package/tests/schemas/runCentric.spec.ts +463 -0
- package/tests/schemas/vacuumReadyPrompt.spec.ts +515 -0
- package/tests/scope-github-auto-detection.spec.ts +200 -0
- package/tests/scopeValidator.spec.ts +497 -0
- package/tests/security-authentication.spec.ts +42 -0
- package/tests/security-authorization.spec.ts +350 -0
- package/tests/security-cli.spec.ts +264 -0
- package/tests/security-compliance.spec.ts +334 -0
- package/tests/security-policy.spec.ts +295 -0
- package/tests/security-scanning.spec.ts +349 -0
- package/tests/security-secrets.spec.ts +401 -0
- package/tests/store/create-run-store.spec.ts +185 -0
- package/tests/store/inmemory/run-store.spec.ts +533 -0
- package/tests/store/sqlite/run-store.spec.ts +849 -0
- package/tests/telemetry/frames.spec.ts +120 -0
- package/tests/tiers.spec.ts +466 -0
- package/tests/token-usage.spec.ts +309 -0
- package/tests/toolchain-manifest.spec.ts +145 -0
- package/tests/unified-budget.spec.ts +713 -0
- package/tests/unit/cache/issue-cache.spec.ts +131 -0
- package/tests/unit/fanout/analyzer-integration.spec.ts +398 -0
- package/tests/unit/fanout/analyzer.spec.ts +605 -0
- package/tests/unit/fanout/github-adapter.spec.ts +203 -0
- package/tests/unit/fanout/harvest.spec.ts +93 -0
- package/tests/unit/fanout/monitor.spec.ts +297 -0
- package/tests/unit/fanout/types.spec.ts +308 -0
- package/tests/unit/github/batch-ops.spec.ts +179 -0
- package/tests/unit/learning/counter-example.spec.ts +168 -0
- package/tests/unit/learning/storage.spec.ts +154 -0
- package/tests/unit/preview/constraints.spec.ts +429 -0
- package/tests/unit/runs/attribution.spec.ts +204 -0
- package/tests/unit/schemas/task-contract.spec.ts +483 -0
- package/tests/unit/snapshot/builder.spec.ts +389 -0
- package/tests/unit/verification/engine-verifier.spec.ts +279 -0
- package/tests/unit/weave/authority-evaluator.spec.ts +404 -0
- package/tests/unit/weave/authority-schema.spec.ts +199 -0
- package/tests/unit/weave/auto-undraft-integration.spec.ts +349 -0
- package/tests/unit/weave/copilot-completion.spec.ts +182 -0
- package/tests/unit/weave/d1-executor.spec.ts +269 -0
- package/tests/unit/weave/d2-executor.spec.ts +334 -0
- package/tests/unit/weave/fanout-generator.spec.ts +365 -0
- package/tests/unit/weave/fanout-matcher.spec.ts +320 -0
- package/tests/unit/weave/fanout-schema.spec.ts +221 -0
- package/tests/unit/weave/mergeWeaveSequential.spec.ts +268 -0
- package/tests/unit/weave/metrics-calculator.spec.ts +212 -0
- package/tests/unit/weave/metrics-logger.spec.ts +233 -0
- package/tests/unit/weave/metrics-schema.spec.ts +383 -0
- package/tests/unit/weave/multi-repo-plan.spec.ts +221 -0
- package/tests/unit/weave/planner.spec.ts +227 -0
- package/tests/unit/weave/post-merge-checks.spec.ts +342 -0
- package/tests/unit/weave/recovery.spec.ts +306 -0
- package/tests/unit/weave/testfix/applier.spec.ts +364 -0
- package/tests/unit/weave/testfix/e2e.spec.ts +273 -0
- package/tests/unit/weave/testfix/integration.spec.ts +128 -0
- package/tests/unit/weave/testfix/matcher.spec.ts +321 -0
- package/tests/unit/weave/testfix/schema.spec.ts +298 -0
- package/tests/utils/fingerprint.spec.ts +251 -0
- package/tests/utils/paths.spec.ts +284 -0
- package/tests/utils/tokens.spec.ts +210 -0
- package/tests/utils/validation.spec.ts +215 -0
- package/tests/utils-validation.spec.ts +80 -0
- package/tests/validate-manifests.spec.ts +231 -0
- package/tests/validation.spec.ts +501 -0
- package/tests/vuln-gate.spec.ts +341 -0
- package/tests/weave/adr007-integration.spec.ts +309 -0
- package/tests/weave/checkpoint/cli-integration.spec.ts +118 -0
- package/tests/weave/checkpoint/storage.spec.ts +302 -0
- package/tests/weave/checkpoint/utils.spec.ts +223 -0
- package/tests/weave/frameHelper.spec.ts +423 -0
- package/tests/weave/gateFailureHandler.spec.ts +249 -0
- package/tests/weave/lockFile.spec.ts +387 -0
- package/tests/weave/mergeHelpers.spec.ts +173 -0
- package/tests/weave/receiptHelper.spec.ts +261 -0
- package/tests/weave/stateMachine.spec.ts +436 -0
- package/tests/weave-contract.test.ts +517 -0
- package/tests/weave-e2e.spec.ts +279 -0
- package/tests/weaveLock.spec.ts +136 -0
- package/tests/workflow-state-machine.spec.ts +274 -0
- package/tests/write-protection.spec.ts +213 -0
- package/tsconfig.json +18 -0
- package/tsup.config.ts +12 -0
- package/vitest.benchmark.config.ts +17 -0
- package/vitest.config.ts +28 -0
- package/vitest.git.config.ts +12 -0
- package/vitest.slow-cli.config.ts +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,1069 @@
|
|
|
1
|
+
# LexRunner — Merge-Weave & Fanout CLI (`lex-pr`)
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
-blue>)
|
|
5
|
+
|
|
6
|
+
**`lex-pr` powered by LexRunner.** Fan-out tasks as multiple PRs in parallel, then build a merge pyramid from the blocks. Compute dependency order, run gates locally, and merge cleanly.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Branding & Licensing
|
|
11
|
+
|
|
12
|
+
**LexRunner** is a proprietary product built on top of **Lex**, the MIT-licensed OSS core. See [ADR-000](docs/adr/ADR-000-product-naming-and-branding.md) for naming and branding decisions.
|
|
13
|
+
|
|
14
|
+
- **Product:** LexRunner (proprietary, merged pyramid & fanout orchestration)
|
|
15
|
+
- **CLI:** `lex-pr` (command-line interface)
|
|
16
|
+
- **OSS Core:** [Lex](https://github.com/Guffawaffle/lex) (MIT license, frames & policy)
|
|
17
|
+
|
|
18
|
+
### LexRunner (Proprietary) vs Lex (MIT OSS)
|
|
19
|
+
|
|
20
|
+
| Aspect | **LexRunner** (Paid) | **Lex** (OSS) |
|
|
21
|
+
| ------------ | ---------------------------------------------- | ----------------------------------------------- |
|
|
22
|
+
| **Purpose** | Enterprise merge-weave orchestration CLI | Atlas/Memory/Policy core frameworks |
|
|
23
|
+
| **License** | Proprietary | MIT (open source) |
|
|
24
|
+
| **Repo** | `Guffawaffle/LexRunner` | `Guffawaffle/lex` |
|
|
25
|
+
| **Audience** | Teams running automated fanout/merge workflows | Developers building on frames/policy primitives |
|
|
26
|
+
|
|
27
|
+
👉 **Choose Lex if:** You need frames, policy scanning, or atlas functionality independently.
|
|
28
|
+
👉 **Choose LexRunner if:** You need the full merge-weave orchestration CLI (built on Lex).
|
|
29
|
+
|
|
30
|
+
### Lex Dependency Management
|
|
31
|
+
|
|
32
|
+
LexRunner consumes Lex as an npm dependency (`@smartergpt/lex`). For details on packaging decisions and version management, see [ADR-008: Lex Packaging Strategy](docs/adr/ADR-008-lex-packaging.md).
|
|
33
|
+
|
|
34
|
+
#### Current Version
|
|
35
|
+
|
|
36
|
+
- **Package:** `@smartergpt/lex`
|
|
37
|
+
- **Version:** `^2.1.1` (allows compatible updates)
|
|
38
|
+
- **License:** MIT
|
|
39
|
+
- **Registry:** https://www.npmjs.com/package/@smartergpt/lex
|
|
40
|
+
|
|
41
|
+
#### Managing Lex Updates
|
|
42
|
+
|
|
43
|
+
Use the provided script to manage Lex dependency:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Check for available updates
|
|
47
|
+
./scripts/package-lex.sh check
|
|
48
|
+
|
|
49
|
+
# Validate current installation
|
|
50
|
+
./scripts/package-lex.sh validate
|
|
51
|
+
|
|
52
|
+
# Update to latest compatible version
|
|
53
|
+
./scripts/package-lex.sh update
|
|
54
|
+
|
|
55
|
+
# Show package information
|
|
56
|
+
./scripts/package-lex.sh info
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### Manual Update Process
|
|
60
|
+
|
|
61
|
+
To update Lex manually:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# 1. Check for updates
|
|
65
|
+
npm outdated @smartergpt/lex
|
|
66
|
+
|
|
67
|
+
# 2. Update to latest compatible version
|
|
68
|
+
npm update @smartergpt/lex
|
|
69
|
+
|
|
70
|
+
# 3. Or install specific version
|
|
71
|
+
npm install @smartergpt/lex@2.1.1
|
|
72
|
+
|
|
73
|
+
# 4. Run tests to validate
|
|
74
|
+
npm test
|
|
75
|
+
|
|
76
|
+
# 5. Commit if tests pass
|
|
77
|
+
git add package.json package-lock.json
|
|
78
|
+
git commit -m "chore: update @smartergpt/lex to 2.1.1"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### Versioning Expectations
|
|
82
|
+
|
|
83
|
+
- **Semantic Versioning:** Lex follows semver strictly
|
|
84
|
+
- **MAJOR** — Breaking API changes (requires LexRunner code updates)
|
|
85
|
+
- **MINOR** — New features, backward compatible (safe to update)
|
|
86
|
+
- **PATCH** — Bug fixes, backward compatible (safe to update)
|
|
87
|
+
- **Caret Range:** `^2.1.1` allows MINOR and PATCH updates, blocks MAJOR
|
|
88
|
+
- **Testing:** Always run tests after updating Lex
|
|
89
|
+
- **CI Integration:** GitHub Dependabot monitors for updates and security issues
|
|
90
|
+
|
|
91
|
+
#### Licensing
|
|
92
|
+
|
|
93
|
+
- **Lex License:** MIT (permissive open source)
|
|
94
|
+
- **LexRunner License:** UNLICENSED (proprietary)
|
|
95
|
+
- **Attribution:** See [NOTICE.md](NOTICE.md) for required attributions
|
|
96
|
+
- **Compliance:** Automated via `scripts/check-license-compliance.mjs`
|
|
97
|
+
|
|
98
|
+
For more details, see:
|
|
99
|
+
|
|
100
|
+
- [Lex Public API Documentation](docs/LEX_PUBLIC_API.md)
|
|
101
|
+
- [Lex Integration Guide](docs/LEX_INTEGRATION.md)
|
|
102
|
+
- [License Compliance Guide](docs/LICENSING.md)
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## MCP Multi-Repo Integration
|
|
107
|
+
|
|
108
|
+
The repository includes an optional **Model Context Protocol (MCP) server** (`src/mcp/server.ts`) that exposes deterministic tools for plan & gate workflows.
|
|
109
|
+
|
|
110
|
+
### Why
|
|
111
|
+
|
|
112
|
+
Use a single built artifact to service multiple local repositories (each as an isolated endpoint) without adding persistent services to your compose stack. This keeps lex-serve minimal (nginx + tunnel) while enabling agent orchestration.
|
|
113
|
+
|
|
114
|
+
### Generator Script
|
|
115
|
+
|
|
116
|
+
Auto-generate `servers.json` describing per-repo MCP endpoints.
|
|
117
|
+
|
|
118
|
+
Script location:
|
|
119
|
+
|
|
120
|
+
`scripts/gen_mcp_servers.py`
|
|
121
|
+
|
|
122
|
+
Key capabilities:
|
|
123
|
+
|
|
124
|
+
- Recursive or shallow git repo discovery under provided roots
|
|
125
|
+
- Include / exclude regex filters (`--include`, `--exclude`)
|
|
126
|
+
- Mutation allow-list via repeated `--mutate <repo>` or structured `--policy-file`
|
|
127
|
+
- Per-repo `.env.mcp` overlay (non-destructive; does not override explicit flags/policy)
|
|
128
|
+
- Profile detection precedence: `.smartergpt.local` → `.smartergpt`
|
|
129
|
+
- Dist autodetect: built `dist/mcp/server.js` → fallback `tsx src/mcp/server.ts`
|
|
130
|
+
- Deterministic sorted keys + SHA-256 hash guard (skip rewrite if unchanged)
|
|
131
|
+
- Optional read-only workspace variant (`--workspace-out`)
|
|
132
|
+
- Prefix isolation (`--prefix`, default `lexrunner`)
|
|
133
|
+
|
|
134
|
+
### Quick Use
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Build once so dist/mcp/server.js is present
|
|
138
|
+
npm run build
|
|
139
|
+
|
|
140
|
+
# Generate primary + workspace variant (recursive scan)
|
|
141
|
+
python3 scripts/gen_mcp_servers.py \
|
|
142
|
+
-r /srv -r /home/guff \
|
|
143
|
+
--recursive \
|
|
144
|
+
--include '^(smartergpt|lex-serve|lexrunner)$' \
|
|
145
|
+
--mutate lexrunner \
|
|
146
|
+
--workspace-out servers.workspace.json
|
|
147
|
+
|
|
148
|
+
# Or use the convenience npm script (uses defaults)
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Output Shape (primary)
|
|
153
|
+
|
|
154
|
+
```jsonc
|
|
155
|
+
{
|
|
156
|
+
"mcpServers": {
|
|
157
|
+
"lexrunner-smartergpt": {
|
|
158
|
+
"command": "node",
|
|
159
|
+
"args": ["/home/guff/lexrunner/dist/mcp/server.js"],
|
|
160
|
+
"env": {
|
|
161
|
+
"ALLOW_MUTATIONS": "false",
|
|
162
|
+
"LEX_PR_PROFILE_DIR": "/srv/sites/smartergpt/.smartergpt",
|
|
163
|
+
},
|
|
164
|
+
"workingDirectory": "/srv/sites/smartergpt",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Workspace variant (`servers.workspace.json`) mirrors entries but forces `ALLOW_MUTATIONS=false` for all.
|
|
171
|
+
|
|
172
|
+
### Orchestrator Flow (Suggested)
|
|
173
|
+
|
|
174
|
+
1. `profile.resolve` (confirm profile path & role)
|
|
175
|
+
2. `local.init` (if runner artifacts missing)
|
|
176
|
+
3. `plan.create`
|
|
177
|
+
4. `gates.run`
|
|
178
|
+
5. `merge.apply` (dry run) → eligibility summary
|
|
179
|
+
6. `merge.apply` (real) only after explicit approval & env `ALLOW_MUTATIONS=true`
|
|
180
|
+
|
|
181
|
+
See `orchestrator-prompt.md` for a supervisory prompt template.
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
````
|
|
185
|
+
|
|
186
|
+
Workspace variant (`servers.workspace.json`) mirrors entries but forces `ALLOW_MUTATIONS=false` for all.
|
|
187
|
+
|
|
188
|
+
### Orchestrator Flow (Suggested)
|
|
189
|
+
1. `profile.resolve` (confirm profile path & role)
|
|
190
|
+
2. `local.init` (if runner artifacts missing)
|
|
191
|
+
3. `plan.create`
|
|
192
|
+
4. `gates.run`
|
|
193
|
+
5. `merge.apply` (dry run) → eligibility summary
|
|
194
|
+
6. `merge.apply` (real) only after explicit approval & env `ALLOW_MUTATIONS=true`
|
|
195
|
+
|
|
196
|
+
See `orchestrator-prompt.md` for a supervisory prompt template.
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
## Two-track separation (firm)
|
|
200
|
+
|
|
201
|
+
See [`docs/TERMS.md`](docs/TERMS.md) for complete canonical terms and separation rules. Core runner (`src/**`) never stores user/work artifacts. `.smartergpt/**` contains portable example profile only.
|
|
202
|
+
|
|
203
|
+
## Requirements
|
|
204
|
+
|
|
205
|
+
- **Node.js**: Version specified in `.nvmrc` (currently 20.18.0)
|
|
206
|
+
- **npm**: Version specified in `packageManager` field of `package.json` (currently 10.0.0)
|
|
207
|
+
- **Git**: Configured with `user.name` and `user.email`
|
|
208
|
+
|
|
209
|
+
Use `npm run cli -- doctor` to verify your environment meets all requirements.
|
|
210
|
+
|
|
211
|
+
## Quick start
|
|
212
|
+
|
|
213
|
+
### Installation
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Install globally
|
|
217
|
+
npm install -g lexrunner
|
|
218
|
+
|
|
219
|
+
# Or install in your project
|
|
220
|
+
npm install --save-dev lexrunner
|
|
221
|
+
````
|
|
222
|
+
|
|
223
|
+
After installation, you'll see a reminder to initialize your workspace:
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
📦 lexrunner installed! Run "npx lex-pr init" to set up your workspace.
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### For New Users
|
|
230
|
+
|
|
231
|
+
**Quick Start: Merge-Weave Workflow (Recommended)**
|
|
232
|
+
|
|
233
|
+
The fastest path to merging multiple PRs:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# 1. Discover open PRs
|
|
237
|
+
lex-pr weave discover
|
|
238
|
+
|
|
239
|
+
# 2. Generate merge plan
|
|
240
|
+
lex-pr weave plan --from-github --output plan.json
|
|
241
|
+
|
|
242
|
+
# 3. Preview execution (dry-run)
|
|
243
|
+
lex-pr weave apply --dry-run
|
|
244
|
+
|
|
245
|
+
# 4. Execute gates
|
|
246
|
+
lex-pr weave apply
|
|
247
|
+
|
|
248
|
+
# 5. Merge PRs (optional)
|
|
249
|
+
lex-pr merge --plan plan.json --execute
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**📖 Full guide:** [MERGE_WEAVE_QUICKSTART.md](./MERGE_WEAVE_QUICKSTART.md)
|
|
253
|
+
|
|
254
|
+
**Traditional Workflow:**
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# 1. Initialize workspace (creates .smartergpt.local/ with v1 structure)
|
|
258
|
+
npx lex-pr init
|
|
259
|
+
|
|
260
|
+
# 2. Verify environment
|
|
261
|
+
npx lex-pr doctor
|
|
262
|
+
|
|
263
|
+
# 3. Discover PRs
|
|
264
|
+
npx lex-pr discover
|
|
265
|
+
|
|
266
|
+
# 4. Generate plan
|
|
267
|
+
npx lex-pr plan --from-github
|
|
268
|
+
|
|
269
|
+
# 5. Review plan interactively
|
|
270
|
+
npx lex-pr plan-review plan.json
|
|
271
|
+
|
|
272
|
+
# 6. Execute gates
|
|
273
|
+
npx lex-pr execute plan.json
|
|
274
|
+
|
|
275
|
+
# 7. Merge PRs
|
|
276
|
+
npx lex-pr merge plan.json
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
See [docs/quickstart.md](docs/quickstart.md) for a complete 5-minute onboarding guide.
|
|
280
|
+
|
|
281
|
+
### Using Merge-Weave in Other Lex Ecosystem Repos
|
|
282
|
+
|
|
283
|
+
LexRunner's merge-weave functionality can be used in any Lex ecosystem repository (lex, lexsona, etc.):
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Quick start for adopting repos
|
|
287
|
+
curl -fsSL https://raw.githubusercontent.com/Guffawaffle/LexRunner/main/scripts/quick-start-merge-weave.sh | bash
|
|
288
|
+
|
|
289
|
+
# Or manually:
|
|
290
|
+
# 1. Install LexRunner
|
|
291
|
+
npm install --save-dev github:Guffawaffle/LexRunner
|
|
292
|
+
|
|
293
|
+
# 2. Discover PRs and generate plan
|
|
294
|
+
npx lex-pr discover --owner YOUR_ORG --repo YOUR_REPO --labels ready-to-merge --output plan.json
|
|
295
|
+
|
|
296
|
+
# 3. Preview merge operations
|
|
297
|
+
npx lex-pr merge --plan plan.json --dry-run
|
|
298
|
+
|
|
299
|
+
# 4. Execute merge
|
|
300
|
+
npx lex-pr merge --plan plan.json --execute --cleanup
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Complete Setup Guide:** See [docs/MERGE_WEAVE_SETUP.md](docs/MERGE_WEAVE_SETUP.md) for detailed installation instructions, configuration examples, and troubleshooting.
|
|
304
|
+
|
|
305
|
+
**Convenience Scripts:**
|
|
306
|
+
|
|
307
|
+
- [`scripts/merge-weave-wrapper.sh`](scripts/merge-weave-wrapper.sh) - Simple wrapper for common operations
|
|
308
|
+
- [`scripts/quick-start-merge-weave.sh`](scripts/quick-start-merge-weave.sh) - Automated setup for new repos
|
|
309
|
+
|
|
310
|
+
## Front-End Capture Pipeline
|
|
311
|
+
|
|
312
|
+
The front-end capture pipeline enables rapid idea-to-project workflows using GitHub Issues (no PRs).
|
|
313
|
+
|
|
314
|
+
### Commands
|
|
315
|
+
|
|
316
|
+
#### `lex-pr idea`
|
|
317
|
+
|
|
318
|
+
Capture feature ideas, generate Feature Spec v0, create/update Idea Issues.
|
|
319
|
+
|
|
320
|
+
**Usage:**
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
# Interactive mode (prompts for all inputs)
|
|
324
|
+
lex-pr idea
|
|
325
|
+
|
|
326
|
+
# Non-interactive with flags
|
|
327
|
+
lex-pr idea \
|
|
328
|
+
--title "Add dark mode support" \
|
|
329
|
+
--description "Implement theme switcher with light/dark modes"
|
|
330
|
+
|
|
331
|
+
# Dry run (no Issue creation)
|
|
332
|
+
lex-pr idea \
|
|
333
|
+
--title "Add dark mode support" \
|
|
334
|
+
--description "Implement theme switcher" \
|
|
335
|
+
--dry-run
|
|
336
|
+
|
|
337
|
+
# Update existing Issue (idempotent via fingerprinting)
|
|
338
|
+
lex-pr idea \
|
|
339
|
+
--title "Add dark mode support (revised)" \
|
|
340
|
+
--description "Implement theme switcher with auto-detection" \
|
|
341
|
+
--update-issue 123
|
|
342
|
+
|
|
343
|
+
# Custom output path
|
|
344
|
+
lex-pr idea \
|
|
345
|
+
--title "Add dark mode support" \
|
|
346
|
+
--description "Implement theme switcher" \
|
|
347
|
+
--output /tmp/my-idea.json
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
**Options:**
|
|
351
|
+
|
|
352
|
+
- `--title <string>` - Idea title (interactive if omitted)
|
|
353
|
+
- `--description <string>` - Brief description (interactive if omitted)
|
|
354
|
+
- `--interactive` - Force interactive mode
|
|
355
|
+
- `--dry-run` - Generate spec without creating Issue
|
|
356
|
+
- `--output <path>` - Output path for Feature Spec v0 (default: `.smartergpt.local/deliverables/_session/idea-{timestamp}.json`)
|
|
357
|
+
- `--repo <owner/repo>` - Target repository (default: auto-detect from git remote)
|
|
358
|
+
- `--label <label>` - Additional labels (repeatable)
|
|
359
|
+
- `--update-issue <num>` - Update existing Issue (idempotent)
|
|
360
|
+
|
|
361
|
+
**Output:**
|
|
362
|
+
|
|
363
|
+
- Feature Spec v0 JSON (validated against schema)
|
|
364
|
+
- GitHub Idea Issue with `[IDEA]` prefix and `idea`, `needs-triage` labels
|
|
365
|
+
- Fingerprint for idempotent updates
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
#### `lex-pr create-project`
|
|
370
|
+
|
|
371
|
+
Load Feature Spec v0, generate Execution Plan v1, create Epic + Sub-Issues.
|
|
372
|
+
|
|
373
|
+
**Usage:**
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Basic usage (requires Feature Spec v0 from lex-pr idea)
|
|
377
|
+
lex-pr create-project \
|
|
378
|
+
--spec .smartergpt.local/deliverables/_session/idea-2025-11-09.json
|
|
379
|
+
|
|
380
|
+
# Dry run (no Issue creation)
|
|
381
|
+
lex-pr create-project \
|
|
382
|
+
--spec .smartergpt.local/deliverables/_session/idea-2025-11-09.json \
|
|
383
|
+
--dry-run
|
|
384
|
+
|
|
385
|
+
# With custom labels
|
|
386
|
+
lex-pr create-project \
|
|
387
|
+
--spec .smartergpt.local/deliverables/_session/idea-2025-11-09.json \
|
|
388
|
+
--epic-labels "phase-1,high-priority" \
|
|
389
|
+
--issue-labels "sprint-3"
|
|
390
|
+
|
|
391
|
+
# Custom output path
|
|
392
|
+
lex-pr create-project \
|
|
393
|
+
--spec .smartergpt.local/deliverables/_session/idea-2025-11-09.json \
|
|
394
|
+
--output /tmp/execution-plan.json
|
|
395
|
+
|
|
396
|
+
# Skip sub-issue linking
|
|
397
|
+
lex-pr create-project \
|
|
398
|
+
--spec .smartergpt.local/deliverables/_session/idea-2025-11-09.json \
|
|
399
|
+
--no-link
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Options:**
|
|
403
|
+
|
|
404
|
+
- `--spec <path>` - Feature Spec v0 file (required)
|
|
405
|
+
- `--dry-run` - Generate plan without creating Issues
|
|
406
|
+
- `--output <path>` - Output path for Execution Plan v1 (default: `.smartergpt.local/deliverables/_session/plan-{timestamp}.json`)
|
|
407
|
+
- `--repo <owner/repo>` - Target repository (default: auto-detect from spec)
|
|
408
|
+
- `--project <name/num>` - Link Issues to GitHub Project (optional)
|
|
409
|
+
- `--epic-labels <labels>` - Additional Epic labels (comma-separated)
|
|
410
|
+
- `--issue-labels <labels>` - Additional sub-issue labels (comma-separated)
|
|
411
|
+
- `--no-link` - Skip sub-issue linking
|
|
412
|
+
|
|
413
|
+
**Output:**
|
|
414
|
+
|
|
415
|
+
- Execution Plan v1 JSON (validated against schema)
|
|
416
|
+
- GitHub Epic Issue with `epic` label
|
|
417
|
+
- GitHub Sub-Issues (feature, testing, docs) linked to Epic
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
### Workflow Example
|
|
422
|
+
|
|
423
|
+
**End-to-end: Idea → Epic + Sub-Issues**
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Step 1: Capture idea
|
|
427
|
+
lex-pr idea \
|
|
428
|
+
--title "Add webhooks support" \
|
|
429
|
+
--description "Allow users to configure webhooks for events"
|
|
430
|
+
|
|
431
|
+
# Output:
|
|
432
|
+
# ✓ Feature Spec v0 written to: .smartergpt.local/deliverables/_session/idea-2025-11-09T14-30-00.json
|
|
433
|
+
# ✓ Idea Issue created: https://github.com/owner/repo/issues/456
|
|
434
|
+
|
|
435
|
+
# Step 2: Generate project
|
|
436
|
+
lex-pr create-project \
|
|
437
|
+
--spec .smartergpt.local/deliverables/_session/idea-2025-11-09T14-30-00.json
|
|
438
|
+
|
|
439
|
+
# Output:
|
|
440
|
+
# ✓ Execution Plan v1 written to: .smartergpt.local/deliverables/_session/plan-2025-11-09T14-35-00.json
|
|
441
|
+
# ✓ Epic created: https://github.com/owner/repo/issues/457
|
|
442
|
+
# ✓ Sub-Issue created: https://github.com/owner/repo/issues/458 (feature)
|
|
443
|
+
# ✓ Sub-Issue created: https://github.com/owner/repo/issues/459 (testing)
|
|
444
|
+
# ✓ Sub-Issue created: https://github.com/owner/repo/issues/460 (docs)
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
### Safety Mechanisms
|
|
450
|
+
|
|
451
|
+
**PR Prevention:**
|
|
452
|
+
|
|
453
|
+
- Commands are Issues-only; no PR creation logic
|
|
454
|
+
- Runtime guards detect accidental PR API calls
|
|
455
|
+
- PR-related flags (`--create-pr`, `--pr`) rejected
|
|
456
|
+
|
|
457
|
+
**Artifact Path Restrictions:**
|
|
458
|
+
|
|
459
|
+
- Writes allowed only to `.smartergpt.local/deliverables/_session/`
|
|
460
|
+
- PR directories (`/PR-<number>/`, `/artifacts/PR-*/`) blocked
|
|
461
|
+
- Custom output paths validated before write
|
|
462
|
+
|
|
463
|
+
**Schema Validation:**
|
|
464
|
+
|
|
465
|
+
- All inputs/outputs validated against Zod schemas
|
|
466
|
+
- Pre-flight checks before Issue creation
|
|
467
|
+
- Detailed error messages with line numbers
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
### Schemas
|
|
472
|
+
|
|
473
|
+
**Feature Spec v0:**
|
|
474
|
+
|
|
475
|
+
```json
|
|
476
|
+
{
|
|
477
|
+
"schemaVersion": "0.1.0",
|
|
478
|
+
"title": "Add dark mode support",
|
|
479
|
+
"description": "Implement theme switcher with light/dark modes",
|
|
480
|
+
"acceptanceCriteria": [
|
|
481
|
+
"User can toggle between light and dark themes",
|
|
482
|
+
"Theme preference persists across sessions",
|
|
483
|
+
"All UI components support both themes"
|
|
484
|
+
],
|
|
485
|
+
"technicalContext": "Use CSS variables and localStorage",
|
|
486
|
+
"constraints": "Must work in IE11+",
|
|
487
|
+
"repo": "owner/repo",
|
|
488
|
+
"createdAt": "2025-11-09T14:30:00.000Z"
|
|
489
|
+
}
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
**Execution Plan v1:**
|
|
493
|
+
|
|
494
|
+
```json
|
|
495
|
+
{
|
|
496
|
+
"schemaVersion": "1.0.0",
|
|
497
|
+
"sourceSpec": {
|
|
498
|
+
/* Feature Spec v0 */
|
|
499
|
+
},
|
|
500
|
+
"epic": {
|
|
501
|
+
"title": "Add dark mode support",
|
|
502
|
+
"description": "Implement theme switcher with light/dark modes",
|
|
503
|
+
"acceptanceCriteria": [
|
|
504
|
+
/* from Feature Spec */
|
|
505
|
+
]
|
|
506
|
+
},
|
|
507
|
+
"subIssues": [
|
|
508
|
+
{
|
|
509
|
+
"id": "feature-impl",
|
|
510
|
+
"title": "Implement Add dark mode support",
|
|
511
|
+
"description": "Core implementation of feature",
|
|
512
|
+
"type": "feature",
|
|
513
|
+
"acceptanceCriteria": [
|
|
514
|
+
/* from Feature Spec */
|
|
515
|
+
],
|
|
516
|
+
"dependsOn": []
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"id": "tests",
|
|
520
|
+
"title": "Add tests for Add dark mode support",
|
|
521
|
+
"description": "Unit and integration tests",
|
|
522
|
+
"type": "testing",
|
|
523
|
+
"acceptanceCriteria": ["Unit tests pass", "Integration tests pass", "Coverage > 80%"],
|
|
524
|
+
"dependsOn": ["feature-impl"]
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"id": "docs",
|
|
528
|
+
"title": "Document Add dark mode support",
|
|
529
|
+
"description": "User-facing documentation",
|
|
530
|
+
"type": "docs",
|
|
531
|
+
"acceptanceCriteria": ["README updated", "Examples added", "API docs complete"],
|
|
532
|
+
"dependsOn": ["feature-impl"]
|
|
533
|
+
}
|
|
534
|
+
],
|
|
535
|
+
"createdAt": "2025-11-09T14:35:00.000Z"
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
For complete documentation, see [docs/front-end-capture-pipeline.md](docs/front-end-capture-pipeline.md).
|
|
540
|
+
|
|
541
|
+
## 📚 Documentation
|
|
542
|
+
|
|
543
|
+
Complete documentation and interactive plan review guides
|
|
544
|
+
|
|
545
|
+
See the full documentation index: [docs/README.md](docs/README.md)
|
|
546
|
+
|
|
547
|
+
Quick links:
|
|
548
|
+
|
|
549
|
+
- **Getting Started**: docs/quickstart.md — 5-minute onboarding
|
|
550
|
+
- **Front-End Capture Pipeline**: docs/front-end-capture-pipeline.md — idea → project workflow (Issues-only)
|
|
551
|
+
- **Merge Pyramid Tutorial**: docs/tutorials/quick-merge-pyramid.md — discover → plan → execute → merge workflow
|
|
552
|
+
- **Diffgraph Planner**: docs/diffgraph-planner.md — automatic dependency discovery & merge ordering
|
|
553
|
+
- **Prompts Configuration**: docs/prompts.md — prompts precedence, cross-repo usage, token expansion
|
|
554
|
+
- **Architecture Overview**: docs/architecture.md — system design & philosophy
|
|
555
|
+
- **CLI Reference**: docs/cli.md — complete command documentation
|
|
556
|
+
- **Troubleshooting**: docs/troubleshooting.md — common issues & solutions
|
|
557
|
+
- **Migration Guide**: docs/migration-guide.md — migrating to lexrunner
|
|
558
|
+
- **FAQ**: FAQ.md — quick answers to common questions
|
|
559
|
+
- **Video Tutorials**: docs/tutorials/ — step-by-step video guides
|
|
560
|
+
- **Workflows**: docs/workflows/ — examples for different team sizes
|
|
561
|
+
- **CI/CD Integrations**: docs/integrations/ — platform-specific setup
|
|
562
|
+
|
|
563
|
+
Interactive Plan Review
|
|
564
|
+
|
|
565
|
+
Review and edit plans before execution. Example workflows:
|
|
566
|
+
|
|
567
|
+
```bash
|
|
568
|
+
# Interactive review with validation
|
|
569
|
+
lex-pr plan-review plan.json
|
|
570
|
+
|
|
571
|
+
# Compare two plans
|
|
572
|
+
lex-pr plan-diff old-plan.json new-plan.json
|
|
573
|
+
|
|
574
|
+
# Save review history
|
|
575
|
+
lex-pr plan-review plan.json --save-history --output approved-plan.json
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
See docs/interactive-plan-review.md for the full interactive workflow guide.
|
|
579
|
+
|
|
580
|
+
## Diffgraph Planning
|
|
581
|
+
|
|
582
|
+
The diffgraph planner automatically discovers dependencies between PRs and computes optimal merge order. It combines:
|
|
583
|
+
|
|
584
|
+
1. **Explicit dependencies** from PR descriptions (e.g., `Depends-on: #123`)
|
|
585
|
+
2. **Implicit dependencies** from file-change analysis
|
|
586
|
+
3. **Validation** for cycles, orphans, and invalid references
|
|
587
|
+
4. **Topological sorting** for deterministic merge layers
|
|
588
|
+
|
|
589
|
+
### Quick Example
|
|
590
|
+
|
|
591
|
+
```bash
|
|
592
|
+
# Generate plan from GitHub PRs with auto-discovery
|
|
593
|
+
lex-pr plan --from-github --output plan.json
|
|
594
|
+
|
|
595
|
+
# Review suggested dependencies
|
|
596
|
+
lex-pr plan --suggest-deps --threshold=0.7
|
|
597
|
+
|
|
598
|
+
# Execute in dependency order
|
|
599
|
+
lex-pr execute --plan plan.json
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
### Key Features
|
|
603
|
+
|
|
604
|
+
- **Automatic dependency discovery** - detects implicit dependencies via file overlap
|
|
605
|
+
- **Cycle detection** - prevents circular dependencies
|
|
606
|
+
- **Confidence scoring** - ranks suggestions by reliability (0.0-1.0)
|
|
607
|
+
- **Multiple heuristics** - shared files, directory proximity, test overlap
|
|
608
|
+
- **Hybrid workflow** - combine explicit + implicit dependencies
|
|
609
|
+
- **GitHub CI integration** - automatically import gate results from GitHub check runs (v0.6.0+)
|
|
610
|
+
|
|
611
|
+
### Documentation
|
|
612
|
+
|
|
613
|
+
**Getting Started:**
|
|
614
|
+
|
|
615
|
+
- [Quickstart Guide](docs/quickstart.md) - Get up and running in 5 minutes
|
|
616
|
+
- [Merge-Weave Quickstart](docs/merge-weave-quickstart.md) - End-to-end merge-weave walkthrough with examples
|
|
617
|
+
|
|
618
|
+
**Reference:**
|
|
619
|
+
|
|
620
|
+
- **[Environment Variables](docs/environment-variables.md)** - environment configuration, CI safety, and aliasing
|
|
621
|
+
- **[Profile Resolution](docs/profile-resolution.md)** - profile precedence and configuration
|
|
622
|
+
- **[Complete Guide](docs/diffgraph-planner.md)** - full feature documentation
|
|
623
|
+
- **[Troubleshooting](docs/troubleshooting-planner.md)** - common errors and solutions
|
|
624
|
+
- **[Tutorials](docs/tutorials/diffgraph-planner/)** - step-by-step guides
|
|
625
|
+
- [01-simple-stack.md](docs/tutorials/diffgraph-planner/01-simple-stack.md) - linear dependencies
|
|
626
|
+
- [02-diamond-pattern.md](docs/tutorials/diffgraph-planner/02-diamond-pattern.md) - fan-out/fan-in
|
|
627
|
+
- [03-large-batch.md](docs/tutorials/diffgraph-planner/03-large-batch.md) - 20+ PRs
|
|
628
|
+
- [04-fixing-cycles.md](docs/tutorials/diffgraph-planner/04-fixing-cycles.md) - cycle resolution
|
|
629
|
+
- [05-hybrid-workflow.md](docs/tutorials/diffgraph-planner/05-hybrid-workflow.md) - explicit + implicit
|
|
630
|
+
|
|
631
|
+
### For Development
|
|
632
|
+
|
|
633
|
+
```bash
|
|
634
|
+
# install dependencies
|
|
635
|
+
npm install
|
|
636
|
+
|
|
637
|
+
# dev mode
|
|
638
|
+
npm run dev
|
|
639
|
+
|
|
640
|
+
# run CLI (ts)
|
|
641
|
+
npm run cli -- plan --help
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
## CLI Commands
|
|
645
|
+
|
|
646
|
+
### Plan Generation
|
|
647
|
+
|
|
648
|
+
```bash
|
|
649
|
+
# Generate plan artifacts (plan.json + snapshot.md)
|
|
650
|
+
npm run cli -- plan [--out .smartergpt/runner]
|
|
651
|
+
|
|
652
|
+
# JSON-only mode for CI integration
|
|
653
|
+
npm run cli -- plan --json
|
|
654
|
+
|
|
655
|
+
# Custom output directory
|
|
656
|
+
npm run cli -- plan --out ./my-artifacts
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
### Other Commands
|
|
660
|
+
|
|
661
|
+
```bash
|
|
662
|
+
# Environment and config sanity checks
|
|
663
|
+
npm run cli -- doctor
|
|
664
|
+
|
|
665
|
+
# Gate report aggregation
|
|
666
|
+
npm run cli -- report <directory> [--out json|md]
|
|
667
|
+
|
|
668
|
+
# Orchestration: Batch planning with Kahn's algorithm
|
|
669
|
+
npm run cli -- orchestrate:plan-batch --issues 156,157,160
|
|
670
|
+
npm run cli -- orchestrate:plan-batch --input analysis.json --json
|
|
671
|
+
|
|
672
|
+
# Python CLI (legacy)
|
|
673
|
+
lex-pr schema validate plan.json
|
|
674
|
+
lex-pr merge-order plan.json --json
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### Orchestration Commands
|
|
678
|
+
|
|
679
|
+
The `orchestrate:plan-batch` command generates deterministic batch plans using Kahn's algorithm:
|
|
680
|
+
|
|
681
|
+
```bash
|
|
682
|
+
# From explicit issue list
|
|
683
|
+
lex-pr orchestrate:plan-batch --issues 156,157,160,161,164
|
|
684
|
+
|
|
685
|
+
# From issue analyzer output
|
|
686
|
+
lex-pr orchestrate:plan-batch --input analysis.json --json > batch-plan.json
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
**Features:**
|
|
690
|
+
|
|
691
|
+
- Deterministic topological sorting (same input → same output)
|
|
692
|
+
- Stable priority queue (score → createdAt → number)
|
|
693
|
+
- Layer-based batching for parallel execution
|
|
694
|
+
- Cycle detection with helpful error messages
|
|
695
|
+
- SHA256 hash for plan reproducibility
|
|
696
|
+
|
|
697
|
+
See [`docs/orchestration.md`](docs/orchestration.md) for detailed documentation.
|
|
698
|
+
|
|
699
|
+
### Agent Stall Detection
|
|
700
|
+
|
|
701
|
+
Monitor Copilot agent PRs for activity and automatically nudge or escalate when agents stall:
|
|
702
|
+
|
|
703
|
+
```bash
|
|
704
|
+
# Check PR status once
|
|
705
|
+
lex-pr fanout monitor --prs 123,456
|
|
706
|
+
|
|
707
|
+
# Watch PRs continuously with auto-nudge
|
|
708
|
+
lex-pr fanout monitor --prs 123,456,789 --watch --interval 5m --action nudge
|
|
709
|
+
|
|
710
|
+
# Custom thresholds and auto-escalation
|
|
711
|
+
lex-pr fanout monitor --prs 123 \
|
|
712
|
+
--warning-threshold 5m \
|
|
713
|
+
--stall-threshold 15m \
|
|
714
|
+
--action escalate
|
|
715
|
+
|
|
716
|
+
# JSON output for automation
|
|
717
|
+
lex-pr fanout monitor --prs 123,456 --json
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
**Features:**
|
|
721
|
+
|
|
722
|
+
- Automatic stall detection (configurable thresholds: 10m warning, 20m stall)
|
|
723
|
+
- Auto-nudge stalled agents with GitHub comments
|
|
724
|
+
- Auto-escalate for human intervention
|
|
725
|
+
- Watch mode for continuous monitoring
|
|
726
|
+
- JSON output for CI/CD integration
|
|
727
|
+
|
|
728
|
+
**Detection States:**
|
|
729
|
+
|
|
730
|
+
- **Active** - Recent commits, no action needed
|
|
731
|
+
- **Stalled** - No commits >= threshold, auto-nudge/escalate
|
|
732
|
+
- **Complete** - PR ready for review
|
|
733
|
+
|
|
734
|
+
See [`docs/agent-stall-detection.md`](docs/agent-stall-detection.md) for complete documentation and examples.
|
|
735
|
+
|
|
736
|
+
### Gate Report Aggregation
|
|
737
|
+
|
|
738
|
+
The `report` command aggregates gate results from a directory of JSON files:
|
|
739
|
+
|
|
740
|
+
```bash
|
|
741
|
+
# Aggregate gate reports (JSON output)
|
|
742
|
+
npm run cli -- report ./gate-results --out json
|
|
743
|
+
|
|
744
|
+
# Generate markdown summary
|
|
745
|
+
npm run cli -- report ./gate-results --out md
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
**Gate Result Format:**
|
|
749
|
+
Each gate result file must follow the JSON schema with stable keys:
|
|
750
|
+
|
|
751
|
+
```json
|
|
752
|
+
{
|
|
753
|
+
"item": "item-name",
|
|
754
|
+
"gate": "gate-name",
|
|
755
|
+
"status": "pass|fail",
|
|
756
|
+
"duration_ms": 1000,
|
|
757
|
+
"started_at": "2024-01-15T10:30:00Z",
|
|
758
|
+
"stderr_path": "/path/to/stderr.log", // optional
|
|
759
|
+
"stdout_path": "/path/to/stdout.log", // optional
|
|
760
|
+
"meta": {
|
|
761
|
+
// optional
|
|
762
|
+
"exit_code": "0",
|
|
763
|
+
"command": "npm test"
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
**Features:**
|
|
769
|
+
|
|
770
|
+
- Stable, deterministic output with sorted items and gates
|
|
771
|
+
- Validation against JSON schema
|
|
772
|
+
- Summary statistics (allGreen, pass/fail counts)
|
|
773
|
+
- Multiple output formats (JSON, Markdown)
|
|
774
|
+
- Exit code 0 if all gates pass, 1 if any fail
|
|
775
|
+
|
|
776
|
+
## Turn Cost Tracking
|
|
777
|
+
|
|
778
|
+
LexRunner implements **Turn Cost** tracking to measure coordination overhead during merge-weave and gate execution operations. Turn Cost quantifies the "friction" in automation workflows beyond simple token counts.
|
|
779
|
+
|
|
780
|
+
### Formula
|
|
781
|
+
|
|
782
|
+
```
|
|
783
|
+
Turn Cost = λL + γC + ρR + τT + αA
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
Where:
|
|
787
|
+
|
|
788
|
+
- **L (Latency)**: API response time, gate execution time, merge time
|
|
789
|
+
- **C (Context Reset)**: Tokens required to rebuild context (N/A for deterministic runner)
|
|
790
|
+
- **R (Renegotiation)**: Conflict resolution retries, clarification turns
|
|
791
|
+
- **T (Token Bloat)**: Excess tokens used beyond expected budget
|
|
792
|
+
- **A (Attention Switch)**: Human interventions, manual conflict resolutions
|
|
793
|
+
|
|
794
|
+
Default weights: `λ=0.1, γ=0.1, ρ=0.3, τ=0.2, α=0.3`
|
|
795
|
+
|
|
796
|
+
### Usage
|
|
797
|
+
|
|
798
|
+
**Execute Command:**
|
|
799
|
+
|
|
800
|
+
```bash
|
|
801
|
+
# Enable Turn Cost tracking during gate execution
|
|
802
|
+
lex-pr execute plan.json --track-turncost
|
|
803
|
+
|
|
804
|
+
# JSON output includes Turn Cost summary
|
|
805
|
+
lex-pr execute plan.json --track-turncost --json
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
**Merge Command:**
|
|
809
|
+
|
|
810
|
+
```bash
|
|
811
|
+
# Track Turn Cost during merge-weave operations
|
|
812
|
+
lex-pr merge --execute --track-turncost
|
|
813
|
+
|
|
814
|
+
# Dry run with conflict detection and Turn Cost preview
|
|
815
|
+
lex-pr merge --track-turncost
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
### Output Format
|
|
819
|
+
|
|
820
|
+
**Human-readable:**
|
|
821
|
+
|
|
822
|
+
```
|
|
823
|
+
=== Turn Cost ===
|
|
824
|
+
Weighted Score: 3.20
|
|
825
|
+
Latency: 12.50s
|
|
826
|
+
Renegotiations: 1
|
|
827
|
+
Attention Switches: 0
|
|
828
|
+
vs Prior Run: -45%
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
**JSON:**
|
|
832
|
+
|
|
833
|
+
```json
|
|
834
|
+
{
|
|
835
|
+
"turnCost": {
|
|
836
|
+
"components": {
|
|
837
|
+
"latencyMs": 12500,
|
|
838
|
+
"contextResetTokens": 0,
|
|
839
|
+
"renegotiationCount": 1,
|
|
840
|
+
"tokenBloat": 2400,
|
|
841
|
+
"attentionSwitchCount": 0
|
|
842
|
+
},
|
|
843
|
+
"weightedScore": 3.2,
|
|
844
|
+
"eventCount": 4,
|
|
845
|
+
"priorRunScore": 5.8,
|
|
846
|
+
"improvement": "-45%"
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
### What Gets Tracked
|
|
852
|
+
|
|
853
|
+
| Operation | Latency | Renegotiation | Attention Switch |
|
|
854
|
+
| ------------------- | ------------------- | ------------------- | ---------------- |
|
|
855
|
+
| Gate execution | ✅ Per-gate timing | ✅ Gate retries | ❌ (future) |
|
|
856
|
+
| Merge operations | ✅ Total merge time | ✅ Conflict retries | ❌ (future) |
|
|
857
|
+
| Conflict resolution | ✅ Resolution time | ✅ Retry attempts | ✅ Manual fixes |
|
|
858
|
+
|
|
859
|
+
### Business Value
|
|
860
|
+
|
|
861
|
+
From the coordination cost compression thesis:
|
|
862
|
+
|
|
863
|
+
> "Token costs are linear; Turn costs compound through cascading misunderstandings."
|
|
864
|
+
|
|
865
|
+
Turn Cost tracking enables:
|
|
866
|
+
|
|
867
|
+
- **Measuring actual coordination overhead** (not just API costs)
|
|
868
|
+
- **Identifying high-friction workflows** that need optimization
|
|
869
|
+
- **Optimizing for human attention** (the scarcest resource)
|
|
870
|
+
- **Comparing automation efficiency** across runs
|
|
871
|
+
|
|
872
|
+
### Related
|
|
873
|
+
|
|
874
|
+
- Issue [#376](https://github.com/Guffawaffle/LexRunner/issues/376): Token Optimization Epic
|
|
875
|
+
- Issue [#330](https://github.com/Guffawaffle/LexRunner/issues/330): Frames & Metrics
|
|
876
|
+
- Issue [#327](https://github.com/Guffawaffle/LexRunner/issues/327): Budget Guards
|
|
877
|
+
|
|
878
|
+
## Configuration
|
|
879
|
+
|
|
880
|
+
### Profile Resolution
|
|
881
|
+
|
|
882
|
+
The runner uses a **precedence chain** to locate the profile directory:
|
|
883
|
+
|
|
884
|
+
1. `--profile-dir <path>` - Explicit CLI override
|
|
885
|
+
2. `LEX_PR_PROFILE_DIR` - Environment variable
|
|
886
|
+
3. `.smartergpt.local/` - Local overlay (development, not tracked)
|
|
887
|
+
4. `.smartergpt/` - Tracked example profile (default)
|
|
888
|
+
|
|
889
|
+
**Quick start:**
|
|
890
|
+
|
|
891
|
+
```bash
|
|
892
|
+
# Initialize local overlay for development
|
|
893
|
+
npm run cli -- init-local
|
|
894
|
+
|
|
895
|
+
# Runner automatically uses .smartergpt.local/
|
|
896
|
+
npm run cli -- plan
|
|
897
|
+
|
|
898
|
+
# Or use explicit override
|
|
899
|
+
npm run cli -- plan --profile-dir /custom/path
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
See [docs/profile-resolution.md](docs/profile-resolution.md) for complete documentation, migration guide, and examples.
|
|
903
|
+
|
|
904
|
+
### Configuration Files
|
|
905
|
+
|
|
906
|
+
The planner reads configuration from the resolved profile directory:
|
|
907
|
+
|
|
908
|
+
- **`stack.yml`**: Explicit plan with items, dependencies, and strategies (highest priority)
|
|
909
|
+
- **`scope.yml`**: Target branch and PR selection criteria (fallback)
|
|
910
|
+
- **`deps.yml`**: Dependency definitions (future use)
|
|
911
|
+
- **`profile.yml`**: Profile metadata and role (`example`, `development`, `local`)
|
|
912
|
+
|
|
913
|
+
### Example stack.yml
|
|
914
|
+
|
|
915
|
+
```yaml
|
|
916
|
+
version: 1
|
|
917
|
+
target: main
|
|
918
|
+
items:
|
|
919
|
+
- id: 1
|
|
920
|
+
name: auth-system # Dependencies resolve by 'name' field
|
|
921
|
+
branch: feature/auth-system
|
|
922
|
+
sha: abc123def456
|
|
923
|
+
deps: [] # Use 'deps' array (references other item names)
|
|
924
|
+
strategy: rebase-weave
|
|
925
|
+
- id: 2
|
|
926
|
+
name: api-endpoints # Generator defaults: name := id
|
|
927
|
+
branch: feature/api-endpoints
|
|
928
|
+
deps: ["auth-system"] # Depends on item with name="auth-system"
|
|
929
|
+
strategy: merge-weave
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
## CLI Exit Codes
|
|
933
|
+
|
|
934
|
+
The CLI follows standard Unix conventions for automation and CI integration:
|
|
935
|
+
|
|
936
|
+
- **`0`**: Success - operation completed without errors
|
|
937
|
+
- **`2`**: Validation errors - invalid configuration, unknown dependencies, schema violations
|
|
938
|
+
- **`1`**: Unexpected errors - system failures, network issues, crashes
|
|
939
|
+
|
|
940
|
+
### Security Subcommand Exit Codes (Extended)
|
|
941
|
+
|
|
942
|
+
For `security` subcommands (`check-rotation`, `scan-plan`, `validate-secrets`):
|
|
943
|
+
|
|
944
|
+
| Code | Meaning | Notes |
|
|
945
|
+
| ---- | --------------------- | ----------------------------------- |
|
|
946
|
+
| 0 | Success / No findings | Status = ok |
|
|
947
|
+
| 1 | Findings detected | Status = findings (action required) |
|
|
948
|
+
| 2 | Internal error | Status = error (investigate stack) |
|
|
949
|
+
|
|
950
|
+
JSON output is deterministic with ordered keys: `command,status,exitCode,findings,timestamp`.
|
|
951
|
+
|
|
952
|
+
Format flags:
|
|
953
|
+
`--format text|json` (default text), `--no-color` disables ANSI styling in text mode.
|
|
954
|
+
|
|
955
|
+
**Secret Rotation:**
|
|
956
|
+
|
|
957
|
+
- See [docs/security/rotation-guide.md](docs/security/rotation-guide.md) for rotation patterns and cadences
|
|
958
|
+
- Example script: `tsx scripts/rotate-secrets-example.ts` (deterministic JSON output)
|
|
959
|
+
|
|
960
|
+
```bash
|
|
961
|
+
# CI-friendly validation
|
|
962
|
+
npm run cli -- plan --json || echo "Plan validation failed with exit code $?"
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
## Project layout
|
|
966
|
+
|
|
967
|
+
- `src/core`: planner, gates runner, weave strategies
|
|
968
|
+
- `src/cli.ts`: human CLI (Commander)
|
|
969
|
+
- `src/mcp/server.ts`: MCP tool/resource surface (adapter)
|
|
970
|
+
- `.smartergpt/`: canonical inputs + runner artifacts
|
|
971
|
+
|
|
972
|
+
## Deterministic Behavior
|
|
973
|
+
|
|
974
|
+
The runner prioritizes **deterministic outputs** for reliable CI/CD integration:
|
|
975
|
+
|
|
976
|
+
```bash
|
|
977
|
+
# Verify determinism - identical inputs produce identical byte outputs
|
|
978
|
+
npm run cli -- plan --out .artifacts1
|
|
979
|
+
npm run cli -- plan --out .artifacts2
|
|
980
|
+
cmp .artifacts1/plan.json .artifacts2/plan.json # Should be identical
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
**Key guarantees:**
|
|
984
|
+
|
|
985
|
+
- Canonical JSON with stable key ordering (no timestamps)
|
|
986
|
+
- Raw-byte deterministic hashing for artifact verification
|
|
987
|
+
- Cross-platform portability (Windows, macOS, Linux)
|
|
988
|
+
- Dependency resolution by `name` field with cycle detection
|
|
989
|
+
|
|
990
|
+
## Note about tests and temp directories
|
|
991
|
+
|
|
992
|
+
When running tests the suite may run files in parallel. Some tests temporarily change the process working directory (for example to exercise CLI behaviors) and create/remove temp directories. To avoid race conditions and `getcwd()` failures we use a per-test-file temporary directory naming pattern (based on the test filename) so parallel test files don't collide when they change `process.cwd()` or remove temporary folders. If you add new tests that change directory, follow the same pattern:
|
|
993
|
+
|
|
994
|
+
```ts
|
|
995
|
+
const testDir = path.join(os.tmpdir(), `lexrunner-determinism-test-${path.basename(__filename)}`);
|
|
996
|
+
process.chdir(testDir);
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
This keeps tests isolated and prevents intermittent failures when running the full test suite.
|
|
1000
|
+
|
|
1001
|
+
## Performance Benchmarks
|
|
1002
|
+
|
|
1003
|
+
The project includes a comprehensive performance regression test suite to track critical operation performance over time.
|
|
1004
|
+
|
|
1005
|
+
### Running Benchmarks
|
|
1006
|
+
|
|
1007
|
+
```bash
|
|
1008
|
+
# Run all benchmarks
|
|
1009
|
+
npm run benchmark
|
|
1010
|
+
|
|
1011
|
+
# Run specific benchmark
|
|
1012
|
+
npm run benchmark -- core/topologicalSort.bench.ts
|
|
1013
|
+
|
|
1014
|
+
# Compare against baseline (CI mode)
|
|
1015
|
+
npm run benchmark:ci
|
|
1016
|
+
|
|
1017
|
+
# Update baseline metrics (after performance improvements)
|
|
1018
|
+
npm run benchmark:baseline
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
### What's Measured
|
|
1022
|
+
|
|
1023
|
+
- **Core Algorithms**: Topological sort, plan parsing, dependency resolution (10-500 nodes)
|
|
1024
|
+
- **I/O Operations**: File operations, git operations
|
|
1025
|
+
- **End-to-End Workflows**: Complete plan generation and execution pipelines
|
|
1026
|
+
|
|
1027
|
+
### CI Integration
|
|
1028
|
+
|
|
1029
|
+
Benchmarks run automatically on PRs via GitHub Actions. The workflow:
|
|
1030
|
+
|
|
1031
|
+
1. Executes all benchmarks
|
|
1032
|
+
2. Compares results against committed baseline
|
|
1033
|
+
3. Posts performance report as PR comment
|
|
1034
|
+
4. **Fails PR if >20% performance regression detected**
|
|
1035
|
+
5. **Warns if 10-20% slower**
|
|
1036
|
+
|
|
1037
|
+
See `tests/benchmarks/README.md` for detailed documentation.
|
|
1038
|
+
|
|
1039
|
+
## Notes
|
|
1040
|
+
|
|
1041
|
+
- Deterministic > clever. Outputs are sorted for stable diffs.
|
|
1042
|
+
- `schemas/plan.schema.json` is the source of truth for validation.
|
|
1043
|
+
- Dependencies resolve by `name` field (generator can default `name := id`)
|
|
1044
|
+
|
|
1045
|
+
## MCP: Multi-Repo Integration
|
|
1046
|
+
|
|
1047
|
+
Generate MCP server manifests for all local repos. The generator discovers git roots under `/srv` and `/home/guff`, detects `.smartergpt(.local)` profiles, and writes a deterministic `servers.json`.
|
|
1048
|
+
|
|
1049
|
+
```bash
|
|
1050
|
+
# Build once (for dist), then generate
|
|
1051
|
+
npm run build
|
|
1052
|
+
npm run generate:mcp-servers
|
|
1053
|
+
|
|
1054
|
+
# Customize (recursive, filters, policy-file, mutate allow-list)
|
|
1055
|
+
python3 scripts/gen_mcp_servers.py -r /srv -r /home/guff --recursive --include '^(smartergpt|lex-serve|lexrunner)$' --policy-file mutate-policy.json --mutate lexrunner -o servers.json --workspace-out servers.workspace.json
|
|
1056
|
+
```
|
|
1057
|
+
|
|
1058
|
+
### MCP Section Notes
|
|
1059
|
+
|
|
1060
|
+
- Profile precedence: `.smartergpt.local` → `.smartergpt`.
|
|
1061
|
+
- Mutations are **off** by default; enable per-repo via `--mutate` or policy file.
|
|
1062
|
+
- If `dist/mcp/server.js` is missing, generator falls back to `npx tsx src/mcp/server.ts`.
|
|
1063
|
+
- `servers.workspace.json` is a read-only variant (all `ALLOW_MUTATIONS=false`).
|
|
1064
|
+
|
|
1065
|
+
### MCP Section Exit Codes
|
|
1066
|
+
|
|
1067
|
+
- `0`: success, no changes
|
|
1068
|
+
- `2`: dry-run indicates the output would change
|
|
1069
|
+
- `1`: error
|