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,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Consistency Validator (ADR-072)
|
|
3
|
+
*
|
|
4
|
+
* Periodically samples reads from both SQLite and RVF engines, compares
|
|
5
|
+
* results, and tracks divergence rate over a rolling window. Monitors
|
|
6
|
+
* RVF deadSpaceRatio and triggers compaction when needed.
|
|
7
|
+
*
|
|
8
|
+
* Used by RvfStageGate to make go/no-go decisions for stage promotion.
|
|
9
|
+
*
|
|
10
|
+
* @module persistence/rvf-consistency-validator
|
|
11
|
+
*/
|
|
12
|
+
import type { RvfStore } from '../integrations/ruvector/rvf-dual-writer.js';
|
|
13
|
+
export interface ConsistencyCheckResult {
|
|
14
|
+
/** Timestamp of the check */
|
|
15
|
+
timestamp: number;
|
|
16
|
+
/** Number of samples compared */
|
|
17
|
+
samplesChecked: number;
|
|
18
|
+
/** Number of divergences found */
|
|
19
|
+
divergences: number;
|
|
20
|
+
/** Divergence rate (0-1) */
|
|
21
|
+
divergenceRate: number;
|
|
22
|
+
/** Details of any divergences */
|
|
23
|
+
details: DivergenceDetail[];
|
|
24
|
+
/** RVF dead space ratio (if available) */
|
|
25
|
+
deadSpaceRatio: number | null;
|
|
26
|
+
/** Whether compaction was triggered */
|
|
27
|
+
compactionTriggered: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface DivergenceDetail {
|
|
30
|
+
patternId: string;
|
|
31
|
+
issue: 'missing-in-rvf' | 'missing-in-sqlite' | 'score-mismatch';
|
|
32
|
+
sqliteScore?: number;
|
|
33
|
+
rvfScore?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ValidatorConfig {
|
|
36
|
+
/** Number of random samples per check (default: 50) */
|
|
37
|
+
sampleSize: number;
|
|
38
|
+
/** Rolling window duration in ms (default: 7 days) */
|
|
39
|
+
windowDurationMs: number;
|
|
40
|
+
/** Dead space ratio threshold to trigger compaction (default: 0.3) */
|
|
41
|
+
compactionThreshold: number;
|
|
42
|
+
/** Score difference threshold to count as divergence (default: 0.05) */
|
|
43
|
+
scoreTolerance: number;
|
|
44
|
+
}
|
|
45
|
+
interface SqliteDb {
|
|
46
|
+
prepare(sql: string): {
|
|
47
|
+
run(...params: unknown[]): {
|
|
48
|
+
changes: number;
|
|
49
|
+
};
|
|
50
|
+
get(...params: unknown[]): unknown;
|
|
51
|
+
all(...params: unknown[]): unknown[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export declare class RvfConsistencyValidator {
|
|
55
|
+
private readonly config;
|
|
56
|
+
private db;
|
|
57
|
+
private rvfStore;
|
|
58
|
+
private history;
|
|
59
|
+
constructor(config?: Partial<ValidatorConfig>);
|
|
60
|
+
setSqliteDb(db: SqliteDb): void;
|
|
61
|
+
setRvfStore(store: RvfStore): void;
|
|
62
|
+
/**
|
|
63
|
+
* Run a consistency check by sampling random pattern IDs from SQLite,
|
|
64
|
+
* searching for them in both engines, and comparing results.
|
|
65
|
+
*/
|
|
66
|
+
runCheck(): ConsistencyCheckResult;
|
|
67
|
+
/**
|
|
68
|
+
* Get the aggregate divergence rate over the rolling window.
|
|
69
|
+
*/
|
|
70
|
+
getRollingDivergenceRate(): number;
|
|
71
|
+
/**
|
|
72
|
+
* Get the number of consistency checks performed in the rolling window.
|
|
73
|
+
*/
|
|
74
|
+
getCheckCount(): number;
|
|
75
|
+
/**
|
|
76
|
+
* Get all check results in the rolling window.
|
|
77
|
+
*/
|
|
78
|
+
getHistory(): ConsistencyCheckResult[];
|
|
79
|
+
private getSampleIds;
|
|
80
|
+
private getSqliteEmbedding;
|
|
81
|
+
private triggerCompaction;
|
|
82
|
+
private pruneHistory;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
85
|
+
//# sourceMappingURL=rvf-consistency-validator.d.ts.map
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Consistency Validator (ADR-072)
|
|
3
|
+
*
|
|
4
|
+
* Periodically samples reads from both SQLite and RVF engines, compares
|
|
5
|
+
* results, and tracks divergence rate over a rolling window. Monitors
|
|
6
|
+
* RVF deadSpaceRatio and triggers compaction when needed.
|
|
7
|
+
*
|
|
8
|
+
* Used by RvfStageGate to make go/no-go decisions for stage promotion.
|
|
9
|
+
*
|
|
10
|
+
* @module persistence/rvf-consistency-validator
|
|
11
|
+
*/
|
|
12
|
+
const DEFAULT_CONFIG = {
|
|
13
|
+
sampleSize: 50,
|
|
14
|
+
windowDurationMs: 7 * 24 * 60 * 60 * 1000, // 7 days
|
|
15
|
+
compactionThreshold: 0.3,
|
|
16
|
+
scoreTolerance: 0.05,
|
|
17
|
+
};
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// RvfConsistencyValidator
|
|
20
|
+
// ============================================================================
|
|
21
|
+
export class RvfConsistencyValidator {
|
|
22
|
+
config;
|
|
23
|
+
db = null;
|
|
24
|
+
rvfStore = null;
|
|
25
|
+
history = [];
|
|
26
|
+
constructor(config) {
|
|
27
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
28
|
+
}
|
|
29
|
+
setSqliteDb(db) { this.db = db; }
|
|
30
|
+
setRvfStore(store) { this.rvfStore = store; }
|
|
31
|
+
// --------------------------------------------------------------------------
|
|
32
|
+
// Consistency Check
|
|
33
|
+
// --------------------------------------------------------------------------
|
|
34
|
+
/**
|
|
35
|
+
* Run a consistency check by sampling random pattern IDs from SQLite,
|
|
36
|
+
* searching for them in both engines, and comparing results.
|
|
37
|
+
*/
|
|
38
|
+
runCheck() {
|
|
39
|
+
const result = {
|
|
40
|
+
timestamp: Date.now(),
|
|
41
|
+
samplesChecked: 0,
|
|
42
|
+
divergences: 0,
|
|
43
|
+
divergenceRate: 0,
|
|
44
|
+
details: [],
|
|
45
|
+
deadSpaceRatio: null,
|
|
46
|
+
compactionTriggered: false,
|
|
47
|
+
};
|
|
48
|
+
if (!this.db || !this.rvfStore) {
|
|
49
|
+
this.history.push(result);
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
// 1. Get random sample of pattern IDs from SQLite
|
|
53
|
+
const sampleIds = this.getSampleIds(this.config.sampleSize);
|
|
54
|
+
result.samplesChecked = sampleIds.length;
|
|
55
|
+
if (sampleIds.length === 0) {
|
|
56
|
+
this.history.push(result);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
// 2. For each sample, get embedding from SQLite and search both engines
|
|
60
|
+
for (const patternId of sampleIds) {
|
|
61
|
+
const embedding = this.getSqliteEmbedding(patternId);
|
|
62
|
+
if (!embedding) {
|
|
63
|
+
result.divergences++;
|
|
64
|
+
result.details.push({ patternId, issue: 'missing-in-sqlite' });
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
// Search RVF
|
|
68
|
+
try {
|
|
69
|
+
const rvfResults = this.rvfStore.search(embedding, 1);
|
|
70
|
+
if (rvfResults.length === 0) {
|
|
71
|
+
result.divergences++;
|
|
72
|
+
result.details.push({ patternId, issue: 'missing-in-rvf' });
|
|
73
|
+
}
|
|
74
|
+
// If RVF returns results, check that the top result ID matches
|
|
75
|
+
// (self-search should return the same pattern as top-1)
|
|
76
|
+
else if (rvfResults[0].id !== patternId && rvfResults[0].score < 0.99) {
|
|
77
|
+
result.divergences++;
|
|
78
|
+
result.details.push({
|
|
79
|
+
patternId,
|
|
80
|
+
issue: 'score-mismatch',
|
|
81
|
+
rvfScore: rvfResults[0].score,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
result.divergences++;
|
|
87
|
+
result.details.push({ patternId, issue: 'missing-in-rvf' });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
result.divergenceRate = result.samplesChecked > 0
|
|
91
|
+
? result.divergences / result.samplesChecked
|
|
92
|
+
: 0;
|
|
93
|
+
// 3. Check dead space ratio and trigger compaction if needed
|
|
94
|
+
try {
|
|
95
|
+
const rvfStatus = this.rvfStore.status();
|
|
96
|
+
const deadSpace = rvfStatus.deadSpaceRatio;
|
|
97
|
+
result.deadSpaceRatio = deadSpace ?? null;
|
|
98
|
+
if (deadSpace != null && deadSpace > this.config.compactionThreshold) {
|
|
99
|
+
this.triggerCompaction();
|
|
100
|
+
result.compactionTriggered = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// Status check is best-effort
|
|
105
|
+
}
|
|
106
|
+
// 4. Add to history and prune old entries
|
|
107
|
+
this.history.push(result);
|
|
108
|
+
this.pruneHistory();
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
// --------------------------------------------------------------------------
|
|
112
|
+
// Rolling Window Metrics
|
|
113
|
+
// --------------------------------------------------------------------------
|
|
114
|
+
/**
|
|
115
|
+
* Get the aggregate divergence rate over the rolling window.
|
|
116
|
+
*/
|
|
117
|
+
getRollingDivergenceRate() {
|
|
118
|
+
const windowStart = Date.now() - this.config.windowDurationMs;
|
|
119
|
+
const inWindow = this.history.filter(h => h.timestamp >= windowStart);
|
|
120
|
+
if (inWindow.length === 0)
|
|
121
|
+
return 0;
|
|
122
|
+
const totalSamples = inWindow.reduce((s, h) => s + h.samplesChecked, 0);
|
|
123
|
+
const totalDivergences = inWindow.reduce((s, h) => s + h.divergences, 0);
|
|
124
|
+
return totalSamples > 0 ? totalDivergences / totalSamples : 0;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get the number of consistency checks performed in the rolling window.
|
|
128
|
+
*/
|
|
129
|
+
getCheckCount() {
|
|
130
|
+
const windowStart = Date.now() - this.config.windowDurationMs;
|
|
131
|
+
return this.history.filter(h => h.timestamp >= windowStart).length;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get all check results in the rolling window.
|
|
135
|
+
*/
|
|
136
|
+
getHistory() {
|
|
137
|
+
const windowStart = Date.now() - this.config.windowDurationMs;
|
|
138
|
+
return this.history.filter(h => h.timestamp >= windowStart);
|
|
139
|
+
}
|
|
140
|
+
// --------------------------------------------------------------------------
|
|
141
|
+
// Private
|
|
142
|
+
// --------------------------------------------------------------------------
|
|
143
|
+
getSampleIds(count) {
|
|
144
|
+
if (!this.db)
|
|
145
|
+
return [];
|
|
146
|
+
try {
|
|
147
|
+
const rows = this.db.prepare(`SELECT pattern_id FROM qe_pattern_embeddings ORDER BY RANDOM() LIMIT ?`).all(count);
|
|
148
|
+
return rows.map(r => r.pattern_id);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
getSqliteEmbedding(patternId) {
|
|
155
|
+
if (!this.db)
|
|
156
|
+
return null;
|
|
157
|
+
try {
|
|
158
|
+
const row = this.db.prepare('SELECT embedding, dimension FROM qe_pattern_embeddings WHERE pattern_id = ?').get(patternId);
|
|
159
|
+
if (!row)
|
|
160
|
+
return null;
|
|
161
|
+
return new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.dimension);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
triggerCompaction() {
|
|
168
|
+
// RVF compaction via the store's compact method (if available)
|
|
169
|
+
try {
|
|
170
|
+
const store = this.rvfStore;
|
|
171
|
+
store.compact?.();
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// Compaction is best-effort
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
pruneHistory() {
|
|
178
|
+
const cutoff = Date.now() - this.config.windowDurationMs;
|
|
179
|
+
this.history = this.history.filter(h => h.timestamp >= cutoff);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=rvf-consistency-validator.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Migration Adapter (ADR-072)
|
|
3
|
+
*
|
|
4
|
+
* Extends RvfDualWriter concepts to all persistence operations (KV, Q-values,
|
|
5
|
+
* GOAP state). Routes reads and writes based on the rvfMigrationStage config:
|
|
6
|
+
*
|
|
7
|
+
* Stage 0: SQLite only (legacy)
|
|
8
|
+
* Stage 1: Hybrid (current — vectors in RVF, metadata in SQLite)
|
|
9
|
+
* Stage 2: Dual-write, read from SQLite (both engines receive writes)
|
|
10
|
+
* Stage 3: Dual-write, read from RVF (both engines receive writes)
|
|
11
|
+
* Stage 4: RVF primary, SQLite escape hatch
|
|
12
|
+
*
|
|
13
|
+
* Each stage is reversible by changing the config — no data is lost.
|
|
14
|
+
*
|
|
15
|
+
* @module persistence/rvf-migration-adapter
|
|
16
|
+
*/
|
|
17
|
+
import type { RvfStore, RvfStatus } from '../integrations/ruvector/rvf-dual-writer.js';
|
|
18
|
+
export type MigrationStage = 0 | 1 | 2 | 3 | 4;
|
|
19
|
+
export declare const STAGE_NAMES: Record<MigrationStage, string>;
|
|
20
|
+
export interface MigrationAdapterConfig {
|
|
21
|
+
/** Current migration stage */
|
|
22
|
+
stage: MigrationStage;
|
|
23
|
+
/** Path to RVF container */
|
|
24
|
+
rvfPath: string;
|
|
25
|
+
/** Vector dimensions (default: 384) */
|
|
26
|
+
dimensions: number;
|
|
27
|
+
/** Enable fallback on RVF read failure in stage 3+ */
|
|
28
|
+
enableFallback: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface WriteResult {
|
|
31
|
+
sqliteSuccess: boolean;
|
|
32
|
+
rvfSuccess: boolean;
|
|
33
|
+
stage: MigrationStage;
|
|
34
|
+
fallbackUsed: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ReadResult<T> {
|
|
37
|
+
data: T | null;
|
|
38
|
+
source: 'sqlite' | 'rvf' | 'fallback';
|
|
39
|
+
latencyMs: number;
|
|
40
|
+
stage: MigrationStage;
|
|
41
|
+
}
|
|
42
|
+
export interface MigrationMetrics {
|
|
43
|
+
stage: MigrationStage;
|
|
44
|
+
stageName: string;
|
|
45
|
+
totalWrites: number;
|
|
46
|
+
totalReads: number;
|
|
47
|
+
rvfWriteFailures: number;
|
|
48
|
+
rvfReadFailures: number;
|
|
49
|
+
fallbacksUsed: number;
|
|
50
|
+
sqliteReadLatencyAvgMs: number;
|
|
51
|
+
rvfReadLatencyAvgMs: number;
|
|
52
|
+
sqliteWriteLatencyAvgMs: number;
|
|
53
|
+
rvfWriteLatencyAvgMs: number;
|
|
54
|
+
}
|
|
55
|
+
interface SqliteDb {
|
|
56
|
+
prepare(sql: string): {
|
|
57
|
+
run(...params: unknown[]): {
|
|
58
|
+
changes: number;
|
|
59
|
+
};
|
|
60
|
+
get(...params: unknown[]): unknown;
|
|
61
|
+
all(...params: unknown[]): unknown[];
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export declare class RvfMigrationAdapter {
|
|
65
|
+
private config;
|
|
66
|
+
private db;
|
|
67
|
+
private rvfStore;
|
|
68
|
+
private totalWrites;
|
|
69
|
+
private totalReads;
|
|
70
|
+
private rvfWriteFailures;
|
|
71
|
+
private rvfReadFailures;
|
|
72
|
+
private fallbacksUsed;
|
|
73
|
+
private sqliteLatencies;
|
|
74
|
+
private rvfLatencies;
|
|
75
|
+
private sqliteWriteLatencies;
|
|
76
|
+
private rvfWriteLatencies;
|
|
77
|
+
constructor(config: Partial<MigrationAdapterConfig> & {
|
|
78
|
+
stage: MigrationStage;
|
|
79
|
+
});
|
|
80
|
+
/** Attach a SQLite database handle */
|
|
81
|
+
setSqliteDb(db: SqliteDb): void;
|
|
82
|
+
/** Attach an RVF store */
|
|
83
|
+
setRvfStore(store: RvfStore): void;
|
|
84
|
+
/** Get current migration stage */
|
|
85
|
+
get stage(): MigrationStage;
|
|
86
|
+
/** Update migration stage (called by coordinator on promotion) */
|
|
87
|
+
setStage(stage: MigrationStage): void;
|
|
88
|
+
/**
|
|
89
|
+
* Write a vector to the appropriate store(s) based on migration stage.
|
|
90
|
+
*
|
|
91
|
+
* Stage 0-1: SQLite only (vectors as BLOBs or hybrid)
|
|
92
|
+
* Stage 2-3: Both engines receive writes
|
|
93
|
+
* Stage 4: RVF only, SQLite escape hatch on failure
|
|
94
|
+
*/
|
|
95
|
+
write(id: string, vector: Float32Array | number[]): WriteResult;
|
|
96
|
+
/**
|
|
97
|
+
* Delete a vector from the appropriate store(s).
|
|
98
|
+
*/
|
|
99
|
+
delete(id: string): WriteResult;
|
|
100
|
+
/**
|
|
101
|
+
* Search for similar vectors, routing to the appropriate engine.
|
|
102
|
+
*
|
|
103
|
+
* Stage 0-2: Read from SQLite
|
|
104
|
+
* Stage 3-4: Read from RVF, fallback to SQLite on error
|
|
105
|
+
*/
|
|
106
|
+
search(query: Float32Array | number[], k: number): ReadResult<Array<{
|
|
107
|
+
id: string;
|
|
108
|
+
score: number;
|
|
109
|
+
}>>;
|
|
110
|
+
/** Get combined status from both engines */
|
|
111
|
+
status(): {
|
|
112
|
+
sqlite: {
|
|
113
|
+
vectorCount: number;
|
|
114
|
+
};
|
|
115
|
+
rvf: RvfStatus | null;
|
|
116
|
+
stage: MigrationStage;
|
|
117
|
+
};
|
|
118
|
+
/** Get aggregated migration metrics */
|
|
119
|
+
getMetrics(): MigrationMetrics;
|
|
120
|
+
/** Reset metrics counters */
|
|
121
|
+
resetMetrics(): void;
|
|
122
|
+
private searchSqlite;
|
|
123
|
+
}
|
|
124
|
+
export {};
|
|
125
|
+
//# sourceMappingURL=rvf-migration-adapter.d.ts.map
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RVF Migration Adapter (ADR-072)
|
|
3
|
+
*
|
|
4
|
+
* Extends RvfDualWriter concepts to all persistence operations (KV, Q-values,
|
|
5
|
+
* GOAP state). Routes reads and writes based on the rvfMigrationStage config:
|
|
6
|
+
*
|
|
7
|
+
* Stage 0: SQLite only (legacy)
|
|
8
|
+
* Stage 1: Hybrid (current — vectors in RVF, metadata in SQLite)
|
|
9
|
+
* Stage 2: Dual-write, read from SQLite (both engines receive writes)
|
|
10
|
+
* Stage 3: Dual-write, read from RVF (both engines receive writes)
|
|
11
|
+
* Stage 4: RVF primary, SQLite escape hatch
|
|
12
|
+
*
|
|
13
|
+
* Each stage is reversible by changing the config — no data is lost.
|
|
14
|
+
*
|
|
15
|
+
* @module persistence/rvf-migration-adapter
|
|
16
|
+
*/
|
|
17
|
+
export const STAGE_NAMES = {
|
|
18
|
+
0: 'sqlite-only',
|
|
19
|
+
1: 'hybrid',
|
|
20
|
+
2: 'dual-write-sqlite-primary',
|
|
21
|
+
3: 'dual-write-rvf-primary',
|
|
22
|
+
4: 'rvf-primary',
|
|
23
|
+
};
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// RvfMigrationAdapter
|
|
26
|
+
// ============================================================================
|
|
27
|
+
export class RvfMigrationAdapter {
|
|
28
|
+
config;
|
|
29
|
+
db = null;
|
|
30
|
+
rvfStore = null;
|
|
31
|
+
// Metrics tracking
|
|
32
|
+
totalWrites = 0;
|
|
33
|
+
totalReads = 0;
|
|
34
|
+
rvfWriteFailures = 0;
|
|
35
|
+
rvfReadFailures = 0;
|
|
36
|
+
fallbacksUsed = 0;
|
|
37
|
+
sqliteLatencies = [];
|
|
38
|
+
rvfLatencies = [];
|
|
39
|
+
sqliteWriteLatencies = [];
|
|
40
|
+
rvfWriteLatencies = [];
|
|
41
|
+
constructor(config) {
|
|
42
|
+
this.config = {
|
|
43
|
+
rvfPath: '.agentic-qe/patterns.rvf',
|
|
44
|
+
dimensions: 384,
|
|
45
|
+
enableFallback: true,
|
|
46
|
+
...config,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Attach a SQLite database handle */
|
|
50
|
+
setSqliteDb(db) {
|
|
51
|
+
this.db = db;
|
|
52
|
+
}
|
|
53
|
+
/** Attach an RVF store */
|
|
54
|
+
setRvfStore(store) {
|
|
55
|
+
this.rvfStore = store;
|
|
56
|
+
}
|
|
57
|
+
/** Get current migration stage */
|
|
58
|
+
get stage() {
|
|
59
|
+
return this.config.stage;
|
|
60
|
+
}
|
|
61
|
+
/** Update migration stage (called by coordinator on promotion) */
|
|
62
|
+
setStage(stage) {
|
|
63
|
+
this.config = { ...this.config, stage };
|
|
64
|
+
}
|
|
65
|
+
// --------------------------------------------------------------------------
|
|
66
|
+
// Write Operations
|
|
67
|
+
// --------------------------------------------------------------------------
|
|
68
|
+
/**
|
|
69
|
+
* Write a vector to the appropriate store(s) based on migration stage.
|
|
70
|
+
*
|
|
71
|
+
* Stage 0-1: SQLite only (vectors as BLOBs or hybrid)
|
|
72
|
+
* Stage 2-3: Both engines receive writes
|
|
73
|
+
* Stage 4: RVF only, SQLite escape hatch on failure
|
|
74
|
+
*/
|
|
75
|
+
write(id, vector) {
|
|
76
|
+
this.totalWrites++;
|
|
77
|
+
const result = {
|
|
78
|
+
sqliteSuccess: false,
|
|
79
|
+
rvfSuccess: false,
|
|
80
|
+
stage: this.config.stage,
|
|
81
|
+
fallbackUsed: false,
|
|
82
|
+
};
|
|
83
|
+
const shouldWriteSqlite = this.config.stage < 4;
|
|
84
|
+
const shouldWriteRvf = this.config.stage >= 2;
|
|
85
|
+
// Write to SQLite
|
|
86
|
+
if (shouldWriteSqlite && this.db) {
|
|
87
|
+
const start = performance.now();
|
|
88
|
+
try {
|
|
89
|
+
const blob = Buffer.from(vector instanceof Float32Array ? vector.buffer : new Float32Array(vector).buffer);
|
|
90
|
+
this.db.prepare(`
|
|
91
|
+
INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
|
|
92
|
+
VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
|
|
93
|
+
ON CONFLICT(pattern_id) DO UPDATE SET
|
|
94
|
+
embedding = excluded.embedding, dimension = excluded.dimension, created_at = datetime('now')
|
|
95
|
+
`).run(id, blob, vector.length);
|
|
96
|
+
result.sqliteSuccess = true;
|
|
97
|
+
this.sqliteWriteLatencies.push(performance.now() - start);
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
result.sqliteSuccess = false;
|
|
101
|
+
if (process.env.AQE_DEBUG_MIGRATION) {
|
|
102
|
+
console.warn('[RVF-Migration] SQLite write failed:', err.message);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Write to RVF
|
|
107
|
+
if (shouldWriteRvf && this.rvfStore) {
|
|
108
|
+
const start = performance.now();
|
|
109
|
+
try {
|
|
110
|
+
this.rvfStore.ingest([{ id, vector }]);
|
|
111
|
+
result.rvfSuccess = true;
|
|
112
|
+
this.rvfWriteLatencies.push(performance.now() - start);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
this.rvfWriteFailures++;
|
|
116
|
+
result.rvfSuccess = false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Stage 4: If RVF write failed, fall back to SQLite
|
|
120
|
+
if (this.config.stage === 4 && !result.rvfSuccess && this.config.enableFallback && this.db) {
|
|
121
|
+
try {
|
|
122
|
+
const blob = Buffer.from(vector instanceof Float32Array ? vector.buffer : new Float32Array(vector).buffer);
|
|
123
|
+
this.db.prepare(`
|
|
124
|
+
INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
|
|
125
|
+
VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
|
|
126
|
+
ON CONFLICT(pattern_id) DO UPDATE SET
|
|
127
|
+
embedding = excluded.embedding, dimension = excluded.dimension, created_at = datetime('now')
|
|
128
|
+
`).run(id, blob, vector.length);
|
|
129
|
+
result.sqliteSuccess = true;
|
|
130
|
+
result.fallbackUsed = true;
|
|
131
|
+
this.fallbacksUsed++;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
// Both engines failed
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Delete a vector from the appropriate store(s).
|
|
141
|
+
*/
|
|
142
|
+
delete(id) {
|
|
143
|
+
this.totalWrites++;
|
|
144
|
+
const result = {
|
|
145
|
+
sqliteSuccess: false,
|
|
146
|
+
rvfSuccess: false,
|
|
147
|
+
stage: this.config.stage,
|
|
148
|
+
fallbackUsed: false,
|
|
149
|
+
};
|
|
150
|
+
if (this.config.stage < 4 && this.db) {
|
|
151
|
+
try {
|
|
152
|
+
this.db.prepare('DELETE FROM qe_pattern_embeddings WHERE pattern_id = ?').run(id);
|
|
153
|
+
result.sqliteSuccess = true;
|
|
154
|
+
}
|
|
155
|
+
catch { /* best effort */ }
|
|
156
|
+
}
|
|
157
|
+
if (this.config.stage >= 2 && this.rvfStore) {
|
|
158
|
+
try {
|
|
159
|
+
this.rvfStore.delete([id]);
|
|
160
|
+
result.rvfSuccess = true;
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
this.rvfWriteFailures++;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
// --------------------------------------------------------------------------
|
|
169
|
+
// Read Operations
|
|
170
|
+
// --------------------------------------------------------------------------
|
|
171
|
+
/**
|
|
172
|
+
* Search for similar vectors, routing to the appropriate engine.
|
|
173
|
+
*
|
|
174
|
+
* Stage 0-2: Read from SQLite
|
|
175
|
+
* Stage 3-4: Read from RVF, fallback to SQLite on error
|
|
176
|
+
*/
|
|
177
|
+
search(query, k) {
|
|
178
|
+
this.totalReads++;
|
|
179
|
+
const useRvf = this.config.stage >= 3;
|
|
180
|
+
if (useRvf && this.rvfStore) {
|
|
181
|
+
const start = performance.now();
|
|
182
|
+
try {
|
|
183
|
+
const results = this.rvfStore.search(query, k);
|
|
184
|
+
const latency = performance.now() - start;
|
|
185
|
+
this.rvfLatencies.push(latency);
|
|
186
|
+
return { data: results, source: 'rvf', latencyMs: latency, stage: this.config.stage };
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
this.rvfReadFailures++;
|
|
190
|
+
// Fall through to SQLite if fallback enabled
|
|
191
|
+
if (!this.config.enableFallback) {
|
|
192
|
+
return { data: null, source: 'rvf', latencyMs: 0, stage: this.config.stage };
|
|
193
|
+
}
|
|
194
|
+
this.fallbacksUsed++;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// SQLite read (stages 0-2 or fallback)
|
|
198
|
+
const start = performance.now();
|
|
199
|
+
const results = this.searchSqlite(query, k);
|
|
200
|
+
const latency = performance.now() - start;
|
|
201
|
+
this.sqliteLatencies.push(latency);
|
|
202
|
+
return {
|
|
203
|
+
data: results,
|
|
204
|
+
source: useRvf ? 'fallback' : 'sqlite',
|
|
205
|
+
latencyMs: latency,
|
|
206
|
+
stage: this.config.stage,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// --------------------------------------------------------------------------
|
|
210
|
+
// Status & Metrics
|
|
211
|
+
// --------------------------------------------------------------------------
|
|
212
|
+
/** Get combined status from both engines */
|
|
213
|
+
status() {
|
|
214
|
+
let sqliteCount = 0;
|
|
215
|
+
if (this.db) {
|
|
216
|
+
try {
|
|
217
|
+
const row = this.db.prepare('SELECT COUNT(*) as cnt FROM qe_pattern_embeddings').get();
|
|
218
|
+
sqliteCount = row?.cnt ?? 0;
|
|
219
|
+
}
|
|
220
|
+
catch { /* table may not exist */ }
|
|
221
|
+
}
|
|
222
|
+
let rvfStatus = null;
|
|
223
|
+
if (this.rvfStore) {
|
|
224
|
+
try {
|
|
225
|
+
rvfStatus = this.rvfStore.status();
|
|
226
|
+
}
|
|
227
|
+
catch { /* best effort */ }
|
|
228
|
+
}
|
|
229
|
+
return { sqlite: { vectorCount: sqliteCount }, rvf: rvfStatus, stage: this.config.stage };
|
|
230
|
+
}
|
|
231
|
+
/** Get aggregated migration metrics */
|
|
232
|
+
getMetrics() {
|
|
233
|
+
return {
|
|
234
|
+
stage: this.config.stage,
|
|
235
|
+
stageName: STAGE_NAMES[this.config.stage],
|
|
236
|
+
totalWrites: this.totalWrites,
|
|
237
|
+
totalReads: this.totalReads,
|
|
238
|
+
rvfWriteFailures: this.rvfWriteFailures,
|
|
239
|
+
rvfReadFailures: this.rvfReadFailures,
|
|
240
|
+
fallbacksUsed: this.fallbacksUsed,
|
|
241
|
+
sqliteReadLatencyAvgMs: avg(this.sqliteLatencies),
|
|
242
|
+
rvfReadLatencyAvgMs: avg(this.rvfLatencies),
|
|
243
|
+
sqliteWriteLatencyAvgMs: avg(this.sqliteWriteLatencies),
|
|
244
|
+
rvfWriteLatencyAvgMs: avg(this.rvfWriteLatencies),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/** Reset metrics counters */
|
|
248
|
+
resetMetrics() {
|
|
249
|
+
this.totalWrites = 0;
|
|
250
|
+
this.totalReads = 0;
|
|
251
|
+
this.rvfWriteFailures = 0;
|
|
252
|
+
this.rvfReadFailures = 0;
|
|
253
|
+
this.fallbacksUsed = 0;
|
|
254
|
+
this.sqliteLatencies = [];
|
|
255
|
+
this.rvfLatencies = [];
|
|
256
|
+
this.sqliteWriteLatencies = [];
|
|
257
|
+
this.rvfWriteLatencies = [];
|
|
258
|
+
}
|
|
259
|
+
// --------------------------------------------------------------------------
|
|
260
|
+
// Private
|
|
261
|
+
// --------------------------------------------------------------------------
|
|
262
|
+
searchSqlite(query, k) {
|
|
263
|
+
if (!this.db)
|
|
264
|
+
return [];
|
|
265
|
+
let rows;
|
|
266
|
+
try {
|
|
267
|
+
rows = this.db.prepare('SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings').all();
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
return [];
|
|
271
|
+
}
|
|
272
|
+
const queryArr = query instanceof Float32Array ? Array.from(query) : query;
|
|
273
|
+
const queryMag = Math.sqrt(queryArr.reduce((s, v) => s + v * v, 0));
|
|
274
|
+
if (queryMag === 0)
|
|
275
|
+
return [];
|
|
276
|
+
const scored = [];
|
|
277
|
+
for (const row of rows) {
|
|
278
|
+
if (row.dimension !== queryArr.length)
|
|
279
|
+
continue;
|
|
280
|
+
const stored = new Float32Array(row.embedding.buffer, row.embedding.byteOffset, row.dimension);
|
|
281
|
+
let dot = 0, storedMag = 0;
|
|
282
|
+
for (let i = 0; i < row.dimension; i++) {
|
|
283
|
+
dot += queryArr[i] * stored[i];
|
|
284
|
+
storedMag += stored[i] * stored[i];
|
|
285
|
+
}
|
|
286
|
+
storedMag = Math.sqrt(storedMag);
|
|
287
|
+
if (storedMag === 0)
|
|
288
|
+
continue;
|
|
289
|
+
scored.push({ id: row.pattern_id, score: dot / (queryMag * storedMag) });
|
|
290
|
+
}
|
|
291
|
+
scored.sort((a, b) => b.score - a.score);
|
|
292
|
+
return scored.slice(0, k);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
// ============================================================================
|
|
296
|
+
// Helpers
|
|
297
|
+
// ============================================================================
|
|
298
|
+
function avg(arr) {
|
|
299
|
+
if (arr.length === 0)
|
|
300
|
+
return 0;
|
|
301
|
+
return arr.reduce((s, v) => s + v, 0) / arr.length;
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=rvf-migration-adapter.js.map
|