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,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HNSW Shadow Validator (ADR-071 Phase 2C)
|
|
3
|
+
*
|
|
4
|
+
* Runs search queries against both the old HNSW implementation (brute-force
|
|
5
|
+
* or InMemoryHNSWIndex) and the unified HnswAdapter backend, then compares
|
|
6
|
+
* results to detect divergences before fully decommissioning old code.
|
|
7
|
+
*
|
|
8
|
+
* Use HnswShadowValidator.validate() to run a batch of queries and get a
|
|
9
|
+
* divergence report. A divergence rate <2% is the go-criteria for enabling
|
|
10
|
+
* the useUnifiedHnsw flag.
|
|
11
|
+
*
|
|
12
|
+
* @module kernel/hnsw-shadow-validator
|
|
13
|
+
*/
|
|
14
|
+
import { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// Brute-Force Reference Implementation
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* Simple brute-force cosine search used as ground-truth reference.
|
|
20
|
+
* O(n) per query — accurate but slow.
|
|
21
|
+
*/
|
|
22
|
+
function bruteForceSearch(vectors, query, k) {
|
|
23
|
+
const scored = [];
|
|
24
|
+
for (const [id, vec] of vectors) {
|
|
25
|
+
scored.push({ id, score: cosineSimilarity(query, vec) });
|
|
26
|
+
}
|
|
27
|
+
scored.sort((a, b) => b.score - a.score);
|
|
28
|
+
return scored.slice(0, k);
|
|
29
|
+
}
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// Shadow Validator
|
|
32
|
+
// ============================================================================
|
|
33
|
+
/**
|
|
34
|
+
* Validates that the unified HnswAdapter produces results consistent
|
|
35
|
+
* with a brute-force reference search.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const validator = new HnswShadowValidator(adapter);
|
|
40
|
+
*
|
|
41
|
+
* // Add vectors to both the adapter and the validator's reference store
|
|
42
|
+
* validator.addVector('doc-1', embedding1);
|
|
43
|
+
* validator.addVector('doc-2', embedding2);
|
|
44
|
+
*
|
|
45
|
+
* // Run validation queries
|
|
46
|
+
* const queries = [randomEmbedding(), randomEmbedding()];
|
|
47
|
+
* const result = validator.validate(queries);
|
|
48
|
+
*
|
|
49
|
+
* console.log(`Divergence: ${(result.divergenceRate * 100).toFixed(1)}%`);
|
|
50
|
+
* console.log(`Passes: ${result.passesGoGate}`);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export class HnswShadowValidator {
|
|
54
|
+
adapter;
|
|
55
|
+
referenceVectors = new Map();
|
|
56
|
+
constructor(adapter) {
|
|
57
|
+
this.adapter = adapter;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Add a vector to both the unified adapter and the brute-force reference.
|
|
61
|
+
*/
|
|
62
|
+
addVector(id, vector) {
|
|
63
|
+
this.adapter.addByStringId(id, vector);
|
|
64
|
+
this.referenceVectors.set(id, vector);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Remove a vector from both stores.
|
|
68
|
+
*/
|
|
69
|
+
removeVector(id) {
|
|
70
|
+
this.adapter.removeByStringId(id);
|
|
71
|
+
this.referenceVectors.delete(id);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get the number of vectors in the reference store.
|
|
75
|
+
*/
|
|
76
|
+
get size() {
|
|
77
|
+
return this.referenceVectors.size;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Run N queries against both implementations and compare results.
|
|
81
|
+
*
|
|
82
|
+
* @param queries - Array of query vectors
|
|
83
|
+
* @param options - Validation options
|
|
84
|
+
* @returns Validation result with divergence metrics
|
|
85
|
+
*/
|
|
86
|
+
validate(queries, options = {}) {
|
|
87
|
+
const k = options.k ?? 10;
|
|
88
|
+
const threshold = options.threshold ?? 0.02;
|
|
89
|
+
const divergences = [];
|
|
90
|
+
let totalJaccard = 0;
|
|
91
|
+
let totalScoreDelta = 0;
|
|
92
|
+
let maxScoreDelta = 0;
|
|
93
|
+
for (let qi = 0; qi < queries.length; qi++) {
|
|
94
|
+
const query = queries[qi];
|
|
95
|
+
// Reference: brute-force
|
|
96
|
+
const refResults = bruteForceSearch(this.referenceVectors, query, k);
|
|
97
|
+
const refIds = refResults.map(r => r.id);
|
|
98
|
+
const refTop1Score = refResults.length > 0 ? refResults[0].score : 0;
|
|
99
|
+
// Unified: HnswAdapter
|
|
100
|
+
const adapterResults = this.adapter.searchByArray(query, k);
|
|
101
|
+
const adapterIds = adapterResults.map(r => r.id);
|
|
102
|
+
const adapterTop1Score = adapterResults.length > 0 ? adapterResults[0].score : 0;
|
|
103
|
+
// Compute Jaccard overlap
|
|
104
|
+
const refSet = new Set(refIds);
|
|
105
|
+
const adapterSet = new Set(adapterIds);
|
|
106
|
+
const intersection = new Set([...refSet].filter(id => adapterSet.has(id)));
|
|
107
|
+
const union = new Set([...refSet, ...adapterSet]);
|
|
108
|
+
const jaccard = union.size > 0 ? intersection.size / union.size : 1;
|
|
109
|
+
const scoreDelta = Math.abs(refTop1Score - adapterTop1Score);
|
|
110
|
+
totalJaccard += jaccard;
|
|
111
|
+
totalScoreDelta += scoreDelta;
|
|
112
|
+
maxScoreDelta = Math.max(maxScoreDelta, scoreDelta);
|
|
113
|
+
// Track divergence if sets don't fully overlap
|
|
114
|
+
if (jaccard < 1.0) {
|
|
115
|
+
divergences.push({
|
|
116
|
+
queryIndex: qi,
|
|
117
|
+
oldTopK: refIds,
|
|
118
|
+
newTopK: adapterIds,
|
|
119
|
+
jaccardOverlap: jaccard,
|
|
120
|
+
top1ScoreDelta: scoreDelta,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const divergenceRate = queries.length > 0
|
|
125
|
+
? divergences.length / queries.length
|
|
126
|
+
: 0;
|
|
127
|
+
return {
|
|
128
|
+
totalQueries: queries.length,
|
|
129
|
+
divergentQueries: divergences.length,
|
|
130
|
+
divergenceRate,
|
|
131
|
+
avgJaccardOverlap: queries.length > 0 ? totalJaccard / queries.length : 1,
|
|
132
|
+
avgTop1ScoreDelta: queries.length > 0 ? totalScoreDelta / queries.length : 0,
|
|
133
|
+
maxTop1ScoreDelta: maxScoreDelta,
|
|
134
|
+
passesGoGate: divergenceRate <= threshold,
|
|
135
|
+
divergences,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=hnsw-shadow-validator.js.map
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export * from './interfaces';
|
|
5
5
|
export { InMemoryEventBus } from './event-bus';
|
|
6
|
-
export { DefaultAgentCoordinator } from './agent-coordinator';
|
|
6
|
+
export { DefaultAgentCoordinator, ProgressiveContextLoader } from './agent-coordinator';
|
|
7
7
|
export { DefaultPluginLoader } from './plugin-loader';
|
|
8
8
|
export { InMemoryBackend } from './memory-backend';
|
|
9
9
|
export { QEKernelImpl, createKernel } from './kernel';
|
package/dist/kernel/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export * from './interfaces';
|
|
6
6
|
// Implementations
|
|
7
7
|
export { InMemoryEventBus } from './event-bus';
|
|
8
|
-
export { DefaultAgentCoordinator } from './agent-coordinator';
|
|
8
|
+
export { DefaultAgentCoordinator, ProgressiveContextLoader } from './agent-coordinator';
|
|
9
9
|
export { DefaultPluginLoader } from './plugin-loader';
|
|
10
10
|
export { InMemoryBackend } from './memory-backend';
|
|
11
11
|
export { QEKernelImpl, createKernel } from './kernel';
|
|
@@ -126,12 +126,51 @@ export interface AgentCoordinator extends Disposable {
|
|
|
126
126
|
/** Check if can spawn more agents */
|
|
127
127
|
canSpawn(): boolean;
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Context loading strategy for agent spawn.
|
|
131
|
+
* - 'full': Load all files (default, existing behavior)
|
|
132
|
+
* - 'lazy': Load files on-demand as agents request them
|
|
133
|
+
* - 'predictive': Use keyword matching to predict which files will be needed
|
|
134
|
+
*/
|
|
135
|
+
export type ContextLoadingStrategy = 'full' | 'lazy' | 'predictive';
|
|
136
|
+
/**
|
|
137
|
+
* Configuration for progressive context loading (ADR-062 Action 5).
|
|
138
|
+
* Reduces token usage by ~40% by loading only predicted files at spawn.
|
|
139
|
+
*/
|
|
140
|
+
export interface ProgressiveContextConfig {
|
|
141
|
+
/** Loading strategy (default: 'full') */
|
|
142
|
+
strategy: ContextLoadingStrategy;
|
|
143
|
+
/** Maximum number of files to load at spawn (default: 10) */
|
|
144
|
+
maxInitialFiles: number;
|
|
145
|
+
/** Keyword similarity threshold for predictive loading (default: 0.7) */
|
|
146
|
+
predictionThreshold: number;
|
|
147
|
+
/** Whether to track file requests for accuracy measurement (default: true) */
|
|
148
|
+
trackFileRequests: boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Record of a file request made by an agent (ADR-062 Action 5).
|
|
152
|
+
* Used to measure prediction accuracy and improve future predictions.
|
|
153
|
+
*/
|
|
154
|
+
export interface FileRequestRecord {
|
|
155
|
+
/** Path of the requested file */
|
|
156
|
+
filePath: string;
|
|
157
|
+
/** Timestamp when the file was requested */
|
|
158
|
+
requestedAt: number;
|
|
159
|
+
/** Whether this file was preloaded (predicted correctly) */
|
|
160
|
+
wasPreloaded: boolean;
|
|
161
|
+
/** ID of the agent that requested the file */
|
|
162
|
+
agentId: string;
|
|
163
|
+
/** Task description associated with this agent */
|
|
164
|
+
taskDescription: string;
|
|
165
|
+
}
|
|
129
166
|
export interface AgentSpawnConfig {
|
|
130
167
|
name: string;
|
|
131
168
|
domain: DomainName;
|
|
132
169
|
type: string;
|
|
133
170
|
capabilities: string[];
|
|
134
171
|
config?: Record<string, unknown>;
|
|
172
|
+
/** ADR-062 Action 5: Progressive context loading configuration */
|
|
173
|
+
progressiveContext?: ProgressiveContextConfig;
|
|
135
174
|
}
|
|
136
175
|
export interface AgentFilter {
|
|
137
176
|
domain?: DomainName;
|
package/dist/kernel/kernel.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { DomainName } from '../shared/types';
|
|
6
6
|
import { QEKernel, EventBus, AgentCoordinator, PluginLoader, MemoryBackend, KernelHealth, KernelConfig } from './interfaces';
|
|
7
|
+
import { ToolCallSignatureTracker } from './anti-drift-middleware.js';
|
|
8
|
+
import type { LoopDetectionResult } from './anti-drift-middleware.js';
|
|
7
9
|
import '../domains/test-generation';
|
|
8
10
|
import '../domains/coverage-analysis';
|
|
9
11
|
import '../domains/security-compliance';
|
|
@@ -17,6 +19,7 @@ export declare class QEKernelImpl implements QEKernel {
|
|
|
17
19
|
private _config;
|
|
18
20
|
private _startTime;
|
|
19
21
|
private _initialized;
|
|
22
|
+
private _loopTracker;
|
|
20
23
|
constructor(config?: Partial<KernelConfig>);
|
|
21
24
|
get eventBus(): EventBus;
|
|
22
25
|
get coordinator(): AgentCoordinator;
|
|
@@ -50,6 +53,26 @@ export declare class QEKernelImpl implements QEKernel {
|
|
|
50
53
|
getHealth(): KernelHealth;
|
|
51
54
|
private determineOverallStatus;
|
|
52
55
|
getConfig(): KernelConfig;
|
|
56
|
+
/**
|
|
57
|
+
* Check a tool call for loop detection (ADR-062).
|
|
58
|
+
*
|
|
59
|
+
* Delegates to {@link ToolCallSignatureTracker.trackCall} and publishes
|
|
60
|
+
* `loop.warning` or `loop.detected` events to the EventBus when the
|
|
61
|
+
* tracker returns `warn` or `steer` respectively.
|
|
62
|
+
*
|
|
63
|
+
* Feature-flagged: returns `allow` immediately when
|
|
64
|
+
* `process.env.AQE_LOOP_DETECTION_ENABLED === 'false'`.
|
|
65
|
+
*
|
|
66
|
+
* @param agentId - The agent making the tool call
|
|
67
|
+
* @param toolName - Name of the tool being called
|
|
68
|
+
* @param args - Arguments to the tool call
|
|
69
|
+
* @returns The loop detection result
|
|
70
|
+
*/
|
|
71
|
+
checkToolCall(agentId: string, toolName: string, args: unknown): LoopDetectionResult;
|
|
72
|
+
/**
|
|
73
|
+
* Get the internal ToolCallSignatureTracker for metrics / testing.
|
|
74
|
+
*/
|
|
75
|
+
get loopTracker(): ToolCallSignatureTracker;
|
|
53
76
|
}
|
|
54
77
|
export declare function createKernel(config?: Partial<KernelConfig>): QEKernel;
|
|
55
78
|
//# sourceMappingURL=kernel.d.ts.map
|
package/dist/kernel/kernel.js
CHANGED
|
@@ -9,12 +9,15 @@ import { DefaultAgentCoordinator } from './agent-coordinator';
|
|
|
9
9
|
import { DefaultPluginLoader } from './plugin-loader';
|
|
10
10
|
import { InMemoryBackend } from './memory-backend';
|
|
11
11
|
import { HybridMemoryBackend } from './hybrid-backend';
|
|
12
|
-
import { SemanticAntiDriftMiddleware } from './anti-drift-middleware.js';
|
|
12
|
+
import { SemanticAntiDriftMiddleware, ToolCallSignatureTracker } from './anti-drift-middleware.js';
|
|
13
|
+
import { LOOP_EVENT_TYPES } from './event-bus.js';
|
|
13
14
|
import { AGENT_CONSTANTS, MEMORY_CONSTANTS } from './constants.js';
|
|
14
15
|
import { findProjectRoot } from './unified-memory.js';
|
|
15
16
|
import { initializeUnifiedPersistence } from './unified-persistence.js';
|
|
16
17
|
import * as path from 'path';
|
|
17
18
|
import * as fs from 'fs';
|
|
19
|
+
import { PluginLifecycleManager } from '../plugins/lifecycle';
|
|
20
|
+
import { PluginCache } from '../plugins/cache';
|
|
18
21
|
// Import domain plugin factories
|
|
19
22
|
import { createTestGenerationPlugin } from '../domains/test-generation/plugin';
|
|
20
23
|
import { createTestExecutionPlugin } from '../domains/test-execution/plugin';
|
|
@@ -70,6 +73,8 @@ export class QEKernelImpl {
|
|
|
70
73
|
_config;
|
|
71
74
|
_startTime;
|
|
72
75
|
_initialized = false;
|
|
76
|
+
// ADR-062: Loop detection tracker
|
|
77
|
+
_loopTracker;
|
|
73
78
|
constructor(config = {}) {
|
|
74
79
|
this._config = { ...DEFAULT_CONFIG, ...config };
|
|
75
80
|
this._startTime = new Date();
|
|
@@ -80,6 +85,8 @@ export class QEKernelImpl {
|
|
|
80
85
|
this._eventBus = new InMemoryEventBus();
|
|
81
86
|
this._coordinator = new DefaultAgentCoordinator(this._config.maxConcurrentAgents);
|
|
82
87
|
this._plugins = new DefaultPluginLoader(this._eventBus, this._memory, this._config.lazyLoading);
|
|
88
|
+
// ADR-062: Instantiate loop detection tracker alongside anti-drift middleware
|
|
89
|
+
this._loopTracker = new ToolCallSignatureTracker();
|
|
83
90
|
}
|
|
84
91
|
get eventBus() {
|
|
85
92
|
return this._eventBus;
|
|
@@ -149,10 +156,75 @@ export class QEKernelImpl {
|
|
|
149
156
|
agentId: 'qe-kernel',
|
|
150
157
|
});
|
|
151
158
|
this._eventBus.registerMiddleware(antiDriftMiddleware);
|
|
159
|
+
// IMP-09: Discover and register external plugins from cache
|
|
160
|
+
try {
|
|
161
|
+
const pluginCacheDir = path.join(dataDir, 'plugins');
|
|
162
|
+
const pluginCache = new PluginCache({ cacheDir: pluginCacheDir });
|
|
163
|
+
const pluginLifecycle = new PluginLifecycleManager({ cache: pluginCache });
|
|
164
|
+
const resolution = pluginLifecycle.resolveLoadOrder();
|
|
165
|
+
for (const resolved of resolution.ordered) {
|
|
166
|
+
const manifest = resolved.manifest;
|
|
167
|
+
const cachedPlugin = pluginCache.get(manifest.name, manifest.version);
|
|
168
|
+
if (!cachedPlugin)
|
|
169
|
+
continue;
|
|
170
|
+
const entryPointPath = path.join(cachedPlugin.path, manifest.entryPoint);
|
|
171
|
+
// Register a factory for each domain the plugin provides
|
|
172
|
+
for (const domain of manifest.domains) {
|
|
173
|
+
const domainName = domain;
|
|
174
|
+
if (DOMAIN_FACTORIES[domainName])
|
|
175
|
+
continue; // don't override built-in domains
|
|
176
|
+
const loader = this._plugins;
|
|
177
|
+
loader.registerFactory(domainName, async (eventBus, memory) => {
|
|
178
|
+
// Dynamically import the plugin entry point at load time
|
|
179
|
+
const pluginModule = await import(entryPointPath);
|
|
180
|
+
const createPlugin = pluginModule.default ?? pluginModule.createPlugin;
|
|
181
|
+
if (typeof createPlugin !== 'function') {
|
|
182
|
+
throw new Error(`Plugin "${manifest.name}" entry point must export a default function or "createPlugin" function`);
|
|
183
|
+
}
|
|
184
|
+
return createPlugin(eventBus, memory, this._coordinator);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// External plugin loading is best-effort — don't block kernel startup
|
|
191
|
+
}
|
|
152
192
|
// Load plugins based on configuration
|
|
153
193
|
if (!this._config.lazyLoading) {
|
|
154
194
|
await this._plugins.loadAll();
|
|
155
195
|
}
|
|
196
|
+
// ADR-067: Wire agent memory branching when RVF PatternStore is enabled
|
|
197
|
+
// Uses shared adapter singleton to avoid duplicate file handles (M4 fix)
|
|
198
|
+
try {
|
|
199
|
+
const { isAgentMemoryBranchingEnabled, isRVFPatternStoreEnabled } = await import('../integrations/ruvector/feature-flags.js');
|
|
200
|
+
if (isAgentMemoryBranchingEnabled() && isRVFPatternStoreEnabled()) {
|
|
201
|
+
const { getSharedRvfAdapter } = await import('../integrations/ruvector/shared-rvf-adapter.js');
|
|
202
|
+
const { AgentMemoryBranch } = await import('../coordination/agent-memory-branch.js');
|
|
203
|
+
const rvfAdapter = getSharedRvfAdapter(dataDir, 384);
|
|
204
|
+
if (rvfAdapter) {
|
|
205
|
+
const branch = new AgentMemoryBranch(rvfAdapter, {
|
|
206
|
+
branchDir: path.join(dataDir, 'branches'),
|
|
207
|
+
});
|
|
208
|
+
this._coordinator.setMemoryBranch(branch);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
// Agent memory branching is best-effort — don't block kernel startup
|
|
214
|
+
}
|
|
215
|
+
// ADR-072 Phase 3: Initialize RVF migration coordinator
|
|
216
|
+
try {
|
|
217
|
+
const { getRvfMigrationStage } = await import('../integrations/ruvector/feature-flags.js');
|
|
218
|
+
const stage = getRvfMigrationStage();
|
|
219
|
+
if (stage >= 2) {
|
|
220
|
+
const { RvfMigrationCoordinator } = await import('../persistence/rvf-migration-coordinator.js');
|
|
221
|
+
const coordinator = RvfMigrationCoordinator.getInstance({ stage });
|
|
222
|
+
await coordinator.initialize();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
// Migration coordinator is best-effort — don't block kernel startup
|
|
227
|
+
}
|
|
156
228
|
this._initialized = true;
|
|
157
229
|
}
|
|
158
230
|
async dispose() {
|
|
@@ -298,6 +370,74 @@ export class QEKernelImpl {
|
|
|
298
370
|
getConfig() {
|
|
299
371
|
return { ...this._config };
|
|
300
372
|
}
|
|
373
|
+
// ==========================================================================
|
|
374
|
+
// ADR-062: Loop Detection
|
|
375
|
+
// ==========================================================================
|
|
376
|
+
/**
|
|
377
|
+
* Check a tool call for loop detection (ADR-062).
|
|
378
|
+
*
|
|
379
|
+
* Delegates to {@link ToolCallSignatureTracker.trackCall} and publishes
|
|
380
|
+
* `loop.warning` or `loop.detected` events to the EventBus when the
|
|
381
|
+
* tracker returns `warn` or `steer` respectively.
|
|
382
|
+
*
|
|
383
|
+
* Feature-flagged: returns `allow` immediately when
|
|
384
|
+
* `process.env.AQE_LOOP_DETECTION_ENABLED === 'false'`.
|
|
385
|
+
*
|
|
386
|
+
* @param agentId - The agent making the tool call
|
|
387
|
+
* @param toolName - Name of the tool being called
|
|
388
|
+
* @param args - Arguments to the tool call
|
|
389
|
+
* @returns The loop detection result
|
|
390
|
+
*/
|
|
391
|
+
checkToolCall(agentId, toolName, args) {
|
|
392
|
+
// Feature flag gate — tracker checks internally too, but we skip event
|
|
393
|
+
// publishing entirely when disabled to avoid unnecessary async work.
|
|
394
|
+
if (process.env.AQE_LOOP_DETECTION_ENABLED === 'false') {
|
|
395
|
+
return this._loopTracker.trackCall(agentId, toolName, args);
|
|
396
|
+
}
|
|
397
|
+
const result = this._loopTracker.trackCall(agentId, toolName, args);
|
|
398
|
+
if (result.action === 'warn') {
|
|
399
|
+
// Fire-and-forget: publish warning event
|
|
400
|
+
const warningEvent = {
|
|
401
|
+
id: `loop-warn-${agentId}-${Date.now()}`,
|
|
402
|
+
type: LOOP_EVENT_TYPES.LOOP_WARNING,
|
|
403
|
+
timestamp: new Date(),
|
|
404
|
+
source: 'coordination',
|
|
405
|
+
correlationId: agentId,
|
|
406
|
+
payload: {
|
|
407
|
+
agentId,
|
|
408
|
+
toolName,
|
|
409
|
+
callCount: result.callCount,
|
|
410
|
+
signature: result.signature,
|
|
411
|
+
},
|
|
412
|
+
};
|
|
413
|
+
void this._eventBus.publish(warningEvent);
|
|
414
|
+
}
|
|
415
|
+
else if (result.action === 'steer') {
|
|
416
|
+
// Fire-and-forget: publish loop-detected event
|
|
417
|
+
const detectedEvent = {
|
|
418
|
+
id: `loop-detected-${agentId}-${Date.now()}`,
|
|
419
|
+
type: LOOP_EVENT_TYPES.LOOP_DETECTED,
|
|
420
|
+
timestamp: new Date(),
|
|
421
|
+
source: 'coordination',
|
|
422
|
+
correlationId: agentId,
|
|
423
|
+
payload: {
|
|
424
|
+
agentId,
|
|
425
|
+
toolName,
|
|
426
|
+
callCount: result.callCount,
|
|
427
|
+
signature: result.signature,
|
|
428
|
+
steeringMessage: result.steeringMessage,
|
|
429
|
+
},
|
|
430
|
+
};
|
|
431
|
+
void this._eventBus.publish(detectedEvent);
|
|
432
|
+
}
|
|
433
|
+
return result;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Get the internal ToolCallSignatureTracker for metrics / testing.
|
|
437
|
+
*/
|
|
438
|
+
get loopTracker() {
|
|
439
|
+
return this._loopTracker;
|
|
440
|
+
}
|
|
301
441
|
}
|
|
302
442
|
// Factory function
|
|
303
443
|
export function createKernel(config) {
|
|
@@ -56,7 +56,9 @@ export class InMemoryBackend {
|
|
|
56
56
|
return value !== undefined;
|
|
57
57
|
}
|
|
58
58
|
async search(pattern, limit = MEMORY_CONSTANTS.DEFAULT_SEARCH_LIMIT) {
|
|
59
|
-
|
|
59
|
+
// Escape regex-special chars first, then convert glob wildcards to regex
|
|
60
|
+
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
|
|
61
|
+
const regex = new RegExp(escaped.replace(/\*/g, '.*'));
|
|
60
62
|
const results = [];
|
|
61
63
|
for (const key of this.store.keys()) {
|
|
62
64
|
if (regex.test(key)) {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { type Database as DatabaseType, type Statement } from 'better-sqlite3';
|
|
25
25
|
export { validateTableName, ALLOWED_TABLE_NAMES } from '../shared/sql-safety.js';
|
|
26
|
-
export { BinaryHeap,
|
|
26
|
+
export { BinaryHeap, UnifiedHnswIndex, createHnswIndex } from './unified-memory-hnsw.js';
|
|
27
27
|
import { type CRDTStore, type CRDTStoreState, type CRDTStoreDelta } from '../memory/crdt/index.js';
|
|
28
28
|
/**
|
|
29
29
|
* Clear the cached project root. Useful for testing or when the
|
|
@@ -34,8 +34,11 @@ const logger = LoggerFactory.create('unified-memory');
|
|
|
34
34
|
export { validateTableName, ALLOWED_TABLE_NAMES } from '../shared/sql-safety.js';
|
|
35
35
|
import { validateTableName } from '../shared/sql-safety.js';
|
|
36
36
|
// Re-export extracted modules for backward compatibility
|
|
37
|
-
export { BinaryHeap,
|
|
38
|
-
|
|
37
|
+
export { BinaryHeap, UnifiedHnswIndex, createHnswIndex } from './unified-memory-hnsw.js';
|
|
38
|
+
// ADR-071 Phase 2C: InMemoryHNSWIndex and RuvectorFlatIndex are decommissioned
|
|
39
|
+
// from production code. Import them directly from unified-memory-hnsw.js for
|
|
40
|
+
// parity tests or benchmarks only.
|
|
41
|
+
import { UnifiedHnswIndex } from './unified-memory-hnsw.js';
|
|
39
42
|
// Import schemas
|
|
40
43
|
import { SCHEMA_VERSION, SCHEMA_VERSION_TABLE, KV_STORE_SCHEMA, VECTORS_SCHEMA, RL_QVALUES_SCHEMA, GOAP_SCHEMA, DREAM_SCHEMA, QE_PATTERNS_SCHEMA, MINCUT_SCHEMA, SONA_PATTERNS_SCHEMA, FEEDBACK_SCHEMA, HYPERGRAPH_SCHEMA, STATS_TABLES, } from './unified-memory-schemas.js';
|
|
41
44
|
// CRDT imports for distributed state synchronization
|
|
@@ -171,7 +174,8 @@ export class UnifiedMemoryManager {
|
|
|
171
174
|
vectorsLoaded = false;
|
|
172
175
|
initPromise = null;
|
|
173
176
|
preparedStatements = new Map();
|
|
174
|
-
|
|
177
|
+
// ADR-071 Phase 2C: Always use UnifiedHnswIndex (old implementations decommissioned)
|
|
178
|
+
vectorIndex = new UnifiedHnswIndex('qe-memory');
|
|
175
179
|
// CRDT store for distributed state synchronization
|
|
176
180
|
crdtStore = null;
|
|
177
181
|
constructor(config) {
|
|
@@ -281,6 +281,71 @@ export declare class AQELearningEngine {
|
|
|
281
281
|
*/
|
|
282
282
|
dispose(): Promise<void>;
|
|
283
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Configuration for the meta-learning cycle.
|
|
286
|
+
*/
|
|
287
|
+
export interface MetaLearningConfig {
|
|
288
|
+
/** Whether meta-learning is enabled */
|
|
289
|
+
enabled: boolean;
|
|
290
|
+
/** Interval between snapshots in milliseconds (default: 300 000 = 5 min) */
|
|
291
|
+
snapshotIntervalMs: number;
|
|
292
|
+
/** Minimum number of snapshots required before analysis runs (default: 5) */
|
|
293
|
+
minSnapshotsForAnalysis: number;
|
|
294
|
+
/** Confidence threshold for auto-applying suggestions (default: 0.8) */
|
|
295
|
+
autoApplyThreshold: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Default meta-learning configuration.
|
|
299
|
+
*/
|
|
300
|
+
export declare const DEFAULT_META_LEARNING_CONFIG: MetaLearningConfig;
|
|
301
|
+
/**
|
|
302
|
+
* An actionable insight produced by the meta-learning cycle.
|
|
303
|
+
*/
|
|
304
|
+
export interface MetaInsight {
|
|
305
|
+
/** Unique identifier */
|
|
306
|
+
id: string;
|
|
307
|
+
/** Category of the detected issue */
|
|
308
|
+
type: 'token-waste' | 'quality-plateau' | 'learning-stall' | 'performance-regression';
|
|
309
|
+
/** Human-readable explanation */
|
|
310
|
+
description: string;
|
|
311
|
+
/** Confidence in this insight (0-1) */
|
|
312
|
+
confidence: number;
|
|
313
|
+
/** Recommended remediation action */
|
|
314
|
+
suggestedAction: string;
|
|
315
|
+
/** Epoch-ms when the insight was detected */
|
|
316
|
+
detectedAt: number;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Meta-Learning Engine — closed-loop meta-optimization (ADR-062).
|
|
320
|
+
*
|
|
321
|
+
* Analyses a time-series of `UnifiedMetricsSnapshot`s to detect
|
|
322
|
+
* token-waste, quality plateaus, learning stalls, and performance
|
|
323
|
+
* regressions. Guarded by the `AQE_META_LEARNING_ENABLED` env var
|
|
324
|
+
* (opt-in, default `false`).
|
|
325
|
+
*/
|
|
326
|
+
export declare class MetaLearningEngine {
|
|
327
|
+
private readonly config;
|
|
328
|
+
constructor(config?: Partial<MetaLearningConfig>);
|
|
329
|
+
/**
|
|
330
|
+
* Run a single meta-learning analysis cycle.
|
|
331
|
+
*
|
|
332
|
+
* Trend detection strategy: compare the first half of snapshots to the
|
|
333
|
+
* second half using simple averages. This keeps the implementation
|
|
334
|
+
* lightweight and predictable.
|
|
335
|
+
*
|
|
336
|
+
* @param snapshots - Ordered (oldest → newest) unified metric snapshots
|
|
337
|
+
* @returns Detected meta-insights (may be empty)
|
|
338
|
+
*/
|
|
339
|
+
runMetaLearningCycle(snapshots: import('./metrics-tracker.js').UnifiedMetricsSnapshot[]): MetaInsight[];
|
|
340
|
+
/**
|
|
341
|
+
* Determine whether an insight should be auto-applied.
|
|
342
|
+
*
|
|
343
|
+
* @param insight - The insight to evaluate
|
|
344
|
+
* @param config - Meta-learning config with the auto-apply threshold
|
|
345
|
+
* @returns `true` if the insight's confidence meets or exceeds the threshold
|
|
346
|
+
*/
|
|
347
|
+
shouldAutoApply(insight: MetaInsight, config?: MetaLearningConfig): boolean;
|
|
348
|
+
}
|
|
284
349
|
/**
|
|
285
350
|
* Create AQE Learning Engine
|
|
286
351
|
*
|