agentic-qe 3.14.5 → 3.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +150 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/ag-ui/event-types.d.ts +1 -1
- package/dist/audit/witness-chain-hash.d.ts +18 -0
- package/dist/audit/witness-chain-hash.js +37 -0
- package/dist/audit/witness-chain-repair.d.ts +71 -0
- package/dist/audit/witness-chain-repair.js +203 -0
- package/dist/audit/witness-chain-verifier.d.ts +152 -0
- package/dist/audit/witness-chain-verifier.js +293 -0
- package/dist/audit/witness-chain.d.ts +10 -43
- package/dist/audit/witness-chain.js +16 -106
- package/dist/audit/witness-findings.js +4 -1
- package/dist/cli/bundle.js +8 -8
- package/dist/cli/chunks/adapter-TVQKH65T.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-AK2W76RG.js +2 -0
- package/dist/cli/chunks/{agent-handler-V6CZ7Q6S.js → agent-handler-MGZCWHIY.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-ZMD6ULC3.js → agent-memory-branch-JZ54MCSP.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +2 -0
- package/dist/cli/chunks/{arena-QLSBESC7.js → arena-CUVH3V7H.js} +2 -2
- package/dist/cli/chunks/{arena-4UPAEHFT.js → arena-YSWTKBCL.js} +4 -4
- package/dist/cli/chunks/audit-LVU76QGA.js +4 -0
- package/dist/cli/chunks/base-W42BURDL.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-4DSBPDRH.js → better-sqlite3-DB3LOJQU.js} +2 -2
- package/dist/cli/chunks/{brain-handler-GBY4EZ4P.js → brain-handler-SD63KOQ6.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-XYBVXCNO.js → branch-enumerator-4MNOPUC7.js} +2 -2
- package/dist/cli/chunks/{browser-32F6MREU.js → browser-OLPNTWQE.js} +2 -2
- package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +2 -0
- package/dist/cli/chunks/{chunk-WLXK2KNU.js → chunk-23CX7JNL.js} +2 -2
- package/dist/cli/chunks/{chunk-O3JTQ7N4.js → chunk-25P6JA6V.js} +1 -1
- package/dist/cli/chunks/{chunk-DO6EI5KB.js → chunk-2G63VIJE.js} +1 -1
- package/dist/cli/chunks/{chunk-G3L5L6YQ.js → chunk-2IMSJ7IO.js} +1 -1
- package/dist/cli/chunks/{chunk-RD6TEZ64.js → chunk-36VKMAMN.js} +2 -2
- package/dist/cli/chunks/{chunk-KIP6WZGV.js → chunk-3M7J4U74.js} +3 -3
- package/dist/cli/chunks/chunk-3QJU4Q4R.js +5 -0
- package/dist/cli/chunks/{chunk-2JGEZHWY.js → chunk-4EKV7PHB.js} +2 -2
- package/dist/cli/chunks/chunk-4INST4ZL.js +4 -0
- package/dist/cli/chunks/{chunk-DPBRWP4J.js → chunk-53BXTTRO.js} +3 -3
- package/dist/cli/chunks/chunk-5D7ZFWDS.js +2 -0
- package/dist/cli/chunks/{chunk-XLAUGSW7.js → chunk-5FSLMYAC.js} +2 -2
- package/dist/cli/chunks/chunk-5GFKTJ65.js +4 -0
- package/dist/cli/chunks/{chunk-WOIGKU2N.js → chunk-5U6N4V5M.js} +11 -11
- package/dist/cli/chunks/{chunk-PSPKSUF6.js → chunk-6EGS77BB.js} +1 -1
- package/dist/cli/chunks/{chunk-QIRL6B3C.js → chunk-6PJPQGF4.js} +2 -2
- package/dist/cli/chunks/{chunk-I6X3EGJI.js → chunk-6RD44SCE.js} +1 -1
- package/dist/cli/chunks/{chunk-IGBEJ4UJ.js → chunk-74IOEOMH.js} +2 -2
- package/dist/cli/chunks/{chunk-E3W6XQ57.js → chunk-77QZHIVX.js} +2 -2
- package/dist/cli/chunks/{chunk-R74ZKREV.js → chunk-7EZ2Z2CK.js} +1 -1
- package/dist/cli/chunks/{chunk-UTBYJ4RF.js → chunk-7MIOK72I.js} +18 -35
- package/dist/cli/chunks/{chunk-URVHZPWY.js → chunk-7QYOTUOX.js} +2 -2
- package/dist/cli/chunks/{chunk-K27SU3RE.js → chunk-A2VUCUTT.js} +2 -2
- package/dist/cli/chunks/{chunk-2KJQ2UQE.js → chunk-A3DK3XNZ.js} +1 -1
- package/dist/cli/chunks/{chunk-5D36YHS3.js → chunk-A5MA7A23.js} +4 -4
- package/dist/cli/chunks/{chunk-WJHWH5D2.js → chunk-AEUEMVJK.js} +2 -2
- package/dist/cli/chunks/{chunk-6CR4VQBQ.js → chunk-AJUBT4NP.js} +2 -2
- package/dist/cli/chunks/chunk-B2YGVSOP.js +27 -0
- package/dist/cli/chunks/{chunk-D6OUCB2H.js → chunk-B4I43GE2.js} +2 -2
- package/dist/cli/chunks/{chunk-WK7B4B6Y.js → chunk-BD7FEUN3.js} +2 -2
- package/dist/cli/chunks/{chunk-OEIQTWQP.js → chunk-BE4KALTE.js} +1 -1
- package/dist/cli/chunks/{chunk-JROVR6YS.js → chunk-BEFTQVEW.js} +2 -2
- package/dist/cli/chunks/{chunk-HBCGYMQU.js → chunk-BLG7SH4A.js} +1 -1
- package/dist/cli/chunks/{chunk-2OMLTYQK.js → chunk-C3FXFU2T.js} +1 -1
- package/dist/cli/chunks/{chunk-6A44AOGN.js → chunk-CBONQM5D.js} +2 -2
- package/dist/cli/chunks/{chunk-73EI4C2E.js → chunk-CQNMGK6Y.js} +2 -2
- package/dist/cli/chunks/{chunk-IIAR5S7Q.js → chunk-CVOQ6ESD.js} +2 -2
- package/dist/cli/chunks/{chunk-6TU7FEMD.js → chunk-DOBKEXMJ.js} +1 -1
- package/dist/cli/chunks/{chunk-BHFR2EXL.js → chunk-DYTQHRUS.js} +1 -1
- package/dist/cli/chunks/{chunk-E4AZXCT5.js → chunk-EADSQN5T.js} +1 -1
- package/dist/cli/chunks/{chunk-CYE2TJFV.js → chunk-EGOIIUBD.js} +2 -2
- package/dist/cli/chunks/{chunk-DKUBQQFG.js → chunk-EIGRV3J6.js} +2 -2
- package/dist/cli/chunks/{chunk-RP2ZKPYV.js → chunk-EJ6MMYLK.js} +1 -1
- package/dist/cli/chunks/{chunk-HSVKZ5KI.js → chunk-ENK44A6Q.js} +2 -2
- package/dist/cli/chunks/{chunk-67YV75XP.js → chunk-EYXE2XKP.js} +2 -2
- package/dist/cli/chunks/{chunk-HYEJJJY3.js → chunk-F2OPFVQH.js} +1 -1
- package/dist/cli/chunks/{chunk-XUR2M2WB.js → chunk-FBZC4IGB.js} +2 -2
- package/dist/cli/chunks/{chunk-BXVAVFGU.js → chunk-FSSR6WBE.js} +2 -2
- package/dist/cli/chunks/{chunk-W2XCZU62.js → chunk-FW4DJ4FJ.js} +1 -1
- package/dist/cli/chunks/{chunk-KKHYJF5U.js → chunk-FYPX5WBJ.js} +1 -1
- package/dist/cli/chunks/{chunk-K7NJHFLZ.js → chunk-G367W7XR.js} +3 -3
- package/dist/cli/chunks/{chunk-IUDWEOLX.js → chunk-GLGKQX2V.js} +2 -2
- package/dist/cli/chunks/{chunk-JVQBWYHW.js → chunk-GV4DYPJP.js} +2 -2
- package/dist/cli/chunks/{chunk-GTKCGPJZ.js → chunk-GVVFTFMB.js} +2 -2
- package/dist/cli/chunks/{chunk-AFEDJ3RU.js → chunk-H5RQPO3X.js} +2 -2
- package/dist/cli/chunks/{chunk-4FWTLJEP.js → chunk-HPWWYT67.js} +2 -2
- package/dist/cli/chunks/{chunk-G3W6BMVJ.js → chunk-HXXHMLJ5.js} +1 -1
- package/dist/cli/chunks/{chunk-NU7UTXMP.js → chunk-HYFQUWNB.js} +2 -2
- package/dist/cli/chunks/chunk-HYOPJHHW.js +2 -0
- package/dist/cli/chunks/{chunk-6LKDHEBY.js → chunk-HZY42OVU.js} +2 -2
- package/dist/cli/chunks/{chunk-C3HQL6S4.js → chunk-IAENZ2DR.js} +2 -2
- package/dist/cli/chunks/{chunk-M23ZOZVY.js → chunk-IEJ7ZV3M.js} +1 -1
- package/dist/cli/chunks/{chunk-RIZVC4XY.js → chunk-IWFFO6VT.js} +2 -2
- package/dist/cli/chunks/chunk-J7AQZLIH.js +21 -0
- package/dist/cli/chunks/{chunk-3KDL6QDK.js → chunk-JHJUSSAU.js} +2 -2
- package/dist/cli/chunks/{chunk-DLF5BOJD.js → chunk-JOZ47MV6.js} +1 -1
- package/dist/cli/chunks/{chunk-ELBZON4V.js → chunk-JZT7BU44.js} +2 -2
- package/dist/cli/chunks/{chunk-3DDXWYMO.js → chunk-KD2BLA5Y.js} +1 -1
- package/dist/cli/chunks/{chunk-VD5IO5EO.js → chunk-KUHLTVWC.js} +1 -1
- package/dist/cli/chunks/{chunk-YDFL445W.js → chunk-LU2EDWQK.js} +2 -2
- package/dist/cli/chunks/chunk-LXZMP3VX.js +736 -0
- package/dist/cli/chunks/{chunk-3YUB5HER.js → chunk-LY7MFGBD.js} +196 -187
- package/dist/cli/chunks/chunk-MM56VPNE.js +180 -0
- package/dist/cli/chunks/{chunk-37TUN44F.js → chunk-MNQN7UZX.js} +2 -2
- package/dist/cli/chunks/{chunk-7DETTOPZ.js → chunk-MQZ53OR3.js} +2 -2
- package/dist/cli/chunks/{chunk-BYG36QC5.js → chunk-MT7UNBZ7.js} +2 -2
- package/dist/cli/chunks/{chunk-JES6R5KP.js → chunk-MZB2UV2O.js} +1 -1
- package/dist/cli/chunks/{chunk-QZMUXJHZ.js → chunk-MZMG6CUJ.js} +2 -2
- package/dist/cli/chunks/chunk-N5XOXPHZ.js +4 -0
- package/dist/cli/chunks/{chunk-RD2VGOUH.js → chunk-NBLDBVAW.js} +1 -1
- package/dist/cli/chunks/{chunk-HVU64GP5.js → chunk-ND4QTZOL.js} +2 -2
- package/dist/cli/chunks/{chunk-SQF6HRXR.js → chunk-NHUGHAY6.js} +1 -1
- package/dist/cli/chunks/{chunk-TUSSPKRM.js → chunk-NOHWJOBS.js} +1 -1
- package/dist/cli/chunks/{chunk-NVYBM3R4.js → chunk-O5V7RHVG.js} +2 -2
- package/dist/cli/chunks/{chunk-6VAZAHQG.js → chunk-O6MO5KMR.js} +2 -2
- package/dist/cli/chunks/{chunk-IUHB5GVS.js → chunk-OAZX6WFU.js} +2 -2
- package/dist/cli/chunks/{chunk-LSUILON7.js → chunk-OEPNNLR4.js} +1 -1
- package/dist/cli/chunks/{chunk-IJHCIXJC.js → chunk-OIDWDGLG.js} +2 -2
- package/dist/cli/chunks/{chunk-CPC7FN52.js → chunk-ON2UTP2U.js} +2 -2
- package/dist/cli/chunks/{chunk-UJWAWIRV.js → chunk-ONR2NXXD.js} +7 -7
- package/dist/cli/chunks/{chunk-7VFY7TUR.js → chunk-OXHF3L2T.js} +2 -2
- package/dist/cli/chunks/{chunk-QYOGD2VW.js → chunk-OZGIOKEA.js} +1 -1
- package/dist/cli/chunks/{chunk-WJTSY5MC.js → chunk-P2UPYSDJ.js} +1 -1
- package/dist/cli/chunks/{chunk-52L77RMG.js → chunk-P7XSPP5D.js} +2 -2
- package/dist/cli/chunks/{chunk-M5AEL7IS.js → chunk-PCJQCEBA.js} +2 -2
- package/dist/cli/chunks/chunk-PELENDDQ.js +2 -0
- package/dist/cli/chunks/{chunk-C3Z4VVHP.js → chunk-PYKY22GC.js} +5 -5
- package/dist/cli/chunks/{chunk-AF4XKLXO.js → chunk-Q3NSU24F.js} +2 -2
- package/dist/cli/chunks/chunk-Q6NTEICT.js +2 -0
- package/dist/cli/chunks/chunk-QFETNCNN.js +12 -0
- package/dist/cli/chunks/{chunk-KYA5LARK.js → chunk-QGOWNVVG.js} +1 -1
- package/dist/cli/chunks/{chunk-Y5L3ES4L.js → chunk-QPLSYEWJ.js} +2 -2
- package/dist/cli/chunks/{chunk-F34OAHOM.js → chunk-QQFQDEUE.js} +2 -2
- package/dist/cli/chunks/{chunk-EFV4ADMO.js → chunk-QUORH2MG.js} +55 -79
- package/dist/cli/chunks/{chunk-QWUXCG2L.js → chunk-QVH5Y7AP.js} +1 -1
- package/dist/cli/chunks/{chunk-I2NENQ44.js → chunk-RC2A4JZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-XZSMZHM2.js → chunk-RDGPXENG.js} +2 -2
- package/dist/cli/chunks/{chunk-N7H767TP.js → chunk-RKI3IQKQ.js} +2 -2
- package/dist/cli/chunks/{chunk-LULD4JV2.js → chunk-RKUAWQOF.js} +2 -2
- package/dist/cli/chunks/chunk-RLW25X66.js +2 -0
- package/dist/cli/chunks/{chunk-UKGXWW64.js → chunk-ROVZSZCS.js} +3 -3
- package/dist/cli/chunks/{chunk-EOR2UT72.js → chunk-RT6O2HW2.js} +2 -2
- package/dist/cli/chunks/{chunk-75QJ5HWE.js → chunk-SM2YJ2AL.js} +2 -2
- package/dist/cli/chunks/{chunk-KO4FNAUR.js → chunk-SRPLERER.js} +3 -3
- package/dist/cli/chunks/{chunk-NRE4NAVA.js → chunk-T77GZF4B.js} +1 -1
- package/dist/cli/chunks/{chunk-R6IU3EWP.js → chunk-TFK2AYIN.js} +2 -2
- package/dist/cli/chunks/chunk-TW3SR4TS.js +2 -0
- package/dist/cli/chunks/{chunk-IYTLXUBO.js → chunk-TXSPBLBT.js} +2 -2
- package/dist/cli/chunks/chunk-UA7TDVL7.js +12 -0
- package/dist/cli/chunks/{chunk-WX6RRIGW.js → chunk-UBJG3IHT.js} +2 -2
- package/dist/cli/chunks/{chunk-NQI7FWCS.js → chunk-UFSVUBTR.js} +2 -2
- package/dist/cli/chunks/{chunk-FUNGTIF2.js → chunk-UOI6ULCH.js} +2 -2
- package/dist/cli/chunks/{chunk-HVXJC3OC.js → chunk-UYUJT6QO.js} +2 -2
- package/dist/cli/chunks/{chunk-KEY43ANX.js → chunk-V5AK56DA.js} +2 -2
- package/dist/cli/chunks/{chunk-XFPPERA2.js → chunk-V6RE4YRQ.js} +2 -2
- package/dist/cli/chunks/{chunk-DDCIYOGT.js → chunk-VW6FRMLW.js} +2 -2
- package/dist/cli/chunks/chunk-VXKWNRGA.js +2 -0
- package/dist/cli/chunks/{chunk-CVMNJSCB.js → chunk-VYDVI6FZ.js} +2 -2
- package/dist/cli/chunks/{chunk-7JZJJA7U.js → chunk-WF6UISKW.js} +3 -3
- package/dist/cli/chunks/{chunk-SQKW3B6B.js → chunk-WIH522AP.js} +1 -1
- package/dist/cli/chunks/{chunk-KLTP5IDB.js → chunk-WOV6XI3A.js} +1 -1
- package/dist/cli/chunks/{chunk-VTOVWHEM.js → chunk-X7ADKL7T.js} +2 -2
- package/dist/cli/chunks/{chunk-SX4JLSLV.js → chunk-XBYQ2BS4.js} +2 -2
- package/dist/cli/chunks/{chunk-E4EYPYR3.js → chunk-XL5KIYE3.js} +2 -2
- package/dist/cli/chunks/{chunk-3VIXOHMS.js → chunk-XWYELBZS.js} +1 -1
- package/dist/cli/chunks/{chunk-YQGPQBCX.js → chunk-XYLQZWF6.js} +2 -2
- package/dist/cli/chunks/{chunk-XEZIIQYJ.js → chunk-Y6AKKQIQ.js} +1 -1
- package/dist/cli/chunks/{chunk-BJPL6THQ.js → chunk-YMW57PEL.js} +1 -1
- package/dist/cli/chunks/{chunk-JSZ663MU.js → chunk-YO4ESCB4.js} +1 -1
- package/dist/cli/chunks/{chunk-AMMQOV35.js → chunk-YRHTQZU4.js} +2 -2
- package/dist/cli/chunks/chunk-Z4Q5PCRZ.js +65 -0
- package/dist/cli/chunks/{chunk-RKOUXVZZ.js → chunk-ZELWDJXT.js} +2 -2
- package/dist/cli/chunks/{chunk-QRCIZFNK.js → chunk-ZQZD55MN.js} +2 -2
- package/dist/cli/chunks/{chunk-UMGFMKDW.js → chunk-ZS4XVJGV.js} +2 -2
- package/dist/cli/chunks/{chunk-6ITZZIQX.js → chunk-ZUB5YOCM.js} +2 -2
- package/dist/cli/chunks/chunk-ZUOVNFXK.js +2 -0
- package/dist/cli/chunks/{chunk-RGGK6VZ7.js → chunk-ZWEKAEEV.js} +1 -1
- package/dist/cli/chunks/{ci-RACDAJMR.js → ci-J3TDK5RA.js} +8 -8
- package/dist/cli/chunks/{ci-output-EHRSZBKG.js → ci-output-RLS32FUY.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-GBV7M5XG.js → circuit-breaker-MRCC7WCM.js} +2 -2
- package/dist/cli/chunks/claude-flow-setup-LIZCEKDF.js +2 -0
- package/dist/cli/chunks/client-3BD2DI4N.js +2 -0
- package/dist/cli/chunks/{cline-installer-W4NMXJSG.js → cline-installer-T7H6R2RC.js} +2 -2
- package/dist/cli/chunks/{code-JWXJMYXB.js → code-XMBLI7OF.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-RVI2IFTM.js → code-index-extractor-QS7BYLEX.js} +2 -2
- package/dist/cli/chunks/{codex-installer-3BORJINH.js → codex-installer-6PGT5FM6.js} +6 -6
- package/dist/cli/chunks/{completions-A55NCTAO.js → completions-2A3WRXY2.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-JCXHGGLY.js → complexity-analyzer-23HOOGJ7.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-PUVFMGYW.js → continuedev-installer-4FSF7B3N.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-4DCMYWHB.js → copilot-installer-A5GRQQUU.js} +2 -2
- package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +2 -0
- package/dist/cli/chunks/{cost-tracker-5TV2GGKY.js → cost-tracker-Z4STQ5VB.js} +2 -2
- package/dist/cli/chunks/{coverage-NNWM7TX3.js → coverage-NUPP6KZZ.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +2 -0
- package/dist/cli/chunks/{cursor-installer-4NCHGJGK.js → cursor-installer-FVJ7ROPJ.js} +2 -2
- package/dist/cli/chunks/{daemon-QIKCXKWO.js → daemon-7ZZA2MMN.js} +4 -4
- package/dist/cli/chunks/{daemon-T4JO4IXP.js → daemon-D662EX5N.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-RPAAIDAD.js → dag-attention-scheduler-IB4TQ2KA.js} +2 -2
- package/dist/cli/chunks/{detect-SBEEVDSN.js → detect-LGLBZN4I.js} +2 -2
- package/dist/cli/chunks/{dist-node-ZHI6NCSU.js → dist-node-Z3OL42YE.js} +2 -2
- package/dist/cli/chunks/{domain-handler-LBC3GJ7Z.js → domain-handler-L3CLNL7U.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-H6IZ5USZ.js → domain-plugins-GQ3V5X6L.js} +2 -2
- package/dist/cli/chunks/domain-transfer-MFCI76IY.js +2 -0
- package/dist/cli/chunks/dream-FTP33IJB.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-AHTR7CRU.js → embed-and-insert-pattern-UGD6USYH.js} +2 -2
- package/dist/cli/chunks/{eval-DZU2KISM.js → eval-3B7UIYGY.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-5IQCWKSL.js → experience-capture-middleware-3RQ4NYY3.js} +3 -3
- package/dist/cli/chunks/{fast-paths-2KLDUWCY.js → fast-paths-QOSAEPYD.js} +2 -2
- package/dist/cli/chunks/{feature-flags-7AC3XDZA.js → feature-flags-3S5TH6P4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-N6UAEZY4.js → feature-flags-TLF4NKOH.js} +2 -2
- package/dist/cli/chunks/{file-discovery-5SDIW4V2.js → file-discovery-AEVMJRNB.js} +2 -2
- package/dist/cli/chunks/{fleet-ZIQCAZ2Y.js → fleet-E6WTXWFL.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-DUMBZJEV.js → gnn-wrapper-MCKH3AUU.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-6HVM6ZMR.js → heartbeat-handler-U7XENHRR.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +2 -0
- package/dist/cli/chunks/hnsw-index-MS5KODD7.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-5DRL5FLX.js → hnsw-legacy-bridge-5GW4SAEI.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-GW67GTCL.js → hnswlib-node-7BLZBK5T.js} +2 -2
- package/dist/cli/chunks/{hooks-QHH6FVO4.js → hooks-F3O2SB6H.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-7XDCCVG2.js → hypergraph-engine-PV4EKXHB.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-QHF7NOU5.js → hypergraph-handler-VOWO5ZTW.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +2 -0
- package/dist/cli/chunks/{init-handler-5UIVOM7K.js → init-handler-ENJ5ONJX.js} +16 -14
- package/dist/cli/chunks/init-wizard-I5DFZUQL.js +2 -0
- package/dist/cli/chunks/kernel-MISPSPPA.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-TGGV6K5Q.js → kilocode-installer-HNNJOOPE.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-4XYBHZWW.js → kiro-installer-UZBIQ3IC.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-L26JESGE.js +2 -0
- package/dist/cli/chunks/{learning-STE5W6BS.js → learning-YMLCVFUT.js} +3 -3
- package/dist/cli/chunks/{llm-router-NKF7J3RI.js → llm-router-YWTARCCT.js} +4 -4
- package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +2 -0
- package/dist/cli/chunks/{load-B2T77UJQ.js → load-DKE3F3IP.js} +2 -2
- package/dist/cli/chunks/load-test-H5ISNNM5.js +2 -0
- package/dist/cli/chunks/mcp-5PSGIUCW.js +2 -0
- package/dist/cli/chunks/{memory-WRFZKG56.js → memory-3L3O6JMM.js} +5 -5
- package/dist/cli/chunks/memory-backend-HWDNOBKW.js +2 -0
- package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +2 -0
- package/dist/cli/chunks/multi-model-executor-AEEO7IA4.js +14 -0
- package/dist/cli/chunks/{opencode-installer-J36EMQU7.js → opencode-installer-ABBO355U.js} +2 -2
- package/dist/cli/chunks/orchestrator-E36Q7MKE.js +393 -0
- package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-BVMTWI3E.js → pattern-usage-recorder-H4XKSID4.js} +2 -2
- package/dist/cli/chunks/{pipeline-OWAHDUAQ.js → pipeline-BGFEHXIN.js} +2 -2
- package/dist/cli/chunks/{platform-ANGBFWBV.js → platform-GK7ZVDJI.js} +2 -2
- package/dist/cli/chunks/{plugin-OO7ON2YW.js → plugin-CAH2CKI6.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-HFG3BXWU.js → prime-radiant-advanced-wasm-M5EYRONA.js} +2 -2
- package/dist/cli/chunks/{project-root-LNOYVTYY.js → project-root-BSNZC243.js} +2 -2
- package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +2 -0
- package/dist/cli/chunks/{protocol-handler-CE3Q6LY4.js → protocol-handler-JDSSC2SF.js} +2 -2
- package/dist/cli/chunks/{prove-7XPN53PY.js → prove-ANPTOZJE.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +2 -0
- package/dist/cli/chunks/{quality-TT23JRFX.js → quality-SXWGYRQR.js} +2 -2
- package/dist/cli/chunks/{quality-gate-PPPRP255.js → quality-gate-GYNCA4ZY.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +2 -0
- package/dist/cli/chunks/{real-embeddings-EYNZIFJE.js → real-embeddings-WSRYAOZM.js} +2 -2
- package/dist/cli/chunks/{ref-validation-QQR64ZXD.js → ref-validation-AZ3LRWEK.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-UIGS7ZJD.js → roocode-installer-2QKGFIEU.js} +2 -2
- package/dist/cli/chunks/router-MTP5LH4H.js +2 -0
- package/dist/cli/chunks/routing-feedback-GWETVB4L.js +2 -0
- package/dist/cli/chunks/{routing-handler-6AENUIRG.js → routing-handler-UYDC5MMD.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-5AWMEV34.js → ruvector-commands-QXADPVEY.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-NWRJ7C22.js → rvf-migration-coordinator-GD4NBFKT.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-ISKRP563.js → rvf-store-integrity-7SXG66IL.js} +2 -2
- package/dist/cli/chunks/safe-db-FWWGAPVE.js +2 -0
- package/dist/cli/chunks/schedule-TPA4V4D5.js +2 -0
- package/dist/cli/chunks/scheduler-5ZTEPNDD.js +2 -0
- package/dist/cli/chunks/{security-325A7FMB.js → security-YKB622PK.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-KMLAV7JK.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-THFDYS2Z.js → shared-rvf-dual-writer-OYY27DFV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +2 -0
- package/dist/cli/chunks/{standalone-memory-UD4MJ6GZ.js → standalone-memory-2DOABVLC.js} +2 -2
- package/dist/cli/chunks/{status-handler-CPFTN4XL.js → status-handler-EXRKETV7.js} +2 -2
- package/dist/cli/chunks/{structural-health-2MG2IVBL.js → structural-health-2SKK6DU6.js} +2 -2
- package/dist/cli/chunks/sync-DQ2YUNI6.js +2 -0
- package/dist/cli/chunks/{sync-EE4VVKOW.js → sync-UW7SX7GO.js} +2 -2
- package/dist/cli/chunks/{task-handler-7H5OYJG4.js → task-handler-LYQ6WYUY.js} +2 -2
- package/dist/cli/chunks/task-handlers-DIJO232S.js +9 -0
- package/dist/cli/chunks/test-WRHZMUCW.js +33 -0
- package/dist/cli/chunks/{test-scheduling-CHQ4ZLLJ.js → test-scheduling-HI23RXFK.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-23SA6SWZ.js +2 -0
- package/dist/cli/chunks/{token-usage-EBXUJNRB.js → token-usage-M7RRDPXO.js} +2 -2
- package/dist/cli/chunks/{transformers-ZEKS2OJZ.js → transformers-4TC35KKS.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-F4LTKAWD.js +2 -0
- package/dist/cli/chunks/{types-KYAA5VLV.js → types-NBXV6LXQ.js} +2 -2
- package/dist/cli/chunks/unified-memory-OVFEPRPS.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +2 -0
- package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +2 -0
- package/dist/cli/chunks/{upgrade-UJBJ5AYM.js → upgrade-4BGOU5RM.js} +2 -2
- package/dist/cli/chunks/{validate-RUV6YMWS.js → validate-EDWAR63H.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-IVEVMGVM.js → validate-swarm-VI72CPR7.js} +2 -2
- package/dist/cli/chunks/visual-security-2FUM5GLI.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-AVWA6HKE.js → web-tree-sitter-Y5XBRQXF.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-DAH7HI2W.js → windsurf-installer-VEX23WAF.js} +2 -2
- package/dist/cli/chunks/witness-chain-3YNL6YGY.js +2 -0
- package/dist/cli/chunks/witness-chain-MH6GA5L6.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-MJZGZRWT.js +2 -0
- package/dist/cli/chunks/witness-chain-verifier-TTJYXTBE.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-JSTBMG43.js → witness-key-manager-EM6YXYOY.js} +2 -2
- package/dist/cli/chunks/{workflow-TWOIA6LZ.js → workflow-2RBDOM7V.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +2 -0
- package/dist/cli/chunks/wrappers-5OTAVVOV.js +2 -0
- package/dist/cli/commands/audit.d.ts +20 -2
- package/dist/cli/commands/audit.js +158 -16
- package/dist/cli/commands/ci.js +1 -1
- package/dist/cli/commands/claude-flow-setup.js +5 -4
- package/dist/cli/commands/test.js +18 -3
- package/dist/cli/handlers/init-handler.d.ts +2 -0
- package/dist/cli/handlers/init-handler.js +8 -2
- package/dist/cli/index.js +10 -1
- package/dist/coordination/handlers/test-execution-handlers.js +13 -8
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/queen-event-handlers.js +9 -6
- package/dist/coordination/result-saver.js +1 -1
- package/dist/coordination/services/index.d.ts +1 -1
- package/dist/coordination/services/task-audit-logger.d.ts +38 -13
- package/dist/coordination/services/task-audit-logger.js +33 -5
- package/dist/coordination/task-executor.d.ts +5 -0
- package/dist/coordination/task-executor.js +10 -5
- package/dist/domains/test-generation/coordinator.js +6 -5
- package/dist/domains/test-generation/interfaces.d.ts +11 -1
- package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
- package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
- package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
- package/dist/domains/test-generation/services/behavior-examples.js +65 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
- package/dist/domains/test-generation/services/test-generator.js +59 -30
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
- package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
- package/dist/init/agents-installer.d.ts +4 -0
- package/dist/init/agents-installer.js +24 -11
- package/dist/init/browser-engine-installer.d.ts +5 -5
- package/dist/init/browser-engine-installer.js +28 -6
- package/dist/init/codex-installer.js +4 -2
- package/dist/init/idempotent-write.d.ts +53 -0
- package/dist/init/idempotent-write.js +160 -0
- package/dist/init/init-wizard.d.ts +2 -0
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/05-learning.js +3 -1
- package/dist/init/phases/07-hooks.js +32 -16
- package/dist/init/phases/08-mcp.js +4 -2
- package/dist/init/phases/09-assets.js +8 -18
- package/dist/init/phases/10-workers.js +7 -5
- package/dist/init/phases/12-verification.js +7 -2
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/init/project-analyzer.d.ts +9 -0
- package/dist/init/project-analyzer.js +20 -1
- package/dist/init/self-configurator.d.ts +5 -3
- package/dist/init/self-configurator.js +18 -29
- package/dist/init/skills-installer.js +4 -2
- package/dist/init/types.d.ts +6 -0
- package/dist/init/types.js +20 -24
- package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
- package/dist/integrations/coherence/coherence-service.js +84 -24
- package/dist/integrations/coherence/vote-tally.d.ts +38 -0
- package/dist/integrations/coherence/vote-tally.js +39 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +23 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +24 -0
- package/dist/integrations/vibium/client.d.ts +1 -0
- package/dist/integrations/vibium/client.js +24 -11
- package/dist/integrations/vibium/runtime.d.ts +14 -0
- package/dist/integrations/vibium/runtime.js +94 -0
- package/dist/kernel/kernel.js +3 -2
- package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
- package/dist/kernel/pattern-fts-self-heal.js +193 -0
- package/dist/kernel/process-lifecycle.d.ts +60 -0
- package/dist/kernel/process-lifecycle.js +91 -0
- package/dist/kernel/unified-memory-schemas.d.ts +15 -1
- package/dist/kernel/unified-memory-schemas.js +53 -25
- package/dist/kernel/unified-memory.js +31 -34
- package/dist/kernel/unified-persistence.js +12 -6
- package/dist/learning/experience-capture.d.ts +2 -1
- package/dist/learning/experience-capture.js +23 -8
- package/dist/learning/pattern-store.d.ts +12 -1
- package/dist/learning/pattern-store.js +45 -30
- package/dist/learning/qe-patterns.d.ts +12 -0
- package/dist/learning/qe-patterns.js +7 -1
- package/dist/learning/qe-reasoning-bank.d.ts +1 -0
- package/dist/learning/qe-reasoning-bank.js +17 -4
- package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
- package/dist/learning/real-qe-reasoning-bank.js +28 -4
- package/dist/learning/rvf-pattern-store.js +36 -23
- package/dist/learning/sqlite-persistence.d.ts +8 -1
- package/dist/learning/sqlite-persistence.js +58 -33
- package/dist/logging/console-logger.d.ts +2 -5
- package/dist/logging/console-logger.js +10 -46
- package/dist/logging/index.d.ts +2 -0
- package/dist/logging/index.js +1 -0
- package/dist/logging/redaction.d.ts +27 -0
- package/dist/logging/redaction.js +170 -0
- package/dist/mcp/bundle.js +522 -545
- package/dist/mcp/entry.js +52 -6
- package/dist/mcp/handlers/core-handlers.js +5 -4
- package/dist/mcp/handlers/domain-handler-configs.js +12 -4
- package/dist/mcp/handlers/task-handlers.js +11 -7
- package/dist/mcp/protocol-server.js +20 -4
- package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
- package/dist/mcp/services/reasoning-bank-service.js +5 -1
- package/dist/mcp/tools/base.d.ts +9 -2
- package/dist/mcp/tools/base.js +7 -0
- package/dist/mcp/tools/coherence/consensus.js +51 -2
- package/dist/mcp/tools/planning/goap-plan.d.ts +20 -7
- package/dist/mcp/tools/planning/goap-plan.js +92 -20
- package/dist/mcp/tools/planning/goap-status.d.ts +37 -12
- package/dist/mcp/tools/planning/goap-status.js +52 -23
- package/dist/mcp/tools/planning/world-state.d.ts +101 -0
- package/dist/mcp/tools/planning/world-state.js +274 -0
- package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
- package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
- package/dist/mcp/tools/test-generation/generate.js +8 -0
- package/dist/mcp/types.d.ts +10 -4
- package/dist/planning/goap-planner.d.ts +60 -4
- package/dist/planning/goap-planner.js +218 -60
- package/dist/planning/index.d.ts +1 -1
- package/dist/planning/index.js +1 -1
- package/dist/planning/plan-executor.d.ts +20 -1
- package/dist/planning/plan-executor.js +209 -100
- package/dist/planning/types.d.ts +16 -0
- package/dist/planning/types.js +17 -0
- package/dist/shared/error-utils.d.ts +15 -0
- package/dist/shared/error-utils.js +21 -0
- package/dist/shared/events/domain-events.d.ts +2 -1
- package/package.json +10 -6
- package/dist/cli/chunks/adapter-IYC62SXA.js +0 -2
- package/dist/cli/chunks/agent-booster-wasm-EDNKP3SP.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-LLOU2IXD.js +0 -2
- package/dist/cli/chunks/audit-CVZQMF55.js +0 -3
- package/dist/cli/chunks/base-P3Z4IKCT.js +0 -2
- package/dist/cli/chunks/browser-workflow-YYHQQ25X.js +0 -2
- package/dist/cli/chunks/chunk-3EZ5DR2R.js +0 -21
- package/dist/cli/chunks/chunk-5WOSWNDN.js +0 -2
- package/dist/cli/chunks/chunk-7CD7PBHY.js +0 -3
- package/dist/cli/chunks/chunk-7X7JYWT4.js +0 -27
- package/dist/cli/chunks/chunk-CZO4BJG5.js +0 -2
- package/dist/cli/chunks/chunk-J27F4NSB.js +0 -2
- package/dist/cli/chunks/chunk-J5UNP6W3.js +0 -2
- package/dist/cli/chunks/chunk-MI5Q55DG.js +0 -65
- package/dist/cli/chunks/chunk-TY5WC3FT.js +0 -12
- package/dist/cli/chunks/chunk-UDHVCKGA.js +0 -5
- package/dist/cli/chunks/chunk-XQSIRBKT.js +0 -180
- package/dist/cli/chunks/chunk-YXP6BKGS.js +0 -730
- package/dist/cli/chunks/chunk-ZBABIZ2D.js +0 -2
- package/dist/cli/chunks/chunk-ZCWERUYB.js +0 -12
- package/dist/cli/chunks/claude-flow-setup-5LVJOFKP.js +0 -2
- package/dist/cli/chunks/client-HUVFA5PF.js +0 -2
- package/dist/cli/chunks/core-handlers-UEXO3VAA.js +0 -2
- package/dist/cli/chunks/cross-domain-router-ODU5IZD6.js +0 -2
- package/dist/cli/chunks/domain-transfer-JZA5TMW3.js +0 -2
- package/dist/cli/chunks/dream-HE3OX42F.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-QUIFGGLX.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-42KB37KP.js +0 -2
- package/dist/cli/chunks/hnsw-index-T2PGO77J.js +0 -2
- package/dist/cli/chunks/hybrid-backend-FRNWYRKH.js +0 -2
- package/dist/cli/chunks/impact-analyzer-A5QYOYBR.js +0 -2
- package/dist/cli/chunks/init-wizard-XBU674YH.js +0 -2
- package/dist/cli/chunks/kernel-DV5MTNZD.js +0 -2
- package/dist/cli/chunks/knowledge-graph-4ACGVJQK.js +0 -2
- package/dist/cli/chunks/llm-router-service-PSMASERT.js +0 -2
- package/dist/cli/chunks/load-test-MRUO2VPF.js +0 -2
- package/dist/cli/chunks/mcp-JGSFCEMH.js +0 -2
- package/dist/cli/chunks/memory-backend-2MPGI6JW.js +0 -2
- package/dist/cli/chunks/memory-handlers-XT4HMITB.js +0 -2
- package/dist/cli/chunks/multi-model-executor-26Q5BSVG.js +0 -14
- package/dist/cli/chunks/orchestrator-D5IFV65I.js +0 -393
- package/dist/cli/chunks/pattern-null-store-TGWUL237.js +0 -2
- package/dist/cli/chunks/protocol-executor-GEVH5KD6.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-DJ2JL6QB.js +0 -2
- package/dist/cli/chunks/queen-coordinator-F7E3AS26.js +0 -2
- package/dist/cli/chunks/router-OZH3QSAU.js +0 -2
- package/dist/cli/chunks/routing-feedback-J2E3ADZB.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-HK525Y5Y.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-Q7FB3BKR.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-5ZRCGUI6.js +0 -2
- package/dist/cli/chunks/safe-db-3OYEPVEH.js +0 -2
- package/dist/cli/chunks/schedule-AG4C2EIQ.js +0 -2
- package/dist/cli/chunks/scheduler-SQS2CZFZ.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-NFL6QSZ6.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-MAKDFSHC.js +0 -2
- package/dist/cli/chunks/sync-MBTW5XBF.js +0 -2
- package/dist/cli/chunks/task-handlers-NH4GJHCJ.js +0 -9
- package/dist/cli/chunks/test-MPHGT4T6.js +0 -33
- package/dist/cli/chunks/token-bootstrap-SSDCYEKK.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-J6ZMAK37.js +0 -2
- package/dist/cli/chunks/unified-memory-DDWMC435.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-4JA7SGBK.js +0 -2
- package/dist/cli/chunks/unified-persistence-F6OSNTXY.js +0 -2
- package/dist/cli/chunks/vibium-HOGMFJ2Z.js +0 -2
- package/dist/cli/chunks/visual-security-25SMBIYT.js +0 -2
- package/dist/cli/chunks/witness-chain-PJOQPFUX.js +0 -2
- package/dist/cli/chunks/witness-chain-ZW6KKUZU.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UKSIDM7Q.js +0 -2
- package/dist/cli/chunks/wrappers-UR7BLXKV.js +0 -2
|
@@ -21,6 +21,34 @@ export interface TaskAuditEntry {
|
|
|
21
21
|
readonly domain?: DomainName;
|
|
22
22
|
readonly details?: Record<string, unknown>;
|
|
23
23
|
}
|
|
24
|
+
/** An entry produced by this logger, positioned within its generation. */
|
|
25
|
+
export interface TaskAuditSequencedEntry extends TaskAuditEntry {
|
|
26
|
+
readonly sequence: number;
|
|
27
|
+
}
|
|
28
|
+
/** Filters select retained entries; they do not change retention metadata. */
|
|
29
|
+
export interface TaskAuditFilter {
|
|
30
|
+
operation?: TaskOperation;
|
|
31
|
+
taskId?: string;
|
|
32
|
+
agentId?: string;
|
|
33
|
+
domain?: DomainName;
|
|
34
|
+
fromTimestamp?: Date;
|
|
35
|
+
toTimestamp?: Date;
|
|
36
|
+
limit?: number;
|
|
37
|
+
}
|
|
38
|
+
/** Completeness of the bounded observation window since construction/clear. */
|
|
39
|
+
export interface TaskAuditWindow {
|
|
40
|
+
generation: string;
|
|
41
|
+
recordedEntries: number;
|
|
42
|
+
retainedEntries: number;
|
|
43
|
+
droppedEntries: number;
|
|
44
|
+
firstRetainedSequence: number | null;
|
|
45
|
+
lastRetainedSequence: number | null;
|
|
46
|
+
disposition: 'complete' | 'truncated';
|
|
47
|
+
}
|
|
48
|
+
/** Filtered entries with metadata for the entire retained window. */
|
|
49
|
+
export interface TaskAuditSnapshot extends TaskAuditWindow {
|
|
50
|
+
entries: TaskAuditSequencedEntry[];
|
|
51
|
+
}
|
|
24
52
|
/**
|
|
25
53
|
* Configuration for task audit logger
|
|
26
54
|
*/
|
|
@@ -41,6 +69,9 @@ export interface TaskAuditConfig {
|
|
|
41
69
|
export declare class TaskAuditLogger {
|
|
42
70
|
private readonly entries;
|
|
43
71
|
private readonly config;
|
|
72
|
+
private generation;
|
|
73
|
+
private recordedEntries;
|
|
74
|
+
private droppedEntries;
|
|
44
75
|
constructor(config?: Partial<TaskAuditConfig>);
|
|
45
76
|
/**
|
|
46
77
|
* Log a task operation
|
|
@@ -65,19 +96,13 @@ export declare class TaskAuditLogger {
|
|
|
65
96
|
/**
|
|
66
97
|
* Get audit entries with optional filtering
|
|
67
98
|
*/
|
|
68
|
-
getEntries(filter?:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
limit?: number;
|
|
76
|
-
}): TaskAuditEntry[];
|
|
77
|
-
/**
|
|
78
|
-
* Get statistics about task operations
|
|
79
|
-
*/
|
|
80
|
-
getStatistics(): {
|
|
99
|
+
getEntries(filter?: TaskAuditFilter): TaskAuditSequencedEntry[];
|
|
100
|
+
/** Get selected entries without losing evidence of earlier evictions/resets. */
|
|
101
|
+
getSnapshot(filter?: TaskAuditFilter): TaskAuditSnapshot;
|
|
102
|
+
private getWindow;
|
|
103
|
+
/** Get counts for the retained window, with its completeness metadata. */
|
|
104
|
+
getStatistics(): TaskAuditWindow & {
|
|
105
|
+
basis: 'retained-window';
|
|
81
106
|
totalEntries: number;
|
|
82
107
|
operationCounts: Record<TaskOperation, number>;
|
|
83
108
|
taskCount: number;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* This replaces the full authorization service with simple audit logging
|
|
6
6
|
* for a local CLI tool where all agents are trusted.
|
|
7
7
|
*/
|
|
8
|
+
import { randomUUID } from 'node:crypto';
|
|
8
9
|
const DEFAULT_CONFIG = {
|
|
9
10
|
enableConsoleLog: true,
|
|
10
11
|
maxEntries: 1000,
|
|
@@ -19,14 +20,21 @@ const DEFAULT_CONFIG = {
|
|
|
19
20
|
export class TaskAuditLogger {
|
|
20
21
|
entries = [];
|
|
21
22
|
config;
|
|
23
|
+
generation = randomUUID();
|
|
24
|
+
recordedEntries = 0;
|
|
25
|
+
droppedEntries = 0;
|
|
22
26
|
constructor(config = {}) {
|
|
23
27
|
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
28
|
+
if (!Number.isSafeInteger(this.config.maxEntries) || this.config.maxEntries < 0) {
|
|
29
|
+
throw new RangeError('maxEntries must be a non-negative safe integer');
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Log a task operation
|
|
27
34
|
*/
|
|
28
35
|
log(operation, taskId, options) {
|
|
29
36
|
const entry = {
|
|
37
|
+
sequence: ++this.recordedEntries,
|
|
30
38
|
timestamp: new Date(),
|
|
31
39
|
operation,
|
|
32
40
|
taskId,
|
|
@@ -37,7 +45,9 @@ export class TaskAuditLogger {
|
|
|
37
45
|
this.entries.push(entry);
|
|
38
46
|
// Trim if exceeds max
|
|
39
47
|
if (this.entries.length > this.config.maxEntries) {
|
|
40
|
-
|
|
48
|
+
const dropped = this.entries.length - this.config.maxEntries;
|
|
49
|
+
this.entries.splice(0, dropped);
|
|
50
|
+
this.droppedEntries += dropped;
|
|
41
51
|
}
|
|
42
52
|
// Console log if enabled
|
|
43
53
|
if (this.config.enableConsoleLog) {
|
|
@@ -102,11 +112,24 @@ export class TaskAuditLogger {
|
|
|
102
112
|
}
|
|
103
113
|
}
|
|
104
114
|
const limit = filter?.limit ?? result.length;
|
|
105
|
-
return result.slice(-limit);
|
|
115
|
+
return limit === 0 ? [] : result.slice(-limit);
|
|
106
116
|
}
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
|
|
117
|
+
/** Get selected entries without losing evidence of earlier evictions/resets. */
|
|
118
|
+
getSnapshot(filter) {
|
|
119
|
+
return { ...this.getWindow(), entries: this.getEntries(filter) };
|
|
120
|
+
}
|
|
121
|
+
getWindow() {
|
|
122
|
+
return {
|
|
123
|
+
generation: this.generation,
|
|
124
|
+
recordedEntries: this.recordedEntries,
|
|
125
|
+
retainedEntries: this.entries.length,
|
|
126
|
+
droppedEntries: this.droppedEntries,
|
|
127
|
+
firstRetainedSequence: this.entries[0]?.sequence ?? null,
|
|
128
|
+
lastRetainedSequence: this.entries[this.entries.length - 1]?.sequence ?? null,
|
|
129
|
+
disposition: this.droppedEntries > 0 ? 'truncated' : 'complete',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Get counts for the retained window, with its completeness metadata. */
|
|
110
133
|
getStatistics() {
|
|
111
134
|
const operationCounts = {
|
|
112
135
|
submit: 0,
|
|
@@ -129,6 +152,8 @@ export class TaskAuditLogger {
|
|
|
129
152
|
}
|
|
130
153
|
}
|
|
131
154
|
return {
|
|
155
|
+
...this.getWindow(),
|
|
156
|
+
basis: 'retained-window',
|
|
132
157
|
totalEntries: this.entries.length,
|
|
133
158
|
operationCounts,
|
|
134
159
|
taskCount: taskIds.size,
|
|
@@ -140,6 +165,9 @@ export class TaskAuditLogger {
|
|
|
140
165
|
*/
|
|
141
166
|
clear() {
|
|
142
167
|
this.entries.length = 0;
|
|
168
|
+
this.generation = randomUUID();
|
|
169
|
+
this.recordedEntries = 0;
|
|
170
|
+
this.droppedEntries = 0;
|
|
143
171
|
}
|
|
144
172
|
}
|
|
145
173
|
/**
|
|
@@ -154,6 +154,11 @@ export declare class DomainTaskExecutor implements TaskHandlerContext {
|
|
|
154
154
|
private getTaskDomain;
|
|
155
155
|
private timeout;
|
|
156
156
|
private publishTaskCompleted;
|
|
157
|
+
/**
|
|
158
|
+
* @param callerError true when the task was rejected because of invalid
|
|
159
|
+
* caller input; the queen then neither retries it nor counts it toward
|
|
160
|
+
* the domain circuit breaker.
|
|
161
|
+
*/
|
|
157
162
|
private publishTaskFailed;
|
|
158
163
|
}
|
|
159
164
|
export declare function createTaskExecutor(kernel: QEKernel, config?: Partial<TaskExecutorConfig>): DomainTaskExecutor;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Handler implementations are extracted into ./handlers/ modules.
|
|
14
14
|
*/
|
|
15
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
|
-
import { toErrorMessage } from '../shared/error-utils.js';
|
|
16
|
+
import { isCallerInputError, toErrorMessage } from '../shared/error-utils.js';
|
|
17
17
|
import { createResultSaver } from './result-saver.js';
|
|
18
18
|
import { createLogger } from '../logging/logger-factory.js';
|
|
19
19
|
import { getClaudeModelForTier } from '../shared/llm/model-registry.js';
|
|
@@ -436,7 +436,7 @@ export class DomainTaskExecutor {
|
|
|
436
436
|
]);
|
|
437
437
|
if (!result.success) {
|
|
438
438
|
const errorMsg = 'error' in result ? result.error.message : 'Unknown error';
|
|
439
|
-
await this.publishTaskFailed(task.id, errorMsg, domain);
|
|
439
|
+
await this.publishTaskFailed(task.id, errorMsg, domain, 'error' in result && isCallerInputError(result.error));
|
|
440
440
|
// ADR-051: Record failed outcome
|
|
441
441
|
this.recordOutcome(task, routingTier, false, Date.now() - startTime).catch((e) => { logger.warn('recordOutcome failed', { error: e instanceof Error ? e.message : String(e), taskId: task.id }); });
|
|
442
442
|
return {
|
|
@@ -486,7 +486,7 @@ export class DomainTaskExecutor {
|
|
|
486
486
|
}
|
|
487
487
|
catch (error) {
|
|
488
488
|
const errorMessage = toErrorMessage(error);
|
|
489
|
-
await this.publishTaskFailed(task.id, errorMessage, domain);
|
|
489
|
+
await this.publishTaskFailed(task.id, errorMessage, domain, isCallerInputError(error));
|
|
490
490
|
// ADR-051: Record failed outcome
|
|
491
491
|
this.recordOutcome(task, routingTier, false, Date.now() - startTime).catch((e) => { logger.warn('recordOutcome failed', { error: e instanceof Error ? e.message : String(e), taskId: task.id }); });
|
|
492
492
|
return {
|
|
@@ -655,13 +655,18 @@ export class DomainTaskExecutor {
|
|
|
655
655
|
payload: { taskId, result },
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
|
-
|
|
658
|
+
/**
|
|
659
|
+
* @param callerError true when the task was rejected because of invalid
|
|
660
|
+
* caller input; the queen then neither retries it nor counts it toward
|
|
661
|
+
* the domain circuit breaker.
|
|
662
|
+
*/
|
|
663
|
+
async publishTaskFailed(taskId, error, domain, callerError = false) {
|
|
659
664
|
await this.eventBus.publish({
|
|
660
665
|
id: uuidv4(),
|
|
661
666
|
type: 'TaskFailed',
|
|
662
667
|
timestamp: new Date(),
|
|
663
668
|
source: domain,
|
|
664
|
-
payload: { taskId, error },
|
|
669
|
+
payload: { taskId, error, ...(callerError ? { callerError: true } : {}) },
|
|
665
670
|
});
|
|
666
671
|
}
|
|
667
672
|
}
|
|
@@ -249,7 +249,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
249
249
|
this.startWorkflow(workflowId, 'generate');
|
|
250
250
|
// Opt-in (plan 06, D7-wire): try the FREE local model first with a repair
|
|
251
251
|
// loop. Fully guarded — any miss falls through to the normal LLM path.
|
|
252
|
-
if (this.freeTierExecutor) {
|
|
252
|
+
if (this.freeTierExecutor && !request.behaviorExamples?.length) {
|
|
253
253
|
try {
|
|
254
254
|
const ft = await this.tryFreeTierGeneration(request);
|
|
255
255
|
if (ft) {
|
|
@@ -354,11 +354,12 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
// Three-loop protocol: instantAdapt must precede recordOutcome
|
|
357
|
-
|
|
357
|
+
const coverageEstimate = result.value.coverageEstimate;
|
|
358
|
+
if (coverageEstimate !== null && isSONAThreeLoopEnabled() && this.qesona?.isThreeLoopEnabled()) {
|
|
358
359
|
const tests = result.value;
|
|
359
360
|
this.qesona.instantAdapt([
|
|
360
361
|
tests.tests.length / 20,
|
|
361
|
-
|
|
362
|
+
coverageEstimate / 100,
|
|
362
363
|
tests.patternsUsed.length / 10,
|
|
363
364
|
request.sourceFiles.length / 20,
|
|
364
365
|
(request.coverageTarget ?? 80) / 100,
|
|
@@ -476,7 +477,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
476
477
|
framework,
|
|
477
478
|
llmEnhanced: true,
|
|
478
479
|
};
|
|
479
|
-
return { tests: [test], coverageEstimate:
|
|
480
|
+
return { tests: [test], coverageEstimate: null, patternsUsed: ['free-tier-local', `tier:${r.tierUsed}`] };
|
|
480
481
|
}
|
|
481
482
|
/**
|
|
482
483
|
* Generate tests using TDD workflow
|
|
@@ -953,7 +954,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
953
954
|
* Per ADR-040: Store test generation patterns in SONA
|
|
954
955
|
*/
|
|
955
956
|
async storeTestGenerationPattern(tests, request) {
|
|
956
|
-
if (!this.qesona) {
|
|
957
|
+
if (!this.qesona || tests.coverageEstimate === null) {
|
|
957
958
|
return;
|
|
958
959
|
}
|
|
959
960
|
try {
|
|
@@ -16,7 +16,14 @@ export interface ITestGenerationAPI {
|
|
|
16
16
|
/** Learn patterns from existing tests */
|
|
17
17
|
learnPatterns(request: ILearnPatternsRequest): Promise<Result<ILearnedPatterns, Error>>;
|
|
18
18
|
}
|
|
19
|
+
/** Caller-owned specifications; expected values are never inferred from source. */
|
|
20
|
+
export interface BehaviorExample {
|
|
21
|
+
functionName: string;
|
|
22
|
+
args: unknown[];
|
|
23
|
+
expected: unknown;
|
|
24
|
+
}
|
|
19
25
|
export interface IGenerateTestsRequest {
|
|
26
|
+
behaviorExamples?: BehaviorExample[];
|
|
20
27
|
sourceFiles: string[];
|
|
21
28
|
testType: 'unit' | 'integration' | 'e2e';
|
|
22
29
|
framework?: TestFramework;
|
|
@@ -41,7 +48,8 @@ export interface IGenerateTestsRequest {
|
|
|
41
48
|
}
|
|
42
49
|
export interface IGeneratedTests {
|
|
43
50
|
tests: IGeneratedTest[];
|
|
44
|
-
|
|
51
|
+
/** null means unmeasured; never coerce unknown coverage to measured zero. */
|
|
52
|
+
coverageEstimate: number | null;
|
|
45
53
|
/** Human-readable pattern names, for display (reports, CLI output). */
|
|
46
54
|
patternsUsed: string[];
|
|
47
55
|
/** Real qe_patterns.id values for the same patterns, for usage/ADR-110 tracking. */
|
|
@@ -61,6 +69,8 @@ export interface IGeneratedTest {
|
|
|
61
69
|
compilationErrors?: string[];
|
|
62
70
|
/** ADR-051: Whether test was enhanced by LLM */
|
|
63
71
|
llmEnhanced?: boolean;
|
|
72
|
+
generationMode?: 'behavior-examples' | 'scaffolding';
|
|
73
|
+
generationLimits?: string[];
|
|
64
74
|
/** Test quality gate validation result (loki-mode Gates 8 & 9) */
|
|
65
75
|
qualityGateResult?: TestQualityGateResult;
|
|
66
76
|
/** ADR-062: Whether this test is a holdout test (not shown to developer, runs in CI only) */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary validation for caller-supplied behavior examples (#787 / #795).
|
|
3
|
+
*
|
|
4
|
+
* Shared by the MCP handlers, the CLI `--behavior-examples` path and the
|
|
5
|
+
* domain service so every entry point rejects the same malformed input with
|
|
6
|
+
* the same message. Failures are `CallerInputError`s: they are the caller's
|
|
7
|
+
* problem, not a sign of an unhealthy test-generation domain, and must never
|
|
8
|
+
* count toward its circuit breaker.
|
|
9
|
+
*
|
|
10
|
+
* Only the shape is checked here. Whether `functionName` exists in the source
|
|
11
|
+
* and whether `args` matches its arity can only be decided against the parsed
|
|
12
|
+
* source (see behavior-examples.ts), which also throws `CallerInputError`.
|
|
13
|
+
*
|
|
14
|
+
* Kept free of heavy imports (no `typescript`) so boundary layers can use it.
|
|
15
|
+
*/
|
|
16
|
+
import type { BehaviorExample } from '../interfaces.js';
|
|
17
|
+
/**
|
|
18
|
+
* JSON Schema for one `behaviorExamples` element. Single source of truth for
|
|
19
|
+
* every tool definition that advertises `behaviorExamples` (protocol server
|
|
20
|
+
* `test_generate_enhanced` and `qe/tests/generate`).
|
|
21
|
+
*/
|
|
22
|
+
export declare const BEHAVIOR_EXAMPLE_ITEM_SCHEMA: Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Throw unless `value` is plain JSON data that can be emitted as a literal:
|
|
25
|
+
* finite numbers (no -0), strings, booleans, null, arrays and plain objects,
|
|
26
|
+
* without cycles.
|
|
27
|
+
*/
|
|
28
|
+
export declare function assertBehaviorJsonValue(value: unknown, label?: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Validate the shape of `behaviorExamples` at a system boundary.
|
|
31
|
+
*
|
|
32
|
+
* @returns the examples typed as `BehaviorExample[]`, or `undefined` when omitted
|
|
33
|
+
* @throws CallerInputError describing the first invalid entry
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateBehaviorExamples(value: unknown): BehaviorExample[] | undefined;
|
|
36
|
+
//# sourceMappingURL=behavior-example-validation.d.ts.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary validation for caller-supplied behavior examples (#787 / #795).
|
|
3
|
+
*
|
|
4
|
+
* Shared by the MCP handlers, the CLI `--behavior-examples` path and the
|
|
5
|
+
* domain service so every entry point rejects the same malformed input with
|
|
6
|
+
* the same message. Failures are `CallerInputError`s: they are the caller's
|
|
7
|
+
* problem, not a sign of an unhealthy test-generation domain, and must never
|
|
8
|
+
* count toward its circuit breaker.
|
|
9
|
+
*
|
|
10
|
+
* Only the shape is checked here. Whether `functionName` exists in the source
|
|
11
|
+
* and whether `args` matches its arity can only be decided against the parsed
|
|
12
|
+
* source (see behavior-examples.ts), which also throws `CallerInputError`.
|
|
13
|
+
*
|
|
14
|
+
* Kept free of heavy imports (no `typescript`) so boundary layers can use it.
|
|
15
|
+
*/
|
|
16
|
+
import { CallerInputError } from '../../../shared/error-utils.js';
|
|
17
|
+
const SHAPE_HINT = 'expected [{ "functionName": "add", "args": [2, 3], "expected": 5 }]';
|
|
18
|
+
/**
|
|
19
|
+
* JSON Schema for one `behaviorExamples` element. Single source of truth for
|
|
20
|
+
* every tool definition that advertises `behaviorExamples` (protocol server
|
|
21
|
+
* `test_generate_enhanced` and `qe/tests/generate`).
|
|
22
|
+
*/
|
|
23
|
+
export const BEHAVIOR_EXAMPLE_ITEM_SCHEMA = {
|
|
24
|
+
type: 'object',
|
|
25
|
+
description: 'One caller-owned specification example',
|
|
26
|
+
properties: {
|
|
27
|
+
functionName: { type: 'string', description: 'Named export of the source file to call' },
|
|
28
|
+
args: { type: 'array', description: 'Positional JSON arguments; length must equal the function arity', items: {} },
|
|
29
|
+
expected: { description: 'Expected JSON return value (use null for a null result)' },
|
|
30
|
+
},
|
|
31
|
+
required: ['functionName', 'args', 'expected'],
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Throw unless `value` is plain JSON data that can be emitted as a literal:
|
|
35
|
+
* finite numbers (no -0), strings, booleans, null, arrays and plain objects,
|
|
36
|
+
* without cycles.
|
|
37
|
+
*/
|
|
38
|
+
export function assertBehaviorJsonValue(value, label = 'Behavior example value') {
|
|
39
|
+
const visit = (v, seen) => {
|
|
40
|
+
if (v === null || typeof v === 'string' || typeof v === 'boolean')
|
|
41
|
+
return;
|
|
42
|
+
if (typeof v === 'number' && Number.isFinite(v) && !Object.is(v, -0))
|
|
43
|
+
return;
|
|
44
|
+
if (typeof v !== 'object' || seen.has(v)) {
|
|
45
|
+
throw new CallerInputError(`${label} must be finite JSON data (no undefined, functions, NaN/Infinity, cycles, or negative zero)`);
|
|
46
|
+
}
|
|
47
|
+
if (!Array.isArray(v) && Object.getPrototypeOf(v) !== Object.prototype && Object.getPrototypeOf(v) !== null) {
|
|
48
|
+
throw new CallerInputError(`${label} must contain only plain JSON objects`);
|
|
49
|
+
}
|
|
50
|
+
seen.add(v);
|
|
51
|
+
for (const item of Array.isArray(v) ? Array.from(v) : Object.values(v))
|
|
52
|
+
visit(item, seen);
|
|
53
|
+
seen.delete(v);
|
|
54
|
+
};
|
|
55
|
+
visit(value, new Set());
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Validate the shape of `behaviorExamples` at a system boundary.
|
|
59
|
+
*
|
|
60
|
+
* @returns the examples typed as `BehaviorExample[]`, or `undefined` when omitted
|
|
61
|
+
* @throws CallerInputError describing the first invalid entry
|
|
62
|
+
*/
|
|
63
|
+
export function validateBehaviorExamples(value) {
|
|
64
|
+
if (value === undefined)
|
|
65
|
+
return undefined;
|
|
66
|
+
if (!Array.isArray(value)) {
|
|
67
|
+
throw new CallerInputError(`behaviorExamples must be an array; ${SHAPE_HINT}`);
|
|
68
|
+
}
|
|
69
|
+
value.forEach((example, index) => {
|
|
70
|
+
const at = `behaviorExamples[${index}]`;
|
|
71
|
+
if (typeof example !== 'object' || example === null || Array.isArray(example)) {
|
|
72
|
+
throw new CallerInputError(`${at} must be an object; ${SHAPE_HINT}`);
|
|
73
|
+
}
|
|
74
|
+
const record = example;
|
|
75
|
+
if (typeof record.functionName !== 'string' || record.functionName.trim() === '') {
|
|
76
|
+
throw new CallerInputError(`${at}.functionName must be a non-empty string`);
|
|
77
|
+
}
|
|
78
|
+
if (!Array.isArray(record.args)) {
|
|
79
|
+
throw new CallerInputError(`${at}.args must be an array of arguments`);
|
|
80
|
+
}
|
|
81
|
+
if (!Object.prototype.hasOwnProperty.call(record, 'expected')) {
|
|
82
|
+
throw new CallerInputError(`${at}.expected is required (use null for a null result)`);
|
|
83
|
+
}
|
|
84
|
+
assertBehaviorJsonValue(record.args, `${at}.args`);
|
|
85
|
+
assertBehaviorJsonValue(record.expected, `${at}.expected`);
|
|
86
|
+
});
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=behavior-example-validation.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BehaviorExample } from '../interfaces.js';
|
|
2
|
+
export declare function generateBehaviorExamples(source: string, sourceFile: string, importPath: string, framework: string, examples: BehaviorExample[] | undefined, testType: string): {
|
|
3
|
+
code: string;
|
|
4
|
+
limits: string[];
|
|
5
|
+
assertions: number;
|
|
6
|
+
mode: "behavior-examples" | "scaffolding";
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=behavior-examples.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { CallerInputError } from '../../../shared/error-utils.js';
|
|
3
|
+
import { assertBehaviorJsonValue, validateBehaviorExamples } from './behavior-example-validation.js';
|
|
4
|
+
/** JSON-only data is emitted as a parsed string, never interpolated as source. */
|
|
5
|
+
function literal(value) {
|
|
6
|
+
assertBehaviorJsonValue(value);
|
|
7
|
+
return `JSON.parse(${JSON.stringify(JSON.stringify(value))})`;
|
|
8
|
+
}
|
|
9
|
+
export function generateBehaviorExamples(source, sourceFile, importPath, framework, examples, testType) {
|
|
10
|
+
const supported = ['vitest', 'jest', 'node-test'].includes(framework) && testType === 'unit';
|
|
11
|
+
const ast = ts.createSourceFile(sourceFile, source, ts.ScriptTarget.Latest, true);
|
|
12
|
+
const diagnostics = ast.parseDiagnostics;
|
|
13
|
+
if (diagnostics.length)
|
|
14
|
+
throw new CallerInputError('Cannot generate behavior examples from syntactically invalid source');
|
|
15
|
+
const exports = new Map();
|
|
16
|
+
for (const node of ast.statements) {
|
|
17
|
+
if (!ts.canHaveModifiers(node) || !ts.getModifiers(node)?.some(m => m.kind === ts.SyntaxKind.ExportKeyword))
|
|
18
|
+
continue;
|
|
19
|
+
if (ts.getModifiers(node)?.some(m => m.kind === ts.SyntaxKind.DefaultKeyword))
|
|
20
|
+
continue;
|
|
21
|
+
const add = (name, fn) => {
|
|
22
|
+
if (fn.body && !fn.asteriskToken && fn.parameters.every(p => ts.isIdentifier(p.name) && p.name.text !== 'this' && !p.dotDotDotToken && !p.questionToken && !p.initializer))
|
|
23
|
+
exports.set(name, fn.parameters.length);
|
|
24
|
+
};
|
|
25
|
+
if (ts.isFunctionDeclaration(node) && node.name)
|
|
26
|
+
add(node.name.text, node);
|
|
27
|
+
if (ts.isVariableStatement(node))
|
|
28
|
+
for (const decl of node.declarationList.declarations) {
|
|
29
|
+
if (ts.isIdentifier(decl.name) && decl.initializer && (ts.isArrowFunction(decl.initializer) || ts.isFunctionExpression(decl.initializer)))
|
|
30
|
+
add(decl.name.text, decl.initializer);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
validateBehaviorExamples(examples);
|
|
34
|
+
if (examples?.length && !supported)
|
|
35
|
+
throw new CallerInputError('Behavior examples support unit tests with vitest, jest, or node-test only');
|
|
36
|
+
const limits = [];
|
|
37
|
+
if (importPath === './module-under-test')
|
|
38
|
+
limits.push('Inline source: save the source and replace ./module-under-test with its real import path before running.');
|
|
39
|
+
const lines = [framework === 'node-test' ? "import { test } from 'node:test';\nimport assert from 'node:assert/strict';" : framework === 'vitest' ? "import { test, expect } from 'vitest';" : "import { test, expect } from '@jest/globals';"];
|
|
40
|
+
if (!examples?.length) {
|
|
41
|
+
limits.push('Scaffolding only: supply behaviorExamples from a specification or trusted fixtures. No behavior or coverage has been verified.');
|
|
42
|
+
lines.push(`test.skip('Scaffolding: behaviorExamples required for ${exports.size} supported named exports', () => {});`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
lines.push(`import * as subject from ${JSON.stringify(importPath)};`);
|
|
46
|
+
for (const [index, example] of examples.entries()) {
|
|
47
|
+
if (!example || typeof example.functionName !== 'string' || !exports.has(example.functionName))
|
|
48
|
+
throw new CallerInputError(`Behavior example ${index + 1} must target a named exported function with required simple parameters; '${String(example?.functionName)}' is not one (supported: ${[...exports.keys()].join(', ') || 'none'})`);
|
|
49
|
+
if (!Array.isArray(example.args) || example.args.length !== exports.get(example.functionName))
|
|
50
|
+
throw new CallerInputError(`Behavior example argument count does not match ${example.functionName}`);
|
|
51
|
+
if (!Object.prototype.hasOwnProperty.call(example, 'expected'))
|
|
52
|
+
throw new CallerInputError('Behavior example requires an explicit expected value');
|
|
53
|
+
const call = `await subject[${JSON.stringify(example.functionName)}](${Array.from(example.args).map(a => literal(a)).join(', ')})`;
|
|
54
|
+
const assertion = framework === 'node-test' ? `assert.deepStrictEqual(${call}, ${literal(example.expected)});` : `expect(${call}).toStrictEqual(${literal(example.expected)});`;
|
|
55
|
+
lines.push(`test(${JSON.stringify(`${example.functionName}: specification example ${index + 1}`)}, async () => { ${assertion} });`);
|
|
56
|
+
}
|
|
57
|
+
const uncovered = [...exports.keys()].filter(name => !examples.some(e => e.functionName === name));
|
|
58
|
+
if (uncovered.length)
|
|
59
|
+
limits.push(`No supplied behavior examples for: ${uncovered.join(', ')}`);
|
|
60
|
+
limits.push('Only supplied examples are asserted; coverage is unmeasured. Re-exports, default exports, classes, rest/default/destructured/optional parameters and thrown-error specifications are unsupported.');
|
|
61
|
+
}
|
|
62
|
+
return { code: `// ${limits.join('\n// ')}\n${lines.join('\n')}\n`, limits, assertions: examples?.length ?? 0,
|
|
63
|
+
mode: examples?.length ? 'behavior-examples' : 'scaffolding' };
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=behavior-examples.js.map
|
|
@@ -70,6 +70,7 @@ export declare class TestGeneratorService implements ITestGenerationService {
|
|
|
70
70
|
private readonly config;
|
|
71
71
|
private readonly memory;
|
|
72
72
|
private readonly generatorFactory;
|
|
73
|
+
private readonly usesDefaultGenerator;
|
|
73
74
|
private readonly tddGenerator;
|
|
74
75
|
private readonly propertyTestGenerator;
|
|
75
76
|
private readonly testDataGenerator;
|
|
@@ -164,7 +165,6 @@ export declare class TestGeneratorService implements ITestGenerationService {
|
|
|
164
165
|
private extractModuleName;
|
|
165
166
|
private getImportPath;
|
|
166
167
|
private countAssertions;
|
|
167
|
-
private estimateCoverage;
|
|
168
168
|
private storeGenerationMetadata;
|
|
169
169
|
}
|
|
170
170
|
/**
|