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
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
* Manages agent lifecycle with max concurrent agents limit
|
|
4
4
|
*/
|
|
5
5
|
import { AgentStatus, Result } from '../shared/types';
|
|
6
|
-
import { AgentCoordinator, AgentSpawnConfig, AgentFilter, AgentInfo } from './interfaces';
|
|
6
|
+
import { AgentCoordinator, AgentSpawnConfig, AgentFilter, AgentInfo, ProgressiveContextConfig, FileRequestRecord } from './interfaces';
|
|
7
7
|
export declare class DefaultAgentCoordinator implements AgentCoordinator {
|
|
8
8
|
private agents;
|
|
9
9
|
private maxAgents;
|
|
10
|
+
private memoryBranch;
|
|
10
11
|
constructor(maxAgents?: number);
|
|
12
|
+
/** Attach an AgentMemoryBranch service for per-agent COW isolation (ADR-067) */
|
|
13
|
+
setMemoryBranch(branch: import('../coordination/agent-memory-branch.js').AgentMemoryBranch): void;
|
|
11
14
|
spawn(config: AgentSpawnConfig): Promise<Result<string, Error>>;
|
|
12
15
|
getStatus(agentId: string): AgentStatus | undefined;
|
|
13
16
|
listAgents(filter?: AgentFilter): AgentInfo[];
|
|
@@ -17,6 +20,77 @@ export declare class DefaultAgentCoordinator implements AgentCoordinator {
|
|
|
17
20
|
dispose(): Promise<void>;
|
|
18
21
|
markCompleted(agentId: string): void;
|
|
19
22
|
markFailed(agentId: string): void;
|
|
23
|
+
/** ADR-067: Handle branch merge or discard on agent completion */
|
|
24
|
+
private handleBranchOnComplete;
|
|
20
25
|
cleanup(ttlMs?: number): number;
|
|
21
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Predicts and manages context files for agent spawning (ADR-062 Action 5).
|
|
29
|
+
*
|
|
30
|
+
* Uses TF-IDF-like keyword matching between the task description and file
|
|
31
|
+
* paths to predict which files an agent will need. This reduces initial
|
|
32
|
+
* token usage by ~40% compared to loading the full codebase context.
|
|
33
|
+
*
|
|
34
|
+
* Feature-gated by `AQE_PROGRESSIVE_CONTEXT_ENABLED` env var (default: false).
|
|
35
|
+
*/
|
|
36
|
+
export declare class ProgressiveContextLoader {
|
|
37
|
+
private config;
|
|
38
|
+
private fileRequests;
|
|
39
|
+
private preloadedFiles;
|
|
40
|
+
constructor(config?: Partial<ProgressiveContextConfig>);
|
|
41
|
+
/**
|
|
42
|
+
* Check if progressive context loading is enabled via feature flag.
|
|
43
|
+
* When disabled, all methods fall back to full-context behavior.
|
|
44
|
+
*/
|
|
45
|
+
private isEnabled;
|
|
46
|
+
/**
|
|
47
|
+
* Predict which files an agent will need based on the task description.
|
|
48
|
+
*
|
|
49
|
+
* Uses simple TF-IDF-like keyword extraction from the task description,
|
|
50
|
+
* then scores each available file path against those keywords. Returns
|
|
51
|
+
* the top N files sorted by relevance score.
|
|
52
|
+
*
|
|
53
|
+
* When the feature flag is disabled or the strategy is 'full', returns
|
|
54
|
+
* all available files (preserving existing behavior).
|
|
55
|
+
*
|
|
56
|
+
* @param taskDescription - Natural language description of the agent's task
|
|
57
|
+
* @param availableFiles - List of file paths the agent could access
|
|
58
|
+
* @returns Sorted list of predicted file paths (most relevant first)
|
|
59
|
+
*/
|
|
60
|
+
predictFilesForTask(taskDescription: string, availableFiles: string[]): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Record a file request made by an agent for tracking prediction accuracy.
|
|
63
|
+
*
|
|
64
|
+
* @param record - The file request record to store
|
|
65
|
+
*/
|
|
66
|
+
recordFileRequest(record: FileRequestRecord): void;
|
|
67
|
+
/**
|
|
68
|
+
* Calculate how accurately predictions matched actual file usage.
|
|
69
|
+
*
|
|
70
|
+
* @returns Object with prediction stats: predicted count, actually used count, hit rate
|
|
71
|
+
*/
|
|
72
|
+
getPredictionAccuracy(): {
|
|
73
|
+
predicted: number;
|
|
74
|
+
actuallyUsed: number;
|
|
75
|
+
hitRate: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Retrieve the file request history, optionally filtered by agent ID.
|
|
79
|
+
*
|
|
80
|
+
* @param agentId - Optional agent ID to filter by
|
|
81
|
+
* @returns Array of file request records
|
|
82
|
+
*/
|
|
83
|
+
getFileRequestHistory(agentId?: string): FileRequestRecord[];
|
|
84
|
+
/**
|
|
85
|
+
* Extract meaningful keywords from a task description.
|
|
86
|
+
* Splits on whitespace/punctuation, lowercases, removes stop words,
|
|
87
|
+
* and deduplicates.
|
|
88
|
+
*/
|
|
89
|
+
private extractKeywords;
|
|
90
|
+
/**
|
|
91
|
+
* Score a file path against a list of keywords using TF-IDF-like matching.
|
|
92
|
+
* Checks both the full path and individual path segments.
|
|
93
|
+
*/
|
|
94
|
+
private scoreFile;
|
|
95
|
+
}
|
|
22
96
|
//# sourceMappingURL=agent-coordinator.d.ts.map
|
|
@@ -8,15 +8,46 @@ import { AGENT_CONSTANTS } from './constants.js';
|
|
|
8
8
|
export class DefaultAgentCoordinator {
|
|
9
9
|
agents = new Map();
|
|
10
10
|
maxAgents;
|
|
11
|
+
// ADR-067: Optional agent memory branching service
|
|
12
|
+
memoryBranch = null;
|
|
11
13
|
constructor(maxAgents = AGENT_CONSTANTS.MAX_CONCURRENT_AGENTS) {
|
|
12
14
|
this.maxAgents = maxAgents;
|
|
13
15
|
}
|
|
16
|
+
/** Attach an AgentMemoryBranch service for per-agent COW isolation (ADR-067) */
|
|
17
|
+
setMemoryBranch(branch) {
|
|
18
|
+
this.memoryBranch = branch;
|
|
19
|
+
}
|
|
14
20
|
async spawn(config) {
|
|
15
21
|
// Check agent limit
|
|
16
22
|
if (!this.canSpawn()) {
|
|
17
23
|
return err(new Error(`Cannot spawn agent: maximum concurrent agents (${this.maxAgents}) reached. ` +
|
|
18
24
|
`Active: ${this.getActiveCount()}`));
|
|
19
25
|
}
|
|
26
|
+
// ADR-062 Action 5: Progressive context loading
|
|
27
|
+
// When enabled, predict which files the agent will need instead of loading everything
|
|
28
|
+
let resolvedConfig = config.config ?? {};
|
|
29
|
+
const progressiveEnabled = config.progressiveContext?.strategy === 'predictive' ||
|
|
30
|
+
process.env.AQE_PROGRESSIVE_CONTEXT_ENABLED === 'true';
|
|
31
|
+
if (progressiveEnabled) {
|
|
32
|
+
try {
|
|
33
|
+
const taskDescription = resolvedConfig.taskDescription || config.name || '';
|
|
34
|
+
const availableFiles = resolvedConfig.availableFiles || [];
|
|
35
|
+
if (taskDescription && availableFiles.length > 0) {
|
|
36
|
+
const loader = new ProgressiveContextLoader(config.progressiveContext);
|
|
37
|
+
const predictedFiles = loader.predictFilesForTask(taskDescription, availableFiles);
|
|
38
|
+
resolvedConfig = {
|
|
39
|
+
...resolvedConfig,
|
|
40
|
+
availableFiles: predictedFiles,
|
|
41
|
+
contextFiles: predictedFiles,
|
|
42
|
+
initialFiles: predictedFiles,
|
|
43
|
+
progressiveContextApplied: true,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// Progressive context must not break agent spawning
|
|
49
|
+
}
|
|
50
|
+
}
|
|
20
51
|
const id = uuidv4();
|
|
21
52
|
const agent = {
|
|
22
53
|
id,
|
|
@@ -25,10 +56,28 @@ export class DefaultAgentCoordinator {
|
|
|
25
56
|
type: config.type,
|
|
26
57
|
status: 'running',
|
|
27
58
|
capabilities: config.capabilities,
|
|
28
|
-
config:
|
|
59
|
+
config: resolvedConfig,
|
|
29
60
|
startedAt: new Date(),
|
|
30
61
|
};
|
|
31
62
|
this.agents.set(id, agent);
|
|
63
|
+
// ADR-067: Create memory branch for isolated agent workspace
|
|
64
|
+
if (this.memoryBranch) {
|
|
65
|
+
try {
|
|
66
|
+
const handle = this.memoryBranch.createBranch(id);
|
|
67
|
+
agent.config = {
|
|
68
|
+
...agent.config,
|
|
69
|
+
_memoryBranchPath: handle.childPath,
|
|
70
|
+
// Expose a recordIngest callback so the agent can log vectors for merge replay
|
|
71
|
+
_memoryBranchRecordIngest: (entries) => {
|
|
72
|
+
this.memoryBranch?.recordIngest(id, entries);
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
// Branch creation must not block agent spawning
|
|
78
|
+
console.warn(`[AgentCoordinator] Memory branch creation failed for ${id}:`, error);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
32
81
|
return ok(id);
|
|
33
82
|
}
|
|
34
83
|
getStatus(agentId) {
|
|
@@ -86,6 +135,8 @@ export class DefaultAgentCoordinator {
|
|
|
86
135
|
if (agent && agent.status === 'running') {
|
|
87
136
|
agent.status = 'completed';
|
|
88
137
|
agent.completedAt = new Date();
|
|
138
|
+
// ADR-067: Merge successful agent's memory branch
|
|
139
|
+
this.handleBranchOnComplete(agentId, 'merge');
|
|
89
140
|
}
|
|
90
141
|
}
|
|
91
142
|
markFailed(agentId) {
|
|
@@ -93,6 +144,30 @@ export class DefaultAgentCoordinator {
|
|
|
93
144
|
if (agent && agent.status === 'running') {
|
|
94
145
|
agent.status = 'failed';
|
|
95
146
|
agent.completedAt = new Date();
|
|
147
|
+
// ADR-067: Discard failed agent's memory branch
|
|
148
|
+
this.handleBranchOnComplete(agentId, 'discard');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** ADR-067: Handle branch merge or discard on agent completion */
|
|
152
|
+
handleBranchOnComplete(agentId, action) {
|
|
153
|
+
if (!this.memoryBranch)
|
|
154
|
+
return;
|
|
155
|
+
const handle = this.memoryBranch.getBranch(agentId);
|
|
156
|
+
if (!handle)
|
|
157
|
+
return;
|
|
158
|
+
try {
|
|
159
|
+
if (action === 'merge') {
|
|
160
|
+
// Fire-and-forget — merge is async but we don't block completion
|
|
161
|
+
this.memoryBranch.mergeBranch(handle).catch(error => {
|
|
162
|
+
console.warn(`[AgentCoordinator] Branch merge failed for ${agentId}:`, error);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.memoryBranch.discardBranch(handle);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
console.warn(`[AgentCoordinator] Branch ${action} failed for ${agentId}:`, error);
|
|
96
171
|
}
|
|
97
172
|
}
|
|
98
173
|
// Cleanup completed/failed agents older than TTL
|
|
@@ -110,4 +185,178 @@ export class DefaultAgentCoordinator {
|
|
|
110
185
|
return cleaned;
|
|
111
186
|
}
|
|
112
187
|
}
|
|
188
|
+
// ============================================================================
|
|
189
|
+
// ADR-062 Action 5: Progressive Context Loader
|
|
190
|
+
// ============================================================================
|
|
191
|
+
/** Default configuration for progressive context loading */
|
|
192
|
+
const DEFAULT_PROGRESSIVE_CONTEXT_CONFIG = {
|
|
193
|
+
strategy: 'full',
|
|
194
|
+
maxInitialFiles: 10,
|
|
195
|
+
predictionThreshold: 0.7,
|
|
196
|
+
trackFileRequests: true,
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Predicts and manages context files for agent spawning (ADR-062 Action 5).
|
|
200
|
+
*
|
|
201
|
+
* Uses TF-IDF-like keyword matching between the task description and file
|
|
202
|
+
* paths to predict which files an agent will need. This reduces initial
|
|
203
|
+
* token usage by ~40% compared to loading the full codebase context.
|
|
204
|
+
*
|
|
205
|
+
* Feature-gated by `AQE_PROGRESSIVE_CONTEXT_ENABLED` env var (default: false).
|
|
206
|
+
*/
|
|
207
|
+
export class ProgressiveContextLoader {
|
|
208
|
+
config;
|
|
209
|
+
fileRequests = [];
|
|
210
|
+
preloadedFiles = new Set();
|
|
211
|
+
constructor(config) {
|
|
212
|
+
this.config = { ...DEFAULT_PROGRESSIVE_CONTEXT_CONFIG, ...config };
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Check if progressive context loading is enabled via feature flag.
|
|
216
|
+
* When disabled, all methods fall back to full-context behavior.
|
|
217
|
+
*/
|
|
218
|
+
isEnabled() {
|
|
219
|
+
return process.env.AQE_PROGRESSIVE_CONTEXT_ENABLED === 'true';
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Predict which files an agent will need based on the task description.
|
|
223
|
+
*
|
|
224
|
+
* Uses simple TF-IDF-like keyword extraction from the task description,
|
|
225
|
+
* then scores each available file path against those keywords. Returns
|
|
226
|
+
* the top N files sorted by relevance score.
|
|
227
|
+
*
|
|
228
|
+
* When the feature flag is disabled or the strategy is 'full', returns
|
|
229
|
+
* all available files (preserving existing behavior).
|
|
230
|
+
*
|
|
231
|
+
* @param taskDescription - Natural language description of the agent's task
|
|
232
|
+
* @param availableFiles - List of file paths the agent could access
|
|
233
|
+
* @returns Sorted list of predicted file paths (most relevant first)
|
|
234
|
+
*/
|
|
235
|
+
predictFilesForTask(taskDescription, availableFiles) {
|
|
236
|
+
// Feature flag gate: disabled → return all files
|
|
237
|
+
if (!this.isEnabled() || this.config.strategy === 'full') {
|
|
238
|
+
return [...availableFiles];
|
|
239
|
+
}
|
|
240
|
+
// Empty inputs: return up to maxInitialFiles from available
|
|
241
|
+
if (!taskDescription || taskDescription.trim().length === 0) {
|
|
242
|
+
return availableFiles.slice(0, this.config.maxInitialFiles);
|
|
243
|
+
}
|
|
244
|
+
if (availableFiles.length === 0) {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
// Extract keywords from task description
|
|
248
|
+
const keywords = this.extractKeywords(taskDescription);
|
|
249
|
+
if (keywords.length === 0) {
|
|
250
|
+
return availableFiles.slice(0, this.config.maxInitialFiles);
|
|
251
|
+
}
|
|
252
|
+
// Score each file against the keywords
|
|
253
|
+
const scored = availableFiles.map(filePath => ({
|
|
254
|
+
filePath,
|
|
255
|
+
score: this.scoreFile(filePath, keywords),
|
|
256
|
+
}));
|
|
257
|
+
// Sort by score descending, then take top N
|
|
258
|
+
scored.sort((a, b) => b.score - a.score);
|
|
259
|
+
// Track which files were preloaded for accuracy measurement
|
|
260
|
+
const predicted = scored
|
|
261
|
+
.slice(0, this.config.maxInitialFiles)
|
|
262
|
+
.map(s => s.filePath);
|
|
263
|
+
this.preloadedFiles = new Set(predicted);
|
|
264
|
+
return predicted;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Record a file request made by an agent for tracking prediction accuracy.
|
|
268
|
+
*
|
|
269
|
+
* @param record - The file request record to store
|
|
270
|
+
*/
|
|
271
|
+
recordFileRequest(record) {
|
|
272
|
+
if (!this.config.trackFileRequests) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
this.fileRequests.push(record);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Calculate how accurately predictions matched actual file usage.
|
|
279
|
+
*
|
|
280
|
+
* @returns Object with prediction stats: predicted count, actually used count, hit rate
|
|
281
|
+
*/
|
|
282
|
+
getPredictionAccuracy() {
|
|
283
|
+
const predicted = this.preloadedFiles.size;
|
|
284
|
+
const actuallyUsed = this.fileRequests.filter(r => r.wasPreloaded).length;
|
|
285
|
+
// Deduplicate actual requests by filePath for hit rate
|
|
286
|
+
const uniqueRequested = new Set(this.fileRequests.map(r => r.filePath));
|
|
287
|
+
const hits = [...uniqueRequested].filter(f => this.preloadedFiles.has(f)).length;
|
|
288
|
+
const hitRate = uniqueRequested.size > 0 ? hits / uniqueRequested.size : 0;
|
|
289
|
+
return { predicted, actuallyUsed, hitRate };
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Retrieve the file request history, optionally filtered by agent ID.
|
|
293
|
+
*
|
|
294
|
+
* @param agentId - Optional agent ID to filter by
|
|
295
|
+
* @returns Array of file request records
|
|
296
|
+
*/
|
|
297
|
+
getFileRequestHistory(agentId) {
|
|
298
|
+
if (agentId) {
|
|
299
|
+
return this.fileRequests.filter(r => r.agentId === agentId);
|
|
300
|
+
}
|
|
301
|
+
return [...this.fileRequests];
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Extract meaningful keywords from a task description.
|
|
305
|
+
* Splits on whitespace/punctuation, lowercases, removes stop words,
|
|
306
|
+
* and deduplicates.
|
|
307
|
+
*/
|
|
308
|
+
extractKeywords(text) {
|
|
309
|
+
const stopWords = new Set([
|
|
310
|
+
'the', 'a', 'an', 'is', 'are', 'was', 'were', 'be', 'been', 'being',
|
|
311
|
+
'have', 'has', 'had', 'do', 'does', 'did', 'will', 'would', 'could',
|
|
312
|
+
'should', 'may', 'might', 'shall', 'can', 'to', 'of', 'in', 'for',
|
|
313
|
+
'on', 'with', 'at', 'by', 'from', 'as', 'into', 'through', 'during',
|
|
314
|
+
'before', 'after', 'and', 'but', 'or', 'nor', 'not', 'so', 'yet',
|
|
315
|
+
'both', 'either', 'neither', 'each', 'every', 'all', 'any', 'few',
|
|
316
|
+
'more', 'most', 'other', 'some', 'such', 'no', 'only', 'same', 'than',
|
|
317
|
+
'too', 'very', 'just', 'because', 'if', 'when', 'while', 'that',
|
|
318
|
+
'this', 'these', 'those', 'it', 'its', 'they', 'them', 'their', 'we',
|
|
319
|
+
'our', 'you', 'your', 'he', 'she', 'his', 'her', 'i', 'me', 'my',
|
|
320
|
+
]);
|
|
321
|
+
const tokens = text
|
|
322
|
+
.toLowerCase()
|
|
323
|
+
.split(/[\s\-_./\\,;:!?()[\]{}'"]+/)
|
|
324
|
+
.filter(t => t.length > 1 && !stopWords.has(t));
|
|
325
|
+
// Deduplicate while preserving order
|
|
326
|
+
return [...new Set(tokens)];
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Score a file path against a list of keywords using TF-IDF-like matching.
|
|
330
|
+
* Checks both the full path and individual path segments.
|
|
331
|
+
*/
|
|
332
|
+
scoreFile(filePath, keywords) {
|
|
333
|
+
const pathLower = filePath.toLowerCase();
|
|
334
|
+
// Split the path into segments for matching
|
|
335
|
+
const segments = pathLower
|
|
336
|
+
.split(/[\\/.]/)
|
|
337
|
+
.filter(s => s.length > 0);
|
|
338
|
+
let score = 0;
|
|
339
|
+
for (const keyword of keywords) {
|
|
340
|
+
// Exact segment match is worth more
|
|
341
|
+
if (segments.includes(keyword)) {
|
|
342
|
+
score += 2.0;
|
|
343
|
+
}
|
|
344
|
+
// Substring match in the full path
|
|
345
|
+
else if (pathLower.includes(keyword)) {
|
|
346
|
+
score += 1.0;
|
|
347
|
+
}
|
|
348
|
+
// Partial match: keyword is a prefix of a segment or vice versa
|
|
349
|
+
else {
|
|
350
|
+
for (const segment of segments) {
|
|
351
|
+
if (segment.startsWith(keyword) || keyword.startsWith(segment)) {
|
|
352
|
+
score += 0.5;
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Normalize by keyword count to get a 0-1 range (roughly)
|
|
359
|
+
return keywords.length > 0 ? score / (keywords.length * 2.0) : 0;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
113
362
|
//# sourceMappingURL=agent-coordinator.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HNSW Legacy Bridge (ADR-071)
|
|
3
|
+
*
|
|
4
|
+
* Bridges the old IHNSWIndex interface (string keys, number[]) to the
|
|
5
|
+
* unified HnswAdapter which already provides string-ID APIs.
|
|
6
|
+
*
|
|
7
|
+
* Delegates ID mapping to HnswAdapter.addByStringId/searchByArray/removeByStringId
|
|
8
|
+
* instead of maintaining a duplicate in-memory map. This means the ID mapping
|
|
9
|
+
* lives in one place (the adapter) and stays consistent.
|
|
10
|
+
*
|
|
11
|
+
* Metadata is stored in a local Map since HnswAdapter does not track
|
|
12
|
+
* domain-specific CoverageVectorMetadata.
|
|
13
|
+
*
|
|
14
|
+
* @module kernel/hnsw-legacy-bridge
|
|
15
|
+
*/
|
|
16
|
+
import type { HnswAdapter } from './hnsw-adapter.js';
|
|
17
|
+
import type { IHNSWIndex, HNSWSearchResult, HNSWInsertItem, HNSWIndexStats, CoverageVectorMetadata } from '../domains/coverage-analysis/services/hnsw-index.js';
|
|
18
|
+
/**
|
|
19
|
+
* Adapts HnswAdapter (unified string+numeric ID interface) behind the
|
|
20
|
+
* old IHNSWIndex interface (string key interface).
|
|
21
|
+
*
|
|
22
|
+
* All ID mapping is delegated to HnswAdapter — no duplicate maps here.
|
|
23
|
+
*/
|
|
24
|
+
export declare class HnswLegacyBridge implements IHNSWIndex {
|
|
25
|
+
private readonly adapter;
|
|
26
|
+
private readonly metadataMap;
|
|
27
|
+
private insertCount;
|
|
28
|
+
constructor(adapter: HnswAdapter);
|
|
29
|
+
initialize(): Promise<void>;
|
|
30
|
+
insert(key: string, vector: number[], metadata?: CoverageVectorMetadata): Promise<void>;
|
|
31
|
+
search(query: number[], k: number): Promise<HNSWSearchResult[]>;
|
|
32
|
+
batchInsert(items: HNSWInsertItem[]): Promise<void>;
|
|
33
|
+
delete(key: string): Promise<boolean>;
|
|
34
|
+
getStats(): Promise<HNSWIndexStats>;
|
|
35
|
+
clear(): Promise<void>;
|
|
36
|
+
isNativeAvailable(): boolean;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=hnsw-legacy-bridge.d.ts.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HNSW Legacy Bridge (ADR-071)
|
|
3
|
+
*
|
|
4
|
+
* Bridges the old IHNSWIndex interface (string keys, number[]) to the
|
|
5
|
+
* unified HnswAdapter which already provides string-ID APIs.
|
|
6
|
+
*
|
|
7
|
+
* Delegates ID mapping to HnswAdapter.addByStringId/searchByArray/removeByStringId
|
|
8
|
+
* instead of maintaining a duplicate in-memory map. This means the ID mapping
|
|
9
|
+
* lives in one place (the adapter) and stays consistent.
|
|
10
|
+
*
|
|
11
|
+
* Metadata is stored in a local Map since HnswAdapter does not track
|
|
12
|
+
* domain-specific CoverageVectorMetadata.
|
|
13
|
+
*
|
|
14
|
+
* @module kernel/hnsw-legacy-bridge
|
|
15
|
+
*/
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// HnswLegacyBridge
|
|
18
|
+
// ============================================================================
|
|
19
|
+
/**
|
|
20
|
+
* Adapts HnswAdapter (unified string+numeric ID interface) behind the
|
|
21
|
+
* old IHNSWIndex interface (string key interface).
|
|
22
|
+
*
|
|
23
|
+
* All ID mapping is delegated to HnswAdapter — no duplicate maps here.
|
|
24
|
+
*/
|
|
25
|
+
export class HnswLegacyBridge {
|
|
26
|
+
adapter;
|
|
27
|
+
metadataMap = new Map();
|
|
28
|
+
insertCount = 0;
|
|
29
|
+
constructor(adapter) {
|
|
30
|
+
this.adapter = adapter;
|
|
31
|
+
}
|
|
32
|
+
// --------------------------------------------------------------------------
|
|
33
|
+
// IHNSWIndex Implementation
|
|
34
|
+
// --------------------------------------------------------------------------
|
|
35
|
+
async initialize() {
|
|
36
|
+
// Adapter is already initialized at construction
|
|
37
|
+
}
|
|
38
|
+
async insert(key, vector, metadata) {
|
|
39
|
+
this.adapter.addByStringId(key, vector);
|
|
40
|
+
this.insertCount++;
|
|
41
|
+
if (metadata) {
|
|
42
|
+
this.metadataMap.set(key, metadata);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async search(query, k) {
|
|
46
|
+
const results = this.adapter.searchByArray(query, k);
|
|
47
|
+
return results.map(r => ({
|
|
48
|
+
key: r.id,
|
|
49
|
+
score: r.score,
|
|
50
|
+
distance: 1 - r.score,
|
|
51
|
+
metadata: this.metadataMap.get(r.id),
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
async batchInsert(items) {
|
|
55
|
+
for (const item of items) {
|
|
56
|
+
await this.insert(item.key, item.vector, item.metadata);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async delete(key) {
|
|
60
|
+
const removed = this.adapter.removeByStringId(key);
|
|
61
|
+
if (removed) {
|
|
62
|
+
this.metadataMap.delete(key);
|
|
63
|
+
}
|
|
64
|
+
return removed;
|
|
65
|
+
}
|
|
66
|
+
async getStats() {
|
|
67
|
+
return {
|
|
68
|
+
nativeHNSW: true,
|
|
69
|
+
backendType: 'ruvector-gnn',
|
|
70
|
+
vectorCount: this.adapter.size(),
|
|
71
|
+
indexSizeBytes: this.adapter.size() * this.adapter.dimensions() * 4,
|
|
72
|
+
avgSearchLatencyMs: this.adapter.lastSearchLatencyMs,
|
|
73
|
+
p95SearchLatencyMs: 0,
|
|
74
|
+
p99SearchLatencyMs: 0,
|
|
75
|
+
searchOperations: 0,
|
|
76
|
+
insertOperations: this.insertCount,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
async clear() {
|
|
80
|
+
this.adapter.clear();
|
|
81
|
+
this.metadataMap.clear();
|
|
82
|
+
this.insertCount = 0;
|
|
83
|
+
}
|
|
84
|
+
isNativeAvailable() {
|
|
85
|
+
return true; // unified adapter is always available
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=hnsw-legacy-bridge.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
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 type { HnswAdapter } from './hnsw-adapter.js';
|
|
15
|
+
export interface ShadowValidationResult {
|
|
16
|
+
/** Total number of queries run */
|
|
17
|
+
totalQueries: number;
|
|
18
|
+
/** Number of queries where top-k sets diverged */
|
|
19
|
+
divergentQueries: number;
|
|
20
|
+
/** Divergence rate (0-1) */
|
|
21
|
+
divergenceRate: number;
|
|
22
|
+
/** Average Jaccard overlap of top-k result sets (1.0 = identical) */
|
|
23
|
+
avgJaccardOverlap: number;
|
|
24
|
+
/** Average score delta between old and new top-1 results */
|
|
25
|
+
avgTop1ScoreDelta: number;
|
|
26
|
+
/** Maximum observed score delta */
|
|
27
|
+
maxTop1ScoreDelta: number;
|
|
28
|
+
/** Whether the divergence rate meets the <2% go-criteria */
|
|
29
|
+
passesGoGate: boolean;
|
|
30
|
+
/** Per-query divergence details (only for divergent queries) */
|
|
31
|
+
divergences: DivergenceDetail[];
|
|
32
|
+
}
|
|
33
|
+
export interface DivergenceDetail {
|
|
34
|
+
queryIndex: number;
|
|
35
|
+
oldTopK: string[];
|
|
36
|
+
newTopK: string[];
|
|
37
|
+
jaccardOverlap: number;
|
|
38
|
+
top1ScoreDelta: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ShadowValidationOptions {
|
|
41
|
+
/** Number of nearest neighbors to compare (default: 10) */
|
|
42
|
+
k?: number;
|
|
43
|
+
/** Divergence rate threshold for pass/fail (default: 0.02 = 2%) */
|
|
44
|
+
threshold?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validates that the unified HnswAdapter produces results consistent
|
|
48
|
+
* with a brute-force reference search.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const validator = new HnswShadowValidator(adapter);
|
|
53
|
+
*
|
|
54
|
+
* // Add vectors to both the adapter and the validator's reference store
|
|
55
|
+
* validator.addVector('doc-1', embedding1);
|
|
56
|
+
* validator.addVector('doc-2', embedding2);
|
|
57
|
+
*
|
|
58
|
+
* // Run validation queries
|
|
59
|
+
* const queries = [randomEmbedding(), randomEmbedding()];
|
|
60
|
+
* const result = validator.validate(queries);
|
|
61
|
+
*
|
|
62
|
+
* console.log(`Divergence: ${(result.divergenceRate * 100).toFixed(1)}%`);
|
|
63
|
+
* console.log(`Passes: ${result.passesGoGate}`);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare class HnswShadowValidator {
|
|
67
|
+
private readonly adapter;
|
|
68
|
+
private readonly referenceVectors;
|
|
69
|
+
constructor(adapter: HnswAdapter);
|
|
70
|
+
/**
|
|
71
|
+
* Add a vector to both the unified adapter and the brute-force reference.
|
|
72
|
+
*/
|
|
73
|
+
addVector(id: string, vector: number[]): void;
|
|
74
|
+
/**
|
|
75
|
+
* Remove a vector from both stores.
|
|
76
|
+
*/
|
|
77
|
+
removeVector(id: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Get the number of vectors in the reference store.
|
|
80
|
+
*/
|
|
81
|
+
get size(): number;
|
|
82
|
+
/**
|
|
83
|
+
* Run N queries against both implementations and compare results.
|
|
84
|
+
*
|
|
85
|
+
* @param queries - Array of query vectors
|
|
86
|
+
* @param options - Validation options
|
|
87
|
+
* @returns Validation result with divergence metrics
|
|
88
|
+
*/
|
|
89
|
+
validate(queries: number[][], options?: ShadowValidationOptions): ShadowValidationResult;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=hnsw-shadow-validator.d.ts.map
|