agentic-qe 3.9.24 → 3.9.26
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 +162 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-LIPKRUFH.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-YYKCGP5I.js → agent-booster-wasm-ZOADSKRX.js} +2 -2
- package/dist/cli/chunks/{agent-handler-SDRMLJNW.js → agent-handler-SPLFCIHA.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-AD5E4475.js → agent-memory-branch-R6ZVL2FT.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-XJGJ6YS7.js +2 -0
- package/dist/cli/chunks/{audit-6CXDBP5N.js → audit-6TQQFGQN.js} +2 -2
- package/dist/cli/chunks/base-22RFSMJU.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-PIFTVXNO.js → better-sqlite3-QIKWKEGD.js} +2 -2
- package/dist/cli/chunks/{brain-handler-QPMGPK4J.js → brain-handler-6BQCTD3M.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-RNVAQ47F.js → branch-enumerator-JTESSKID.js} +2 -2
- package/dist/cli/chunks/{browser-GCXX35IY.js → browser-YDZLFZNH.js} +2 -2
- package/dist/cli/chunks/browser-workflow-ST7DX7KA.js +2 -0
- package/dist/cli/chunks/{chunk-ROBKPGX5.js → chunk-22YZRYG4.js} +3 -3
- package/dist/cli/chunks/{chunk-HQY2BNJT.js → chunk-2OFL5HSB.js} +2 -2
- package/dist/cli/chunks/{chunk-HFPQVO4O.js → chunk-2XOIJE7J.js} +2 -2
- package/dist/cli/chunks/{chunk-PTIPWMXS.js → chunk-3K2QCWFD.js} +1 -1
- package/dist/cli/chunks/{chunk-TQGEZV6M.js → chunk-3QPQZJUY.js} +2 -2
- package/dist/cli/chunks/{chunk-XD6XAYKA.js → chunk-4EBC7ATS.js} +9 -9
- package/dist/cli/chunks/{chunk-G73FWR34.js → chunk-4F6RPT7N.js} +3 -3
- package/dist/cli/chunks/{chunk-7H36CVZ6.js → chunk-4GUVB7FG.js} +2 -2
- package/dist/cli/chunks/{chunk-WB3GQ7X7.js → chunk-4I6XGKSB.js} +2 -2
- package/dist/cli/chunks/{chunk-F4GZAQR2.js → chunk-4QUKBJAS.js} +2 -2
- package/dist/cli/chunks/{chunk-FHRUSW2V.js → chunk-4RFODPDS.js} +2 -2
- package/dist/cli/chunks/{chunk-NOUDTI2R.js → chunk-4U57VG6R.js} +2 -2
- package/dist/cli/chunks/{chunk-BWCSNSXR.js → chunk-4ZAOHYFA.js} +2 -2
- package/dist/cli/chunks/{chunk-QUN5QEW5.js → chunk-5JGFDJA6.js} +2 -2
- package/dist/cli/chunks/{chunk-QLPGWGJT.js → chunk-5TTQNRAP.js} +1 -1
- package/dist/cli/chunks/{chunk-M7MA7R2X.js → chunk-6AH4SN6I.js} +1 -1
- package/dist/cli/chunks/{chunk-IFCUBSI2.js → chunk-6UFMNYQV.js} +1 -1
- package/dist/cli/chunks/{chunk-K2M6UBGI.js → chunk-6VRKHHYI.js} +1 -1
- package/dist/cli/chunks/{chunk-I3VTEYYF.js → chunk-7L3F76MS.js} +3 -3
- package/dist/cli/chunks/{chunk-FPBCG7CX.js → chunk-7T2KT74O.js} +25 -9
- package/dist/cli/chunks/{chunk-BDGKN7GC.js → chunk-A4U4DNPR.js} +1 -1
- package/dist/cli/chunks/{chunk-WGEX22Z4.js → chunk-AGBIQXB4.js} +2 -2
- package/dist/cli/chunks/{chunk-MDSCVTJZ.js → chunk-AH3IPNOJ.js} +2 -2
- package/dist/cli/chunks/{chunk-U6V6R2EF.js → chunk-ANEIDNH7.js} +2 -2
- package/dist/cli/chunks/{chunk-MG52OB2J.js → chunk-AOURUJFN.js} +1 -1
- package/dist/cli/chunks/{chunk-4LA24G33.js → chunk-ARLHD5MG.js} +1 -1
- package/dist/cli/chunks/{chunk-LX6XRBJ2.js → chunk-AUD45G7X.js} +2 -2
- package/dist/cli/chunks/{chunk-HYX3LWLA.js → chunk-B3KHJQ34.js} +2 -2
- package/dist/cli/chunks/{chunk-IQRLMOTN.js → chunk-BBALCRJM.js} +1 -1
- package/dist/cli/chunks/{chunk-OJPKAWKD.js → chunk-BFSKBIAM.js} +1 -1
- package/dist/cli/chunks/{chunk-HGOTTQQK.js → chunk-BOV44F3Z.js} +2 -2
- package/dist/cli/chunks/{chunk-L5JJKGKJ.js → chunk-C5ZA6UBI.js} +1 -1
- package/dist/cli/chunks/{chunk-LOFQAI7V.js → chunk-C77FS4ER.js} +2 -2
- package/dist/cli/chunks/{chunk-7XK73L6C.js → chunk-CBBVUZFD.js} +10 -10
- package/dist/cli/chunks/{chunk-JYMDWMEJ.js → chunk-CMFRBO4N.js} +3 -3
- package/dist/cli/chunks/{chunk-73K34C4S.js → chunk-CU5Q46NR.js} +4 -4
- package/dist/cli/chunks/{chunk-3ZNIACXR.js → chunk-CYPOU765.js} +1 -1
- package/dist/cli/chunks/{chunk-EAC3PZGH.js → chunk-DBSEDJ7P.js} +2 -2
- package/dist/cli/chunks/{chunk-OOU4VQ2T.js → chunk-EEWGVVKH.js} +2 -2
- package/dist/cli/chunks/{chunk-RMTPAEZO.js → chunk-EFAN5HUX.js} +2 -2
- package/dist/cli/chunks/{chunk-5OBSLVXI.js → chunk-EPCKRFMU.js} +2 -2
- package/dist/cli/chunks/{chunk-O4CTWG4B.js → chunk-EQ4IZRD5.js} +2 -2
- package/dist/cli/chunks/{chunk-4AUGLQOE.js → chunk-ETBVBV2M.js} +2 -2
- package/dist/cli/chunks/{chunk-YRKY76JZ.js → chunk-EX7UGFWX.js} +2 -2
- package/dist/cli/chunks/{chunk-DZPKBTP3.js → chunk-EYFL6QLX.js} +2 -2
- package/dist/cli/chunks/{chunk-A4CHQJEO.js → chunk-F24XTOID.js} +2 -2
- package/dist/cli/chunks/{chunk-RGOJFKIY.js → chunk-F77VZ4IY.js} +2 -2
- package/dist/cli/chunks/{chunk-QNMIY45G.js → chunk-FDC2ANCP.js} +3 -3
- package/dist/cli/chunks/{chunk-TS5YIHJH.js → chunk-FRUDEEZH.js} +1 -1
- package/dist/cli/chunks/{chunk-UGR3JJD7.js → chunk-FWPV44HL.js} +2 -2
- package/dist/cli/chunks/{chunk-MUH2YGNO.js → chunk-G3KTLF57.js} +2 -2
- package/dist/cli/chunks/{chunk-L7EDWT5P.js → chunk-G42KXBBG.js} +2 -2
- package/dist/cli/chunks/{chunk-3Y5C4SE3.js → chunk-GHQ6QT47.js} +2 -2
- package/dist/cli/chunks/{chunk-SNTRKHVH.js → chunk-GW5T4BSO.js} +5 -5
- package/dist/cli/chunks/{chunk-PU3MT7SE.js → chunk-HKHRIPXP.js} +7 -7
- package/dist/cli/chunks/{chunk-L5Y2BVYX.js → chunk-HSQLB4GR.js} +2 -2
- package/dist/cli/chunks/{chunk-MXXRESCK.js → chunk-IKRLPS4M.js} +2 -2
- package/dist/cli/chunks/{chunk-N643IL63.js → chunk-IVNZLESN.js} +2 -2
- package/dist/cli/chunks/{chunk-ZSVCK7B2.js → chunk-JWKNHSXP.js} +2 -2
- package/dist/cli/chunks/{chunk-NYEVQB5R.js → chunk-K64UL5PA.js} +2 -2
- package/dist/cli/chunks/{chunk-6FCVDWPR.js → chunk-KQQPUHQD.js} +1 -1
- package/dist/cli/chunks/{chunk-YLC6QGNW.js → chunk-LP7ILPFQ.js} +2 -2
- package/dist/cli/chunks/{chunk-L4JUOVBW.js → chunk-LPDPGCDC.js} +2 -2
- package/dist/cli/chunks/{chunk-QDUV7TDQ.js → chunk-MAPQ2UZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-OPHVJUZK.js → chunk-MSPY7HMF.js} +2 -2
- package/dist/cli/chunks/{chunk-4SDQZI7D.js → chunk-MTRA6I7Y.js} +1 -1
- package/dist/cli/chunks/{chunk-AJ45BRKK.js → chunk-MW4WEMLE.js} +2 -2
- package/dist/cli/chunks/{chunk-V7IDAZKZ.js → chunk-MXZY5IJA.js} +1 -1
- package/dist/cli/chunks/{chunk-42CCJFXZ.js → chunk-N2ET2TL5.js} +2 -2
- package/dist/cli/chunks/{chunk-EALLOFGD.js → chunk-N3GLRFMH.js} +1 -1
- package/dist/cli/chunks/{chunk-O3ADCWEC.js → chunk-OFAXQGU5.js} +2 -2
- package/dist/cli/chunks/{chunk-4FCCQJQA.js → chunk-ONYCSOAR.js} +1 -1
- package/dist/cli/chunks/{chunk-6SWRLJ3I.js → chunk-P6M6LNSI.js} +2 -2
- package/dist/cli/chunks/{chunk-C4ST4NP4.js → chunk-PJPNRDEF.js} +2 -2
- package/dist/cli/chunks/{chunk-7I6ULQRI.js → chunk-PLB75ASZ.js} +1 -1
- package/dist/cli/chunks/{chunk-EHA2BZ47.js → chunk-PPP7KZQL.js} +2 -2
- package/dist/cli/chunks/{chunk-SE572JWE.js → chunk-PS7YB3IV.js} +3 -3
- package/dist/cli/chunks/{chunk-W7HIJ5DV.js → chunk-PSOF6DZA.js} +8 -8
- package/dist/cli/chunks/{chunk-25AL3RPA.js → chunk-QFXOKERO.js} +1 -1
- package/dist/cli/chunks/{chunk-ZJNZ5SDG.js → chunk-QQMGUORN.js} +2 -2
- package/dist/cli/chunks/{chunk-PSJJNJLE.js → chunk-QU7TNCUB.js} +1 -1
- package/dist/cli/chunks/{chunk-RSED3U2F.js → chunk-QUHNBIUZ.js} +1 -1
- package/dist/cli/chunks/{chunk-Z2CO6ZI5.js → chunk-QXQWQRZA.js} +1 -1
- package/dist/cli/chunks/{chunk-TUY3BOQM.js → chunk-RD3CNJWR.js} +2 -2
- package/dist/cli/chunks/{chunk-LVR47OZA.js → chunk-RLAXE5HU.js} +2 -2
- package/dist/cli/chunks/{chunk-WH75EHSK.js → chunk-RNVXTNEB.js} +2 -2
- package/dist/cli/chunks/chunk-RSNZQ3MN.js +2 -0
- package/dist/cli/chunks/{chunk-7ODDJI3P.js → chunk-RXQX6JNQ.js} +2 -2
- package/dist/cli/chunks/{chunk-CTSTHKH4.js → chunk-SDD3XQ7X.js} +1 -1
- package/dist/cli/chunks/{chunk-DZHAXSOZ.js → chunk-SGGYSL7J.js} +1 -1
- package/dist/cli/chunks/{chunk-3NZ7IVRI.js → chunk-SYQZPNHQ.js} +2 -2
- package/dist/cli/chunks/{chunk-54RVQDTB.js → chunk-SYRUG2T7.js} +1 -1
- package/dist/cli/chunks/{chunk-HH3ENF7B.js → chunk-TLBP7EVX.js} +1 -1
- package/dist/cli/chunks/{chunk-YFWVVYZX.js → chunk-TQBP3YGG.js} +1 -1
- package/dist/cli/chunks/{chunk-ZHVORPKM.js → chunk-TRIA62JA.js} +2 -2
- package/dist/cli/chunks/{chunk-INPP5RW4.js → chunk-TU2A5BGA.js} +2 -2
- package/dist/cli/chunks/{chunk-73JTRGIQ.js → chunk-TZ73IAF5.js} +2 -2
- package/dist/cli/chunks/{chunk-LQHWPAQP.js → chunk-U5BMUXV2.js} +2 -2
- package/dist/cli/chunks/{chunk-3LHP7G6U.js → chunk-UJPERPQU.js} +1 -1
- package/dist/cli/chunks/{chunk-KSN6QUCR.js → chunk-VBJ4UQ3X.js} +2 -2
- package/dist/cli/chunks/{chunk-7LIRKYB6.js → chunk-VC2FHUOY.js} +2 -2
- package/dist/cli/chunks/{chunk-QG63KW2J.js → chunk-VHHFSVR3.js} +2 -2
- package/dist/cli/chunks/{chunk-KQRJXVMO.js → chunk-VPPXZORB.js} +1 -1
- package/dist/cli/chunks/{chunk-VUKMN54Z.js → chunk-WCI2FMWZ.js} +1 -1
- package/dist/cli/chunks/{chunk-6XXHK6NL.js → chunk-WND3EYCS.js} +2 -2
- package/dist/cli/chunks/{chunk-PEKULOY4.js → chunk-XAA7ZBNG.js} +1 -1
- package/dist/cli/chunks/{chunk-JDJ6VEXU.js → chunk-XDEF6UFY.js} +2 -2
- package/dist/cli/chunks/{chunk-7TC7HNSA.js → chunk-XHENTAXI.js} +2 -2
- package/dist/cli/chunks/{chunk-YEVQOQVZ.js → chunk-XYMUYLHY.js} +1 -1
- package/dist/cli/chunks/{chunk-2NJO73YD.js → chunk-Y3YJMKXS.js} +2 -2
- package/dist/cli/chunks/{chunk-RHFNFYIL.js → chunk-YCZEXLKL.js} +2 -2
- package/dist/cli/chunks/{chunk-Q5OLVIKK.js → chunk-YUMVG55I.js} +2 -2
- package/dist/cli/chunks/{chunk-ERDCTBUC.js → chunk-YYOKX7VH.js} +2 -2
- package/dist/cli/chunks/{chunk-DFG3KX7E.js → chunk-ZFLD5ATZ.js} +2 -2
- package/dist/cli/chunks/{chunk-JVN5TS5E.js → chunk-ZUUNOGHI.js} +2 -2
- package/dist/cli/chunks/{ci-F4VZKYED.js → ci-EAX5WWT6.js} +2 -2
- package/dist/cli/chunks/{ci-output-LLKTJAKA.js → ci-output-JCWHRJ2A.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ZQ4747J4.js → circuit-breaker-RAEDVT33.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-LHM5WAJN.js → claude-flow-setup-NJAY4WXY.js} +2 -2
- package/dist/cli/chunks/client-6463JNJR.js +2 -0
- package/dist/cli/chunks/{cline-installer-YZOPUVED.js → cline-installer-X3GCUEWC.js} +2 -2
- package/dist/cli/chunks/{code-7WPHN4PO.js → code-GXJ6JC6O.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-N25SYDBV.js → code-index-extractor-TTA7HZEW.js} +2 -2
- package/dist/cli/chunks/{codex-installer-53WXU6E4.js → codex-installer-TXMSGJHK.js} +2 -2
- package/dist/cli/chunks/{completions-WPB73WPI.js → completions-RSFIDY22.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-OLOYWXN5.js → complexity-analyzer-C6244ZOI.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-5QXNYNJG.js → continuedev-installer-5WQIRQW4.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-POWDJ5TF.js → copilot-installer-5Q64SC52.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-NCRSKECA.js → cost-tracker-6SBRULNN.js} +2 -2
- package/dist/cli/chunks/{coverage-ZOWE75NF.js → coverage-X2AG3K6E.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-OYUCD42M.js +2 -0
- package/dist/cli/chunks/{cursor-installer-W5U432Q4.js → cursor-installer-VHZ5LEPG.js} +2 -2
- package/dist/cli/chunks/{daemon-JHXPBUL3.js → daemon-CDQXWIV4.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-JKYKYDLZ.js → dag-attention-scheduler-33UWNTSB.js} +2 -2
- package/dist/cli/chunks/{detect-MNW7EGOS.js → detect-UDWTKRQL.js} +2 -2
- package/dist/cli/chunks/{dist-node-33BRM2EM.js → dist-node-CKTPNPBG.js} +2 -2
- package/dist/cli/chunks/{domain-handler-PRTXYKNX.js → domain-handler-5J4AH4XR.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-FJVNUH6Y.js → domain-transfer-P6VPN56R.js} +2 -2
- package/dist/cli/chunks/dream-R76KD347.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-XST4CYRL.js → embed-and-insert-pattern-2YFFI7IN.js} +2 -2
- package/dist/cli/chunks/{eval-SLBS3MDW.js → eval-K7VFIO2T.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-MZ4VBCGB.js → experience-capture-middleware-P4RQW7JV.js} +3 -3
- package/dist/cli/chunks/{fast-paths-H6Z4TAE7.js → fast-paths-T27YLQWQ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-RF44J4FC.js → feature-flags-HHQNCU6V.js} +2 -2
- package/dist/cli/chunks/{feature-flags-7UYNPXYB.js → feature-flags-YFPFETDZ.js} +2 -2
- package/dist/cli/chunks/{file-discovery-2RZS7M6Q.js → file-discovery-ZKNENDOJ.js} +2 -2
- package/dist/cli/chunks/{fleet-XVVAC32S.js → fleet-N5OTMFIN.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-XAJR4F5W.js → gnn-wrapper-D6L4FIWY.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-PAPNBHL5.js → heartbeat-handler-5RDU3KKK.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-PNGMQ5A2.js → heartbeat-scheduler-FALV24GQ.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-CYWGI732.js +2 -0
- package/dist/cli/chunks/hnsw-index-UOYT3QKQ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-EK67OOYT.js → hnsw-legacy-bridge-ARD7KA3G.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-X4MDD7D3.js → hnswlib-node-TULXUZI4.js} +2 -2
- package/dist/cli/chunks/hooks-6HA23JHQ.js +259 -0
- package/dist/cli/chunks/{hybrid-router-FA6Q25KJ.js → hybrid-router-XUYQW7FJ.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-PT6AI5VE.js → hypergraph-engine-OGGXYQAO.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-TTP3AY5E.js → hypergraph-handler-UFV3XYVX.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-PWV7CJUA.js +2 -0
- package/dist/cli/chunks/{init-handler-GV4RMNLA.js → init-handler-VUSXGONQ.js} +6 -6
- package/dist/cli/chunks/init-wizard-DKIFAPJJ.js +2 -0
- package/dist/cli/chunks/kernel-WQL2MUBH.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-MUK6H6PQ.js → kilocode-installer-C2JMSYAU.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-VHOG37LV.js → kiro-installer-6LJFFEEZ.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-U5OZDWGT.js +2 -0
- package/dist/cli/chunks/{learning-N5NUW6SR.js → learning-4B624JV3.js} +3 -3
- package/dist/cli/chunks/{llm-router-6D3JJ5MX.js → llm-router-QUOLZECD.js} +4 -4
- package/dist/cli/chunks/{load-3ZM66OKE.js → load-MIQWBMGE.js} +2 -2
- package/dist/cli/chunks/load-test-D2CQYRZQ.js +2 -0
- package/dist/cli/chunks/{mcp-W2JSXQ32.js → mcp-MBJWNXDM.js} +2 -2
- package/dist/cli/chunks/{memory-J4W4HRUH.js → memory-WX3XHQZP.js} +5 -5
- package/dist/cli/chunks/memory-backend-HFIGDCZE.js +2 -0
- package/dist/cli/chunks/{memory-handlers-ZBNFDKP4.js → memory-handlers-Q3XCN5SC.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-MVEFZZSV.js → multi-model-executor-RLY7OQOG.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-DGRDAJFV.js → opencode-installer-JATQNZWA.js} +2 -2
- package/dist/cli/chunks/{orchestrator-LPXK5JF7.js → orchestrator-7BNG32I2.js} +6 -6
- package/dist/cli/chunks/{pipeline-7GABQFX4.js → pipeline-ORKGL7DP.js} +2 -2
- package/dist/cli/chunks/{platform-FNGEQTDL.js → platform-4SLJDRVL.js} +2 -2
- package/dist/cli/chunks/{plugin-T4YRNESL.js → plugin-V6FRBF4W.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-I25PHLYB.js → prime-radiant-advanced-wasm-NA7AXKCA.js} +2 -2
- package/dist/cli/chunks/protocol-executor-LTJIEFVG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-6KWLEBZJ.js → protocol-handler-RSJOZ4XL.js} +2 -2
- package/dist/cli/chunks/{prove-B5XQ3SY4.js → prove-2ZMKUODH.js} +2 -2
- package/dist/cli/chunks/{provider-manager-WTZ3FGAH.js → provider-manager-PSPAFCK7.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-ZJ56AWO2.js +2 -0
- package/dist/cli/chunks/{quality-JQ3M7ENY.js → quality-6PZOOQSK.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-CZA7SS4O.js +2 -0
- package/dist/cli/chunks/{real-embeddings-EH4WUKDJ.js → real-embeddings-BGNTSKHD.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-6GLCDHDJ.js → roocode-installer-NOHRQJIP.js} +2 -2
- package/dist/cli/chunks/router-N23IDBEQ.js +2 -0
- package/dist/cli/chunks/routing-feedback-IADXJ4RV.js +2 -0
- package/dist/cli/chunks/{routing-handler-4N2XJFNM.js → routing-handler-ZAOGNENU.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-MGWMR2WN.js → ruvector-commands-5K3Q4N5H.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-6LN3WQEK.js → rvf-dual-writer-NWFQC4KN.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-LAZ5EDQG.js → rvf-migration-adapter-MS7QGBWK.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-LRXFWTDN.js → rvf-migration-coordinator-YUBSSB6Z.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-MOR7NUA5.js +2 -0
- package/dist/cli/chunks/safe-db-IRAUFZTC.js +2 -0
- package/dist/cli/chunks/schedule-PKUUCNCA.js +2 -0
- package/dist/cli/chunks/scheduler-NE4NP4W5.js +2 -0
- package/dist/cli/chunks/{security-JMEQUSTV.js → security-BJWJWQRB.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-OTON2BMV.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-W3KUF2Z5.js → shared-rvf-dual-writer-LEBD3EHA.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-DXFBYN5L.js +2 -0
- package/dist/cli/chunks/{status-handler-T3MU7LJC.js → status-handler-XANOAVIB.js} +2 -2
- package/dist/cli/chunks/{structural-health-DKLLSKB7.js → structural-health-TZA7PJ2T.js} +2 -2
- package/dist/cli/chunks/{sync-YV4JLAYR.js → sync-MKNYPUYP.js} +2 -2
- package/dist/cli/chunks/{task-handler-WFMLTZFA.js → task-handler-KXSUKNQV.js} +2 -2
- package/dist/cli/chunks/{task-handlers-XPRO67IJ.js → task-handlers-54MMRT3D.js} +3 -3
- package/dist/cli/chunks/{test-6LD3KVOS.js → test-AKS5AAT7.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-E5CSY4SE.js → test-scheduling-OA7UPWQ5.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-TLPEXH6S.js → token-bootstrap-ZIUNRF3E.js} +2 -2
- package/dist/cli/chunks/{token-usage-2MDI65YN.js → token-usage-IJENSXPQ.js} +2 -2
- package/dist/cli/chunks/{transformers-CMZ3QD3F.js → transformers-CACTFP7H.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-IXDHBBYF.js → tree-sitter-wasm-parser-4H4UVHAQ.js} +2 -2
- package/dist/cli/chunks/{types-GAK4Q24M.js → types-AGACOWV3.js} +2 -2
- package/dist/cli/chunks/unified-memory-4M3V7XL6.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-6IKIDXEW.js +2 -0
- package/dist/cli/chunks/unified-persistence-XJ4D23TB.js +2 -0
- package/dist/cli/chunks/{upgrade-TFUW4SLZ.js → upgrade-EKE25VPL.js} +2 -2
- package/dist/cli/chunks/{validate-J4GGNKLW.js → validate-BZTYZQGP.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-KCQX46PY.js → validate-swarm-GZANKJ7M.js} +2 -2
- package/dist/cli/chunks/{vibium-WKIFKIZW.js → vibium-5X7QY25W.js} +2 -2
- package/dist/cli/chunks/visual-security-2X63QHFJ.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-OQSGWVGY.js → web-tree-sitter-KDFT6ZUY.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-D6PIM3JO.js → windsurf-installer-QFZJISMO.js} +2 -2
- package/dist/cli/chunks/{witness-chain-NRVX76IB.js → witness-chain-ESSANJ4X.js} +2 -2
- package/dist/cli/chunks/witness-chain-MWIG363M.js +2 -0
- package/dist/cli/chunks/{workflow-3X2UQG7E.js → workflow-EQFV2P66.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-B3ECPAFI.js +2 -0
- package/dist/cli/chunks/{wrappers-UXKMHCHX.js → wrappers-RKJJDJLC.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 +113 -6
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +20 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +72 -0
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +103 -36
- package/dist/cli/commands/hooks-handlers/task-hooks.js +16 -3
- package/dist/cli/commands/hooks.js +1 -0
- package/dist/init/init-wizard-hooks.js +13 -0
- package/dist/init/phases/07-hooks.js +14 -0
- package/dist/learning/qe-reasoning-bank.js +39 -8
- 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 +142 -126
- package/package.json +8 -3
- package/dist/cli/chunks/adapter-KIGGXGP6.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-L3OD7COO.js +0 -2
- package/dist/cli/chunks/base-D55R3AAK.js +0 -2
- package/dist/cli/chunks/browser-workflow-GVOTUSBY.js +0 -2
- package/dist/cli/chunks/chunk-DWNKD2AQ.js +0 -2
- package/dist/cli/chunks/client-LZ4J7CB2.js +0 -2
- package/dist/cli/chunks/cross-domain-router-RQJLKTPC.js +0 -2
- package/dist/cli/chunks/dream-LLY2GYI7.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-5KZG2W4N.js +0 -2
- package/dist/cli/chunks/hnsw-index-RVENHJNC.js +0 -2
- package/dist/cli/chunks/hooks-FXUZIAAW.js +0 -225
- package/dist/cli/chunks/impact-analyzer-NXT3TDYG.js +0 -2
- package/dist/cli/chunks/init-wizard-WWYKBF4D.js +0 -2
- package/dist/cli/chunks/kernel-HGEE2UL6.js +0 -2
- package/dist/cli/chunks/knowledge-graph-EOJCWCZL.js +0 -2
- package/dist/cli/chunks/load-test-HRB2KH2Y.js +0 -2
- package/dist/cli/chunks/memory-backend-DPAKTNVV.js +0 -2
- package/dist/cli/chunks/protocol-executor-XQX2GJVA.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-FYUB2RJT.js +0 -2
- package/dist/cli/chunks/queen-coordinator-J52B6O53.js +0 -2
- package/dist/cli/chunks/router-WFPO4XXI.js +0 -2
- package/dist/cli/chunks/routing-feedback-2RL7OC36.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-SA4QDDO3.js +0 -2
- package/dist/cli/chunks/safe-db-E5KUJFP2.js +0 -2
- package/dist/cli/chunks/schedule-BF4MDQ4Z.js +0 -2
- package/dist/cli/chunks/scheduler-QG2JMZVB.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-S4KZM33F.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-BXM2XX7R.js +0 -2
- package/dist/cli/chunks/unified-memory-WPVYK4Q5.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-G3PRXB4L.js +0 -2
- package/dist/cli/chunks/unified-persistence-WZ5XANS4.js +0 -2
- package/dist/cli/chunks/visual-security-ZVQG2EY4.js +0 -2
- package/dist/cli/chunks/witness-chain-F3PHT6MB.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-VQVQKILY.js +0 -2
|
@@ -45,6 +45,37 @@ export async function checkAndTriggerDream(memoryBackend) {
|
|
|
45
45
|
}
|
|
46
46
|
const reason = timeTriggered ? 'time-interval' : 'experience-threshold';
|
|
47
47
|
console.log(chalk.dim(`[hooks] Dream trigger: ${reason} (${dreamState.experienceCount} experiences, ${Math.round(timeSinceLastDream / 60000)}min since last dream)`));
|
|
48
|
+
// Issue #461: concurrent hook subprocesses all see the same stale
|
|
49
|
+
// dreamState.lastDreamTime, race past the time/experience triggers, and
|
|
50
|
+
// start ~10s dream cycles in parallel. They then all hit the WAL writer
|
|
51
|
+
// at roughly the same time and 35% of cycles fail with
|
|
52
|
+
// `database is locked` (duration_ms ≈ 10050ms — the full cycle ran, only
|
|
53
|
+
// the write-back failed). `busy_timeout` doesn't help: it serializes
|
|
54
|
+
// sequential contention, not simultaneous writers.
|
|
55
|
+
//
|
|
56
|
+
// Peek at dream_cycles before we open the engine — if another process
|
|
57
|
+
// has started a cycle in the last 60s, bail out with reason='already-
|
|
58
|
+
// running'. Fail-open: any error in the guard lets the dream proceed,
|
|
59
|
+
// so this can never make things worse than they were before.
|
|
60
|
+
try {
|
|
61
|
+
const { getUnifiedMemory } = await import('../../../kernel/unified-memory.js');
|
|
62
|
+
const um = getUnifiedMemory();
|
|
63
|
+
if (um.isInitialized()) {
|
|
64
|
+
const db = um.getDatabase();
|
|
65
|
+
const running = db
|
|
66
|
+
.prepare(`SELECT COUNT(*) AS n FROM dream_cycles
|
|
67
|
+
WHERE status = 'running'
|
|
68
|
+
AND start_time > datetime('now', '-60 seconds')`)
|
|
69
|
+
.get();
|
|
70
|
+
if (running && running.n > 0) {
|
|
71
|
+
return { triggered: false, reason: 'already-running' };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// fail-open — if dream_cycles table is missing or unified memory not
|
|
77
|
+
// ready, we'd rather risk the rare lock than block dreaming entirely.
|
|
78
|
+
}
|
|
48
79
|
// Run a quick dream cycle
|
|
49
80
|
const { createDreamEngine } = await import('../../../learning/dream/index.js');
|
|
50
81
|
const { createQEReasoningBank: createRB } = await import('../../../learning/qe-reasoning-bank.js');
|
|
@@ -76,6 +107,27 @@ export async function checkAndTriggerDream(memoryBackend) {
|
|
|
76
107
|
await engine.loadPatternsAsConcepts(importPatterns);
|
|
77
108
|
}
|
|
78
109
|
const result = await engine.dream(10000);
|
|
110
|
+
// Issue #456: apply actionable insights inline so the hook path doesn't
|
|
111
|
+
// leave the backlog growing forever. DreamScheduler.autoApplyInsights()
|
|
112
|
+
// wires this in the daemon path, but checkAndTriggerDream is the
|
|
113
|
+
// hook-driven path and has no scheduler — without this block, every
|
|
114
|
+
// hook-fired dream cycle writes insights with applied=0 and they
|
|
115
|
+
// accumulate indefinitely (#456 evidence: 378 unapplied / 9 applied).
|
|
116
|
+
// Threshold matches DreamSchedulerConfig.insightConfidenceThreshold
|
|
117
|
+
// default (0.5) and InsightGenerator's `actionable` gate.
|
|
118
|
+
let insightsApplied = 0;
|
|
119
|
+
try {
|
|
120
|
+
for (const insight of result.insights) {
|
|
121
|
+
if (insight.actionable && insight.confidenceScore >= 0.5) {
|
|
122
|
+
const applyResult = await engine.applyInsight(insight.id);
|
|
123
|
+
if (applyResult.success)
|
|
124
|
+
insightsApplied++;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (applyErr) {
|
|
129
|
+
console.error(chalk.dim(`[hooks] Dream apply: ${applyErr instanceof Error ? applyErr.message : 'unknown'}`));
|
|
130
|
+
}
|
|
79
131
|
// Update state
|
|
80
132
|
dreamState.lastDreamTime = new Date().toISOString();
|
|
81
133
|
dreamState.experienceCount = 0;
|
|
@@ -86,6 +138,7 @@ export async function checkAndTriggerDream(memoryBackend) {
|
|
|
86
138
|
triggered: true,
|
|
87
139
|
reason,
|
|
88
140
|
insightsGenerated: result.insights.length,
|
|
141
|
+
insightsApplied,
|
|
89
142
|
};
|
|
90
143
|
}
|
|
91
144
|
catch (error) {
|
|
@@ -236,12 +289,19 @@ export async function persistTaskOutcome(opts) {
|
|
|
236
289
|
model_tier, started_at, completed_at, source)
|
|
237
290
|
VALUES (?, ?, ?, ?, ?, ?, ?, NULL, datetime('now'), datetime('now'), ?)
|
|
238
291
|
`).run(experienceId, taskField.slice(0, 500), opts.agent, opts.domain ?? 'general', opts.success ? 1 : 0, qualityScore, durationMs, 'cli-hook-post-task');
|
|
239
|
-
// 2. Base experience_applications row
|
|
292
|
+
// 2. Base experience_applications row.
|
|
293
|
+
//
|
|
294
|
+
// Issue #463: tokens_saved was hardcoded to 0 on every row, so the
|
|
295
|
+
// learning-ROI column was permanently useless. qualityScore is already
|
|
296
|
+
// computed above and ranges 0.34 (failure+slow) to 0.68 (success+fast).
|
|
297
|
+
// Scale by 100 as a proxy until a real per-task token-delta calculation
|
|
298
|
+
// is wired in — gives a non-trivial 34-68 signal that downstream
|
|
299
|
+
// analytics can reason about.
|
|
240
300
|
db.prepare(`
|
|
241
301
|
INSERT INTO experience_applications
|
|
242
302
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
243
303
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
244
|
-
`).run(`app-${Date.now()}-${randomUUID().slice(0, 8)}`, experienceId, taskField, opts.success ? 1 : 0,
|
|
304
|
+
`).run(`app-${Date.now()}-${randomUUID().slice(0, 8)}`, experienceId, taskField, opts.success ? 1 : 0, Math.round(qualityScore * 100), `[Patch 060] post-task outcome: ${opts.success ? 'success' : 'failure'}`);
|
|
245
305
|
// 3. Read bridge → fan out per-pattern application rows + delete bridge
|
|
246
306
|
try {
|
|
247
307
|
const bridgeRow = db.prepare(`
|
|
@@ -287,6 +347,27 @@ export async function persistTaskOutcome(opts) {
|
|
|
287
347
|
WHERE id = ?
|
|
288
348
|
`);
|
|
289
349
|
const getPatternConfidence = db.prepare(`SELECT confidence FROM qe_patterns WHERE id = ?`);
|
|
350
|
+
// Issue #455: recordOutcome() is called with a synthetic
|
|
351
|
+
// `task:agent:taskId` patternId that never matches qe_patterns.id, so
|
|
352
|
+
// checkPatternPromotionWithCoherence() is skipped for the real UUIDs
|
|
353
|
+
// updated here. Without an inline promotion check, short-term patterns
|
|
354
|
+
// that cross the thresholds (successful_uses ≥ 3, success_rate ≥ 0.7,
|
|
355
|
+
// confidence ≥ 0.6) stay short-term forever — qe_patterns.long-term
|
|
356
|
+
// count never grows past zero.
|
|
357
|
+
const promotionSelectStmt = db.prepare(`
|
|
358
|
+
SELECT tier, successful_uses, success_rate, confidence
|
|
359
|
+
FROM qe_patterns
|
|
360
|
+
WHERE id = ?
|
|
361
|
+
`);
|
|
362
|
+
const promotionUpdateStmt = db.prepare(`
|
|
363
|
+
UPDATE qe_patterns
|
|
364
|
+
SET tier = 'long-term', updated_at = datetime('now')
|
|
365
|
+
WHERE id = ?
|
|
366
|
+
AND tier = 'short-term'
|
|
367
|
+
AND successful_uses >= 3
|
|
368
|
+
AND success_rate >= 0.7
|
|
369
|
+
AND confidence >= 0.6
|
|
370
|
+
`);
|
|
290
371
|
for (const patternId of bridge.selectedPatternIds) {
|
|
291
372
|
insertApp.run(`app-${Date.now()}-${randomUUID().slice(0, 8)}`, experienceId, `${taskField}:pattern:${patternId}`, opts.success ? 1 : 0, perPatternTokens, `[Patch 160+300] task-bridge pattern_id=${patternId} ts=${perPatternTokens}`);
|
|
292
373
|
try {
|
|
@@ -297,6 +378,19 @@ export async function persistTaskOutcome(opts) {
|
|
|
297
378
|
}
|
|
298
379
|
}
|
|
299
380
|
catch { /* fail-soft per pattern */ }
|
|
381
|
+
// Issue #455: re-read post-UPDATE state and promote if thresholds met.
|
|
382
|
+
// Guarded WHERE clause makes the UPDATE idempotent and no-op for
|
|
383
|
+
// already-long-term rows or rows below threshold.
|
|
384
|
+
try {
|
|
385
|
+
const pm = promotionSelectStmt.get(patternId);
|
|
386
|
+
if (pm?.tier === 'short-term' &&
|
|
387
|
+
pm.successful_uses >= 3 &&
|
|
388
|
+
pm.success_rate >= 0.7 &&
|
|
389
|
+
pm.confidence >= 0.6) {
|
|
390
|
+
promotionUpdateStmt.run(patternId);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
catch { /* fail-soft per pattern */ }
|
|
300
394
|
}
|
|
301
395
|
// 4. Delete bridge entry (one-shot consumption)
|
|
302
396
|
if (bridgeRow) {
|
|
@@ -475,12 +569,19 @@ export async function updateRoutingOutcomeQuality(opts) {
|
|
|
475
569
|
db.pragma('busy_timeout = 60000');
|
|
476
570
|
}
|
|
477
571
|
catch { /* hook-side patient timeout (ADR-001 / patch 260) */ }
|
|
572
|
+
// #451: explicit discriminator — only close PRE-TASK sentinels here.
|
|
573
|
+
// The route hook (UserPromptSubmit) writes sentinels with no taskId field
|
|
574
|
+
// in task_json. pre-task writes them with `"taskId"` in task_json. Without
|
|
575
|
+
// this filter, post-task could accidentally grab a stale route sentinel
|
|
576
|
+
// sitting from earlier in the session. Symmetric counterpart in
|
|
577
|
+
// routing-hooks.ts's `post-route` command, which has the inverse filter.
|
|
478
578
|
db.prepare(`
|
|
479
579
|
UPDATE routing_outcomes
|
|
480
580
|
SET success = ?, quality_score = ?, duration_ms = ?
|
|
481
581
|
WHERE id IN (
|
|
482
582
|
SELECT id FROM routing_outcomes
|
|
483
583
|
WHERE quality_score = -1
|
|
584
|
+
AND task_json LIKE '%"taskId"%'
|
|
484
585
|
AND created_at > datetime('now', '-30 minutes')
|
|
485
586
|
ORDER BY (CASE WHEN used_agent = ? THEN 0 ELSE 1 END), created_at DESC
|
|
486
587
|
LIMIT 1
|
|
@@ -523,9 +624,16 @@ export async function consolidateExperiencesToPatterns() {
|
|
|
523
624
|
}
|
|
524
625
|
}
|
|
525
626
|
// Aggregate unprocessed experiences by domain+agent with quality thresholds.
|
|
526
|
-
//
|
|
527
|
-
//
|
|
528
|
-
//
|
|
627
|
+
//
|
|
628
|
+
// Issue #464: dropped the `AND agent != 'cli-hook'` filter. The original
|
|
629
|
+
// exclusion (issue #348) was meant to keep low-quality Bash telemetry
|
|
630
|
+
// (quality ~0.40, success_rate ~0.24) from flooding the pipeline — but
|
|
631
|
+
// post-edit experiences also use agent='cli-hook' and have avg_quality
|
|
632
|
+
// ~0.75 / success_rate ~1.0, well above the HAVING thresholds. Excluding
|
|
633
|
+
// by agent name meant the dominant share of high-quality experiences was
|
|
634
|
+
// ineligible and consolidation never produced patterns. The HAVING clause
|
|
635
|
+
// below is the real quality gate; tighten it if #348's concern resurfaces
|
|
636
|
+
// rather than filtering by agent name.
|
|
529
637
|
const aggregates = db.prepare(`
|
|
530
638
|
SELECT
|
|
531
639
|
domain,
|
|
@@ -538,7 +646,6 @@ export async function consolidateExperiencesToPatterns() {
|
|
|
538
646
|
GROUP_CONCAT(DISTINCT source) as sources
|
|
539
647
|
FROM captured_experiences
|
|
540
648
|
WHERE application_count = 0
|
|
541
|
-
AND agent != 'cli-hook'
|
|
542
649
|
GROUP BY domain, agent
|
|
543
650
|
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
544
651
|
ORDER BY avg_quality DESC
|
|
@@ -67,5 +67,25 @@ export declare function printJson(data: unknown): void;
|
|
|
67
67
|
export declare function printSuccess(message: string): void;
|
|
68
68
|
export declare function printError(message: string): void;
|
|
69
69
|
export declare function printGuidance(guidance: string[]): void;
|
|
70
|
+
/**
|
|
71
|
+
* Read piped stdin with a short timeout. Claude Code delivers
|
|
72
|
+
* UserPromptSubmit / PostToolUse / PreToolUse events as JSON on stdin —
|
|
73
|
+
* `$PROMPT`, `$TOOL_INPUT_file_path`, etc. are NOT exposed as env vars in
|
|
74
|
+
* every hook surface, so reading stdin is the only reliable fallback when
|
|
75
|
+
* the explicit CLI option resolves to an empty string.
|
|
76
|
+
*
|
|
77
|
+
* Returns '' when stdin is a TTY (interactive run) or no data arrives
|
|
78
|
+
* before the timeout. Never throws — a hook must never crash the host.
|
|
79
|
+
*/
|
|
80
|
+
export declare function readStdinJsonEvent(timeoutMs?: number): Promise<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Extract a file path from a Claude Code PostToolUse / PreToolUse hook event.
|
|
83
|
+
* Edit / Write / MultiEdit / NotebookEdit tools all put the target path in
|
|
84
|
+
* `tool_input.file_path` (snake_case from Claude Code) — older transports
|
|
85
|
+
* use `toolInput.file_path`. Returns '' when no recognized field is present.
|
|
86
|
+
*
|
|
87
|
+
* Exported for unit testing.
|
|
88
|
+
*/
|
|
89
|
+
export declare function extractFilePathFromEvent(raw: string): string;
|
|
70
90
|
export { DREAM_STATE_KEY, DREAM_INTERVAL_MS, DREAM_EXPERIENCE_THRESHOLD, DREAM_MIN_GAP_MS, type DreamHookState, type TaskBridgePayload, type TaskOutcomeResult, checkAndTriggerDream, incrementDreamExperience, persistCommandExperience, persistTaskOutcome, updateHookRouterQValue, updateRoutingOutcomeQuality, consolidateExperiencesToPatterns, } from './hooks-dream-learning.js';
|
|
71
91
|
//# sourceMappingURL=hooks-shared.d.ts.map
|
|
@@ -250,6 +250,78 @@ export function printGuidance(guidance) {
|
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
// ============================================================================
|
|
253
|
+
// Stdin Event Helpers
|
|
254
|
+
// ============================================================================
|
|
255
|
+
/**
|
|
256
|
+
* Read piped stdin with a short timeout. Claude Code delivers
|
|
257
|
+
* UserPromptSubmit / PostToolUse / PreToolUse events as JSON on stdin —
|
|
258
|
+
* `$PROMPT`, `$TOOL_INPUT_file_path`, etc. are NOT exposed as env vars in
|
|
259
|
+
* every hook surface, so reading stdin is the only reliable fallback when
|
|
260
|
+
* the explicit CLI option resolves to an empty string.
|
|
261
|
+
*
|
|
262
|
+
* Returns '' when stdin is a TTY (interactive run) or no data arrives
|
|
263
|
+
* before the timeout. Never throws — a hook must never crash the host.
|
|
264
|
+
*/
|
|
265
|
+
export async function readStdinJsonEvent(timeoutMs = 500) {
|
|
266
|
+
if (process.stdin.isTTY)
|
|
267
|
+
return '';
|
|
268
|
+
return new Promise((resolve) => {
|
|
269
|
+
let data = '';
|
|
270
|
+
const timer = setTimeout(() => {
|
|
271
|
+
process.stdin.removeAllListeners();
|
|
272
|
+
process.stdin.pause();
|
|
273
|
+
resolve(data);
|
|
274
|
+
}, timeoutMs);
|
|
275
|
+
process.stdin.setEncoding('utf8');
|
|
276
|
+
process.stdin.on('data', (chunk) => {
|
|
277
|
+
data += chunk;
|
|
278
|
+
});
|
|
279
|
+
process.stdin.on('end', () => {
|
|
280
|
+
clearTimeout(timer);
|
|
281
|
+
resolve(data);
|
|
282
|
+
});
|
|
283
|
+
process.stdin.on('error', () => {
|
|
284
|
+
clearTimeout(timer);
|
|
285
|
+
resolve(data);
|
|
286
|
+
});
|
|
287
|
+
process.stdin.resume();
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Extract a file path from a Claude Code PostToolUse / PreToolUse hook event.
|
|
292
|
+
* Edit / Write / MultiEdit / NotebookEdit tools all put the target path in
|
|
293
|
+
* `tool_input.file_path` (snake_case from Claude Code) — older transports
|
|
294
|
+
* use `toolInput.file_path`. Returns '' when no recognized field is present.
|
|
295
|
+
*
|
|
296
|
+
* Exported for unit testing.
|
|
297
|
+
*/
|
|
298
|
+
export function extractFilePathFromEvent(raw) {
|
|
299
|
+
if (!raw.trim())
|
|
300
|
+
return '';
|
|
301
|
+
let event;
|
|
302
|
+
try {
|
|
303
|
+
event = JSON.parse(raw);
|
|
304
|
+
}
|
|
305
|
+
catch {
|
|
306
|
+
return '';
|
|
307
|
+
}
|
|
308
|
+
const toolInputSnake = event.tool_input;
|
|
309
|
+
const toolInputCamel = event.toolInput;
|
|
310
|
+
const candidates = [
|
|
311
|
+
toolInputSnake?.file_path,
|
|
312
|
+
toolInputSnake?.filePath,
|
|
313
|
+
toolInputCamel?.file_path,
|
|
314
|
+
toolInputCamel?.filePath,
|
|
315
|
+
event.file_path,
|
|
316
|
+
event.filePath,
|
|
317
|
+
];
|
|
318
|
+
for (const c of candidates) {
|
|
319
|
+
if (typeof c === 'string' && c.trim())
|
|
320
|
+
return c;
|
|
321
|
+
}
|
|
322
|
+
return '';
|
|
323
|
+
}
|
|
324
|
+
// ============================================================================
|
|
253
325
|
// Dream Scheduler & Learning — re-exported from hooks-dream-learning.ts
|
|
254
326
|
// ============================================================================
|
|
255
327
|
export { DREAM_STATE_KEY, DREAM_INTERVAL_MS, DREAM_EXPERIENCE_THRESHOLD, DREAM_MIN_GAP_MS, checkAndTriggerDream, incrementDreamExperience, persistCommandExperience, persistTaskOutcome, updateHookRouterQValue, updateRoutingOutcomeQuality, consolidateExperiencesToPatterns, } from './hooks-dream-learning.js';
|
|
@@ -7,42 +7,8 @@
|
|
|
7
7
|
import { randomUUID } from 'crypto';
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import path from 'node:path';
|
|
10
|
-
import { findProjectRoot } from '../../../kernel/unified-memory.js';
|
|
11
|
-
import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, } from './hooks-shared.js';
|
|
12
|
-
/**
|
|
13
|
-
* Read piped stdin with a short timeout. Claude Code delivers
|
|
14
|
-
* UserPromptSubmit / PostToolUse / etc. events as JSON on stdin —
|
|
15
|
-
* `$PROMPT` is NOT exposed as an env var, so reading stdin is the
|
|
16
|
-
* only reliable way to recover the prompt body for routing.
|
|
17
|
-
*
|
|
18
|
-
* Returns '' when stdin is a TTY (interactive run) or no data arrives
|
|
19
|
-
* before the timeout. Never throws — a hook must never crash the host.
|
|
20
|
-
*/
|
|
21
|
-
async function readStdinJsonEvent(timeoutMs = 500) {
|
|
22
|
-
if (process.stdin.isTTY)
|
|
23
|
-
return '';
|
|
24
|
-
return new Promise((resolve) => {
|
|
25
|
-
let data = '';
|
|
26
|
-
const timer = setTimeout(() => {
|
|
27
|
-
process.stdin.removeAllListeners();
|
|
28
|
-
process.stdin.pause();
|
|
29
|
-
resolve(data);
|
|
30
|
-
}, timeoutMs);
|
|
31
|
-
process.stdin.setEncoding('utf8');
|
|
32
|
-
process.stdin.on('data', (chunk) => {
|
|
33
|
-
data += chunk;
|
|
34
|
-
});
|
|
35
|
-
process.stdin.on('end', () => {
|
|
36
|
-
clearTimeout(timer);
|
|
37
|
-
resolve(data);
|
|
38
|
-
});
|
|
39
|
-
process.stdin.on('error', () => {
|
|
40
|
-
clearTimeout(timer);
|
|
41
|
-
resolve(data);
|
|
42
|
-
});
|
|
43
|
-
process.stdin.resume();
|
|
44
|
-
});
|
|
45
|
-
}
|
|
10
|
+
import { findProjectRoot, getUnifiedMemory } from '../../../kernel/unified-memory.js';
|
|
11
|
+
import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, readStdinJsonEvent, } from './hooks-shared.js';
|
|
46
12
|
/**
|
|
47
13
|
* Extract a routable task description from a Claude Code hook event JSON
|
|
48
14
|
* payload. Different hook surfaces use different field names — try the
|
|
@@ -189,5 +155,106 @@ export function registerRoutingHooks(hooks) {
|
|
|
189
155
|
throw error;
|
|
190
156
|
}
|
|
191
157
|
});
|
|
158
|
+
// -------------------------------------------------------------------------
|
|
159
|
+
// post-route: Close routing_outcomes sentinel from Stop hook (#451)
|
|
160
|
+
//
|
|
161
|
+
// The `route` hook fires on UserPromptSubmit and writes a sentinel row with
|
|
162
|
+
// quality_score=-1. That sentinel is only closed by post-task's
|
|
163
|
+
// updateRoutingOutcomeQuality, which fires on PostToolUse ^(Task|Agent)$ —
|
|
164
|
+
// so in any direct-work session (Bash/Edit/Read without spawning sub-agents)
|
|
165
|
+
// route sentinels accumulate forever and Stream D never converges.
|
|
166
|
+
//
|
|
167
|
+
// This subcommand is wired into the Stop hook (one invocation per turn) and
|
|
168
|
+
// closes the most-recent route sentinel 1:1. Discriminator
|
|
169
|
+
// `task_json NOT LIKE '%"taskId"%'` isolates route sentinels from the
|
|
170
|
+
// pre-task sentinels that carry taskId in their task_json.
|
|
171
|
+
// -------------------------------------------------------------------------
|
|
172
|
+
hooks
|
|
173
|
+
.command('post-route')
|
|
174
|
+
.description('Close the most-recent route sentinel from a Stop hook (#451)')
|
|
175
|
+
.option('--success <bool>', 'Whether the turn completed successfully', 'true')
|
|
176
|
+
.option('--json', 'Output as JSON')
|
|
177
|
+
.action(async (options) => {
|
|
178
|
+
try {
|
|
179
|
+
const success = options.success === 'true' || options.success === true;
|
|
180
|
+
// 6-dim outcome quality, durationTier defaulted to favorable (1.0):
|
|
181
|
+
// qualityScore = 0.25*success + 0.325 + 0.10*durationTier
|
|
182
|
+
// Stop hook doesn't measure turn duration, so we pick the most
|
|
183
|
+
// favorable bucket — same shape as the post-task formula but with the
|
|
184
|
+
// duration term collapsed to a constant.
|
|
185
|
+
const qualityScore = 0.325 + (success ? 0.25 : 0) + 0.10;
|
|
186
|
+
const um = getUnifiedMemory();
|
|
187
|
+
if (!um.isInitialized()) {
|
|
188
|
+
await um.initialize();
|
|
189
|
+
}
|
|
190
|
+
const db = um.getDatabase();
|
|
191
|
+
applyHookBusyTimeout(db);
|
|
192
|
+
const result = db.prepare(`
|
|
193
|
+
UPDATE routing_outcomes
|
|
194
|
+
SET success = ?, quality_score = ?, duration_ms = 0, error = NULL
|
|
195
|
+
WHERE id = (
|
|
196
|
+
SELECT id FROM routing_outcomes
|
|
197
|
+
WHERE quality_score = -1
|
|
198
|
+
AND task_json NOT LIKE '%"taskId"%'
|
|
199
|
+
ORDER BY created_at DESC
|
|
200
|
+
LIMIT 1
|
|
201
|
+
)
|
|
202
|
+
`).run(success ? 1 : 0, qualityScore);
|
|
203
|
+
// Issue #465: orphan-sentinel sweep. Sessions that terminate without
|
|
204
|
+
// firing Stop (context compact, process kill, IDE crash) leave their
|
|
205
|
+
// sentinels at quality_score=-1 forever — every subsequent post-route
|
|
206
|
+
// call only closes the most-recent one (LIMIT 1) and newer rows keep
|
|
207
|
+
// pre-empting old ones in the ORDER BY DESC. Reporter saw 122/149
|
|
208
|
+
// rows stuck at -1, inverting AVG(quality_score) to -0.717.
|
|
209
|
+
//
|
|
210
|
+
// We use the conservative base score (0.325 = no success/duration
|
|
211
|
+
// bonus) rather than the current turn's qualityScore: those orphans
|
|
212
|
+
// belong to UNKNOWN historical turns and shouldn't inherit the
|
|
213
|
+
// current turn's outcome. Tag with error='stale-sentinel' so
|
|
214
|
+
// precision-sensitive queries can filter them out.
|
|
215
|
+
// Discriminator mirrors the LIMIT-1 close above and #451's symmetric
|
|
216
|
+
// design: route sentinels are owned by post-route, pre-task sentinels
|
|
217
|
+
// (task_json carries "taskId") are owned by post-task. Sweeping a
|
|
218
|
+
// pre-task sentinel here would race with updateRoutingOutcomeQuality
|
|
219
|
+
// and break the ownership split. If pre-task sentinels orphan, that
|
|
220
|
+
// belongs in a separate fix.
|
|
221
|
+
const staleResult = db.prepare(`
|
|
222
|
+
UPDATE routing_outcomes
|
|
223
|
+
SET success = 0,
|
|
224
|
+
quality_score = 0.325,
|
|
225
|
+
duration_ms = 0,
|
|
226
|
+
error = 'stale-sentinel'
|
|
227
|
+
WHERE quality_score = -1
|
|
228
|
+
AND task_json NOT LIKE '%"taskId"%'
|
|
229
|
+
AND created_at < datetime('now', '-300 seconds')
|
|
230
|
+
`).run();
|
|
231
|
+
if (options.json) {
|
|
232
|
+
printJson({
|
|
233
|
+
success: true,
|
|
234
|
+
resolved: result.changes > 0,
|
|
235
|
+
staleSwept: staleResult.changes,
|
|
236
|
+
qualityScore,
|
|
237
|
+
turnSuccess: success,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
else if (staleResult.changes > 0) {
|
|
241
|
+
console.log(chalk.dim(`[hooks] post-route: swept ${staleResult.changes} stale sentinel(s)`));
|
|
242
|
+
}
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
// Best-effort: Stop hooks must never crash the host. Swallow + log.
|
|
247
|
+
if (options.json) {
|
|
248
|
+
printJson({
|
|
249
|
+
success: false,
|
|
250
|
+
error: error instanceof Error ? error.message : 'unknown',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
console.error(chalk.dim(`[hooks] post-route: ${error instanceof Error ? error.message : 'unknown'}`));
|
|
255
|
+
}
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
192
259
|
}
|
|
193
260
|
//# sourceMappingURL=routing-hooks.js.map
|
|
@@ -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;
|
|
@@ -34,6 +34,7 @@ Examples:
|
|
|
34
34
|
aqe hooks route --task "Generate tests for UserService"
|
|
35
35
|
aqe hooks pre-task --description "Generate tests" --json
|
|
36
36
|
aqe hooks post-task --task-id "task-123" --success true
|
|
37
|
+
aqe hooks post-route --success true --json # Stop hook (#451)
|
|
37
38
|
|
|
38
39
|
# Bash command hooks
|
|
39
40
|
aqe hooks pre-command --command "npm test" --json
|
|
@@ -165,6 +165,19 @@ export async function configureHooks(projectRoot, config) {
|
|
|
165
165
|
},
|
|
166
166
|
],
|
|
167
167
|
},
|
|
168
|
+
{
|
|
169
|
+
hooks: [
|
|
170
|
+
{
|
|
171
|
+
// #451: close the route sentinel from this turn. Stop fires
|
|
172
|
+
// 1:1 with UserPromptSubmit/route — without this, route
|
|
173
|
+
// sentinels accumulate at quality_score=-1 indefinitely.
|
|
174
|
+
type: 'command',
|
|
175
|
+
command: 'npx agentic-qe hooks post-route --success true --json',
|
|
176
|
+
timeout: 5000,
|
|
177
|
+
continueOnError: true,
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
168
181
|
],
|
|
169
182
|
};
|
|
170
183
|
// Smart merge: replace old AQE hooks, keep user hooks, add new AQE hooks
|
|
@@ -533,6 +533,20 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
|
|
|
533
533
|
},
|
|
534
534
|
],
|
|
535
535
|
},
|
|
536
|
+
{
|
|
537
|
+
hooks: [
|
|
538
|
+
{
|
|
539
|
+
// #451: close the route sentinel that UserPromptSubmit wrote
|
|
540
|
+
// at the start of this turn. Stop fires 1:1 with UserPromptSubmit
|
|
541
|
+
// — without this, `routing_outcomes` accumulates quality_score=-1
|
|
542
|
+
// rows forever in direct-work sessions (no Task/Agent spawned).
|
|
543
|
+
type: 'command',
|
|
544
|
+
command: 'npx agentic-qe hooks post-route --success true --json',
|
|
545
|
+
timeout: 5000,
|
|
546
|
+
continueOnError: true,
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
},
|
|
536
550
|
{
|
|
537
551
|
hooks: [
|
|
538
552
|
{
|
|
@@ -466,17 +466,48 @@ export class QEReasoningBank {
|
|
|
466
466
|
for (const domain of QE_DOMAIN_LIST) {
|
|
467
467
|
byDomain[domain] = patternStoreStats.byDomain[domain] || 0;
|
|
468
468
|
}
|
|
469
|
+
// DB fallback (#454): in-memory `this.stats` is reset on every process
|
|
470
|
+
// start, but every hook invocation spawns a fresh node. Without a DB
|
|
471
|
+
// fallback, `aqe hooks stats` always reports zeros even when historical
|
|
472
|
+
// routing_outcomes / qe_pattern_usage rows exist. We use the in-memory
|
|
473
|
+
// counters when they're non-zero (live, current-process data), otherwise
|
|
474
|
+
// fall back to aggregated DB totals.
|
|
475
|
+
let routingRequests = this.stats.routingRequests;
|
|
476
|
+
let avgRoutingConfidence = this.stats.routingRequests > 0
|
|
477
|
+
? this.stats.totalRoutingConfidence / this.stats.routingRequests
|
|
478
|
+
: 0;
|
|
479
|
+
let learningOutcomes = this.stats.learningOutcomes;
|
|
480
|
+
let patternSuccessRate = this.stats.learningOutcomes > 0
|
|
481
|
+
? this.stats.successfulOutcomes / this.stats.learningOutcomes
|
|
482
|
+
: 0;
|
|
483
|
+
if (routingRequests === 0 || learningOutcomes === 0) {
|
|
484
|
+
try {
|
|
485
|
+
const agg = this.getSqliteStore().getAggregateOutcomeStats();
|
|
486
|
+
if (routingRequests === 0 && agg.routingRequests > 0) {
|
|
487
|
+
routingRequests = agg.routingRequests;
|
|
488
|
+
avgRoutingConfidence = agg.avgRoutingConfidence;
|
|
489
|
+
}
|
|
490
|
+
if (learningOutcomes === 0 && agg.learningOutcomes > 0) {
|
|
491
|
+
learningOutcomes = agg.learningOutcomes;
|
|
492
|
+
// Prefer per-usage success rate (closer to recordOutcome semantics);
|
|
493
|
+
// fall back to qe_patterns.success_rate aggregate when no usage rows.
|
|
494
|
+
patternSuccessRate =
|
|
495
|
+
agg.learningOutcomes > 0
|
|
496
|
+
? agg.successfulOutcomes / agg.learningOutcomes
|
|
497
|
+
: agg.avgPatternSuccessRate;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
catch {
|
|
501
|
+
// best-effort — never let stats reporting crash the host
|
|
502
|
+
}
|
|
503
|
+
}
|
|
469
504
|
return {
|
|
470
505
|
totalPatterns: patternStoreStats.totalPatterns,
|
|
471
506
|
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,
|
|
507
|
+
routingRequests,
|
|
508
|
+
avgRoutingConfidence,
|
|
509
|
+
learningOutcomes,
|
|
510
|
+
patternSuccessRate,
|
|
480
511
|
patternStoreStats,
|
|
481
512
|
};
|
|
482
513
|
}
|
|
@@ -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>>;
|