agentic-qe 3.8.14 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +60 -0
- package/dist/adapters/a2ui/integration/agui-sync.js +2 -1
- package/dist/audit/witness-chain.d.ts +1 -1
- package/dist/boot/fast-paths.d.ts +24 -0
- package/dist/boot/fast-paths.js +43 -0
- package/dist/boot/parallel-prefetch.d.ts +26 -0
- package/dist/boot/parallel-prefetch.js +36 -0
- package/dist/cli/bundle.js +12 -9431
- package/dist/cli/chunks/adapter-NTM4ZH3P.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-UH2J6BNA.js +2 -0
- package/dist/cli/chunks/agent-handler-ZCBWQE3X.js +33 -0
- package/dist/cli/chunks/agent-memory-branch-2BAVI7UW.js +2 -0
- package/dist/cli/chunks/aqe-learning-engine-RVX6MPYK.js +2 -0
- package/dist/cli/chunks/audit-G5UIJBSQ.js +3 -0
- package/dist/cli/chunks/base-7HKNQ6UP.js +2 -0
- package/dist/cli/chunks/better-sqlite3-YHIAPPVT.js +2 -0
- package/dist/cli/chunks/brain-handler-5EE3J5PR.js +68 -0
- package/dist/cli/chunks/branch-enumerator-OV54PID5.js +7 -0
- package/dist/cli/chunks/browser-7RZGKOEO.js +4 -0
- package/dist/cli/chunks/browser-workflow-UOFSQK7X.js +2 -0
- package/dist/cli/chunks/chunk-24E47G3D.js +604 -0
- package/dist/cli/chunks/chunk-35H73OPP.js +2 -0
- package/dist/cli/chunks/chunk-36X2O3BL.js +3 -0
- package/dist/cli/chunks/chunk-3JESHZQM.js +2 -0
- package/dist/cli/chunks/chunk-3VAKR43Z.js +2 -0
- package/dist/cli/chunks/chunk-3WQNW6CH.js +2 -0
- package/dist/cli/chunks/chunk-43M6Y6VF.js +15 -0
- package/dist/cli/chunks/chunk-4BHOAQJH.js +2 -0
- package/dist/cli/chunks/chunk-4LWXZCSD.js +146 -0
- package/dist/cli/chunks/chunk-4TNXEANY.js +2 -0
- package/dist/cli/chunks/chunk-4XBY5JDT.js +4 -0
- package/dist/cli/chunks/chunk-4XREPCBZ.js +2 -0
- package/dist/cli/chunks/chunk-5GPTM2RV.js +2 -0
- package/dist/cli/chunks/chunk-5KBQQP3X.js +7 -0
- package/dist/cli/chunks/chunk-5LDBKZ6P.js +2 -0
- package/dist/cli/chunks/chunk-6BSJNG2S.js +2 -0
- package/dist/cli/chunks/chunk-6YC24TPL.js +27 -0
- package/dist/cli/chunks/chunk-7ATLJCSG.js +2 -0
- package/dist/cli/chunks/chunk-7JQTHPCD.js +2 -0
- package/dist/cli/chunks/chunk-7YUOUVN7.js +2 -0
- package/dist/cli/chunks/chunk-7ZNINH6J.js +59 -0
- package/dist/cli/chunks/chunk-A57BEPL7.js +3 -0
- package/dist/cli/chunks/chunk-AFPMCMVX.js +45 -0
- package/dist/cli/chunks/chunk-AREIP4FX.js +3 -0
- package/dist/cli/chunks/chunk-B2I7BJLL.js +3 -0
- package/dist/cli/chunks/chunk-BEHP3DEF.js +66 -0
- package/dist/cli/chunks/chunk-C24ZDUCM.js +30 -0
- package/dist/cli/chunks/chunk-D4PSFWND.js +2 -0
- package/dist/cli/chunks/chunk-D55PSO5D.js +81 -0
- package/dist/cli/chunks/chunk-DC3HPOOJ.js +2 -0
- package/dist/cli/chunks/chunk-DMGLX76J.js +180 -0
- package/dist/cli/chunks/chunk-E33KQBMW.js +2 -0
- package/dist/cli/chunks/chunk-EQFZQPFN.js +2 -0
- package/dist/cli/chunks/chunk-FPRL6UDF.js +2 -0
- package/dist/cli/chunks/chunk-FRNB4CH2.js +2 -0
- package/dist/cli/chunks/chunk-FWDKVTK4.js +2 -0
- package/dist/cli/chunks/chunk-GFNUESMU.js +2 -0
- package/dist/cli/chunks/chunk-GJW6V35N.js +2 -0
- package/dist/cli/chunks/chunk-GLIFZWV2.js +2 -0
- package/dist/cli/chunks/chunk-GNUUBTSX.js +14 -0
- package/dist/cli/chunks/chunk-HAUXLXKZ.js +2 -0
- package/dist/cli/chunks/chunk-HTXSUTWL.js +9 -0
- package/dist/cli/chunks/chunk-I5WZ2NM2.js +95 -0
- package/dist/cli/chunks/chunk-I7TA453K.js +2 -0
- package/dist/cli/chunks/chunk-IF6GW6IY.js +27 -0
- package/dist/cli/chunks/chunk-IHWSNYL2.js +5 -0
- package/dist/cli/chunks/chunk-IJKYJGJL.js +2 -0
- package/dist/cli/chunks/chunk-IQPXANCE.js +14 -0
- package/dist/cli/chunks/chunk-JCEY7RLP.js +2 -0
- package/dist/cli/chunks/chunk-JSOBRKMA.js +2 -0
- package/dist/cli/chunks/chunk-KIGRLIU4.js +2 -0
- package/dist/cli/chunks/chunk-L4H54Z27.js +21 -0
- package/dist/cli/chunks/chunk-LCOEBFAB.js +2 -0
- package/dist/cli/chunks/chunk-MZ54VM6A.js +2 -0
- package/dist/cli/chunks/chunk-NB47YT6A.js +167 -0
- package/dist/cli/chunks/chunk-NG3BKE7V.js +2 -0
- package/dist/cli/chunks/chunk-NG4TE3OW.js +2 -0
- package/dist/cli/chunks/chunk-O636JKJR.js +18 -0
- package/dist/cli/chunks/chunk-O6QQ4HLS.js +2 -0
- package/dist/cli/chunks/chunk-OFNIQCGX.js +2 -0
- package/dist/cli/chunks/chunk-OTSJU5LH.js +2 -0
- package/dist/cli/chunks/chunk-POLFT2PQ.js +15 -0
- package/dist/cli/chunks/chunk-QAYTL6KC.js +2 -0
- package/dist/cli/chunks/chunk-QMFP5OKH.js +2 -0
- package/dist/cli/chunks/chunk-RAJO7VML.js +2 -0
- package/dist/cli/chunks/chunk-RKIGOARX.js +2 -0
- package/dist/cli/chunks/chunk-RU6Q5HOC.js +3 -0
- package/dist/cli/chunks/chunk-RV6SGDET.js +2 -0
- package/dist/cli/chunks/chunk-RWXI7XAR.js +2 -0
- package/dist/cli/chunks/chunk-RXVYOXDB.js +2 -0
- package/dist/cli/chunks/chunk-SGRN6JFB.js +2 -0
- package/dist/cli/chunks/chunk-SVNX4UWR.js +3029 -0
- package/dist/cli/chunks/chunk-TL7ABIMP.js +2 -0
- package/dist/cli/chunks/chunk-TOLYWONQ.js +2 -0
- package/dist/cli/chunks/chunk-TPXYS3WG.js +3 -0
- package/dist/cli/chunks/chunk-U5JQGRHZ.js +2 -0
- package/dist/cli/chunks/chunk-UB7RGVKO.js +2 -0
- package/dist/cli/chunks/chunk-UBKK7KCR.js +70 -0
- package/dist/cli/chunks/chunk-UMGWGX7C.js +2 -0
- package/dist/cli/chunks/chunk-UN4PA4M2.js +2 -0
- package/dist/cli/chunks/chunk-US7INRP2.js +314 -0
- package/dist/cli/chunks/chunk-UWDBFPHQ.js +750 -0
- package/dist/cli/chunks/chunk-UZZCWWIG.js +2 -0
- package/dist/cli/chunks/chunk-V4HM4QAO.js +24 -0
- package/dist/cli/chunks/chunk-V4U3CTS2.js +180 -0
- package/dist/cli/chunks/chunk-VCCMCFDU.js +2 -0
- package/dist/cli/chunks/chunk-VEWIT6VN.js +4 -0
- package/dist/cli/chunks/chunk-VNYGVG4Y.js +2 -0
- package/dist/cli/chunks/chunk-VO3OVD5D.js +4 -0
- package/dist/cli/chunks/chunk-VY74OMGQ.js +6 -0
- package/dist/cli/chunks/chunk-WDJBGXC2.js +2 -0
- package/dist/cli/chunks/chunk-WDV6TN7E.js +65 -0
- package/dist/cli/chunks/chunk-WLXEDOG4.js +2 -0
- package/dist/cli/chunks/chunk-WXXAAXNS.js +12 -0
- package/dist/cli/chunks/chunk-X4MZYBOU.js +256 -0
- package/dist/cli/chunks/chunk-XE2YAYU5.js +12 -0
- package/dist/cli/chunks/chunk-XP6XKBNW.js +2 -0
- package/dist/cli/chunks/chunk-XPB6ZVQY.js +2 -0
- package/dist/cli/chunks/chunk-XRVUSKQV.js +1 -0
- package/dist/cli/chunks/chunk-XSITQBYB.js +20 -0
- package/dist/cli/chunks/chunk-XTLA4F5Z.js +91 -0
- package/dist/cli/chunks/chunk-XU6L2VJY.js +2 -0
- package/dist/cli/chunks/chunk-XUFHYPZK.js +2 -0
- package/dist/cli/chunks/chunk-Y2ZEDXTV.js +16 -0
- package/dist/cli/chunks/chunk-YQWB4QUP.js +316 -0
- package/dist/cli/chunks/chunk-YUQIXT3G.js +79 -0
- package/dist/cli/chunks/chunk-YYYB2JN5.js +2 -0
- package/dist/cli/chunks/chunk-ZEUVPLGX.js +2 -0
- package/dist/cli/chunks/chunk-ZSRQHJEW.js +3 -0
- package/dist/cli/chunks/ci-N4NTYAAI.js +81 -0
- package/dist/cli/chunks/ci-output-XYR2PSYH.js +2 -0
- package/dist/cli/chunks/claude-flow-setup-FX7PRBJV.js +2 -0
- package/dist/cli/chunks/client-CRRENRK4.js +2 -0
- package/dist/cli/chunks/cline-installer-GTHQOK7U.js +4 -0
- package/dist/cli/chunks/code-4G6ZHVNI.js +38 -0
- package/dist/cli/chunks/code-index-extractor-MKJTP5AK.js +3 -0
- package/dist/cli/chunks/codex-installer-UGS773DT.js +8 -0
- package/dist/cli/chunks/completions-B3BXNXAU.js +1364 -0
- package/dist/cli/chunks/complexity-analyzer-PMN77CUP.js +2 -0
- package/dist/cli/chunks/continuedev-installer-3DYKSIP3.js +14 -0
- package/dist/cli/chunks/copilot-installer-IUC5HDHD.js +3 -0
- package/dist/cli/chunks/cost-tracker-GSGQ7O5T.js +2 -0
- package/dist/cli/chunks/coverage-PO72QC3P.js +27 -0
- package/dist/cli/chunks/cross-domain-router-FSCGJG3B.js +2 -0
- package/dist/cli/chunks/cursor-installer-FK53S3ZL.js +3 -0
- package/dist/cli/chunks/daemon-4UIQTQ73.js +19 -0
- package/dist/cli/chunks/dag-attention-scheduler-ZGIMLECE.js +2 -0
- package/dist/cli/chunks/detect-XXHLTLL7.js +2 -0
- package/dist/cli/chunks/domain-handler-PPGFP7P4.js +25 -0
- package/dist/cli/chunks/domain-transfer-Q5UAE65W.js +2 -0
- package/dist/cli/chunks/dream-PONKQULG.js +2 -0
- package/dist/cli/chunks/esm-node-XLWDJRBX.js +2 -0
- package/dist/cli/chunks/eval-JVJKHSTQ.js +15 -0
- package/dist/cli/chunks/fast-paths-3KX4ZV66.js +2 -0
- package/dist/cli/chunks/feature-flags-2NOVE7DL.js +2 -0
- package/dist/cli/chunks/feature-flags-GKHHG2I2.js +2 -0
- package/dist/cli/chunks/file-discovery-XFSGQNM3.js +2 -0
- package/dist/cli/chunks/fleet-FOIDAXLR.js +43 -0
- package/dist/cli/chunks/gnn-wrapper-HPCQREKP.js +2 -0
- package/dist/cli/chunks/heartbeat-handler-HTR3EFFV.js +48 -0
- package/dist/cli/chunks/heartbeat-scheduler-NZQWN7CH.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-BNA5WUAB.js +2 -0
- package/dist/cli/chunks/hnsw-index-RQIIAE7S.js +2 -0
- package/dist/cli/chunks/hnsw-legacy-bridge-H6OA3AA3.js +2 -0
- package/dist/cli/chunks/hnswlib-node-FF27BDMD.js +2 -0
- package/dist/cli/chunks/hooks-63NZQ7NH.js +101 -0
- package/dist/cli/chunks/hypergraph-engine-XMSLA4XH.js +2 -0
- package/dist/cli/chunks/hypergraph-handler-ID6J6GS2.js +35 -0
- package/dist/cli/chunks/impact-analyzer-FS2UNVP4.js +2 -0
- package/dist/cli/chunks/init-handler-CIKZGGAY.js +68 -0
- package/dist/cli/chunks/init-wizard-TUU5PPY6.js +2 -0
- package/dist/cli/chunks/kernel-XFG42WAG.js +2 -0
- package/dist/cli/chunks/kilocode-installer-N7NLISYY.js +4 -0
- package/dist/cli/chunks/kiro-installer-U6XIPAT3.js +74 -0
- package/dist/cli/chunks/knowledge-graph-XV7FPU2T.js +2 -0
- package/dist/cli/chunks/learning-NKOF7KDJ.js +107 -0
- package/dist/cli/chunks/llm-router-34WHT3PH.js +30 -0
- package/dist/cli/chunks/load-ZW4Z3YLT.js +2 -0
- package/dist/cli/chunks/load-test-F4L7RTXJ.js +2 -0
- package/dist/cli/chunks/mcp-6R7SVGKO.js +2 -0
- package/dist/cli/chunks/memory-OUYCBU4M.js +32 -0
- package/dist/cli/chunks/memory-backend-DTJD2DWF.js +2 -0
- package/dist/cli/chunks/memory-handlers-WNXKZRNM.js +2 -0
- package/dist/cli/chunks/opencode-installer-FR75GHFU.js +3 -0
- package/dist/cli/chunks/orchestrator-AK7ZMVNH.js +371 -0
- package/dist/cli/chunks/pipeline-CFOPG7EM.js +19 -0
- package/dist/cli/chunks/platform-NY3ULBR7.js +2 -0
- package/dist/cli/chunks/plugin-LRANQYUR.js +27 -0
- package/dist/cli/chunks/prime-radiant-advanced-wasm-6KEIU55P.js +2 -0
- package/dist/cli/chunks/protocol-executor-6W4PS2D4.js +2 -0
- package/dist/cli/chunks/protocol-handler-ESSZGJ7R.js +20 -0
- package/dist/cli/chunks/prove-EF2PPY65.js +3 -0
- package/dist/cli/chunks/qe-reasoning-bank-7G3TZLEA.js +2 -0
- package/dist/cli/chunks/quality-AYBXB635.js +7 -0
- package/dist/cli/chunks/queen-coordinator-NFPKGMQN.js +2 -0
- package/dist/cli/chunks/real-embeddings-QPBXE7MA.js +2 -0
- package/dist/cli/chunks/roocode-installer-UF6MMBH6.js +4 -0
- package/dist/cli/chunks/router-F4B7Q66G.js +2 -0
- package/dist/cli/chunks/routing-feedback-5CIDDW7P.js +2 -0
- package/dist/cli/chunks/routing-handler-5TVKFU7V.js +20 -0
- package/dist/cli/chunks/ruvector-commands-E33VXFIA.js +8 -0
- package/dist/cli/chunks/rvf-dual-writer-O3AZKD24.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-IKEUZ2HX.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-M4H7W4RN.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-UX3WAPIP.js +2 -0
- package/dist/cli/chunks/safe-db-QBBNXEVK.js +2 -0
- package/dist/cli/chunks/schedule-GFT4NN6Z.js +2 -0
- package/dist/cli/chunks/scheduler-CQ56T7DB.js +2 -0
- package/dist/cli/chunks/security-ZLWT7IU3.js +14 -0
- package/dist/cli/chunks/shared-rvf-adapter-EXACQ2PT.js +2 -0
- package/dist/cli/chunks/shared-rvf-dual-writer-G43LQDIV.js +2 -0
- package/dist/cli/chunks/sqlite-persistence-JHSUZPAW.js +2 -0
- package/dist/cli/chunks/status-handler-7P23CXUI.js +45 -0
- package/dist/cli/chunks/structural-health-SCNBNL7K.js +2 -0
- package/dist/cli/chunks/sync-BYZBBH65.js +23 -0
- package/dist/cli/chunks/task-handler-DWJQXZ2K.js +49 -0
- package/dist/cli/chunks/task-handlers-35JIXVRW.js +2 -0
- package/dist/cli/chunks/test-2JSS4XW7.js +33 -0
- package/dist/cli/chunks/test-scheduling-TWJ5I7N3.js +15 -0
- package/dist/cli/chunks/token-bootstrap-LLLNJT5V.js +2 -0
- package/dist/cli/chunks/token-usage-EQ4HM4EZ.js +25 -0
- package/dist/cli/chunks/transformers-PBIR5U5S.js +2 -0
- package/dist/cli/chunks/tree-sitter-wasm-parser-X3L2GXUX.js +2 -0
- package/dist/cli/chunks/types-OD43K2NP.js +2 -0
- package/dist/cli/chunks/unified-memory-YPHONR2T.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-HJS4OXWM.js +2 -0
- package/dist/cli/chunks/unified-persistence-EFZRO6AW.js +2 -0
- package/dist/cli/chunks/validate-POMLT2KU.js +21 -0
- package/dist/cli/chunks/validate-swarm-UOC4JGZT.js +14 -0
- package/dist/cli/chunks/vibium-5JF6LAXI.js +2 -0
- package/dist/cli/chunks/visual-security-7KWFLYNB.js +2 -0
- package/dist/cli/chunks/web-tree-sitter-R7WR7J7B.js +2 -0
- package/dist/cli/chunks/windsurf-installer-ZSPEUBKR.js +7 -0
- package/dist/cli/chunks/witness-chain-CFSPCXHG.js +2 -0
- package/dist/cli/chunks/witness-chain-RWU6WT37.js +2 -0
- package/dist/cli/chunks/workflow-YNQT3OW2.js +51 -0
- package/dist/cli/chunks/workflow-orchestrator-Z6TAVMQP.js +2 -0
- package/dist/cli/chunks/wrappers-BP4FODVH.js +2 -0
- package/dist/cli/commands/daemon.d.ts +13 -0
- package/dist/cli/commands/daemon.js +224 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +2 -1
- package/dist/cli/commands/plugin.d.ts +12 -0
- package/dist/cli/commands/plugin.js +135 -0
- package/dist/cli/commands/ruvector-commands.js +14 -2
- package/dist/cli/commands/workflow.d.ts +10 -0
- package/dist/cli/commands/workflow.js +587 -0
- package/dist/cli/handlers/brain-handler.js +13 -8
- package/dist/cli/handlers/heartbeat-handler.d.ts +1 -0
- package/dist/cli/handlers/heartbeat-handler.js +20 -10
- package/dist/cli/handlers/hypergraph-handler.js +3 -3
- package/dist/cli/handlers/init-handler.js +10 -9
- package/dist/cli/handlers/interfaces.d.ts +4 -4
- package/dist/cli/index.js +159 -638
- package/dist/cli/lazy-registry.d.ts +27 -0
- package/dist/cli/lazy-registry.js +70 -0
- package/dist/context/compaction/context-budget.d.ts +71 -0
- package/dist/context/compaction/context-budget.js +120 -0
- package/dist/context/compaction/index.d.ts +96 -0
- package/dist/context/compaction/index.js +259 -0
- package/dist/context/compaction/llm-caller-adapter.d.ts +14 -0
- package/dist/context/compaction/llm-caller-adapter.js +47 -0
- package/dist/context/compaction/tier1-microcompact.d.ts +33 -0
- package/dist/context/compaction/tier1-microcompact.js +47 -0
- package/dist/context/compaction/tier2-session-summary.d.ts +72 -0
- package/dist/context/compaction/tier2-session-summary.js +172 -0
- package/dist/context/compaction/tier3-llm-compact.d.ts +65 -0
- package/dist/context/compaction/tier3-llm-compact.js +166 -0
- package/dist/context/compaction/tier4-reactive.d.ts +54 -0
- package/dist/context/compaction/tier4-reactive.js +129 -0
- package/dist/coordination/agent-memory-branch.d.ts +117 -0
- package/dist/coordination/agent-memory-branch.js +213 -0
- package/dist/coordination/agent-teams/mailbox.d.ts +43 -0
- package/dist/coordination/agent-teams/mailbox.js +130 -4
- package/dist/coordination/consensus/providers/claude-provider.d.ts +1 -0
- package/dist/coordination/consensus/providers/claude-provider.js +23 -3
- package/dist/coordination/handlers/handler-utils.d.ts +1 -0
- package/dist/coordination/handlers/handler-utils.js +9 -2
- package/dist/coordination/handlers/quality-handlers.js +7 -1
- package/dist/domains/contract-testing/coordinator.js +11 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +20 -1
- package/dist/domains/quality-assessment/coherence/gate-controller.js +64 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts +3 -3
- package/dist/domains/quality-assessment/coherence/index.js +2 -2
- package/dist/domains/quality-assessment/coherence/types.d.ts +39 -0
- package/dist/domains/quality-assessment/coherence/types.js +11 -0
- package/dist/domains/quality-assessment/coordinator.d.ts +14 -0
- package/dist/domains/quality-assessment/coordinator.js +92 -0
- package/dist/domains/test-execution/coordinator.d.ts +19 -0
- package/dist/domains/test-execution/coordinator.js +102 -5
- package/dist/domains/test-generation/coordinator.js +11 -0
- package/dist/domains/test-generation/interfaces.d.ts +2 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +9 -0
- package/dist/domains/test-generation/services/test-generator.js +37 -0
- package/dist/hooks/cross-phase-hooks.d.ts +11 -0
- package/dist/hooks/cross-phase-hooks.js +73 -9
- package/dist/hooks/security/config-snapshot.d.ts +21 -0
- package/dist/hooks/security/config-snapshot.js +33 -0
- package/dist/hooks/security/exit-codes.d.ts +28 -0
- package/dist/hooks/security/exit-codes.js +33 -0
- package/dist/hooks/security/index.d.ts +15 -0
- package/dist/hooks/security/index.js +15 -0
- package/dist/hooks/security/ssrf-guard.d.ts +25 -0
- package/dist/hooks/security/ssrf-guard.js +69 -0
- package/dist/init/agents-installer.d.ts +5 -3
- package/dist/init/agents-installer.js +17 -43
- package/dist/init/find-package-root.d.ts +22 -0
- package/dist/init/find-package-root.js +46 -0
- package/dist/init/n8n-installer.d.ts +4 -2
- package/dist/init/n8n-installer.js +23 -23
- package/dist/init/opencode-installer.d.ts +0 -5
- package/dist/init/opencode-installer.js +12 -39
- package/dist/init/skills-installer.d.ts +5 -2
- package/dist/init/skills-installer.js +15 -37
- package/dist/integrations/embeddings/index/HNSWIndex.d.ts +9 -2
- package/dist/integrations/embeddings/index/HNSWIndex.js +110 -35
- package/dist/integrations/ruvector/cognitive-routing.d.ts +67 -0
- package/dist/integrations/ruvector/cognitive-routing.js +208 -0
- package/dist/integrations/ruvector/feature-flags.d.ts +84 -0
- package/dist/integrations/ruvector/feature-flags.js +59 -0
- package/dist/integrations/ruvector/hdc-fingerprint.d.ts +76 -0
- package/dist/integrations/ruvector/hdc-fingerprint.js +217 -0
- package/dist/integrations/ruvector/hyperbolic-hnsw.d.ts +59 -0
- package/dist/integrations/ruvector/hyperbolic-hnsw.js +194 -0
- package/dist/integrations/ruvector/index.d.ts +5 -2
- package/dist/integrations/ruvector/index.js +13 -2
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +24 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +55 -0
- package/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +6 -0
- package/dist/integrations/ruvector/shared-rvf-dual-writer.js +38 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +8 -0
- package/dist/integrations/ruvector/sona-persistence.js +10 -0
- package/dist/integrations/ruvector/vector-delta-tracker.d.ts +96 -0
- package/dist/integrations/ruvector/vector-delta-tracker.js +226 -0
- package/dist/kernel/agent-coordinator.d.ts +75 -1
- package/dist/kernel/agent-coordinator.js +250 -1
- package/dist/kernel/hnsw-legacy-bridge.d.ts +38 -0
- package/dist/kernel/hnsw-legacy-bridge.js +88 -0
- package/dist/kernel/hnsw-shadow-validator.d.ts +91 -0
- package/dist/kernel/hnsw-shadow-validator.js +139 -0
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/interfaces.d.ts +39 -0
- package/dist/kernel/kernel.d.ts +23 -0
- package/dist/kernel/kernel.js +141 -1
- package/dist/kernel/memory-backend.js +3 -1
- package/dist/kernel/unified-memory.d.ts +1 -1
- package/dist/kernel/unified-memory.js +7 -3
- package/dist/learning/aqe-learning-engine.d.ts +65 -0
- package/dist/learning/aqe-learning-engine.js +134 -0
- package/dist/learning/dream/dream-engine.d.ts +6 -1
- package/dist/learning/dream/dream-engine.js +37 -2
- package/dist/learning/dream/dream-scheduler.d.ts +25 -0
- package/dist/learning/dream/dream-scheduler.js +120 -0
- package/dist/learning/dream/rvcow-branch-manager.d.ts +6 -3
- package/dist/learning/dream/rvcow-branch-manager.js +60 -5
- package/dist/learning/experience-capture.d.ts +3 -3
- package/dist/learning/hyperbolic-pattern-index.d.ts +82 -0
- package/dist/learning/hyperbolic-pattern-index.js +142 -0
- package/dist/learning/index.d.ts +3 -3
- package/dist/learning/index.js +1 -1
- package/dist/learning/metrics-tracker.d.ts +44 -0
- package/dist/learning/metrics-tracker.js +37 -0
- package/dist/learning/pattern-promotion.d.ts +3 -3
- package/dist/learning/pattern-store.d.ts +45 -2
- package/dist/learning/pattern-store.js +217 -4
- package/dist/learning/qe-patterns.d.ts +1 -1
- package/dist/learning/qe-reasoning-bank.js +1 -1
- package/dist/learning/rvf-pattern-migration.d.ts +50 -0
- package/dist/learning/rvf-pattern-migration.js +106 -0
- package/dist/learning/rvf-pattern-store.d.ts +66 -0
- package/dist/learning/rvf-pattern-store.js +447 -0
- package/dist/mcp/bundle.js +1937 -1793
- package/dist/mcp/entry.js +132 -77
- package/dist/mcp/handlers/index.d.ts +1 -0
- package/dist/mcp/handlers/index.js +2 -0
- package/dist/mcp/handlers/migration-handlers.d.ts +52 -0
- package/dist/mcp/handlers/migration-handlers.js +85 -0
- package/dist/mcp/middleware/batch-executor.d.ts +46 -0
- package/dist/mcp/middleware/batch-executor.js +150 -0
- package/dist/mcp/middleware/microcompact.d.ts +97 -0
- package/dist/mcp/middleware/microcompact.js +179 -0
- package/dist/mcp/middleware/middleware-chain.d.ts +37 -0
- package/dist/mcp/middleware/middleware-chain.js +60 -0
- package/dist/mcp/protocol-server.d.ts +12 -0
- package/dist/mcp/protocol-server.js +192 -36
- package/dist/mcp/services/session-durability-middleware.d.ts +22 -0
- package/dist/mcp/services/session-durability-middleware.js +64 -0
- package/dist/mcp/services/session-resume.d.ts +29 -0
- package/dist/mcp/services/session-resume.js +221 -0
- package/dist/mcp/services/session-store.d.ts +84 -0
- package/dist/mcp/services/session-store.js +163 -0
- package/dist/mcp/tool-registry.d.ts +9 -0
- package/dist/mcp/tool-registry.js +30 -1
- package/dist/mcp/types.d.ts +2 -1
- package/dist/optimization/early-exit-token-optimizer.d.ts +7 -7
- package/dist/optimization/early-exit-token-optimizer.js +3 -3
- package/dist/persistence/rvf-consistency-validator.d.ts +85 -0
- package/dist/persistence/rvf-consistency-validator.js +182 -0
- package/dist/persistence/rvf-migration-adapter.d.ts +125 -0
- package/dist/persistence/rvf-migration-adapter.js +303 -0
- package/dist/persistence/rvf-migration-coordinator.d.ts +115 -0
- package/dist/persistence/rvf-migration-coordinator.js +224 -0
- package/dist/persistence/rvf-stage-gate.d.ts +70 -0
- package/dist/persistence/rvf-stage-gate.js +163 -0
- package/dist/plugins/cache.d.ts +44 -0
- package/dist/plugins/cache.js +149 -0
- package/dist/plugins/index.d.ts +15 -0
- package/dist/plugins/index.js +15 -0
- package/dist/plugins/lifecycle.d.ts +67 -0
- package/dist/plugins/lifecycle.js +175 -0
- package/dist/plugins/manifest.d.ts +45 -0
- package/dist/plugins/manifest.js +173 -0
- package/dist/plugins/resolver.d.ts +37 -0
- package/dist/plugins/resolver.js +80 -0
- package/dist/plugins/security.d.ts +23 -0
- package/dist/plugins/security.js +125 -0
- package/dist/plugins/sources/github.d.ts +17 -0
- package/dist/plugins/sources/github.js +77 -0
- package/dist/plugins/sources/local.d.ts +20 -0
- package/dist/plugins/sources/local.js +32 -0
- package/dist/plugins/sources/npm.d.ts +18 -0
- package/dist/plugins/sources/npm.js +82 -0
- package/dist/shared/llm/retry.d.ts +5 -2
- package/dist/shared/llm/retry.js +7 -3
- package/dist/shared/prompt-cache-latch.d.ts +41 -0
- package/dist/shared/prompt-cache-latch.js +63 -0
- package/dist/shared/retry-engine.d.ts +77 -0
- package/dist/shared/retry-engine.js +194 -0
- package/dist/workers/daemon.d.ts +8 -0
- package/dist/workers/daemon.js +13 -0
- package/dist/workers/quality-daemon/ci-monitor.d.ts +55 -0
- package/dist/workers/quality-daemon/ci-monitor.js +147 -0
- package/dist/workers/quality-daemon/coverage-delta.d.ts +72 -0
- package/dist/workers/quality-daemon/coverage-delta.js +135 -0
- package/dist/workers/quality-daemon/git-watcher.d.ts +51 -0
- package/dist/workers/quality-daemon/git-watcher.js +209 -0
- package/dist/workers/quality-daemon/index.d.ts +119 -0
- package/dist/workers/quality-daemon/index.js +343 -0
- package/dist/workers/quality-daemon/nightly-consolidation.d.ts +74 -0
- package/dist/workers/quality-daemon/nightly-consolidation.js +136 -0
- package/dist/workers/quality-daemon/notification-service.d.ts +67 -0
- package/dist/workers/quality-daemon/notification-service.js +178 -0
- package/dist/workers/quality-daemon/persistent-memory.d.ts +31 -0
- package/dist/workers/quality-daemon/persistent-memory.js +30 -0
- package/dist/workers/quality-daemon/priority-queue.d.ts +97 -0
- package/dist/workers/quality-daemon/priority-queue.js +126 -0
- package/dist/workers/quality-daemon/test-suggester.d.ts +50 -0
- package/dist/workers/quality-daemon/test-suggester.js +121 -0
- package/dist/workers/worker-manager.js +2 -1
- package/package.json +10 -10
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Migration Coordinator (ADR-072 Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Wires together RvfMigrationAdapter, RvfConsistencyValidator, and
|
|
5
|
+
* RvfStageGate into a single service that can be initialized during
|
|
6
|
+
* kernel boot and exposed via MCP tools.
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle:
|
|
9
|
+
* 1. Kernel calls RvfMigrationCoordinator.initialize(db)
|
|
10
|
+
* 2. Coordinator reads stage from feature flags, attaches SQLite + RVF handles
|
|
11
|
+
* 3. MCP tools call getStatus(), runConsistencyCheck(), promote()
|
|
12
|
+
*
|
|
13
|
+
* @module persistence/rvf-migration-coordinator
|
|
14
|
+
*/
|
|
15
|
+
import { RvfMigrationAdapter, type MigrationStage, type MigrationMetrics } from './rvf-migration-adapter.js';
|
|
16
|
+
import { type ConsistencyCheckResult } from './rvf-consistency-validator.js';
|
|
17
|
+
import { type StageGateResult } from './rvf-stage-gate.js';
|
|
18
|
+
export interface MigrationStatus {
|
|
19
|
+
stage: MigrationStage;
|
|
20
|
+
stageName: string;
|
|
21
|
+
metrics: MigrationMetrics;
|
|
22
|
+
consistencyHistory: {
|
|
23
|
+
totalChecks: number;
|
|
24
|
+
rollingDivergenceRate: number;
|
|
25
|
+
lastCheck: ConsistencyCheckResult | null;
|
|
26
|
+
};
|
|
27
|
+
gateEvaluation: StageGateResult;
|
|
28
|
+
engineStatus: {
|
|
29
|
+
sqliteVectorCount: number;
|
|
30
|
+
rvfAvailable: boolean;
|
|
31
|
+
rvfVectorCount: number | null;
|
|
32
|
+
rvfDeadSpaceRatio: number | null;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface MigrationCoordinatorConfig {
|
|
36
|
+
/** Override migration stage (otherwise reads from feature flags) */
|
|
37
|
+
stage?: MigrationStage;
|
|
38
|
+
/** RVF file path */
|
|
39
|
+
rvfPath?: string;
|
|
40
|
+
/** Vector dimensions */
|
|
41
|
+
dimensions?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class RvfMigrationCoordinator {
|
|
44
|
+
private adapter;
|
|
45
|
+
private validator;
|
|
46
|
+
private gate;
|
|
47
|
+
private currentStage;
|
|
48
|
+
private initialized;
|
|
49
|
+
constructor(config?: MigrationCoordinatorConfig);
|
|
50
|
+
/**
|
|
51
|
+
* Attach the real SQLite database handle (from UnifiedMemoryManager).
|
|
52
|
+
* Called during kernel boot.
|
|
53
|
+
*/
|
|
54
|
+
attachSqliteDb(db: unknown): void;
|
|
55
|
+
/**
|
|
56
|
+
* Attach the shared RVF store (from shared-rvf-adapter singleton).
|
|
57
|
+
* Called during kernel boot when native bindings are available.
|
|
58
|
+
*/
|
|
59
|
+
attachRvfStore(store: unknown): void;
|
|
60
|
+
/**
|
|
61
|
+
* Attach a witness chain for audit trail of stage promotions.
|
|
62
|
+
*/
|
|
63
|
+
attachWitnessChain(wc: unknown): void;
|
|
64
|
+
/**
|
|
65
|
+
* Full initialization: reads handles from running system.
|
|
66
|
+
*/
|
|
67
|
+
initialize(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Get comprehensive migration status.
|
|
70
|
+
* This is the primary user-facing method — shows stage, metrics,
|
|
71
|
+
* consistency history, and gate evaluation at a glance.
|
|
72
|
+
*/
|
|
73
|
+
getStatus(): MigrationStatus;
|
|
74
|
+
/**
|
|
75
|
+
* Run a consistency check between SQLite and RVF.
|
|
76
|
+
* Returns the check result with divergence details.
|
|
77
|
+
*/
|
|
78
|
+
runConsistencyCheck(): ConsistencyCheckResult;
|
|
79
|
+
/**
|
|
80
|
+
* Evaluate whether promotion to the next stage is allowed.
|
|
81
|
+
*/
|
|
82
|
+
evaluateGate(): StageGateResult;
|
|
83
|
+
/**
|
|
84
|
+
* Attempt to promote to the next migration stage.
|
|
85
|
+
*
|
|
86
|
+
* @param force - Skip gate checks (records forced promotion in witness chain)
|
|
87
|
+
* @returns Promotion result with new stage
|
|
88
|
+
*/
|
|
89
|
+
promote(force?: boolean): {
|
|
90
|
+
promoted: boolean;
|
|
91
|
+
previousStage: MigrationStage;
|
|
92
|
+
newStage: MigrationStage;
|
|
93
|
+
result: StageGateResult;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Write a vector through the migration adapter.
|
|
97
|
+
* Used to verify dual-write routing at each stage.
|
|
98
|
+
*/
|
|
99
|
+
write(id: string, vector: Float32Array | number[]): import("./rvf-migration-adapter.js").WriteResult;
|
|
100
|
+
/**
|
|
101
|
+
* Search through the migration adapter.
|
|
102
|
+
* Used to verify read routing at each stage.
|
|
103
|
+
*/
|
|
104
|
+
search(query: Float32Array | number[], k: number): import("./rvf-migration-adapter.js").ReadResult<{
|
|
105
|
+
id: string;
|
|
106
|
+
score: number;
|
|
107
|
+
}[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Get the underlying adapter (for advanced use / testing).
|
|
110
|
+
*/
|
|
111
|
+
getAdapter(): RvfMigrationAdapter;
|
|
112
|
+
static getInstance(config?: MigrationCoordinatorConfig): RvfMigrationCoordinator;
|
|
113
|
+
static resetInstance(): void;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=rvf-migration-coordinator.d.ts.map
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Migration Coordinator (ADR-072 Phase 3)
|
|
3
|
+
*
|
|
4
|
+
* Wires together RvfMigrationAdapter, RvfConsistencyValidator, and
|
|
5
|
+
* RvfStageGate into a single service that can be initialized during
|
|
6
|
+
* kernel boot and exposed via MCP tools.
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle:
|
|
9
|
+
* 1. Kernel calls RvfMigrationCoordinator.initialize(db)
|
|
10
|
+
* 2. Coordinator reads stage from feature flags, attaches SQLite + RVF handles
|
|
11
|
+
* 3. MCP tools call getStatus(), runConsistencyCheck(), promote()
|
|
12
|
+
*
|
|
13
|
+
* @module persistence/rvf-migration-coordinator
|
|
14
|
+
*/
|
|
15
|
+
import { RvfMigrationAdapter, STAGE_NAMES } from './rvf-migration-adapter.js';
|
|
16
|
+
import { RvfConsistencyValidator } from './rvf-consistency-validator.js';
|
|
17
|
+
import { RvfStageGate } from './rvf-stage-gate.js';
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Singleton
|
|
20
|
+
// ============================================================================
|
|
21
|
+
let instance = null;
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// RvfMigrationCoordinator
|
|
24
|
+
// ============================================================================
|
|
25
|
+
export class RvfMigrationCoordinator {
|
|
26
|
+
adapter;
|
|
27
|
+
validator;
|
|
28
|
+
gate;
|
|
29
|
+
currentStage;
|
|
30
|
+
initialized = false;
|
|
31
|
+
constructor(config) {
|
|
32
|
+
// Stage is set synchronously from config or default.
|
|
33
|
+
// Feature flags are read asynchronously in initialize().
|
|
34
|
+
this.currentStage = config?.stage ?? 1;
|
|
35
|
+
this.adapter = new RvfMigrationAdapter({
|
|
36
|
+
stage: this.currentStage,
|
|
37
|
+
rvfPath: config?.rvfPath ?? '.agentic-qe/patterns.rvf',
|
|
38
|
+
dimensions: config?.dimensions ?? 384,
|
|
39
|
+
enableFallback: true,
|
|
40
|
+
});
|
|
41
|
+
this.validator = new RvfConsistencyValidator({
|
|
42
|
+
sampleSize: 50,
|
|
43
|
+
windowDurationMs: 7 * 24 * 60 * 60 * 1000, // 7 days
|
|
44
|
+
compactionThreshold: 0.3,
|
|
45
|
+
scoreTolerance: 0.05,
|
|
46
|
+
});
|
|
47
|
+
this.gate = new RvfStageGate({
|
|
48
|
+
minChecksRequired: 10,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// --------------------------------------------------------------------------
|
|
52
|
+
// Initialization
|
|
53
|
+
// --------------------------------------------------------------------------
|
|
54
|
+
/**
|
|
55
|
+
* Attach the real SQLite database handle (from UnifiedMemoryManager).
|
|
56
|
+
* Called during kernel boot.
|
|
57
|
+
*/
|
|
58
|
+
attachSqliteDb(db) {
|
|
59
|
+
this.adapter.setSqliteDb(db);
|
|
60
|
+
this.validator.setSqliteDb(db);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Attach the shared RVF store (from shared-rvf-adapter singleton).
|
|
64
|
+
* Called during kernel boot when native bindings are available.
|
|
65
|
+
*/
|
|
66
|
+
attachRvfStore(store) {
|
|
67
|
+
this.adapter.setRvfStore(store);
|
|
68
|
+
this.validator.setRvfStore(store);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Attach a witness chain for audit trail of stage promotions.
|
|
72
|
+
*/
|
|
73
|
+
attachWitnessChain(wc) {
|
|
74
|
+
this.gate.setWitnessChain(wc);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Full initialization: reads handles from running system.
|
|
78
|
+
*/
|
|
79
|
+
async initialize() {
|
|
80
|
+
if (this.initialized)
|
|
81
|
+
return;
|
|
82
|
+
// Read stage from feature flags (async import for ESM compatibility)
|
|
83
|
+
if (this.currentStage === 1) {
|
|
84
|
+
try {
|
|
85
|
+
const { getRvfMigrationStage } = await import('../integrations/ruvector/feature-flags.js');
|
|
86
|
+
const flagStage = getRvfMigrationStage();
|
|
87
|
+
this.currentStage = flagStage;
|
|
88
|
+
this.adapter.setStage(flagStage);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
// Feature flags unavailable — keep constructor default
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Try to get SQLite handle from UnifiedMemoryManager
|
|
95
|
+
try {
|
|
96
|
+
const { UnifiedMemoryManager } = await import('../kernel/unified-memory.js');
|
|
97
|
+
const umm = UnifiedMemoryManager.getInstance();
|
|
98
|
+
await umm.initialize();
|
|
99
|
+
const db = umm.getDatabase();
|
|
100
|
+
if (db)
|
|
101
|
+
this.attachSqliteDb(db);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// UMM unavailable — adapter works without it (read/write ops return empty)
|
|
105
|
+
}
|
|
106
|
+
// Try to get shared RVF adapter
|
|
107
|
+
try {
|
|
108
|
+
const { getSharedRvfAdapter } = await import('../integrations/ruvector/shared-rvf-adapter.js');
|
|
109
|
+
const adapter = getSharedRvfAdapter();
|
|
110
|
+
if (adapter)
|
|
111
|
+
this.attachRvfStore(adapter);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// RVF native unavailable — adapter works without it
|
|
115
|
+
}
|
|
116
|
+
// Try to attach witness chain
|
|
117
|
+
try {
|
|
118
|
+
const { WitnessChain } = await import('../audit/witness-chain.js');
|
|
119
|
+
const wc = new WitnessChain();
|
|
120
|
+
await wc.initialize();
|
|
121
|
+
this.attachWitnessChain(wc);
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
// Witness chain is optional
|
|
125
|
+
}
|
|
126
|
+
this.initialized = true;
|
|
127
|
+
}
|
|
128
|
+
// --------------------------------------------------------------------------
|
|
129
|
+
// User-Facing Operations
|
|
130
|
+
// --------------------------------------------------------------------------
|
|
131
|
+
/**
|
|
132
|
+
* Get comprehensive migration status.
|
|
133
|
+
* This is the primary user-facing method — shows stage, metrics,
|
|
134
|
+
* consistency history, and gate evaluation at a glance.
|
|
135
|
+
*/
|
|
136
|
+
getStatus() {
|
|
137
|
+
const metrics = this.adapter.getMetrics();
|
|
138
|
+
const engineStatus = this.adapter.status();
|
|
139
|
+
const history = this.validator.getHistory();
|
|
140
|
+
const gateEvaluation = this.gate.evaluate(this.currentStage, this.validator, metrics);
|
|
141
|
+
return {
|
|
142
|
+
stage: this.currentStage,
|
|
143
|
+
stageName: STAGE_NAMES[this.currentStage],
|
|
144
|
+
metrics,
|
|
145
|
+
consistencyHistory: {
|
|
146
|
+
totalChecks: this.validator.getCheckCount(),
|
|
147
|
+
rollingDivergenceRate: this.validator.getRollingDivergenceRate(),
|
|
148
|
+
lastCheck: history.length > 0 ? history[history.length - 1] : null,
|
|
149
|
+
},
|
|
150
|
+
gateEvaluation,
|
|
151
|
+
engineStatus: {
|
|
152
|
+
sqliteVectorCount: engineStatus.sqlite.vectorCount,
|
|
153
|
+
rvfAvailable: engineStatus.rvf !== null,
|
|
154
|
+
rvfVectorCount: engineStatus.rvf?.totalVectors ?? null,
|
|
155
|
+
rvfDeadSpaceRatio: engineStatus.rvf?.deadSpaceRatio ?? null,
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Run a consistency check between SQLite and RVF.
|
|
161
|
+
* Returns the check result with divergence details.
|
|
162
|
+
*/
|
|
163
|
+
runConsistencyCheck() {
|
|
164
|
+
return this.validator.runCheck();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Evaluate whether promotion to the next stage is allowed.
|
|
168
|
+
*/
|
|
169
|
+
evaluateGate() {
|
|
170
|
+
return this.gate.evaluate(this.currentStage, this.validator, this.adapter.getMetrics());
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Attempt to promote to the next migration stage.
|
|
174
|
+
*
|
|
175
|
+
* @param force - Skip gate checks (records forced promotion in witness chain)
|
|
176
|
+
* @returns Promotion result with new stage
|
|
177
|
+
*/
|
|
178
|
+
promote(force = false) {
|
|
179
|
+
const previousStage = this.currentStage;
|
|
180
|
+
const { promoted, newStage, result } = this.gate.promote(this.currentStage, this.validator, this.adapter.getMetrics(), force);
|
|
181
|
+
if (promoted) {
|
|
182
|
+
this.currentStage = newStage;
|
|
183
|
+
// Propagate to adapter so write/read routing uses the new stage
|
|
184
|
+
this.adapter.setStage(newStage);
|
|
185
|
+
// Note: The feature flag default is NOT mutated at runtime.
|
|
186
|
+
// The new stage is active for this process lifetime. To persist
|
|
187
|
+
// the promotion, update rvfMigrationStage in feature-flags.ts.
|
|
188
|
+
}
|
|
189
|
+
return { promoted, previousStage, newStage, result };
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Write a vector through the migration adapter.
|
|
193
|
+
* Used to verify dual-write routing at each stage.
|
|
194
|
+
*/
|
|
195
|
+
write(id, vector) {
|
|
196
|
+
return this.adapter.write(id, vector);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Search through the migration adapter.
|
|
200
|
+
* Used to verify read routing at each stage.
|
|
201
|
+
*/
|
|
202
|
+
search(query, k) {
|
|
203
|
+
return this.adapter.search(query, k);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Get the underlying adapter (for advanced use / testing).
|
|
207
|
+
*/
|
|
208
|
+
getAdapter() {
|
|
209
|
+
return this.adapter;
|
|
210
|
+
}
|
|
211
|
+
// --------------------------------------------------------------------------
|
|
212
|
+
// Singleton
|
|
213
|
+
// --------------------------------------------------------------------------
|
|
214
|
+
static getInstance(config) {
|
|
215
|
+
if (!instance) {
|
|
216
|
+
instance = new RvfMigrationCoordinator(config);
|
|
217
|
+
}
|
|
218
|
+
return instance;
|
|
219
|
+
}
|
|
220
|
+
static resetInstance() {
|
|
221
|
+
instance = null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=rvf-migration-coordinator.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Stage Gate Enforcer (ADR-072)
|
|
3
|
+
*
|
|
4
|
+
* Enforces go/no-go criteria for promoting the RVF migration stage.
|
|
5
|
+
* Each stage transition has specific requirements that must be met
|
|
6
|
+
* before promotion is allowed.
|
|
7
|
+
*
|
|
8
|
+
* Stage gates (from ADR-072):
|
|
9
|
+
* Stage 2→3: divergence <0.01% over 7 days, RVF read latency <2x SQLite
|
|
10
|
+
* Stage 3→4: zero fallbacks over 14 days, RVF write latency <1.5x SQLite
|
|
11
|
+
*
|
|
12
|
+
* Supports manual override with witness chain recording for audit trail.
|
|
13
|
+
*
|
|
14
|
+
* @module persistence/rvf-stage-gate
|
|
15
|
+
*/
|
|
16
|
+
import type { MigrationStage, MigrationMetrics } from './rvf-migration-adapter.js';
|
|
17
|
+
import type { RvfConsistencyValidator } from './rvf-consistency-validator.js';
|
|
18
|
+
import type { WitnessChain } from '../audit/witness-chain.js';
|
|
19
|
+
export interface StageGateResult {
|
|
20
|
+
/** Whether promotion is allowed */
|
|
21
|
+
canPromote: boolean;
|
|
22
|
+
/** Current stage */
|
|
23
|
+
currentStage: MigrationStage;
|
|
24
|
+
/** Target stage */
|
|
25
|
+
targetStage: MigrationStage;
|
|
26
|
+
/** Individual gate check results */
|
|
27
|
+
checks: GateCheck[];
|
|
28
|
+
/** Human-readable summary */
|
|
29
|
+
summary: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GateCheck {
|
|
32
|
+
name: string;
|
|
33
|
+
passed: boolean;
|
|
34
|
+
actual: string;
|
|
35
|
+
threshold: string;
|
|
36
|
+
}
|
|
37
|
+
export interface StageGateConfig {
|
|
38
|
+
/** Max divergence rate for stage 2→3 (default: 0.0001 = 0.01%) */
|
|
39
|
+
maxDivergenceRate2to3: number;
|
|
40
|
+
/** Max RVF/SQLite read latency ratio for stage 2→3 (default: 2.0) */
|
|
41
|
+
maxReadLatencyRatio2to3: number;
|
|
42
|
+
/** Max fallbacks allowed for stage 3→4 (default: 0) */
|
|
43
|
+
maxFallbacks3to4: number;
|
|
44
|
+
/** Max RVF/SQLite write latency ratio for stage 3→4 (default: 1.5) */
|
|
45
|
+
maxWriteLatencyRatio3to4: number;
|
|
46
|
+
/** Minimum checks required in window before gate can pass (default: 10) */
|
|
47
|
+
minChecksRequired: number;
|
|
48
|
+
}
|
|
49
|
+
export declare class RvfStageGate {
|
|
50
|
+
private readonly config;
|
|
51
|
+
private witnessChain;
|
|
52
|
+
constructor(config?: Partial<StageGateConfig>);
|
|
53
|
+
/** Attach witness chain for audit trail of promotions */
|
|
54
|
+
setWitnessChain(wc: WitnessChain): void;
|
|
55
|
+
/**
|
|
56
|
+
* Evaluate whether promotion from currentStage to currentStage+1 is allowed.
|
|
57
|
+
*/
|
|
58
|
+
evaluate(currentStage: MigrationStage, validator: RvfConsistencyValidator, metrics: MigrationMetrics): StageGateResult;
|
|
59
|
+
/**
|
|
60
|
+
* Attempt to promote to the next stage. Returns the new stage if successful.
|
|
61
|
+
* Records the promotion (or block) in the witness chain.
|
|
62
|
+
*/
|
|
63
|
+
promote(currentStage: MigrationStage, validator: RvfConsistencyValidator, metrics: MigrationMetrics, force?: boolean): {
|
|
64
|
+
promoted: boolean;
|
|
65
|
+
newStage: MigrationStage;
|
|
66
|
+
result: StageGateResult;
|
|
67
|
+
};
|
|
68
|
+
private recordWitness;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=rvf-stage-gate.d.ts.map
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Stage Gate Enforcer (ADR-072)
|
|
3
|
+
*
|
|
4
|
+
* Enforces go/no-go criteria for promoting the RVF migration stage.
|
|
5
|
+
* Each stage transition has specific requirements that must be met
|
|
6
|
+
* before promotion is allowed.
|
|
7
|
+
*
|
|
8
|
+
* Stage gates (from ADR-072):
|
|
9
|
+
* Stage 2→3: divergence <0.01% over 7 days, RVF read latency <2x SQLite
|
|
10
|
+
* Stage 3→4: zero fallbacks over 14 days, RVF write latency <1.5x SQLite
|
|
11
|
+
*
|
|
12
|
+
* Supports manual override with witness chain recording for audit trail.
|
|
13
|
+
*
|
|
14
|
+
* @module persistence/rvf-stage-gate
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_CONFIG = {
|
|
17
|
+
maxDivergenceRate2to3: 0.0001, // 0.01%
|
|
18
|
+
maxReadLatencyRatio2to3: 2.0,
|
|
19
|
+
maxFallbacks3to4: 0,
|
|
20
|
+
maxWriteLatencyRatio3to4: 1.5,
|
|
21
|
+
minChecksRequired: 10,
|
|
22
|
+
};
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// RvfStageGate
|
|
25
|
+
// ============================================================================
|
|
26
|
+
export class RvfStageGate {
|
|
27
|
+
config;
|
|
28
|
+
witnessChain = null;
|
|
29
|
+
constructor(config) {
|
|
30
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
31
|
+
}
|
|
32
|
+
/** Attach witness chain for audit trail of promotions */
|
|
33
|
+
setWitnessChain(wc) {
|
|
34
|
+
this.witnessChain = wc;
|
|
35
|
+
}
|
|
36
|
+
// --------------------------------------------------------------------------
|
|
37
|
+
// Gate Evaluation
|
|
38
|
+
// --------------------------------------------------------------------------
|
|
39
|
+
/**
|
|
40
|
+
* Evaluate whether promotion from currentStage to currentStage+1 is allowed.
|
|
41
|
+
*/
|
|
42
|
+
evaluate(currentStage, validator, metrics) {
|
|
43
|
+
const targetStage = Math.min(currentStage + 1, 4);
|
|
44
|
+
if (currentStage >= 4) {
|
|
45
|
+
return {
|
|
46
|
+
canPromote: false,
|
|
47
|
+
currentStage,
|
|
48
|
+
targetStage: 4,
|
|
49
|
+
checks: [],
|
|
50
|
+
summary: 'Already at maximum stage (4: RVF primary)',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (currentStage < 2) {
|
|
54
|
+
// Stages 0→1 and 1→2 don't have automated gates
|
|
55
|
+
return {
|
|
56
|
+
canPromote: true,
|
|
57
|
+
currentStage,
|
|
58
|
+
targetStage,
|
|
59
|
+
checks: [],
|
|
60
|
+
summary: `Stage ${currentStage}→${targetStage} has no automated gates — manual promotion allowed`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const checks = [];
|
|
64
|
+
if (currentStage === 2) {
|
|
65
|
+
// Stage 2→3: divergence + read latency
|
|
66
|
+
const divergenceRate = validator.getRollingDivergenceRate();
|
|
67
|
+
const checkCount = validator.getCheckCount();
|
|
68
|
+
checks.push({
|
|
69
|
+
name: 'consistency-checks-count',
|
|
70
|
+
passed: checkCount >= this.config.minChecksRequired,
|
|
71
|
+
actual: `${checkCount} checks`,
|
|
72
|
+
threshold: `>= ${this.config.minChecksRequired} checks`,
|
|
73
|
+
});
|
|
74
|
+
checks.push({
|
|
75
|
+
name: 'divergence-rate',
|
|
76
|
+
passed: divergenceRate <= this.config.maxDivergenceRate2to3,
|
|
77
|
+
actual: `${(divergenceRate * 100).toFixed(4)}%`,
|
|
78
|
+
threshold: `<= ${(this.config.maxDivergenceRate2to3 * 100).toFixed(4)}%`,
|
|
79
|
+
});
|
|
80
|
+
const latencyRatio = metrics.sqliteReadLatencyAvgMs > 0
|
|
81
|
+
? metrics.rvfReadLatencyAvgMs / metrics.sqliteReadLatencyAvgMs
|
|
82
|
+
: 0;
|
|
83
|
+
checks.push({
|
|
84
|
+
name: 'read-latency-ratio',
|
|
85
|
+
passed: latencyRatio <= this.config.maxReadLatencyRatio2to3 || metrics.rvfReadLatencyAvgMs === 0,
|
|
86
|
+
actual: `${latencyRatio.toFixed(2)}x`,
|
|
87
|
+
threshold: `<= ${this.config.maxReadLatencyRatio2to3}x`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (currentStage === 3) {
|
|
91
|
+
// Stage 3→4: zero fallbacks + write latency
|
|
92
|
+
checks.push({
|
|
93
|
+
name: 'fallback-count',
|
|
94
|
+
passed: metrics.fallbacksUsed <= this.config.maxFallbacks3to4,
|
|
95
|
+
actual: `${metrics.fallbacksUsed} fallbacks`,
|
|
96
|
+
threshold: `<= ${this.config.maxFallbacks3to4} fallbacks`,
|
|
97
|
+
});
|
|
98
|
+
// Use write latency metrics when available, fall back to read latency as proxy
|
|
99
|
+
const sqliteWriteAvg = metrics.sqliteWriteLatencyAvgMs ?? metrics.sqliteReadLatencyAvgMs;
|
|
100
|
+
const rvfWriteAvg = metrics.rvfWriteLatencyAvgMs ?? metrics.rvfReadLatencyAvgMs;
|
|
101
|
+
const writeLatencyRatio = sqliteWriteAvg > 0 ? rvfWriteAvg / sqliteWriteAvg : 0;
|
|
102
|
+
checks.push({
|
|
103
|
+
name: 'write-latency-ratio',
|
|
104
|
+
passed: writeLatencyRatio <= this.config.maxWriteLatencyRatio3to4 || rvfWriteAvg === 0,
|
|
105
|
+
actual: `${writeLatencyRatio.toFixed(2)}x`,
|
|
106
|
+
threshold: `<= ${this.config.maxWriteLatencyRatio3to4}x`,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const canPromote = checks.length > 0 && checks.every(c => c.passed);
|
|
110
|
+
const failedChecks = checks.filter(c => !c.passed).map(c => c.name);
|
|
111
|
+
return {
|
|
112
|
+
canPromote,
|
|
113
|
+
currentStage,
|
|
114
|
+
targetStage,
|
|
115
|
+
checks,
|
|
116
|
+
summary: canPromote
|
|
117
|
+
? `All gates passed — safe to promote to stage ${targetStage}`
|
|
118
|
+
: `Blocked: ${failedChecks.join(', ')} failed`,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
// --------------------------------------------------------------------------
|
|
122
|
+
// Promotion
|
|
123
|
+
// --------------------------------------------------------------------------
|
|
124
|
+
/**
|
|
125
|
+
* Attempt to promote to the next stage. Returns the new stage if successful.
|
|
126
|
+
* Records the promotion (or block) in the witness chain.
|
|
127
|
+
*/
|
|
128
|
+
promote(currentStage, validator, metrics, force = false) {
|
|
129
|
+
const result = this.evaluate(currentStage, validator, metrics);
|
|
130
|
+
if (!result.canPromote && !force) {
|
|
131
|
+
this.recordWitness('QUALITY_GATE_FAIL', {
|
|
132
|
+
action: 'stage-promotion-blocked',
|
|
133
|
+
from: currentStage,
|
|
134
|
+
to: result.targetStage,
|
|
135
|
+
failedChecks: result.checks.filter(c => !c.passed),
|
|
136
|
+
summary: result.summary,
|
|
137
|
+
});
|
|
138
|
+
return { promoted: false, newStage: currentStage, result };
|
|
139
|
+
}
|
|
140
|
+
const newStage = result.targetStage;
|
|
141
|
+
this.recordWitness(force ? 'QUALITY_GATE_PASS' : 'QUALITY_GATE_PASS', {
|
|
142
|
+
action: force ? 'stage-promotion-forced' : 'stage-promotion-approved',
|
|
143
|
+
from: currentStage,
|
|
144
|
+
to: newStage,
|
|
145
|
+
checks: result.checks,
|
|
146
|
+
forced: force,
|
|
147
|
+
summary: result.summary,
|
|
148
|
+
});
|
|
149
|
+
return { promoted: true, newStage, result };
|
|
150
|
+
}
|
|
151
|
+
// --------------------------------------------------------------------------
|
|
152
|
+
// Private
|
|
153
|
+
// --------------------------------------------------------------------------
|
|
154
|
+
recordWitness(actionType, data) {
|
|
155
|
+
try {
|
|
156
|
+
this.witnessChain?.append(actionType, data, 'rvf-stage-gate');
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
// Witness recording is best-effort
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=rvf-stage-gate.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Plugin Cache (IMP-09)
|
|
3
|
+
*
|
|
4
|
+
* Versioned immutable cache for installed plugins.
|
|
5
|
+
* Stores plugins at `.agentic-qe/plugins/{name}@{version}/`.
|
|
6
|
+
* Once cached, a version is never modified — only new versions are added.
|
|
7
|
+
*/
|
|
8
|
+
import type { QEPluginManifest } from './manifest';
|
|
9
|
+
export interface CachedPlugin {
|
|
10
|
+
manifest: QEPluginManifest;
|
|
11
|
+
path: string;
|
|
12
|
+
cachedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PluginCacheOptions {
|
|
15
|
+
/** Base directory for the plugin cache (default: .agentic-qe/plugins) */
|
|
16
|
+
cacheDir?: string;
|
|
17
|
+
/** Number of old versions to keep per plugin (default: 2) */
|
|
18
|
+
keepVersions?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class PluginCache {
|
|
21
|
+
private readonly cacheDir;
|
|
22
|
+
private readonly keepVersions;
|
|
23
|
+
constructor(options?: PluginCacheOptions);
|
|
24
|
+
/** Check if a specific version is cached. */
|
|
25
|
+
has(name: string, version: string): boolean;
|
|
26
|
+
/** Get the cached path for a plugin version, or undefined if not cached. */
|
|
27
|
+
get(name: string, version: string): CachedPlugin | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Store a plugin in the cache by copying from a source directory.
|
|
30
|
+
* Returns the cache path. If already cached, returns the existing path
|
|
31
|
+
* (immutable — no overwrite).
|
|
32
|
+
*/
|
|
33
|
+
store(manifest: QEPluginManifest, sourceDir: string): string;
|
|
34
|
+
/** Remove a specific cached version. */
|
|
35
|
+
remove(name: string, version: string): boolean;
|
|
36
|
+
/** List all cached versions for a plugin. */
|
|
37
|
+
listVersions(name: string): CachedPlugin[];
|
|
38
|
+
/** List all cached plugins (latest version of each). */
|
|
39
|
+
listAll(): CachedPlugin[];
|
|
40
|
+
private versionDir;
|
|
41
|
+
private pruneOldVersions;
|
|
42
|
+
private copyDir;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=cache.d.ts.map
|