agentic-qe 3.15.12 → 3.15.14
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 +124 -5
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +196 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-23KA2YW7.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-5VZCKTIJ.js → agent-booster-wasm-2DLAEZK6.js} +2 -2
- package/dist/cli/chunks/{agent-handler-K3C6CQCD.js → agent-handler-P3IY7XEE.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-NVFQ25WS.js → agent-memory-branch-WWKC2H3G.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-MUICAXW5.js +2 -0
- package/dist/cli/chunks/{arena-TSZVDSXS.js → arena-4BMFF6BS.js} +4 -4
- package/dist/cli/chunks/{arena-QGWIJADQ.js → arena-EIV5OALF.js} +2 -2
- package/dist/cli/chunks/{audit-KIEE2SHJ.js → audit-DNTI453H.js} +3 -3
- package/dist/cli/chunks/base-XPWGYDKD.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-BNB32NW3.js → better-sqlite3-TQBQGNC6.js} +2 -2
- package/dist/cli/chunks/brain-handler-HY57CNAO.js +95 -0
- package/dist/cli/chunks/{branch-enumerator-LZ7UXKAY.js → branch-enumerator-THPMZPHQ.js} +2 -2
- package/dist/cli/chunks/{browser-VDHAW4RK.js → browser-O6JJOZCK.js} +2 -2
- package/dist/cli/chunks/browser-workflow-UMQVBVGK.js +2 -0
- package/dist/cli/chunks/{chunk-4PU5GTZW.js → chunk-2HPNGK7A.js} +2 -2
- package/dist/cli/chunks/{chunk-MCPXNUDK.js → chunk-2IJO3657.js} +2 -2
- package/dist/cli/chunks/{chunk-4Y6OEBJZ.js → chunk-2QLE6NDW.js} +1 -1
- package/dist/cli/chunks/{chunk-DZGPUGUG.js → chunk-2UZBLC5H.js} +2 -2
- package/dist/cli/chunks/{chunk-5A66EGEW.js → chunk-2W5MQDHM.js} +2 -2
- package/dist/cli/chunks/{chunk-JRYWLOBD.js → chunk-3FITMWWJ.js} +2 -2
- package/dist/cli/chunks/{chunk-RCOLPF3B.js → chunk-3TF27MG5.js} +2 -2
- package/dist/cli/chunks/{chunk-KGA7VAI4.js → chunk-3XACRXBY.js} +2 -2
- package/dist/cli/chunks/{chunk-SQVZ3TRU.js → chunk-43XHGWYH.js} +2 -2
- package/dist/cli/chunks/{chunk-JR6CUKAI.js → chunk-4RPBODN5.js} +2 -2
- package/dist/cli/chunks/{chunk-C3YOVASQ.js → chunk-4T7XV5KQ.js} +1 -1
- package/dist/cli/chunks/{chunk-N7O3PF6Y.js → chunk-4WLIOPHX.js} +2 -2
- package/dist/cli/chunks/{chunk-PGSJBXTD.js → chunk-52KOPIMI.js} +2 -2
- package/dist/cli/chunks/{chunk-4KUOYDY2.js → chunk-56NSE3LJ.js} +2 -2
- package/dist/cli/chunks/{chunk-3IU4LDZR.js → chunk-57DRT6UA.js} +2 -2
- package/dist/cli/chunks/{chunk-2JYUA27M.js → chunk-57FX3GP6.js} +1 -1
- package/dist/cli/chunks/{chunk-7QEUHNKO.js → chunk-5PLBQZ5J.js} +1 -1
- package/dist/cli/chunks/{chunk-VF7FTD64.js → chunk-5Y7UFHJD.js} +1 -1
- package/dist/cli/chunks/{chunk-7JFDLL2F.js → chunk-5Z4MO2F3.js} +1 -1
- package/dist/cli/chunks/chunk-65EE2EST.js +8 -0
- package/dist/cli/chunks/{chunk-66PXR3NI.js → chunk-6NIGSY5L.js} +2 -2
- package/dist/cli/chunks/chunk-6O63ZTVX.js +3 -0
- package/dist/cli/chunks/{chunk-ZYOYR3UR.js → chunk-6OI5SK7M.js} +1 -1
- package/dist/cli/chunks/{chunk-5TAEW5OV.js → chunk-6P4Q4RTC.js} +1 -1
- package/dist/cli/chunks/{chunk-W5HQIYQU.js → chunk-7724KXM2.js} +3 -3
- package/dist/cli/chunks/{chunk-A2JCRXTK.js → chunk-7MISCSL5.js} +2 -2
- package/dist/cli/chunks/{chunk-OHVYINGM.js → chunk-7MUO4DEH.js} +3 -3
- package/dist/cli/chunks/{chunk-QCPVUNN3.js → chunk-7QUSNBAA.js} +2 -2
- package/dist/cli/chunks/{chunk-YUA6ZKKY.js → chunk-7SQTLUEN.js} +2 -2
- package/dist/cli/chunks/{chunk-CA5UNWQF.js → chunk-7T6L3LFN.js} +2 -2
- package/dist/cli/chunks/{chunk-UREDS662.js → chunk-7TH4PJSU.js} +2 -2
- package/dist/cli/chunks/{chunk-TVA5GRIU.js → chunk-7Y3LXH57.js} +2 -2
- package/dist/cli/chunks/{chunk-A5Y7DAVQ.js → chunk-A2T56XVL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZROAMFX2.js → chunk-AJVLVF7V.js} +2 -2
- package/dist/cli/chunks/{chunk-26672ISV.js → chunk-ARRBXCII.js} +2 -2
- package/dist/cli/chunks/{chunk-5S4UIDFK.js → chunk-AYLEH2UF.js} +1 -1
- package/dist/cli/chunks/{chunk-DRCBRUGN.js → chunk-BBYJBZHG.js} +2 -2
- package/dist/cli/chunks/{chunk-BMG2JLSQ.js → chunk-BM3EJLMV.js} +2 -2
- package/dist/cli/chunks/{chunk-6QRI3JVE.js → chunk-BNG4J3CE.js} +2 -2
- package/dist/cli/chunks/{chunk-EN7GRVEQ.js → chunk-BPDAQB3F.js} +2 -2
- package/dist/cli/chunks/{chunk-J7Y7ZBIT.js → chunk-BQJ7CV53.js} +9 -9
- package/dist/cli/chunks/{chunk-ADUAJIAU.js → chunk-C3OIBFAA.js} +2 -2
- package/dist/cli/chunks/{chunk-4LWMAAWK.js → chunk-CAZM63TP.js} +2 -2
- package/dist/cli/chunks/{chunk-UZED4YZ5.js → chunk-CIINJHOX.js} +1 -1
- package/dist/cli/chunks/{chunk-C74M4WUI.js → chunk-CPPYZYXC.js} +2 -2
- package/dist/cli/chunks/chunk-D3ZZ2NLL.js +62 -0
- package/dist/cli/chunks/{chunk-U7ZHDGXG.js → chunk-D5GB5PUU.js} +1 -1
- package/dist/cli/chunks/{chunk-HZBXJFGN.js → chunk-DLTB5KCR.js} +2 -2
- package/dist/cli/chunks/{chunk-NNBQZR73.js → chunk-DRLSJJIC.js} +2 -2
- package/dist/cli/chunks/{chunk-HLGFHHWV.js → chunk-DSQESXL4.js} +2 -2
- package/dist/cli/chunks/{chunk-LFBA735S.js → chunk-E2JLAW3U.js} +3 -3
- package/dist/cli/chunks/{chunk-PT2NXS43.js → chunk-E3QIQMMN.js} +1 -1
- package/dist/cli/chunks/{chunk-35MIUSXQ.js → chunk-E7OR6V3V.js} +2 -2
- package/dist/cli/chunks/{chunk-G24SWTAX.js → chunk-E7QTWGPI.js} +413 -413
- package/dist/cli/chunks/{chunk-PX5OPXY6.js → chunk-EC65UZ77.js} +1 -1
- package/dist/cli/chunks/{chunk-JNXK47OL.js → chunk-EIEEST4T.js} +2 -2
- package/dist/cli/chunks/{chunk-2PPSS4JD.js → chunk-FHPNWHY7.js} +2 -2
- package/dist/cli/chunks/{chunk-PTBOLBM4.js → chunk-FJOIBZUB.js} +2 -2
- package/dist/cli/chunks/{chunk-TXEUVUMO.js → chunk-FTYRPEJS.js} +1 -1
- package/dist/cli/chunks/{chunk-ZPVGX4DI.js → chunk-G7HGUQAE.js} +2 -2
- package/dist/cli/chunks/{chunk-EF6OERRR.js → chunk-GY4P7KAI.js} +1 -1
- package/dist/cli/chunks/{chunk-UUZZXHUF.js → chunk-H3C5FJRH.js} +2 -2
- package/dist/cli/chunks/{chunk-L3PV7VXK.js → chunk-H4LYXLAT.js} +1 -1
- package/dist/cli/chunks/{chunk-5Z23ZMXZ.js → chunk-HAYKLXCT.js} +63 -61
- package/dist/cli/chunks/{chunk-IPA7K556.js → chunk-HEDGFKC5.js} +2 -2
- package/dist/cli/chunks/{chunk-BC4T6SCV.js → chunk-HHBF2BZC.js} +4 -4
- package/dist/cli/chunks/{chunk-IVTQF55W.js → chunk-HSDWPQQY.js} +3 -3
- package/dist/cli/chunks/{chunk-SG2TX72G.js → chunk-HTVGHHX2.js} +2 -2
- package/dist/cli/chunks/{chunk-FZJCBSN4.js → chunk-HV43NX4A.js} +2 -2
- package/dist/cli/chunks/{chunk-MMEALJ4D.js → chunk-IDBA5GK2.js} +2 -2
- package/dist/cli/chunks/{chunk-IA55PFLG.js → chunk-INGXD5IX.js} +2 -2
- package/dist/cli/chunks/{chunk-RYHG3I7J.js → chunk-IQRPR4KB.js} +2 -2
- package/dist/cli/chunks/{chunk-7OEFBWAG.js → chunk-IRPNEXOU.js} +2 -2
- package/dist/cli/chunks/{chunk-P7UFJ6DO.js → chunk-J35JWDJE.js} +1 -1
- package/dist/cli/chunks/chunk-J6ASX536.js +2 -0
- package/dist/cli/chunks/{chunk-2ASQRBK2.js → chunk-JAOCHPYX.js} +2 -2
- package/dist/cli/chunks/{chunk-G3AABG4Q.js → chunk-JB7R77SH.js} +2 -2
- package/dist/cli/chunks/{chunk-HSA5IGGW.js → chunk-JI67T6Q2.js} +2 -2
- package/dist/cli/chunks/{chunk-ZGROHCOW.js → chunk-JJHLGGPP.js} +1 -1
- package/dist/cli/chunks/{chunk-L7NGKANW.js → chunk-JK6PMLQQ.js} +2 -2
- package/dist/cli/chunks/{chunk-IL7GQNNE.js → chunk-JO26SG47.js} +2 -2
- package/dist/cli/chunks/{chunk-3EWQN37E.js → chunk-JSSU4RIK.js} +2 -2
- package/dist/cli/chunks/{chunk-TOWOJGEI.js → chunk-K2SMP4OD.js} +1 -1
- package/dist/cli/chunks/{chunk-YVJEUX3I.js → chunk-K7GFYFBO.js} +2 -2
- package/dist/cli/chunks/{chunk-DAUEK66C.js → chunk-K7RT6ITZ.js} +1 -1
- package/dist/cli/chunks/{chunk-33I2ZP6E.js → chunk-KJ5A54ZH.js} +2 -2
- package/dist/cli/chunks/{chunk-W4II6SIH.js → chunk-L5VSLPMW.js} +2 -2
- package/dist/cli/chunks/{chunk-NVRYELCY.js → chunk-L752CNG3.js} +3 -3
- package/dist/cli/chunks/{chunk-MAJXZYGK.js → chunk-L7PC675Y.js} +1 -1
- package/dist/cli/chunks/{chunk-YWWMNTBF.js → chunk-LTGQJYYO.js} +2 -2
- package/dist/cli/chunks/{chunk-7DNR4KKR.js → chunk-M2TG7VDK.js} +1 -1
- package/dist/cli/chunks/{chunk-2E2QO44T.js → chunk-M5JEA6ZY.js} +2 -2
- package/dist/cli/chunks/{chunk-IETBWYHW.js → chunk-MB4UKUBV.js} +2 -2
- package/dist/cli/chunks/{chunk-W7H55PY4.js → chunk-MKYOE7NE.js} +1 -1
- package/dist/cli/chunks/{chunk-FNUFTWEO.js → chunk-MQXWG55U.js} +3 -3
- package/dist/cli/chunks/{chunk-O4QJMANM.js → chunk-MR2OPUSA.js} +1 -1
- package/dist/cli/chunks/{chunk-KA5SHLMW.js → chunk-N736GLWZ.js} +2 -2
- package/dist/cli/chunks/{chunk-NV74SICL.js → chunk-NHEG2DLN.js} +2 -2
- package/dist/cli/chunks/chunk-NKOLILT7.js +86 -0
- package/dist/cli/chunks/{chunk-KJDI5CHX.js → chunk-NPCXGX7N.js} +2 -2
- package/dist/cli/chunks/{chunk-2IVE5AR3.js → chunk-NZQYJCO6.js} +1 -1
- package/dist/cli/chunks/{chunk-4SA7M34P.js → chunk-O2AAYJUV.js} +1 -1
- package/dist/cli/chunks/{chunk-ULCW6IVQ.js → chunk-O32BFQV4.js} +2 -2
- package/dist/cli/chunks/{chunk-JOWUS2X5.js → chunk-O3ERGUXH.js} +1 -1
- package/dist/cli/chunks/{chunk-BYRCB5JT.js → chunk-O5CEL447.js} +2 -2
- package/dist/cli/chunks/{chunk-CPIBIR3X.js → chunk-O756AOUX.js} +2 -2
- package/dist/cli/chunks/{chunk-TSOQ2QLT.js → chunk-OCN53CCK.js} +2 -2
- package/dist/cli/chunks/{chunk-YLKIXEPP.js → chunk-OGEIHS76.js} +1 -1
- package/dist/cli/chunks/{chunk-ICKUINKD.js → chunk-OLUOVNUF.js} +2 -2
- package/dist/cli/chunks/{chunk-5ADXFUMO.js → chunk-P2TPH3TC.js} +2 -2
- package/dist/cli/chunks/{chunk-SBHM5X2S.js → chunk-PCQZIAXB.js} +2 -2
- package/dist/cli/chunks/{chunk-CDA5Z74H.js → chunk-PGN4TARY.js} +2 -2
- package/dist/cli/chunks/{chunk-P5E26N2X.js → chunk-PNRPVQGI.js} +2 -2
- package/dist/cli/chunks/{chunk-23PQF7NN.js → chunk-PWQWKYBG.js} +1 -1
- package/dist/cli/chunks/{chunk-T4EN5VVK.js → chunk-QNQE3EOH.js} +2 -2
- package/dist/cli/chunks/chunk-QP2HLKTS.js +2 -0
- package/dist/cli/chunks/{chunk-7TA5MUPW.js → chunk-QP6GL3O5.js} +1 -1
- package/dist/cli/chunks/{chunk-GKFV6CUD.js → chunk-QUZ745UQ.js} +2 -2
- package/dist/cli/chunks/{chunk-INZARYUD.js → chunk-R5RRWLRI.js} +2 -2
- package/dist/cli/chunks/{chunk-VZBC6DP7.js → chunk-RE6JTSDM.js} +1 -1
- package/dist/cli/chunks/{chunk-JGIJPDGD.js → chunk-TOJF3ZG4.js} +2 -2
- package/dist/cli/chunks/{chunk-WLRU6ESI.js → chunk-TSP6SU5V.js} +2 -2
- package/dist/cli/chunks/{chunk-6E6HB4N4.js → chunk-TW6Z6W4X.js} +4 -4
- package/dist/cli/chunks/{chunk-ENGL7FIJ.js → chunk-TWOV3I3A.js} +1 -1
- package/dist/cli/chunks/chunk-U4TML2VD.js +3 -0
- package/dist/cli/chunks/{chunk-O3IM4WRZ.js → chunk-U6IOQKCT.js} +2 -2
- package/dist/cli/chunks/{chunk-SPC4RBLF.js → chunk-UDSB3XCG.js} +2 -2
- package/dist/cli/chunks/{chunk-URSTP3WI.js → chunk-UFP7SN5V.js} +2 -2
- package/dist/cli/chunks/{chunk-MYF5CNGV.js → chunk-UMHFTQTR.js} +2 -2
- package/dist/cli/chunks/{chunk-65TH6RPD.js → chunk-UNYTHZDZ.js} +1 -1
- package/dist/cli/chunks/{chunk-FAGKBOX2.js → chunk-UPWLMIDY.js} +2 -2
- package/dist/cli/chunks/{chunk-4CB3QPZM.js → chunk-USAKCGHC.js} +2 -2
- package/dist/cli/chunks/{chunk-QUJJYTJH.js → chunk-V3MGY76S.js} +2 -2
- package/dist/cli/chunks/{chunk-WDEXOLK2.js → chunk-V6SE2ZU2.js} +1 -1
- package/dist/cli/chunks/{chunk-JW5PDJ5O.js → chunk-VCVRZD4Y.js} +3 -3
- package/dist/cli/chunks/{chunk-TGMXUZZC.js → chunk-VG32EEUG.js} +2 -2
- package/dist/cli/chunks/{chunk-MYUMJ2ZI.js → chunk-VGZOPQQY.js} +1 -1
- package/dist/cli/chunks/{chunk-BOSMELJX.js → chunk-VJBJRFUO.js} +2 -2
- package/dist/cli/chunks/{chunk-K3A3NWT3.js → chunk-WBC6WB32.js} +2 -2
- package/dist/cli/chunks/{chunk-QWG3SILX.js → chunk-WCM6WE7G.js} +5 -5
- package/dist/cli/chunks/{chunk-GJKZ7UQO.js → chunk-WCPSR4MJ.js} +2 -2
- package/dist/cli/chunks/{chunk-U6IXYQO4.js → chunk-WKI46WWN.js} +2 -2
- package/dist/cli/chunks/{chunk-NX4BCSOZ.js → chunk-WM2QRIRD.js} +2 -2
- package/dist/cli/chunks/{chunk-32UTHIY5.js → chunk-WRC3HLUY.js} +3 -3
- package/dist/cli/chunks/{chunk-AJEXPFAB.js → chunk-WUGXXNK4.js} +1 -1
- package/dist/cli/chunks/{chunk-NA3F6FEO.js → chunk-WZQADC5R.js} +2 -2
- package/dist/cli/chunks/{chunk-SDRJJUPO.js → chunk-X6NJOT3V.js} +1 -1
- package/dist/cli/chunks/{chunk-CU36D7TN.js → chunk-X6Q2N5S5.js} +2 -2
- package/dist/cli/chunks/{chunk-UIKQPO4Y.js → chunk-X7CUI7KH.js} +2 -2
- package/dist/cli/chunks/{chunk-MCPEC6OO.js → chunk-XMCSKYDE.js} +1 -1
- package/dist/cli/chunks/{chunk-WTAUF6O4.js → chunk-XN3KCKAM.js} +2 -2
- package/dist/cli/chunks/{chunk-TLRHAMX5.js → chunk-XSPMLJCQ.js} +1 -1
- package/dist/cli/chunks/{chunk-VUR5THML.js → chunk-XTZGAG6P.js} +2 -2
- package/dist/cli/chunks/{chunk-47RMGDG4.js → chunk-YE54T2NQ.js} +2 -2
- package/dist/cli/chunks/{chunk-HM3LSFTY.js → chunk-YEFTK4HD.js} +2 -2
- package/dist/cli/chunks/{chunk-4HWUECVD.js → chunk-YGC5QKQ4.js} +2 -2
- package/dist/cli/chunks/{chunk-SUX5XB2Z.js → chunk-YGOSSVY5.js} +2 -2
- package/dist/cli/chunks/{chunk-UJNGGFGX.js → chunk-YKQWIXUY.js} +2 -2
- package/dist/cli/chunks/{chunk-SITL5YZV.js → chunk-Z2S7DNFP.js} +2 -2
- package/dist/cli/chunks/{chunk-WGTEZT7G.js → chunk-Z54G2YOL.js} +2 -2
- package/dist/cli/chunks/{chunk-YNVEDFPQ.js → chunk-ZJGFQK27.js} +1 -1
- package/dist/cli/chunks/{chunk-35NW676P.js → chunk-ZUE524JL.js} +2 -2
- package/dist/cli/chunks/{ci-BZNWW3I3.js → ci-UMA2SMNW.js} +2 -2
- package/dist/cli/chunks/{ci-config-LOHNXOKV.js → ci-config-UQSILJFQ.js} +2 -2
- package/dist/cli/chunks/{ci-output-LCOQBSJL.js → ci-output-U6YZLLKH.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-7LRXTLFE.js → circuit-breaker-ATYQP6X2.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-HBU4VWC3.js → claude-flow-setup-6YHFD7AN.js} +2 -2
- package/dist/cli/chunks/client-E43GWLQH.js +2 -0
- package/dist/cli/chunks/{cline-installer-CO6MLH6X.js → cline-installer-EPE7IOZE.js} +2 -2
- package/dist/cli/chunks/{code-SIXBS6JM.js → code-NUEJ4XYO.js} +19 -18
- package/dist/cli/chunks/{code-index-extractor-GWJKZ2IQ.js → code-index-extractor-D4DBT6OL.js} +2 -2
- package/dist/cli/chunks/{codex-installer-6NINVWXJ.js → codex-installer-633SM4LR.js} +2 -2
- package/dist/cli/chunks/{completions-7VIX3GML.js → completions-WUKVIW3L.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-FBQR6ZP2.js → complexity-analyzer-F73ACR5H.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-VA7RIXW5.js → continuedev-installer-QH42TKMS.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-4QEBC4MU.js → copilot-installer-Y3XC7BTT.js} +2 -2
- package/dist/cli/chunks/core-handlers-R5A3SQDY.js +2 -0
- package/dist/cli/chunks/{cost-tracker-GRYKHPWL.js → cost-tracker-57QPV7E3.js} +2 -2
- package/dist/cli/chunks/coverage-IBCHMBCR.js +51 -0
- package/dist/cli/chunks/cross-domain-router-LLYVPZF6.js +2 -0
- package/dist/cli/chunks/{cursor-installer-ZXIPSZVH.js → cursor-installer-F4UYQHIN.js} +2 -2
- package/dist/cli/chunks/{daemon-N2VRHPSJ.js → daemon-BYYPIJ7G.js} +4 -4
- package/dist/cli/chunks/{daemon-D7F3RGI5.js → daemon-XR4Q6YZF.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-NL6BA7BY.js → dag-attention-scheduler-ZR5ZD3TW.js} +2 -2
- package/dist/cli/chunks/{detect-XC2HCIIT.js → detect-GEGYURLL.js} +2 -2
- package/dist/cli/chunks/{dist-node-A3Y26MEI.js → dist-node-JU3KT2JO.js} +2 -2
- package/dist/cli/chunks/{domain-handler-WV6SFXRB.js → domain-handler-7QI3FJGE.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-KJIF6Z2B.js → domain-plugins-O2YRM2PD.js} +2 -2
- package/dist/cli/chunks/domain-transfer-7J3S2OS6.js +2 -0
- package/dist/cli/chunks/dream-6C4NURSE.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-PA3Y4KGO.js → embed-and-insert-pattern-URES5Q6J.js} +2 -2
- package/dist/cli/chunks/{eval-YGEZNUVE.js → eval-RVMCIUOR.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-D4T7NW6B.js → experience-capture-middleware-SYJQSBKE.js} +3 -3
- package/dist/cli/chunks/{fast-paths-6JYK7RYQ.js → fast-paths-QUKPKWKZ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-DKXMDVPE.js → feature-flags-5JCSKL2P.js} +2 -2
- package/dist/cli/chunks/{feature-flags-RBH2GDSR.js → feature-flags-K7JXNKJI.js} +2 -2
- package/dist/cli/chunks/file-discovery-J5IE5KP7.js +2 -0
- package/dist/cli/chunks/fleet-II4Q6HXK.js +44 -0
- package/dist/cli/chunks/{gnn-wrapper-MV54UC4C.js → gnn-wrapper-M7VO2EMS.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-7DKMVQQH.js → heartbeat-handler-ND5CY26N.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-FC5PBTMN.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-47UIVOBG.js +2 -0
- package/dist/cli/chunks/hnsw-index-3AKVLOZQ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-6IWREDQC.js → hnsw-legacy-bridge-N3AUUUU7.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-5BIESSCK.js → hnswlib-node-NZY3E5EN.js} +2 -2
- package/dist/cli/chunks/{hooks-3EETRM62.js → hooks-QVJDTII5.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-YAOSNX47.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-RSWCB2D3.js → hypergraph-engine-ZRY6MTDV.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-552LXKL3.js → hypergraph-handler-56DO4XZQ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-4FMJXM4M.js +2 -0
- package/dist/cli/chunks/{init-guard-OTDBJ5HD.js → init-guard-DTF4EVUY.js} +2 -2
- package/dist/cli/chunks/{init-handler-3FK3TKEA.js → init-handler-M6CNQHMX.js} +6 -6
- package/dist/cli/chunks/init-wizard-RTLCRWDT.js +2 -0
- package/dist/cli/chunks/kernel-2OWIGGGT.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-KZ2O4LF3.js → kilocode-installer-IJN7XKBH.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-MLCCXRF7.js → kiro-installer-UKKPGPDC.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-25XXKDJN.js +2 -0
- package/dist/cli/chunks/learning-W2HETWQ4.js +131 -0
- package/dist/cli/chunks/{llm-router-PDEV3UP2.js → llm-router-Y546K4VX.js} +4 -4
- package/dist/cli/chunks/llm-router-service-G3EIN4UB.js +2 -0
- package/dist/cli/chunks/{load-XFVVLO7E.js → load-MKAB2AXE.js} +2 -2
- package/dist/cli/chunks/load-test-D6QYNIVT.js +2 -0
- package/dist/cli/chunks/{mcp-74G3CL2S.js → mcp-AZKUS6K3.js} +2 -2
- package/dist/cli/chunks/{memory-XIFM6JNX.js → memory-ZDOQN2KU.js} +5 -5
- package/dist/cli/chunks/memory-backend-LDFFZMEQ.js +2 -0
- package/dist/cli/chunks/{memory-handlers-ZCKURV6S.js → memory-handlers-3SQVY7FE.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-7L4W3O2Q.js → multi-model-executor-WWVXDHG4.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-BPG422LF.js → opencode-installer-YUJNXXWS.js} +2 -2
- package/dist/cli/chunks/{orchestrator-OEAFLAEV.js → orchestrator-Z6PWPLRE.js} +109 -25
- package/dist/cli/chunks/pattern-null-store-KDVRM7PW.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-LOPNCULT.js → pattern-usage-recorder-TPWPX32U.js} +2 -2
- package/dist/cli/chunks/{pipeline-VWTYUZB7.js → pipeline-4BBGTE4M.js} +2 -2
- package/dist/cli/chunks/{platform-WFJJ3X2E.js → platform-5GSHXCV5.js} +2 -2
- package/dist/cli/chunks/{plugin-744TPUSG.js → plugin-OFDVF5HS.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-BD5BLNDR.js → prime-radiant-advanced-wasm-NC6MUYGJ.js} +2 -2
- package/dist/cli/chunks/project-root-DDGBWDP6.js +2 -0
- package/dist/cli/chunks/protocol-executor-KBOLLCWA.js +2 -0
- package/dist/cli/chunks/{protocol-handler-JIBILI74.js → protocol-handler-MPOAAEPA.js} +2 -2
- package/dist/cli/chunks/{prove-MNOL5FYW.js → prove-CDKMAIVM.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-GRXBT7FC.js +2 -0
- package/dist/cli/chunks/{quality-JEGBDGGX.js → quality-ZH4F7R7R.js} +2 -2
- package/dist/cli/chunks/{quality-gate-SYJ6ROMI.js → quality-gate-IDRMW6OE.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-L2QWMJ5Q.js +2 -0
- package/dist/cli/chunks/{real-embeddings-ZWXS5ZFV.js → real-embeddings-I2UVNNB3.js} +2 -2
- package/dist/cli/chunks/{ref-validation-RRHUFW2N.js → ref-validation-Z5GCGVXK.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-XFO6JSVN.js → roocode-installer-IZ2S7PH2.js} +2 -2
- package/dist/cli/chunks/router-FT5WJPUH.js +2 -0
- package/dist/cli/chunks/routing-feedback-EO2MKOUX.js +2 -0
- package/dist/cli/chunks/{routing-handler-L2K3JASE.js → routing-handler-NAX35VUW.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-A6CINHGM.js → ruvector-commands-5YW2SOFF.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-WHBFQJVU.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-YT3APF2I.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-T4RY7L53.js → rvf-migration-coordinator-VUIZHTVG.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-37PUFKQD.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-IR33TGQS.js → rvf-store-integrity-IPGCAT6C.js} +2 -2
- package/dist/cli/chunks/safe-db-TDZKUOZJ.js +2 -0
- package/dist/cli/chunks/schedule-CRKTRY2A.js +2 -0
- package/dist/cli/chunks/scheduler-6ZBDVQWN.js +2 -0
- package/dist/cli/chunks/{security-Z5GDE2IH.js → security-3IH4BO5Z.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-SIZMEHPM.js → shared-rvf-adapter-ABY7PAY2.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-HLM65RDS.js → shared-rvf-dual-writer-6KENLN2W.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-FFJQAIKW.js +2 -0
- package/dist/cli/chunks/{standalone-memory-SKSZG7P5.js → standalone-memory-RLFAUGOW.js} +2 -2
- package/dist/cli/chunks/{status-handler-766YOOMJ.js → status-handler-FCOZBPE5.js} +2 -2
- package/dist/cli/chunks/{structural-health-M45FNOLT.js → structural-health-4RDA5UUM.js} +2 -2
- package/dist/cli/chunks/{sync-B2U366I3.js → sync-54LUAUTK.js} +2 -2
- package/dist/cli/chunks/{sync-6CJ24B5T.js → sync-KGEEXXCC.js} +2 -2
- package/dist/cli/chunks/task-handler-K3OXHYKU.js +62 -0
- package/dist/cli/chunks/task-handlers-6H7L2UT4.js +9 -0
- package/dist/cli/chunks/{test-TODH7KRF.js → test-S7IG6EIX.js} +4 -4
- package/dist/cli/chunks/test-runner-process-OTQDAJLN.js +2 -0
- package/dist/cli/chunks/{test-scheduling-VMVMVRHT.js → test-scheduling-7XYXI4L2.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-XQW7BMCK.js → token-bootstrap-3QMABE45.js} +2 -2
- package/dist/cli/chunks/{token-usage-JCZEIRKO.js → token-usage-Y2YTPOFE.js} +2 -2
- package/dist/cli/chunks/{transformers-U2ML3OHE.js → transformers-UCJ3HHHC.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-D6JTTHTP.js +2 -0
- package/dist/cli/chunks/{types-GGEPCHP6.js → types-6CMFPETH.js} +2 -2
- package/dist/cli/chunks/unified-memory-QARWQKJ2.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-LHY3DXCP.js +2 -0
- package/dist/cli/chunks/unified-persistence-WEYYGLHM.js +2 -0
- package/dist/cli/chunks/{upgrade-T5GRM7HS.js → upgrade-K25DN6WU.js} +2 -2
- package/dist/cli/chunks/{validate-XMUJPLP3.js → validate-T4V3TBY3.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-KJLF7JEH.js → validate-swarm-XSRC576T.js} +2 -2
- package/dist/cli/chunks/visual-security-O4ALMCXQ.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-LOHVZ7G5.js → web-tree-sitter-YOZXHRTN.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-33FBTXJU.js → windsurf-installer-ITPU2IYL.js} +2 -2
- package/dist/cli/chunks/witness-chain-B3YW5NMS.js +2 -0
- package/dist/cli/chunks/witness-chain-PIYR72HJ.js +2 -0
- package/dist/cli/chunks/{witness-chain-repair-VWBO4NXE.js → witness-chain-repair-YUG7E3UX.js} +2 -2
- package/dist/cli/chunks/{witness-chain-verifier-BHJ3ZAEK.js → witness-chain-verifier-DTDSVKOG.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-WNVPH2Z3.js → witness-key-manager-EWACWGAW.js} +2 -2
- package/dist/cli/chunks/{workflow-6QR5MQTO.js → workflow-ZIQ4FV42.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-3ZN2BCGY.js +2 -0
- package/dist/cli/chunks/{wrappers-EHOL62TS.js → wrappers-PW2O27LL.js} +2 -2
- package/dist/cli/commands/code.js +6 -0
- package/dist/cli/commands/coverage.js +6 -0
- package/dist/cli/commands/fleet-run.d.ts +12 -0
- package/dist/cli/commands/fleet-run.js +175 -0
- package/dist/cli/commands/fleet.js +2 -117
- package/dist/cli/commands/learning-prune.d.ts +14 -0
- package/dist/cli/commands/learning-prune.js +105 -0
- package/dist/cli/commands/learning.js +9 -0
- package/dist/cli/handlers/brain-handler.js +12 -1
- package/dist/cli/handlers/task-handler.d.ts +5 -0
- package/dist/cli/handlers/task-handler.js +20 -0
- package/dist/cli/utils/coverage-verdict.js +14 -3
- package/dist/cli/utils/fleet-operation.d.ts +5 -2
- package/dist/cli/utils/fleet-operation.js +13 -2
- package/dist/cli/utils/fleet-result.d.ts +16 -2
- package/dist/cli/utils/fleet-result.js +26 -21
- package/dist/cli/utils/fleet-shard.d.ts +36 -0
- package/dist/cli/utils/fleet-shard.js +110 -0
- package/dist/context/compaction/index.d.ts +7 -0
- package/dist/context/compaction/index.js +30 -6
- package/dist/coordination/handlers/code-intelligence-handlers.js +21 -1
- package/dist/coordination/handlers/coverage-evidence.d.ts +19 -0
- package/dist/coordination/handlers/coverage-evidence.js +31 -2
- package/dist/coordination/handlers/coverage-handlers.js +5 -1
- package/dist/coordination/handlers/coverage-target.js +8 -1
- package/dist/coordination/handlers/handler-types.d.ts +2 -2
- package/dist/coordination/handlers/handler-utils.d.ts +6 -0
- package/dist/coordination/handlers/handler-utils.js +14 -4
- package/dist/coordination/handlers/misc-handlers.js +5 -2
- package/dist/coordination/handlers/quality-handlers.js +11 -3
- package/dist/coordination/handlers/security-handlers.js +12 -2
- package/dist/coordination/protocols/security-audit.js +11 -1
- package/dist/coordination/result-saver-adapters.js +1 -0
- package/dist/coordination/result-saver.js +9 -5
- package/dist/coordination/task-executor.js +7 -2
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +1 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +23 -45
- package/dist/domains/code-intelligence/coordinator-gnn.d.ts +2 -16
- package/dist/domains/code-intelligence/coordinator-gnn.js +1 -62
- package/dist/domains/code-intelligence/coordinator.d.ts +12 -6
- package/dist/domains/code-intelligence/coordinator.js +24 -27
- package/dist/domains/code-intelligence/interfaces.d.ts +9 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +43 -5
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +134 -71
- package/dist/domains/coverage-analysis/collected-metrics.d.ts +26 -0
- package/dist/domains/coverage-analysis/collected-metrics.js +54 -0
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +13 -3
- package/dist/domains/coverage-analysis/services/coverage-parser.d.ts +2 -0
- package/dist/domains/coverage-analysis/services/coverage-parser.js +18 -2
- package/dist/domains/defect-intelligence/services/defect-predictor.js +3 -6
- package/dist/domains/quality-assessment/coherence/gate-controller.js +16 -4
- package/dist/domains/quality-assessment/coherence/lambda-calculator.d.ts +8 -0
- package/dist/domains/quality-assessment/coherence/lambda-calculator.js +57 -14
- package/dist/domains/quality-assessment/coherence/types.d.ts +12 -7
- package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +3 -1
- package/dist/domains/quality-assessment/coordinator-reports.d.ts +30 -10
- package/dist/domains/quality-assessment/coordinator-reports.js +93 -57
- package/dist/domains/quality-assessment/coordinator.d.ts +14 -40
- package/dist/domains/quality-assessment/coordinator.js +10 -4
- package/dist/domains/quality-assessment/coverage-report-event.d.ts +8 -0
- package/dist/domains/quality-assessment/coverage-report-event.js +22 -1
- package/dist/domains/quality-assessment/interfaces.d.ts +8 -0
- package/dist/domains/quality-assessment/services/coherence-gate.js +15 -2
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +4 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.js +63 -17
- package/dist/domains/quality-assessment/services/quality-gate.js +6 -4
- package/dist/domains/security-compliance/index.d.ts +1 -1
- package/dist/domains/security-compliance/interfaces.d.ts +46 -5
- package/dist/domains/security-compliance/services/scanners/dast-auth-testing.d.ts +3 -3
- package/dist/domains/security-compliance/services/scanners/dast-auth-testing.js +15 -14
- package/dist/domains/security-compliance/services/scanners/dast-helpers.d.ts +8 -9
- package/dist/domains/security-compliance/services/scanners/dast-helpers.js +19 -44
- package/dist/domains/security-compliance/services/scanners/dast-injection-testing.d.ts +3 -3
- package/dist/domains/security-compliance/services/scanners/dast-injection-testing.js +13 -9
- package/dist/domains/security-compliance/services/scanners/dast-requests.d.ts +54 -0
- package/dist/domains/security-compliance/services/scanners/dast-requests.js +125 -0
- package/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts +5 -1
- package/dist/domains/security-compliance/services/scanners/dast-scanner.js +125 -155
- package/dist/domains/security-compliance/services/scanners/index.d.ts +1 -1
- package/dist/domains/security-compliance/services/scanners/index.js +1 -1
- package/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +2 -2
- package/dist/domains/security-compliance/services/security-auditor-dast.js +183 -212
- package/dist/domains/security-compliance/services/security-auditor-reports.js +5 -1
- package/dist/domains/security-compliance/services/security-auditor.d.ts +11 -3
- package/dist/domains/security-compliance/services/security-auditor.js +106 -65
- package/dist/domains/test-execution/coordinator.d.ts +2 -1
- package/dist/domains/test-execution/coordinator.js +33 -27
- package/dist/domains/test-execution/interfaces.d.ts +10 -0
- package/dist/domains/test-execution/services/test-executor.d.ts +6 -0
- package/dist/domains/test-execution/services/test-executor.js +22 -4
- package/dist/domains/visual-accessibility/coordinator.js +34 -9
- package/dist/domains/visual-accessibility/interfaces.d.ts +27 -0
- package/dist/domains/visual-accessibility/plugin.js +5 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.d.ts +13 -21
- package/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.js +13 -297
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +13 -5
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +96 -73
- package/dist/init/phases/07-hooks.js +90 -6
- package/dist/integrations/embeddings/index/HNSWIndex.js +8 -4
- package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +25 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.js +154 -61
- package/dist/integrations/ruvector/transfer-coherence-stub.js +5 -10
- package/dist/learning/dream/dream-engine.d.ts +24 -1
- package/dist/learning/dream/dream-engine.js +57 -6
- package/dist/learning/learning-retention.d.ts +103 -0
- package/dist/learning/learning-retention.js +213 -0
- package/dist/mcp/bundle.js +508 -503
- package/dist/mcp/handlers/domain-handler-configs.d.ts +17 -1
- package/dist/mcp/handlers/domain-handler-configs.js +33 -16
- package/dist/mcp/handlers/handler-factory.js +3 -0
- package/dist/mcp/handlers/model-route-handlers.d.ts +107 -0
- package/dist/mcp/handlers/model-route-handlers.js +139 -0
- package/dist/mcp/handlers/orchestrate-routes.js +41 -3
- package/dist/mcp/handlers/task-handlers.d.ts +3 -251
- package/dist/mcp/handlers/task-handlers.js +6 -828
- package/dist/mcp/handlers/task-inference.d.ts +26 -0
- package/dist/mcp/handlers/task-inference.js +156 -0
- package/dist/mcp/handlers/task-learning-handlers.d.ts +92 -0
- package/dist/mcp/handlers/task-learning-handlers.js +230 -0
- package/dist/mcp/handlers/task-orchestrate-handler.d.ts +73 -0
- package/dist/mcp/handlers/task-orchestrate-handler.js +361 -0
- package/dist/mcp/protocol-server.js +13 -3
- package/dist/mcp/tools/chaos-resilience/inject.d.ts +3 -4
- package/dist/mcp/tools/chaos-resilience/inject.js +11 -81
- package/dist/mcp/tools/code-intelligence/analyze.js +3 -6
- package/dist/mcp/tools/coverage-analysis/index.d.ts +4 -0
- package/dist/mcp/tools/coverage-analysis/index.js +8 -2
- package/dist/mcp/tools/learning-optimization/dream.d.ts +8 -0
- package/dist/mcp/tools/learning-optimization/dream.js +4 -0
- package/dist/mcp/tools/visual-accessibility/index.d.ts +7 -0
- package/dist/mcp/tools/visual-accessibility/index.js +29 -13
- package/dist/shared/events/domain-events.d.ts +2 -0
- package/dist/shared/metrics/code-metrics.js +21 -3
- package/dist/shared/parsers/typescript-parser.d.ts +6 -0
- package/dist/shared/parsers/typescript-parser.js +13 -1
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-HL7MOCQN.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-OZ2DXB4G.js +0 -2
- package/dist/cli/chunks/base-WIM7G3HC.js +0 -2
- package/dist/cli/chunks/brain-handler-MPC5SPYI.js +0 -94
- package/dist/cli/chunks/browser-workflow-QRKCFVR3.js +0 -2
- package/dist/cli/chunks/chunk-4A76VPU4.js +0 -3
- package/dist/cli/chunks/chunk-QSGEBCDB.js +0 -62
- package/dist/cli/chunks/chunk-UCSK2RMI.js +0 -2
- package/dist/cli/chunks/chunk-VXVTFKRA.js +0 -2
- package/dist/cli/chunks/chunk-XCNSGSKV.js +0 -3
- package/dist/cli/chunks/chunk-XZOYKB22.js +0 -79
- package/dist/cli/chunks/chunk-YIDAXOUX.js +0 -8
- package/dist/cli/chunks/client-4PNYDFYS.js +0 -2
- package/dist/cli/chunks/core-handlers-ODO6LUWQ.js +0 -2
- package/dist/cli/chunks/coverage-USPMNKOU.js +0 -50
- package/dist/cli/chunks/cross-domain-router-DT4MHJKK.js +0 -2
- package/dist/cli/chunks/domain-transfer-L3F6AES2.js +0 -2
- package/dist/cli/chunks/dream-QOB3JCOM.js +0 -2
- package/dist/cli/chunks/file-discovery-BN76S2PR.js +0 -2
- package/dist/cli/chunks/fleet-43YMXACN.js +0 -46
- package/dist/cli/chunks/heartbeat-scheduler-3NNP4WCP.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-MZR7Y4WF.js +0 -2
- package/dist/cli/chunks/hnsw-index-HE4AX22U.js +0 -2
- package/dist/cli/chunks/hybrid-backend-IHUHB3Y2.js +0 -2
- package/dist/cli/chunks/impact-analyzer-FI6GI6PD.js +0 -2
- package/dist/cli/chunks/init-wizard-WLQKH5Y5.js +0 -2
- package/dist/cli/chunks/kernel-2WZOQEZS.js +0 -2
- package/dist/cli/chunks/knowledge-graph-G3LVKK6P.js +0 -2
- package/dist/cli/chunks/learning-QUCMBD77.js +0 -122
- package/dist/cli/chunks/llm-router-service-MM75HKWJ.js +0 -2
- package/dist/cli/chunks/load-test-BEWEE44J.js +0 -2
- package/dist/cli/chunks/memory-backend-NYKBBKZR.js +0 -2
- package/dist/cli/chunks/pattern-null-store-QGPUIV6M.js +0 -2
- package/dist/cli/chunks/project-root-C7ELXZRK.js +0 -2
- package/dist/cli/chunks/protocol-executor-SUVE33BM.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-YWZMMGJB.js +0 -2
- package/dist/cli/chunks/queen-coordinator-ZFAKXRN7.js +0 -2
- package/dist/cli/chunks/router-4FTAVYLJ.js +0 -2
- package/dist/cli/chunks/routing-feedback-IO2KOWMJ.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-KCIRNE7C.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-MFC5WTJU.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-I3KWHE7X.js +0 -2
- package/dist/cli/chunks/safe-db-QXDZ6QY3.js +0 -2
- package/dist/cli/chunks/schedule-CZKD6RIY.js +0 -2
- package/dist/cli/chunks/scheduler-BLA3Q4CH.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-XIUYDJC4.js +0 -2
- package/dist/cli/chunks/task-handler-P6IFLCKP.js +0 -62
- package/dist/cli/chunks/task-handlers-DPWMUKFC.js +0 -9
- package/dist/cli/chunks/test-runner-process-46IPK3GH.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-MOI2WWNJ.js +0 -2
- package/dist/cli/chunks/unified-memory-FL26RTV3.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-E2BPTH3U.js +0 -2
- package/dist/cli/chunks/unified-persistence-5ZOUPKHF.js +0 -2
- package/dist/cli/chunks/visual-security-IJVPO5FA.js +0 -2
- package/dist/cli/chunks/witness-chain-5FAFCQKP.js +0 -2
- package/dist/cli/chunks/witness-chain-V2M32W5D.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-3JLF3IX7.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{d as g,e as y,f as k,g as w}from"./chunk-
|
|
3
|
-
`)}function O(){try{let e=l(),a=p.join(e,".agentic-qe","memory.db");if(!f(a))return null;let n=(j(),v(F)),t=new n(a),r=g(t),o=k(r);return t.close(),o}catch{return null}}async function P(e){let a=w(),t=(O()??y()).verifyChain(),r={featureEnabled:a,chainLength:t.length,integrity:t.valid,brokenAt:t.brokenAt,lastHash:t.lastHash,message:t.message};return e.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(b(t,a)),r}async function L(e){let{WitnessChain:a,hashWith:n,serializeEntry:t}=await import("./witness-chain-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{d as g,e as y,f as k,g as w}from"./chunk-XTZGAG6P.js";import{v as x}from"./chunk-JK6PMLQQ.js";import"./chunk-6NIGSY5L.js";import"./chunk-XN3KCKAM.js";import"./chunk-UDSB3XCG.js";import"./chunk-Z54G2YOL.js";import"./chunk-HEDGFKC5.js";import"./chunk-AJVLVF7V.js";import"./chunk-7SQTLUEN.js";import"./chunk-57DRT6UA.js";import"./chunk-K7GFYFBO.js";import"./chunk-BNG4J3CE.js";import"./chunk-LTGQJYYO.js";import"./chunk-YKQWIXUY.js";import"./chunk-C3OIBFAA.js";import"./chunk-IRPNEXOU.js";import"./chunk-7QUSNBAA.js";import"./chunk-E7OR6V3V.js";import{c as l}from"./chunk-2UZBLC5H.js";import"./chunk-CAZM63TP.js";import"./chunk-INGXD5IX.js";import"./chunk-L5VSLPMW.js";import{p as F,q as j}from"./chunk-U6IOQKCT.js";import{f as v}from"./chunk-V6SE2ZU2.js";import{Command as E}from"commander";import s from"chalk";x();import{existsSync as f}from"node:fs";import p from"node:path";function b(e,a,n){let t=[];t.push(s.bold("Witness Chain Audit Verification")),t.push("");let r=a?s.green("ENABLED"):s.yellow("DISABLED");t.push(` Feature Flag: ${r}`),t.push(` Chain Length: ${e.length} receipts`);let o=n?.status==="forked"?s.yellow("FORKED (no tampering detected)"):e.valid?s.green(n?.status==="valid-with-forks"?"VALID (forks re-anchored)":"VALID"):s.red(n?.status==="tampered"?"BROKEN (tampering detected)":"BROKEN");t.push(` Integrity: ${o}`),e.length>0&&t.push(` Last Hash: ${e.lastHash.slice(0,16)}...`);let i=n?.forks?.length??0;if(i>0){let d=n?.acknowledgedForks?.length??0;t.push(` Forks: ${i} accidental (pre-3.14.5 concurrent writes, #753), ${d} re-anchored`)}if(n?.status==="forked")t.push(""),t.push(s.yellow(` ${e.message}`));else if(!e.valid&&e.brokenAt>=0){t.push("");let d=n?.status==="tampered"&&n.tamperedAt!==void 0?n.tamperedAt:e.brokenAt;t.push(s.red(` Break detected at index ${d}${n?.tamperReason?` (${n.tamperReason})`:""}`)),t.push(s.red(` ${e.message}`))}else e.valid&&i>0&&(t.push(""),t.push(s.green(` ${e.message}`)));return t.push(""),t.join(`
|
|
3
|
+
`)}function O(){try{let e=l(),a=p.join(e,".agentic-qe","memory.db");if(!f(a))return null;let n=(j(),v(F)),t=new n(a),r=g(t),o=k(r);return t.close(),o}catch{return null}}async function P(e){let a=w(),t=(O()??y()).verifyChain(),r={featureEnabled:a,chainLength:t.length,integrity:t.valid,brokenAt:t.brokenAt,lastHash:t.lastHash,message:t.message};return e.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(b(t,a)),r}async function L(e){let{WitnessChain:a,hashWith:n,serializeEntry:t}=await import("./witness-chain-PIYR72HJ.js"),{dbPath:r,keyDir:o}=R(),i;if(!f(r))i={featureEnabled:!0,chainLength:0,integrity:!0,brokenAt:-1,lastHash:"",message:`No database found at ${r} \u2014 nothing to verify`};else{let{default:d}=await import("./better-sqlite3-TQBQGNC6.js"),u=new d(r,{readonly:!0});try{let m=new a(u,await A(o)??void 0);await m.initialize();let c=m.verify({includeArchive:!0,checkSignatures:!1}),{tableExists:C}=await import("./witness-chain-verifier-DTDSVKOG.js"),h=C(u,"witness_chain")?u.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get():void 0,$=h?n(h.hash_algo||"sha256",t(h)):"";i={featureEnabled:!0,chainLength:c.entriesChecked,integrity:c.valid,brokenAt:c.brokenAt??-1,lastHash:$,message:V(c),status:c.status,tampered:c.tampered,...c.tamperedAt!==void 0?{tamperedAt:c.tamperedAt}:{},...c.tamperReason?{tamperReason:c.tamperReason}:{},forks:c.forks,acknowledgedForks:c.acknowledgedForks}}finally{u.close()}}return e.format==="json"?console.log(JSON.stringify(i,null,2)):console.log(b({valid:i.integrity,length:i.chainLength,brokenAt:i.brokenAt,lastHash:i.lastHash,message:i.message},i.featureEnabled,i)),i}function R(){let e=l();return{dbPath:p.join(e,".agentic-qe","memory.db"),keyDir:p.join(e,".agentic-qe","witness-keys")}}async function A(e){if(!f(e))return null;let{WitnessKeyManager:a}=await import("./witness-key-manager-EWACWGAW.js");return new a({keyDir:e,autoGenerate:!1})}function V(e){let a=e.entriesChecked,n=e.forks.length,t=n-e.acknowledgedForks.length;switch(e.status){case"valid":return`Audit chain verified: ${a} entries checked, ${e.signatureFailures??0} signature failures`;case"valid-with-forks":return`Audit chain verified: ${a} entries checked; ${n} accidental fork(s) from pre-3.14.5 concurrent writes are re-anchored by CHAIN_REANCHOR, no tampering detected`;case"forked":return`${t} accidental fork(s) (pre-3.14.5 concurrent writes, #753), no tampering detected \u2014 ${a} entries checked, first fork at id=${e.brokenAt}. Run \`aqe audit repair --chain audit\` to back up the store and re-anchor.`;default:return`Audit chain BROKEN: tampering detected at id=${e.tamperedAt} (${e.tamperReason}); ${a} entries checked`+(n>0?`, ${n} accidental fork(s) found before it`:"")}}function W(e){return e.action==="refused"?!0:e.action==="reanchored"&&!(e.after?.status==="valid"||e.after?.status==="valid-with-forks")}async function D(e){let{repairWitnessChainForks:a}=await import("./witness-chain-repair-YUG7E3UX.js"),{dbPath:n,keyDir:t}=R(),r=e.dryRun===!0,o;if(f(n)){let{openDatabase:i}=await import("./safe-db-TDZKUOZJ.js"),d=i(n,{readonly:r,fileMustExist:!0});try{let u=r?await A(t):(await import("./witness-key-manager-EWACWGAW.js")).getDefaultWitnessKeyManager();o=await a(d,{dbPath:n,dryRun:r,keyManager:u})}finally{d.close()}}else{let i={status:"valid",entriesChecked:0,forks:0,unacknowledgedForks:0};o={action:"none",dryRun:r,message:`No database found at ${n} \u2014 nothing to repair`,before:i,rowsBefore:{live:0,archive:0},rowsAfter:{live:0,archive:0},forksAcknowledged:[]}}return e.format==="json"?console.log(JSON.stringify(o,null,2)):console.log(S(o)),o}function S(e){let a=e.action==="refused"?s.red:e.action==="reanchored"?s.green:s.yellow,n=[s.bold("Witness Chain Audit Repair"),"",` Action: ${a(e.action.toUpperCase())}${e.dryRun?" (dry run)":""}`,` Before: ${e.before.status}, ${e.before.forks} fork(s), ${e.before.unacknowledgedForks} unacknowledged`,` Rows: live ${e.rowsBefore.live} -> ${e.rowsAfter.live}, archive ${e.rowsBefore.archive} -> ${e.rowsAfter.archive}`];return e.after&&n.push(` After: ${e.after.status}`),e.backupPath&&n.push(` Backup: ${e.backupPath}`),n.push("",` ${a(e.message)}`,""),n.join(`
|
|
4
4
|
`)}function q(e,a,n){let t=new E("audit").description("Witness chain audit trail management");return t.command("verify").description("Verify witness chain integrity").option("-F, --format <format>","Output format (json|text)","text").option("-C, --chain <chain>","Which chain to verify: governance (29 decision receipts) or audit (full QE audit trail)","governance").action(async r=>{try{let o=r.format,i=r.chain==="audit"?await L({format:o}):await P({format:o});await a(i.integrity?0:1)}catch(o){console.error("Failed to verify witness chain:",o),await a(1)}}),t.command("repair").description("Re-anchor accidental pre-3.14.5 forks in the audit chain (#753); backs up first, refuses on tampering").option("-C, --chain <chain>",'Chain to repair (only "audit" is supported)',"audit").option("--dry-run","Report what would be done without writing anything",!1).option("-F, --format <format>","Output format (json|text)","text").action(async r=>{try{if(r.chain!=="audit"){console.error(`aqe audit repair supports only --chain audit (got "${r.chain}")`),await a(1);return}let o=await D({format:r.format,dryRun:r.dryRun===!0});await a(W(o)?1:0)}catch(o){console.error("Failed to repair witness chain:",o),await a(1)}}),t}export{q as createAuditCommand,b as formatVerificationText,D as handleAuditChainRepair,L as handleAuditChainVerify,P as handleAuditVerify};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-NPCXGX7N.js";import"./chunk-HTVGHHX2.js";import"./chunk-QUZ745UQ.js";import"./chunk-JK6PMLQQ.js";import"./chunk-6NIGSY5L.js";import"./chunk-XN3KCKAM.js";import"./chunk-UDSB3XCG.js";import"./chunk-Z54G2YOL.js";import"./chunk-HEDGFKC5.js";import"./chunk-AJVLVF7V.js";import"./chunk-7SQTLUEN.js";import"./chunk-57DRT6UA.js";import"./chunk-K7GFYFBO.js";import"./chunk-BNG4J3CE.js";import"./chunk-QP6GL3O5.js";import"./chunk-LTGQJYYO.js";import"./chunk-YKQWIXUY.js";import"./chunk-C3OIBFAA.js";import"./chunk-IRPNEXOU.js";import"./chunk-7QUSNBAA.js";import"./chunk-E7OR6V3V.js";import"./chunk-2UZBLC5H.js";import"./chunk-CAZM63TP.js";import"./chunk-INGXD5IX.js";import"./chunk-L5VSLPMW.js";import"./chunk-U6IOQKCT.js";import"./chunk-V6SE2ZU2.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-U6IOQKCT.js";import"./chunk-V6SE2ZU2.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a as P,b as z,c as G,d as C,e as fe,f as U,g as X,h as N,i as me,j as ue,k as Q,l as De,m as K,n as pe,o as Te,p as j,q as Y,r as Z,s as ee,t as ne}from"./chunk-BPDAQB3F.js";import{c as $e}from"./chunk-YGOSSVY5.js";import{b as Ne}from"./chunk-MB4UKUBV.js";import{a as ke,d as de,e as Ae}from"./chunk-NZQYJCO6.js";import"./chunk-JK6PMLQQ.js";import"./chunk-6NIGSY5L.js";import{b as $,d as ce}from"./chunk-XN3KCKAM.js";import"./chunk-UDSB3XCG.js";import"./chunk-Z54G2YOL.js";import"./chunk-HEDGFKC5.js";import"./chunk-AJVLVF7V.js";import"./chunk-7SQTLUEN.js";import"./chunk-57DRT6UA.js";import"./chunk-K7GFYFBO.js";import"./chunk-BNG4J3CE.js";import"./chunk-LTGQJYYO.js";import"./chunk-YKQWIXUY.js";import"./chunk-C3OIBFAA.js";import"./chunk-IRPNEXOU.js";import"./chunk-7QUSNBAA.js";import"./chunk-E7OR6V3V.js";import"./chunk-2UZBLC5H.js";import"./chunk-CAZM63TP.js";import{a as Ie,b as Oe,c as H,d as W,f as pn}from"./chunk-2W5MQDHM.js";import{d as q,e as gn}from"./chunk-INGXD5IX.js";import"./chunk-L5VSLPMW.js";import"./chunk-U6IOQKCT.js";import"./chunk-V6SE2ZU2.js";import M from"path";import o from"chalk";gn();ce();import{existsSync as re,mkdirSync as yn,writeFileSync as bn,readFileSync as ge}from"fs";import{join as T,resolve as ye}from"path";function te(e,n){let r="shake256",t=JSON.stringify(n),a=e.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get(),i=a?de(r,Ae(a)):ke;e.prepare(`
|
|
3
|
+
INSERT INTO witness_chain
|
|
4
|
+
(prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo)
|
|
5
|
+
VALUES (?, ?, 'BRAIN_IMPORT', ?, ?, 'brain-import', ?)
|
|
6
|
+
`).run(i,de(r,t),t,new Date().toISOString(),r)}var hn={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Rn(e,n){let r=hn[e.tableName];return!(r&&n[r]===!1)}var wn=1e4;function vn(e,n,r,t){if(!Rn(n,r))return pe(T(t,n.fileName),[]),{count:0,rows:[]};let[a,i]=n.domainColumn?K(r.domains,n.domainColumn):[void 0,[]];if(r.domains&&r.domains.length>0&&!n.domainColumn){let d=r.domains.map(()=>"?").join(","),c=`manifest_id IN (SELECT id FROM learning_evidence_manifests WHERE task_family IN (${d}))`;["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(n.tableName)?(a=c,i=[...r.domains]):["pattern_manifest_lineage","pattern_segment_lineage"].includes(n.tableName)&&(a=`${c} AND pattern_id IN (SELECT id FROM qe_patterns WHERE qe_domain IN (${d}))`,i=[...r.domains,...r.domains])}if(ue(e,n.tableName,a,i)>=wn){let d=n.blobColumns,c=d&&d.length>0?p=>U(p,d):void 0;return{count:Te(T(t,n.fileName),De(e,n.tableName,a,i),c)}}let s=Q(e,n.tableName,a,i);return n.blobColumns&&n.blobColumns.length>0&&(s=s.map(d=>U(d,n.blobColumns))),pe(T(t,n.fileName),s),{count:s.length,rows:s}}function Me(e){let n=[];for(let r of C){let t=T(e,r.fileName);re(t)?n.push(N(ge(t,"utf-8"))):n.push(N(""))}return N(n.join(":"))}function Fe(e,n,r="memory.db"){let t=ye(n.outputPath);re(t)||yn(t,{recursive:!0});let a=0,i={},l=new Set;for(let m of C){let p=vn(e,m,n,t);if(i[m.tableName]=p.count,a+=p.count,m.tableName==="qe_patterns"){if(p.rows)for(let h of p.rows)h.qe_domain&&l.add(h.qe_domain);else if(p.count>0){let[h,B]=m.domainColumn?K(n.domains,m.domainColumn):[void 0,[]],f=`SELECT DISTINCT qe_domain FROM qe_patterns ${h?`WHERE ${h} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let R=e.prepare(f).all(...B||[]);for(let y of R)l.add(y.qe_domain)}catch{}}}}let s=n.includeVectors!==!1?ue(e,"vectors"):0,d=Me(t),c={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:i.qe_patterns||0,vectorCount:s,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:a},domains:[...l].sort(),checksum:d,tableRecordCounts:i};return bn(T(t,"manifest.json"),JSON.stringify(c,null,2),"utf-8"),c}var Sn=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function _n(e){return e==="1.0"?C.filter(n=>Sn.has(n.tableName)):e==="3.0"?C:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),C)}function Le(e,n,r){let t=ye(n),a=T(t,"manifest.json");if(!re(a))throw new Error(`Manifest not found at ${a}`);let i=$(ge(a,"utf-8")),l=Me(t);if(l!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${l}. The export may have been tampered with or corrupted.`);let s=_n(i.version),d=0,c=0,m=0,p=()=>{let h=new Map,B=new Map,g=0;for(let f of s){let R=T(t,f.fileName),y=j(R,$);if(f.tableName==="witness_chain"){g+=y.length,c+=y.length;continue}f.blobColumns&&f.blobColumns.length>0&&(y=y.map(b=>X(b,f.blobColumns)));for(let b of y){let k=Y(b,h),w;if(f.dedupColumns&&f.dedupColumns.length>0)w=ee(e,f.tableName,k,f.dedupColumns,f.preserveId);else{let D=P[f.tableName]||"id",u=G[f.tableName],I=z[f.tableName];w=Z(e,f.tableName,k,D,r.mergeStrategy,u,I,h,B,b.pattern_id)}d+=w.imported,c+=w.skipped,m+=w.conflicts}}te(e,{sourceChecksum:i.checksum,sourceWitnessRows:g,importedRecords:d,skippedRecords:c,conflicts:m}),d+=1};return ne(e,r.dryRun??!1,p),{imported:d,skipped:c,conflicts:m}}function qe(e){let n=ye(e),r=T(n,"manifest.json");if(!re(r))throw new Error(`Manifest not found at ${r}`);return $(ge(r,"utf-8"))}pn();import{existsSync as V,readdirSync as En,renameSync as Cn,statSync as xn,unlinkSync as he,writeFileSync as Bn}from"fs";import{basename as In,dirname as On,join as Nn,resolve as ie}from"path";var kn=128*1024*1024,oe="code-intelligence:",Pe=`substr(id, 1, ${oe.length}) = ?`;function An(e,n){if(e!=="vectors")return!1;let r=n.id;return typeof r=="string"&&r.startsWith(oe)}var ae=class extends Error{constructor(r,t,a,i){let l=Object.entries(a).filter(([,s])=>s>=1048576).sort((s,d)=>d[1]-s[1]).slice(0,3).map(([s,d])=>`${s} ${be(d)}`).join(", ");super(`RVF_KERNEL_TOO_LARGE: the brain kernel needs ${i?"":"at least "}${be(r)}, over the ${be(t)} limit of the native RVF writer.`+(l?` Largest tables: ${l}.`:"")+" Nothing was written. Use --format jsonl (no size limit), or reduce the largest learning tables first.");this.kernelBytes=r;this.limitBytes=t;this.tableBytes=a;this.complete=i;this.name="RvfKernelTooLargeError"}kernelBytes;limitBytes;tableBytes;complete;code="RVF_KERNEL_TOO_LARGE"};function be(e){return`${(e/(1024*1024)).toFixed(1)} MB`}var Ve=["",".idmap.json",".manifest.json"],$n=[...Ve,".lock"];function je(e){for(let n of $n)try{let r=`${e}${n}`;V(r)&&he(r)}catch{}}function Dn(e){let n=On(e),r=`${In(e)}.tmp.`,t;try{t=En(n)}catch{return}for(let a of t){if(!a.startsWith(r))continue;let i=Number.parseInt(a.slice(r.length).split(".")[0],10);if(!(!Number.isInteger(i)||i<=0)&&!(i!==process.pid&&Tn(i)))try{he(Nn(n,a))}catch{}}}function Tn(e){try{return process.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function Je(e,n,r="memory.db"){if(!W())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=ie(n.outputPath),a=n.dimension??384,i=`${t}.tmp.${process.pid}`;Dn(t),je(i);let l=n.maxKernelBytes??kn,s={},d=[],c={},m={},p={},h=new Set,B=0,g=0;for(let u of C){let[I,A]=u.domainColumn?K(n.domains,u.domainColumn):[void 0,[]];if(u.tableName==="vectors"&&me(e,"vectors")){let{n:x}=e.prepare(`SELECT COUNT(*) AS n FROM vectors WHERE ${Pe}`).get(oe);x>0&&(p.vectors=x),I=`(id IS NULL OR NOT ${Pe})`,A=[oe]}let _=Q(e,u.tableName,I,A);if(n.domains&&n.domains.length>0){let x=new Set((s.learning_evidence_manifests??[]).map(v=>v.id)),L=new Set((s.qe_patterns??[]).map(v=>v.id));["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(u.tableName)?_=_.filter(v=>x.has(v.manifest_id)):u.tableName==="pattern_manifest_lineage"?_=_.filter(v=>{let S=v;return x.has(S.manifest_id)&&L.has(S.pattern_id)}):u.tableName==="pattern_segment_lineage"&&(_=_.filter(v=>{let S=v;return x.has(S.manifest_id)&&L.has(S.pattern_id)}))}if(u.tableName==="qe_patterns")for(let x of _)x.qe_domain&&h.add(x.qe_domain);let F=fe[u.tableName];F&&F.length>0&&(_=_.map(x=>U(x,F))),(u.tableName==="qe_patterns"||u.tableName==="learning_evidence_manifests")&&(s[u.tableName]=_),m[u.tableName]=_.length,B+=_.length;let J=JSON.stringify(_);if(d.push([u.tableName,J]),c[u.tableName]=Buffer.byteLength(J),g+=c[u.tableName],g>l)throw new ae(g,l,c,!1)}let f=new Date().toISOString(),R=[...h].sort(),y=`{"version":"3.0","format":"rvf","exportedAt":${JSON.stringify(f)},"sourceDb":${JSON.stringify(r)},"domains":${JSON.stringify(R)},"tables":{`+d.map(([u,I])=>`${JSON.stringify(u)}:${I}`).join(",")+"}}";d.length=0;let b=Buffer.from(y);if(b.length>l)throw new ae(b.length,l,c,!0);let k=N(y),w=Ie(i,a),D=!1;try{let u=0,I=[];if(me(e,"qe_pattern_embeddings")){let v=e.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(E=>E.name==="space_id"),S=e.prepare(`SELECT pattern_id, embedding, dimension, ${v?"space_id":"NULL"} AS space_id
|
|
7
|
+
FROM qe_pattern_embeddings`).all();for(let E of S)E.embedding&&E.dimension===a&&E.space_id&&I.push({id:`pe:${E.pattern_id}`,vector:new Float32Array(E.embedding.buffer,E.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings",spaceId:E.space_id}})}I.length>0&&(u=w.ingest(I).accepted),w.embedKernel(b);let A=n.sign?w.sign(b)??void 0:void 0,_=A?n.signerKeyId??"default":void 0,F=w.fileId(),J=F?{fileId:F,parentId:w.parentId(),lineageDepth:w.lineageDepth()}:void 0,x=w.status(),L={version:"3.0",format:"rvf",exportedAt:f,sourceDb:r,stats:{patternCount:m.qe_patterns??0,embeddingCount:u,qValueCount:m.rl_q_values??0,dreamInsightCount:m.dream_insights??0,witnessChainLength:m.witness_chain??0,totalRecords:B,tableCounts:m,...Object.keys(p).length>0?{skippedCacheRows:p}:{}},domains:R,checksum:k,rvfStatus:{totalVectors:x.totalVectors,totalSegments:x.totalSegments,fileSizeBytes:x.fileSizeBytes},...A?{signature:A,signerKeyId:_}:{},...J?{lineage:J}:{}};if(A)try{w.freeze()}catch{}if(Bn(`${i}.manifest.json`,JSON.stringify(L,null,2),"utf-8"),w.close(),D=!0,V(t)&&!n.allowOverwriteRicher){let v;try{v=Ue(t,!0)}catch(S){if(Mn(t)||!Fn(S)){let E=S instanceof Error?S.message:String(S);throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: the existing mirror is readable but its richness could not be established (${E}). Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`)}}if(v){let S=v.stats.tableCounts,E=L.stats.tableCounts,xe=C.map(({tableName:O})=>O).filter(O=>!S||!Number.isSafeInteger(S[O]));if(xe.length>0)throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: existing mirror lacks trustworthy counts for ${xe.join(", ")}. Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`);let Be=C.map(({tableName:O})=>({tableName:O,existing:S[O],candidate:E[O]})).filter(({existing:O,candidate:le})=>O>le);if(Be.length>0){let O=Be.map(({tableName:le,existing:mn,candidate:un})=>`${le} ${mn} -> ${un}`).join(", ");throw new Error(`RVF_MIRROR_RICHER: refusing to replace richer mirrored tables: ${O}. Restore/import the mirror first, or repeat with --force-overwrite-richer after preserving a backup.`)}}}for(let v of[...Ve].reverse()){let S=`${i}${v}`,E=`${t}${v}`;V(S)?Cn(S,E):V(E)&&he(E)}return L}catch(u){if(!D)try{w.close()}catch{}throw je(i),u}}function Mn(e){let n;try{return n=H(ie(e)),!!n.extractKernel()?.image}catch{return!1}finally{try{n?.close()}catch{}}}function Fn(e){let n=e instanceof Error?e.message:String(e);return/ManifestNotFound|InvalidMagic|ChecksumMismatch|CorruptStore/i.test(n)}var Ln={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function We(e,n,r){if(!W())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=ie(n);if(!V(t))throw new Error(`RVF file not found: ${t}`);let a=r.dryRun?H(t):Oe(t);try{let i=a.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let g=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${g}`)}let l=a.extractKernel();if(!l||!l.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let s;try{s=JSON.parse(l.image.toString("utf-8"))}catch(g){throw new Error(`Failed to parse brain kernel data as JSON: ${g instanceof Error?g.message:g}`)}let d=0,c=0,m=0,p=0,h={};if(s.tables)Object.assign(h,s.tables);else for(let[g,f]of Object.entries(Ln)){let R=s[g];Array.isArray(R)&&(h[f]=R)}let B=()=>{let g=new Map,f=new Map,R=0;for(let y of C){let b=h[y.tableName];if(!b||!Array.isArray(b))continue;if(y.tableName==="witness_chain"){R+=b.length,c+=b.length;continue}let k=fe[y.tableName];k&&k.length>0&&(b=b.map(w=>X(w,k)));for(let w of b){let D=Y(w,g),u;if(y.dedupColumns&&y.dedupColumns.length>0)u=ee(e,y.tableName,D,y.dedupColumns,y.preserveId);else{let I=P[y.tableName]||"id",A=G[y.tableName],_=z[y.tableName];u=Z(e,y.tableName,D,I,r.mergeStrategy,A,_,g,f,w.pattern_id)}if(u.imported)for(let I of k??[])D[I]instanceof Buffer&&p++;d+=u.imported,c+=u.skipped,m+=u.conflicts}}te(e,{sourceChecksum:N(l.image.toString("utf-8")),sourceWitnessRows:R,importedRecords:d,skippedRecords:c,conflicts:m}),d+=1};if(ne(e,r.dryRun??!1,B),!r.dryRun&&m>0)try{a.compact()}catch{}return{imported:d,skipped:c,conflicts:m,embeddingsRestored:p}}finally{a.close()}}function se(e){return Ue(e,!1)}function Ue(e,n){if(!W())throw new Error("@ruvector/rvf-node is not available.");let r=ie(e);if(!V(r))throw new Error(`RVF file not found: ${r}`);let t=H(r);try{let a=t.extractKernel();if(!a||!a.image)throw new Error("No brain data found in RVF file");let i=a.image.toString("utf-8"),l;try{l=JSON.parse(i)}catch(f){throw new Error(`Failed to parse brain kernel data as JSON: ${f instanceof Error?f.message:f}`)}let s=t.status(),d=xn(r).size,c=l.tables,m=c?c.qe_patterns?.length??0:l.patterns?.length??0,p=c?c.rl_q_values?.length??0:l.qValues?.length??0,h=c?c.dream_insights?.length??0:l.dreamInsights?.length??0,B=c?c.witness_chain?.length??0:l.witnessChain?.length??0,g=c&&typeof c=="object"&&!Array.isArray(c)?Object.fromEntries(Object.entries(c).filter(f=>Array.isArray(f[1])).map(([f,R])=>[f,n?R.filter(y=>!An(f,y)).length:R.length])):void 0;return{version:"3.0",format:"rvf",exportedAt:l.exportedAt??"unknown",sourceDb:l.sourceDb??"unknown",stats:{patternCount:m,embeddingCount:s.totalVectors,qValueCount:p,dreamInsightCount:h,witnessChainLength:B,...g?{tableCounts:g}:{}},domains:l.domains??[],checksum:N(i),rvfStatus:{totalVectors:s.totalVectors,totalSegments:s.totalSegments,fileSizeBytes:d}}}finally{t.close()}}function Re(){return W()}ce();import{existsSync as ve,readFileSync as qn,statSync as Pn}from"fs";import{join as we,resolve as Ke}from"path";function Xe(e,n,r={}){let t=Ke(e),a=Ke(n),i=He(t),l=He(a),s=ze(t,i),d=ze(a,l),c=i==="jsonl"&&l==="jsonl",m=Jn({pathA:t,pathB:a,manifestA:s,manifestB:d,recordLevel:c,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),p=new Set(s.domains),h=new Set(d.domains),B=s.domains.filter(b=>!h.has(b)),g=d.domains.filter(b=>!p.has(b)),f=s.checksum===d.checksum,R=s.version===d.version,y=f&&R&&m.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:i,formatB:l,manifestA:s,manifestB:d,checksumMatch:f,versionMatch:R,identical:y,recordLevel:c,tableDiffs:m,domainsOnlyInA:B,domainsOnlyInB:g}}function He(e){if(!ve(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(Pn(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function ze(e,n){return n==="rvf"?Vn(e):jn(e)}function jn(e){let n=we(e,"manifest.json");if(!ve(n))throw new Error(`Manifest not found at ${n}`);let r=$(qn(n,"utf-8"));return Qe(r,"jsonl")}function Vn(e){let n=se(e);return Qe(n,"rvf")}function Qe(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function Jn(e){let n=e.tableFilter?C.filter(t=>t.tableName===e.tableFilter):C;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,i=e.manifestB.tableRecordCounts[t.tableName]??0,l=i-a,s,d,c;if(e.recordLevel&&Wn(t)){let m=Un(we(e.pathA,t.fileName),we(e.pathB,t.fileName),t,e.maxIdsPerBucket);s=m.added,d=m.removed,c=m.changed}r.push({tableName:t.tableName,countA:a,countB:i,delta:l,...s!==void 0?{added:s}:{},...d!==void 0?{removed:d}:{},...c!==void 0?{changed:c}:{}})}return r}function Wn(e){return!0}function Un(e,n,r,t){let a=Ge(e,r),i=Ge(n,r),l=[],s=[],d=[];for(let[c,m]of a){let p=i.get(c);if(p===void 0)s.length<t&&s.push(c);else if(p!==m){if(r.dedupColumns&&r.dedupColumns.length>0)continue;d.length<t&&d.push(c)}}for(let c of i.keys())a.has(c)||l.length<t&&l.push(c);return l.sort(),s.sort(),d.sort(),{added:l,removed:s,changed:d}}function Ge(e,n){let r=new Map;if(!ve(e))return r;let t=j(e,$);for(let a of t){let i=Kn(a,n);if(i===void 0)continue;let l=Hn(a);r.set(i,zn(l))}return r}function Kn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let i of n.dedupColumns){let l=e[i];if(l==null)return;a.push(String(l))}return a.join("")}let r=P[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function Hn(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function zn(e){return N(e)}ce();import{existsSync as Se,statSync as Gn}from"fs";import{join as Ye,resolve as Xn}from"path";var Qn=20,Yn="qe_patterns";function Ze(e,n={}){let r=Xn(e);nt(r);let t=n.table??Yn,a=C.find(R=>R.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let i=Ye(r,a.fileName);if(!Se(i))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let l=j(i,$),s=a.domainColumn,d=Math.max(1,n.limit??Qn),c=n.query?n.query.toLowerCase():void 0,m=n.domains&&n.domains.length>0?new Set(n.domains):void 0,p=n.since,h=n.until,B=n.patternType,g=0,f=[];for(let R of l)Zn(R,{domainColumn:s,domains:m,patternType:B,since:p,until:h,queryLower:c})&&(g++,f.length<d&&f.push(et(R,a.tableName,s)));return{table:t,inputPath:r,totalScanned:l.length,totalMatched:g,limit:d,hits:f,truncated:g>d}}function Zn(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=en(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function en(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function et(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:en(e)};return{id:t,display:a,row:e}}function nt(e){if(!Se(e))throw new Error(`Path not found: ${e}`);if(Gn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ye(e,"manifest.json");if(!Se(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function nn(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
|
|
8
|
+
CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
|
|
9
|
+
pattern_id TEXT PRIMARY KEY
|
|
10
|
+
)
|
|
11
|
+
`),e.exec("DELETE FROM _covered_patterns"),e.exec(`
|
|
12
|
+
INSERT INTO _covered_patterns (pattern_id)
|
|
13
|
+
SELECT DISTINCT json_extract(action_data, '$.patternId')
|
|
14
|
+
FROM witness_chain
|
|
15
|
+
WHERE action_type = 'PATTERN_CREATE'
|
|
16
|
+
AND json_extract(action_data, '$.patternId') IS NOT NULL
|
|
17
|
+
`),e.exec(`
|
|
18
|
+
INSERT OR IGNORE INTO _covered_patterns (pattern_id)
|
|
19
|
+
SELECT DISTINCT json_extract(action_data, '$.pattern_id')
|
|
20
|
+
FROM witness_chain
|
|
21
|
+
WHERE action_type = 'PATTERN_CREATE'
|
|
22
|
+
AND json_extract(action_data, '$.pattern_id') IS NOT NULL
|
|
23
|
+
`);let t=e.prepare(`SELECT p.id, p.pattern_type, p.qe_domain, p.name, p.created_at
|
|
24
|
+
FROM qe_patterns p
|
|
25
|
+
LEFT JOIN _covered_patterns c ON p.id = c.pattern_id
|
|
26
|
+
WHERE c.pattern_id IS NULL
|
|
27
|
+
ORDER BY p.created_at ASC`).all(),i=e.prepare("SELECT COUNT(*) as count FROM qe_patterns").get().count-t.length,l=0;for(let s of t)n.append("PATTERN_CREATE",{patternId:s.id,patternType:s.pattern_type,qeDomain:s.qe_domain,name:s.name,originalCreatedAt:s.created_at,backfilled:!0},"system:backfill"),l++;return e.exec("DROP TABLE IF EXISTS _covered_patterns"),{created:l,skipped:i}}async function tn(e,n){if(tt(n.format)==="rvf"){let a=q(e,{readonly:!0});try{return Je(a,{outputPath:n.outputPath,domains:n.domains,allowOverwriteRicher:n.allowOverwriteRicher},e)}finally{a.close()}}let t=q(e,{readonly:!0});try{return Fe(t,n,e)}finally{t.close()}}async function rn(e,n,r){if(cn(n,r.format)==="rvf"){let i=q(e);try{return We(i,n,{mergeStrategy:r.mergeStrategy,dryRun:r.dryRun})}finally{i.close()}}let a=q(e);try{return Le(a,n,r)}finally{a.close()}}async function on(e,n){return cn(e,n)==="rvf"?se(e):qe(e)}async function an(e,n,r={}){return Xe(e,n,r)}async function sn(e,n={}){return Ze(e,n)}async function ln(e){let n=q(e);try{let r=$e(n,Ne());return await r.initialize(),nn(n,r)}finally{n.close()}}function tt(e){if(e==="jsonl")return"jsonl";if(e==="rvf"){if(!Re())throw new Error("RVF format requested but @ruvector/rvf-node is not available on this platform. Use --format jsonl instead.");return"rvf"}return Re()?"rvf":"jsonl"}function cn(e,n){return n==="rvf"?"rvf":n==="jsonl"?"jsonl":e.endsWith(".rvf")?"rvf":"jsonl"}var Ce=class{name="brain";description="Export, import, and inspect QE brain state";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let t=n.command("brain").description(this.description);t.command("export").description("Export brain state to a portable directory").requiredOption("-o, --output <path>","Output directory path").option("--format <format>","Export format: rvf (default) or jsonl","rvf").option("--db <path>","Source database path").option("--force-overwrite-richer","Allow replacing an existing RVF with fewer patterns",!1).action(async a=>{await this.executeExport(a)}),t.command("import").description("Import brain state from an export directory").requiredOption("-i, --input <path>","Path to brain export directory").option("--strategy <strategy>","Merge strategy","skip-conflicts").option("--dry-run","Preview import without writing",!1).option("--db <path>","Target database path").action(async a=>{await this.executeImport(a)}),t.command("info").description("Show manifest info for a brain export").requiredOption("-i, --input <path>","Path to brain export directory").action(async a=>{await this.executeInfo(a)}),t.command("witness-backfill").description("Create witness chain entries for patterns that predate the witness chain").option("--db <path>","Database path").action(async a=>{await this.executeWitnessBackfill(a)}),t.command("diff").description("Compare two brain exports (JSONL directory or .rvf file)").argument("<a>","Path to first brain export").argument("<b>","Path to second brain export").option("--table <name>","Restrict comparison to a single table").option("--verbose","Show the IDs of added/removed/changed records",!1).option("--json","Emit the diff as JSON to stdout",!1).action(async(a,i,l)=>{await this.executeDiff(a,i,l)}),t.command("search").description("Search a JSONL brain export with filters").requiredOption("-i, --input <path>","Path to brain export directory (JSONL)").option("--table <name>","Table to search (default: qe_patterns)").option("--domain <name...>","Restrict to one or more domains").option("--pattern-type <type>","Restrict to a specific pattern_type (qe_patterns only)").option("--since <iso>","Include rows with timestamp \u2265 <iso>").option("--until <iso>","Include rows with timestamp \u2264 <iso>").option("-q, --query <text>","Substring match across name + description (case-insensitive)").option("-l, --limit <n>","Maximum results to return","20").option("--json","Emit results as JSON to stdout",!1).action(async a=>{await this.executeSearch(a)})}async executeExport(n){try{console.log(o.blue(`
|
|
28
|
+
Exporting brain state (format: ${n.format})...
|
|
29
|
+
`));let r=await _e(n.db),t=await tn(r,{outputPath:M.resolve(n.output),format:n.format,allowOverwriteRicher:n.forceOverwriteRicher});if(console.log(o.green(" Export complete.")),console.log(` Format: ${o.cyan("format"in t?t.format??"jsonl":"jsonl")}`),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"embeddingCount"in t.stats?console.log(` Vectors: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`),"rvfStatus"in t){let i=t.rvfStatus;console.log(` RVF Size: ${o.cyan(dn(i.fileSizeBytes))}`),console.log(` Segments: ${o.cyan(i.totalSegments)}`)}let a=t.stats.skippedCacheRows?.vectors;a&&console.log(` Skipped: ${o.gray(`${a} code-index vectors (regenerable: aqe code index <path>)`)}`),console.log(` Checksum: ${o.gray(t.checksum)}`),console.log(` Output: ${o.cyan(M.resolve(n.output))}`),console.log(""),await this.cleanupAndExit(0)}catch(r){r?.code==="RVF_KERNEL_TOO_LARGE"?console.error(o.red(`
|
|
30
|
+
Brain export failed:`),r.message):console.error(o.red(`
|
|
31
|
+
Brain export failed:`),r),await this.cleanupAndExit(1)}}async executeImport(n){try{n.dryRun?console.log(o.yellow(`
|
|
32
|
+
Dry-run mode \u2014 no data will be written.
|
|
33
|
+
`)):console.log(o.blue(`
|
|
34
|
+
Importing brain state...
|
|
35
|
+
`));let r=await _e(n.db),t=await rn(r,M.resolve(n.input),{mergeStrategy:n.strategy,dryRun:n.dryRun});console.log(o.green(" Import complete.")),console.log(` Imported: ${o.cyan(t.imported)}`),console.log(` Skipped: ${o.yellow(t.skipped)}`),console.log(` Conflicts: ${o.red(t.conflicts)}`),"embeddingsRestored"in t&&console.log(` Embeddings: ${o.cyan(t.embeddingsRestored)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
36
|
+
Brain import failed:`),r),await this.cleanupAndExit(1)}}async executeInfo(n){try{console.log(o.blue(`
|
|
37
|
+
Brain Export Info
|
|
38
|
+
`));let r=M.resolve(n.input),t=await on(r),a="format"in t?t.format??"jsonl":"jsonl";if(console.log(` Version: ${o.cyan(t.version)}`),console.log(` Format: ${o.cyan(a)}`),console.log(` Exported: ${o.cyan(t.exportedAt)}`),console.log(` Source DB: ${o.cyan(t.sourceDb)}`),console.log(o.blue(`
|
|
39
|
+
Learning Data:`)),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"qValueCount"in t.stats&&console.log(` Q-Values: ${o.cyan(t.stats.qValueCount)}`),"dreamInsightCount"in t.stats){let s=t.stats.dreamInsightCount,c=("tableRecordCounts"in t?t.tableRecordCounts:void 0)?.dream_cycles,m=c!==void 0?` (${c} cycles)`:"";console.log(` Dream Insights: ${o.cyan(s)}${o.gray(m)}`)}"witnessChainLength"in t.stats&&console.log(` Witness Chain: ${o.cyan(t.stats.witnessChainLength)} entries`),"embeddingCount"in t.stats?console.log(` Embeddings: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`);let i="tableRecordCounts"in t?t.tableRecordCounts:void 0;if(i){let s=Object.entries(i).filter(([d,c])=>c>0&&!["qe_patterns","rl_q_values","dream_insights","dream_cycles","witness_chain","vectors","qe_pattern_embeddings"].includes(d));if(s.length>0)for(let[d,c]of s){let p=`${d.replace(/_/g," ").replace(/\b\w/g,h=>h.toUpperCase())}:`.padEnd(15);console.log(` ${p}${o.cyan(c)}`)}}let l="totalRecords"in t.stats?t.stats.totalRecords:void 0;if(l!==void 0&&(console.log(o.blue(`
|
|
40
|
+
Summary:`)),console.log(` Total Records: ${o.cyan(l)}`)),"domains"in t&&Array.isArray(t.domains)&&t.domains.length>0&&(l||console.log(o.blue(`
|
|
41
|
+
Summary:`)),console.log(` Domains: ${o.cyan(t.domains.join(", "))}`)),"rvfStatus"in t){let s=t.rvfStatus;console.log(o.blue(`
|
|
42
|
+
RVF Details:`)),console.log(` File Size: ${o.cyan(dn(s.fileSizeBytes))}`),console.log(` Vectors: ${o.cyan(s.totalVectors)}`),console.log(` Segments: ${o.cyan(s.totalSegments)}`)}if("lineage"in t){let s=t.lineage;s&&(console.log(o.blue(`
|
|
43
|
+
Lineage:`)),console.log(` File ID: ${o.cyan(s.fileId)}`),console.log(` Parent ID: ${o.cyan(s.parentId??"none (root)")}`),console.log(` Depth: ${o.cyan(s.lineageDepth)}`))}if("signature"in t){let s=t.signature,d=t.signerKeyId;console.log(o.blue(`
|
|
44
|
+
Signature:`)),s?(console.log(` Status: ${o.green("Signed")}`),console.log(` Key ID: ${o.cyan(d??"unknown")}`),console.log(` Signature: ${o.gray(s.slice(0,32)+"...")}`)):console.log(` Status: ${o.yellow("Unsigned")}`)}console.log(`
|
|
45
|
+
Checksum: ${o.gray(t.checksum)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
46
|
+
Failed to read brain info:`),r),await this.cleanupAndExit(1)}}async executeDiff(n,r,t){try{let a=await an(M.resolve(n),M.resolve(r),{tableFilter:t.table});if(t.json){process.stdout.write(JSON.stringify(a,null,2)+`
|
|
47
|
+
`),await this.cleanupAndExit(a.identical?0:1);return}at(a,t.verbose),await this.cleanupAndExit(a.identical?0:1)}catch(a){console.error(o.red(`
|
|
48
|
+
Brain diff failed:`),a),await this.cleanupAndExit(2)}}async executeSearch(n){try{let r=rt(n.limit),t=ot(n.domain),a=await sn(M.resolve(n.input),{table:n.table,domains:t,patternType:n.patternType,since:n.since,until:n.until,query:n.query,limit:r});if(n.json){process.stdout.write(JSON.stringify(a,null,2)+`
|
|
49
|
+
`),await this.cleanupAndExit(a.totalMatched>0?0:3);return}lt(a),await this.cleanupAndExit(a.totalMatched>0?0:3)}catch(r){console.error(o.red(`
|
|
50
|
+
Brain search failed:`),r),await this.cleanupAndExit(2)}}async executeWitnessBackfill(n){try{console.log(o.blue(`
|
|
51
|
+
Running witness chain backfill...
|
|
52
|
+
`));let r=await _e(n.db),t=await ln(r);console.log(o.green(" Backfill complete.")),console.log(` Created: ${o.cyan(t.created)} new witness entries`),console.log(` Skipped: ${o.cyan(t.skipped)} (already witnessed)`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
53
|
+
Witness backfill failed:`),r),await this.cleanupAndExit(1)}}getHelp(){return`
|
|
54
|
+
Export, import, and inspect QE brain state.
|
|
55
|
+
|
|
56
|
+
Formats:
|
|
57
|
+
rvf \u2014 Single portable .rvf file (default, requires @ruvector/rvf-node)
|
|
58
|
+
jsonl \u2014 JSONL directory format (fallback when native not available)
|
|
59
|
+
|
|
60
|
+
Usage:
|
|
61
|
+
aqe brain export -o brain.rvf [--format rvf] [--db <path>]
|
|
62
|
+
aqe brain export -o ./brain-dir --format jsonl [--db <path>]
|
|
63
|
+
aqe brain import -i brain.rvf [--strategy skip-conflicts] [--dry-run] [--db <path>]
|
|
64
|
+
aqe brain info -i brain.rvf
|
|
65
|
+
|
|
66
|
+
Subcommands:
|
|
67
|
+
export Export brain state to a portable .rvf file or JSONL directory
|
|
68
|
+
import Import a brain export into the local database
|
|
69
|
+
info Show manifest metadata for an existing brain export
|
|
70
|
+
diff Compare two brain exports (manifest always; record-level for JSONL)
|
|
71
|
+
search Filtered search over a JSONL brain export
|
|
72
|
+
|
|
73
|
+
Examples:
|
|
74
|
+
aqe brain export -o .agentic-qe/brain.rvf
|
|
75
|
+
aqe brain export -o .agentic-qe/brain.rvf --format rvf
|
|
76
|
+
aqe brain export -o ./brain-export --format jsonl
|
|
77
|
+
aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
|
|
78
|
+
aqe brain import -i .agentic-qe/brain.rvf --dry-run
|
|
79
|
+
aqe brain info -i .agentic-qe/brain.rvf
|
|
80
|
+
aqe brain diff ./brain-a ./brain-b --verbose
|
|
81
|
+
aqe brain search -i ./brain-export --query oauth --domain test-generation
|
|
82
|
+
aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
|
|
83
|
+
`}};async function _e(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-QARWQKJ2.js");return M.join(n(),".agentic-qe","memory.db")}function dn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function rt(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function ot(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let i=a.trim();i&&r.push(i)}return r.length>0?r:void 0}function at(e,n){console.log(o.blue(`
|
|
84
|
+
Brain Diff
|
|
85
|
+
`)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+fn(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
|
|
86
|
+
Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
|
|
87
|
+
Note: record-level diff is only available when both sides are JSONL exports.
|
|
88
|
+
Per-table counts shown below; re-export with --format jsonl for added/removed/changed IDs.`)),console.log(o.blue(`
|
|
89
|
+
Tables:`));let r=e.tableDiffs.filter(it);if(r.length===0)console.log(o.gray(" (no differences)"));else for(let t of r)console.log(` ${t.tableName.padEnd(28)} ${o.cyan(String(t.countA).padStart(7))} \u2192 ${o.cyan(String(t.countB).padStart(7))} ${fn(t.delta)}`+st(t,n)),n&&(t.added&&t.added.length>0&&Ee("added",t.added),t.removed&&t.removed.length>0&&Ee("removed",t.removed),t.changed&&t.changed.length>0&&Ee("changed",t.changed));console.log(""),e.identical?console.log(o.green(` Result: identical
|
|
90
|
+
`)):console.log(o.yellow(` Result: differences found
|
|
91
|
+
`))}function it(e){return!!(e.delta!==0||e.added&&e.added.length>0||e.removed&&e.removed.length>0||e.changed&&e.changed.length>0)}function fn(e){return e===0?o.gray("(\xB10)"):e>0?o.green(`(+${e})`):o.red(`(${e})`)}function st(e,n){let r=[];return e.added&&e.added.length>0&&r.push(o.green(`+${e.added.length}`)),e.removed&&e.removed.length>0&&r.push(o.red(`-${e.removed.length}`)),e.changed&&e.changed.length>0&&r.push(o.yellow(`~${e.changed.length}`)),r.length===0?"":n?" "+r.join(" "):" "+o.gray("[")+r.join(" ")+o.gray("]")}function Ee(e,n){let r=n.slice(0,10).join(", "),t=n.length>10?o.gray(` \u2026(+${n.length-10} more)`):"";console.log(` ${o.gray(e+":")} ${r}${t}`)}function lt(e){if(console.log(o.blue(`
|
|
92
|
+
Brain Search
|
|
93
|
+
`)),console.log(` Input: ${o.cyan(e.inputPath)}`),console.log(` Table: ${o.cyan(e.table)}`),console.log(` Scanned: ${o.cyan(e.totalScanned)} Matched: ${o.cyan(e.totalMatched)} Shown: ${o.cyan(e.hits.length)}`+(e.truncated?o.yellow(` (truncated to limit ${e.limit})`):"")),e.hits.length===0){console.log(o.yellow(`
|
|
94
|
+
No matching rows.
|
|
95
|
+
`));return}console.log("");for(let n of e.hits){let r=o.cyan(n.id)+(n.display.patternType?o.gray(` ${n.display.patternType}`):"")+(n.display.domain?o.gray(` [${n.display.domain}]`):"")+(n.display.confidence!==void 0?o.gray(` conf=${n.display.confidence.toFixed(2)}`):"");if(console.log(` ${r}`),n.display.name&&console.log(` ${o.bold(n.display.name)}`),n.display.description){let t=n.display.description.length>200?n.display.description.slice(0,200)+"\u2026":n.display.description;console.log(` ${o.gray(t)}`)}n.display.updatedAt&&console.log(` ${o.gray(n.display.updatedAt)}`),console.log("")}}function Ht(e,n){return new Ce(e,n)}export{Ce as BrainHandler,Ht as createBrainHandler};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import"./chunk-V6SE2ZU2.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.split(`
|
|
3
3
|
`),l=!1;for(let i=0;i<n.length;i++){let d=n[i],t=d.trim(),c=i+1,u=d.length-d.trimStart().length+1;if(l){t.includes("*/")&&(l=!1);continue}if(t.startsWith("/*")){l=!t.includes("*/");continue}if(t.startsWith("//"))continue;if(/^\s*if\s*\(/.test(d)&&(this.findMatchingElse(n,i)||r.push({file:s,line:c,column:u,language:this.language,construct:"if-without-else",triggerCondition:"when condition is false",currentHandling:"falls through \u2014 no else branch",suggestedGuard:"Add else branch or document why falsy path is safe",severity:"medium"})),/^\s*switch\s*\(/.test(d)){let a=this.extractBlock(n,i);if(a&&!a.includes("default:")&&!a.includes("default :")&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-no-default",triggerCondition:"when value matches no case",currentHandling:"falls through \u2014 no default case",suggestedGuard:"Add default case with error handling or exhaustive check",severity:"high"}),a){let g=a.match(/case\s+[^:]+:/g)||[],h=a.match(/\b(break|return|throw|continue)\b/g)||[];g.length>0&&h.length<g.length&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-missing-break",triggerCondition:"when case falls through to next case",currentHandling:"fall-through \u2014 may execute unintended cases",suggestedGuard:"Add break/return to each case or add explicit // falls through comment",severity:"medium"})}}if(/\bcatch\s*\(/.test(t)||/\bcatch\s*\{/.test(t)){let a=this.extractBlock(n,i);if(a!==null){let g=a.replace(/[{}]/g,"").trim();(g.length===0||/^\s*\/\//.test(g))&&r.push({file:s,line:c,column:u,language:this.language,construct:"try-empty-catch",triggerCondition:"when exception is thrown",currentHandling:"exception silently swallowed",suggestedGuard:"Log the error or rethrow with context",severity:"high"})}}if(/\btry\s*\{/.test(t)&&this.extractBlock(n,i)&&(n.slice(i,Math.min(i+30,n.length)).join(`
|
|
4
4
|
`).includes("finally")||r.push({file:s,line:c,column:u,language:this.language,construct:"try-no-finally",triggerCondition:"when cleanup is needed regardless of success/failure",currentHandling:"no finally block \u2014 cleanup may be skipped on exception",suggestedGuard:"Add finally block for resource cleanup if applicable",severity:"low"})),t.includes("?.")){let a=t.match(/(\w+(?:\.\w+)*)\?\./g)||[];for(let g of a)if(!t.includes("??")&&!t.includes("|| ")&&!t.includes("if")){r.push({file:s,line:c,column:u,language:this.language,construct:"optional-chaining-null-path",triggerCondition:`when ${g.replace("?.","")} is null/undefined`,currentHandling:"returns undefined \u2014 may propagate",suggestedGuard:"Add ?? fallback or explicit null check",severity:"low"});break}}if(t.includes("??")&&!t.includes("?.")&&r.push({file:s,line:c,column:u,language:this.language,construct:"nullish-coalescing-fallback",triggerCondition:"when left side is null/undefined",currentHandling:"uses fallback value",suggestedGuard:"Verify fallback value is appropriate for all null cases",severity:"low"}),/\.\s*then\s*\(/.test(t)&&!t.includes(".catch")&&!t.includes("await")){let a=n.slice(i,Math.min(i+5,n.length)).join(" ");!a.includes(".catch")&&!a.includes("try")&&r.push({file:s,line:c,column:u,language:this.language,construct:"promise-no-catch",triggerCondition:"when promise rejects",currentHandling:"unhandled rejection \u2014 may crash process",suggestedGuard:"Add .catch() handler or use try/catch with await",severity:"high"})}let p=["map","filter","reduce","forEach","find","some","every","flatMap"];for(let a of p)if(new RegExp(`\\.${a}\\s*\\(`).test(t)){let h=n.slice(Math.max(0,i-3),i).join(" ");if(!h.includes(".length")&&!h.includes("if (")&&!h.includes("?.")){r.push({file:s,line:c,column:u,language:this.language,construct:"array-callback-empty",triggerCondition:`when array is empty before .${a}()`,currentHandling:a==="reduce"?"may throw without initial value":"returns empty result \u2014 may cause downstream issues",suggestedGuard:a==="reduce"?"Provide initial value or check array length":"Check array length or handle empty result",severity:a==="reduce"?"high":"low"});break}}/\|\|\s*['"`\d]/.test(t)&&!t.includes("??")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-or-falsy",triggerCondition:'when left side is falsy (0, "", false, null, undefined)',currentHandling:'uses fallback \u2014 may unintentionally override 0, "", or false',suggestedGuard:"Use ?? instead of || if only null/undefined should trigger fallback",severity:"medium"}),/&&\s*\w+\s*\(/.test(t)&&!t.includes("if")&&!t.includes("while")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-and-short-circuit",triggerCondition:"when left side is falsy \u2014 right side never executes",currentHandling:"short-circuits \u2014 function call skipped silently",suggestedGuard:"Use explicit if-statement for clarity when side effects matter",severity:"low"}),(t.match(/\?/g)||[]).length>=2&&t.includes(":")&&r.push({file:s,line:c,column:u,language:this.language,construct:"ternary-complex",triggerCondition:"when nested ternary conditions interact",currentHandling:"nested ternary \u2014 hard to read and maintain",suggestedGuard:"Refactor to if/else or switch for readability",severity:"medium"}),(/\btypeof\s+\w+\s*===?\s*['"]/.test(t)||/\binstanceof\b/.test(t))&&!t.includes("else")&&!this.findMatchingElse(n,i)&&r.push({file:s,line:c,column:u,language:this.language,construct:"type-guard-unhandled",triggerCondition:"when value does not match the guarded type",currentHandling:"unguarded type path \u2014 may cause runtime type errors",suggestedGuard:"Add else branch or exhaustive type checking",severity:"medium"})}return r}findMatchingElse(e,s){let r={depth:0};for(let n=s;n<Math.min(s+30,e.length);n++){let l=e[n];for(let i of l)i==="{"&&r.depth++,i==="}"&&r.depth--;if(r.depth===0&&n>s){if((e[n+1]?.trim()||"").startsWith("else")||e[n].trim().endsWith("else")||e[n].trim().endsWith("else {")||e[n].includes("} else"))return!0;break}}return!1}extractBlock(e,s){let r=0,n=!1,l=[];for(let i=s;i<Math.min(s+50,e.length);i++){let d=e[i];for(let t of d)t==="{"&&(r++,n=!0),t==="}"&&r--;if(n&&(l.push(d),r===0))return l.join(`
|
|
5
5
|
`)}return null}};function y(o,e,s){let r=Date.now(),n=s||(e.endsWith(".ts")||e.endsWith(".tsx")?"typescript":"javascript"),i=new f(n).enumerate(o,e);return{file:e,language:n,branches:i,totalConstructs:i.length,unhandledCount:i.length,duration:Date.now()-r}}function b(o){let e=[];if(e.push(`# Branch Enumeration Report: ${o.file}`),e.push(""),e.push(`**Language**: ${o.language} | **Branches**: ${o.unhandledCount} | **Duration**: ${o.duration}ms`),e.push(""),o.branches.length===0)return e.push("No unhandled branches detected."),e.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a as m}from"./chunk-57FX3GP6.js";import{c,e as y}from"./chunk-UDSB3XCG.js";import"./chunk-V6SE2ZU2.js";import{readFile as w,readdir as W}from"fs/promises";import{join as f,basename as b,dirname as v}from"path";import{fileURLToPath as E}from"url";import{parse as d}from"yaml";y();var x=E(import.meta.url),O=v(x),l=class{templatesDir;cache=new Map;constructor(t){this.templatesDir=t||f(O,"templates")}async load(t){if(this.cache.has(t))return this.cache.get(t);try{let e=f(this.templatesDir,`${t}.yaml`),n=await w(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${t}:
|
|
3
3
|
${i.errors.join(`
|
|
4
4
|
`)}`);return this.cache.set(t,o),o}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${t}`):e}}async list(){try{return(await W(this.templatesDir)).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).map(e=>b(e,e.endsWith(".yaml")?".yaml":".yml")).sort()}catch(t){if(t.code==="ENOENT")return[];throw t}}async validate(t){let e=[],n=[];if(t.name||e.push("Workflow must have a name"),t.version||e.push("Workflow must have a version"),t.description||n.push("Workflow should have a description"),Array.isArray(t.variables)?t.variables.forEach((o,i)=>{o.name||e.push(`Variable at index ${i} must have a name`),o.type||e.push(`Variable ${o.name} must have a type`),o.required===void 0&&n.push(`Variable ${o.name} should specify if it's required`)}):e.push("Workflow must have a variables array"),!Array.isArray(t.steps))e.push("Workflow must have a steps array");else if(t.steps.length===0)e.push("Workflow must have at least one step");else{t.steps.forEach((r,s)=>{r.name||e.push(`Step at index ${s} must have a name`),r.action||e.push(`Step ${r.name||s} must have an action`),(!r.config||typeof r.config!="object")&&e.push(`Step ${r.name||s} must have a config object`),r.assertions&&Array.isArray(r.assertions)&&r.assertions.forEach((u,p)=>{u.condition||e.push(`Assertion ${p} in step ${r.name||s} must have a condition`),u.message||n.push(`Assertion ${p} in step ${r.name||s} should have a message`)})});let o=t.steps.map(r=>r.name),i=o.filter((r,s)=>o.indexOf(r)!==s);i.length>0&&e.push(`Duplicate step names found: ${i.join(", ")}`)}return{valid:e.length===0,errors:e,warnings:n}}async createContext(t,e){let n=await this.load(t),o=n.variables.filter(r=>r.required&&!Object.hasOwn(e,r.name)).map(r=>r.name);if(o.length>0)throw new Error(`Missing required variables: ${o.join(", ")}`);let i={};return n.variables.forEach(r=>{Object.hasOwn(e,r.name)?c(i,r.name,e[r.name]):"default"in r&&c(i,r.name,r.default)}),{variables:i,results:new Map,metadata:{startTime:Date.now(),workflow:n.name,templateName:t}}}async getMetadata(t){try{let e=f(this.templatesDir,`${t}.yaml`),n=await w(e,"utf-8"),o=d(n);return{name:o.name,version:o.version,description:o.description}}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${t}`):e}}clearCache(){this.cache.clear()}async reload(t){return this.cache.delete(t),this.load(t)}},T=new l;function g(a,t){return a.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{let i=n.trim().split("."),r=t;for(let s of i)if(r&&typeof r=="object"&&Object.hasOwn(r,s))r=r[s];else return e;return r!=null?String(r):e})}function A(a,t){let e={...t.variables,result:t.results.get("__last_result__")},n=g(a,e);return m(n,e,!1)}var h=["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"],R={"login-flow":"Authentication testing workflow for login forms with credential validation","oauth-flow":"OAuth2/OIDC authentication testing workflow with provider integration","scraping-workflow":"Data extraction workflow for web scraping with pagination and structured output","visual-regression":"Screenshot comparison workflow for visual regression testing across breakpoints","form-validation":"Input validation testing workflow for form fields with error handling","navigation-flow":"Multi-page navigation workflow for testing user journeys and state persistence","api-integration":"Browser-API hybrid testing workflow for validating frontend-backend integration","performance-audit":"Lighthouse-style performance audit workflow with Core Web Vitals","accessibility-audit":"WCAG 2.1 Level AA compliance audit workflow with automated accessibility testing"},k={authentication:["login-flow","oauth-flow"],testing:["form-validation","navigation-flow","api-integration"],quality:["visual-regression","performance-audit","accessibility-audit"],automation:["scraping-workflow"]};function L(a){return k[a]}function N(a){return h.includes(a)}function B(){return h.map(a=>{let t=Object.entries(k).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:R[a],category:t}})}export{k as WORKFLOW_CATEGORIES,R as WORKFLOW_DESCRIPTIONS,h as WORKFLOW_TEMPLATES,l as WorkflowLoader,T as defaultWorkflowLoader,A as evaluateCondition,B as getAllWorkflowTemplates,L as getWorkflowsByCategory,g as interpolateVariables,N as isValidWorkflowTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-P2TPH3TC.js";import"./chunk-NPCXGX7N.js";import"./chunk-HTVGHHX2.js";import"./chunk-QUZ745UQ.js";import"./chunk-JK6PMLQQ.js";import"./chunk-6NIGSY5L.js";import"./chunk-XN3KCKAM.js";import"./chunk-UDSB3XCG.js";import"./chunk-Z54G2YOL.js";import"./chunk-HEDGFKC5.js";import"./chunk-AJVLVF7V.js";import"./chunk-7SQTLUEN.js";import"./chunk-57DRT6UA.js";import"./chunk-K7GFYFBO.js";import"./chunk-BNG4J3CE.js";import"./chunk-QP6GL3O5.js";import"./chunk-LTGQJYYO.js";import"./chunk-YKQWIXUY.js";import"./chunk-C3OIBFAA.js";import"./chunk-IRPNEXOU.js";import"./chunk-7QUSNBAA.js";import"./chunk-E7OR6V3V.js";import"./chunk-2UZBLC5H.js";import"./chunk-CAZM63TP.js";import"./chunk-INGXD5IX.js";import"./chunk-L5VSLPMW.js";import"./chunk-U6IOQKCT.js";import"./chunk-V6SE2ZU2.js";export{a as BrowserWorkflowTool};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as C,d as P}from"./chunk-WTAUF6O4.js";import{a as w,d as M}from"./chunk-ZROAMFX2.js";import{a as T}from"./chunk-UJNGGFGX.js";import{c as S}from"./chunk-ADUAJIAU.js";import{a as b,e as $}from"./chunk-W4II6SIH.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{b as C,d as P}from"./chunk-XN3KCKAM.js";import{a as w,d as M}from"./chunk-AJVLVF7V.js";import{a as T}from"./chunk-YKQWIXUY.js";import{c as S}from"./chunk-C3OIBFAA.js";import{a as b,e as $}from"./chunk-L5VSLPMW.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
|
|
3
3
|
|
|
4
4
|
> ${c} Generated: ${e.timestamp.toISOString()}
|
|
5
5
|
> Run ID: ${e.runId}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-37PUFKQD.js");if(!d())return null;let{getUnifiedMemory:v,findProjectRoot:p}=await import("./unified-memory-QARWQKJ2.js"),o=v().getDatabase();if(!o)return null;let{join:m}=await import("node:path"),g=m(process.env.AQE_PROJECT_ROOT??p(),".agentic-qe","brain.rvf"),{RvfDualWriter:R}=await import("./rvf-dual-writer-WHBFQJVU.js"),l=new R(o,{rvfPath:g,mode:"dual-write",dimensions:384});await l.initialize(),e=l;try{let{getRvfMigrationStage:y}=await import("./feature-flags-5JCSKL2P.js"),a=y();if(a>=2){let{RvfMigrationAdapter:A}=await import("./rvf-migration-adapter-YT3APF2I.js"),s=new A({stage:a});s.setSqliteDb(o);let{getSharedRvfAdapter:D}=await import("./shared-rvf-adapter-ABY7PAY2.js"),i=D();if(i){let h={ingest:n=>i.ingest(n),search:(n,M)=>i.search(n,M).map(c=>({id:c.id,score:c.score})),delete:n=>i.delete(n),status:()=>i.status(),close:()=>{}};s.setRvfStore(h)}f=s,console.log(`[RVF] Migration adapter active at stage ${a} (${["sqlite-only","hybrid","dual-sqlite","dual-rvf","rvf-primary"][a]})`)}}catch{}return l}catch(r){return(process.env.DEBUG||process.env.AQE_VERBOSE)&&console.debug("[RVF] Dual-writer init failed, degrading to sqlite-only:",r instanceof Error?r.message:r),null}finally{u=!0,t=null,import("./base-XPWGYDKD.js").then(({registerRvfResetFn:r})=>r(w)).catch(()=>{})}})(),t)}function S(){return e}function b(){return f}function w(){if(e){try{e.close()}catch{}e=null}f=null,t=null,u=!1}export{W as a,S as b,b as c,w as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
2
|
var v="quality-assessment";var p=["coverage","testsPassing","criticalBugs","codeSmells","securityVulnerabilities","technicalDebt","duplications"],g={coverage:{direction:"min",value:80,severity:"high"},testsPassing:{direction:"min",value:95,severity:"critical"},criticalBugs:{direction:"max",value:0,severity:"critical"},codeSmells:{direction:"max",value:20,severity:"medium"},securityVulnerabilities:{direction:"max",value:0,severity:"critical"},technicalDebt:{direction:"max",value:5,severity:"medium"},duplications:{direction:"max",value:5,severity:"low"}};function f(e){return`quality-evidence:${e}:latest`}function E(e,t,r){if(typeof e!="string")throw new Error("Measured quality evidence is malformed: measuredAt is required.");let i=Date.parse(e);if(!Number.isFinite(i))throw new Error("Measured quality evidence is malformed: measuredAt is invalid.");if(i>t+6e4)throw new Error("Measured quality evidence is malformed: measuredAt is in the future.");if(t-i>r)throw new Error("Measured quality evidence is stale. Run the relevant quality analyzers again.");return i}function h(e,t,r,i){if(!e||typeof e!="object")throw new Error(`No measured quality evidence found for ${t}.`);let a=e;if(a.schemaVersion!==1||a.metric!==t||!Number.isFinite(a.value)||a.value<0||typeof a.source!="string"||a.source.trim().length===0)throw new Error(`Measured quality evidence for ${t} is malformed or incomplete.`);E(a.measuredAt,r,i)}async function b(e,t,r){let i=Date.now();if(E(r.measuredAt,i,Number.POSITIVE_INFINITY),r.source.trim().length===0)throw new Error("Quality evidence source is required.");for(let a of p){let s=t[a];if(s===void 0)continue;if(!Number.isFinite(s)||s<0)throw new Error(`Quality evidence value for ${a} must be a non-negative finite number.`);let n={schemaVersion:1,metric:a,value:s,measuredAt:r.measuredAt,source:r.source,...r.runId?{runId:r.runId}:{},...r.runStatus?{runStatus:r.runStatus}:{}};await e.set(f(a),n,{namespace:v,persist:!0})}}function Q(e){let t=e.passed+e.failed+(e.skipped??0);return t>0?e.passed/t*100:0}async function A(e,t,r){let i=t.failed>0?"failed":"passed",a={measuredAt:r.measuredAt??new Date().toISOString(),source:r.source,runId:t.runId,runStatus:i};await b(e,{testsPassing:Q(t),...typeof r.coverage=="number"&&Number.isFinite(r.coverage)?{coverage:r.coverage}:{}},a)}var m="insufficient-evidence",c="no MCP tool or CLI command records it yet, so supply it from your own measurement",M={coverage:"run the tests with coverage instrumentation enabled so measured line coverage is recorded (a static estimate is not measured coverage)",testsPassing:"run the test suite (test_execute_parallel, or `aqe test execute`)",security:"static analysis never measures security; drop it from metrics and use security_scan_comprehensive (or `aqe security`) for findings",securityVulnerabilities:`a measured vulnerability count is required; ${c}`,criticalBugs:`a measured critical-bug count is required; ${c}`,codeSmells:`a measured code-smell count is required; ${c}`,technicalDebt:`a measured technical-debt ratio is required; ${c}`,duplications:`a measured duplication percentage is required; ${c}`,complexity:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse",maintainability:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse",testability:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse",duplication:"make sure the target contains readable TypeScript/JavaScript source the analyzer can parse"};function I(e){return e.map(t=>`Insufficient evidence: ${t} not measured \u2014 ${M[t]??"measure it"}.`)}var y=class extends Error{status=m;unmeasured;problems;constructor(t){super(t[0]?.reason??"Measured quality evidence is unavailable."),this.name="InsufficientQualityEvidenceError",this.problems=t,this.unmeasured=t.map(r=>r.metric)}toDetails(){return{passed:!1,status:m,evidenceStatus:m,unmeasured:this.unmeasured,gateEvaluated:!1,recommendations:I(this.unmeasured)}}};async function w(e,t={}){let r=t.now??Date.now(),i=t.maxAgeMs??864e5,a={},s=[],n={};for(let u of p){let d=await e.get(f(u),{namespace:v});try{h(d,u,r,i),a[u]=d.value,n[u]=d}catch(l){s.push({metric:u,reason:l instanceof Error?l.message:String(l)})}}let o=n.coverage;return o?.runStatus==="failed"&&(!o.runId||n.testsPassing?.runId!==o.runId)&&(delete a.coverage,s.push({metric:"coverage",reason:"Measured coverage comes from a run with failing tests, but no testsPassing evidence from that same run was recorded. Re-run the test suite."})),{values:a,problems:s}}async function N(e,t,r={}){let i=await e.get(f(t),{namespace:v});try{return h(i,t,r.now??Date.now(),r.maxAgeMs??864e5),i}catch{return null}}async function S(e,t={}){let{values:r,problems:i}=await w(e,t);if(i.length>0)throw new y(i);return r}function x(e={}){if(e.coverage!==void 0&&(!Number.isFinite(e.coverage)||e.coverage<0||e.coverage>100))throw new Error("Coverage quality threshold must be a finite number between 0 and 100.");return{...g,...e.coverage!==void 0?{coverage:{...g.coverage,value:e.coverage}}:{}}}function T(e,t={}){let r=x(t),i=p.map(a=>{let s=r[a],n=e[a];return{name:a,value:n,threshold:s.value,direction:s.direction,severity:s.severity,passed:s.direction==="min"?n>=s.value:n<=s.value}});return{passed:i.every(a=>a.passed),checks:i,recommendations:i.filter(a=>!a.passed).map(a=>`${a.name} failed its measured ${a.direction} threshold.`)}}export{p as a,g as b,b as c,A as d,m as e,I as f,y as g,w as h,N as i,S as j,x as k,T as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as g,b as d,c as u,e as m,f as S}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a as g,b as d,c as u,e as m,f as S}from"./chunk-CAZM63TP.js";import{b as O}from"./chunk-V6SE2ZU2.js";import*as c from"fs";import*as j from"os";import*as t from"path";function k(){o=null,f=null}function v(n){let e=m(n);return R.has(e)||(R.add(e),console.error(`[AQE] No project marker found and "${n}" is a shared temp/system directory; using the private scratch root "${e}" instead of creating a shared .agentic-qe store there. Set AQE_PROJECT_ROOT to choose a root.`)),e}function T(...n){return t.join(x(),".agentic-qe",...n)}function _(n,e){let s=t.relative(e,n);return s===""||!s.startsWith("..")&&!t.isAbsolute(s)}function x(n=process.cwd()){if(process.env.AQE_PROJECT_ROOT)return process.env.AQE_PROJECT_ROOT;let e=t.resolve(n);if(o&&f===e)return o;f=e;let s=t.parse(e).root,l=null;try{l=t.resolve(j.homedir())}catch{l=null}let r=e,a=null,i=null,h=null;for(;r!==s&&!g(r);){let p=c.existsSync(t.join(r,".git")),y=!p&&d(r),P=r===l&&r!==e&&!_(e,t.join(r,".agentic-qe"));i===null&&!P&&!y&&c.existsSync(t.join(r,".agentic-qe"))&&a===null&&(a=r),p&&i===null&&(i=r),c.existsSync(t.join(r,"package.json"))&&(h=r),r=t.dirname(r)}return a?o=a:i?o=i:h?o=h:u(e)?o=v(e):o=e,o}var o,f,R,A=O(()=>{S();S();o=null,f=null;R=new Set});export{k as a,T as b,x as c,A as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as h,d as v,f as T}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{b as h,d as v,f as T}from"./chunk-V6SE2ZU2.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>C,LinearAttention:()=>j,MoEAttention:()=>W,MultiHeadAttention:()=>F,RuvectorLayer:()=>I,SonaEngine:()=>K,TensorCompress:()=>E,default:()=>_,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>q});import{createRequire as A}from"module";var O,g,_,I,E,L,V,B,D,k,z,F,C,j,W,K,q,R=h(()=>{O=A(import.meta.url),g=O("@ruvector/rvf-node"),_=g,{RuvectorLayer:I,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:C,LinearAttention:j,MoEAttention:W,SonaEngine:K,pipeline:q}=g||{}});var Z={};v(Z,{createRvfStore:()=>$,isRvfNativeAvailable:()=>X,openRvfStore:()=>G,openRvfStoreReadonly:()=>U});import{readFileSync as J,writeFileSync as H,copyFileSync as Q,existsSync as Y}from"fs";function c(){if(S)return m;S=!0;try{let s=(R(),T(y));!s.RvfDatabase&&s.default&&s.default.RvfDatabase&&(s=s.default),m=s}catch{m=null}return m}function w(s){return`${s}.idmap.json`}function N(s){let e=w(s),t=new Map,n=new Map,i=1;if(Y(e))try{let r=JSON.parse(J(e,"utf-8"));i=r.nextLabel;for(let[a,p]of r.entries)t.set(a,p),n.set(p,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:i}}function b(s,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(s),JSON.stringify(n),"utf-8")}function $(s,e){let t=c();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(s,{dimension:e}),i=n.dimension();return new d(n,s,i,new Map,new Map,1)}function G(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function U(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function X(){return process.env.AQE_MEMORY_BACKEND==="memory"?!1:c()!==null}var m,S,d,P=h(()=>{m=null,S=!1;d=class s{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,i,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=i,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),i=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:f,metadata:x}=e[o],l=this.strToNum.get(u);l===void 0&&(l=this.nextLabel++,this.strToNum.set(u,l),this.numToStr.set(l,u)),i.push(l),r.push(x);let M=f instanceof Float32Array?f:new Float32Array(f);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,i,o)}else a=this.db.ingestBatch(n,i);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}has(e){return this.ensureOpen(),this.strToNum.has(e)}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let i of e){let r=this.strToNum.get(i);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let i of e){let r=this.strToNum.get(i);r!==void 0&&(this.strToNum.delete(i),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),Q(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);b(e,t,this.nextLabel);let r=c().RvfDatabase.open(e);return new s(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(i=>i.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length,deadSpaceRatio:typeof e.deadSpaceRatio=="number"?e.deadSpaceRatio:0}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen();try{let e=this.db.compact();return e&&typeof e=="object"?{segmentsCompacted:typeof e.segmentsCompacted=="number"?e.segmentsCompacted:0,bytesReclaimed:typeof e.bytesReclaimed=="number"?e.bytesReclaimed:0,epoch:typeof e.epoch=="number"?e.epoch:0}:{segmentsCompacted:0,bytesReclaimed:0,epoch:0}}catch{return null}}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=c();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),i=new Map(this.strToNum),r=new Map(this.numToStr);return b(e,i,this.nextLabel),new s(n,e,this._dimension,i,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){b(this._path,this.strToNum,this.nextLabel)}}});export{$ as a,G as b,U as c,X as d,Z as e,P as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as Z}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a as Z}from"./chunk-PWQWKYBG.js";import{a as C,e as x,f as X}from"./chunk-YGC5QKQ4.js";import{a as O}from"./chunk-TWOV3I3A.js";import{a as F,b as H,c as G,d as j,e as V,f as Y,h as K}from"./chunk-Z2S7DNFP.js";import{c as $,d as J}from"./chunk-HHBF2BZC.js";import{a as W,b as _,g as z,j as U}from"./chunk-JJHLGGPP.js";import{i as B}from"./chunk-HV43NX4A.js";import{b as w,d as re}from"./chunk-XN3KCKAM.js";import{b as D,h as q,j as M,l as L,m as v,s as A}from"./chunk-L752CNG3.js";import{i as N}from"./chunk-QP6GL3O5.js";import{c as p,d as h}from"./chunk-RE6JTSDM.js";import{a as ie}from"./chunk-YKQWIXUY.js";import{c as T}from"./chunk-C3OIBFAA.js";import{a as b,b as y,e as ne}from"./chunk-L5VSLPMW.js";ie();ne();re();var o=T.create("RealQEReasoningBank"),ae={sqlite:{dbPath:".agentic-qe/memory.db",walMode:!0,useUnified:!0},embeddings:{modelName:"Xenova/all-MiniLM-L6-v2",quantized:!0,enableCache:!0},enableLearning:!0,enableRouting:!0,enableGuidance:!0,hnsw:{M:16,efConstruction:200,efSearch:100},routingWeights:{similarity:.3,performance:.4,capabilities:.3},coherenceThreshold:.4,embedderRetryIntervalMs:6e4},k=class{constructor(e={},t){this.coherenceService=t;this.qeConfig={...ae,...e},this.sqliteStore=B(this.qeConfig.sqlite),this.asymmetricEngine=new Z,this.embedderRecovery=new Y({retryIntervalMs:this.qeConfig.embedderRetryIntervalMs,probe:()=>this.probeEmbedderForRetry(),onRecovered:()=>o.info("Embedder available again: pattern search uses vectors"),onRetryFailed:n=>o.debug("Embedder still unavailable",{error:b(n)})})}coherenceService;qeConfig;sqliteStore;hnswIndex=null;patternIdMap=new Map;initialized=!1;embedderRecovery;stats={routingRequests:0,totalRoutingLatency:0,learningOutcomes:0,successfulOutcomes:0};routingLatencies=new O(1e3);asymmetricEngine;agentCapabilities={"qe-test-generator":{domains:["test-generation"],capabilities:["test-generation","tdd","bdd","unit-test","integration-test"],performanceScore:.85},"qe-coverage-analyzer":{domains:["coverage-analysis"],capabilities:["coverage-analysis","gap-detection","risk-scoring"],performanceScore:.92},"qe-coverage-specialist":{domains:["coverage-analysis"],capabilities:["sublinear-analysis","branch-coverage","mutation-testing"],performanceScore:.88},"qe-test-architect":{domains:["test-generation","coverage-analysis"],capabilities:["test-strategy","test-pyramid","architecture"],performanceScore:.9},"qe-api-contract-validator":{domains:["contract-testing"],capabilities:["contract-testing","openapi","graphql","pact"],performanceScore:.87},"qe-security-auditor":{domains:["security-compliance"],capabilities:["sast","dast","vulnerability","owasp"],performanceScore:.82},"qe-visual-tester":{domains:["visual-accessibility"],capabilities:["screenshot","visual-regression","percy","chromatic"],performanceScore:.8},"qe-a11y-ally":{domains:["visual-accessibility"],capabilities:["wcag","aria","screen-reader","contrast"],performanceScore:.85},"qe-performance-tester":{domains:["chaos-resilience"],capabilities:["load-testing","stress-testing","k6","artillery"],performanceScore:.83},"qe-flaky-investigator":{domains:["test-execution"],capabilities:["flaky-detection","test-stability","retry"],performanceScore:.78},"qe-chaos-engineer":{domains:["chaos-resilience"],capabilities:["chaos-testing","resilience","fault-injection"],performanceScore:.75}};async initialize(){if(this.initialized)return;let e=performance.now();await this.sqliteStore.initialize(),o.info("SQLite persistence initialized");try{await q(D,this.qeConfig.embeddings)}catch(i){this.embedderRecovery.markUnavailable(b(i)),o.warn("No embedding runtime: patterns are stored without vectors (pending `aqe learning backfill-embeddings`) and searched by text matching only",{reason:this.embedderRecovery.unavailableReason})}this.embedderRecovery.unavailableReason===null&&(await this.initializeHNSW(),o.info("HNSW index initialized"),await this.loadPatternsIntoHNSW()),this.sqliteStore.getStats().totalPatterns===0&&(this.sqliteStore.hasAnyHistoricalData?.()??!1?o.error("qe_patterns table is EMPTY but historical data exists \u2014 possible data loss! Restore from backup instead of loading seed patterns. Skipping foundational pattern load to avoid masking data loss."):await this.loadFoundationalPatterns()),this.initialized=!0;let n=performance.now()-e;o.info("Fully initialized",{durationMs:Math.round(n)})}getPatternSearchStatus(){let e=this.embedderRecovery.unavailableReason;return e===null?{mode:"vector"}:{mode:"lexical-only",reason:e}}async embedOrUndefined(e){if(this.embedderRecovery.isAvailable())try{return await q(e,this.qeConfig.embeddings)}catch(t){let n=`Embedder failed at runtime: ${b(t)}`;this.embedderRecovery.markUnavailable(n)&&o.warn("Embedder failed: patterns are stored without vectors and searched by text matching only until it recovers",{reason:n});return}}async probeEmbedderForRetry(){await V(this.qeConfig.embeddings),this.hnswIndex||(await this.initializeHNSW(),await this.loadPatternsIntoHNSW())}async initializeHNSW(){try{let e=await import("./hnswlib-node-NZY3E5EN.js"),n=e.default?.HierarchicalNSW||e.HierarchicalNSW;if(typeof n!="function")throw new Error("HierarchicalNSW not found in hnswlib-node module");let i=n,r=v();this.hnswIndex=new i("cosine",r),this.hnswIndex.initIndex(1e5,this.qeConfig.hnsw.M,this.qeConfig.hnsw.efConstruction),this.hnswIndex.setEf(this.qeConfig.hnsw.efSearch),o.info("HNSW initialized",{dimension:r,M:this.qeConfig.hnsw.M})}catch(e){throw o.error("HNSW initialization failed",e instanceof Error?e:void 0),e}}async loadPatternsIntoHNSW(){if(!this.hnswIndex)return;let e=this.sqliteStore.getAllEmbeddings(),t=v(),n=0,i=0,r=A()?.spaceId;for(let{patternId:s,embedding:a,spaceId:l}of e){if(!r||l!==r||!a||!Array.isArray(a)||a.length!==t){i++;continue}let c=this.hnswIndex.getCurrentCount();this.hnswIndex.addPoint(a,c),this.patternIdMap.set(c,s),n++}i>0&&o.warn("Skipped invalid embeddings",{skipped:i,expectedDim:t}),o.info("Loaded patterns into HNSW index",{count:n})}async loadFoundationalPatterns(){let e=[{patternType:"test-template",name:"AAA Unit Test",description:"Arrange-Act-Assert pattern for clear, maintainable unit tests",template:{type:"code",content:`describe('{{className}}', () => {
|
|
3
3
|
describe('{{methodName}}', () => {
|
|
4
4
|
it('should {{expectedBehavior}}', {{async}} () => {
|
|
5
5
|
// Arrange
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as o,b as s,c as n,f as a}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{a as o,b as s,c as n,f as a}from"./chunk-CAZM63TP.js";a();import{existsSync as d,statSync as l}from"node:fs";import{join as u,resolve as p}from"node:path";function c(r=process.cwd(),t=process.env){return p(r,t.AQE_PROJECT_ROOT||".")}function E(r,t){return(t?o(r)||s(r)&&!d(u(r,".git")):n(r))?`Refusing to initialize in "${r}": it is a shared temp/system directory, so a store here would be shared by every unrelated project below it and later commands would not use it. Create a project directory first (mkdir my-project && cd my-project) or set AQE_PROJECT_ROOT to a project directory.`:null}function O(r,t=process.env){return E(c(r,t),!!t.AQE_PROJECT_ROOT)}function h(r=process.cwd(),t=process.env){if(!t.AQE_PROJECT_ROOT)return null;let e=c(r,t),i=!1;try{i=l(e).isDirectory()}catch{i=!1}return i?null:`AQE_PROJECT_ROOT "${e}" is not an existing directory. Create it first (mkdir -p) or correct the path; aqe init does not create the project root.`}export{c as a,E as b,O as c,h as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{e as l,l as c}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{e as l,l as c}from"./chunk-NPCXGX7N.js";import{a as i}from"./chunk-EC65UZ77.js";import{a as n,e as h}from"./chunk-L5VSLPMW.js";h();var d=class extends c{config={name:"qe/tests/schedule",description:"Schedule and execute tests using phase-based pipeline with git-aware selection and flaky tracking. Runs tests in phases (unit, integration, e2e), selects affected tests from git changes, and tracks flaky tests.",domain:"test-execution",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{cwd:{type:"string",description:"Working directory for test execution (defaults to project root)"},gitRef:{type:"string",description:'Git ref to compare for affected test selection (e.g., "main", "HEAD~3")'},useGitAware:{type:"boolean",description:"Enable git-aware test selection to only run affected tests",default:!0},trackFlaky:{type:"boolean",description:"Enable flaky test tracking and quarantine",default:!0}}}}async execute(s,o){if(s.gitRef!==void 0){let a=i(s.gitRef,"gitRef");if(a)return{success:!1,error:a}}try{let{runTestPipeline:a}=await import("./test-scheduling-7XYXI4L2.js"),u=await l(o),t=await a({cwd:s.cwd||process.cwd(),memory:u,baseRef:s.gitRef,flakyHistoryPath:s.trackFlaky!==!1?".agentic-qe/flaky-history.json":void 0,runAllTests:s.useGitAware===!1}),f=t.phaseResults.reduce((e,r)=>e+r.totalTests,0),p=t.phaseResults.reduce((e,r)=>e+r.passed,0),g=t.phaseResults.reduce((e,r)=>e+r.failed,0);return{success:!0,data:{pipelineId:o.requestId,phases:t.phaseResults.map(e=>({phaseId:e.phaseId,phaseName:e.phaseName,totalTests:e.totalTests,passed:e.passed,failed:e.failed,passRate:e.passRate,durationMs:e.durationMs})),gitAware:{enabled:!t.ranAllTests,selectedTests:t.selectedTests.length,gitRef:s.gitRef},flakyTracking:{enabled:s.trackFlaky!==!1},totalDuration:t.totalDurationMs,ranAllTests:t.ranAllTests,summary:`Executed ${t.phaseResults.length} phases, ${f} tests (${p} passed, ${g} failed) in ${t.totalDurationMs}ms`}}}catch(a){return{success:!1,error:n(a)}}}};export{d as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as N}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{b as N}from"./chunk-V6SE2ZU2.js";import{execFileSync as b,spawn as R}from"node:child_process";import{readdirSync as I,readFileSync as k}from"node:fs";function v(t){for(let s of I("/proc")){if(!/^\d+$/.test(s))continue;let o;try{o=k(`/proc/${s}/stat`,"utf8")}catch(a){if(["ENOENT","ESRCH"].includes(a.code??""))continue;throw a}let r=o.slice(o.lastIndexOf(")")+1).trim().split(/\s+/);if(r.length<3||!/^\d+$/.test(r[2]))throw new Error(`Invalid process stat for ${s}`);if(Number(r[2])===t&&r[0]!=="Z"&&r[0]!=="X")return!0}return!1}function J(t){let s=b("ps",["-axo","pgid=,stat="],{encoding:"utf8",timeout:1e3,maxBuffer:1048576});for(let o of s.split(`
|
|
3
3
|
`)){if(!o.trim())continue;let r=/^\s*(\d+)\s+([A-Z?])\S*\s*$/.exec(o);if(!r)throw new Error("Could not determine Darwin process group state");if(Number(r[1])===t&&r[2]!=="Z")return!0}return!1}function O(t){let s=t.pid;return process.platform==="win32"||s===void 0?()=>{}:(g.size===0&&process.once("exit",P),g.add(s),()=>{g.delete(s),g.size===0&&process.off("exit",P)})}function G(t){return new Promise((s,o)=>{let r=process.platform,a=r==="linux",p=process.platform!=="win32"&&t.pid!==void 0,E=process.platform==="win32"&&t.pid!==void 0,d,i=!1,m=!1,w=!1,u=!1,f=()=>{i||(i=!0,clearTimeout(d),t.off("close",S),s())},c=e=>{i||(i=!0,clearTimeout(d),t.off("close",S),o(e))},T=()=>{try{return process.kill(-t.pid,0),m&&a?v(t.pid):!0}catch(e){if(e.code==="ESRCH")return!1;if(r==="darwin"&&e.code==="EPERM")return J(t.pid);if(m&&a&&e.code==="EPERM")return v(t.pid);throw e}},x=e=>{try{return process.kill(-t.pid,e),!0}catch(n){if(n.code==="ESRCH")return!1;throw n}},S=()=>{w=!0;try{if(E){u&&f();return}(!p||!T())&&f()}catch(e){c(e)}};t.once("close",S);try{if(p){if(!x("SIGTERM")){f();return}d=setTimeout(()=>{try{if(!x("SIGKILL")){f();return}m=!0;let e=Date.now()+1e3,n=()=>{try{T()?Date.now()>=e?c(new Error(`Test runner group ${t.pid} survived SIGKILL.`)):d=setTimeout(n,20):f()}catch(l){c(l)}};n()}catch(e){c(e)}},1e3)}else if(E){let e=R("taskkill",["/PID",String(t.pid),"/T","/F"],{stdio:"ignore",windowsHide:!0,timeout:2e3});e.once("error",c),e.once("close",n=>{n!==0?c(new Error(`Test runner tree termination failed (taskkill exit ${n}).`)):(u=!0,w&&f())})}else{if(t.kill("SIGTERM"),i)return;d=setTimeout(()=>{t.kill("SIGKILL")},1e3)}}catch(e){c(e)}})}function M(t,s,o){let r=o.maxBuffer??L;return new Promise(a=>{let p="",E="",d,i,m,w=!1,u;try{u=R(t,[...s],{cwd:o.cwd,env:o.env??process.env,detached:process.platform!=="win32",stdio:["ignore","pipe","pipe"]})}catch(e){a({status:null,signal:null,stdout:p,stderr:E,error:e});return}let f=O(u),c=(e,n)=>{if(w)return;w=!0,clearTimeout(x),clearTimeout(m);let h={status:i?null:e,signal:i&&!n?"SIGTERM":n,stdout:p,stderr:E,error:d},y=()=>{f(),a(h)};i?i.then(y,y):y()},T=(e,n)=>{if(i)return;d=Object.assign(new Error(n),{code:e,syscall:`spawnSync ${t}`}),i=G(u);let l=()=>{u.stdout?.destroy(),u.stderr?.destroy()};i.then(l,l),m=setTimeout(l,$)},x=setTimeout(()=>T("ETIMEDOUT",`spawnSync ${t} ETIMEDOUT`),o.timeout),S=e=>n=>{if(i)return;let l=(e==="stdout"?p:E)+n,h=l.length>r?l.slice(0,r):l;e==="stdout"?p=h:E=h,l.length>r&&T("ENOBUFS",`spawnSync ${t} ENOBUFS`)};u.stdout?.setEncoding("utf8").on("data",S("stdout")),u.stderr?.setEncoding("utf8").on("data",S("stderr")),u.once("error",e=>{d??=e,u.pid===void 0&&c(null,null)}),u.once("close",(e,n)=>c(e,n))})}async function B(t,s,o){let r=await M(t,s,o);if(r.error)throw r.error;if(r.status!==0)throw Object.assign(new Error(`${t} exited with ${r.status??r.signal}: ${r.stderr.trim()}`),{status:r.status,stderr:r.stderr});return r.stdout}var g,P,L,$,C=N(()=>{g=new Set,P=()=>{for(let t of g)try{process.kill(-t,"SIGKILL")}catch{}};L=1024*1024,$=3e3});export{O as a,G as b,M as c,B as d,C as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{d as m}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
|
+
import{d as m}from"./chunk-AJVLVF7V.js";import{d as T}from"./chunk-BNG4J3CE.js";T();function p(t,r,o){let e=0,n=t.length;for(;e<n;){let i=e+n>>>1;o(t[i],r)<=0?e=i+1:n=i}return e}function a(t,r,o){let e=p(t,r,o);return t.splice(e,0,r),e}function s(){return(t,r)=>t.createdAt.getTime()-r.createdAt.getTime()}m();export{a,s as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
|
|
2
2
|
import{writeFileSync as p,readFileSync as m}from"node:fs";import{resolve as f,dirname as u,join as g}from"node:path";import{mkdirSync as h}from"node:fs";import{fileURLToPath as y}from"node:url";function v(){try{let e=typeof __dirname<"u"?__dirname:u(y(import.meta.url));for(let n=0;n<5;n++){let t=g(e,"package.json");try{let r=JSON.parse(m(t,"utf-8"));if(r.version)return r.version}catch{}e=u(e)}}catch{}return"unknown"}function d(e){return e.status??e.evidence?.completeness??"unverified"}var T=["-F, --format <format>","Output format (text|json|sarif|junit|markdown)","text"],w=["-o, --output <path>","Write output to file instead of stdout"];function C(e,n,t){if(n){let r=f(n);h(u(r),{recursive:!0}),p(r,e,"utf-8"),t&&console.log(t),console.log(`Output written to: ${r}`)}else console.log(e)}function S(e){return JSON.stringify(e,null,2)}var $="https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json";function E(e){let n=d(e),t=s=>{switch(s.toLowerCase()){case"critical":case"high":return"error";case"medium":return"warning";case"low":case"info":return"note";default:return"warning"}},r=new Map,o=[];for(let s of e.vulnerabilities){let a=s.ruleId||`AQE/${s.type.replace(/\s+/g,"-").toLowerCase()}`;r.has(a)||r.set(a,{id:a,name:s.type,shortDescription:s.type,...s.cweId?{helpUri:`https://cwe.mitre.org/data/definitions/${s.cweId.replace("CWE-","")}.html`}:{}}),o.push({ruleId:a,level:t(s.severity),message:{text:s.message},locations:[{physicalLocation:{artifactLocation:{uri:s.file,uriBaseId:"%SRCROOT%"},region:{startLine:s.line,startColumn:1}}}],...s.cweId?{taxa:[{id:s.cweId,toolComponent:{name:"CWE"}}]}:{}})}let i={$schema:$,version:"2.1.0",runs:[{tool:{driver:{name:"agentic-qe",version:v(),informationUri:"https://github.com/proffesor-for-testing/agentic-qe",rules:Array.from(r.values()).map(s=>({id:s.id,name:s.name,shortDescription:{text:s.shortDescription},...s.helpUri?{helpUri:s.helpUri}:{},defaultConfiguration:{level:"warning"}}))}},results:o,properties:{securityScan:{status:n,target:e.target,scanType:e.scanType,coverage:e.evidence?e.coverage:void 0,evidence:e.evidence,discovery:e.discovery,checks:e.checks}},invocations:[{executionSuccessful:n==="complete",...n==="complete"?{}:{toolExecutionNotifications:[{level:"warning",message:{text:`Security analysis ${n}; findings do not establish complete coverage.`}}]}}]}]};return JSON.stringify(i,null,2)}function c(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function F(e){let n=e.tests||[],t=e.passed+e.failed+e.skipped,r=(e.duration/1e3).toFixed(3),o=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
`;if(o+=`<testsuites tests="${t}" failures="${e.failed}" errors="0" time="${r}">
|
|
4
4
|
`,o+=` <testsuite name="aqe-test-run" tests="${t}" failures="${e.failed}" errors="0" skipped="${e.skipped}" time="${r}" id="${c(e.runId)}">
|