agentic-qe 3.9.25 → 3.9.27
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 +173 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/bridge/captured-experience-bridge.d.ts +40 -0
- package/dist/bridge/captured-experience-bridge.js +232 -0
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-T3LXVVV6.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-3JH5PJWN.js → agent-booster-wasm-ITOX2PFK.js} +2 -2
- package/dist/cli/chunks/{agent-handler-3FEJU2TM.js → agent-handler-NGVDEBFM.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-FCLJ7NQB.js → agent-memory-branch-6WLQE4UP.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-NDMVUAJB.js +2 -0
- package/dist/cli/chunks/{audit-FSLEJMM5.js → audit-KTNR6LYC.js} +2 -2
- package/dist/cli/chunks/base-NQRD32GI.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-KUWXTCD4.js → better-sqlite3-ROUVYY3W.js} +2 -2
- package/dist/cli/chunks/{brain-handler-IVRXCPLL.js → brain-handler-ZFLB6Q37.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-EXW3AFAQ.js → branch-enumerator-SONBYE7U.js} +2 -2
- package/dist/cli/chunks/{browser-3J6OTKWZ.js → browser-D6YYID5Y.js} +2 -2
- package/dist/cli/chunks/browser-workflow-WSAEHMFE.js +2 -0
- package/dist/cli/chunks/{chunk-I5AVFRDJ.js → chunk-2IKQT3IF.js} +1 -1
- package/dist/cli/chunks/{chunk-LTWNVZDR.js → chunk-2J3B4ONK.js} +2 -2
- package/dist/cli/chunks/{chunk-4ASWQOFE.js → chunk-2MO2U3NO.js} +2 -2
- package/dist/cli/chunks/{chunk-MYDJYPBT.js → chunk-2O6XVANK.js} +2 -2
- package/dist/cli/chunks/{chunk-MP4GPPOD.js → chunk-2SEXNZIJ.js} +2 -2
- package/dist/cli/chunks/{chunk-3ITRVWXL.js → chunk-2UPD2NX5.js} +1 -1
- package/dist/cli/chunks/{chunk-XNXFB4TV.js → chunk-2Z2DD5YW.js} +2 -2
- package/dist/cli/chunks/{chunk-73SK2MNU.js → chunk-3BTSXIJ3.js} +2 -2
- package/dist/cli/chunks/{chunk-MMWH7D2O.js → chunk-4AWB4BKC.js} +2 -2
- package/dist/cli/chunks/{chunk-75PD5ATI.js → chunk-4DTF53TE.js} +2 -2
- package/dist/cli/chunks/{chunk-P6REB3IC.js → chunk-4K7KTT4Q.js} +1 -1
- package/dist/cli/chunks/{chunk-OGBDSSVO.js → chunk-4SLL4YG2.js} +2 -2
- package/dist/cli/chunks/{chunk-OJ7RJC7F.js → chunk-4Z2KY7N3.js} +1 -1
- package/dist/cli/chunks/{chunk-DNIU6W6Z.js → chunk-5DDRRXKR.js} +2 -2
- package/dist/cli/chunks/{chunk-7QILWWRD.js → chunk-5GBDMANM.js} +2 -2
- package/dist/cli/chunks/{chunk-FHKQSSQT.js → chunk-5W3XL5YW.js} +2 -2
- package/dist/cli/chunks/{chunk-4DVQS5LA.js → chunk-5WPQATT7.js} +2 -2
- package/dist/cli/chunks/{chunk-W7ULVE22.js → chunk-6BGF3VZJ.js} +2 -2
- package/dist/cli/chunks/{chunk-XXG6OQSR.js → chunk-6BIHLI3A.js} +25 -9
- package/dist/cli/chunks/{chunk-M4F7EAR6.js → chunk-6IYCOEW7.js} +2 -2
- package/dist/cli/chunks/{chunk-XMYX6HAG.js → chunk-6R2OTCWG.js} +2 -2
- package/dist/cli/chunks/{chunk-J2O5RRNH.js → chunk-7EC2C5QP.js} +1 -1
- package/dist/cli/chunks/{chunk-3LSHQUQ2.js → chunk-7QXW6HLF.js} +2 -2
- package/dist/cli/chunks/{chunk-QJKXAYOM.js → chunk-A4QYEA22.js} +2 -2
- package/dist/cli/chunks/{chunk-M4GE3R5K.js → chunk-A7D5532X.js} +2 -2
- package/dist/cli/chunks/{chunk-AZ3GC5UX.js → chunk-AAYGZTW3.js} +3 -3
- package/dist/cli/chunks/{chunk-T5WFV3EH.js → chunk-ADU5MOQE.js} +1 -1
- package/dist/cli/chunks/{chunk-ILIKB32B.js → chunk-BT5YOORE.js} +2 -2
- package/dist/cli/chunks/{chunk-FO3VJDCI.js → chunk-BZNIVIZE.js} +1 -1
- package/dist/cli/chunks/{chunk-W2OPF27P.js → chunk-C7TMWGMN.js} +3 -3
- package/dist/cli/chunks/{chunk-3OPXTQMB.js → chunk-CNWWQYZ3.js} +1 -1
- package/dist/cli/chunks/{chunk-6PW5L2SC.js → chunk-COTY53RT.js} +2 -2
- package/dist/cli/chunks/{chunk-ML7AEOPI.js → chunk-CYNQW276.js} +2 -2
- package/dist/cli/chunks/{chunk-2IRRXFBV.js → chunk-DL6L4FGW.js} +2 -2
- package/dist/cli/chunks/{chunk-VLNCDVU6.js → chunk-DPMCEGYQ.js} +2 -2
- package/dist/cli/chunks/{chunk-VUEYEMMJ.js → chunk-DURR7FQ2.js} +9 -9
- package/dist/cli/chunks/{chunk-KAVN56IT.js → chunk-E3K7FQKW.js} +2 -2
- package/dist/cli/chunks/{chunk-7VNGENWZ.js → chunk-ET5RCLBO.js} +2 -2
- package/dist/cli/chunks/{chunk-XPXL75LN.js → chunk-EW2JQIYW.js} +1 -1
- package/dist/cli/chunks/{chunk-XC34CWA3.js → chunk-F5PNA7J3.js} +2 -2
- package/dist/cli/chunks/{chunk-4GVLZIHN.js → chunk-FQZM3SVW.js} +2 -2
- package/dist/cli/chunks/{chunk-EKQI2HRL.js → chunk-FY3TF4SA.js} +2 -2
- package/dist/cli/chunks/{chunk-V3L3FD4I.js → chunk-G4KZCXZK.js} +1 -1
- package/dist/cli/chunks/{chunk-XBGO4NQE.js → chunk-GGIE7KUU.js} +2 -2
- package/dist/cli/chunks/{chunk-PMAMZZ6B.js → chunk-GXHMSIBM.js} +1 -1
- package/dist/cli/chunks/{chunk-4FRRDVWH.js → chunk-HEZJOCD7.js} +2 -2
- package/dist/cli/chunks/{chunk-R7VO6E3E.js → chunk-HPB5MPJP.js} +2 -2
- package/dist/cli/chunks/{chunk-VRNRR3VU.js → chunk-HV7V34DZ.js} +2 -2
- package/dist/cli/chunks/{chunk-W5RRYCQ7.js → chunk-HYCRKKJN.js} +2 -2
- package/dist/cli/chunks/{chunk-XBBNMF3C.js → chunk-I3YJEVI2.js} +2 -2
- package/dist/cli/chunks/{chunk-IJH3WAC4.js → chunk-I73XKAOF.js} +3 -3
- package/dist/cli/chunks/{chunk-7YV5T64G.js → chunk-IQITE3HO.js} +1 -1
- package/dist/cli/chunks/{chunk-U67BTJC3.js → chunk-ITGHTWHH.js} +2 -2
- package/dist/cli/chunks/{chunk-FUNP4GGE.js → chunk-IUUT6Q5I.js} +2 -2
- package/dist/cli/chunks/{chunk-76RCKSCL.js → chunk-J24PEKZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-GV3LIGPJ.js → chunk-J2ZH6IHM.js} +2 -2
- package/dist/cli/chunks/{chunk-NADXRFKX.js → chunk-J6EDIEZB.js} +1 -1
- package/dist/cli/chunks/{chunk-R3OII6WM.js → chunk-JBL5G5VJ.js} +1 -1
- package/dist/cli/chunks/{chunk-AQXKM5VB.js → chunk-JN7WVS57.js} +2 -2
- package/dist/cli/chunks/{chunk-X66FBTTD.js → chunk-JP7AOQZZ.js} +1 -1
- package/dist/cli/chunks/{chunk-VYFRA4ZP.js → chunk-JZTMCQVH.js} +1 -1
- package/dist/cli/chunks/{chunk-6IRQAAMQ.js → chunk-KFDY5AD7.js} +1 -1
- package/dist/cli/chunks/{chunk-I5WMRFJ2.js → chunk-LU27B4M7.js} +3 -3
- package/dist/cli/chunks/{chunk-5DOCH2OX.js → chunk-LXGVB3FK.js} +1 -1
- package/dist/cli/chunks/{chunk-DPDDWIL7.js → chunk-MFRS4KFZ.js} +2 -2
- package/dist/cli/chunks/{chunk-PFH2G7AP.js → chunk-MHPA6IWB.js} +2 -2
- package/dist/cli/chunks/{chunk-KYDLYPOG.js → chunk-MKDGVPE3.js} +129 -124
- package/dist/cli/chunks/{chunk-VZVHYH7B.js → chunk-MSA7UH3M.js} +1 -1
- package/dist/cli/chunks/{chunk-WOD7Y7NC.js → chunk-NTTW3LSE.js} +2 -2
- package/dist/cli/chunks/{chunk-UHWGEZXG.js → chunk-NWSFGZKC.js} +1 -1
- package/dist/cli/chunks/{chunk-LFD3YTNY.js → chunk-O7XW2BWN.js} +2 -2
- package/dist/cli/chunks/{chunk-F3IEJL4O.js → chunk-OA5ZH3IH.js} +2 -2
- package/dist/cli/chunks/{chunk-X33KZ6WO.js → chunk-OHT5NJXJ.js} +1 -1
- package/dist/cli/chunks/{chunk-NIXA5DVA.js → chunk-PBP2TWV7.js} +2 -2
- package/dist/cli/chunks/{chunk-74YWPNUB.js → chunk-PFHUT2VE.js} +2 -2
- package/dist/cli/chunks/{chunk-5KWOG53N.js → chunk-PGS2MYE7.js} +1 -1
- package/dist/cli/chunks/{chunk-5XCHNZNW.js → chunk-PIR3KN5M.js} +2 -2
- package/dist/cli/chunks/{chunk-2ZN6YGSA.js → chunk-PMP6QRTB.js} +5 -5
- package/dist/cli/chunks/{chunk-N64WUFUI.js → chunk-PU7S6SEW.js} +4 -4
- package/dist/cli/chunks/{chunk-QFNWLRPV.js → chunk-PXFK5V2E.js} +2 -2
- package/dist/cli/chunks/{chunk-MAWGLIAE.js → chunk-Q5GQ267O.js} +1 -1
- package/dist/cli/chunks/{chunk-73SPNQDP.js → chunk-QM2LHV7P.js} +2 -2
- package/dist/cli/chunks/{chunk-TCRBP7GO.js → chunk-RAVTYXUD.js} +1 -1
- package/dist/cli/chunks/{chunk-JXSEJIIB.js → chunk-RDJZLKU2.js} +1 -1
- package/dist/cli/chunks/{chunk-THQNIMJU.js → chunk-RE5OY7WL.js} +2 -2
- package/dist/cli/chunks/{chunk-KVZKBPKC.js → chunk-RM7WNXRT.js} +2 -2
- package/dist/cli/chunks/{chunk-ZGGHGWXF.js → chunk-RPDLRKAT.js} +1 -1
- package/dist/cli/chunks/{chunk-2ACE3T6H.js → chunk-S3QE2RBR.js} +10 -10
- package/dist/cli/chunks/{chunk-IV4OBL4P.js → chunk-SCS3RUTT.js} +1 -1
- package/dist/cli/chunks/{chunk-JPB44BMP.js → chunk-SL5MAYYP.js} +2 -2
- package/dist/cli/chunks/{chunk-7G2UJMKQ.js → chunk-T46HLTI3.js} +2 -2
- package/dist/cli/chunks/{chunk-4EUPBVPV.js → chunk-T5HPBBVB.js} +1 -1
- package/dist/cli/chunks/{chunk-5SGWYFOV.js → chunk-U7S7A7LB.js} +1 -1
- package/dist/cli/chunks/{chunk-HLVL2N5U.js → chunk-UIKOUIGI.js} +2 -2
- package/dist/cli/chunks/{chunk-EY2W47L3.js → chunk-V7HMKS5S.js} +2 -2
- package/dist/cli/chunks/{chunk-FFP7OV5L.js → chunk-VNC7ANGV.js} +2 -2
- package/dist/cli/chunks/{chunk-QOVAU4DT.js → chunk-VRPZU5KM.js} +1 -1
- package/dist/cli/chunks/{chunk-NURG5LQO.js → chunk-W5EOH4NH.js} +1 -1
- package/dist/cli/chunks/{chunk-DZVIMPC2.js → chunk-WD5T5PE6.js} +2 -2
- package/dist/cli/chunks/{chunk-HEVA2HR3.js → chunk-WGYJD6DT.js} +2 -2
- package/dist/cli/chunks/{chunk-SKRQF45C.js → chunk-WHI7FVTH.js} +2 -2
- package/dist/cli/chunks/{chunk-SDOG2MMY.js → chunk-WLT5RGLK.js} +2 -2
- package/dist/cli/chunks/{chunk-5RJENBAG.js → chunk-WPN2NYZ3.js} +3 -3
- package/dist/cli/chunks/{chunk-CRTUB5NH.js → chunk-WVRFTL46.js} +1 -1
- package/dist/cli/chunks/{chunk-5ZADSKFC.js → chunk-X6HOSOIT.js} +3 -3
- package/dist/cli/chunks/{chunk-P5ZV4RCF.js → chunk-XFDOE4QW.js} +2 -2
- package/dist/cli/chunks/{chunk-AFQNJJWA.js → chunk-XLFWSEZ4.js} +2 -2
- package/dist/cli/chunks/{chunk-FL2G2VFC.js → chunk-XLY5LUNG.js} +2 -2
- package/dist/cli/chunks/{chunk-H6IV3LHA.js → chunk-XM3HKZ4U.js} +2 -2
- package/dist/cli/chunks/{chunk-MVT2F4Z4.js → chunk-XS63BAQL.js} +4 -4
- package/dist/cli/chunks/{chunk-JFWRCQCV.js → chunk-YHROZCDI.js} +2 -2
- package/dist/cli/chunks/{chunk-LKRGOCDO.js → chunk-YLSLQ2DT.js} +2 -2
- package/dist/cli/chunks/{chunk-Q3MHHREJ.js → chunk-YYGYN4RJ.js} +2 -2
- package/dist/cli/chunks/{chunk-6UH7B3PE.js → chunk-ZC5WKTB5.js} +1 -1
- package/dist/cli/chunks/chunk-ZGJTIDFI.js +2 -0
- package/dist/cli/chunks/{ci-2UUAA532.js → ci-TNCEZMBI.js} +2 -2
- package/dist/cli/chunks/{ci-output-NLBMSDOP.js → ci-output-GXRUBE4X.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-UMHTVSA2.js → circuit-breaker-UY3UVWZK.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-Q6A7T2CH.js → claude-flow-setup-G4PJY2IE.js} +2 -2
- package/dist/cli/chunks/client-XZQV5LLD.js +2 -0
- package/dist/cli/chunks/{cline-installer-UPIZH2ZF.js → cline-installer-VDCVZLLN.js} +2 -2
- package/dist/cli/chunks/{code-TPVQFW7C.js → code-2COXCETT.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-Z7J3RZ4Q.js → code-index-extractor-TBRSOYNZ.js} +2 -2
- package/dist/cli/chunks/{codex-installer-GTT3IBZT.js → codex-installer-CNUIJ7RF.js} +2 -2
- package/dist/cli/chunks/{completions-TXYGM6BK.js → completions-42LTVU5S.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-HMXULCFI.js → complexity-analyzer-2ECJ3OPO.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-3GDGFMEE.js → continuedev-installer-FW2GFUG2.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-S4KIV6OT.js → copilot-installer-QSV6WUBZ.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-E2M57AGD.js → cost-tracker-CH3CSBR5.js} +2 -2
- package/dist/cli/chunks/{coverage-NXF6THG2.js → coverage-XNF65ZHG.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-FTKMTQQC.js +2 -0
- package/dist/cli/chunks/{cursor-installer-GSMPSNIZ.js → cursor-installer-FP44QVKZ.js} +2 -2
- package/dist/cli/chunks/{daemon-IGNIH3TQ.js → daemon-RCTFQOCN.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-FFCTYK3P.js → dag-attention-scheduler-SRMUBFRY.js} +2 -2
- package/dist/cli/chunks/{detect-CFB72DRI.js → detect-6N6E24MC.js} +2 -2
- package/dist/cli/chunks/{dist-node-RGD4BMAQ.js → dist-node-T6UY6WUC.js} +2 -2
- package/dist/cli/chunks/{domain-handler-SAKJIOXO.js → domain-handler-67FVCSTC.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-44QPKEAY.js → domain-transfer-T6QVO7Q7.js} +2 -2
- package/dist/cli/chunks/dream-RB4NFA6Z.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-Z4MA4ZST.js → embed-and-insert-pattern-ZGTGPFKX.js} +2 -2
- package/dist/cli/chunks/{eval-IDTYZI7P.js → eval-KBCCSN2V.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-HXLGMWLK.js → experience-capture-middleware-QH2I2HCM.js} +3 -3
- package/dist/cli/chunks/{fast-paths-V47QDNVC.js → fast-paths-ZP3R5NWJ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-RALYJOEU.js → feature-flags-MGYWJNZ2.js} +2 -2
- package/dist/cli/chunks/{feature-flags-YWKFG357.js → feature-flags-TTPWNBQU.js} +2 -2
- package/dist/cli/chunks/{file-discovery-R3CDYNKP.js → file-discovery-VUIFTAJQ.js} +2 -2
- package/dist/cli/chunks/{fleet-XBVAD6CL.js → fleet-RFCEBGRJ.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-HVZMQHEX.js → gnn-wrapper-JSEZQYAZ.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-BBHOWYMJ.js → heartbeat-handler-ZRVNKBJK.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-SNUBX4LF.js → heartbeat-scheduler-ZQTLT3DW.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-ZKM2ITVF.js +2 -0
- package/dist/cli/chunks/hnsw-index-CFYACM4M.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-NKQVKQ3J.js → hnsw-legacy-bridge-Y6MPTDAI.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-SAJ7HAFG.js → hnswlib-node-X73LVNSE.js} +2 -2
- package/dist/cli/chunks/hooks-RIKFUPBG.js +259 -0
- package/dist/cli/chunks/{hybrid-router-YUVRBFMA.js → hybrid-router-B35QFYSN.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-EKOOW425.js → hypergraph-engine-GABHICVB.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-M4MSX62E.js → hypergraph-handler-NCMVBN4Q.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-DOLCGJKR.js +2 -0
- package/dist/cli/chunks/{init-handler-W3DIXGVJ.js → init-handler-7ROPCNFB.js} +6 -6
- package/dist/cli/chunks/init-wizard-BMYBCQNH.js +2 -0
- package/dist/cli/chunks/kernel-FUWIWNAU.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-VVFIT4TJ.js → kilocode-installer-JXHO4YK3.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-JCNYLJXT.js → kiro-installer-7SUM4FLK.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-JFX7VTYG.js +2 -0
- package/dist/cli/chunks/{learning-5X4UDI4G.js → learning-74DAUWK5.js} +3 -3
- package/dist/cli/chunks/{llm-router-M6NOWWP3.js → llm-router-LYQ3AJYV.js} +4 -4
- package/dist/cli/chunks/{load-UMYB2ZGL.js → load-EKML5ERV.js} +2 -2
- package/dist/cli/chunks/load-test-5J6WURNM.js +2 -0
- package/dist/cli/chunks/{mcp-ZDAIT7D5.js → mcp-XBL5K2W4.js} +2 -2
- package/dist/cli/chunks/{memory-FIWC4JNS.js → memory-FVYBB4DR.js} +5 -5
- package/dist/cli/chunks/memory-backend-SLFDDGZB.js +2 -0
- package/dist/cli/chunks/{memory-handlers-AHZIB4VB.js → memory-handlers-LN7J33BW.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-SA4CVCSA.js → multi-model-executor-5LK2OUJ7.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-S6UDYAAQ.js → opencode-installer-FY7QUQ3U.js} +2 -2
- package/dist/cli/chunks/{orchestrator-JNVRGX5Z.js → orchestrator-UYVNXY2H.js} +5 -5
- package/dist/cli/chunks/{pipeline-TLZ66K2O.js → pipeline-ZALCCJ2O.js} +2 -2
- package/dist/cli/chunks/{platform-MQ5UXRLD.js → platform-J2VZO4PZ.js} +2 -2
- package/dist/cli/chunks/{plugin-5S4YEY4C.js → plugin-2J74277Q.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-LIVSVFZA.js → prime-radiant-advanced-wasm-XUBMJ4Z5.js} +2 -2
- package/dist/cli/chunks/protocol-executor-3T2LU2YQ.js +2 -0
- package/dist/cli/chunks/{protocol-handler-KQIOJKTK.js → protocol-handler-YGOAM45F.js} +2 -2
- package/dist/cli/chunks/{prove-YFRZIQ2O.js → prove-7K3XVHHK.js} +2 -2
- package/dist/cli/chunks/{provider-manager-OKEHQIHC.js → provider-manager-S7GYXNYK.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-KPX2L7ZZ.js +2 -0
- package/dist/cli/chunks/{quality-GGBNSKJU.js → quality-7WK5BINE.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-G7ZZKP7M.js +2 -0
- package/dist/cli/chunks/{real-embeddings-2KWJAO6Y.js → real-embeddings-SE7AMRSP.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-KYZQFIEV.js → roocode-installer-WAMTTOPL.js} +2 -2
- package/dist/cli/chunks/router-UNMP4QIG.js +2 -0
- package/dist/cli/chunks/routing-feedback-OG5NUKZD.js +2 -0
- package/dist/cli/chunks/{routing-handler-Y5FLAUB2.js → routing-handler-PMHQRA32.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-MHSEXDRI.js → ruvector-commands-GFL76O4H.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-5PV65OR3.js → rvf-dual-writer-GWBC6LPL.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-3SZW2YA4.js → rvf-migration-adapter-CXIG3BWR.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-5LN2I44C.js → rvf-migration-coordinator-EOQMTSCT.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-EPXU4UUM.js +2 -0
- package/dist/cli/chunks/safe-db-BYZRI4XX.js +2 -0
- package/dist/cli/chunks/schedule-Z4ICJMF6.js +2 -0
- package/dist/cli/chunks/scheduler-T4IIRLST.js +2 -0
- package/dist/cli/chunks/{security-THETDKDS.js → security-TUU4SO7E.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-FDAQL677.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-NFUIB2ZL.js → shared-rvf-dual-writer-REFYUOL6.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-SNTM6622.js +2 -0
- package/dist/cli/chunks/{status-handler-CUW2OUS2.js → status-handler-V3FJKB72.js} +2 -2
- package/dist/cli/chunks/{structural-health-IK2LN4ES.js → structural-health-YS2IIXLZ.js} +2 -2
- package/dist/cli/chunks/{sync-DA33QCRD.js → sync-K5GEHWLO.js} +2 -2
- package/dist/cli/chunks/{task-handler-24CAZ4MB.js → task-handler-XPCZ2JHK.js} +2 -2
- package/dist/cli/chunks/{task-handlers-YHMFT7G3.js → task-handlers-JTL52AMR.js} +3 -3
- package/dist/cli/chunks/{test-ED6UE2EP.js → test-5FJNVFGF.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-RQP2IPFY.js → test-scheduling-JPL25DXR.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-POOTQ33M.js → token-bootstrap-QPFQ4UAT.js} +2 -2
- package/dist/cli/chunks/{token-usage-YNKDAQDK.js → token-usage-MVT2IZ5R.js} +2 -2
- package/dist/cli/chunks/{transformers-NONXIEJK.js → transformers-ZXK7QT3Z.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-HF7WUMJQ.js → tree-sitter-wasm-parser-VBZAQFTO.js} +2 -2
- package/dist/cli/chunks/{types-UUKKK3L5.js → types-UQCZMHTU.js} +2 -2
- package/dist/cli/chunks/unified-memory-RL5XRRVQ.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-FMHZ5TCH.js +2 -0
- package/dist/cli/chunks/unified-persistence-GI5NFSWC.js +2 -0
- package/dist/cli/chunks/{upgrade-ZNUFD44G.js → upgrade-TETHVGBS.js} +2 -2
- package/dist/cli/chunks/{validate-6IFD37Q4.js → validate-7YJTPQC7.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-74CENSXV.js → validate-swarm-QO32GODJ.js} +2 -2
- package/dist/cli/chunks/{vibium-B2DDFMOQ.js → vibium-HDRQBZAY.js} +2 -2
- package/dist/cli/chunks/visual-security-TARFNARP.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-X6ELMFG4.js → web-tree-sitter-4QMH7RWP.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-HEIKCJDP.js → windsurf-installer-HMBCR4V3.js} +2 -2
- package/dist/cli/chunks/{witness-chain-TO6YFTUT.js → witness-chain-2SYYDES4.js} +2 -2
- package/dist/cli/chunks/witness-chain-U36QGK2S.js +2 -0
- package/dist/cli/chunks/{workflow-WY73P2QK.js → workflow-CNFOBA7L.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-WILFC5ES.js +2 -0
- package/dist/cli/chunks/{wrappers-VF7LWJER.js → wrappers-5KG5VXFG.js} +2 -2
- package/dist/cli/commands/hooks-handlers/editing-hooks.js +21 -6
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +2 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +106 -6
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +20 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +111 -6
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +33 -35
- package/dist/cli/commands/hooks-handlers/task-hooks.js +16 -3
- package/dist/kernel/kernel.d.ts +1 -0
- package/dist/kernel/kernel.js +21 -0
- package/dist/learning/pattern-promotion.d.ts +6 -0
- package/dist/learning/pattern-promotion.js +5 -0
- package/dist/learning/qe-reasoning-bank-types.d.ts +12 -3
- package/dist/learning/qe-reasoning-bank.d.ts +10 -3
- package/dist/learning/qe-reasoning-bank.js +67 -15
- package/dist/learning/rvf-pattern-store.d.ts +9 -0
- package/dist/learning/rvf-pattern-store.js +42 -0
- package/dist/learning/sqlite-persistence.d.ts +18 -0
- package/dist/learning/sqlite-persistence.js +59 -0
- package/dist/mcp/bundle.js +358 -337
- package/dist/optimization/index.d.ts +0 -2
- package/dist/optimization/index.js +0 -2
- package/dist/workers/workers/learning-consolidation.js +9 -3
- package/package.json +8 -3
- package/dist/cli/chunks/adapter-DRRUAQGD.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-5WYTKZ2I.js +0 -2
- package/dist/cli/chunks/base-LQVASZ6V.js +0 -2
- package/dist/cli/chunks/browser-workflow-TXQBTTSA.js +0 -2
- package/dist/cli/chunks/chunk-EOZIQTHG.js +0 -2
- package/dist/cli/chunks/client-TMGGCVZM.js +0 -2
- package/dist/cli/chunks/cross-domain-router-3WM3FES7.js +0 -2
- package/dist/cli/chunks/dream-SSRYUA2N.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-HGJUAHPN.js +0 -2
- package/dist/cli/chunks/hnsw-index-Q6GETC2C.js +0 -2
- package/dist/cli/chunks/hooks-HOD4SK3C.js +0 -237
- package/dist/cli/chunks/impact-analyzer-AIOLML23.js +0 -2
- package/dist/cli/chunks/init-wizard-FVH6XXAD.js +0 -2
- package/dist/cli/chunks/kernel-EBLOZQ7R.js +0 -2
- package/dist/cli/chunks/knowledge-graph-BXVKN4TE.js +0 -2
- package/dist/cli/chunks/load-test-DAFHZ5B4.js +0 -2
- package/dist/cli/chunks/memory-backend-LW2HMGVV.js +0 -2
- package/dist/cli/chunks/protocol-executor-LP4ID64X.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-6KBZMXKR.js +0 -2
- package/dist/cli/chunks/queen-coordinator-3ZAXRHXE.js +0 -2
- package/dist/cli/chunks/router-QJUMFZN6.js +0 -2
- package/dist/cli/chunks/routing-feedback-TVYNKT3K.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-G5NC4S6V.js +0 -2
- package/dist/cli/chunks/safe-db-7STPJWYA.js +0 -2
- package/dist/cli/chunks/schedule-NTT6YXMP.js +0 -2
- package/dist/cli/chunks/scheduler-BC5VEZI2.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-T63WSHGK.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-GJDAUFQU.js +0 -2
- package/dist/cli/chunks/unified-memory-JVMA5MJR.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-SSBWEA2T.js +0 -2
- package/dist/cli/chunks/unified-persistence-CWGWVHCB.js +0 -2
- package/dist/cli/chunks/visual-security-LGOI2DGK.js +0 -2
- package/dist/cli/chunks/witness-chain-JDFTWTJS.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-IDCHNGN6.js +0 -2
- package/dist/optimization/qe-workers.d.ts +0 -193
- package/dist/optimization/qe-workers.js +0 -692
|
@@ -311,10 +311,19 @@ export function registerTaskHooks(hooks) {
|
|
|
311
311
|
durationMs,
|
|
312
312
|
success,
|
|
313
313
|
});
|
|
314
|
+
// Issue #460: when --agent arrives empty (Claude Code does not
|
|
315
|
+
// expose $TOOL_RESULT_agent_id in PostToolUse context), `agent`
|
|
316
|
+
// resolves to 'unknown' and every Q-value lands in the same
|
|
317
|
+
// bucket — the router can never learn per-agent differentiation.
|
|
318
|
+
// The pre-task bridge already carries `agent: routing.recommendedAgent`
|
|
319
|
+
// which is the correct action key, so prefer that over 'unknown'.
|
|
320
|
+
const effectiveAgent = agent === 'unknown' && outcome.bridge?.agent
|
|
321
|
+
? outcome.bridge.agent
|
|
322
|
+
: agent;
|
|
314
323
|
// Stream D (patch 150): apply 6-dim outcome quality to the
|
|
315
324
|
// routing_outcomes sentinel that pre-task wrote with quality=-1.
|
|
316
325
|
await updateRoutingOutcomeQuality({
|
|
317
|
-
agent,
|
|
326
|
+
agent: effectiveAgent,
|
|
318
327
|
success,
|
|
319
328
|
durationMs,
|
|
320
329
|
qualityScore: outcome.qualityScore,
|
|
@@ -327,7 +336,7 @@ export function registerTaskHooks(hooks) {
|
|
|
327
336
|
priority: outcome.bridge.priority,
|
|
328
337
|
domain: outcome.bridge.domain,
|
|
329
338
|
complexityBucket: outcome.bridge.complexityBucket,
|
|
330
|
-
agent,
|
|
339
|
+
agent: effectiveAgent,
|
|
331
340
|
success,
|
|
332
341
|
});
|
|
333
342
|
}
|
|
@@ -355,6 +364,7 @@ export function registerTaskHooks(hooks) {
|
|
|
355
364
|
dreamTriggered: dreamResult.triggered,
|
|
356
365
|
dreamReason: dreamResult.reason,
|
|
357
366
|
dreamInsights: dreamResult.insightsGenerated,
|
|
367
|
+
dreamInsightsApplied: dreamResult.insightsApplied,
|
|
358
368
|
});
|
|
359
369
|
}
|
|
360
370
|
else {
|
|
@@ -364,7 +374,10 @@ export function registerTaskHooks(hooks) {
|
|
|
364
374
|
console.log(chalk.green(` Patterns learned: ${patternsLearned}`));
|
|
365
375
|
}
|
|
366
376
|
if (dreamResult.triggered) {
|
|
367
|
-
|
|
377
|
+
const appliedSuffix = typeof dreamResult.insightsApplied === 'number'
|
|
378
|
+
? `, ${dreamResult.insightsApplied} applied`
|
|
379
|
+
: '';
|
|
380
|
+
console.log(chalk.blue(` 🌙 Dream cycle triggered (${dreamResult.reason}): ${dreamResult.insightsGenerated} insights${appliedSuffix}`));
|
|
368
381
|
}
|
|
369
382
|
}
|
|
370
383
|
return;
|
package/dist/kernel/kernel.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class QEKernelImpl implements QEKernel {
|
|
|
20
20
|
private _startTime;
|
|
21
21
|
private _initialized;
|
|
22
22
|
private _loopTracker;
|
|
23
|
+
private _experienceBridge?;
|
|
23
24
|
constructor(config?: Partial<KernelConfig>);
|
|
24
25
|
get eventBus(): EventBus;
|
|
25
26
|
get coordinator(): AgentCoordinator;
|
package/dist/kernel/kernel.js
CHANGED
|
@@ -18,6 +18,7 @@ import * as path from 'path';
|
|
|
18
18
|
import * as fs from 'fs';
|
|
19
19
|
import { PluginLifecycleManager } from '../plugins/lifecycle';
|
|
20
20
|
import { PluginCache } from '../plugins/cache';
|
|
21
|
+
import { CapturedExperienceBridge } from '../bridge/captured-experience-bridge.js';
|
|
21
22
|
// Import domain plugin factories
|
|
22
23
|
import { createTestGenerationPlugin } from '../domains/test-generation/plugin';
|
|
23
24
|
import { createTestExecutionPlugin } from '../domains/test-execution/plugin';
|
|
@@ -75,6 +76,9 @@ export class QEKernelImpl {
|
|
|
75
76
|
_initialized = false;
|
|
76
77
|
// ADR-062: Loop detection tracker
|
|
77
78
|
_loopTracker;
|
|
79
|
+
// Issue #479: drains captured_experiences into the eventBus so hook-driven
|
|
80
|
+
// activity reaches the 13 domain plugins' subscribeToEvents() handlers.
|
|
81
|
+
_experienceBridge;
|
|
78
82
|
constructor(config = {}) {
|
|
79
83
|
this._config = { ...DEFAULT_CONFIG, ...config };
|
|
80
84
|
this._startTime = new Date();
|
|
@@ -225,9 +229,26 @@ export class QEKernelImpl {
|
|
|
225
229
|
catch {
|
|
226
230
|
// Migration coordinator is best-effort — don't block kernel startup
|
|
227
231
|
}
|
|
232
|
+
// Issue #479: start the captured-experience bridge so hook-driven
|
|
233
|
+
// activity (written to captured_experiences SQLite by short-lived
|
|
234
|
+
// hook subprocesses) reaches the domain plugins' eventBus handlers.
|
|
235
|
+
// Best-effort — never block kernel startup on bridge failure.
|
|
236
|
+
try {
|
|
237
|
+
this._experienceBridge = new CapturedExperienceBridge(this._eventBus, this._memory);
|
|
238
|
+
await this._experienceBridge.start();
|
|
239
|
+
}
|
|
240
|
+
catch (err) {
|
|
241
|
+
console.warn('[QEKernel] CapturedExperienceBridge failed to start:', err instanceof Error ? err.message : err);
|
|
242
|
+
this._experienceBridge = undefined;
|
|
243
|
+
}
|
|
228
244
|
this._initialized = true;
|
|
229
245
|
}
|
|
230
246
|
async dispose() {
|
|
247
|
+
// Stop the bridge first so it doesn't try to publish to a disposed bus.
|
|
248
|
+
if (this._experienceBridge) {
|
|
249
|
+
await this._experienceBridge.stop();
|
|
250
|
+
this._experienceBridge = undefined;
|
|
251
|
+
}
|
|
231
252
|
// Dispose in reverse order of initialization
|
|
232
253
|
await this._plugins.disposeAll();
|
|
233
254
|
await this._coordinator.dispose();
|
|
@@ -53,6 +53,12 @@ export interface SeedingDeps {
|
|
|
53
53
|
searchPatterns: (query: string | number[], options?: Record<string, unknown>) => Promise<Result<PatternSearchResult[]>>;
|
|
54
54
|
storePattern: (options: Record<string, unknown>) => Promise<Result<QEPattern>>;
|
|
55
55
|
patternStore: IPatternStore;
|
|
56
|
+
/**
|
|
57
|
+
* Optional cancellation signal. Checked before each store/search so that
|
|
58
|
+
* an aborted init (issue #478) stops appending to the pattern store
|
|
59
|
+
* instead of running to completion in the background.
|
|
60
|
+
*/
|
|
61
|
+
signal?: AbortSignal;
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
64
|
* Seed cross-domain patterns by transferring generalizable patterns
|
|
@@ -152,10 +152,13 @@ export async function promotePattern(patternId, deps) {
|
|
|
152
152
|
* from populated domains to their related domains.
|
|
153
153
|
*/
|
|
154
154
|
export async function seedCrossDomainPatterns(deps) {
|
|
155
|
+
const { signal } = deps;
|
|
156
|
+
signal?.throwIfAborted();
|
|
155
157
|
const stats = await deps.patternStore.getStats();
|
|
156
158
|
let transferred = 0;
|
|
157
159
|
let skipped = 0;
|
|
158
160
|
for (const [sourceDomainStr, targetDomains] of Object.entries(RELATED_DOMAINS)) {
|
|
161
|
+
signal?.throwIfAborted();
|
|
159
162
|
const sourceDomain = sourceDomainStr;
|
|
160
163
|
const sourceCount = stats.byDomain[sourceDomain] || 0;
|
|
161
164
|
if (sourceCount === 0)
|
|
@@ -167,12 +170,14 @@ export async function seedCrossDomainPatterns(deps) {
|
|
|
167
170
|
if (!sourceResult.success)
|
|
168
171
|
continue;
|
|
169
172
|
for (const targetDomain of targetDomains) {
|
|
173
|
+
signal?.throwIfAborted();
|
|
170
174
|
const targetCount = stats.byDomain[targetDomain] || 0;
|
|
171
175
|
if (targetCount >= sourceCount) {
|
|
172
176
|
skipped++;
|
|
173
177
|
continue;
|
|
174
178
|
}
|
|
175
179
|
for (const { pattern: sourcePattern } of sourceResult.value) {
|
|
180
|
+
signal?.throwIfAborted();
|
|
176
181
|
const existingCheck = await deps.searchPatterns(sourcePattern.name, {
|
|
177
182
|
domain: targetDomain,
|
|
178
183
|
limit: 1,
|
|
@@ -112,8 +112,17 @@ export interface PromotionBlockedEvent {
|
|
|
112
112
|
* QEReasoningBank interface
|
|
113
113
|
*/
|
|
114
114
|
export interface IQEReasoningBank {
|
|
115
|
-
/**
|
|
116
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Initialize the reasoning bank.
|
|
117
|
+
*
|
|
118
|
+
* Pass `signal` to bound long-running init steps (pattern bootstrap,
|
|
119
|
+
* cross-domain seeding). When the signal is aborted, every awaited step
|
|
120
|
+
* checks it via `throwIfAborted()` so the work stops promptly instead of
|
|
121
|
+
* leaking past a caller-side timeout.
|
|
122
|
+
*/
|
|
123
|
+
initialize(options?: {
|
|
124
|
+
signal?: AbortSignal;
|
|
125
|
+
}): Promise<void>;
|
|
117
126
|
/** Store a new pattern */
|
|
118
127
|
storePattern(options: CreateQEPatternOptions): Promise<Result<QEPattern>>;
|
|
119
128
|
/** Search for patterns */
|
|
@@ -136,7 +145,7 @@ export interface IQEReasoningBank {
|
|
|
136
145
|
/** Get embedding for text */
|
|
137
146
|
embed(text: string): Promise<number[]>;
|
|
138
147
|
/** Seed cross-domain patterns by transferring from populated domains to related ones */
|
|
139
|
-
seedCrossDomainPatterns(): Promise<{
|
|
148
|
+
seedCrossDomainPatterns(signal?: AbortSignal): Promise<{
|
|
140
149
|
transferred: number;
|
|
141
150
|
skipped: number;
|
|
142
151
|
}>;
|
|
@@ -65,9 +65,16 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
65
65
|
private stats;
|
|
66
66
|
constructor(memory: MemoryBackend, eventBus?: EventBus | undefined, config?: Partial<QEReasoningBankConfig>, coherenceService?: import("../integrations/coherence/coherence-service.js").ICoherenceService | undefined);
|
|
67
67
|
/**
|
|
68
|
-
* Initialize the reasoning bank
|
|
68
|
+
* Initialize the reasoning bank.
|
|
69
|
+
*
|
|
70
|
+
* `options.signal` bounds the init: every step calls
|
|
71
|
+
* `signal.throwIfAborted()` before starting work, so a caller-side
|
|
72
|
+
* timeout that aborts the signal causes initialize() to reject promptly
|
|
73
|
+
* instead of leaking writes past the timeout (issue #478).
|
|
69
74
|
*/
|
|
70
|
-
initialize(
|
|
75
|
+
initialize(options?: {
|
|
76
|
+
signal?: AbortSignal;
|
|
77
|
+
}): Promise<void>;
|
|
71
78
|
/**
|
|
72
79
|
* Load pre-trained patterns for common QE scenarios
|
|
73
80
|
*/
|
|
@@ -79,7 +86,7 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
79
86
|
* Uses the domain compatibility matrix to determine which domains
|
|
80
87
|
* are related and applies a relevance decay to transferred patterns.
|
|
81
88
|
*/
|
|
82
|
-
seedCrossDomainPatterns(): Promise<{
|
|
89
|
+
seedCrossDomainPatterns(signal?: AbortSignal): Promise<{
|
|
83
90
|
transferred: number;
|
|
84
91
|
skipped: number;
|
|
85
92
|
}>;
|
|
@@ -106,12 +106,20 @@ export class QEReasoningBank {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
* Initialize the reasoning bank
|
|
109
|
+
* Initialize the reasoning bank.
|
|
110
|
+
*
|
|
111
|
+
* `options.signal` bounds the init: every step calls
|
|
112
|
+
* `signal.throwIfAborted()` before starting work, so a caller-side
|
|
113
|
+
* timeout that aborts the signal causes initialize() to reject promptly
|
|
114
|
+
* instead of leaking writes past the timeout (issue #478).
|
|
110
115
|
*/
|
|
111
|
-
async initialize() {
|
|
116
|
+
async initialize(options) {
|
|
112
117
|
if (this.initialized)
|
|
113
118
|
return;
|
|
119
|
+
const signal = options?.signal;
|
|
120
|
+
signal?.throwIfAborted();
|
|
114
121
|
await this.patternStore.initialize();
|
|
122
|
+
signal?.throwIfAborted();
|
|
115
123
|
// Wire SQLitePatternStore into PatternStore for delete/promote persistence
|
|
116
124
|
try {
|
|
117
125
|
const store = this.getSqliteStore();
|
|
@@ -121,8 +129,10 @@ export class QEReasoningBank {
|
|
|
121
129
|
catch (e) {
|
|
122
130
|
logger.warn('Failed to wire SQLitePatternStore into PatternStore', { error: toErrorMessage(e) });
|
|
123
131
|
}
|
|
132
|
+
signal?.throwIfAborted();
|
|
124
133
|
// Load any pre-trained patterns
|
|
125
|
-
await this.loadPretrainedPatterns();
|
|
134
|
+
await this.loadPretrainedPatterns(signal);
|
|
135
|
+
signal?.throwIfAborted();
|
|
126
136
|
this.initialized = true;
|
|
127
137
|
// Run cross-domain transfer ONCE per DB lifetime (not every init)
|
|
128
138
|
// IMPORTANT: Set the flag BEFORE the transfer so that even if the transfer
|
|
@@ -134,7 +144,7 @@ export class QEReasoningBank {
|
|
|
134
144
|
if (!alreadySeeded) {
|
|
135
145
|
// Set flag FIRST to prevent re-runs if transfer times out or process exits
|
|
136
146
|
await this.memory.set(SEED_FLAG_KEY, true);
|
|
137
|
-
await this.seedCrossDomainPatterns();
|
|
147
|
+
await this.seedCrossDomainPatterns(signal);
|
|
138
148
|
}
|
|
139
149
|
else {
|
|
140
150
|
const stats = await this.patternStore.getStats();
|
|
@@ -142,6 +152,10 @@ export class QEReasoningBank {
|
|
|
142
152
|
}
|
|
143
153
|
}
|
|
144
154
|
catch (error) {
|
|
155
|
+
// Re-throw abort errors so the caller sees the cancellation;
|
|
156
|
+
// swallow other errors per the existing non-fatal contract.
|
|
157
|
+
if (signal?.aborted)
|
|
158
|
+
throw error;
|
|
145
159
|
logger.warn('Cross-domain seeding failed (non-fatal)', { error });
|
|
146
160
|
}
|
|
147
161
|
logger.info('Initialized');
|
|
@@ -149,8 +163,9 @@ export class QEReasoningBank {
|
|
|
149
163
|
/**
|
|
150
164
|
* Load pre-trained patterns for common QE scenarios
|
|
151
165
|
*/
|
|
152
|
-
async loadPretrainedPatterns() {
|
|
166
|
+
async loadPretrainedPatterns(signal) {
|
|
153
167
|
// Check if we already have patterns
|
|
168
|
+
signal?.throwIfAborted();
|
|
154
169
|
const stats = await this.patternStore.getStats();
|
|
155
170
|
if (stats.totalPatterns > 0) {
|
|
156
171
|
logger.info('Found existing patterns', { totalPatterns: stats.totalPatterns });
|
|
@@ -189,10 +204,15 @@ export class QEReasoningBank {
|
|
|
189
204
|
// 1. embeddings are computed via this.embed()
|
|
190
205
|
// 2. patternStore.store() calls adapter.ingest() for each pattern
|
|
191
206
|
for (const options of PRETRAINED_PATTERNS) {
|
|
207
|
+
// Bail before each store() so an aborted init does not keep appending
|
|
208
|
+
// to patterns.rvf (issue #478).
|
|
209
|
+
signal?.throwIfAborted();
|
|
192
210
|
try {
|
|
193
211
|
await this.storePattern(options);
|
|
194
212
|
}
|
|
195
213
|
catch (error) {
|
|
214
|
+
if (signal?.aborted)
|
|
215
|
+
throw error;
|
|
196
216
|
logger.warn('Failed to load pattern', { name: options.name, error });
|
|
197
217
|
}
|
|
198
218
|
}
|
|
@@ -205,14 +225,15 @@ export class QEReasoningBank {
|
|
|
205
225
|
* Uses the domain compatibility matrix to determine which domains
|
|
206
226
|
* are related and applies a relevance decay to transferred patterns.
|
|
207
227
|
*/
|
|
208
|
-
async seedCrossDomainPatterns() {
|
|
228
|
+
async seedCrossDomainPatterns(signal) {
|
|
209
229
|
if (!this.initialized) {
|
|
210
|
-
await this.initialize();
|
|
230
|
+
await this.initialize({ signal });
|
|
211
231
|
}
|
|
212
232
|
return seedCrossDomainPatternsFn({
|
|
213
233
|
searchPatterns: this.searchPatterns.bind(this),
|
|
214
234
|
storePattern: this.storePattern.bind(this),
|
|
215
235
|
patternStore: this.patternStore,
|
|
236
|
+
signal,
|
|
216
237
|
});
|
|
217
238
|
}
|
|
218
239
|
/**
|
|
@@ -466,17 +487,48 @@ export class QEReasoningBank {
|
|
|
466
487
|
for (const domain of QE_DOMAIN_LIST) {
|
|
467
488
|
byDomain[domain] = patternStoreStats.byDomain[domain] || 0;
|
|
468
489
|
}
|
|
490
|
+
// DB fallback (#454): in-memory `this.stats` is reset on every process
|
|
491
|
+
// start, but every hook invocation spawns a fresh node. Without a DB
|
|
492
|
+
// fallback, `aqe hooks stats` always reports zeros even when historical
|
|
493
|
+
// routing_outcomes / qe_pattern_usage rows exist. We use the in-memory
|
|
494
|
+
// counters when they're non-zero (live, current-process data), otherwise
|
|
495
|
+
// fall back to aggregated DB totals.
|
|
496
|
+
let routingRequests = this.stats.routingRequests;
|
|
497
|
+
let avgRoutingConfidence = this.stats.routingRequests > 0
|
|
498
|
+
? this.stats.totalRoutingConfidence / this.stats.routingRequests
|
|
499
|
+
: 0;
|
|
500
|
+
let learningOutcomes = this.stats.learningOutcomes;
|
|
501
|
+
let patternSuccessRate = this.stats.learningOutcomes > 0
|
|
502
|
+
? this.stats.successfulOutcomes / this.stats.learningOutcomes
|
|
503
|
+
: 0;
|
|
504
|
+
if (routingRequests === 0 || learningOutcomes === 0) {
|
|
505
|
+
try {
|
|
506
|
+
const agg = this.getSqliteStore().getAggregateOutcomeStats();
|
|
507
|
+
if (routingRequests === 0 && agg.routingRequests > 0) {
|
|
508
|
+
routingRequests = agg.routingRequests;
|
|
509
|
+
avgRoutingConfidence = agg.avgRoutingConfidence;
|
|
510
|
+
}
|
|
511
|
+
if (learningOutcomes === 0 && agg.learningOutcomes > 0) {
|
|
512
|
+
learningOutcomes = agg.learningOutcomes;
|
|
513
|
+
// Prefer per-usage success rate (closer to recordOutcome semantics);
|
|
514
|
+
// fall back to qe_patterns.success_rate aggregate when no usage rows.
|
|
515
|
+
patternSuccessRate =
|
|
516
|
+
agg.learningOutcomes > 0
|
|
517
|
+
? agg.successfulOutcomes / agg.learningOutcomes
|
|
518
|
+
: agg.avgPatternSuccessRate;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
catch {
|
|
522
|
+
// best-effort — never let stats reporting crash the host
|
|
523
|
+
}
|
|
524
|
+
}
|
|
469
525
|
return {
|
|
470
526
|
totalPatterns: patternStoreStats.totalPatterns,
|
|
471
527
|
byDomain,
|
|
472
|
-
routingRequests
|
|
473
|
-
avgRoutingConfidence
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
learningOutcomes: this.stats.learningOutcomes,
|
|
477
|
-
patternSuccessRate: this.stats.learningOutcomes > 0
|
|
478
|
-
? this.stats.successfulOutcomes / this.stats.learningOutcomes
|
|
479
|
-
: 0,
|
|
528
|
+
routingRequests,
|
|
529
|
+
avgRoutingConfidence,
|
|
530
|
+
learningOutcomes,
|
|
531
|
+
patternSuccessRate,
|
|
480
532
|
patternStoreStats,
|
|
481
533
|
};
|
|
482
534
|
}
|
|
@@ -49,6 +49,15 @@ export declare class RvfPatternStore implements IPatternStore {
|
|
|
49
49
|
/** Get the underlying RVF adapter (for COW branching, migration, etc.) */
|
|
50
50
|
getAdapter(): RvfNativeAdapter | null;
|
|
51
51
|
initialize(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Compare the RVF vector count with the SQLite pattern count; if RVF has
|
|
54
|
+
* more rows, read the idmap.json and delete any vector IDs that no longer
|
|
55
|
+
* have a matching qe_patterns row.
|
|
56
|
+
*
|
|
57
|
+
* Fail-open: any error in the purge path is swallowed so a stale or
|
|
58
|
+
* corrupted idmap can't keep the store from initializing (#462).
|
|
59
|
+
*/
|
|
60
|
+
private purgeOrphanedVectors;
|
|
52
61
|
dispose(): Promise<void>;
|
|
53
62
|
store(pattern: QEPattern): Promise<Result<string>>;
|
|
54
63
|
create(options: CreateQEPatternOptions): Promise<Result<QEPattern>>;
|
|
@@ -89,6 +89,48 @@ export class RvfPatternStore {
|
|
|
89
89
|
// SQLite auto-attach is best-effort
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
// Issue #462: purge orphan vectors that survived in patterns.rvf when an
|
|
93
|
+
// upgrade workflow rewrote qe_patterns via INSERT OR REPLACE without
|
|
94
|
+
// calling RvfPatternStore.delete() on the old IDs. Ghost vectors win
|
|
95
|
+
// cosine-similarity matches, route to non-existent pattern IDs, and
|
|
96
|
+
// every learning write fails silently. Run once on init.
|
|
97
|
+
await this.purgeOrphanedVectors();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Compare the RVF vector count with the SQLite pattern count; if RVF has
|
|
101
|
+
* more rows, read the idmap.json and delete any vector IDs that no longer
|
|
102
|
+
* have a matching qe_patterns row.
|
|
103
|
+
*
|
|
104
|
+
* Fail-open: any error in the purge path is swallowed so a stale or
|
|
105
|
+
* corrupted idmap can't keep the store from initializing (#462).
|
|
106
|
+
*/
|
|
107
|
+
async purgeOrphanedVectors() {
|
|
108
|
+
if (!this.adapter || !this.sqliteStore)
|
|
109
|
+
return;
|
|
110
|
+
try {
|
|
111
|
+
const rvfCount = this.adapter.status()?.totalVectors ?? 0;
|
|
112
|
+
const dbCount = this.sqliteStore.getStats()?.totalPatterns ?? 0;
|
|
113
|
+
if (rvfCount <= dbCount)
|
|
114
|
+
return;
|
|
115
|
+
const { readFileSync, existsSync } = await import('node:fs');
|
|
116
|
+
const idmapPath = `${this.rvfPath}.idmap.json`;
|
|
117
|
+
if (!existsSync(idmapPath))
|
|
118
|
+
return;
|
|
119
|
+
const idmap = JSON.parse(readFileSync(idmapPath, 'utf-8'));
|
|
120
|
+
const rvfIds = new Set((idmap.entries ?? [])
|
|
121
|
+
.map((e) => (Array.isArray(e) ? e[0] : undefined))
|
|
122
|
+
.filter((id) => typeof id === 'string'));
|
|
123
|
+
const dbIds = new Set(this.sqliteStore.getPatterns({ limit: 10_000 }).map((p) => p.id));
|
|
124
|
+
const orphans = [...rvfIds].filter((id) => !dbIds.has(id));
|
|
125
|
+
if (orphans.length === 0)
|
|
126
|
+
return;
|
|
127
|
+
this.adapter.delete(orphans);
|
|
128
|
+
console.log(`[RvfPatternStore] Removed ${orphans.length} ghost vectors (index ${rvfCount} > DB ${dbCount})`);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
// fail-open: a stale idmap or read error must not block initialization
|
|
132
|
+
console.warn(`[RvfPatternStore] orphan purge skipped: ${toErrorMessage(error)}`);
|
|
133
|
+
}
|
|
92
134
|
}
|
|
93
135
|
async dispose() {
|
|
94
136
|
if (this.adapter && !this.skipCloseOnDispose) {
|
|
@@ -134,6 +134,24 @@ export declare class SQLitePatternStore {
|
|
|
134
134
|
byDomain: Record<string, number>;
|
|
135
135
|
byTier: Record<string, number>;
|
|
136
136
|
};
|
|
137
|
+
/**
|
|
138
|
+
* Aggregate outcome counters used by QEReasoningBank.getStats() as a fallback
|
|
139
|
+
* when the in-memory `this.stats` object is zero — every hook subprocess
|
|
140
|
+
* starts with a fresh counter, so without this fallback observability is
|
|
141
|
+
* always blank (#454).
|
|
142
|
+
*
|
|
143
|
+
* routing_outcomes and qe_pattern_usage live in the same unified memory.db
|
|
144
|
+
* as qe_patterns. avgConfidence/avgSuccessRate return 0 when the source
|
|
145
|
+
* tables are empty rather than NaN.
|
|
146
|
+
*/
|
|
147
|
+
getAggregateOutcomeStats(): {
|
|
148
|
+
routingRequests: number;
|
|
149
|
+
avgRoutingConfidence: number;
|
|
150
|
+
successfulRoutings: number;
|
|
151
|
+
learningOutcomes: number;
|
|
152
|
+
successfulOutcomes: number;
|
|
153
|
+
avgPatternSuccessRate: number;
|
|
154
|
+
};
|
|
137
155
|
/**
|
|
138
156
|
* Check if there's any historical data (embeddings, usage, trajectories)
|
|
139
157
|
* even if qe_patterns is empty. Used to detect data loss vs fresh database.
|
|
@@ -596,6 +596,65 @@ export class SQLitePatternStore {
|
|
|
596
596
|
}
|
|
597
597
|
return { totalPatterns: total, byDomain, byTier };
|
|
598
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* Aggregate outcome counters used by QEReasoningBank.getStats() as a fallback
|
|
601
|
+
* when the in-memory `this.stats` object is zero — every hook subprocess
|
|
602
|
+
* starts with a fresh counter, so without this fallback observability is
|
|
603
|
+
* always blank (#454).
|
|
604
|
+
*
|
|
605
|
+
* routing_outcomes and qe_pattern_usage live in the same unified memory.db
|
|
606
|
+
* as qe_patterns. avgConfidence/avgSuccessRate return 0 when the source
|
|
607
|
+
* tables are empty rather than NaN.
|
|
608
|
+
*/
|
|
609
|
+
getAggregateOutcomeStats() {
|
|
610
|
+
const empty = {
|
|
611
|
+
routingRequests: 0,
|
|
612
|
+
avgRoutingConfidence: 0,
|
|
613
|
+
successfulRoutings: 0,
|
|
614
|
+
learningOutcomes: 0,
|
|
615
|
+
successfulOutcomes: 0,
|
|
616
|
+
avgPatternSuccessRate: 0,
|
|
617
|
+
};
|
|
618
|
+
if (!this.db)
|
|
619
|
+
return empty;
|
|
620
|
+
const safeGet = (sql) => {
|
|
621
|
+
try {
|
|
622
|
+
return this.db.prepare(sql).get();
|
|
623
|
+
}
|
|
624
|
+
catch {
|
|
625
|
+
return undefined;
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
// routing_outcomes carries (success, quality_score) per closed turn.
|
|
629
|
+
// Sentinels still have quality_score = -1, so filter to closed rows.
|
|
630
|
+
const routing = safeGet(`
|
|
631
|
+
SELECT
|
|
632
|
+
COUNT(*) AS total,
|
|
633
|
+
COUNT(CASE WHEN quality_score >= 0 THEN 1 END) AS closed,
|
|
634
|
+
AVG(CASE WHEN quality_score >= 0 THEN quality_score END) AS avg_q,
|
|
635
|
+
COALESCE(SUM(CASE WHEN success = 1 THEN 1 ELSE 0 END), 0) AS succ
|
|
636
|
+
FROM routing_outcomes
|
|
637
|
+
`);
|
|
638
|
+
const usage = safeGet(`
|
|
639
|
+
SELECT
|
|
640
|
+
COUNT(*) AS total,
|
|
641
|
+
COALESCE(SUM(CASE WHEN success = 1 THEN 1 ELSE 0 END), 0) AS succ
|
|
642
|
+
FROM qe_pattern_usage
|
|
643
|
+
`);
|
|
644
|
+
const patternAvg = safeGet(`
|
|
645
|
+
SELECT AVG(success_rate) AS avg_sr
|
|
646
|
+
FROM qe_patterns
|
|
647
|
+
WHERE usage_count > 0
|
|
648
|
+
`);
|
|
649
|
+
return {
|
|
650
|
+
routingRequests: routing?.total ?? 0,
|
|
651
|
+
avgRoutingConfidence: routing?.avg_q ?? 0,
|
|
652
|
+
successfulRoutings: routing?.succ ?? 0,
|
|
653
|
+
learningOutcomes: usage?.total ?? 0,
|
|
654
|
+
successfulOutcomes: usage?.succ ?? 0,
|
|
655
|
+
avgPatternSuccessRate: patternAvg?.avg_sr ?? 0,
|
|
656
|
+
};
|
|
657
|
+
}
|
|
599
658
|
/**
|
|
600
659
|
* Check if there's any historical data (embeddings, usage, trajectories)
|
|
601
660
|
* even if qe_patterns is empty. Used to detect data loss vs fresh database.
|