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
|
@@ -880,6 +880,140 @@ export class AQELearningEngine {
|
|
|
880
880
|
this.initialized = false;
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
+
/**
|
|
884
|
+
* Default meta-learning configuration.
|
|
885
|
+
*/
|
|
886
|
+
export const DEFAULT_META_LEARNING_CONFIG = {
|
|
887
|
+
enabled: false,
|
|
888
|
+
snapshotIntervalMs: 300_000,
|
|
889
|
+
minSnapshotsForAnalysis: 5,
|
|
890
|
+
autoApplyThreshold: 0.8,
|
|
891
|
+
};
|
|
892
|
+
/**
|
|
893
|
+
* Meta-Learning Engine — closed-loop meta-optimization (ADR-062).
|
|
894
|
+
*
|
|
895
|
+
* Analyses a time-series of `UnifiedMetricsSnapshot`s to detect
|
|
896
|
+
* token-waste, quality plateaus, learning stalls, and performance
|
|
897
|
+
* regressions. Guarded by the `AQE_META_LEARNING_ENABLED` env var
|
|
898
|
+
* (opt-in, default `false`).
|
|
899
|
+
*/
|
|
900
|
+
export class MetaLearningEngine {
|
|
901
|
+
config;
|
|
902
|
+
constructor(config) {
|
|
903
|
+
this.config = { ...DEFAULT_META_LEARNING_CONFIG, ...config };
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Run a single meta-learning analysis cycle.
|
|
907
|
+
*
|
|
908
|
+
* Trend detection strategy: compare the first half of snapshots to the
|
|
909
|
+
* second half using simple averages. This keeps the implementation
|
|
910
|
+
* lightweight and predictable.
|
|
911
|
+
*
|
|
912
|
+
* @param snapshots - Ordered (oldest → newest) unified metric snapshots
|
|
913
|
+
* @returns Detected meta-insights (may be empty)
|
|
914
|
+
*/
|
|
915
|
+
runMetaLearningCycle(snapshots) {
|
|
916
|
+
// Feature-flag gate
|
|
917
|
+
if (process.env.AQE_META_LEARNING_ENABLED !== 'true') {
|
|
918
|
+
return [];
|
|
919
|
+
}
|
|
920
|
+
if (!this.config.enabled) {
|
|
921
|
+
return [];
|
|
922
|
+
}
|
|
923
|
+
if (snapshots.length < this.config.minSnapshotsForAnalysis) {
|
|
924
|
+
return [];
|
|
925
|
+
}
|
|
926
|
+
const mid = Math.floor(snapshots.length / 2);
|
|
927
|
+
const firstHalf = snapshots.slice(0, mid);
|
|
928
|
+
const secondHalf = snapshots.slice(mid);
|
|
929
|
+
const insights = [];
|
|
930
|
+
const now = Date.now();
|
|
931
|
+
// --- Token waste: cost increasing but savings flat ---
|
|
932
|
+
const avgCostFirst = avg(firstHalf.map(s => s.tokenMetrics.costUsd));
|
|
933
|
+
const avgCostSecond = avg(secondHalf.map(s => s.tokenMetrics.costUsd));
|
|
934
|
+
const avgSavingsFirst = avg(firstHalf.map(s => s.tokenMetrics.savingsUsd));
|
|
935
|
+
const avgSavingsSecond = avg(secondHalf.map(s => s.tokenMetrics.savingsUsd));
|
|
936
|
+
if (avgCostSecond > avgCostFirst * 1.1 && avgSavingsSecond <= avgSavingsFirst * 1.05) {
|
|
937
|
+
const confidence = Math.min(1, (avgCostSecond - avgCostFirst) / (avgCostFirst || 1));
|
|
938
|
+
insights.push({
|
|
939
|
+
id: `meta-tw-${now}`,
|
|
940
|
+
type: 'token-waste',
|
|
941
|
+
description: `Token cost increased by ${((avgCostSecond / (avgCostFirst || 1) - 1) * 100).toFixed(1)}% while savings remained flat`,
|
|
942
|
+
confidence: clamp01(confidence),
|
|
943
|
+
suggestedAction: 'Review cache configuration and increase pattern reuse thresholds',
|
|
944
|
+
detectedAt: now,
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
// --- Quality plateau: gatePassRate flat ---
|
|
948
|
+
const avgGateFirst = avg(firstHalf.map(s => s.qualityMetrics.gatePassRate));
|
|
949
|
+
const avgGateSecond = avg(secondHalf.map(s => s.qualityMetrics.gatePassRate));
|
|
950
|
+
const gateDelta = Math.abs(avgGateSecond - avgGateFirst);
|
|
951
|
+
if (gateDelta < 0.02 && snapshots.length >= this.config.minSnapshotsForAnalysis) {
|
|
952
|
+
insights.push({
|
|
953
|
+
id: `meta-qp-${now}`,
|
|
954
|
+
type: 'quality-plateau',
|
|
955
|
+
description: `Gate pass rate has been flat at ${(avgGateSecond * 100).toFixed(1)}% across ${snapshots.length} snapshots`,
|
|
956
|
+
confidence: clamp01(0.6 + (snapshots.length - this.config.minSnapshotsForAnalysis) * 0.05),
|
|
957
|
+
suggestedAction: 'Consider reviewing quality thresholds or adding new test coverage domains',
|
|
958
|
+
detectedAt: now,
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
// --- Learning stall: patternCount flat AND confidence flat ---
|
|
962
|
+
const avgPatFirst = avg(firstHalf.map(s => s.learningMetrics.patternCount));
|
|
963
|
+
const avgPatSecond = avg(secondHalf.map(s => s.learningMetrics.patternCount));
|
|
964
|
+
const avgConfFirst = avg(firstHalf.map(s => s.learningMetrics.averageConfidence));
|
|
965
|
+
const avgConfSecond = avg(secondHalf.map(s => s.learningMetrics.averageConfidence));
|
|
966
|
+
const patDelta = Math.abs(avgPatSecond - avgPatFirst);
|
|
967
|
+
const confDelta = Math.abs(avgConfSecond - avgConfFirst);
|
|
968
|
+
if (patDelta < 1 && confDelta < 0.02) {
|
|
969
|
+
insights.push({
|
|
970
|
+
id: `meta-ls-${now}`,
|
|
971
|
+
type: 'learning-stall',
|
|
972
|
+
description: `Pattern count (~${Math.round(avgPatSecond)}) and confidence (~${avgConfSecond.toFixed(2)}) have stagnated`,
|
|
973
|
+
confidence: clamp01(0.65 + (snapshots.length - this.config.minSnapshotsForAnalysis) * 0.04),
|
|
974
|
+
suggestedAction: 'Expand to new QE domains or lower pattern creation thresholds to encourage exploration',
|
|
975
|
+
detectedAt: now,
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
// --- Performance regression: p95 latency increasing ---
|
|
979
|
+
const avgP95First = avg(firstHalf.map(s => s.performanceMetrics.p95LatencyMs));
|
|
980
|
+
const avgP95Second = avg(secondHalf.map(s => s.performanceMetrics.p95LatencyMs));
|
|
981
|
+
if (avgP95Second > avgP95First * 1.2 && avgP95First > 0) {
|
|
982
|
+
const confidence = Math.min(1, (avgP95Second - avgP95First) / (avgP95First || 1));
|
|
983
|
+
insights.push({
|
|
984
|
+
id: `meta-pr-${now}`,
|
|
985
|
+
type: 'performance-regression',
|
|
986
|
+
description: `P95 latency increased from ${avgP95First.toFixed(0)}ms to ${avgP95Second.toFixed(0)}ms`,
|
|
987
|
+
confidence: clamp01(confidence),
|
|
988
|
+
suggestedAction: 'Profile hot paths and consider HNSW index tuning or batch size reduction',
|
|
989
|
+
detectedAt: now,
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
return insights;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Determine whether an insight should be auto-applied.
|
|
996
|
+
*
|
|
997
|
+
* @param insight - The insight to evaluate
|
|
998
|
+
* @param config - Meta-learning config with the auto-apply threshold
|
|
999
|
+
* @returns `true` if the insight's confidence meets or exceeds the threshold
|
|
1000
|
+
*/
|
|
1001
|
+
shouldAutoApply(insight, config) {
|
|
1002
|
+
const threshold = (config ?? this.config).autoApplyThreshold;
|
|
1003
|
+
return insight.confidence >= threshold;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
// --- Helpers -----------------------------------------------------------------
|
|
1007
|
+
/** Arithmetic mean; returns 0 for empty arrays. */
|
|
1008
|
+
function avg(values) {
|
|
1009
|
+
if (values.length === 0)
|
|
1010
|
+
return 0;
|
|
1011
|
+
return values.reduce((a, b) => a + b, 0) / values.length;
|
|
1012
|
+
}
|
|
1013
|
+
/** Clamp a number into [0, 1]. */
|
|
1014
|
+
function clamp01(v) {
|
|
1015
|
+
return Math.max(0, Math.min(1, v));
|
|
1016
|
+
}
|
|
883
1017
|
// ============================================================================
|
|
884
1018
|
// Factory Functions
|
|
885
1019
|
// ============================================================================
|
|
@@ -106,6 +106,9 @@ export declare class DreamEngine {
|
|
|
106
106
|
/** Optional witness chain for audit trail of dream decisions (ADR-070) */
|
|
107
107
|
private _witnessChain;
|
|
108
108
|
set witnessChain(wc: WitnessChain | null);
|
|
109
|
+
/** Optional RVF adapter for COW branching (ADR-069). Set externally to share with PatternStore. */
|
|
110
|
+
private _rvfAdapter;
|
|
111
|
+
set rvfAdapter(adapter: any);
|
|
109
112
|
constructor(config?: Partial<DreamConfig>);
|
|
110
113
|
/**
|
|
111
114
|
* Initialize using unified persistence
|
|
@@ -203,7 +206,9 @@ export declare class DreamEngine {
|
|
|
203
206
|
private rowToInsight;
|
|
204
207
|
}
|
|
205
208
|
/**
|
|
206
|
-
* Create a new DreamEngine instance
|
|
209
|
+
* Create a new DreamEngine instance.
|
|
210
|
+
* When useRVFPatternStore is enabled, auto-wires the RVF adapter for
|
|
211
|
+
* COW branching (ADR-069) so callers don't need to set it manually.
|
|
207
212
|
*/
|
|
208
213
|
export declare function createDreamEngine(config?: Partial<DreamConfig>): DreamEngine;
|
|
209
214
|
export default DreamEngine;
|
|
@@ -212,6 +212,11 @@ export class DreamEngine {
|
|
|
212
212
|
/** Optional witness chain for audit trail of dream decisions (ADR-070) */
|
|
213
213
|
_witnessChain = null;
|
|
214
214
|
set witnessChain(wc) { this._witnessChain = wc; }
|
|
215
|
+
/** Optional RVF adapter for COW branching (ADR-069). Set externally to share with PatternStore. */
|
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
217
|
+
_rvfAdapter = null;
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
219
|
+
set rvfAdapter(adapter) { this._rvfAdapter = adapter; }
|
|
215
220
|
constructor(config) {
|
|
216
221
|
this.config = { ...DEFAULT_DREAM_CONFIG, ...config };
|
|
217
222
|
}
|
|
@@ -238,6 +243,12 @@ export class DreamEngine {
|
|
|
238
243
|
// Initialize RVCOW branch manager (ADR-069)
|
|
239
244
|
if (this.config.enableBranching) {
|
|
240
245
|
this.branchManager = new RVCOWBranchManager(this.db, this.config.branchValidationThresholds);
|
|
246
|
+
// ADR-069: Wire RVF adapter for true COW branching when available
|
|
247
|
+
// Uses externally-provided adapter to avoid duplicate file handles
|
|
248
|
+
if (this._rvfAdapter) {
|
|
249
|
+
this.branchManager.setRvfAdapter(this._rvfAdapter, true);
|
|
250
|
+
console.log('[DreamEngine] RVF COW branching activated (ADR-069)');
|
|
251
|
+
}
|
|
241
252
|
}
|
|
242
253
|
this.initialized = true;
|
|
243
254
|
console.log(`[DreamEngine] Initialized: ${this.persistence.getDbPath()}`);
|
|
@@ -710,10 +721,34 @@ export class DreamEngine {
|
|
|
710
721
|
// Factory Function
|
|
711
722
|
// ============================================================================
|
|
712
723
|
/**
|
|
713
|
-
* Create a new DreamEngine instance
|
|
724
|
+
* Create a new DreamEngine instance.
|
|
725
|
+
* When useRVFPatternStore is enabled, auto-wires the RVF adapter for
|
|
726
|
+
* COW branching (ADR-069) so callers don't need to set it manually.
|
|
714
727
|
*/
|
|
715
728
|
export function createDreamEngine(config) {
|
|
716
|
-
|
|
729
|
+
const engine = new DreamEngine(config);
|
|
730
|
+
// ADR-069: Auto-wire RVF adapter from the shared singleton (M4 fix).
|
|
731
|
+
// Uses the same adapter instance as the kernel to avoid dual file handles.
|
|
732
|
+
// Dynamic import() for ESM compatibility — wiring resolves before
|
|
733
|
+
// engine.initialize() is called since callers always await that.
|
|
734
|
+
import('../../integrations/ruvector/feature-flags.js')
|
|
735
|
+
.then(({ isRVFPatternStoreEnabled }) => {
|
|
736
|
+
if (!isRVFPatternStoreEnabled())
|
|
737
|
+
return null;
|
|
738
|
+
return import('../../integrations/ruvector/shared-rvf-adapter.js');
|
|
739
|
+
})
|
|
740
|
+
.then((mod) => {
|
|
741
|
+
if (!mod)
|
|
742
|
+
return;
|
|
743
|
+
const adapter = mod.getSharedRvfAdapter();
|
|
744
|
+
if (adapter) {
|
|
745
|
+
engine.rvfAdapter = adapter;
|
|
746
|
+
}
|
|
747
|
+
})
|
|
748
|
+
.catch(() => {
|
|
749
|
+
// RVF adapter wiring is best-effort — DreamEngine works without it
|
|
750
|
+
});
|
|
751
|
+
return engine;
|
|
717
752
|
}
|
|
718
753
|
export default DreamEngine;
|
|
719
754
|
//# sourceMappingURL=dream-engine.js.map
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { EventBus, MemoryBackend } from '../../kernel/interfaces.js';
|
|
16
16
|
import type { DreamEngine, DreamCycleResult } from './dream-engine.js';
|
|
17
|
+
import { type MetaInsight } from '../aqe-learning-engine.js';
|
|
17
18
|
/**
|
|
18
19
|
* Configuration for the DreamScheduler
|
|
19
20
|
*/
|
|
@@ -150,6 +151,13 @@ export declare class DreamScheduler {
|
|
|
150
151
|
private totalDreamsCompleted;
|
|
151
152
|
private subscriptions;
|
|
152
153
|
private lastDreamResult;
|
|
154
|
+
private readonly metaLearningEngine;
|
|
155
|
+
private readonly metaLearningSnapshots;
|
|
156
|
+
private metricsTracker;
|
|
157
|
+
private static readonly MAX_META_SNAPSHOTS;
|
|
158
|
+
/** Queryable store of detected meta-learning insights (Gap 1: persist, not just log) */
|
|
159
|
+
private readonly detectedInsights;
|
|
160
|
+
private static readonly MAX_DETECTED_INSIGHTS;
|
|
153
161
|
/**
|
|
154
162
|
* Create a new DreamScheduler instance.
|
|
155
163
|
*
|
|
@@ -231,6 +239,17 @@ export declare class DreamScheduler {
|
|
|
231
239
|
* @returns Last dream result or null
|
|
232
240
|
*/
|
|
233
241
|
getLastDreamResult(): DreamCycleResult | null;
|
|
242
|
+
/**
|
|
243
|
+
* Return all detected meta-learning insights (most recent first).
|
|
244
|
+
*
|
|
245
|
+
* Gap 1 fix: insights are now stored in-memory rather than only logged,
|
|
246
|
+
* making them queryable by other subsystems (e.g., PatternStore consumers,
|
|
247
|
+
* quality gates, or dashboards).
|
|
248
|
+
*
|
|
249
|
+
* @param limit - Maximum number of insights to return (default: all)
|
|
250
|
+
* @returns Array of MetaInsight objects, newest first
|
|
251
|
+
*/
|
|
252
|
+
getMetaInsights(limit?: number): MetaInsight[];
|
|
234
253
|
/**
|
|
235
254
|
* Execute a dream cycle with the specified duration.
|
|
236
255
|
*/
|
|
@@ -239,6 +258,12 @@ export declare class DreamScheduler {
|
|
|
239
258
|
* Auto-apply insights that meet the confidence threshold.
|
|
240
259
|
*/
|
|
241
260
|
private autoApplyInsights;
|
|
261
|
+
/**
|
|
262
|
+
* Collect a metrics snapshot and, if enough have accumulated, run a
|
|
263
|
+
* meta-learning analysis cycle to detect token-waste, quality plateaus,
|
|
264
|
+
* learning stalls, and performance regressions.
|
|
265
|
+
*/
|
|
266
|
+
private runPostDreamMetaLearning;
|
|
242
267
|
/**
|
|
243
268
|
* Schedule the next automatic dream.
|
|
244
269
|
*/
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
16
|
import { LoggerFactory } from '../../logging/index.js';
|
|
17
|
+
// ADR-062: Meta-learning integration
|
|
18
|
+
import { MetaLearningEngine, DEFAULT_META_LEARNING_CONFIG, } from '../aqe-learning-engine.js';
|
|
19
|
+
import { LearningMetricsTracker, } from '../metrics-tracker.js';
|
|
17
20
|
const logger = LoggerFactory.create('DreamScheduler');
|
|
18
21
|
/**
|
|
19
22
|
* Default DreamScheduler configuration
|
|
@@ -94,6 +97,14 @@ export class DreamScheduler {
|
|
|
94
97
|
subscriptions = [];
|
|
95
98
|
// Last result
|
|
96
99
|
lastDreamResult = null;
|
|
100
|
+
// ADR-062: Meta-learning integration
|
|
101
|
+
metaLearningEngine;
|
|
102
|
+
metaLearningSnapshots = [];
|
|
103
|
+
metricsTracker = null;
|
|
104
|
+
static MAX_META_SNAPSHOTS = 20;
|
|
105
|
+
/** Queryable store of detected meta-learning insights (Gap 1: persist, not just log) */
|
|
106
|
+
detectedInsights = [];
|
|
107
|
+
static MAX_DETECTED_INSIGHTS = 100;
|
|
97
108
|
/**
|
|
98
109
|
* Create a new DreamScheduler instance.
|
|
99
110
|
*
|
|
@@ -113,6 +124,8 @@ export class DreamScheduler {
|
|
|
113
124
|
this.eventBus = dependencies.eventBus;
|
|
114
125
|
this.memoryBackend = dependencies.memoryBackend;
|
|
115
126
|
this.config = { ...DEFAULT_DREAM_SCHEDULER_CONFIG, ...config };
|
|
127
|
+
// ADR-062: Initialize meta-learning engine
|
|
128
|
+
this.metaLearningEngine = new MetaLearningEngine();
|
|
116
129
|
}
|
|
117
130
|
// ==========================================================================
|
|
118
131
|
// Lifecycle Methods
|
|
@@ -177,6 +190,11 @@ export class DreamScheduler {
|
|
|
177
190
|
subscription.unsubscribe();
|
|
178
191
|
}
|
|
179
192
|
this.subscriptions = [];
|
|
193
|
+
// Close meta-learning metrics tracker if initialized
|
|
194
|
+
if (this.metricsTracker) {
|
|
195
|
+
this.metricsTracker.close();
|
|
196
|
+
this.metricsTracker = null;
|
|
197
|
+
}
|
|
180
198
|
// Save state before disposing
|
|
181
199
|
await this.saveState();
|
|
182
200
|
this.initialized = false;
|
|
@@ -288,6 +306,21 @@ export class DreamScheduler {
|
|
|
288
306
|
getLastDreamResult() {
|
|
289
307
|
return this.lastDreamResult;
|
|
290
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Return all detected meta-learning insights (most recent first).
|
|
311
|
+
*
|
|
312
|
+
* Gap 1 fix: insights are now stored in-memory rather than only logged,
|
|
313
|
+
* making them queryable by other subsystems (e.g., PatternStore consumers,
|
|
314
|
+
* quality gates, or dashboards).
|
|
315
|
+
*
|
|
316
|
+
* @param limit - Maximum number of insights to return (default: all)
|
|
317
|
+
* @returns Array of MetaInsight objects, newest first
|
|
318
|
+
*/
|
|
319
|
+
getMetaInsights(limit) {
|
|
320
|
+
// Return newest first (reverse of insertion order)
|
|
321
|
+
const reversed = [...this.detectedInsights].reverse();
|
|
322
|
+
return limit !== undefined ? reversed.slice(0, limit) : reversed;
|
|
323
|
+
}
|
|
291
324
|
// ==========================================================================
|
|
292
325
|
// Private: Dream Execution
|
|
293
326
|
// ==========================================================================
|
|
@@ -320,6 +353,18 @@ export class DreamScheduler {
|
|
|
320
353
|
}
|
|
321
354
|
// Publish dream completed event
|
|
322
355
|
await this.publishDreamCompletedEvent(result);
|
|
356
|
+
// ADR-062: Run meta-learning analysis after dream cycle
|
|
357
|
+
if (process.env.AQE_META_LEARNING_ENABLED === 'true') {
|
|
358
|
+
try {
|
|
359
|
+
await this.runPostDreamMetaLearning();
|
|
360
|
+
}
|
|
361
|
+
catch (metaErr) {
|
|
362
|
+
// Meta-learning failure must never break dream cycles
|
|
363
|
+
logger.warn('Post-dream meta-learning failed (non-critical)', {
|
|
364
|
+
error: metaErr instanceof Error ? metaErr.message : String(metaErr),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
}
|
|
323
368
|
// Reschedule next dream if running
|
|
324
369
|
if (this.running) {
|
|
325
370
|
this.scheduleNextDream();
|
|
@@ -350,6 +395,81 @@ export class DreamScheduler {
|
|
|
350
395
|
}
|
|
351
396
|
}
|
|
352
397
|
// ==========================================================================
|
|
398
|
+
// Private: Meta-Learning (ADR-062)
|
|
399
|
+
// ==========================================================================
|
|
400
|
+
/**
|
|
401
|
+
* Collect a metrics snapshot and, if enough have accumulated, run a
|
|
402
|
+
* meta-learning analysis cycle to detect token-waste, quality plateaus,
|
|
403
|
+
* learning stalls, and performance regressions.
|
|
404
|
+
*/
|
|
405
|
+
async runPostDreamMetaLearning() {
|
|
406
|
+
// Lazily initialize the metrics tracker
|
|
407
|
+
if (!this.metricsTracker) {
|
|
408
|
+
this.metricsTracker = new LearningMetricsTracker();
|
|
409
|
+
await this.metricsTracker.initialize();
|
|
410
|
+
}
|
|
411
|
+
// Collect a unified snapshot
|
|
412
|
+
const snapshot = await this.metricsTracker.collectUnifiedSnapshot();
|
|
413
|
+
this.metaLearningSnapshots.push(snapshot);
|
|
414
|
+
// Cap the buffer at MAX_META_SNAPSHOTS (keep most recent)
|
|
415
|
+
while (this.metaLearningSnapshots.length > DreamScheduler.MAX_META_SNAPSHOTS) {
|
|
416
|
+
this.metaLearningSnapshots.shift();
|
|
417
|
+
}
|
|
418
|
+
// Run meta-learning if we have enough snapshots
|
|
419
|
+
const minRequired = DEFAULT_META_LEARNING_CONFIG.minSnapshotsForAnalysis;
|
|
420
|
+
if (this.metaLearningSnapshots.length >= minRequired) {
|
|
421
|
+
const insights = this.metaLearningEngine.runMetaLearningCycle(this.metaLearningSnapshots);
|
|
422
|
+
if (insights.length > 0) {
|
|
423
|
+
logger.info('Meta-learning insights detected', {
|
|
424
|
+
count: insights.length,
|
|
425
|
+
types: insights.map(i => i.type),
|
|
426
|
+
});
|
|
427
|
+
// Gap 1: Store insights in queryable in-memory buffer (not just logs)
|
|
428
|
+
for (const insight of insights) {
|
|
429
|
+
logger.info(`Meta-insight [${insight.type}]: ${insight.description}`, {
|
|
430
|
+
confidence: insight.confidence.toFixed(2),
|
|
431
|
+
suggestedAction: insight.suggestedAction,
|
|
432
|
+
});
|
|
433
|
+
this.detectedInsights.push(insight);
|
|
434
|
+
}
|
|
435
|
+
// Cap the insights buffer at MAX_DETECTED_INSIGHTS (keep most recent)
|
|
436
|
+
while (this.detectedInsights.length > DreamScheduler.MAX_DETECTED_INSIGHTS) {
|
|
437
|
+
this.detectedInsights.shift();
|
|
438
|
+
}
|
|
439
|
+
// Publish event so other subsystems can react to meta-learning insights
|
|
440
|
+
try {
|
|
441
|
+
this.eventBus.publish({
|
|
442
|
+
id: uuidv4(),
|
|
443
|
+
type: 'meta-learning.insight-detected',
|
|
444
|
+
timestamp: new Date(),
|
|
445
|
+
source: 'learning-optimization',
|
|
446
|
+
payload: {
|
|
447
|
+
count: insights.length,
|
|
448
|
+
insights: insights.map(i => ({
|
|
449
|
+
id: i.id,
|
|
450
|
+
type: i.type,
|
|
451
|
+
description: i.description,
|
|
452
|
+
confidence: i.confidence,
|
|
453
|
+
suggestedAction: i.suggestedAction,
|
|
454
|
+
detectedAt: i.detectedAt,
|
|
455
|
+
})),
|
|
456
|
+
},
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
catch {
|
|
460
|
+
// Event publishing is best-effort; insight storage above is the primary mechanism
|
|
461
|
+
logger.debug('Failed to publish meta-learning insight event');
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
logger.debug('Meta-learning: accumulating snapshots', {
|
|
467
|
+
current: this.metaLearningSnapshots.length,
|
|
468
|
+
required: minRequired,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
// ==========================================================================
|
|
353
473
|
// Private: Scheduling
|
|
354
474
|
// ==========================================================================
|
|
355
475
|
/**
|
|
@@ -102,7 +102,8 @@ export declare class RVCOWBranchManager {
|
|
|
102
102
|
private listeners;
|
|
103
103
|
/** Optional RVF native adapter for COW fork snapshots of dream state */
|
|
104
104
|
private rvfAdapter?;
|
|
105
|
-
/** When true and rvfAdapter is set, createBranch() also forks an RVF snapshot
|
|
105
|
+
/** When true and rvfAdapter is set, createBranch() also forks an RVF snapshot.
|
|
106
|
+
* Driven by isRVFPatternStoreEnabled() feature flag when adapter is present. */
|
|
106
107
|
private useRvfFork;
|
|
107
108
|
/** Optional witness chain for audit trail of branch operations (ADR-070) */
|
|
108
109
|
private _witnessChain;
|
|
@@ -110,8 +111,8 @@ export declare class RVCOWBranchManager {
|
|
|
110
111
|
constructor(db: DatabaseType, thresholds?: ValidationThresholds);
|
|
111
112
|
/**
|
|
112
113
|
* Set an RVF native adapter for supplementary COW fork snapshots.
|
|
113
|
-
* When set
|
|
114
|
-
*
|
|
114
|
+
* When set, useRvfFork is driven by the isRVFPatternStoreEnabled()
|
|
115
|
+
* feature flag (defaults to the explicit param if flag check fails).
|
|
115
116
|
* SQLite savepoints remain the primary branching mechanism.
|
|
116
117
|
*/
|
|
117
118
|
setRvfAdapter(adapter: any, useRvfFork?: boolean): void;
|
|
@@ -168,6 +169,8 @@ export declare class RVCOWBranchManager {
|
|
|
168
169
|
*/
|
|
169
170
|
captureBaseline(): QualityBaseline;
|
|
170
171
|
private ensureBranchActive;
|
|
172
|
+
/** Clean up RVF branch file and child adapter (ADR-069) */
|
|
173
|
+
private cleanupRvfBranch;
|
|
171
174
|
private sanitizeSavepointName;
|
|
172
175
|
private emit;
|
|
173
176
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @module learning/dream/rvcow-branch-manager
|
|
17
17
|
*/
|
|
18
|
+
import { existsSync, unlinkSync } from 'fs';
|
|
18
19
|
/** Default validation thresholds */
|
|
19
20
|
export const DEFAULT_VALIDATION_THRESHOLDS = {
|
|
20
21
|
maxPatternCountDrop: 0.05,
|
|
@@ -48,7 +49,8 @@ export class RVCOWBranchManager {
|
|
|
48
49
|
/** Optional RVF native adapter for COW fork snapshots of dream state */
|
|
49
50
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
51
|
rvfAdapter;
|
|
51
|
-
/** When true and rvfAdapter is set, createBranch() also forks an RVF snapshot
|
|
52
|
+
/** When true and rvfAdapter is set, createBranch() also forks an RVF snapshot.
|
|
53
|
+
* Driven by isRVFPatternStoreEnabled() feature flag when adapter is present. */
|
|
52
54
|
useRvfFork = false;
|
|
53
55
|
/** Optional witness chain for audit trail of branch operations (ADR-070) */
|
|
54
56
|
_witnessChain = null;
|
|
@@ -59,14 +61,23 @@ export class RVCOWBranchManager {
|
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
61
63
|
* Set an RVF native adapter for supplementary COW fork snapshots.
|
|
62
|
-
* When set
|
|
63
|
-
*
|
|
64
|
+
* When set, useRvfFork is driven by the isRVFPatternStoreEnabled()
|
|
65
|
+
* feature flag (defaults to the explicit param if flag check fails).
|
|
64
66
|
* SQLite savepoints remain the primary branching mechanism.
|
|
65
67
|
*/
|
|
66
68
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
69
|
setRvfAdapter(adapter, useRvfFork = true) {
|
|
68
70
|
this.rvfAdapter = adapter;
|
|
71
|
+
// ADR-069: Link to feature flag so RVF fork follows the same toggle.
|
|
72
|
+
// Use dynamic import() for ESM safety; fall back to explicit param.
|
|
69
73
|
this.useRvfFork = useRvfFork;
|
|
74
|
+
import('../../integrations/ruvector/feature-flags.js')
|
|
75
|
+
.then(({ isRVFPatternStoreEnabled }) => {
|
|
76
|
+
this.useRvfFork = isRVFPatternStoreEnabled();
|
|
77
|
+
})
|
|
78
|
+
.catch(() => {
|
|
79
|
+
// Keep the explicit useRvfFork param value
|
|
80
|
+
});
|
|
70
81
|
}
|
|
71
82
|
// --------------------------------------------------------------------------
|
|
72
83
|
// Branch Lifecycle
|
|
@@ -95,10 +106,15 @@ export class RVCOWBranchManager {
|
|
|
95
106
|
status: 'active',
|
|
96
107
|
baselineSnapshot: baseline,
|
|
97
108
|
};
|
|
98
|
-
//
|
|
109
|
+
// ADR-069: RVF COW branch for true isolation (when configured)
|
|
110
|
+
// Creates a lightweight derived .rvf alongside the SQLite savepoint
|
|
99
111
|
if (this.rvfAdapter && this.useRvfFork) {
|
|
100
112
|
try {
|
|
101
|
-
|
|
113
|
+
const branchPath = `/tmp/dream-branch-${safeName}.rvf`;
|
|
114
|
+
const childAdapter = this.rvfAdapter.derive(branchPath);
|
|
115
|
+
const branchExt = branch;
|
|
116
|
+
branchExt._rvfBranchPath = branchPath;
|
|
117
|
+
branchExt._rvfChildAdapter = childAdapter;
|
|
102
118
|
}
|
|
103
119
|
catch {
|
|
104
120
|
// RVF fork is best-effort — SQLite savepoint is the primary mechanism
|
|
@@ -153,6 +169,25 @@ export class RVCOWBranchManager {
|
|
|
153
169
|
`(${(lossFraction * 100).toFixed(1)}%, threshold: ${(this.thresholds.maxHighConfidenceLoss * 100).toFixed(1)}%)`);
|
|
154
170
|
}
|
|
155
171
|
}
|
|
172
|
+
// Check 4 (ADR-069): Search recall comparison — verify dream didn't degrade retrieval
|
|
173
|
+
if (this.rvfAdapter && this.useRvfFork && base.patternCount > 0) {
|
|
174
|
+
try {
|
|
175
|
+
const dim = this.rvfAdapter.dimension?.() ?? 384;
|
|
176
|
+
// Run a benchmark query with a random-ish vector
|
|
177
|
+
const benchQuery = new Float32Array(dim);
|
|
178
|
+
for (let i = 0; i < dim; i++)
|
|
179
|
+
benchQuery[i] = Math.sin(i * 0.1);
|
|
180
|
+
const preResults = this.rvfAdapter.search?.(benchQuery, 10) ?? [];
|
|
181
|
+
// If search returns fewer results post-dream, recall may have degraded
|
|
182
|
+
if (preResults.length < Math.min(5, base.patternCount)) {
|
|
183
|
+
reasons.push(`Search recall degraded: only ${preResults.length} results returned (expected ≥${Math.min(5, base.patternCount)})`);
|
|
184
|
+
// Advisory — don't fail the gate for recall alone
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
// Recall check is advisory — don't block on errors
|
|
189
|
+
}
|
|
190
|
+
}
|
|
156
191
|
const reason = passed
|
|
157
192
|
? 'All quality checks passed'
|
|
158
193
|
: `Validation failed: ${reasons.join('; ')}`;
|
|
@@ -177,6 +212,7 @@ export class RVCOWBranchManager {
|
|
|
177
212
|
this.db.exec(`RELEASE SAVEPOINT "${safeName}"`);
|
|
178
213
|
branch.status = 'merged';
|
|
179
214
|
this.activeBranches.delete(branch.name);
|
|
215
|
+
this.cleanupRvfBranch(branch);
|
|
180
216
|
this.emit('dream:branch_merged', branch);
|
|
181
217
|
try {
|
|
182
218
|
this._witnessChain?.append('BRANCH_MERGE', {
|
|
@@ -199,6 +235,7 @@ export class RVCOWBranchManager {
|
|
|
199
235
|
this.db.exec(`RELEASE SAVEPOINT "${safeName}"`);
|
|
200
236
|
branch.status = 'discarded';
|
|
201
237
|
this.activeBranches.delete(branch.name);
|
|
238
|
+
this.cleanupRvfBranch(branch);
|
|
202
239
|
this.emit('dream:branch_discarded', branch);
|
|
203
240
|
}
|
|
204
241
|
/**
|
|
@@ -254,6 +291,24 @@ export class RVCOWBranchManager {
|
|
|
254
291
|
throw new Error(`Branch '${name}' is ${branch.status}, not active`);
|
|
255
292
|
}
|
|
256
293
|
}
|
|
294
|
+
/** Clean up RVF branch file and child adapter (ADR-069) */
|
|
295
|
+
cleanupRvfBranch(branch) {
|
|
296
|
+
const ext = branch;
|
|
297
|
+
// Close child adapter if present
|
|
298
|
+
try {
|
|
299
|
+
const child = ext._rvfChildAdapter;
|
|
300
|
+
child?.close?.();
|
|
301
|
+
}
|
|
302
|
+
catch { /* best effort */ }
|
|
303
|
+
// Delete the temp .rvf file
|
|
304
|
+
try {
|
|
305
|
+
const branchPath = ext._rvfBranchPath;
|
|
306
|
+
if (branchPath && existsSync(branchPath)) {
|
|
307
|
+
unlinkSync(branchPath);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
catch { /* best effort */ }
|
|
311
|
+
}
|
|
257
312
|
sanitizeSavepointName(name) {
|
|
258
313
|
// Replace non-alphanumeric characters (except hyphens/underscores) with underscores
|
|
259
314
|
return name.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
@@ -16,7 +16,7 @@ import type { MemoryBackend, EventBus } from '../kernel/interfaces.js';
|
|
|
16
16
|
import type { Result } from '../shared/types/index.js';
|
|
17
17
|
import type { WitnessChain } from '../governance/witness-chain.js';
|
|
18
18
|
import type { QEDomain } from './qe-patterns.js';
|
|
19
|
-
import type {
|
|
19
|
+
import type { IPatternStore } from './pattern-store.js';
|
|
20
20
|
/**
|
|
21
21
|
* Test outcome categories for binary reward assignment (GRPO-inspired).
|
|
22
22
|
* Maps discrete test outcomes to reward signals for pattern learning.
|
|
@@ -169,7 +169,7 @@ export declare class ExperienceCaptureService {
|
|
|
169
169
|
private sessionCaptureCount;
|
|
170
170
|
/** Optional witness chain for attaching audit receipts to experiences */
|
|
171
171
|
private witnessChain?;
|
|
172
|
-
constructor(memory: MemoryBackend, patternStore?:
|
|
172
|
+
constructor(memory: MemoryBackend, patternStore?: IPatternStore | undefined, eventBus?: EventBus | undefined, config?: Partial<ExperienceCaptureConfig>);
|
|
173
173
|
/**
|
|
174
174
|
* Set the witness chain for attaching audit receipts to captured experiences.
|
|
175
175
|
* Only creates witness records when the useWitnessChain feature flag is enabled.
|
|
@@ -324,5 +324,5 @@ export declare class ExperienceCaptureService {
|
|
|
324
324
|
/**
|
|
325
325
|
* Create experience capture service
|
|
326
326
|
*/
|
|
327
|
-
export declare function createExperienceCaptureService(memory: MemoryBackend, patternStore?:
|
|
327
|
+
export declare function createExperienceCaptureService(memory: MemoryBackend, patternStore?: IPatternStore, eventBus?: EventBus, config?: Partial<ExperienceCaptureConfig>): ExperienceCaptureService;
|
|
328
328
|
//# sourceMappingURL=experience-capture.d.ts.map
|