agentic-qe 3.14.0 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/brain-checkpoint.cjs +2 -1
- package/.claude/helpers/validate-v3-config.sh +6 -5
- package/.claude/hooks/aqe-hook.cjs +14 -14
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/.claude/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/.claude/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/.claude/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/.claude/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +77 -0
- package/assets/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/assets/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/assets/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/assets/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/assets/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +7 -7
- package/dist/cli/chunks/adapter-I2N7PEKG.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-JZO6VUW4.js → agent-booster-wasm-OY5Y2CUM.js} +2 -2
- package/dist/cli/chunks/{agent-handler-534KFGEJ.js → agent-handler-TUOH55LD.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-B7KWLWY4.js → agent-memory-branch-XM3IYKT3.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-U4ALUH6A.js +2 -0
- package/dist/cli/chunks/{arena-OW5MELJX.js → arena-DOCLIEBL.js} +4 -4
- package/dist/cli/chunks/{arena-7CCD3S3I.js → arena-UMFJZKG7.js} +2 -2
- package/dist/cli/chunks/{audit-BHVKN4E2.js → audit-KZLU5VLW.js} +3 -3
- package/dist/cli/chunks/base-RCYIBNHM.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-P5FA6WFK.js → better-sqlite3-MIEZBNUI.js} +2 -2
- package/dist/cli/chunks/{brain-handler-WNW5LOV7.js → brain-handler-6PZN46B7.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-TVZ2ODKH.js → branch-enumerator-XCETHA4F.js} +2 -2
- package/dist/cli/chunks/{browser-TCEB2W2F.js → browser-UEXISDCJ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-L6TDB5O5.js +2 -0
- package/dist/cli/chunks/{chunk-IQ3JFHZN.js → chunk-3AYNHOWS.js} +1 -1
- package/dist/cli/chunks/{chunk-3QT6S3A3.js → chunk-3BRR2FLH.js} +3 -3
- package/dist/cli/chunks/{chunk-43GPSYAL.js → chunk-3FFMUB3B.js} +2 -2
- package/dist/cli/chunks/{chunk-E4NU4BJA.js → chunk-3JMSXOU4.js} +2 -2
- package/dist/cli/chunks/{chunk-IQLRA4FV.js → chunk-3TMUCJNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-AR6SATU3.js → chunk-3WSH4HD2.js} +2 -2
- package/dist/cli/chunks/{chunk-7OUMJCJT.js → chunk-3XRXUVUI.js} +1 -1
- package/dist/cli/chunks/{chunk-ZQSXG7FA.js → chunk-45S5553E.js} +2 -2
- package/dist/cli/chunks/{chunk-LKR7T3OZ.js → chunk-4MT62HKK.js} +1 -1
- package/dist/cli/chunks/{chunk-SUSMHSXT.js → chunk-4ZLFUO4I.js} +2 -2
- package/dist/cli/chunks/{chunk-QMMDN4WX.js → chunk-5F5V4QYU.js} +3 -3
- package/dist/cli/chunks/{chunk-I3VHXA2W.js → chunk-5KP62DC3.js} +2 -2
- package/dist/cli/chunks/{chunk-OONCRNFA.js → chunk-5NSSJUWW.js} +2 -2
- package/dist/cli/chunks/{chunk-T3BZAFLP.js → chunk-5T6PAUZD.js} +1 -1
- package/dist/cli/chunks/{chunk-VOSISOFD.js → chunk-5TYGSQOL.js} +1 -1
- package/dist/cli/chunks/{chunk-L4C42WYI.js → chunk-5Y2QFSVZ.js} +2 -2
- package/dist/cli/chunks/{chunk-RKUYVVGJ.js → chunk-6B77GPWL.js} +2 -2
- package/dist/cli/chunks/{chunk-LZHTCUCO.js → chunk-6DDMHZWH.js} +2 -2
- package/dist/cli/chunks/{chunk-SROZXIMT.js → chunk-6HMNN2Y2.js} +54 -54
- package/dist/cli/chunks/{chunk-7RAB2BZY.js → chunk-6YIMLUH6.js} +2 -2
- package/dist/cli/chunks/{chunk-NKWO2X3T.js → chunk-6Z6Y3YBX.js} +1 -1
- package/dist/cli/chunks/{chunk-4MK2G6TK.js → chunk-75SC3GEX.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBOWR4XT.js → chunk-7AF55H2D.js} +2 -2
- package/dist/cli/chunks/{chunk-WKNWRDA5.js → chunk-7AYTM426.js} +1 -1
- package/dist/cli/chunks/{chunk-JAK5UUWH.js → chunk-7GF6IRSU.js} +2 -2
- package/dist/cli/chunks/{chunk-4ZVGSVHV.js → chunk-7XL2D56F.js} +4 -4
- package/dist/cli/chunks/{chunk-2NO4H35K.js → chunk-A6RB34Y6.js} +1 -1
- package/dist/cli/chunks/{chunk-ZI3UO7QR.js → chunk-AESYVAPH.js} +2 -2
- package/dist/cli/chunks/{chunk-GKNDP5VK.js → chunk-AZUC7E5S.js} +2 -2
- package/dist/cli/chunks/{chunk-B3H4K7CY.js → chunk-B6Y6AF4M.js} +2 -2
- package/dist/cli/chunks/{chunk-ECTPFCON.js → chunk-C3XNFIOM.js} +2 -2
- package/dist/cli/chunks/{chunk-QZPFUFZG.js → chunk-CBWF42ET.js} +2 -2
- package/dist/cli/chunks/{chunk-JMKMDSXG.js → chunk-CCZZZBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-6IZQSLYZ.js → chunk-CGDW47WP.js} +2 -2
- package/dist/cli/chunks/chunk-CGZ7LTUK.js +2 -0
- package/dist/cli/chunks/{chunk-FRL3X2QA.js → chunk-D6RCRTTR.js} +2 -2
- package/dist/cli/chunks/{chunk-DOWCOZDO.js → chunk-DFXQLHQM.js} +2 -2
- package/dist/cli/chunks/{chunk-QQCENKCX.js → chunk-DKSLJZVA.js} +1 -1
- package/dist/cli/chunks/{chunk-YKWMKRYB.js → chunk-DKUKGBJE.js} +1 -1
- package/dist/cli/chunks/{chunk-ENGKLFLY.js → chunk-DKXSJDII.js} +2 -2
- package/dist/cli/chunks/chunk-EEJP3WTQ.js +4 -0
- package/dist/cli/chunks/{chunk-PEW6FZ47.js → chunk-EHW62JL2.js} +1 -1
- package/dist/cli/chunks/{chunk-5LEAGKX5.js → chunk-EPBWFTHH.js} +2 -2
- package/dist/cli/chunks/{chunk-ZAAYOENS.js → chunk-ERTGGFXZ.js} +2 -2
- package/dist/cli/chunks/{chunk-TKYEP7OR.js → chunk-F7TRO2OM.js} +1 -1
- package/dist/cli/chunks/{chunk-HJIAVR6P.js → chunk-FFRKTZYP.js} +2 -2
- package/dist/cli/chunks/{chunk-S5YVLPXU.js → chunk-FH7SCX2I.js} +2 -2
- package/dist/cli/chunks/{chunk-N2YAUDAV.js → chunk-FHBGALBG.js} +2 -2
- package/dist/cli/chunks/{chunk-WWWX76QB.js → chunk-FOAFRC2W.js} +2 -2
- package/dist/cli/chunks/{chunk-KTSCZ7AW.js → chunk-FPBQ7BXU.js} +2 -2
- package/dist/cli/chunks/{chunk-JTWJR2KY.js → chunk-FRRRDCXY.js} +2 -2
- package/dist/cli/chunks/{chunk-2HYVOX6N.js → chunk-FZ47ZCRL.js} +1 -1
- package/dist/cli/chunks/{chunk-H3YDDKBW.js → chunk-GH3NJOTC.js} +3 -3
- package/dist/cli/chunks/{chunk-5VDVYTO5.js → chunk-GO66DCIZ.js} +2 -2
- package/dist/cli/chunks/{chunk-H6NFDOMK.js → chunk-GRVR3Y6I.js} +1 -1
- package/dist/cli/chunks/chunk-GYTWUOKU.js +65 -0
- package/dist/cli/chunks/{chunk-O2MZZL54.js → chunk-H2DX36SC.js} +2 -2
- package/dist/cli/chunks/{chunk-NOPVFBQM.js → chunk-H5LSXVWY.js} +2 -2
- package/dist/cli/chunks/{chunk-DDPJUAXQ.js → chunk-HBAQVJDP.js} +2 -2
- package/dist/cli/chunks/{chunk-R6WJF4D5.js → chunk-HCCILQGN.js} +2 -2
- package/dist/cli/chunks/{chunk-CIZ6LSNV.js → chunk-HJD52N32.js} +2 -2
- package/dist/cli/chunks/{chunk-4FEJEVG7.js → chunk-HKU5PPS7.js} +1 -1
- package/dist/cli/chunks/{chunk-M3HUZD2I.js → chunk-HPQU6XZH.js} +1 -1
- package/dist/cli/chunks/{chunk-IL6QRXRP.js → chunk-HRUQWABO.js} +10 -10
- package/dist/cli/chunks/{chunk-BZ4QVFP2.js → chunk-IGRTQ6VT.js} +2 -2
- package/dist/cli/chunks/{chunk-HQ7243G3.js → chunk-IIBXGHZT.js} +2 -2
- package/dist/cli/chunks/{chunk-LCSVROU7.js → chunk-IYB3GRXF.js} +10 -10
- package/dist/cli/chunks/{chunk-CIUOC5F3.js → chunk-IYIMLLUV.js} +1 -1
- package/dist/cli/chunks/{chunk-6AOZU3UN.js → chunk-J2VF7ZO7.js} +2 -2
- package/dist/cli/chunks/{chunk-2D7UBX5S.js → chunk-J33LKXVH.js} +1 -1
- package/dist/cli/chunks/{chunk-JY4VZ6BN.js → chunk-J7VAD4RG.js} +2 -2
- package/dist/cli/chunks/{chunk-A2WZEMWT.js → chunk-JJ4GUO4K.js} +1 -1
- package/dist/cli/chunks/{chunk-RGVD6ZUX.js → chunk-JMULRLD4.js} +1 -1
- package/dist/cli/chunks/{chunk-JRKEBESE.js → chunk-JNSTKE3K.js} +2 -2
- package/dist/cli/chunks/{chunk-3RYTAYR6.js → chunk-JZUWPDVS.js} +1 -1
- package/dist/cli/chunks/{chunk-5XGVSQS2.js → chunk-KHUO4NCW.js} +2 -2
- package/dist/cli/chunks/{chunk-AFGT26NR.js → chunk-KXMW7XTJ.js} +2 -2
- package/dist/cli/chunks/{chunk-6DPAMYLU.js → chunk-KXTN3FR4.js} +2 -2
- package/dist/cli/chunks/{chunk-VXU53F7Z.js → chunk-L4WATX6B.js} +2 -2
- package/dist/cli/chunks/{chunk-SSV6KSFT.js → chunk-L66BWYQH.js} +1 -1
- package/dist/cli/chunks/{chunk-FOHYBR3O.js → chunk-LJ63HPPN.js} +1 -1
- package/dist/cli/chunks/{chunk-6IJMD2ZL.js → chunk-LMPK63PO.js} +3 -3
- package/dist/cli/chunks/{chunk-IL4AEB3J.js → chunk-LQDFWLKK.js} +2 -2
- package/dist/cli/chunks/{chunk-IE5LC7MB.js → chunk-LSXQPMPI.js} +2 -2
- package/dist/cli/chunks/{chunk-UI6WSPEK.js → chunk-MDLLEUFN.js} +3 -3
- package/dist/cli/chunks/{chunk-A7SKM6JL.js → chunk-MFAN5W27.js} +1 -1
- package/dist/cli/chunks/{chunk-J3XSHJGK.js → chunk-MZ2PJUN6.js} +2 -2
- package/dist/cli/chunks/{chunk-VPVZHJSU.js → chunk-N22LMACN.js} +2 -2
- package/dist/cli/chunks/{chunk-XITTURP2.js → chunk-NAJCQJSK.js} +2 -2
- package/dist/cli/chunks/{chunk-VYENTZ45.js → chunk-ND6JBUVH.js} +2 -2
- package/dist/cli/chunks/{chunk-AVLA5PBJ.js → chunk-NEEZ6M4W.js} +2 -2
- package/dist/cli/chunks/{chunk-HNKPLVYS.js → chunk-NNJ63W77.js} +1 -1
- package/dist/cli/chunks/{chunk-NDPQ2WPU.js → chunk-O7KF3GBV.js} +1 -1
- package/dist/cli/chunks/{chunk-YEAC3DC6.js → chunk-OBKMLOHU.js} +2 -2
- package/dist/cli/chunks/{chunk-NYARYONH.js → chunk-OBLHI4HA.js} +1 -1
- package/dist/cli/chunks/{chunk-5MZF4N4Q.js → chunk-ODNLKYOM.js} +1 -1
- package/dist/cli/chunks/{chunk-6W42XWLL.js → chunk-PMREFRPP.js} +2 -2
- package/dist/cli/chunks/{chunk-7BOPFN3Y.js → chunk-PMUF7WU6.js} +2 -2
- package/dist/cli/chunks/{chunk-52DFCV57.js → chunk-PS5NIMWJ.js} +2 -2
- package/dist/cli/chunks/{chunk-ZBKGX72B.js → chunk-PS6Y662P.js} +3 -3
- package/dist/cli/chunks/{chunk-YW4RNZWT.js → chunk-PYAH4K2U.js} +2 -2
- package/dist/cli/chunks/{chunk-E722WNWC.js → chunk-PZZX57ZA.js} +2 -2
- package/dist/cli/chunks/{chunk-YKZV7O65.js → chunk-QAE4BOIV.js} +2 -2
- package/dist/cli/chunks/{chunk-FF43SRP6.js → chunk-QIY43XQJ.js} +1 -1
- package/dist/cli/chunks/{chunk-HLNQDRHA.js → chunk-QM6EJHP5.js} +1 -1
- package/dist/cli/chunks/{chunk-7RVAHJQZ.js → chunk-QMTBWHGR.js} +3 -3
- package/dist/cli/chunks/{chunk-3EM2MK3Z.js → chunk-RCHDSUVU.js} +2 -2
- package/dist/cli/chunks/{chunk-K6CGQR5R.js → chunk-RUEHSOE6.js} +1 -1
- package/dist/cli/chunks/{chunk-ZNSMVQCG.js → chunk-RVCMZUSJ.js} +2 -2
- package/dist/cli/chunks/{chunk-OIYUSWHX.js → chunk-RXHI6CKK.js} +1 -1
- package/dist/cli/chunks/{chunk-KDIZQHG5.js → chunk-RXPHQ4ZE.js} +2 -2
- package/dist/cli/chunks/{chunk-XXFKN7LB.js → chunk-RYHCYTFE.js} +1 -1
- package/dist/cli/chunks/{chunk-WTHAVFIC.js → chunk-S4WIAKPL.js} +1 -1
- package/dist/cli/chunks/{chunk-GVEJP5T7.js → chunk-S53ZUAVI.js} +2 -2
- package/dist/cli/chunks/{chunk-UUJ5VQJM.js → chunk-SEKOMKNG.js} +1 -1
- package/dist/cli/chunks/{chunk-2O4DDPEA.js → chunk-SZRDEPUY.js} +3 -3
- package/dist/cli/chunks/{chunk-3GUO4ERR.js → chunk-T7XYQX5G.js} +2 -2
- package/dist/cli/chunks/{chunk-U4GZWPKM.js → chunk-TF33GKWA.js} +2 -2
- package/dist/cli/chunks/{chunk-6AYO3IR2.js → chunk-TGFJUL6M.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCVJCCQQ.js → chunk-TLD727EF.js} +2 -2
- package/dist/cli/chunks/{chunk-QSPRQPEL.js → chunk-TQ2JZVZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-BQCTO7UB.js → chunk-TT7DF2GX.js} +2 -2
- package/dist/cli/chunks/{chunk-DJITEQYS.js → chunk-UCJEAK7D.js} +2 -2
- package/dist/cli/chunks/{chunk-4XTHRAUV.js → chunk-UN7EHLRV.js} +1 -1
- package/dist/cli/chunks/{chunk-Q73RRTLE.js → chunk-UUE5CBZQ.js} +2 -2
- package/dist/cli/chunks/{chunk-JGROLJ33.js → chunk-UWRMPRY5.js} +1 -1
- package/dist/cli/chunks/{chunk-EJ6IP7DE.js → chunk-VEWYUEVY.js} +2 -2
- package/dist/cli/chunks/{chunk-VESOYP6A.js → chunk-VUXHJPUS.js} +2 -2
- package/dist/cli/chunks/{chunk-HQHLHSJO.js → chunk-VVP2ROXD.js} +2 -2
- package/dist/cli/chunks/{chunk-H76TV4UU.js → chunk-WFJKLM6Z.js} +3 -3
- package/dist/cli/chunks/{chunk-TGOGCA74.js → chunk-X5G3UDWP.js} +2 -2
- package/dist/cli/chunks/{chunk-QKQZ4IJF.js → chunk-Y63V33M6.js} +5 -5
- package/dist/cli/chunks/{chunk-3JIJBR4V.js → chunk-YXN47QOI.js} +2 -2
- package/dist/cli/chunks/{chunk-MO7EITJK.js → chunk-Z5YU2TDS.js} +2 -2
- package/dist/cli/chunks/{chunk-TQJE7DNL.js → chunk-ZAHCVRR7.js} +2 -2
- package/dist/cli/chunks/{chunk-VRRG66XB.js → chunk-ZC3HC6FO.js} +1 -1
- package/dist/cli/chunks/{ci-B432UH6N.js → ci-Q2VX75PS.js} +2 -2
- package/dist/cli/chunks/{ci-output-GTHH7WYG.js → ci-output-MD5GTVR2.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-VW75DLME.js → circuit-breaker-JMRLG2XI.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-RE3IVT7U.js → claude-flow-setup-IMXYALBU.js} +2 -2
- package/dist/cli/chunks/client-L4PIXCGV.js +2 -0
- package/dist/cli/chunks/{cline-installer-NUBZZ55N.js → cline-installer-HWFASEGE.js} +2 -2
- package/dist/cli/chunks/{code-K6JCWKNW.js → code-3V37TCAD.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-I4ILB5JN.js → code-index-extractor-5V54WGFL.js} +2 -2
- package/dist/cli/chunks/codex-installer-UCA5AVE6.js +14 -0
- package/dist/cli/chunks/{completions-V3KJVJF4.js → completions-2DMRCQU6.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-HRG7OOY3.js → complexity-analyzer-MMQRXBTD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-CNTDONWG.js → continuedev-installer-FAARXP3S.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-XPWWIWYA.js → copilot-installer-AKQALMB5.js} +2 -2
- package/dist/cli/chunks/core-handlers-KROSXP4V.js +2 -0
- package/dist/cli/chunks/{cost-tracker-MFNLQ56K.js → cost-tracker-AXWHDND5.js} +2 -2
- package/dist/cli/chunks/{coverage-KOIK654V.js → coverage-ZLSKKCG5.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-WMTYBOON.js +2 -0
- package/dist/cli/chunks/{cursor-installer-S5MKLRQQ.js → cursor-installer-UALCQKVD.js} +2 -2
- package/dist/cli/chunks/{daemon-DUS6JYW6.js → daemon-4LNOPJGN.js} +3 -3
- package/dist/cli/chunks/{daemon-Z7VPGWHY.js → daemon-K3DFGCXC.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-7CQ3ARNI.js → dag-attention-scheduler-LCQ7MYKC.js} +2 -2
- package/dist/cli/chunks/{detect-WORBCAYF.js → detect-P7PEN3MZ.js} +2 -2
- package/dist/cli/chunks/{dist-node-KRNI6OYW.js → dist-node-I72BJC2D.js} +2 -2
- package/dist/cli/chunks/{domain-handler-KRUR2VQG.js → domain-handler-LROF6KWN.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-VEOVLV54.js → domain-transfer-M2ZSSTPV.js} +2 -2
- package/dist/cli/chunks/dream-AV63YQ2Y.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-QU3NQVA5.js → embed-and-insert-pattern-MTBPUGO4.js} +2 -2
- package/dist/cli/chunks/{eval-AYQ7BSUP.js → eval-O24ALB3W.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-AWQBL6LT.js → experience-capture-middleware-7JXEOGRE.js} +3 -3
- package/dist/cli/chunks/{fast-paths-V5EL4BYJ.js → fast-paths-4CFYJV4U.js} +2 -2
- package/dist/cli/chunks/{feature-flags-P34BPRWU.js → feature-flags-CHPUA7IM.js} +2 -2
- package/dist/cli/chunks/{feature-flags-BXX7BP22.js → feature-flags-E6PIM6ZB.js} +2 -2
- package/dist/cli/chunks/{file-discovery-MS6BKQ2U.js → file-discovery-2ANIAUCP.js} +2 -2
- package/dist/cli/chunks/{fleet-7WVVPA4W.js → fleet-2MQ3OGCP.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-7WQ3LEPG.js → gnn-wrapper-P7JW3622.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-P7QD3BZH.js → heartbeat-handler-WWWZSA7V.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-5IZUGMC2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-NV2NNBJL.js +2 -0
- package/dist/cli/chunks/hnsw-index-GRJ3KA2O.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-Y3GAR3UP.js → hnsw-legacy-bridge-W634ZOTV.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-5QUXZQWQ.js → hnswlib-node-SLZDLMKM.js} +2 -2
- package/dist/cli/chunks/{hooks-2D64KPRY.js → hooks-3BFAZGG7.js} +10 -10
- package/dist/cli/chunks/{hypergraph-engine-5INXEZDP.js → hypergraph-engine-XJSGXP2J.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-YJJJ3ESZ.js → hypergraph-handler-RVUWZMOX.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-YM4QUWVH.js +2 -0
- package/dist/cli/chunks/{init-handler-QSFYJN5Q.js → init-handler-FYOZNNNO.js} +9 -8
- package/dist/cli/chunks/init-wizard-YESXGIK6.js +2 -0
- package/dist/cli/chunks/kernel-VH5SKESU.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-3N3QGTJU.js → kilocode-installer-MAAKFVSB.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-GIWVTFZQ.js → kiro-installer-GX3TLZC5.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-F3NL4WJV.js +2 -0
- package/dist/cli/chunks/{learning-SGO2DQ5Q.js → learning-T4QZ6C26.js} +3 -3
- package/dist/cli/chunks/{llm-router-HBBULO65.js → llm-router-N2M4WXOC.js} +4 -4
- package/dist/cli/chunks/llm-router-service-HQYCJMPK.js +2 -0
- package/dist/cli/chunks/{load-B5OFYB4H.js → load-6RU3G4P2.js} +2 -2
- package/dist/cli/chunks/load-test-GWRGKWMN.js +2 -0
- package/dist/cli/chunks/{mcp-FG3LNQR4.js → mcp-EFBO7BAU.js} +2 -2
- package/dist/cli/chunks/{memory-SPS7ZWLC.js → memory-AXU2M3DN.js} +5 -5
- package/dist/cli/chunks/memory-backend-7A2PFKPV.js +2 -0
- package/dist/cli/chunks/{memory-handlers-P7FTPWP3.js → memory-handlers-65CXN76C.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-PUB7E6KH.js → multi-model-executor-W7AFGVNH.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-TGCSGVG2.js → opencode-installer-KJE2RLCH.js} +2 -2
- package/dist/cli/chunks/{orchestrator-S5FTJFGB.js → orchestrator-CL6MLGVU.js} +22 -21
- package/dist/cli/chunks/pattern-null-store-K2WPRYCP.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-LCXXGRAB.js → pattern-usage-recorder-7SNSJ7K2.js} +2 -2
- package/dist/cli/chunks/{pipeline-ENOSRHKW.js → pipeline-3UU6ON3F.js} +2 -2
- package/dist/cli/chunks/platform-SNMPIDIT.js +2 -0
- package/dist/cli/chunks/{plugin-JZ5ODJSU.js → plugin-65IIUUCU.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-DPJUPNCG.js → prime-radiant-advanced-wasm-WWWJRLRP.js} +2 -2
- package/dist/cli/chunks/protocol-executor-TJDLEHND.js +2 -0
- package/dist/cli/chunks/{protocol-handler-IP4NLVY3.js → protocol-handler-SEBHCLLJ.js} +2 -2
- package/dist/cli/chunks/{prove-P6FM4RU7.js → prove-N4X7CCJ4.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-CGRMFPDM.js +2 -0
- package/dist/cli/chunks/{quality-UHP4XO26.js → quality-LBCJWXMU.js} +2 -2
- package/dist/cli/chunks/quality-gate-KZIQI7QT.js +7 -0
- package/dist/cli/chunks/queen-coordinator-FKP6QZAQ.js +2 -0
- package/dist/cli/chunks/{real-embeddings-6SO5MFRQ.js → real-embeddings-XCZFHFME.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-WTWUOFCH.js → roocode-installer-P3O6B7PT.js} +2 -2
- package/dist/cli/chunks/router-KZ5BISAM.js +2 -0
- package/dist/cli/chunks/routing-feedback-O4Y5TTR6.js +2 -0
- package/dist/cli/chunks/{routing-handler-IK7HYERQ.js → routing-handler-OXZ4DOV4.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-THLB4NIM.js → ruvector-commands-PSY5IDSL.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-NG3UF3D5.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-PUHVTKQY.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-BUKCSHBD.js → rvf-migration-coordinator-4SUT7GTJ.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-ODXFKZ6G.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-ECTADZIN.js → rvf-store-integrity-TCKC22FH.js} +2 -2
- package/dist/cli/chunks/safe-db-BUQDNH2R.js +2 -0
- package/dist/cli/chunks/schedule-ZXNDZNNB.js +2 -0
- package/dist/cli/chunks/scheduler-YUQQWWW3.js +2 -0
- package/dist/cli/chunks/{security-HN4UXFXX.js → security-RQGUQGSI.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-XJCPX5SN.js → shared-rvf-adapter-ZJFN52C2.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-23X5PNY5.js → shared-rvf-dual-writer-V2R37HWV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-HVSX46C7.js +2 -0
- package/dist/cli/chunks/{status-handler-ZXANTHKT.js → status-handler-XEKWNVDR.js} +2 -2
- package/dist/cli/chunks/{structural-health-LR6WI3AH.js → structural-health-QMIW6WUN.js} +2 -2
- package/dist/cli/chunks/{sync-4OEI3BC2.js → sync-GDYJ2ULT.js} +2 -2
- package/dist/cli/chunks/{sync-I5IUJF33.js → sync-H5SXWXPP.js} +2 -2
- package/dist/cli/chunks/{task-handler-R3ATJKU5.js → task-handler-EPLKCQHY.js} +2 -2
- package/dist/cli/chunks/{task-handlers-4X357AEW.js → task-handlers-22NTLWTC.js} +3 -3
- package/dist/cli/chunks/{test-PR2B5H2F.js → test-WHJFRZ3F.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-ZNOSQVLD.js → test-scheduling-KZVFZOQN.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-LYXOI72S.js → token-bootstrap-BW5WA6PY.js} +2 -2
- package/dist/cli/chunks/{token-usage-R6EQZBX2.js → token-usage-4A4O57R6.js} +2 -2
- package/dist/cli/chunks/{transformers-COQWK27J.js → transformers-FYTBRV46.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-LLIW2X3M.js → tree-sitter-wasm-parser-TZIJPLF3.js} +2 -2
- package/dist/cli/chunks/{types-MEYTZITK.js → types-B2L6LKFA.js} +2 -2
- package/dist/cli/chunks/unified-memory-AHN4RVBP.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-XB7JPF74.js +2 -0
- package/dist/cli/chunks/unified-persistence-53KWNFQJ.js +2 -0
- package/dist/cli/chunks/{upgrade-DVIJ456A.js → upgrade-O6U7EA7V.js} +2 -2
- package/dist/cli/chunks/{validate-UYTSMJ5X.js → validate-FHNZ5XL3.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-P32WCJR6.js → validate-swarm-YOLLUEHE.js} +2 -2
- package/dist/cli/chunks/{vibium-JGVOLM6X.js → vibium-UXRPEIXB.js} +2 -2
- package/dist/cli/chunks/visual-security-CRPYS7L7.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-5ZGNCTPN.js → web-tree-sitter-JJ5UIYFD.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-IILSSQAE.js → windsurf-installer-I4QMQPIL.js} +2 -2
- package/dist/cli/chunks/witness-chain-5WCR2CAS.js +2 -0
- package/dist/cli/chunks/{witness-chain-JZMXCG3B.js → witness-chain-BIJ7WDGS.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-UUTLNUIH.js → witness-key-manager-3SMMLJLP.js} +2 -2
- package/dist/cli/chunks/{workflow-NS7HXVHZ.js → workflow-33PUXXJV.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RZWCLTT5.js +2 -0
- package/dist/cli/chunks/{wrappers-XKEDSV5W.js → wrappers-ASAU36VK.js} +2 -2
- package/dist/cli/commands/platform.d.ts +1 -0
- package/dist/cli/commands/platform.js +28 -6
- package/dist/cli/commands/quality-gate.js +25 -3
- package/dist/cli/handlers/init-handler.d.ts +5 -0
- package/dist/cli/handlers/init-handler.js +6 -0
- package/dist/cli/index.js +4 -1
- package/dist/contracts/verdicts.d.ts +625 -0
- package/dist/contracts/verdicts.js +202 -14
- package/dist/coordination/handlers/coverage-handlers.js +8 -1
- package/dist/domains/chaos-resilience/diagnosis/corpus.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/corpus.js +141 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.d.ts +11 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.js +109 -0
- package/dist/domains/chaos-resilience/diagnosis/index.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/index.js +5 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.d.ts +8 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.js +128 -0
- package/dist/domains/chaos-resilience/diagnosis/types.d.ts +171 -0
- package/dist/domains/chaos-resilience/diagnosis/types.js +3 -0
- package/dist/domains/chaos-resilience/index.d.ts +1 -0
- package/dist/domains/chaos-resilience/index.js +1 -0
- package/dist/domains/index.d.ts +1 -0
- package/dist/domains/index.js +1 -0
- package/dist/early-exit/early-exit-controller.d.ts +4 -2
- package/dist/early-exit/early-exit-controller.js +95 -7
- package/dist/early-exit/index.d.ts +1 -1
- package/dist/early-exit/speculative-executor.js +3 -0
- package/dist/early-exit/types.d.ts +51 -0
- package/dist/early-exit/types.js +3 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/init/browser-engine-installer.d.ts +11 -0
- package/dist/init/browser-engine-installer.js +35 -5
- package/dist/init/codex-installer.d.ts +11 -1
- package/dist/init/codex-installer.js +90 -24
- package/dist/init/init-wizard-hooks.js +11 -11
- package/dist/init/orchestrator.js +2 -0
- package/dist/init/phases/07-hooks.d.ts +3 -3
- package/dist/init/phases/07-hooks.js +19 -18
- package/dist/init/phases/09-assets.d.ts +4 -0
- package/dist/init/phases/09-assets.js +13 -10
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/init/types.d.ts +4 -0
- package/dist/learning/index.d.ts +3 -0
- package/dist/learning/index.js +2 -0
- package/dist/learning/pattern-mutation-error.d.ts +9 -0
- package/dist/learning/pattern-mutation-error.js +14 -0
- package/dist/learning/pattern-store.js +24 -2
- package/dist/learning/qe-reasoning-bank.js +24 -5
- package/dist/learning/rvf-pattern-store.js +23 -5
- package/dist/learning/structural-retrieval/corpus.d.ts +5 -0
- package/dist/learning/structural-retrieval/corpus.js +97 -0
- package/dist/learning/structural-retrieval/evaluate.d.ts +7 -0
- package/dist/learning/structural-retrieval/evaluate.js +124 -0
- package/dist/learning/structural-retrieval/index.d.ts +6 -0
- package/dist/learning/structural-retrieval/index.js +4 -0
- package/dist/learning/structural-retrieval/receipt.d.ts +14 -0
- package/dist/learning/structural-retrieval/receipt.js +36 -0
- package/dist/learning/structural-retrieval/types.d.ts +83 -0
- package/dist/learning/structural-retrieval/types.js +2 -0
- package/dist/mcp/bundle.js +423 -423
- package/dist/mcp/services/session-resume.d.ts +15 -19
- package/dist/mcp/services/session-resume.js +204 -194
- package/dist/mcp/tools/quality-assessment/gate.d.ts +8 -5
- package/dist/mcp/tools/quality-assessment/gate.js +9 -4
- package/dist/skills/qe-court/cli.js +0 -0
- package/dist/validation/quality-gate-runner.d.ts +27 -4
- package/dist/validation/quality-gate-runner.js +33 -4
- package/dist/validation/verification-reach.d.ts +90 -0
- package/dist/validation/verification-reach.js +187 -0
- package/dist/verification/adversarial-verify/index.d.ts +1 -1
- package/dist/verification/adversarial-verify/measurement-receipt.d.ts +13 -0
- package/dist/verification/adversarial-verify/measurement-receipt.js +136 -0
- package/dist/verification/adversarial-verify/synthesize.js +7 -10
- package/dist/verification/adversarial-verify/types.d.ts +35 -0
- package/dist/verification/adversarial-verify/verify.js +6 -1
- package/package.json +7 -4
- package/schemas/coverage-gap.schema.json +41 -0
- package/schemas/finding-verdict.schema.json +470 -0
- package/schemas/risk-decision.schema.json +41 -0
- package/dist/cli/chunks/adapter-3VBXL7DO.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-NXRNKJNA.js +0 -2
- package/dist/cli/chunks/base-F6GMOKU2.js +0 -2
- package/dist/cli/chunks/browser-workflow-QRDC46LR.js +0 -2
- package/dist/cli/chunks/chunk-R2B6EE45.js +0 -2
- package/dist/cli/chunks/chunk-TRDEULS7.js +0 -4
- package/dist/cli/chunks/chunk-WJXHE52V.js +0 -65
- package/dist/cli/chunks/client-HNBZUEVV.js +0 -2
- package/dist/cli/chunks/codex-installer-AKQ5BCHU.js +0 -15
- package/dist/cli/chunks/core-handlers-TB7NLYXL.js +0 -2
- package/dist/cli/chunks/cross-domain-router-MDSI553U.js +0 -2
- package/dist/cli/chunks/dream-X7ISHFEE.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-2C5XGFQT.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-KCVMXLUL.js +0 -2
- package/dist/cli/chunks/hnsw-index-OGWZS6MP.js +0 -2
- package/dist/cli/chunks/impact-analyzer-IBJ43GQL.js +0 -2
- package/dist/cli/chunks/init-wizard-6XMFD5LP.js +0 -2
- package/dist/cli/chunks/kernel-UDUMUPB3.js +0 -2
- package/dist/cli/chunks/knowledge-graph-JRYTUG3W.js +0 -2
- package/dist/cli/chunks/llm-router-service-KF5ZALUQ.js +0 -2
- package/dist/cli/chunks/load-test-LHMBCNCH.js +0 -2
- package/dist/cli/chunks/memory-backend-WZHKHBZK.js +0 -2
- package/dist/cli/chunks/pattern-null-store-UZSHCRL2.js +0 -2
- package/dist/cli/chunks/platform-WCRBO3Z7.js +0 -2
- package/dist/cli/chunks/protocol-executor-42NLVDTC.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-W74RSMMU.js +0 -2
- package/dist/cli/chunks/quality-gate-63DDBSGM.js +0 -7
- package/dist/cli/chunks/queen-coordinator-XELKSRMS.js +0 -2
- package/dist/cli/chunks/router-GTW2EQZV.js +0 -2
- package/dist/cli/chunks/routing-feedback-NVOBWEMK.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-5OPVMXNL.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-5S4YFTX4.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-LYSJHEVX.js +0 -2
- package/dist/cli/chunks/safe-db-AEB3JMLD.js +0 -2
- package/dist/cli/chunks/schedule-4QNPCQNT.js +0 -2
- package/dist/cli/chunks/scheduler-S3DFHX6A.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-L2KISU2H.js +0 -2
- package/dist/cli/chunks/unified-memory-5KQMA7FV.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-PQRPTYOD.js +0 -2
- package/dist/cli/chunks/unified-persistence-YDONVPJB.js +0 -2
- package/dist/cli/chunks/visual-security-RJ7RTNGJ.js +0 -2
- package/dist/cli/chunks/witness-chain-YXXXNGAM.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-5KUAVSTH.js +0 -2
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const ratio = (numerator, denominator) => denominator === 0 ? 0 : numerator / denominator;
|
|
2
|
+
function wilson95(successes, total) {
|
|
3
|
+
if (total === 0)
|
|
4
|
+
return [0, 0];
|
|
5
|
+
const z = 1.96;
|
|
6
|
+
const p = successes / total;
|
|
7
|
+
const denominator = 1 + (z * z) / total;
|
|
8
|
+
const center = (p + (z * z) / (2 * total)) / denominator;
|
|
9
|
+
const margin = (z / denominator) * Math.sqrt((p * (1 - p) / total) + (z * z) / (4 * total * total));
|
|
10
|
+
return [Math.max(0, center - margin), Math.min(1, center + margin)];
|
|
11
|
+
}
|
|
12
|
+
export function scoreAgentFaultDetector(corpus, detector, topK = 3) {
|
|
13
|
+
const diagnoses = new Map();
|
|
14
|
+
for (const item of corpus.cases)
|
|
15
|
+
diagnoses.set(item.caseId, runDetector(detector, item.caseId, item.detectorInput));
|
|
16
|
+
const cases = corpus.cases.map((item) => {
|
|
17
|
+
const diagnosis = diagnoses.get(item.caseId);
|
|
18
|
+
const truth = item.heldOut.truth;
|
|
19
|
+
const top = diagnosis.candidates[0];
|
|
20
|
+
const injected = truth.faultType !== 'none';
|
|
21
|
+
const predictedFault = Boolean(top && top.faultType !== 'none');
|
|
22
|
+
return {
|
|
23
|
+
caseId: item.caseId,
|
|
24
|
+
faultType: truth.faultType,
|
|
25
|
+
boundary: truth.boundary,
|
|
26
|
+
faultInjected: injected,
|
|
27
|
+
signalObserved: diagnosis.signalObserved,
|
|
28
|
+
detected: injected ? predictedFault : !predictedFault,
|
|
29
|
+
typeCorrect: top?.faultType === truth.faultType,
|
|
30
|
+
componentLocalized: top?.componentId === truth.componentId,
|
|
31
|
+
spanLocalized: top?.spanId === truth.spanId,
|
|
32
|
+
jointCorrect: top?.faultType === truth.faultType && top?.componentId === truth.componentId,
|
|
33
|
+
recovered: item.detectorInput.structured.spans.some((span) => span.recovered),
|
|
34
|
+
taskSucceeded: item.detectorInput.structured.terminalOutcome === 'completed',
|
|
35
|
+
abstained: diagnosis.status === 'abstained',
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const faulty = corpus.cases.filter((item) => item.heldOut.truth.faultType !== 'none');
|
|
39
|
+
const clean = corpus.cases.filter((item) => item.heldOut.truth.faultType === 'none');
|
|
40
|
+
const faultyScores = cases.filter((item) => item.faultInjected);
|
|
41
|
+
const cleanScores = cases.filter((item) => !item.faultInjected);
|
|
42
|
+
const predictedClean = corpus.cases.filter((item) => diagnoses.get(item.caseId)?.candidates[0]?.faultType === 'none');
|
|
43
|
+
const trueCleanPredictions = predictedClean.filter((item) => item.heldOut.truth.faultType === 'none');
|
|
44
|
+
const typeTopKCorrect = faulty.filter((item) => diagnoses.get(item.caseId)?.candidates
|
|
45
|
+
.slice(0, topK).some((candidate) => candidate.faultType === item.heldOut.truth.faultType)).length;
|
|
46
|
+
const parsed = [...diagnoses.values()].filter((item) => item.status !== 'parse-error').length;
|
|
47
|
+
const abstained = [...diagnoses.values()].filter((item) => item.status === 'abstained').length;
|
|
48
|
+
return {
|
|
49
|
+
detectorId: detector.id,
|
|
50
|
+
corpusId: corpus.manifest.corpusId,
|
|
51
|
+
support: cases.length,
|
|
52
|
+
noFault: {
|
|
53
|
+
precision: ratio(trueCleanPredictions.length, predictedClean.length),
|
|
54
|
+
recall: ratio(cleanScores.filter((item) => item.typeCorrect).length, clean.length),
|
|
55
|
+
falsePositiveRate: ratio(cleanScores.filter((item) => !item.typeCorrect).length, clean.length),
|
|
56
|
+
},
|
|
57
|
+
faultRecall: ratio(faultyScores.filter((item) => item.detected).length, faulty.length),
|
|
58
|
+
typeTop1: ratio(faultyScores.filter((item) => item.typeCorrect).length, faulty.length),
|
|
59
|
+
typeTopK: ratio(typeTopKCorrect, faulty.length),
|
|
60
|
+
componentTop1: ratio(faultyScores.filter((item) => item.componentLocalized).length, faulty.length),
|
|
61
|
+
exactSpanTop1: ratio(faultyScores.filter((item) => item.spanLocalized).length, faulty.length),
|
|
62
|
+
jointTop1: ratio(faultyScores.filter((item) => item.jointCorrect).length, faulty.length),
|
|
63
|
+
parseRate: ratio(parsed, cases.length),
|
|
64
|
+
abstentionRate: ratio(abstained, cases.length),
|
|
65
|
+
meanLatencyMs: ratio([...diagnoses.values()].reduce((sum, item) => sum + item.latencyMs, 0), cases.length),
|
|
66
|
+
totalTokens: [...diagnoses.values()].reduce((sum, item) => sum + (item.tokens ?? 0), 0),
|
|
67
|
+
totalCost: [...diagnoses.values()].reduce((sum, item) => sum + (item.cost ?? 0), 0),
|
|
68
|
+
uncertainty: { method: 'wilson-95', faultRecall: wilson95(faultyScores.filter((item) => item.detected).length, faulty.length) },
|
|
69
|
+
byFault: slice(corpus, cases, (index) => corpus.cases[index].heldOut.truth.faultType),
|
|
70
|
+
byBoundary: slice(corpus, cases, (index) => corpus.cases[index].heldOut.truth.boundary),
|
|
71
|
+
cases,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function slice(corpus, scores, key) {
|
|
75
|
+
const groups = new Map();
|
|
76
|
+
scores.forEach((score, index) => groups.set(key(index), [...(groups.get(key(index)) ?? []), score]));
|
|
77
|
+
return Object.fromEntries([...groups.entries()].map(([name, items]) => [name, {
|
|
78
|
+
support: items.length,
|
|
79
|
+
detected: items.filter((item) => item.detected).length,
|
|
80
|
+
typeTop1: items.filter((item) => item.typeCorrect).length,
|
|
81
|
+
componentTop1: items.filter((item) => item.componentLocalized).length,
|
|
82
|
+
jointTop1: items.filter((item) => item.jointCorrect).length,
|
|
83
|
+
abstentions: items.filter((item) => item.abstained).length,
|
|
84
|
+
}]));
|
|
85
|
+
}
|
|
86
|
+
export function qualifyAgentFaultDetector(report) {
|
|
87
|
+
const failures = [];
|
|
88
|
+
if (report.noFault.falsePositiveRate > 0.1)
|
|
89
|
+
failures.push('no-fault false-positive rate exceeds 10%');
|
|
90
|
+
if (report.typeTop1 < 0.5)
|
|
91
|
+
failures.push('fault-type top-1 accuracy is below 50%');
|
|
92
|
+
if (report.jointTop1 < 0.5)
|
|
93
|
+
failures.push('joint type/location accuracy is below 50%');
|
|
94
|
+
if (report.parseRate < 1)
|
|
95
|
+
failures.push('detector did not parse every frozen case');
|
|
96
|
+
for (const critical of ['corrupted-tool-output', 'guardrail-bypass']) {
|
|
97
|
+
const score = report.cases.find((item) => item.faultType === critical);
|
|
98
|
+
if (score && !score.typeCorrect && !score.abstained) {
|
|
99
|
+
failures.push(`${critical} must be diagnosed correctly or explicitly abstained`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return { passed: failures.length === 0, failures };
|
|
103
|
+
}
|
|
104
|
+
function runDetector(detector, caseId, input) {
|
|
105
|
+
try {
|
|
106
|
+
const result = detector.diagnose(caseId, input);
|
|
107
|
+
const validStatus = ['diagnosed', 'abstained', 'parse-error'].includes(result.status);
|
|
108
|
+
const validCandidates = Array.isArray(result.candidates)
|
|
109
|
+
&& result.candidates.every((item) => Number.isFinite(item.confidence)
|
|
110
|
+
&& item.confidence >= 0 && item.confidence <= 1);
|
|
111
|
+
if (result.caseId !== caseId || !validStatus || !validCandidates
|
|
112
|
+
|| !Number.isFinite(result.latencyMs) || result.latencyMs < 0) {
|
|
113
|
+
throw new Error('Detector returned an invalid diagnosis envelope');
|
|
114
|
+
}
|
|
115
|
+
return result;
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
return {
|
|
119
|
+
caseId,
|
|
120
|
+
status: 'parse-error',
|
|
121
|
+
candidates: [],
|
|
122
|
+
signalObserved: false,
|
|
123
|
+
latencyMs: 0,
|
|
124
|
+
reason: error instanceof Error ? error.message : 'Detector failed',
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=scorer.js.map
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
export declare const AGENT_FAULT_TRACE_SCHEMA_VERSION: "1.0.0";
|
|
2
|
+
export declare const AGENT_FAULT_CORPUS_SCHEMA_VERSION: "1.0.0";
|
|
3
|
+
export type AgentRuntimeBoundary = 'tool' | 'model-context' | 'guardrail' | 'inter-agent' | 'control';
|
|
4
|
+
export type AgentRuntimeFaultType = 'none' | 'tool-unavailable' | 'tool-timeout' | 'corrupted-tool-output' | 'context-truncation' | 'delegation-timeout' | 'agent-misroute' | 'delegation-loop' | 'guardrail-bypass';
|
|
5
|
+
export type TraceSpanKind = 'run' | 'agent' | 'delegation' | 'tool' | 'model' | 'guardrail';
|
|
6
|
+
export type TraceSpanStatus = 'ok' | 'error' | 'timeout' | 'cancelled';
|
|
7
|
+
export interface SanitizedTraceSpan {
|
|
8
|
+
readonly spanId: string;
|
|
9
|
+
readonly parentSpanId?: string;
|
|
10
|
+
readonly componentId: string;
|
|
11
|
+
readonly kind: TraceSpanKind;
|
|
12
|
+
readonly startOffsetMs: number;
|
|
13
|
+
readonly durationMs: number;
|
|
14
|
+
readonly status: TraceSpanStatus;
|
|
15
|
+
readonly signalCode?: string;
|
|
16
|
+
readonly inputBytes: number;
|
|
17
|
+
readonly outputBytes: number;
|
|
18
|
+
readonly inputHash: string;
|
|
19
|
+
readonly outputHash: string;
|
|
20
|
+
readonly intendedDestination?: string;
|
|
21
|
+
readonly actualDestination?: string;
|
|
22
|
+
readonly policyRef?: string;
|
|
23
|
+
readonly expectedDecision?: 'allow' | 'deny';
|
|
24
|
+
readonly actualDecision?: 'allow' | 'deny';
|
|
25
|
+
readonly retry?: number;
|
|
26
|
+
readonly recovered?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface SanitizedExecutionTrace {
|
|
29
|
+
readonly schemaVersion: typeof AGENT_FAULT_TRACE_SCHEMA_VERSION;
|
|
30
|
+
readonly runId: string;
|
|
31
|
+
readonly taskId: string;
|
|
32
|
+
readonly harnessRevision: string;
|
|
33
|
+
readonly terminalOutcome: 'completed' | 'failed' | 'cancelled';
|
|
34
|
+
readonly spans: readonly SanitizedTraceSpan[];
|
|
35
|
+
}
|
|
36
|
+
export interface StructuredTraceView {
|
|
37
|
+
readonly schemaVersion: typeof AGENT_FAULT_TRACE_SCHEMA_VERSION;
|
|
38
|
+
readonly runId: string;
|
|
39
|
+
readonly taskId: string;
|
|
40
|
+
readonly terminalOutcome: SanitizedExecutionTrace['terminalOutcome'];
|
|
41
|
+
readonly spans: readonly SanitizedTraceSpan[];
|
|
42
|
+
}
|
|
43
|
+
export interface AgentFaultDetectorInput {
|
|
44
|
+
readonly trace: SanitizedExecutionTrace;
|
|
45
|
+
readonly structured: StructuredTraceView;
|
|
46
|
+
readonly cleanReference?: StructuredTraceView;
|
|
47
|
+
}
|
|
48
|
+
export interface AgentFaultInjectionManifest {
|
|
49
|
+
readonly schemaVersion: typeof AGENT_FAULT_CORPUS_SCHEMA_VERSION;
|
|
50
|
+
readonly caseId: string;
|
|
51
|
+
readonly runId: string;
|
|
52
|
+
readonly taskId: string;
|
|
53
|
+
readonly sourceRevision: string;
|
|
54
|
+
readonly environmentDigest: string;
|
|
55
|
+
readonly seed: number;
|
|
56
|
+
readonly target: {
|
|
57
|
+
readonly boundary: AgentRuntimeBoundary;
|
|
58
|
+
readonly componentId: string;
|
|
59
|
+
readonly spanId: string;
|
|
60
|
+
};
|
|
61
|
+
readonly parameters: Readonly<Record<string, string | number | boolean>>;
|
|
62
|
+
readonly expectedObservableSignal: string;
|
|
63
|
+
readonly cleanup: {
|
|
64
|
+
readonly required: boolean;
|
|
65
|
+
readonly state: 'not-required' | 'verified';
|
|
66
|
+
readonly witness: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export interface AgentFaultGroundTruth {
|
|
70
|
+
readonly faultType: AgentRuntimeFaultType;
|
|
71
|
+
readonly boundary: AgentRuntimeBoundary;
|
|
72
|
+
readonly componentId: string;
|
|
73
|
+
readonly spanId: string;
|
|
74
|
+
}
|
|
75
|
+
export interface AgentFaultCorpusCase {
|
|
76
|
+
readonly caseId: string;
|
|
77
|
+
readonly cleanReferenceId?: string;
|
|
78
|
+
readonly detectorInput: AgentFaultDetectorInput;
|
|
79
|
+
/** Held outside detectorInput. Callers must not pass this object to detectors. */
|
|
80
|
+
readonly heldOut: {
|
|
81
|
+
readonly manifest: AgentFaultInjectionManifest;
|
|
82
|
+
readonly truth: AgentFaultGroundTruth;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export interface AgentFaultCorpusManifest {
|
|
86
|
+
readonly schemaVersion: typeof AGENT_FAULT_CORPUS_SCHEMA_VERSION;
|
|
87
|
+
readonly corpusId: string;
|
|
88
|
+
readonly sourceRevision: string;
|
|
89
|
+
readonly harnessRevision: string;
|
|
90
|
+
readonly caseCount: number;
|
|
91
|
+
readonly casesDigest: string;
|
|
92
|
+
readonly mixedFaults: 'out-of-scope';
|
|
93
|
+
readonly detectorInputExcludes: readonly string[];
|
|
94
|
+
}
|
|
95
|
+
export interface AgentFaultCorpus {
|
|
96
|
+
readonly manifest: AgentFaultCorpusManifest;
|
|
97
|
+
readonly cases: readonly AgentFaultCorpusCase[];
|
|
98
|
+
}
|
|
99
|
+
export interface RankedFaultCandidate {
|
|
100
|
+
readonly faultType: AgentRuntimeFaultType;
|
|
101
|
+
readonly boundary: AgentRuntimeBoundary;
|
|
102
|
+
readonly componentId: string;
|
|
103
|
+
readonly spanId: string;
|
|
104
|
+
readonly confidence: number;
|
|
105
|
+
}
|
|
106
|
+
export interface AgentFaultDiagnosis {
|
|
107
|
+
readonly caseId: string;
|
|
108
|
+
readonly status: 'diagnosed' | 'abstained' | 'parse-error';
|
|
109
|
+
readonly candidates: readonly RankedFaultCandidate[];
|
|
110
|
+
readonly signalObserved: boolean;
|
|
111
|
+
readonly latencyMs: number;
|
|
112
|
+
readonly tokens?: number;
|
|
113
|
+
readonly cost?: number;
|
|
114
|
+
readonly reason?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface AgentFaultDetector {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
diagnose(caseId: string, input: AgentFaultDetectorInput): AgentFaultDiagnosis;
|
|
119
|
+
}
|
|
120
|
+
export interface AgentFaultCaseScore {
|
|
121
|
+
readonly caseId: string;
|
|
122
|
+
readonly faultType: AgentRuntimeFaultType;
|
|
123
|
+
readonly boundary: AgentRuntimeBoundary;
|
|
124
|
+
readonly faultInjected: boolean;
|
|
125
|
+
readonly signalObserved: boolean;
|
|
126
|
+
readonly detected: boolean;
|
|
127
|
+
readonly typeCorrect: boolean;
|
|
128
|
+
readonly componentLocalized: boolean;
|
|
129
|
+
readonly spanLocalized: boolean;
|
|
130
|
+
readonly jointCorrect: boolean;
|
|
131
|
+
readonly recovered: boolean;
|
|
132
|
+
readonly taskSucceeded: boolean;
|
|
133
|
+
readonly abstained: boolean;
|
|
134
|
+
}
|
|
135
|
+
export interface AgentFaultSliceScore {
|
|
136
|
+
readonly support: number;
|
|
137
|
+
readonly detected: number;
|
|
138
|
+
readonly typeTop1: number;
|
|
139
|
+
readonly componentTop1: number;
|
|
140
|
+
readonly jointTop1: number;
|
|
141
|
+
readonly abstentions: number;
|
|
142
|
+
}
|
|
143
|
+
export interface AgentFaultScoreReport {
|
|
144
|
+
readonly detectorId: string;
|
|
145
|
+
readonly corpusId: string;
|
|
146
|
+
readonly support: number;
|
|
147
|
+
readonly noFault: {
|
|
148
|
+
readonly precision: number;
|
|
149
|
+
readonly recall: number;
|
|
150
|
+
readonly falsePositiveRate: number;
|
|
151
|
+
};
|
|
152
|
+
readonly faultRecall: number;
|
|
153
|
+
readonly typeTop1: number;
|
|
154
|
+
readonly typeTopK: number;
|
|
155
|
+
readonly componentTop1: number;
|
|
156
|
+
readonly exactSpanTop1: number;
|
|
157
|
+
readonly jointTop1: number;
|
|
158
|
+
readonly parseRate: number;
|
|
159
|
+
readonly abstentionRate: number;
|
|
160
|
+
readonly meanLatencyMs: number;
|
|
161
|
+
readonly totalTokens: number;
|
|
162
|
+
readonly totalCost: number;
|
|
163
|
+
readonly uncertainty: {
|
|
164
|
+
readonly method: 'wilson-95';
|
|
165
|
+
readonly faultRecall: readonly [number, number];
|
|
166
|
+
};
|
|
167
|
+
readonly byFault: Readonly<Record<string, AgentFaultSliceScore>>;
|
|
168
|
+
readonly byBoundary: Readonly<Record<string, AgentFaultSliceScore>>;
|
|
169
|
+
readonly cases: readonly AgentFaultCaseScore[];
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -10,4 +10,5 @@ export { ChaosEngineerService, type ChaosEngineerConfig, } from './services/chao
|
|
|
10
10
|
export { LoadTesterService, type LoadTesterConfig, } from './services/load-tester';
|
|
11
11
|
export { PerformanceProfilerService, type PerformanceProfilerConfig, } from './services/performance-profiler';
|
|
12
12
|
export type { ChaosExperiment, Hypothesis, MetricExpectation, Tolerance, SteadyStateDefinition, SteadyStateProbe, FaultInjection, FaultType, FaultTarget, FaultParameters, BlastRadius, RollbackPlan, RollbackTrigger, RollbackStep, ExperimentSchedule, ExperimentResult, ExperimentStatus, FaultResult, MetricSnapshot, Incident, LoadTest, LoadTestType, LoadTestTarget, LoadProfile, VirtualUserConfig, LoadScenario, LoadStep, LoadAssertion, LoadTestResult, LoadTestSummary, TimelinePoint, LoadTestError, AssertionResult, TrafficSample, SampledRequest, RecoveryTestResult, RecoveryEvent, FailoverTestResult, FailoverStep, CircuitBreakerTestOptions, CircuitBreakerTestResult, RateLimitTestResult, RateLimitResponse, ServiceArchitecture, ServiceDefinition, ServiceDependency, ChaosSuiteReport, LoadTestSuiteReport, PerformanceBottleneck, ResilienceAssessment, ResilienceWeakness, ResilienceRecommendation, ResilienceDashboard, ResilienceIssue, IChaosEngineeringService, ILoadTestingService, IResilienceTestingService, IChaosResilienceCoordinator, IChaosExperimentRepository, IExperimentResultRepository, ILoadTestRepository, ILoadTestResultRepository, ChaosExperimentStartedEvent, ChaosExperimentCompletedEvent, FaultInjectedEvent, LoadTestCompletedEvent, ResilienceIssueDetectedEvent, } from './interfaces';
|
|
13
|
+
export * from './diagnosis/index.js';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -18,4 +18,5 @@ export { ChaosResilienceCoordinator, } from './coordinator.js';
|
|
|
18
18
|
export { ChaosEngineerService, } from './services/chaos-engineer.js';
|
|
19
19
|
export { LoadTesterService, } from './services/load-tester.js';
|
|
20
20
|
export { PerformanceProfilerService, } from './services/performance-profiler.js';
|
|
21
|
+
export * from './diagnosis/index.js';
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/dist/domains/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * as SecurityCompliance from './security-compliance/interfaces';
|
|
|
16
16
|
export * as ContractTesting from './contract-testing/interfaces';
|
|
17
17
|
export * as VisualAccessibility from './visual-accessibility/interfaces';
|
|
18
18
|
export * as ChaosResilience from './chaos-resilience/interfaces';
|
|
19
|
+
export * as AgentFaultDiagnosis from './chaos-resilience/diagnosis/index';
|
|
19
20
|
export * as LearningOptimization from './learning-optimization/interfaces';
|
|
20
21
|
export * as EnterpriseIntegration from './enterprise-integration/interfaces';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/domains/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * as SecurityCompliance from './security-compliance/interfaces.js';
|
|
|
18
18
|
export * as ContractTesting from './contract-testing/interfaces.js';
|
|
19
19
|
export * as VisualAccessibility from './visual-accessibility/interfaces.js';
|
|
20
20
|
export * as ChaosResilience from './chaos-resilience/interfaces.js';
|
|
21
|
+
export * as AgentFaultDiagnosis from './chaos-resilience/diagnosis/index.js';
|
|
21
22
|
export * as LearningOptimization from './learning-optimization/interfaces.js';
|
|
22
23
|
export * as EnterpriseIntegration from './enterprise-integration/interfaces.js';
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This module implements the main controller that orchestrates early exit testing,
|
|
6
6
|
* combining quality signal calculation, decision making, and speculative execution.
|
|
7
7
|
*/
|
|
8
|
-
import { EarlyExitConfig, EarlyExitDecision, TestLayer, TestPyramidResult, LayerResult, SpeculativeResult, QualitySignal, EarlyExitMetrics } from './types';
|
|
8
|
+
import { EarlyExitConfig, EarlyExitDecision, TestLayer, TestPyramidResult, LayerResult, SpeculativeResult, QualitySignal, EarlyExitMetrics, ShadowCalibrationContext } from './types';
|
|
9
9
|
/**
|
|
10
10
|
* Layer executor function type
|
|
11
11
|
*/
|
|
@@ -18,6 +18,7 @@ export interface EarlyExitEvents {
|
|
|
18
18
|
onLayerComplete?: (layer: TestLayer, result: LayerResult, signal: QualitySignal) => void;
|
|
19
19
|
onDecision?: (decision: EarlyExitDecision, layer: number) => void;
|
|
20
20
|
onEarlyExit?: (exitLayer: number, decision: EarlyExitDecision) => void;
|
|
21
|
+
onCandidateExit?: (exitLayer: number, decision: EarlyExitDecision) => void;
|
|
21
22
|
onSpeculationComplete?: (speculations: SpeculativeResult[]) => void;
|
|
22
23
|
onComplete?: (result: TestPyramidResult) => void;
|
|
23
24
|
}
|
|
@@ -71,7 +72,8 @@ export declare class EarlyExitController {
|
|
|
71
72
|
* @param executor - Function to execute a single layer
|
|
72
73
|
* @returns Complete test pyramid result with early exit information
|
|
73
74
|
*/
|
|
74
|
-
runWithEarlyExit(layers: TestLayer[], executor: LayerExecutor): Promise<TestPyramidResult>;
|
|
75
|
+
runWithEarlyExit(layers: TestLayer[], executor: LayerExecutor, calibrationContext?: ShadowCalibrationContext): Promise<TestPyramidResult>;
|
|
76
|
+
private createShadowResult;
|
|
75
77
|
/**
|
|
76
78
|
* Execute a single test layer
|
|
77
79
|
*/
|
|
@@ -6,11 +6,20 @@
|
|
|
6
6
|
* combining quality signal calculation, decision making, and speculative execution.
|
|
7
7
|
*/
|
|
8
8
|
import { DEFAULT_EXIT_CONFIG, } from './types.js';
|
|
9
|
+
import { createHash } from 'node:crypto';
|
|
9
10
|
import { calculateQualitySignal } from './quality-signal.js';
|
|
10
11
|
import { CoherenceEarlyExit } from './early-exit-decision.js';
|
|
11
12
|
import { SpeculativeExecutor } from './speculative-executor.js';
|
|
12
13
|
import { getUnifiedMemory } from '../kernel/unified-memory.js';
|
|
13
14
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
15
|
+
function deepFreeze(value) {
|
|
16
|
+
if (value && typeof value === 'object' && !Object.isFrozen(value)) {
|
|
17
|
+
Object.freeze(value);
|
|
18
|
+
for (const child of Object.values(value))
|
|
19
|
+
deepFreeze(child);
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
14
23
|
// ============================================================================
|
|
15
24
|
// Early Exit Controller Class
|
|
16
25
|
// ============================================================================
|
|
@@ -82,11 +91,12 @@ export class EarlyExitController {
|
|
|
82
91
|
* @param executor - Function to execute a single layer
|
|
83
92
|
* @returns Complete test pyramid result with early exit information
|
|
84
93
|
*/
|
|
85
|
-
async runWithEarlyExit(layers, executor) {
|
|
94
|
+
async runWithEarlyExit(layers, executor, calibrationContext) {
|
|
86
95
|
const startTime = Date.now();
|
|
87
96
|
const results = [];
|
|
88
97
|
let exitDecision = null;
|
|
89
98
|
let previousSignal;
|
|
99
|
+
let shadowCandidate = null;
|
|
90
100
|
// Execute layers until early exit or completion
|
|
91
101
|
for (let i = 0; i < layers.length; i++) {
|
|
92
102
|
const layer = layers[i];
|
|
@@ -107,6 +117,10 @@ export class EarlyExitController {
|
|
|
107
117
|
}
|
|
108
118
|
// Emit layer complete event
|
|
109
119
|
this.events.onLayerComplete?.(layer, layerResult, signal);
|
|
120
|
+
// The first candidate is the pre-registered counterfactual. The full run
|
|
121
|
+
// remains authoritative and later signals cannot rewrite that decision.
|
|
122
|
+
if (shadowCandidate)
|
|
123
|
+
continue;
|
|
110
124
|
// Check for early exit
|
|
111
125
|
exitDecision = this.earlyExit.shouldExit(signal, i);
|
|
112
126
|
// Emit decision event
|
|
@@ -115,23 +129,32 @@ export class EarlyExitController {
|
|
|
115
129
|
this.logDecision(exitDecision, i, signal);
|
|
116
130
|
}
|
|
117
131
|
if (exitDecision.canExit) {
|
|
118
|
-
// Emit early exit event
|
|
119
|
-
this.events.onEarlyExit?.(i, exitDecision);
|
|
120
132
|
// Generate speculative predictions for remaining layers
|
|
121
133
|
const skippedLayers = layers.slice(i + 1);
|
|
122
134
|
let speculations = [];
|
|
123
135
|
if (exitDecision.enableSpeculation && skippedLayers.length > 0) {
|
|
124
136
|
const batch = await this.speculator.speculate(exitDecision, skippedLayers);
|
|
125
137
|
speculations = batch.predictions;
|
|
126
|
-
//
|
|
127
|
-
|
|
138
|
+
// Enforced mode may sample verification layers. Shadow mode executes
|
|
139
|
+
// every remaining layer exactly once below.
|
|
140
|
+
if (this.config.mode === 'enforced' && this.config.verificationLayers > 0) {
|
|
128
141
|
speculations = await this.speculator.verify(speculations, skippedLayers, (verifyLayer) => executor(verifyLayer));
|
|
129
142
|
}
|
|
130
143
|
// Emit speculation complete event
|
|
131
144
|
this.events.onSpeculationComplete?.(speculations);
|
|
132
145
|
}
|
|
133
|
-
const totalDuration = Date.now() - startTime;
|
|
134
146
|
const computeSavings = this.estimateComputeSavings(i, layers);
|
|
147
|
+
if (this.config.mode !== 'enforced') {
|
|
148
|
+
shadowCandidate = {
|
|
149
|
+
layer: i, decision: exitDecision, speculations,
|
|
150
|
+
estimatedSavings: computeSavings, signal,
|
|
151
|
+
};
|
|
152
|
+
this.events.onCandidateExit?.(i, exitDecision);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
// Emit an actual early exit only in explicitly enforced mode.
|
|
156
|
+
this.events.onEarlyExit?.(i, exitDecision);
|
|
157
|
+
const totalDuration = Date.now() - startTime;
|
|
135
158
|
const result = this.createPyramidResult(results, true, i, exitDecision, speculations, skippedLayers.length, totalDuration, computeSavings, signal);
|
|
136
159
|
// Update metrics
|
|
137
160
|
this.updateMetrics(result);
|
|
@@ -143,13 +166,67 @@ export class EarlyExitController {
|
|
|
143
166
|
// Completed all layers without early exit
|
|
144
167
|
const totalDuration = Date.now() - startTime;
|
|
145
168
|
const finalSignal = previousSignal || this.createDefaultSignal();
|
|
146
|
-
const result =
|
|
169
|
+
const result = shadowCandidate
|
|
170
|
+
? this.createShadowResult(results, shadowCandidate, totalDuration, finalSignal, calibrationContext)
|
|
171
|
+
: this.createPyramidResult(results, false, layers.length - 1, exitDecision || this.createDefaultDecision(layers.length - 1), [], 0, totalDuration, 0, finalSignal);
|
|
147
172
|
// Update metrics
|
|
148
173
|
this.updateMetrics(result);
|
|
149
174
|
// Emit complete event
|
|
150
175
|
this.events.onComplete?.(result);
|
|
151
176
|
return result;
|
|
152
177
|
}
|
|
178
|
+
createShadowResult(layers, candidate, totalDuration, finalSignal, context) {
|
|
179
|
+
const contextBound = context !== undefined && Object.values(context).every(value => typeof value === 'string' && value.trim().length > 0);
|
|
180
|
+
const prefixFailed = layers.slice(0, candidate.layer + 1).some(layer => layer.failedTests > 0);
|
|
181
|
+
const speculativeOutcomes = candidate.speculations.map(result => result.predicted);
|
|
182
|
+
const predictedVerdict = prefixFailed || speculativeOutcomes.includes('fail')
|
|
183
|
+
? 'fail'
|
|
184
|
+
: speculativeOutcomes.includes('flaky') ? 'inconclusive' : 'pass';
|
|
185
|
+
const fullRunVerdict = layers.some(layer => layer.failedTests > 0) ? 'fail' : 'pass';
|
|
186
|
+
const firstMissed = layers.slice(candidate.layer + 1).find(layer => layer.failedTests > 0);
|
|
187
|
+
const result = this.createPyramidResult(layers, false, candidate.layer, candidate.decision, candidate.speculations, 0, totalDuration, 0, finalSignal);
|
|
188
|
+
const receiptPayload = {
|
|
189
|
+
evidenceClass: contextBound ? 'EXECUTED' : 'INCONCLUSIVE',
|
|
190
|
+
candidateExitLayer: candidate.layer,
|
|
191
|
+
candidateSignal: {
|
|
192
|
+
lambda: candidate.signal.lambda,
|
|
193
|
+
lambdaPrev: candidate.signal.lambdaPrev,
|
|
194
|
+
boundaryConcentration: candidate.signal.boundaryConcentration,
|
|
195
|
+
flags: candidate.signal.flags,
|
|
196
|
+
timestamp: candidate.signal.timestamp.toISOString(),
|
|
197
|
+
},
|
|
198
|
+
thresholds: {
|
|
199
|
+
minLambdaForExit: this.config.minLambdaForExit,
|
|
200
|
+
minLambdaStability: this.config.minLambdaStability,
|
|
201
|
+
maxBoundaryConcentration: this.config.maxBoundaryConcentration,
|
|
202
|
+
minConfidence: this.config.minConfidence,
|
|
203
|
+
},
|
|
204
|
+
predictedLayers: candidate.speculations.map(prediction => ({
|
|
205
|
+
layerIndex: prediction.layerIndex,
|
|
206
|
+
layerType: prediction.layerType,
|
|
207
|
+
outcome: prediction.predicted,
|
|
208
|
+
confidence: prediction.confidence,
|
|
209
|
+
evidenceClass: 'PREDICTED',
|
|
210
|
+
})),
|
|
211
|
+
predictedVerdict,
|
|
212
|
+
fullRunVerdict,
|
|
213
|
+
falsePass: predictedVerdict === 'pass' && fullRunVerdict === 'fail',
|
|
214
|
+
falseFail: predictedVerdict === 'fail' && fullRunVerdict === 'pass',
|
|
215
|
+
...(firstMissed ? { firstMissedFailure: {
|
|
216
|
+
layerIndex: firstMissed.layerIndex,
|
|
217
|
+
layerType: firstMissed.layerType,
|
|
218
|
+
failedTests: firstMissed.failedTests,
|
|
219
|
+
} } : {}),
|
|
220
|
+
estimatedSavings: candidate.estimatedSavings,
|
|
221
|
+
actualSavings: 0,
|
|
222
|
+
...(contextBound ? { context: { ...context } } : {}),
|
|
223
|
+
};
|
|
224
|
+
result.shadowCalibration = deepFreeze({
|
|
225
|
+
...receiptPayload,
|
|
226
|
+
receiptId: createHash('sha256').update(JSON.stringify(receiptPayload)).digest('hex'),
|
|
227
|
+
});
|
|
228
|
+
return result;
|
|
229
|
+
}
|
|
153
230
|
/**
|
|
154
231
|
* Execute a single test layer
|
|
155
232
|
*/
|
|
@@ -263,6 +340,7 @@ export class EarlyExitController {
|
|
|
263
340
|
speculationAccuracy: 0,
|
|
264
341
|
falsePositiveRate: 0,
|
|
265
342
|
falseNegativeRate: 0,
|
|
343
|
+
shadowCandidateCount: 0,
|
|
266
344
|
};
|
|
267
345
|
}
|
|
268
346
|
/**
|
|
@@ -291,6 +369,16 @@ export class EarlyExitController {
|
|
|
291
369
|
// Update speculation accuracy
|
|
292
370
|
const speculatorStats = this.speculator.getAccuracyStats();
|
|
293
371
|
this.executionMetrics.speculationAccuracy = speculatorStats.accuracy;
|
|
372
|
+
if (result.shadowCalibration) {
|
|
373
|
+
const previousCount = this.executionMetrics.shadowCandidateCount;
|
|
374
|
+
const falsePasses = this.executionMetrics.falsePositiveRate * previousCount
|
|
375
|
+
+ Number(result.shadowCalibration.falsePass);
|
|
376
|
+
const falseFails = this.executionMetrics.falseNegativeRate * previousCount
|
|
377
|
+
+ Number(result.shadowCalibration.falseFail);
|
|
378
|
+
this.executionMetrics.shadowCandidateCount++;
|
|
379
|
+
this.executionMetrics.falsePositiveRate = falsePasses / this.executionMetrics.shadowCandidateCount;
|
|
380
|
+
this.executionMetrics.falseNegativeRate = falseFails / this.executionMetrics.shadowCandidateCount;
|
|
381
|
+
}
|
|
294
382
|
}
|
|
295
383
|
/**
|
|
296
384
|
* Set event handlers
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*
|
|
30
30
|
* @module early-exit
|
|
31
31
|
*/
|
|
32
|
-
export type { TestLayerType, TestLayer, LayerResult, TestResult, QualitySignal, ExitReason, EarlyExitDecision, EarlyExitConfig, PredictedOutcome, SpeculativeResult, SpeculativeBatch, TestPyramidResult, EarlyExitMetrics, } from './types';
|
|
32
|
+
export type { TestLayerType, TestLayer, LayerResult, TestResult, QualitySignal, ExitReason, EarlyExitDecision, EarlyExitConfig, PredictedOutcome, SpeculativeResult, SpeculativeBatch, TestPyramidResult, EarlyExitMetrics, ShadowCalibrationContext, ShadowCalibrationResult, } from './types';
|
|
33
33
|
export { DEFAULT_EXIT_CONFIG, AGGRESSIVE_EXIT_CONFIG, CONSERVATIVE_EXIT_CONFIG, QualityFlags, } from './types';
|
|
34
34
|
export { calculateQualitySignal, calculateLambdaStability, calculateConfidence, countQualityPartitions, createQualitySignal, isStableForExit, } from './quality-signal';
|
|
35
35
|
export { CoherenceEarlyExit, createEarlyExit, createAggressiveEarlyExit, createConservativeEarlyExit, createCustomEarlyExit, } from './early-exit-decision';
|
|
@@ -82,6 +82,7 @@ export class SpeculativeExecutor {
|
|
|
82
82
|
const actualOutcome = this.determineOutcome(actual);
|
|
83
83
|
const verifiedPrediction = {
|
|
84
84
|
...prediction,
|
|
85
|
+
evidenceClass: 'EXECUTED',
|
|
85
86
|
verified: true,
|
|
86
87
|
actual: actualOutcome,
|
|
87
88
|
correct: prediction.predicted === actualOutcome,
|
|
@@ -94,6 +95,7 @@ export class SpeculativeExecutor {
|
|
|
94
95
|
// Verification failed - keep original prediction unverified
|
|
95
96
|
verified.push({
|
|
96
97
|
...prediction,
|
|
98
|
+
evidenceClass: 'INCONCLUSIVE',
|
|
97
99
|
verified: false,
|
|
98
100
|
reasoning: `${prediction.reasoning} (verification failed: ${error instanceof Error ? error.message : 'unknown error'})`,
|
|
99
101
|
});
|
|
@@ -139,6 +141,7 @@ export class SpeculativeExecutor {
|
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
return {
|
|
144
|
+
evidenceClass: 'PREDICTED',
|
|
142
145
|
predicted: predictedOutcome,
|
|
143
146
|
confidence: Math.round(adjustedConfidence * 1000) / 1000,
|
|
144
147
|
verified: false,
|
|
@@ -143,6 +143,8 @@ export interface EarlyExitDecision {
|
|
|
143
143
|
* Configuration for early exit behavior
|
|
144
144
|
*/
|
|
145
145
|
export interface EarlyExitConfig {
|
|
146
|
+
/** Shadow executes all layers; enforced permits a qualified early stop. */
|
|
147
|
+
mode?: 'shadow' | 'enforced';
|
|
146
148
|
/** Target exit layer (0-indexed) - exit after this layer if conditions met */
|
|
147
149
|
exitLayer: number;
|
|
148
150
|
/** Minimum lambda value required for early exit (0-100 scale) */
|
|
@@ -182,6 +184,8 @@ export type PredictedOutcome = 'pass' | 'fail' | 'flaky';
|
|
|
182
184
|
* Result of speculative prediction
|
|
183
185
|
*/
|
|
184
186
|
export interface SpeculativeResult {
|
|
187
|
+
/** Predictions and executions are never interchangeable evidence. */
|
|
188
|
+
evidenceClass: 'PREDICTED' | 'EXECUTED' | 'INCONCLUSIVE';
|
|
185
189
|
/** Predicted outcome */
|
|
186
190
|
predicted: PredictedOutcome;
|
|
187
191
|
/** Confidence in prediction (0-1) */
|
|
@@ -240,6 +244,51 @@ export interface TestPyramidResult {
|
|
|
240
244
|
finalSignal: QualitySignal;
|
|
241
245
|
/** Early exit decision details */
|
|
242
246
|
decision: EarlyExitDecision;
|
|
247
|
+
/** Full-run counterfactual evidence when the controller is calibrating. */
|
|
248
|
+
shadowCalibration?: ShadowCalibrationResult;
|
|
249
|
+
}
|
|
250
|
+
export interface ShadowCalibrationContext {
|
|
251
|
+
revision: string;
|
|
252
|
+
environment: string;
|
|
253
|
+
featureSchemaVersion: string;
|
|
254
|
+
heuristicVersion: string;
|
|
255
|
+
}
|
|
256
|
+
export interface ShadowCalibrationResult {
|
|
257
|
+
receiptId: string;
|
|
258
|
+
evidenceClass: 'EXECUTED' | 'INCONCLUSIVE';
|
|
259
|
+
candidateExitLayer: number;
|
|
260
|
+
candidateSignal: {
|
|
261
|
+
lambda: number;
|
|
262
|
+
lambdaPrev: number;
|
|
263
|
+
boundaryConcentration: number;
|
|
264
|
+
flags: number;
|
|
265
|
+
timestamp: string;
|
|
266
|
+
};
|
|
267
|
+
thresholds: {
|
|
268
|
+
minLambdaForExit: number;
|
|
269
|
+
minLambdaStability: number;
|
|
270
|
+
maxBoundaryConcentration: number;
|
|
271
|
+
minConfidence: number;
|
|
272
|
+
};
|
|
273
|
+
predictedLayers: Array<{
|
|
274
|
+
layerIndex: number;
|
|
275
|
+
layerType: TestLayerType;
|
|
276
|
+
outcome: PredictedOutcome;
|
|
277
|
+
confidence: number;
|
|
278
|
+
evidenceClass: 'PREDICTED';
|
|
279
|
+
}>;
|
|
280
|
+
predictedVerdict: 'pass' | 'fail' | 'inconclusive';
|
|
281
|
+
fullRunVerdict: 'pass' | 'fail';
|
|
282
|
+
falsePass: boolean;
|
|
283
|
+
falseFail: boolean;
|
|
284
|
+
firstMissedFailure?: {
|
|
285
|
+
layerIndex: number;
|
|
286
|
+
layerType: TestLayerType;
|
|
287
|
+
failedTests: number;
|
|
288
|
+
};
|
|
289
|
+
estimatedSavings: number;
|
|
290
|
+
actualSavings: 0;
|
|
291
|
+
context?: ShadowCalibrationContext;
|
|
243
292
|
}
|
|
244
293
|
/**
|
|
245
294
|
* Metrics for early exit system performance
|
|
@@ -267,5 +316,7 @@ export interface EarlyExitMetrics {
|
|
|
267
316
|
falsePositiveRate: number;
|
|
268
317
|
/** False negative rate (didn't exit when should have) */
|
|
269
318
|
falseNegativeRate: number;
|
|
319
|
+
/** Candidate exits observed while full execution remained authoritative. */
|
|
320
|
+
shadowCandidateCount: number;
|
|
270
321
|
}
|
|
271
322
|
//# sourceMappingURL=types.d.ts.map
|