agentic-qe 3.9.17 → 3.9.19
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/helpers/statusline-v3.cjs +1 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +56 -0
- package/README.md +65 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-5NI3IO42.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-JN7W7O5X.js → agent-booster-wasm-HVBKHNIS.js} +2 -2
- package/dist/cli/chunks/{agent-handler-F6Q75SJQ.js → agent-handler-XNBDYRSJ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-3GGTDVR4.js → agent-memory-branch-YCVTQEMJ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-JOUK5HMO.js +2 -0
- package/dist/cli/chunks/{audit-R7KN45HM.js → audit-6C2PE7OY.js} +2 -2
- package/dist/cli/chunks/base-DCAB7AHK.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-2LTGEMYR.js → better-sqlite3-HZPCHUQU.js} +2 -2
- package/dist/cli/chunks/{brain-handler-PML5L6WQ.js → brain-handler-OV75Q2NM.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-OKUPS2XC.js → branch-enumerator-QW6D42HJ.js} +2 -2
- package/dist/cli/chunks/{browser-KOQOTSAT.js → browser-5BA7Q7OR.js} +2 -2
- package/dist/cli/chunks/browser-workflow-A4UV73SZ.js +2 -0
- package/dist/cli/chunks/{chunk-ZLOMFM25.js → chunk-255CWHTF.js} +2 -2
- package/dist/cli/chunks/{chunk-QW554DTP.js → chunk-2SIQ742L.js} +1 -1
- package/dist/cli/chunks/{chunk-XMMKAV5R.js → chunk-2SSDY6OE.js} +2 -2
- package/dist/cli/chunks/{chunk-HMT6LKHH.js → chunk-2WJLEZKP.js} +2 -2
- package/dist/cli/chunks/{chunk-VX6XHAG2.js → chunk-2WM4NYM5.js} +2 -2
- package/dist/cli/chunks/{chunk-6PRIY3HT.js → chunk-2XATUQIG.js} +2 -2
- package/dist/cli/chunks/{chunk-BCBC3DVN.js → chunk-3546SG2L.js} +2 -2
- package/dist/cli/chunks/{chunk-ORNWQXEX.js → chunk-37DTXQ6P.js} +2 -2
- package/dist/cli/chunks/{chunk-3GYAIW2P.js → chunk-3HQ4AZDH.js} +2 -2
- package/dist/cli/chunks/{chunk-YUCMGFHE.js → chunk-3X3QQZ7Q.js} +2 -2
- package/dist/cli/chunks/{chunk-ZQKNVZPD.js → chunk-44SPMVML.js} +2 -2
- package/dist/cli/chunks/{chunk-65Z6HMDA.js → chunk-5KGFDNYI.js} +2 -2
- package/dist/cli/chunks/{chunk-OUSQ4KQN.js → chunk-5LXWEAEJ.js} +2 -2
- package/dist/cli/chunks/{chunk-DJXYFFGA.js → chunk-5MGRZ4YD.js} +2 -2
- package/dist/cli/chunks/{chunk-6YFEWIL5.js → chunk-5R2DUR3A.js} +2 -2
- package/dist/cli/chunks/{chunk-QMVGGG4B.js → chunk-5X2AUPK2.js} +1 -1
- package/dist/cli/chunks/{chunk-QYDBV5MD.js → chunk-6BRUQTC7.js} +1 -1
- package/dist/cli/chunks/{chunk-RP2RHB7H.js → chunk-7IV2RK5M.js} +2 -2
- package/dist/cli/chunks/{chunk-A3WC5KTG.js → chunk-7WMHLBNZ.js} +1 -1
- package/dist/cli/chunks/{chunk-VYCFMW64.js → chunk-AEET2WOI.js} +68 -67
- package/dist/cli/chunks/{chunk-V4DMYY6P.js → chunk-AG7J7DTM.js} +2 -2
- package/dist/cli/chunks/{chunk-JT2KLBDB.js → chunk-ALYUJEYA.js} +2 -2
- package/dist/cli/chunks/{chunk-L6ZJSFAA.js → chunk-AOASQYOO.js} +1 -1
- package/dist/cli/chunks/{chunk-6YCZDIGF.js → chunk-AZKVGH5I.js} +2 -2
- package/dist/cli/chunks/{chunk-3UGV2XWF.js → chunk-B2EHSFUW.js} +2 -2
- package/dist/cli/chunks/{chunk-TATCL3AK.js → chunk-B65GTWF3.js} +2 -2
- package/dist/cli/chunks/{chunk-PMH52K5J.js → chunk-BB3KUX6C.js} +1 -1
- package/dist/cli/chunks/{chunk-EGBRCXYT.js → chunk-BFBR2ZZJ.js} +2 -2
- package/dist/cli/chunks/{chunk-LD4OYOX2.js → chunk-BGTYOZRK.js} +2 -2
- package/dist/cli/chunks/{chunk-KUEG6K4A.js → chunk-BOUCIIUI.js} +1 -1
- package/dist/cli/chunks/{chunk-AZWCJFT6.js → chunk-C5YFCM2H.js} +2 -2
- package/dist/cli/chunks/{chunk-F5X3U57Y.js → chunk-CYLQTVIA.js} +2 -2
- package/dist/cli/chunks/{chunk-G3G5QEHL.js → chunk-D2EHD2KF.js} +1 -1
- package/dist/cli/chunks/{chunk-AFLTMVMT.js → chunk-D74RGYKI.js} +1 -1
- package/dist/cli/chunks/{chunk-QVJQXRHU.js → chunk-DAPBSAVT.js} +2 -2
- package/dist/cli/chunks/{chunk-BGY4CHZA.js → chunk-DZS7XQ2Z.js} +2 -2
- package/dist/cli/chunks/{chunk-RYATPB5L.js → chunk-EW5TQQBR.js} +2 -2
- package/dist/cli/chunks/{chunk-L5JZIORJ.js → chunk-EZZJ5XD6.js} +2 -2
- package/dist/cli/chunks/{chunk-MNSF47HC.js → chunk-FJJLNCSL.js} +3 -3
- package/dist/cli/chunks/{chunk-6F6BNLVP.js → chunk-FL2DMHOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-EVQYUUQ3.js → chunk-FNVA7U7X.js} +2 -2
- package/dist/cli/chunks/{chunk-I3NUJ6KJ.js → chunk-FPVXXQVX.js} +3 -3
- package/dist/cli/chunks/{chunk-K4FG3CRS.js → chunk-FT3MAIRW.js} +3 -3
- package/dist/cli/chunks/{chunk-CZXV3JAF.js → chunk-G2V4GMPR.js} +3 -3
- package/dist/cli/chunks/chunk-GJ5FON37.js +15 -0
- package/dist/cli/chunks/{chunk-6PCGUJCG.js → chunk-GL742O2V.js} +4 -4
- package/dist/cli/chunks/{chunk-X66N7E7D.js → chunk-GVDLCJC5.js} +1 -1
- package/dist/cli/chunks/{chunk-3KIUCAVI.js → chunk-GYDE5TCN.js} +1 -1
- package/dist/cli/chunks/{chunk-2K7GRX5U.js → chunk-GYESQBDU.js} +2 -2
- package/dist/cli/chunks/{chunk-63ERVKIO.js → chunk-H4QM37XS.js} +1 -1
- package/dist/cli/chunks/{chunk-VI2I5R6C.js → chunk-HCSTXZYE.js} +2 -2
- package/dist/cli/chunks/{chunk-6HGRJPD6.js → chunk-HJ7CRPZY.js} +1 -1
- package/dist/cli/chunks/{chunk-G5DEPXD4.js → chunk-HQFREZRX.js} +2 -2
- package/dist/cli/chunks/{chunk-7VGZDTY4.js → chunk-HVNW3TZS.js} +1 -1
- package/dist/cli/chunks/{chunk-W5HTZ3VZ.js → chunk-I3JRRFVT.js} +2 -2
- package/dist/cli/chunks/{chunk-Y47U7ICT.js → chunk-IG2RCBHJ.js} +1 -1
- package/dist/cli/chunks/{chunk-4TDIA2EN.js → chunk-IPLQPBJA.js} +2 -2
- package/dist/cli/chunks/{chunk-ARN2KDLJ.js → chunk-IV74GAZN.js} +2 -2
- package/dist/cli/chunks/{chunk-I64R2D4U.js → chunk-J7F65KKG.js} +4 -4
- package/dist/cli/chunks/{chunk-A67FRRPJ.js → chunk-JCPJG2KU.js} +3 -3
- package/dist/cli/chunks/{chunk-HQXRCW7Z.js → chunk-JLX35EPX.js} +2 -2
- package/dist/cli/chunks/{chunk-42TUEMH7.js → chunk-JYHZK44T.js} +1 -1
- package/dist/cli/chunks/{chunk-63V33NAB.js → chunk-K554X3T4.js} +2 -2
- package/dist/cli/chunks/{chunk-P2V5ZG3Q.js → chunk-KTDGHN2J.js} +1 -1
- package/dist/cli/chunks/{chunk-FVVZWNLV.js → chunk-KU7OXAFY.js} +1 -1
- package/dist/cli/chunks/{chunk-5J444NJR.js → chunk-LDBHCOM3.js} +2 -2
- package/dist/cli/chunks/{chunk-PGTMLW5K.js → chunk-LTE3CDOY.js} +2 -2
- package/dist/cli/chunks/{chunk-WP55YBB2.js → chunk-M6EP724N.js} +1 -1
- package/dist/cli/chunks/{chunk-Z5R46W6Q.js → chunk-MIQAFOFO.js} +1 -1
- package/dist/cli/chunks/{chunk-OSBJWQZL.js → chunk-MMVSIESL.js} +2 -2
- package/dist/cli/chunks/{chunk-WGEJ646F.js → chunk-MN4366PQ.js} +2 -2
- package/dist/cli/chunks/{chunk-7PWW2OXP.js → chunk-MTHO6A3V.js} +1 -1
- package/dist/cli/chunks/{chunk-UTO2M76W.js → chunk-N2PLNYEV.js} +1 -1
- package/dist/cli/chunks/{chunk-BCIEQ4IP.js → chunk-NBBIA3QA.js} +2 -2
- package/dist/cli/chunks/{chunk-2LXXYKAP.js → chunk-NMYZSZHW.js} +2 -2
- package/dist/cli/chunks/{chunk-V3VJNWOF.js → chunk-NPSWRGNT.js} +2 -2
- package/dist/cli/chunks/{chunk-PEHHOJE6.js → chunk-NXO7CT5K.js} +2 -2
- package/dist/cli/chunks/{chunk-42HSEBOH.js → chunk-O5ZP3CBF.js} +2 -2
- package/dist/cli/chunks/{chunk-DR6SJ6P3.js → chunk-O6UMETOH.js} +2 -2
- package/dist/cli/chunks/{chunk-CPZUNBSQ.js → chunk-OEQCZBBM.js} +2 -2
- package/dist/cli/chunks/{chunk-PJZHNAUT.js → chunk-P6EYD4V3.js} +2 -2
- package/dist/cli/chunks/{chunk-DDJUVCKF.js → chunk-PS72GF4R.js} +3 -3
- package/dist/cli/chunks/{chunk-LA565BGJ.js → chunk-PUUTYV32.js} +2 -2
- package/dist/cli/chunks/{chunk-AZQ476BM.js → chunk-QOK4TIE4.js} +2 -2
- package/dist/cli/chunks/chunk-R5IL3XD5.js +69 -0
- package/dist/cli/chunks/{chunk-BUWZOMC7.js → chunk-RL5CBCBV.js} +1 -1
- package/dist/cli/chunks/{chunk-FYNDV2NZ.js → chunk-SKDDAPBV.js} +1 -1
- package/dist/cli/chunks/{chunk-K44EQV74.js → chunk-SKNHAGYP.js} +2 -2
- package/dist/cli/chunks/{chunk-CQSU7NTG.js → chunk-SLDYG7LC.js} +2 -2
- package/dist/cli/chunks/{chunk-PV6WBC2D.js → chunk-SRKBR4DU.js} +2 -2
- package/dist/cli/chunks/{chunk-XZOJWFLH.js → chunk-TCUIYIZ4.js} +1 -1
- package/dist/cli/chunks/{chunk-JVDYHVF2.js → chunk-TMAIHTE3.js} +4 -4
- package/dist/cli/chunks/{chunk-B36RPXAQ.js → chunk-TXCOK5DC.js} +2 -2
- package/dist/cli/chunks/{chunk-KTUSZRS3.js → chunk-U257SS7D.js} +2 -2
- package/dist/cli/chunks/{chunk-32FWC6G3.js → chunk-U2WMCNNR.js} +2 -2
- package/dist/cli/chunks/{chunk-I5BLJ2QQ.js → chunk-UIASVDYG.js} +2 -2
- package/dist/cli/chunks/{chunk-CY73RJJJ.js → chunk-V7ZPTEP7.js} +1 -1
- package/dist/cli/chunks/{chunk-YE5AYBHX.js → chunk-VHG67L7O.js} +2 -2
- package/dist/cli/chunks/{chunk-FCWB2FJG.js → chunk-VLQYU7ZQ.js} +1 -1
- package/dist/cli/chunks/{chunk-R3COBKOP.js → chunk-VPDZTMMB.js} +3 -3
- package/dist/cli/chunks/{chunk-QFFSQWXP.js → chunk-VRGXYOIN.js} +1 -1
- package/dist/cli/chunks/{chunk-PMNZN4K7.js → chunk-VSI45JCP.js} +1 -1
- package/dist/cli/chunks/{chunk-DVEQOD74.js → chunk-VWWLJBRA.js} +45 -44
- package/dist/cli/chunks/{chunk-6MRUG5G2.js → chunk-VXUIIZNG.js} +1 -1
- package/dist/cli/chunks/{chunk-QXOAFWWK.js → chunk-W3IO4FQ5.js} +2 -2
- package/dist/cli/chunks/{chunk-XB4JRJU4.js → chunk-WULMXLNN.js} +1 -1
- package/dist/cli/chunks/{chunk-MER7IHAZ.js → chunk-WZUQT2BE.js} +2 -2
- package/dist/cli/chunks/{chunk-USORP6QK.js → chunk-XF32XZMY.js} +2 -2
- package/dist/cli/chunks/{chunk-ZI3UBCIN.js → chunk-XKD6AFY5.js} +1 -1
- package/dist/cli/chunks/{chunk-Z77BVREU.js → chunk-XP4T7CZY.js} +2 -2
- package/dist/cli/chunks/{chunk-APWO3FI3.js → chunk-XQZ63XSL.js} +1 -1
- package/dist/cli/chunks/{chunk-MPEQXXXR.js → chunk-XXHJKAE6.js} +2 -2
- package/dist/cli/chunks/{chunk-N64PBOR5.js → chunk-Y3GX66VZ.js} +2 -2
- package/dist/cli/chunks/{chunk-B3M3JEFD.js → chunk-YXLQJ226.js} +2 -2
- package/dist/cli/chunks/chunk-Z2E5DTKX.js +2 -0
- package/dist/cli/chunks/{ci-TRWQ33L2.js → ci-FTZE4PD3.js} +2 -2
- package/dist/cli/chunks/{ci-output-TCFNHOTU.js → ci-output-C3ORCIHU.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-GO2TIL7E.js → circuit-breaker-GS5OTOJZ.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-U77JVSVU.js → claude-flow-setup-RWOFP5L2.js} +2 -2
- package/dist/cli/chunks/client-UTNF2C5K.js +2 -0
- package/dist/cli/chunks/{cline-installer-XFD3SMGS.js → cline-installer-D7RGRAUH.js} +2 -2
- package/dist/cli/chunks/{code-V3VE2TMW.js → code-HBDMMYHY.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-C6DHOOWA.js → code-index-extractor-B2KUPAEH.js} +2 -2
- package/dist/cli/chunks/{codex-installer-IUR7MVE6.js → codex-installer-MPXV4AOD.js} +2 -2
- package/dist/cli/chunks/{completions-R7FZHNJJ.js → completions-QJS6QOZQ.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-EP4QF5CS.js → complexity-analyzer-YQQXWZIL.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-6DW2SBMQ.js → continuedev-installer-Z6PBKYMB.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-U3UOX7D5.js → copilot-installer-RWVD44CV.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-5QZ5A46I.js → cost-tracker-DFPBFYWL.js} +2 -2
- package/dist/cli/chunks/{coverage-QOOOITLD.js → coverage-DYST26FK.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-FCM34JOR.js +2 -0
- package/dist/cli/chunks/{cursor-installer-SY3TRE2I.js → cursor-installer-LL6UWKTZ.js} +2 -2
- package/dist/cli/chunks/{daemon-HBSBIPUZ.js → daemon-6PIHFZNR.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-ZNLUW2HL.js → dag-attention-scheduler-WS3HJW4F.js} +2 -2
- package/dist/cli/chunks/{detect-DMUJPGNC.js → detect-J4OITSUD.js} +2 -2
- package/dist/cli/chunks/{dist-node-4RPPRXUH.js → dist-node-QSLD5K6K.js} +2 -2
- package/dist/cli/chunks/{domain-handler-XJFDML77.js → domain-handler-BD53QZ4Q.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-MXPKJ2A2.js → domain-transfer-VZBWINQL.js} +2 -2
- package/dist/cli/chunks/dream-6KCS7EWS.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-5UAFXNDX.js +3 -0
- package/dist/cli/chunks/{eval-DHBZ74RL.js → eval-GBKU6VTD.js} +2 -2
- package/dist/cli/chunks/{fast-paths-WTNFCV2I.js → fast-paths-MYZ6GITZ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-VC7BQNHU.js → feature-flags-2WVV66AO.js} +2 -2
- package/dist/cli/chunks/{feature-flags-264QUQ3E.js → feature-flags-6ALWBTHS.js} +2 -2
- package/dist/cli/chunks/{file-discovery-LXQPIRKG.js → file-discovery-FOYCPGD6.js} +2 -2
- package/dist/cli/chunks/{fleet-4OAZWNXG.js → fleet-JROEDHAT.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-MAXAOMTP.js → gnn-wrapper-KAXTFFEE.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-ZTUI75EB.js → heartbeat-handler-PG24CBMQ.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-VWPA7XKA.js → heartbeat-scheduler-LSS3RD6E.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-PG6O67CQ.js +2 -0
- package/dist/cli/chunks/hnsw-index-AHYZHLNZ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-EQDYPKGL.js → hnsw-legacy-bridge-HYH4AJAO.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-G4QGTGIB.js → hnswlib-node-WTTST5LC.js} +2 -2
- package/dist/cli/chunks/hooks-RDZSAFQG.js +214 -0
- package/dist/cli/chunks/{hybrid-router-XODWORQ3.js → hybrid-router-HNPS6EFL.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-T73DH7N6.js → hypergraph-engine-JUFXRXCC.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-OZJJJW5B.js → hypergraph-handler-YFRF53TF.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-USAJVJY5.js +2 -0
- package/dist/cli/chunks/{init-handler-YXXNCXM4.js → init-handler-P4W5F57S.js} +6 -6
- package/dist/cli/chunks/init-wizard-GL7LAZID.js +2 -0
- package/dist/cli/chunks/kernel-2YAIESTR.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-3RCK2JPW.js → kilocode-installer-5VWY4DMH.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-LKC42QRS.js → kiro-installer-PZC3BQII.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-QSIYZRAG.js +2 -0
- package/dist/cli/chunks/{learning-BIBRKCYL.js → learning-4OH4ZG25.js} +3 -3
- package/dist/cli/chunks/{llm-router-Z6Z7TTBI.js → llm-router-LZBR6SZQ.js} +4 -4
- package/dist/cli/chunks/{load-T2QUB663.js → load-SPWP6VB3.js} +2 -2
- package/dist/cli/chunks/load-test-UEHSHLVN.js +2 -0
- package/dist/cli/chunks/{mcp-QBOL6TK4.js → mcp-QYPQMM7L.js} +2 -2
- package/dist/cli/chunks/{memory-7RQ2SF36.js → memory-54ILJMWQ.js} +5 -5
- package/dist/cli/chunks/memory-backend-4NE4ADPG.js +2 -0
- package/dist/cli/chunks/{memory-handlers-5OHDUBJS.js → memory-handlers-YK7H5UCX.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-PGSNT3NO.js → multi-model-executor-XAOAVPPI.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-AEOXTTFG.js → opencode-installer-CNS4XMUF.js} +2 -2
- package/dist/cli/chunks/{orchestrator-6K2L36JA.js → orchestrator-SSEMSKUI.js} +6 -6
- package/dist/cli/chunks/{pipeline-MFQCW7JD.js → pipeline-DS3AENTB.js} +2 -2
- package/dist/cli/chunks/{platform-DM6RQ3FM.js → platform-BL6LH5NF.js} +2 -2
- package/dist/cli/chunks/{plugin-CCTGDC55.js → plugin-FNXPEQ2C.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-J4FXB63L.js → prime-radiant-advanced-wasm-E6S6BGNA.js} +2 -2
- package/dist/cli/chunks/protocol-executor-YI4HNXND.js +2 -0
- package/dist/cli/chunks/{protocol-handler-7UOBNLET.js → protocol-handler-D4WIUU3W.js} +2 -2
- package/dist/cli/chunks/{prove-VAPGITFF.js → prove-OLB3PKW6.js} +2 -2
- package/dist/cli/chunks/{provider-manager-F6TLUJFW.js → provider-manager-GKTQ75DT.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-ANBAXQXC.js +2 -0
- package/dist/cli/chunks/{quality-7LJQI3SB.js → quality-ZYJVYTUL.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-MYYUSWVX.js +2 -0
- package/dist/cli/chunks/{real-embeddings-NHWAUSV3.js → real-embeddings-SKJRHLCS.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-HQFQJJPU.js → roocode-installer-WZGKOLWE.js} +2 -2
- package/dist/cli/chunks/router-RYCLZ7A4.js +2 -0
- package/dist/cli/chunks/routing-feedback-5KSRG2UI.js +2 -0
- package/dist/cli/chunks/{routing-handler-VH66WSPU.js → routing-handler-4GIMINCI.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-IPUWLJFU.js → ruvector-commands-YZONXZ2W.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-KRFEM6JH.js → rvf-dual-writer-WSS5GF54.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-SVCZ72IU.js → rvf-migration-adapter-WS4HHVEU.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-FYBIF3SX.js → rvf-migration-coordinator-6BY5GI47.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-NEIOLJRF.js +2 -0
- package/dist/cli/chunks/safe-db-3JQP4EPU.js +2 -0
- package/dist/cli/chunks/schedule-2QKCL64E.js +2 -0
- package/dist/cli/chunks/scheduler-FMOP45FC.js +2 -0
- package/dist/cli/chunks/{security-C2I6CG7B.js → security-HCNOL2K3.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-BMFIVWMJ.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-BPIFGN7I.js → shared-rvf-dual-writer-QRNLSDS7.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-I5RYLFOE.js +2 -0
- package/dist/cli/chunks/{status-handler-57UA6GNR.js → status-handler-QXZ442MY.js} +2 -2
- package/dist/cli/chunks/{structural-health-KMHBG6FO.js → structural-health-OFYZ3Z4A.js} +2 -2
- package/dist/cli/chunks/{sync-53YM6U4S.js → sync-J4BG65NF.js} +2 -2
- package/dist/cli/chunks/{task-handler-W2XPS5WW.js → task-handler-UBSFCKK3.js} +2 -2
- package/dist/cli/chunks/{task-handlers-BG4IAMBJ.js → task-handlers-JFUT2FQ7.js} +2 -2
- package/dist/cli/chunks/{test-QJBBVPL2.js → test-WTNAHJHH.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-Y4J6EY2K.js → test-scheduling-QREBYRGW.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-3TKR3UIE.js → token-bootstrap-HE5H77OL.js} +2 -2
- package/dist/cli/chunks/{token-usage-5FUNHHVZ.js → token-usage-V5B6K3JL.js} +2 -2
- package/dist/cli/chunks/{transformers-KVPA35SR.js → transformers-HIVMQP4O.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-LTBBLY5U.js → tree-sitter-wasm-parser-WP2SF2M5.js} +2 -2
- package/dist/cli/chunks/{types-Y2BHPD6B.js → types-7ZBTAO5Z.js} +2 -2
- package/dist/cli/chunks/unified-memory-2ETCY22B.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-OALJW537.js +2 -0
- package/dist/cli/chunks/unified-persistence-SQMP7A3O.js +2 -0
- package/dist/cli/chunks/{upgrade-E4VAQZQR.js → upgrade-WIFAJDBG.js} +2 -2
- package/dist/cli/chunks/{validate-4ICDQCKJ.js → validate-W63V36GA.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-AIEOQOUF.js → validate-swarm-CK5BM3YY.js} +2 -2
- package/dist/cli/chunks/{vibium-AF2K6YXR.js → vibium-MJCCO36E.js} +2 -2
- package/dist/cli/chunks/visual-security-JUJPF2QO.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-PM67K5SP.js → web-tree-sitter-ESERXLPK.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-4MKUQ2KT.js → windsurf-installer-FDWQ5BWI.js} +2 -2
- package/dist/cli/chunks/{witness-chain-FLPF7CS6.js → witness-chain-L5KSYE2S.js} +2 -2
- package/dist/cli/chunks/witness-chain-QJVKAAZT.js +2 -0
- package/dist/cli/chunks/{workflow-DHTCI6QD.js → workflow-34GYJDFW.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-WXB2RVVW.js +2 -0
- package/dist/cli/chunks/{wrappers-5K6UGI3T.js → wrappers-VGKEBQLW.js} +2 -2
- package/dist/cli/commands/hooks-handlers/command-hooks.js +104 -11
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +98 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +285 -1
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +20 -1
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +35 -3
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -5
- package/dist/cli/commands/hooks-handlers/task-hooks.js +216 -5
- package/dist/coordination/handlers/test-execution-handlers.d.ts +18 -0
- package/dist/coordination/handlers/test-execution-handlers.js +77 -9
- package/dist/coordination/task-executor.js +11 -2
- package/dist/domains/test-generation/generators/jest-vitest-generator.js +13 -3
- package/dist/domains/test-generation/interfaces.d.ts +12 -0
- package/dist/domains/test-generation/services/test-generator.js +5 -1
- package/dist/governance/continue-gate-integration.d.ts +13 -0
- package/dist/governance/continue-gate-integration.js +31 -8
- package/dist/init/phases/07-hooks.js +2 -2
- package/dist/integrations/ruvector/hypergraph-engine.js +63 -4
- package/dist/integrations/ruvector/hypergraph-schema.d.ts +6 -2
- package/dist/learning/embed-and-insert-pattern.d.ts +36 -0
- package/dist/learning/embed-and-insert-pattern.js +52 -0
- package/dist/learning/pattern-store.d.ts +8 -0
- package/dist/learning/pattern-store.js +66 -43
- package/dist/mcp/bundle.js +400 -392
- package/dist/mcp/entry.js +21 -1
- package/dist/mcp/protocol-server.js +6 -1
- package/dist/mcp/tools/coverage-analysis/index.js +11 -2
- package/dist/workers/workers/learning-consolidation.js +6 -1
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-2BIT6BGH.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-B5G3RG4W.js +0 -2
- package/dist/cli/chunks/base-A3ZRMSIZ.js +0 -2
- package/dist/cli/chunks/browser-workflow-C6Z53ZH6.js +0 -2
- package/dist/cli/chunks/chunk-2ARCG4XJ.js +0 -2
- package/dist/cli/chunks/chunk-JC4O47QG.js +0 -66
- package/dist/cli/chunks/chunk-KTJWRVFR.js +0 -15
- package/dist/cli/chunks/client-B3QSCZSJ.js +0 -2
- package/dist/cli/chunks/cross-domain-router-OYBTXKCV.js +0 -2
- package/dist/cli/chunks/dream-R2F6L47W.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-TQPQE4OJ.js +0 -2
- package/dist/cli/chunks/hnsw-index-2X3NMTDU.js +0 -2
- package/dist/cli/chunks/hooks-RBVHAPBL.js +0 -101
- package/dist/cli/chunks/impact-analyzer-B7GBDSA3.js +0 -2
- package/dist/cli/chunks/init-wizard-7N6MCER4.js +0 -2
- package/dist/cli/chunks/kernel-6CJ4FP5Z.js +0 -2
- package/dist/cli/chunks/knowledge-graph-4XYLO6ZW.js +0 -2
- package/dist/cli/chunks/load-test-UODCPBYF.js +0 -2
- package/dist/cli/chunks/memory-backend-PUPAE4QQ.js +0 -2
- package/dist/cli/chunks/protocol-executor-X3EYJINP.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-3RDWPSYG.js +0 -2
- package/dist/cli/chunks/queen-coordinator-XIQZIYAZ.js +0 -2
- package/dist/cli/chunks/router-AFEFPU2A.js +0 -2
- package/dist/cli/chunks/routing-feedback-AGYMQFMV.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-AFOWXCZH.js +0 -2
- package/dist/cli/chunks/safe-db-NNF5DE5T.js +0 -2
- package/dist/cli/chunks/schedule-HJUZSHEA.js +0 -2
- package/dist/cli/chunks/scheduler-DZ53RPJQ.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-5UQSTUSR.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-27ESC5DX.js +0 -2
- package/dist/cli/chunks/unified-memory-O7GFUSD3.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-XBLROJEN.js +0 -2
- package/dist/cli/chunks/unified-persistence-YBHEAL2S.js +0 -2
- package/dist/cli/chunks/visual-security-4F7VYCAU.js +0 -2
- package/dist/cli/chunks/witness-chain-AXJ44BGW.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UAFUPHD3.js +0 -2
|
@@ -8,7 +8,7 @@ import { randomUUID } from 'crypto';
|
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import { findProjectRoot } from '../../../kernel/unified-memory.js';
|
|
11
|
-
import { getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, } from './hooks-shared.js';
|
|
11
|
+
import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, } from './hooks-shared.js';
|
|
12
12
|
/**
|
|
13
13
|
* Read piped stdin with a short timeout. Claude Code delivers
|
|
14
14
|
* UserPromptSubmit / PostToolUse / etc. events as JSON on stdin —
|
|
@@ -147,7 +147,15 @@ export function registerRoutingHooks(hooks) {
|
|
|
147
147
|
await um.initialize();
|
|
148
148
|
}
|
|
149
149
|
const db = um.getDatabase();
|
|
150
|
+
applyHookBusyTimeout(db);
|
|
150
151
|
const outcomeId = `route-${Date.now()}-${randomUUID().slice(0, 8)}`;
|
|
152
|
+
// Split-write semantics: quality_score means "outcome quality after
|
|
153
|
+
// task ran" (6-dim formula), NOT routing confidence. Routing-
|
|
154
|
+
// confidence stays in decision_json. We write a sentinel
|
|
155
|
+
// (success=0, quality_score=-1) so post-task UPDATE fills the actual
|
|
156
|
+
// quality. lowConfidence is surfaced via decision_json + the error
|
|
157
|
+
// column so it's visible in queries that don't parse JSON.
|
|
158
|
+
const lowConfidence = routing.confidence < 0.5;
|
|
151
159
|
db.prepare(`
|
|
152
160
|
INSERT OR REPLACE INTO routing_outcomes (
|
|
153
161
|
id, task_json, decision_json, used_agent,
|
|
@@ -158,10 +166,12 @@ export function registerRoutingHooks(hooks) {
|
|
|
158
166
|
recommended: routing.recommendedAgent,
|
|
159
167
|
confidence: routing.confidence,
|
|
160
168
|
alternatives: routing.alternatives,
|
|
161
|
-
|
|
162
|
-
1, //
|
|
163
|
-
|
|
164
|
-
|
|
169
|
+
lowConfidence,
|
|
170
|
+
}), routing.recommendedAgent, 1, // followed_recommendation = true
|
|
171
|
+
0, // success = 0 (sentinel — post-task UPDATEs)
|
|
172
|
+
-1, // quality_score = -1 sentinel
|
|
173
|
+
0, // duration not yet tracked
|
|
174
|
+
lowConfidence ? 'low-confidence' : null);
|
|
165
175
|
// Increment dream experience counter
|
|
166
176
|
const projectRoot = findProjectRoot();
|
|
167
177
|
const dataDir = path.join(projectRoot, '.agentic-qe');
|
|
@@ -4,11 +4,52 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Handles task lifecycle hooks for pattern learning.
|
|
6
6
|
*/
|
|
7
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
7
8
|
import chalk from 'chalk';
|
|
8
9
|
import path from 'node:path';
|
|
9
10
|
import { QE_HOOK_EVENTS } from '../../../learning/qe-hooks.js';
|
|
10
|
-
import { findProjectRoot } from '../../../kernel/unified-memory.js';
|
|
11
|
-
import { getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, checkAndTriggerDream, printJson, printSuccess, } from './hooks-shared.js';
|
|
11
|
+
import { findProjectRoot, getUnifiedMemory } from '../../../kernel/unified-memory.js';
|
|
12
|
+
import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, checkAndTriggerDream, persistTaskOutcome, updateHookRouterQValue, updateRoutingOutcomeQuality, printJson, printSuccess, } from './hooks-shared.js';
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Constants — task-bridge / routing-quality / q-learning
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/** kv_store namespace key for cross-subprocess pre-task → post-task bridge */
|
|
17
|
+
const TASK_BRIDGE_NAMESPACE = 'task-bridge';
|
|
18
|
+
/** Bridge TTL: a Task() invocation rarely exceeds this — older entries are stale */
|
|
19
|
+
const TASK_BRIDGE_TTL_MS = 600_000; // 10 minutes
|
|
20
|
+
/** Confidence floor below which we flag the route as low-confidence (patch 320) */
|
|
21
|
+
const LOW_CONFIDENCE_THRESHOLD = 0.5;
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Helpers
|
|
24
|
+
// ============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Derive a structural taskType from a free-form task description.
|
|
27
|
+
* Mirrors the categories the q-learning router cares about (ADR-061/087).
|
|
28
|
+
*/
|
|
29
|
+
function deriveTaskType(description) {
|
|
30
|
+
const d = description.toLowerCase();
|
|
31
|
+
if (/\bgenerate[- ]?test|\btest[- ]?gen|\bgenerate.+spec/.test(d))
|
|
32
|
+
return 'test-generation';
|
|
33
|
+
if (/\bcoverage|\banalyze.+cover/.test(d))
|
|
34
|
+
return 'coverage-analysis';
|
|
35
|
+
if (/\bquality|\bassess|\baudit/.test(d))
|
|
36
|
+
return 'quality-assessment';
|
|
37
|
+
if (/\bsecurity|\bvulnerab|\bcompliance/.test(d))
|
|
38
|
+
return 'security-compliance';
|
|
39
|
+
if (/\bdefect|\bbug|\bdiagnos/.test(d))
|
|
40
|
+
return 'defect-intelligence';
|
|
41
|
+
if (/\brequirement|\bspec\b/.test(d))
|
|
42
|
+
return 'requirements-validation';
|
|
43
|
+
if (/\brefactor|\brewrite|\boptim/.test(d))
|
|
44
|
+
return 'refactoring';
|
|
45
|
+
if (/\btest|\brun.+test/.test(d))
|
|
46
|
+
return 'test-execution';
|
|
47
|
+
return 'unknown';
|
|
48
|
+
}
|
|
49
|
+
/** Hash a description to a stable short bridge key. */
|
|
50
|
+
function hashDescription(description) {
|
|
51
|
+
return createHash('sha256').update(description).digest('hex').slice(0, 16);
|
|
52
|
+
}
|
|
12
53
|
/**
|
|
13
54
|
* Register pre-task and post-task subcommands on the hooks command.
|
|
14
55
|
*/
|
|
@@ -35,6 +76,132 @@ export function registerTaskHooks(hooks) {
|
|
|
35
76
|
routing = result.value;
|
|
36
77
|
}
|
|
37
78
|
}
|
|
79
|
+
// Patch 050: top-5 selectedPatternIds for downstream per-pattern feedback
|
|
80
|
+
const selectedPatternIds = (routing?.patterns ?? [])
|
|
81
|
+
.slice(0, 5)
|
|
82
|
+
.map((p) => p?.id)
|
|
83
|
+
.filter((id) => typeof id === 'string');
|
|
84
|
+
// Patches 090/100/160/300/320: signals derived from memory.db.
|
|
85
|
+
// All best-effort: failures fall through to empty/default values.
|
|
86
|
+
let historicalBest = null;
|
|
87
|
+
let priorVerdicts = [];
|
|
88
|
+
let estimatedTokenSavings = 0;
|
|
89
|
+
let bridgeKey = null;
|
|
90
|
+
try {
|
|
91
|
+
const um = getUnifiedMemory();
|
|
92
|
+
if (!um.isInitialized()) {
|
|
93
|
+
await um.initialize();
|
|
94
|
+
}
|
|
95
|
+
const db = um.getDatabase();
|
|
96
|
+
applyHookBusyTimeout(db);
|
|
97
|
+
// Patch 090: best-historical-agent across past successful routes
|
|
98
|
+
try {
|
|
99
|
+
const row = db.prepare(`
|
|
100
|
+
SELECT used_agent AS agent,
|
|
101
|
+
ROUND(AVG(quality_score), 3) AS avgQuality,
|
|
102
|
+
COUNT(*) AS n
|
|
103
|
+
FROM routing_outcomes
|
|
104
|
+
WHERE success = 1 AND quality_score >= 0
|
|
105
|
+
GROUP BY used_agent
|
|
106
|
+
ORDER BY avgQuality DESC, n DESC
|
|
107
|
+
LIMIT 1
|
|
108
|
+
`).get();
|
|
109
|
+
if (row)
|
|
110
|
+
historicalBest = row;
|
|
111
|
+
}
|
|
112
|
+
catch { /* table may be empty */ }
|
|
113
|
+
// Patch 100: surface recent verdicts namespace for context reuse
|
|
114
|
+
try {
|
|
115
|
+
const rows = db.prepare(`
|
|
116
|
+
SELECT key, value
|
|
117
|
+
FROM kv_store
|
|
118
|
+
WHERE namespace = 'verdicts'
|
|
119
|
+
AND created_at > datetime('now', '-7 days')
|
|
120
|
+
ORDER BY created_at DESC
|
|
121
|
+
LIMIT 3
|
|
122
|
+
`).all();
|
|
123
|
+
priorVerdicts = rows.map((r) => ({
|
|
124
|
+
key: r.key,
|
|
125
|
+
summary: String(r.value).slice(0, 200),
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
catch { /* table may be empty */ }
|
|
129
|
+
// Patch 300: bootstrap estimatedTokenSavings from selected patterns
|
|
130
|
+
if (selectedPatternIds.length > 0) {
|
|
131
|
+
try {
|
|
132
|
+
const placeholders = selectedPatternIds.map(() => '?').join(',');
|
|
133
|
+
const tokRow = db.prepare(`
|
|
134
|
+
SELECT COALESCE(SUM(average_token_savings), 0) AS sum
|
|
135
|
+
FROM qe_patterns
|
|
136
|
+
WHERE id IN (${placeholders})
|
|
137
|
+
`).get(...selectedPatternIds);
|
|
138
|
+
estimatedTokenSavings = Math.max(0, Math.round(tokRow?.sum ?? 0));
|
|
139
|
+
}
|
|
140
|
+
catch { /* column may not exist on older schemas */ }
|
|
141
|
+
}
|
|
142
|
+
// Patch 160 + 280-bridge: write the task-bridge entry that post-task
|
|
143
|
+
// will consume to fan out experience_applications per pattern_id and
|
|
144
|
+
// derive a structural q-learning state_key.
|
|
145
|
+
if (options.description && selectedPatternIds.length > 0) {
|
|
146
|
+
try {
|
|
147
|
+
const description = String(options.description);
|
|
148
|
+
const taskType = deriveTaskType(description);
|
|
149
|
+
const priority = 'normal';
|
|
150
|
+
const domain = routing?.domains?.[0] ?? 'any';
|
|
151
|
+
const complexityBucket = Math.max(0, Math.min(10, Math.round(Math.min(description.length / 200, 1) * 10)));
|
|
152
|
+
bridgeKey = `task:${hashDescription(description)}`;
|
|
153
|
+
const payload = JSON.stringify({
|
|
154
|
+
selectedPatternIds,
|
|
155
|
+
agent: routing?.recommendedAgent ?? null,
|
|
156
|
+
description: description.slice(0, 200),
|
|
157
|
+
taskType,
|
|
158
|
+
priority,
|
|
159
|
+
domain,
|
|
160
|
+
complexityBucket,
|
|
161
|
+
estimatedTokenSavings,
|
|
162
|
+
ts: Date.now(),
|
|
163
|
+
});
|
|
164
|
+
const expiresAt = Date.now() + TASK_BRIDGE_TTL_MS;
|
|
165
|
+
db.prepare(`
|
|
166
|
+
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at, created_at)
|
|
167
|
+
VALUES (?, ?, ?, ?, strftime('%s','now')*1000)
|
|
168
|
+
`).run(bridgeKey, TASK_BRIDGE_NAMESPACE, payload, expiresAt);
|
|
169
|
+
}
|
|
170
|
+
catch (bridgeErr) {
|
|
171
|
+
console.error(chalk.dim(`[hooks] pre-task bridge: ${bridgeErr instanceof Error ? bridgeErr.message : 'unknown'}`));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// Patch 150: write a routing_outcomes sentinel that post-task UPDATEs
|
|
175
|
+
// with the 6-dim outcome quality. Pre-task cannot know quality yet.
|
|
176
|
+
// success=0/quality=-1 sentinel pair makes the row easy to find later.
|
|
177
|
+
if (routing?.recommendedAgent && options.taskId) {
|
|
178
|
+
try {
|
|
179
|
+
const outcomeId = `route-${Date.now()}-${randomUUID().slice(0, 8)}`;
|
|
180
|
+
const lowConfidence = routing.confidence < LOW_CONFIDENCE_THRESHOLD;
|
|
181
|
+
db.prepare(`
|
|
182
|
+
INSERT INTO routing_outcomes (
|
|
183
|
+
id, task_json, decision_json, used_agent,
|
|
184
|
+
followed_recommendation, success, quality_score,
|
|
185
|
+
duration_ms, error
|
|
186
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
187
|
+
`).run(outcomeId, JSON.stringify({ description: options.description, taskId: options.taskId }), JSON.stringify({
|
|
188
|
+
recommended: routing.recommendedAgent,
|
|
189
|
+
confidence: routing.confidence,
|
|
190
|
+
alternatives: routing.alternatives,
|
|
191
|
+
lowConfidence,
|
|
192
|
+
}), routing.recommendedAgent, 1, 0, // success = 0 (sentinel — post-task UPDATEs to actual)
|
|
193
|
+
-1, // quality_score = -1 sentinel
|
|
194
|
+
0, lowConfidence ? 'low-confidence' : null);
|
|
195
|
+
}
|
|
196
|
+
catch (sentinelErr) {
|
|
197
|
+
console.error(chalk.dim(`[hooks] pre-task sentinel: ${sentinelErr instanceof Error ? sentinelErr.message : 'unknown'}`));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
catch (memErr) {
|
|
202
|
+
console.error(chalk.dim(`[hooks] pre-task memory: ${memErr instanceof Error ? memErr.message : 'unknown'}`));
|
|
203
|
+
}
|
|
204
|
+
const lowConfidence = routing ? routing.confidence < LOW_CONFIDENCE_THRESHOLD : false;
|
|
38
205
|
if (options.json) {
|
|
39
206
|
printJson({
|
|
40
207
|
success: true,
|
|
@@ -43,6 +210,18 @@ export function registerTaskHooks(hooks) {
|
|
|
43
210
|
recommendedAgent: routing?.recommendedAgent,
|
|
44
211
|
confidence: routing?.confidence,
|
|
45
212
|
guidance: routing?.guidance || [],
|
|
213
|
+
// Patch 050
|
|
214
|
+
selectedPatternIds,
|
|
215
|
+
// Patch 090
|
|
216
|
+
historicalBest,
|
|
217
|
+
// Patch 100
|
|
218
|
+
priorVerdicts,
|
|
219
|
+
// Patch 300
|
|
220
|
+
estimatedTokenSavings,
|
|
221
|
+
// Patch 320
|
|
222
|
+
lowConfidence,
|
|
223
|
+
// Bridge identifier so post-task can correlate (debug aid)
|
|
224
|
+
bridgeKey,
|
|
46
225
|
});
|
|
47
226
|
}
|
|
48
227
|
else {
|
|
@@ -51,6 +230,9 @@ export function registerTaskHooks(hooks) {
|
|
|
51
230
|
if (routing) {
|
|
52
231
|
console.log(chalk.bold('\n🎯 Recommended:'), chalk.cyan(routing.recommendedAgent));
|
|
53
232
|
console.log(chalk.dim(` Confidence: ${(routing.confidence * 100).toFixed(1)}%`));
|
|
233
|
+
if (lowConfidence) {
|
|
234
|
+
console.log(chalk.yellow(' ⚠ Low confidence — consider providing more context'));
|
|
235
|
+
}
|
|
54
236
|
}
|
|
55
237
|
}
|
|
56
238
|
return;
|
|
@@ -95,14 +277,43 @@ export function registerTaskHooks(hooks) {
|
|
|
95
277
|
// Record as learning experience for every post-task invocation
|
|
96
278
|
if (options.taskId) {
|
|
97
279
|
const agent = options.agent || 'unknown';
|
|
280
|
+
const durationMs = options.duration ? parseInt(options.duration, 10) : 0;
|
|
98
281
|
await reasoningBank.recordOutcome({
|
|
99
282
|
patternId: `task:${agent}:${options.taskId}`,
|
|
100
283
|
success,
|
|
101
|
-
metrics: {
|
|
102
|
-
executionTimeMs: options.duration ? parseInt(options.duration, 10) : 0,
|
|
103
|
-
},
|
|
284
|
+
metrics: { executionTimeMs: durationMs },
|
|
104
285
|
feedback: `Agent: ${agent}, Task: ${options.taskId}`,
|
|
105
286
|
});
|
|
287
|
+
// Stream B: full experience pipeline (captured_experiences,
|
|
288
|
+
// experience_applications + per-pattern fan-out, qe_trajectories
|
|
289
|
+
// single-step + multi-step stitch, dream_insights.applied bump).
|
|
290
|
+
// Patches 060/110/120/160/180/300.
|
|
291
|
+
const outcome = await persistTaskOutcome({
|
|
292
|
+
taskId: options.taskId,
|
|
293
|
+
agent,
|
|
294
|
+
durationMs,
|
|
295
|
+
success,
|
|
296
|
+
});
|
|
297
|
+
// Stream D (patch 150): apply 6-dim outcome quality to the
|
|
298
|
+
// routing_outcomes sentinel that pre-task wrote with quality=-1.
|
|
299
|
+
await updateRoutingOutcomeQuality({
|
|
300
|
+
agent,
|
|
301
|
+
success,
|
|
302
|
+
durationMs,
|
|
303
|
+
qualityScore: outcome.qualityScore,
|
|
304
|
+
});
|
|
305
|
+
// Stream F (patch 280): Bellman Q-update for the hook-router state.
|
|
306
|
+
// Bridge payload carries the structural state derivation.
|
|
307
|
+
if (outcome.bridge) {
|
|
308
|
+
await updateHookRouterQValue({
|
|
309
|
+
taskType: outcome.bridge.taskType,
|
|
310
|
+
priority: outcome.bridge.priority,
|
|
311
|
+
domain: outcome.bridge.domain,
|
|
312
|
+
complexityBucket: outcome.bridge.complexityBucket,
|
|
313
|
+
agent,
|
|
314
|
+
success,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
106
317
|
}
|
|
107
318
|
// Record experience for dream scheduler and check if dream should trigger
|
|
108
319
|
const projectRoot = findProjectRoot();
|
|
@@ -5,5 +5,23 @@
|
|
|
5
5
|
* Covers: generate-tests, execute-tests
|
|
6
6
|
*/
|
|
7
7
|
import type { TaskHandlerContext } from './handler-types';
|
|
8
|
+
/**
|
|
9
|
+
* Rewrite any temp-source references in a generated test so the user gets a
|
|
10
|
+
* test that imports from the original source path (when known) or a clear
|
|
11
|
+
* placeholder. Without this, generated tests reference the throwaway
|
|
12
|
+
* `/tmp/aqe-temp-*` file we created for analysis — that file is unlinked
|
|
13
|
+
* after generation, so the test would never run as-emitted.
|
|
14
|
+
*
|
|
15
|
+
* The generator may emit the temp path with the original extension
|
|
16
|
+
* (`/tmp/aqe-temp-X.ts`), with a substituted extension
|
|
17
|
+
* (`/tmp/aqe-temp-X.test.ts`), or extension-stripped (TS import convention:
|
|
18
|
+
* `/tmp/aqe-temp-X`). All three forms must be rewritten.
|
|
19
|
+
*
|
|
20
|
+
* Exported for unit testing (bug #1 regression).
|
|
21
|
+
*/
|
|
22
|
+
export declare function rewriteTempPathsInGeneratedTest(testCode: string | undefined, sourceFile: string | undefined, tempPath: string | undefined, originalFilePath: string | undefined): {
|
|
23
|
+
testCode?: string;
|
|
24
|
+
sourceFile?: string;
|
|
25
|
+
};
|
|
8
26
|
export declare function registerTestExecutionHandlers(ctx: TaskHandlerContext): void;
|
|
9
27
|
//# sourceMappingURL=test-execution-handlers.d.ts.map
|
|
@@ -8,6 +8,49 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
8
8
|
import * as fs from 'fs/promises';
|
|
9
9
|
import { ok, err } from '../../shared/types';
|
|
10
10
|
import { toError } from '../../shared/error-utils.js';
|
|
11
|
+
function escapeRegExp(s) {
|
|
12
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Rewrite any temp-source references in a generated test so the user gets a
|
|
16
|
+
* test that imports from the original source path (when known) or a clear
|
|
17
|
+
* placeholder. Without this, generated tests reference the throwaway
|
|
18
|
+
* `/tmp/aqe-temp-*` file we created for analysis — that file is unlinked
|
|
19
|
+
* after generation, so the test would never run as-emitted.
|
|
20
|
+
*
|
|
21
|
+
* The generator may emit the temp path with the original extension
|
|
22
|
+
* (`/tmp/aqe-temp-X.ts`), with a substituted extension
|
|
23
|
+
* (`/tmp/aqe-temp-X.test.ts`), or extension-stripped (TS import convention:
|
|
24
|
+
* `/tmp/aqe-temp-X`). All three forms must be rewritten.
|
|
25
|
+
*
|
|
26
|
+
* Exported for unit testing (bug #1 regression).
|
|
27
|
+
*/
|
|
28
|
+
export function rewriteTempPathsInGeneratedTest(testCode, sourceFile, tempPath, originalFilePath) {
|
|
29
|
+
if (!tempPath) {
|
|
30
|
+
return { testCode, sourceFile };
|
|
31
|
+
}
|
|
32
|
+
// For the user's import target we strip the source extension when the
|
|
33
|
+
// original is a path (TS imports omit `.ts`); preserve it otherwise.
|
|
34
|
+
const stripExt = (p) => p.replace(/\.[a-z]+$/i, '');
|
|
35
|
+
const replacement = originalFilePath
|
|
36
|
+
? (originalFilePath.match(/\.(ts|tsx|js|jsx|mjs|cjs)$/i) ? stripExt(originalFilePath) : originalFilePath)
|
|
37
|
+
: './module-under-test';
|
|
38
|
+
const todoComment = originalFilePath
|
|
39
|
+
? ''
|
|
40
|
+
: `// TODO: replace './module-under-test' with the actual import path of the module under test\n`;
|
|
41
|
+
// Build a regex that matches the temp path with any (or no) extension suffix.
|
|
42
|
+
// Order matters: replace extension-bearing forms before extension-less, since
|
|
43
|
+
// the extension-less form is a prefix of the others.
|
|
44
|
+
const tempBase = stripExt(tempPath);
|
|
45
|
+
const tempBaseEscaped = escapeRegExp(tempBase);
|
|
46
|
+
// Matches: <base>.<ext> | <base>.<ext>.<ext> | <base>
|
|
47
|
+
const anyForm = new RegExp(tempBaseEscaped + '(?:\\.[a-zA-Z]+){0,2}', 'g');
|
|
48
|
+
const newCode = testCode
|
|
49
|
+
? todoComment + testCode.replace(anyForm, replacement)
|
|
50
|
+
: testCode;
|
|
51
|
+
const newRef = sourceFile === tempPath ? (originalFilePath || sourceFile) : sourceFile;
|
|
52
|
+
return { testCode: newCode, sourceFile: newRef };
|
|
53
|
+
}
|
|
11
54
|
export function registerTestExecutionHandlers(ctx) {
|
|
12
55
|
// Register test generation handler - REAL IMPLEMENTATION
|
|
13
56
|
ctx.registerHandler('generate-tests', async (task) => {
|
|
@@ -16,6 +59,7 @@ export function registerTestExecutionHandlers(ctx) {
|
|
|
16
59
|
const generator = ctx.getTestGenerator();
|
|
17
60
|
// Determine source files to analyze
|
|
18
61
|
let sourceFiles = [];
|
|
62
|
+
let tempPath;
|
|
19
63
|
if (payload.sourceFiles && payload.sourceFiles.length > 0) {
|
|
20
64
|
sourceFiles = payload.sourceFiles;
|
|
21
65
|
}
|
|
@@ -32,7 +76,7 @@ export function registerTestExecutionHandlers(ctx) {
|
|
|
32
76
|
cpp: '.cpp', c: '.c', scala: '.scala',
|
|
33
77
|
};
|
|
34
78
|
const ext = langExtMap[payload.language?.toLowerCase() || 'typescript'] || '.ts';
|
|
35
|
-
|
|
79
|
+
tempPath = `/tmp/aqe-temp-${uuidv4()}${ext}`;
|
|
36
80
|
await fs.writeFile(tempPath, payload.sourceCode, 'utf-8');
|
|
37
81
|
sourceFiles = [tempPath];
|
|
38
82
|
}
|
|
@@ -46,30 +90,54 @@ export function registerTestExecutionHandlers(ctx) {
|
|
|
46
90
|
warning: 'No source files or code provided for test generation. Provide sourceCode, filePath, or sourceFiles in the payload.',
|
|
47
91
|
});
|
|
48
92
|
}
|
|
49
|
-
// Use the real TestGeneratorService
|
|
93
|
+
// Use the real TestGeneratorService.
|
|
94
|
+
// Bug #1 fix: when we wrote a temp file for analysis, tell the generator
|
|
95
|
+
// to bake a sensible logical import path into the emitted tests instead
|
|
96
|
+
// of the throwaway temp path. If the user supplied filePath, use that;
|
|
97
|
+
// otherwise use a placeholder the user can edit.
|
|
50
98
|
const framework = (payload.framework || 'vitest');
|
|
99
|
+
const importPathOverrides = tempPath
|
|
100
|
+
? { [tempPath]: payload.filePath
|
|
101
|
+
? payload.filePath.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/i, '')
|
|
102
|
+
: './module-under-test' }
|
|
103
|
+
: undefined;
|
|
51
104
|
const result = await generator.generateTests({
|
|
52
105
|
sourceFiles,
|
|
53
106
|
testType: payload.testType || 'unit',
|
|
54
107
|
framework,
|
|
55
108
|
coverageTarget: payload.coverageGoal || 80,
|
|
56
109
|
patterns: [],
|
|
110
|
+
importPathOverrides,
|
|
57
111
|
});
|
|
112
|
+
// Always clean up the temp file we created — even on failure
|
|
113
|
+
if (tempPath) {
|
|
114
|
+
try {
|
|
115
|
+
await fs.unlink(tempPath);
|
|
116
|
+
}
|
|
117
|
+
catch { /* best-effort */ }
|
|
118
|
+
}
|
|
58
119
|
if (!result.success) {
|
|
59
120
|
return result;
|
|
60
121
|
}
|
|
61
122
|
const generatedTests = result.value;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
123
|
+
// Rewrite any temp-path references in generated tests so users get tests
|
|
124
|
+
// that reference a real source path (or a clear placeholder) rather than
|
|
125
|
+
// a /tmp/aqe-temp-* path that never existed in their codebase.
|
|
126
|
+
const tests = generatedTests.tests.map(t => {
|
|
127
|
+
const rewritten = rewriteTempPathsInGeneratedTest(t.testCode, t.sourceFile, tempPath, payload.filePath);
|
|
128
|
+
return {
|
|
66
129
|
name: t.name,
|
|
67
130
|
file: t.testFile,
|
|
68
131
|
type: t.type,
|
|
69
|
-
sourceFile:
|
|
132
|
+
sourceFile: rewritten.sourceFile,
|
|
70
133
|
assertions: t.assertions,
|
|
71
|
-
testCode:
|
|
72
|
-
}
|
|
134
|
+
testCode: rewritten.testCode,
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
return ok({
|
|
138
|
+
testsGenerated: tests.length,
|
|
139
|
+
coverageEstimate: generatedTests.coverageEstimate,
|
|
140
|
+
tests,
|
|
73
141
|
patternsUsed: generatedTests.patternsUsed,
|
|
74
142
|
});
|
|
75
143
|
}
|
|
@@ -297,9 +297,18 @@ export class DomainTaskExecutor {
|
|
|
297
297
|
// Log outcome for debugging and metrics
|
|
298
298
|
console.debug(`[TaskExecutor] Outcome recorded: task=${task.id}, tier=${tier}, ` +
|
|
299
299
|
`model=${getModelForTier(tier)}, success=${success}, duration=${durationMs}ms`);
|
|
300
|
-
// ADR-023: Record routing outcome for learning feedback loop
|
|
300
|
+
// ADR-023: Record routing outcome for learning feedback loop.
|
|
301
|
+
// qualityScore uses the 6-dim outcome formula (matches the post-task
|
|
302
|
+
// hook UPDATE path) instead of a binary success?0.8:0.2.
|
|
301
303
|
if (this.qualityFeedbackLoop) {
|
|
302
304
|
const targetDomains = task.targetDomains || [];
|
|
305
|
+
const successScore = success ? 1 : 0;
|
|
306
|
+
const durationTier = durationMs < 100 ? 1.0 :
|
|
307
|
+
durationMs < 500 ? 0.8 :
|
|
308
|
+
durationMs < 2000 ? 0.6 :
|
|
309
|
+
durationMs < 5000 ? 0.4 :
|
|
310
|
+
durationMs < 10000 ? 0.2 : 0.1;
|
|
311
|
+
const qualityScore = 0.25 * successScore + 0.325 + 0.10 * durationTier;
|
|
303
312
|
await this.qualityFeedbackLoop.recordRoutingOutcome({
|
|
304
313
|
taskId: task.id,
|
|
305
314
|
taskDescription: task.type,
|
|
@@ -307,7 +316,7 @@ export class DomainTaskExecutor {
|
|
|
307
316
|
usedAgent: String(tier),
|
|
308
317
|
followedRecommendation: true,
|
|
309
318
|
success,
|
|
310
|
-
qualityScore
|
|
319
|
+
qualityScore,
|
|
311
320
|
durationMs,
|
|
312
321
|
timestamp: new Date(),
|
|
313
322
|
error: success ? undefined : 'Task execution failed',
|
|
@@ -52,8 +52,15 @@ export class JestVitestGenerator extends BaseTestGenerator {
|
|
|
52
52
|
const patternComment = this.generatePatternComment(patterns);
|
|
53
53
|
const exports = this.extractExports(analysis.functions, analysis.classes);
|
|
54
54
|
const importStatement = this.generateImportStatement(exports, importPath, moduleName);
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// Per-framework imports:
|
|
56
|
+
// - vitest: `import { ..., vi } from 'vitest'` (vi is the mock util)
|
|
57
|
+
// - jest: `import { ..., jest } from '@jest/globals'`
|
|
58
|
+
// (jest 28+ provides @jest/globals; importing from 'jest' is invalid —
|
|
59
|
+
// it's a CLI package, not a runtime export. Globals work too but
|
|
60
|
+
// explicit imports match vitest style and are TS-friendly.)
|
|
61
|
+
const mockImport = this.framework === 'vitest' ? ', vi' : ', jest';
|
|
62
|
+
const importSource = this.framework === 'vitest' ? 'vitest' : '@jest/globals';
|
|
63
|
+
let testCode = `${patternComment}import { describe, it, expect, beforeEach${mockImport} } from '${importSource}';
|
|
57
64
|
${importStatement}
|
|
58
65
|
`;
|
|
59
66
|
// KG: Generate mock declarations for external (non-relative) dependencies only.
|
|
@@ -274,7 +281,10 @@ ${importStatement}
|
|
|
274
281
|
callerTest += ` expect(publicKeys.length).toBeGreaterThan(0);\n`;
|
|
275
282
|
callerTest += ` });\n`;
|
|
276
283
|
}
|
|
277
|
-
|
|
284
|
+
const stubImportSource = this.framework === 'vitest' ? 'vitest' : '@jest/globals';
|
|
285
|
+
const stubMockImport = this.framework === 'vitest' ? ', vi' : ', jest';
|
|
286
|
+
return `${patternComment}import { describe, it, expect, beforeEach${stubMockImport} } from '${stubImportSource}';
|
|
287
|
+
import { ${moduleName} } from '${importPath}';
|
|
278
288
|
${mockDeclarations}
|
|
279
289
|
describe('${moduleName}', () => {
|
|
280
290
|
${similarityComment} describe('${testType} tests', () => {
|
|
@@ -26,6 +26,18 @@ export interface IGenerateTestsRequest {
|
|
|
26
26
|
projectRoot?: string;
|
|
27
27
|
compileValidation?: boolean;
|
|
28
28
|
maxCompileRetries?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Map of sourceFile path → import path to bake into generated test imports.
|
|
31
|
+
* Use this when the file at `sourceFiles[i]` is a temporary copy of source
|
|
32
|
+
* (e.g. an inline-source MCP call) and the generated tests should reference
|
|
33
|
+
* a different logical path. If a file is not in the map, the import path
|
|
34
|
+
* is derived from the source file path as before.
|
|
35
|
+
*
|
|
36
|
+
* Example:
|
|
37
|
+
* { '/tmp/aqe-temp-abc.ts': './src/services/auth' }
|
|
38
|
+
* → generated test emits `import { ... } from './src/services/auth'`
|
|
39
|
+
*/
|
|
40
|
+
importPathOverrides?: Record<string, string>;
|
|
29
41
|
}
|
|
30
42
|
export interface IGeneratedTests {
|
|
31
43
|
tests: IGeneratedTest[];
|
|
@@ -420,7 +420,11 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
|
|
|
420
420
|
}
|
|
421
421
|
const generator = this.generatorFactory.create(framework);
|
|
422
422
|
const moduleName = this.extractModuleName(sourceFile);
|
|
423
|
-
|
|
423
|
+
// Bug #1 fix: prefer caller-supplied import path override when present
|
|
424
|
+
// (used by MCP handler when sourceCode is written to a temp file but the
|
|
425
|
+
// generated tests should reference the original logical path).
|
|
426
|
+
const importPath = originalRequest?.importPathOverrides?.[sourceFile]
|
|
427
|
+
?? this.getImportPath(sourceFile);
|
|
424
428
|
const context = {
|
|
425
429
|
moduleName,
|
|
426
430
|
importPath,
|
|
@@ -79,6 +79,19 @@ export declare class ContinueGateIntegration {
|
|
|
79
79
|
*
|
|
80
80
|
* ContinueDecision has: { decision, reasons, metrics, recommendedAction }
|
|
81
81
|
* We map to: { shouldContinue, reason, throttleMs, escalate, reworkRatio }
|
|
82
|
+
*
|
|
83
|
+
* Decision semantics:
|
|
84
|
+
* - 'continue', 'checkpoint': proceed normally
|
|
85
|
+
* - 'throttle': proceed but caller should slow down (soft signal — not a block).
|
|
86
|
+
* The recommended action is "slow down", not "abort". Treating throttle as
|
|
87
|
+
* a hard rejection would cause legitimate work to be denied; the caller can
|
|
88
|
+
* apply the throttleMs as a backoff hint between subsequent calls.
|
|
89
|
+
* - 'pause', 'stop': block this task
|
|
90
|
+
*
|
|
91
|
+
* NOTE: With totalTokensUsed pinned to 0 in the caller (no real token
|
|
92
|
+
* telemetry yet), the guidance gate's budget-slope detector cannot fire,
|
|
93
|
+
* so 'throttle' from this path is rare in practice — it would only fire
|
|
94
|
+
* if some other slowdown signal (not budget) were configured.
|
|
82
95
|
*/
|
|
83
96
|
private mapGuidanceDecision;
|
|
84
97
|
/**
|
|
@@ -142,6 +142,17 @@ export class ContinueGateIntegration {
|
|
|
142
142
|
if (this.guidanceContinueGate && localDecision.shouldContinue && !localDecision.reason) {
|
|
143
143
|
try {
|
|
144
144
|
const reworkRatio = this.calculateReworkRatio(history.slice(-10));
|
|
145
|
+
// ADR-058 NOTE: We do NOT track real per-action token usage here.
|
|
146
|
+
// Passing a synthetic estimate (e.g. history.length * 500) to the
|
|
147
|
+
// guidance gate causes the linear-regression slope detector to fire
|
|
148
|
+
// on the first multi-step interaction (slope = 500 vs 0.02 threshold),
|
|
149
|
+
// which would block legitimate one-off MCP tool calls.
|
|
150
|
+
//
|
|
151
|
+
// Until real token telemetry is wired in, we set totalTokensUsed = 0
|
|
152
|
+
// and a generous budgetRemaining. This effectively disables the
|
|
153
|
+
// budget-slope and budget-exhaustion checks (they require non-zero
|
|
154
|
+
// token data to fire) while keeping the coherence, rework, and
|
|
155
|
+
// uncertainty checks active — those use real data we DO have.
|
|
145
156
|
const stepContext = {
|
|
146
157
|
stepNumber: history.length,
|
|
147
158
|
totalToolCalls: history.length,
|
|
@@ -150,9 +161,9 @@ export class ContinueGateIntegration {
|
|
|
150
161
|
uncertaintyScore: reworkRatio,
|
|
151
162
|
elapsedMs: history.length > 0 ? Date.now() - history[0].timestamp : 0,
|
|
152
163
|
lastCheckpointStep: 0,
|
|
153
|
-
totalTokensUsed:
|
|
164
|
+
totalTokensUsed: 0, // No real token telemetry — see comment above
|
|
154
165
|
budgetRemaining: {
|
|
155
|
-
tokens:
|
|
166
|
+
tokens: Number.MAX_SAFE_INTEGER, // Defer budget gating to dedicated cost monitor
|
|
156
167
|
toolCalls: Math.max(0, (flags.maxConsecutiveRetries * 10) - history.length),
|
|
157
168
|
timeMs: Math.max(0, flags.idleTimeoutMs - (history.length > 0 ? Date.now() - history[history.length - 1].timestamp : 0)),
|
|
158
169
|
},
|
|
@@ -254,15 +265,27 @@ export class ContinueGateIntegration {
|
|
|
254
265
|
*
|
|
255
266
|
* ContinueDecision has: { decision, reasons, metrics, recommendedAction }
|
|
256
267
|
* We map to: { shouldContinue, reason, throttleMs, escalate, reworkRatio }
|
|
268
|
+
*
|
|
269
|
+
* Decision semantics:
|
|
270
|
+
* - 'continue', 'checkpoint': proceed normally
|
|
271
|
+
* - 'throttle': proceed but caller should slow down (soft signal — not a block).
|
|
272
|
+
* The recommended action is "slow down", not "abort". Treating throttle as
|
|
273
|
+
* a hard rejection would cause legitimate work to be denied; the caller can
|
|
274
|
+
* apply the throttleMs as a backoff hint between subsequent calls.
|
|
275
|
+
* - 'pause', 'stop': block this task
|
|
276
|
+
*
|
|
277
|
+
* NOTE: With totalTokensUsed pinned to 0 in the caller (no real token
|
|
278
|
+
* telemetry yet), the guidance gate's budget-slope detector cannot fire,
|
|
279
|
+
* so 'throttle' from this path is rare in practice — it would only fire
|
|
280
|
+
* if some other slowdown signal (not budget) were configured.
|
|
257
281
|
*/
|
|
258
282
|
mapGuidanceDecision(decision, agentId) {
|
|
259
283
|
const flags = governanceFlags.getFlags().continueGate;
|
|
260
|
-
const
|
|
284
|
+
const isBlocking = decision.decision === 'pause' || decision.decision === 'stop';
|
|
285
|
+
const shouldContinue = !isBlocking;
|
|
261
286
|
const reason = decision.reasons.length > 0 ? decision.reasons.join('; ') : undefined;
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const throttleMs = decision.decision === 'stop' ? 30000 :
|
|
265
|
-
decision.decision === 'pause' ? 15000 : 5000;
|
|
287
|
+
if (isBlocking && flags.throttleOnExceed) {
|
|
288
|
+
const throttleMs = decision.decision === 'stop' ? 30000 : 15000;
|
|
266
289
|
this.throttledAgents.set(agentId, Date.now() + throttleMs);
|
|
267
290
|
}
|
|
268
291
|
return {
|
|
@@ -271,7 +294,7 @@ export class ContinueGateIntegration {
|
|
|
271
294
|
throttleMs: decision.decision === 'throttle' ? 5000 :
|
|
272
295
|
decision.decision === 'pause' ? 15000 :
|
|
273
296
|
decision.decision === 'stop' ? 30000 : undefined,
|
|
274
|
-
escalate:
|
|
297
|
+
escalate: isBlocking,
|
|
275
298
|
reworkRatio: decision.metrics.reworkRatio,
|
|
276
299
|
};
|
|
277
300
|
}
|