@iowarp/clio-coder 0.4.4 → 0.4.6
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/CHANGELOG.md +116 -2
- package/CONTRIBUTING.md +39 -24
- package/NOTICE +16 -0
- package/README.md +343 -403
- package/dist/{acp-WNAYYF4F.js → acp-UVEVWSDL.js} +25 -24
- package/dist/{agents-3OKXHLOI.js → agents-VWY37DTK.js} +78 -77
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-VKNNMGPU.js → auth-PCV2XQDV.js} +38 -38
- package/dist/builtins-PD652MTK.js +22 -0
- package/dist/{chunk-TQAHXW6Y.js → chunk-22PQ4TX4.js} +4 -4
- package/dist/{chunk-NRO2BJRH.js → chunk-24T2YZ7A.js} +10686 -4464
- package/dist/{chunk-Y55JBDO5.js → chunk-2AKYFREM.js} +38 -23
- package/dist/{chunk-NEDJ26B5.js → chunk-2GPGAE5W.js} +6 -51
- package/dist/{chunk-IKCO5N3L.js → chunk-2QPI3TR3.js} +3 -3
- package/dist/{chunk-HRQMFLJP.js → chunk-32KJPXAM.js} +6 -6
- package/dist/{chunk-65DEGPJ6.js → chunk-3A3CUMKA.js} +6 -4
- package/dist/{chunk-UXCU4E3T.js → chunk-3BJGMT2D.js} +35 -14
- package/dist/{chunk-5ICU3EUH.js → chunk-3HQVBIKD.js} +5 -5
- package/dist/{chunk-GWZNEVM2.js → chunk-3JLFK5MW.js} +9 -9
- package/dist/{chunk-XXYSBZIQ.js → chunk-3O2ZAUGQ.js} +4 -4
- package/dist/{chunk-GX5WYQO4.js → chunk-3QKXHCGS.js} +8 -8
- package/dist/{chunk-JCI2ROMZ.js → chunk-3T4DXWP6.js} +7 -7
- package/dist/{chunk-DR52UMZW.js → chunk-3UW3KU4A.js} +2 -2
- package/dist/{chunk-OEJSLEPW.js → chunk-3WBALRQH.js} +337 -337
- package/dist/{chunk-ELWDPP3Y.js → chunk-4DU2TVI4.js} +8 -8
- package/dist/{chunk-JSD46VO2.js → chunk-4U4TKZFR.js} +43 -36
- package/dist/{chunk-FEAXX7B6.js → chunk-4VMV6OS6.js} +4 -4
- package/dist/{chunk-2ZSONWVL.js → chunk-536HXRFE.js} +13 -13
- package/dist/{chunk-W54I7H25.js → chunk-5A6XR3RJ.js} +44 -19
- package/dist/{chunk-YPC6ZR5L.js → chunk-5CMARGPF.js} +119 -5
- package/dist/{chunk-KXDSS5WJ.js → chunk-5CY4Q6QI.js} +4 -4
- package/dist/{chunk-D4CJV46V.js → chunk-5GZICIYO.js} +3 -3
- package/dist/{chunk-4IUZQIJ3.js → chunk-5PHVPU4G.js} +2 -2
- package/dist/{chunk-Q4WO54TA.js → chunk-5QRX7SLS.js} +11 -11
- package/dist/{chunk-3ODX73FK.js → chunk-5VTJP36Q.js} +4 -4
- package/dist/chunk-5ZSZEYJK.js +119 -0
- package/dist/{chunk-EBY63B7G.js → chunk-6EXUUOSN.js} +2 -2
- package/dist/{chunk-DT3LWJOB.js → chunk-6HAO6X5B.js} +24 -6
- package/dist/{chunk-SVNXH4L2.js → chunk-6ICZKDUC.js} +2 -2
- package/dist/{chunk-K6T2ZAMZ.js → chunk-6OII3LOK.js} +6 -6
- package/dist/{chunk-36CT5VVL.js → chunk-6RYDAVQT.js} +138 -89
- package/dist/{chunk-I7XBWTYH.js → chunk-6VRRJT7L.js} +5 -5
- package/dist/{chunk-DQOVN6KV.js → chunk-6YA46L5A.js} +4 -4
- package/dist/{chunk-NZMNUPZZ.js → chunk-77CZRFTE.js} +3 -3
- package/dist/{chunk-NAI6ZFCY.js → chunk-7JSSKXG2.js} +122 -11
- package/dist/{chunk-2VTFPG5O.js → chunk-7WLRF2U5.js} +2 -2
- package/dist/chunk-7WUZEB2M.js +165 -0
- package/dist/{chunk-3UUXNFEX.js → chunk-7YJWEF2L.js} +61 -34
- package/dist/{chunk-3EBYEESD.js → chunk-A46ILRS2.js} +5 -5
- package/dist/{chunk-IXIY2H4R.js → chunk-ACCKVSHU.js} +5 -5
- package/dist/{chunk-UOIZ7DA4.js → chunk-AP7HDJOP.js} +2 -2
- package/dist/{chunk-JEIYHLOR.js → chunk-B3MOMLJ4.js} +12 -12
- package/dist/{chunk-APJ265NV.js → chunk-B5GGDIHT.js} +146 -146
- package/dist/{chunk-PMZVFWSR.js → chunk-B5ZTR6KZ.js} +2 -2
- package/dist/{chunk-I5FWO7L5.js → chunk-B6UM3OZC.js} +2 -2
- package/dist/{chunk-2CU2H6KE.js → chunk-BBV5TKE6.js} +5 -5
- package/dist/{chunk-23L32XTI.js → chunk-BLTEAUCB.js} +68 -39
- package/dist/{chunk-4O6MANBS.js → chunk-BS4GAMUB.js} +14 -10
- package/dist/{chunk-XULDXHTN.js → chunk-BT7HGDOX.js} +105 -53
- package/dist/{chunk-S66XZJOF.js → chunk-C27U2TYG.js} +2 -2
- package/dist/{chunk-QZWQA4DE.js → chunk-CBSKDFWL.js} +3 -3
- package/dist/{chunk-2LEAKD4C.js → chunk-CKK25WN3.js} +3 -3
- package/dist/{chunk-BYP5D4HI.js → chunk-CTTI7G3T.js} +2 -2
- package/dist/{chunk-XAKHZX5N.js → chunk-CVDAFGPW.js} +4 -4
- package/dist/{chunk-RKKLTLYB.js → chunk-CXQ37WJH.js} +3 -3
- package/dist/{chunk-GTUD2WMY.js → chunk-DBREN25X.js} +44 -9
- package/dist/{chunk-NDDGJUXD.js → chunk-DNCE23JJ.js} +2 -2
- package/dist/{chunk-HVDIIIQW.js → chunk-DNHVRBH4.js} +3 -3
- package/dist/{chunk-D7E7WCDF.js → chunk-DVNAPPXU.js} +2 -2
- package/dist/{chunk-6UINWWS6.js → chunk-DXLUVUD4.js} +16 -16
- package/dist/{chunk-YXLYO42X.js → chunk-DXVMLM3Z.js} +3 -2
- package/dist/{chunk-5MEZN6CB.js → chunk-DZK63TZJ.js} +6 -6
- package/dist/{chunk-IWHMRKLL.js → chunk-E3LEPLQ2.js} +2 -2
- package/dist/{chunk-JT2RFCC5.js → chunk-E7RF4KBO.js} +5 -5
- package/dist/{chunk-3R73A4XB.js → chunk-ECBHH7LU.js} +3 -3
- package/dist/chunk-ECOMVOHP.js +139 -0
- package/dist/chunk-EFSEIZE6.js +56 -0
- package/dist/{chunk-4NSRCOYP.js → chunk-EHOSNVVM.js} +3 -2
- package/dist/chunk-EM2WNQS2.js +93 -0
- package/dist/{chunk-57XXR6DR.js → chunk-F5Z7EWMN.js} +967 -246
- package/dist/{chunk-HAXOFFRH.js → chunk-FQOOGXBH.js} +7 -7
- package/dist/{chunk-ZTJUVLTU.js → chunk-FXFVDPWY.js} +2 -2
- package/dist/{chunk-XPLRXC72.js → chunk-GD55RTIW.js} +3 -3
- package/dist/{chunk-5B2AEOW5.js → chunk-GH5ZR6JP.js} +472 -472
- package/dist/{chunk-TOIVGRUX.js → chunk-GJ24ODAX.js} +5 -5
- package/dist/{chunk-EXLD33WO.js → chunk-GLYBJ4RQ.js} +24 -9
- package/dist/{chunk-26QSH3EJ.js → chunk-HHVJNVUJ.js} +5 -5
- package/dist/{chunk-F4EKGO4N.js → chunk-HL26ADLH.js} +4 -2
- package/dist/{chunk-FFUPXJC4.js → chunk-HPTJF6DG.js} +32 -56
- package/dist/{chunk-ID64D7PE.js → chunk-HXHFDHB6.js} +24 -24
- package/dist/{chunk-CUSRQKPU.js → chunk-HZ2T2YED.js} +299 -89
- package/dist/{chunk-YD5GIKET.js → chunk-HZFBVU5X.js} +49 -580
- package/dist/{chunk-6QOTUPRG.js → chunk-I2K2NCZQ.js} +65 -17
- package/dist/{chunk-SZAA6XDG.js → chunk-IFDRAD6F.js} +2 -2
- package/dist/{chunk-I2DWJ4GM.js → chunk-IGLVVNEG.js} +54 -42
- package/dist/{chunk-6Q3CYFD3.js → chunk-IKRWLEDA.js} +186 -35
- package/dist/{chunk-2JH2WHGE.js → chunk-J2FYEQ5L.js} +4 -4
- package/dist/{chunk-BMS5RKQY.js → chunk-JABWPKFY.js} +3 -3
- package/dist/{chunk-2DSOYNFC.js → chunk-JMPL7NUB.js} +7 -7
- package/dist/{chunk-QDC3K2U3.js → chunk-K2BLQC5E.js} +3 -3
- package/dist/{chunk-AUPNRN7C.js → chunk-K2HL3GBL.js} +4 -4
- package/dist/{chunk-54X7T7DK.js → chunk-KAFMW7WM.js} +72 -81
- package/dist/{chunk-OZNBF4L3.js → chunk-KECNXMDE.js} +2 -2
- package/dist/{chunk-BTK3SSSK.js → chunk-KMF54VH3.js} +2 -2
- package/dist/chunk-KPRLAMP4.js +32 -0
- package/dist/{chunk-ECH6PKUQ.js → chunk-KQ6IDQIB.js} +2 -2
- package/dist/{chunk-3UNOLWNZ.js → chunk-KTFSFCVN.js} +20 -9
- package/dist/{chunk-IRXAATOX.js → chunk-L4N3DWNW.js} +3 -3
- package/dist/{chunk-JQLNNIKT.js → chunk-LIN2K3EL.js} +6 -6
- package/dist/{chunk-2STGEDFV.js → chunk-LK2FN5JY.js} +2 -2
- package/dist/{chunk-LCGCVYZ4.js → chunk-LQTKDAUO.js} +2 -2
- package/dist/{chunk-U6TMQNSI.js → chunk-LTR5QCLS.js} +4 -4
- package/dist/chunk-LUL5Z66S.js +221 -0
- package/dist/{chunk-ELZVTCGV.js → chunk-LVFANMOH.js} +151 -327
- package/dist/{chunk-H7IXIC72.js → chunk-LY4N4TTL.js} +17 -3
- package/dist/{chunk-VKPAQYEB.js → chunk-LZBMXNLP.js} +5 -5
- package/dist/{chunk-UL3WSD3F.js → chunk-M4KFUXS7.js} +2 -2
- package/dist/{chunk-NXYCB2VD.js → chunk-M6TAYK66.js} +6 -6
- package/dist/{chunk-CFGTUFWB.js → chunk-MCJKEGHO.js} +2 -2
- package/dist/{chunk-6XLNIQDB.js → chunk-MYI32N4R.js} +2 -2
- package/dist/{chunk-4WR7VSYB.js → chunk-N2OKBREN.js} +23 -9
- package/dist/{chunk-3GY4F45V.js → chunk-NC4KV7EL.js} +6 -6
- package/dist/{chunk-LLXSDWXS.js → chunk-NF3BK5WR.js} +5 -5
- package/dist/{chunk-4M6Z5QVF.js → chunk-NNWJYUNO.js} +11 -11
- package/dist/chunk-NTK3WTHM.js +141 -0
- package/dist/{chunk-GYV6VZOC.js → chunk-NTTS3O53.js} +2 -2
- package/dist/{chunk-4BJ5BYCE.js → chunk-O3VV6IVK.js} +2 -2
- package/dist/{chunk-W6GROXXM.js → chunk-O5F25NIE.js} +2 -2
- package/dist/{chunk-NXIMQY5W.js → chunk-ODUTYZIU.js} +5 -5
- package/dist/{chunk-KFV5L5SK.js → chunk-OQM5IVJY.js} +118 -232
- package/dist/{chunk-75W7L2E2.js → chunk-P5JMBPDJ.js} +1052 -171
- package/dist/{chunk-XRZT5WY5.js → chunk-P5SC4DLJ.js} +4 -4
- package/dist/{chunk-S6PYF2XF.js → chunk-P6M7RKMI.js} +4 -4
- package/dist/{chunk-R6Q67RJH.js → chunk-PECBKCDK.js} +34 -6
- package/dist/{chunk-33YXPOE3.js → chunk-PPEZJWUG.js} +2 -2
- package/dist/{chunk-RXTN6AKH.js → chunk-PWWSIB2A.js} +5 -5
- package/dist/{chunk-DXKJURES.js → chunk-PZN2LQY6.js} +14 -11
- package/dist/{chunk-N56KALIC.js → chunk-Q7NNUHQV.js} +62 -35
- package/dist/{chunk-RQCKCSRL.js → chunk-QCOV5DFY.js} +22 -22
- package/dist/{chunk-3DPEIQKN.js → chunk-QH3ZTUOA.js} +2 -2
- package/dist/{chunk-NEKRRTYW.js → chunk-QJMRYTCX.js} +8 -8
- package/dist/{chunk-YNFKXPEC.js → chunk-QNWRHOMF.js} +35 -66
- package/dist/{chunk-YAKGTXEV.js → chunk-QRFXEO6Y.js} +2 -2
- package/dist/{chunk-35MSIRKH.js → chunk-QUIJZSDW.js} +2 -2
- package/dist/{chunk-72YIHOZQ.js → chunk-QXFBABFJ.js} +10 -10
- package/dist/chunk-R2CT5YDO.js +66 -0
- package/dist/{chunk-HHV2GANA.js → chunk-R2P2U3ZS.js} +2 -2
- package/dist/{chunk-IGLP3ODT.js → chunk-RGZNQ5CT.js} +15 -15
- package/dist/chunk-SD7SHNDW.js +15 -0
- package/dist/chunk-SL2RDHKO.js +19 -0
- package/dist/{chunk-NUGM5KR6.js → chunk-SRCEQKQS.js} +2 -2
- package/dist/{chunk-OMQNJVKW.js → chunk-SRZOW5L2.js} +43 -13
- package/dist/{chunk-UEPWCCTY.js → chunk-SXQKNKRA.js} +12 -12
- package/dist/{chunk-3M6DQK6S.js → chunk-T334FW2H.js} +7 -7
- package/dist/{chunk-V76WTFTW.js → chunk-T52TPHYC.js} +6 -6
- package/dist/{chunk-5636DCO5.js → chunk-TJFDL26W.js} +59 -12
- package/dist/{chunk-3I7MS7N2.js → chunk-TK2BMCBZ.js} +2 -2
- package/dist/{chunk-5OIVVPHF.js → chunk-TN5FW4XY.js} +13 -6
- package/dist/{chunk-LL4KHSZI.js → chunk-U2MSJ57E.js} +2 -2
- package/dist/{chunk-FTMGRKEF.js → chunk-U44YYLVV.js} +4 -4
- package/dist/{chunk-YECAMM3D.js → chunk-U7H5WRG5.js} +5 -5
- package/dist/{chunk-5TUB6SLS.js → chunk-UFYNOQK4.js} +7 -7
- package/dist/{chunk-R346GLFC.js → chunk-UHW5V7HC.js} +2 -2
- package/dist/{chunk-VIA6RFQZ.js → chunk-UQIVHSE4.js} +4 -4
- package/dist/{chunk-RAY4OVGZ.js → chunk-URBGEOH3.js} +5 -5
- package/dist/chunk-USZA7GWL.js +341 -0
- package/dist/{chunk-ZA4VCIGV.js → chunk-UUQ5G6EZ.js} +60 -41
- package/dist/{chunk-VG7TBQIY.js → chunk-V552WL53.js} +68 -4
- package/dist/{chunk-7UGL4MB5.js → chunk-VAHLPXPY.js} +10 -10
- package/dist/{chunk-25QBEXRS.js → chunk-VANN3GDP.js} +7 -26
- package/dist/{chunk-BWH6N36D.js → chunk-VHKTOLEW.js} +272 -42
- package/dist/{chunk-QUFRYSWI.js → chunk-VHMX7SXF.js} +129 -48
- package/dist/{chunk-336NSSKI.js → chunk-VNBICSS2.js} +2 -2
- package/dist/{chunk-VAVR4IJY.js → chunk-VQD7NH7Z.js} +3 -3
- package/dist/{chunk-LBMZMYH2.js → chunk-W2RJEH6Q.js} +3 -3
- package/dist/{chunk-7CR24IG7.js → chunk-WDV62RKY.js} +2 -2
- package/dist/{chunk-BJVFZO5U.js → chunk-WJIMKGD6.js} +7 -7
- package/dist/{chunk-USR47QNF.js → chunk-WKUYQBCG.js} +14 -14
- package/dist/{chunk-GHS5EBTQ.js → chunk-WNGF5AJX.js} +36 -22
- package/dist/{chunk-MXHC5QYU.js → chunk-WTQGRBHV.js} +5 -144
- package/dist/{chunk-6OSVSQL5.js → chunk-WV6TDAPN.js} +41 -23
- package/dist/chunk-WXA2CFJO.js +23 -0
- package/dist/{chunk-2ASED4PZ.js → chunk-X3BI7HTV.js} +26 -26
- package/dist/{chunk-QSNYB6ZV.js → chunk-XCUDZQLX.js} +3 -3
- package/dist/{chunk-RZDWV63N.js → chunk-XWMSPJYN.js} +6 -6
- package/dist/chunk-YGDMBK7O.js +567 -0
- package/dist/{chunk-6PAZTBPA.js → chunk-YPRSNUTC.js} +15 -6
- package/dist/{chunk-2IR2NMPA.js → chunk-ZIDFQJRB.js} +2 -2
- package/dist/{chunk-LTIKRKFL.js → chunk-ZS43Y2FT.js} +4 -4
- package/dist/{chunk-6EJMN2Y3.js → chunk-ZTNFYMIO.js} +2 -2
- package/dist/{chunk-WEPFGWHJ.js → chunk-ZZFWWYLX.js} +2 -2
- package/dist/cli/index.js +44 -44
- package/dist/clio-QQCMTUZE.js +26 -0
- package/dist/{code-nav-IJR2DBPR.js → code-nav-GUPM6766.js} +48 -32
- package/dist/codewiki/build-worker.js +76 -29
- package/dist/{compile-cache-OQAVB7Y5.js → compile-cache-WJEPUZEJ.js} +4 -4
- package/dist/{components-2TGAI2RC.js → components-TNIKXCBH.js} +13 -13
- package/dist/{config-IUA6OYNS.js → config-IIM7YOD3.js} +211 -124
- package/dist/configure-4ZM5HWJX.js +73 -0
- package/dist/{context-BOYF5EJM.js → context-44BZLJ3J.js} +62 -31
- package/dist/{context-4MPR7WKB.js → context-AIDVQKMW.js} +126 -121
- package/dist/{context-2DKHWH2T.js → context-OL5P3HEP.js} +92 -62
- package/dist/context-clear-OQV76MYP.js +184 -0
- package/dist/{context-index-HNG3MOME.js → context-index-HP2JFUWA.js} +13 -11
- package/dist/{context-map-COB37XXN.js → context-map-INTXD54D.js} +71 -21
- package/dist/{context-working-set-3I3FYX6Y.js → context-working-set-ZUW3EGLS.js} +32 -31
- package/dist/detail-UXPWRANG.js +115 -0
- package/dist/{dispatch-runner-RJ5I2F2O.js → dispatch-runner-P3ZW6G77.js} +192 -116
- package/dist/{docs-SPOV3BAN.js → docs-BL7ROUFN.js} +4 -4
- package/dist/{doctor-DKICC2SN.js → doctor-JJVGPZWT.js} +59 -58
- package/dist/{eval-OQOQUDHK.js → eval-V2RTN3UH.js} +476 -170
- package/dist/{eval-inventory-Y6QRFOH5.js → eval-inventory-QOYZERXJ.js} +7 -7
- package/dist/evidence-35PYWGSO.js +225 -0
- package/dist/{evidence-4DQ25GUQ.js → evidence-CIGGKI6J.js} +111 -94
- package/dist/{evolve-GSS52E5J.js → evolve-33SM3NJP.js} +108 -91
- package/dist/{extensions-G7MFLYHT.js → extensions-YVRHX6ZI.js} +16 -16
- package/dist/{fleet-Q37YHHAQ.js → fleet-LFO7SIPC.js} +147 -146
- package/dist/{fleet-commands-G7E4N7SM.js → fleet-commands-RLK72GU3.js} +27 -26
- package/dist/{fleet-decisions-O7M6QBA2.js → fleet-decisions-3SBSCTCW.js} +16 -15
- package/dist/{fleet-graph-TOUBW6OW.js → fleet-graph-JZIBCGMW.js} +39 -38
- package/dist/{fleet-inspect-SW33JJNI.js → fleet-inspect-2L5YGGZJ.js} +108 -91
- package/dist/{fleet-new-RDVJLHHH.js → fleet-new-RCKGSRDV.js} +3 -3
- package/dist/{fleet-preflight-CV2655TW.js → fleet-preflight-QRSHIIDE.js} +10 -9
- package/dist/{fleet-validate-KESZX2YH.js → fleet-validate-LIAVKDUU.js} +46 -42
- package/dist/{fleet-verify-UQPMTVE3.js → fleet-verify-JIK3OQZR.js} +106 -89
- package/dist/fleet-view-IWHYGQKK.js +118 -0
- package/dist/{init-PXEXQSBF.js → init-NJEDOTQW.js} +124 -123
- package/dist/{install-NKNG7KD4.js → install-3RZDDP23.js} +5 -5
- package/dist/{interop-ZG5T62U3.js → interop-RVCAYECG.js} +25 -25
- package/dist/inventory-74UL7UHU.js +118 -0
- package/dist/{library-B2W4N74O.js → library-CTKZA7K3.js} +45 -44
- package/dist/{memory-YCANYS5A.js → memory-I76I5VUH.js} +108 -93
- package/dist/{models-GERTU3YI.js → models-D4YDIQZQ.js} +64 -62
- package/dist/{monitor-CPNIUULB.js → monitor-NKVD55HX.js} +137 -107
- package/dist/{orchestrator-J4BSH4WQ.js → orchestrator-I6OATVPK.js} +1715 -1687
- package/dist/{panes-BOHAEGYC.js → panes-7BTYH3XQ.js} +8 -8
- package/dist/{panes-NXSLDQZ2.js → panes-WPOMEMRH.js} +22 -22
- package/dist/{paths-VSUWNC22.js → paths-J3KN7UAO.js} +12 -12
- package/dist/preload-EJAWJEIO.js +116 -0
- package/dist/{registry-LG64LTF4.js → registry-DESGAXWK.js} +3 -3
- package/dist/{reset-TNWTB5LU.js → reset-4XMQKDNZ.js} +22 -20
- package/dist/{resources-4PXNMD5G.js → resources-TVYVXK3Q.js} +41 -40
- package/dist/{run-D6XJ34CN.js → run-OWQNNSJU.js} +164 -157
- package/dist/{share-2NWMJJEE.js → share-NPZZMUXG.js} +43 -42
- package/dist/{skills-KR7WON5G.js → skills-OXFEAWMT.js} +47 -46
- package/dist/{skills-eval-O2ZNOLDS.js → skills-eval-J5TCKSJA.js} +128 -107
- package/dist/{skills-inventory-ZZOUBK7O.js → skills-inventory-7II4DM57.js} +41 -40
- package/dist/slash-commands-MDSDSWYF.js +92 -0
- package/dist/{steer-XA25PSCS.js → steer-S7D7IKPU.js} +7 -7
- package/dist/{support-7EMVWYG2.js → support-5VAEC32W.js} +14 -14
- package/dist/{targets-OMH2XCSN.js → targets-KILZEOCE.js} +161 -94
- package/dist/tasks-R6P6OV22.js +36 -0
- package/dist/{terminal-lease-C2J3JYRE.js → terminal-lease-LZCG2KN3.js} +12 -11
- package/dist/tools-6OCQ6SVB.js +28 -0
- package/dist/{trace-FXMXUZUF.js → trace-JHLXWUMN.js} +18 -17
- package/dist/{tree-sitter-HGKH6LG4.js → tree-sitter-AQUUOSYM.js} +6 -6
- package/dist/{tui-primitives-K5PASC3O.js → tui-primitives-RCY2HN7G.js} +3 -3
- package/dist/{uninstall-HALS6BLF.js → uninstall-FXYMFFRT.js} +17 -17
- package/dist/{upgrade-MS72RJEP.js → upgrade-D2OZH6IQ.js} +42 -41
- package/dist/{usage-NHG6MCJM.js → usage-PIASNUS4.js} +137 -105
- package/dist/{verifiers-7AUNVXDY.js → verifiers-LTHUY2PX.js} +28 -27
- package/dist/verify-HYF7KBVE.js +30 -0
- package/dist/{version-KGEG7EPO.js → version-RFPKO6T7.js} +4 -4
- package/dist/{web-fetch-V4FKSDAV.js → web-fetch-MQN4FH3X.js} +169 -18
- package/dist/wiki-generate-RK7JQ5NP.js +615 -0
- package/dist/{with-panes-BDQEWBRT.js → with-panes-OFTNAR4Y.js} +34 -20
- package/dist/worker/entry.js +108 -95
- package/dist/{workspace-ZJ6BFM3Q.js → workspace-DZ7JADBG.js} +6 -6
- package/docs/README.md +7 -6
- package/docs/architecture/acp.md +10 -0
- package/docs/architecture/architecture.md +5 -5
- package/docs/architecture/context-engine.md +45 -60
- package/docs/architecture/context-working-set.md +7 -9
- package/docs/architecture/dispatch-architecture-rationale.md +1 -1
- package/docs/architecture/evidence-and-memory.md +10 -0
- package/docs/architecture/pi-boundary.md +37 -7
- package/docs/architecture/prompt-envelope-and-tools.md +7 -7
- package/docs/architecture/session-lifecycle.md +4 -4
- package/docs/architecture/tui-design.md +45 -30
- package/docs/architecture/worker-dispatch-mechanics.md +4 -0
- package/docs/guide/commands-and-modes.md +75 -61
- package/docs/guide/configuration-and-targets.md +126 -26
- package/docs/guide/configuration-reference.md +22 -7
- package/docs/guide/environment-variables.md +6 -2
- package/docs/guide/fleet-dispatch.md +13 -6
- package/docs/guide/glossary.md +1 -1
- package/docs/guide/installation-and-lifecycle.md +79 -20
- package/docs/guide/proactive-memory.md +1 -1
- package/docs/guide/skills-marketplace.md +11 -3
- package/docs/guide/tool-usage.md +9 -2
- package/docs/process/development-pipeline.md +11 -11
- package/docs/process/documentation-coverage.md +1 -1
- package/docs/process/documentation-guide.md +2 -2
- package/docs/process/eval-runner.md +15 -0
- package/docs/process/evals-internal.md +1 -1
- package/docs/process/release-cut-checklist.md +24 -12
- package/evals/README.md +4 -0
- package/evals/behavioral-corpus-grader.mjs +147 -14
- package/evals/behavioral-model-negative-control.yaml +1 -0
- package/evals/behavioral-model.yaml +266 -1
- package/evals/fixtures/docs-retrieval.json +102 -0
- package/evals/fixtures/scalar-decision.json +17 -0
- package/evals/fixtures/scout-citation-pipeline.json +55 -0
- package/evals/fixtures/source-explanation.json +74 -0
- package/evals/fixtures/tool-arguments.json +18 -0
- package/evals/fixtures/tool-surface/read.txt +4 -0
- package/evals/fixtures/tool-surface/subdir/keep.txt +1 -0
- package/evals/no-edit-memory-grader.mjs +149 -0
- package/evals/scalar-decision-grader.py +41 -0
- package/evals/scalar-decision-machinery.ts +145 -0
- package/evals/source-explanation-grader.mjs +118 -0
- package/evals/tool-surface-grader.mjs +53 -0
- package/evals/tool-surface-model.yaml +274 -0
- package/package.json +14 -14
- package/skills/README.md +6 -6
- package/skills/registry.yaml +1 -1
- package/skills/skill-marketplace.json +1 -1
- package/src/cli/ask.ts +10 -10
- package/src/cli/bootstrap-generate.ts +6 -0
- package/src/cli/config-inspect.ts +24 -7
- package/src/cli/config-trust.ts +62 -0
- package/src/cli/config.ts +8 -0
- package/src/cli/configure-editor.ts +51 -0
- package/src/cli/configure-interop.ts +1 -1
- package/src/cli/configure-oauth.ts +1 -1
- package/src/cli/configure-onboarding.ts +232 -96
- package/src/cli/configure-prompts.ts +76 -0
- package/src/cli/configure-quick.ts +274 -0
- package/src/cli/configure-target.ts +14 -2
- package/src/cli/configure.ts +413 -174
- package/src/cli/context-map.ts +75 -14
- package/src/cli/context.ts +46 -17
- package/src/cli/eval.ts +17 -3
- package/src/cli/modes/print.ts +32 -4
- package/src/cli/oauth-manual-input.ts +1 -1
- package/src/cli/reset.ts +2 -0
- package/src/cli/run.ts +16 -14
- package/src/cli/select.ts +35 -4
- package/src/cli/skills-eval.ts +10 -8
- package/src/cli/steer-channel.ts +31 -18
- package/src/cli/targets.ts +83 -31
- package/src/cli/tasks.ts +10 -1
- package/src/cli/upgrade.ts +11 -8
- package/src/cli/usage.ts +24 -0
- package/src/cli/wiki-generate.ts +239 -96
- package/src/core/bash-exec.ts +43 -15
- package/src/core/bus-events.ts +15 -0
- package/src/core/config.ts +39 -15
- package/src/core/defaults.ts +38 -15
- package/src/{interactive → core}/external-editor.ts +4 -4
- package/src/core/file-references.ts +11 -1
- package/src/core/incomplete-installation.ts +3 -1
- package/src/core/settings-layers.ts +21 -5
- package/src/core/termination.ts +26 -9
- package/src/core/untrusted-content.ts +16 -0
- package/src/core/workspace-trust.ts +179 -0
- package/src/domains/agents/builtins/coder.md +4 -2
- package/src/domains/agents/builtins/context-bootstrap.md +3 -1
- package/src/domains/agents/builtins/documenter.md +7 -4
- package/src/domains/agents/builtins/researcher.md +1 -0
- package/src/domains/agents/builtins/scout.md +7 -1
- package/src/domains/agents/result-contract.ts +199 -26
- package/src/domains/config/classify.ts +1 -1
- package/src/domains/config/keybindings.ts +3 -31
- package/src/domains/context/bootstrap-prompt.ts +11 -9
- package/src/domains/context/bootstrap.ts +74 -39
- package/src/domains/context/clio-md.ts +88 -26
- package/src/domains/context/codewiki/build-operation.ts +121 -0
- package/src/domains/context/codewiki/build-worker-protocol.ts +37 -3
- package/src/domains/context/codewiki/build-worker.ts +3 -35
- package/src/domains/context/codewiki/coordinator.ts +36 -6
- package/src/domains/context/codewiki/indexer.ts +59 -19
- package/src/domains/context/contract.ts +6 -2
- package/src/domains/context/extension.ts +72 -10
- package/src/domains/context/fingerprint.ts +39 -34
- package/src/domains/context/index.ts +7 -1
- package/src/domains/context/prompt-context.ts +55 -14
- package/src/domains/context/refresh.ts +9 -57
- package/src/domains/context/wiki/assemble.ts +14 -10
- package/src/domains/context/wiki/evidence.ts +209 -0
- package/src/domains/context/wiki/generate.ts +201 -67
- package/src/domains/context/wiki/meta.ts +10 -2
- package/src/domains/context/wiki/plan-store.ts +70 -14
- package/src/domains/context/wiki/plan.ts +71 -14
- package/src/domains/context/wiki/prompts.ts +42 -1
- package/src/domains/context/wiki/source-content.ts +106 -0
- package/src/domains/context/wiki/staleness.ts +33 -22
- package/src/domains/context/working-set/contract.ts +8 -2
- package/src/domains/context/working-set/engine.ts +17 -4
- package/src/domains/context/working-set/fold.ts +15 -2
- package/src/domains/context/working-set/marker.ts +2 -1
- package/src/domains/context/working-set/project.ts +18 -7
- package/src/domains/context/working-set/recall.ts +82 -56
- package/src/domains/dispatch/active-route-planner.ts +6 -3
- package/src/domains/dispatch/admission-queue.ts +19 -7
- package/src/domains/dispatch/admission.ts +3 -3
- package/src/domains/dispatch/budget-envelope.ts +47 -82
- package/src/domains/dispatch/capacity-lease.ts +57 -19
- package/src/domains/dispatch/contract.ts +10 -2
- package/src/domains/dispatch/event-pump.ts +28 -7
- package/src/domains/dispatch/execution-role.ts +49 -2
- package/src/domains/dispatch/execution-scheduler.ts +2 -0
- package/src/domains/dispatch/extension.ts +190 -105
- package/src/domains/dispatch/fleet-run.ts +20 -0
- package/src/domains/dispatch/gate-role-prompts.ts +4 -2
- package/src/domains/dispatch/parallel-writers.ts +34 -0
- package/src/domains/dispatch/reservation-store.ts +8 -34
- package/src/domains/dispatch/route-approval.ts +3 -3
- package/src/domains/dispatch/route-observer.ts +4 -2
- package/src/domains/dispatch/route-quality.ts +6 -1
- package/src/domains/dispatch/types.ts +4 -3
- package/src/domains/dispatch/worker-spawn.ts +58 -21
- package/src/domains/dispatch/workspace-checkpoint.ts +57 -0
- package/src/domains/eval/compare/behavioral.ts +81 -14
- package/src/domains/eval/compare/compare.ts +15 -5
- package/src/domains/eval/compare/envelope.ts +12 -5
- package/src/domains/eval/metrics/context.ts +24 -1
- package/src/domains/eval/metrics/tracked.ts +4 -28
- package/src/domains/eval/reports/comparison.ts +9 -9
- package/src/domains/eval/runners/clio-run.ts +5 -1
- package/src/domains/eval/schema/suite.ts +2 -0
- package/src/domains/eval/schema/validate.ts +1 -0
- package/src/domains/eval/suites/run.ts +189 -13
- package/src/domains/eval/verifiers/integrity.ts +39 -0
- package/src/domains/eval/verifiers/patch.ts +58 -2
- package/src/domains/eval/workspaces/temp-copy.ts +3 -0
- package/src/domains/evidence/build.ts +4 -2
- package/src/domains/interop/registry.ts +2 -2
- package/src/domains/middleware/hooks-io.ts +45 -26
- package/src/domains/middleware/hooks.ts +6 -0
- package/src/domains/middleware/injection-screen.ts +23 -0
- package/src/domains/middleware/rules.ts +5 -1
- package/src/domains/middleware/stalled-turn.ts +18 -3
- package/src/domains/middleware/task-board-reminder.ts +4 -2
- package/src/domains/middleware/task-nudge.ts +4 -1
- package/src/domains/mux/contract.ts +34 -1
- package/src/domains/mux/dock-controller.ts +8 -1
- package/src/domains/mux/index.ts +1 -0
- package/src/domains/mux/socket-client.ts +13 -3
- package/src/domains/observability/contract.ts +2 -2
- package/src/domains/observability/projection.ts +30 -9
- package/src/domains/prompts/compiler.ts +10 -2
- package/src/domains/prompts/contract.ts +7 -4
- package/src/domains/prompts/extension.ts +28 -64
- package/src/domains/prompts/fragments/identity/clio.md +23 -0
- package/src/domains/prompts/fragments/operating/contract.md +10 -0
- package/src/domains/prompts/fragments/operating/delegation.md +5 -0
- package/src/domains/prompts/fragments/wiki/page.md +28 -15
- package/src/domains/prompts/fragments/wiki/plan.md +4 -4
- package/src/domains/prompts/preload-prefix.ts +31 -0
- package/src/domains/prompts/preload.ts +135 -61
- package/src/domains/providers/auth/backend-file.ts +15 -11
- package/src/domains/providers/auth/storage.ts +3 -5
- package/src/domains/providers/catalog.ts +18 -3
- package/src/domains/providers/probe/fingerprint.ts +13 -6
- package/src/domains/providers/probe/reasoning.ts +2 -0
- package/src/domains/providers/runtime-resolution.ts +11 -9
- package/src/domains/providers/runtimes/cloud/openrouter.ts +2 -0
- package/src/domains/providers/runtimes/common/probe-helpers.ts +23 -7
- package/src/domains/providers/runtimes/protocol/anthropic-compat.ts +7 -2
- package/src/domains/providers/runtimes/protocol/openai-compat.ts +10 -4
- package/src/domains/resources/skills/promotion.ts +8 -1
- package/src/domains/safety/action-classifier.ts +9 -0
- package/src/domains/safety/autonomy.ts +10 -1
- package/src/domains/safety/contract.ts +5 -1
- package/src/domains/safety/default-path-policy.ts +11 -0
- package/src/domains/safety/extension.ts +11 -2
- package/src/domains/safety/policy-engine.ts +189 -32
- package/src/domains/safety/project-policy.ts +7 -2
- package/src/domains/safety/workspace-trust.ts +43 -0
- package/src/domains/session/compaction/compact.ts +384 -21
- package/src/domains/session/compaction/cut-point.ts +42 -5
- package/src/domains/session/compaction/tokens.ts +9 -1
- package/src/domains/session/decision-board.ts +43 -33
- package/src/domains/session/entries.ts +169 -4
- package/src/domains/session/prompt-manifest.ts +47 -8
- package/src/domains/session/task-board.ts +21 -3
- package/src/domains/user-tasks/handoff.ts +16 -0
- package/src/engine/acp/adapter.ts +44 -12
- package/src/engine/acp/server.ts +1 -0
- package/src/engine/acp/transport.ts +2 -1
- package/src/engine/acp/types.ts +6 -1
- package/src/engine/antigravity/subprocess-runtime.ts +20 -4
- package/src/engine/api-registry.ts +19 -2
- package/src/engine/apis/openai-completions.ts +13 -6
- package/src/engine/apis/output-budget.ts +26 -10
- package/src/engine/claude/sdk-runtime.ts +4 -3
- package/src/engine/env-api-keys.ts +2 -1
- package/src/engine/external-subprocess.ts +14 -3
- package/src/engine/loop-guard.ts +19 -2
- package/src/engine/provider-diagnostics.ts +129 -0
- package/src/engine/provider-payload.ts +3 -1
- package/src/engine/worker-runtime.ts +13 -2
- package/src/engine/worker-tools.ts +5 -1
- package/src/entry/extension-reload.ts +1 -0
- package/src/entry/orchestrator.ts +53 -15
- package/src/interactive/application-controller.ts +1 -31
- package/src/interactive/chat-loop-messages.ts +12 -4
- package/src/interactive/chat-loop.ts +115 -45
- package/src/interactive/chat-panel.ts +163 -637
- package/src/interactive/chat-renderer.ts +73 -30
- package/src/interactive/context-recall-command.ts +2 -1
- package/src/interactive/dispatch-board.ts +18 -5
- package/src/interactive/editor-submit.ts +21 -31
- package/src/interactive/footer/dashboard.ts +8 -3
- package/src/interactive/footer/widgets.ts +50 -91
- package/src/interactive/interactive-application.ts +24 -44
- package/src/interactive/interactive-event-projection.ts +9 -45
- package/src/interactive/interactive-input-runtime.ts +3 -28
- package/src/interactive/interactive-presentation.ts +45 -16
- package/src/interactive/interactive-slash-runtime.ts +5 -40
- package/src/interactive/layout.ts +31 -5
- package/src/interactive/model-session-replay.ts +2 -2
- package/src/interactive/overlay-frame.ts +1 -0
- package/src/interactive/overlay-general-openers.ts +5 -1
- package/src/interactive/overlay-lifecycle.ts +1 -0
- package/src/interactive/overlay-session-lifecycle.ts +7 -1
- package/src/interactive/overlays/ask-user.ts +1 -0
- package/src/interactive/overlays/message-picker.ts +1 -1
- package/src/interactive/overlays/settings.ts +9 -8
- package/src/interactive/renderers/preview.ts +16 -0
- package/src/interactive/renderers/tool-execution.ts +84 -161
- package/src/interactive/renderers/worker-entry.ts +74 -43
- package/src/interactive/slash-autocomplete.ts +1 -6
- package/src/interactive/slash-commands.ts +16 -46
- package/src/interactive/status/controller.ts +0 -5
- package/src/interactive/status/state-machine.ts +44 -26
- package/src/interactive/status/types.ts +3 -0
- package/src/interactive/status/verbs.ts +13 -12
- package/src/interactive/transcript-detail.ts +50 -112
- package/src/interactive/turn-context.ts +221 -53
- package/src/interactive/turn-middleware.ts +3 -1
- package/src/interactive/turn-persistence.ts +3 -0
- package/src/interactive/turn-runtime.ts +11 -2
- package/src/interactive/turn-state.ts +10 -9
- package/src/interactive/view/artifacts.ts +4 -0
- package/src/interactive/view/view-overlay.ts +44 -34
- package/src/interactive/watch-pane.ts +18 -4
- package/src/interactive/worker-stream.ts +7 -7
- package/src/tools/agent-tools.ts +6 -3
- package/src/tools/bash.ts +1 -1
- package/src/tools/builtin-tool-catalog.ts +9 -2
- package/src/tools/codewiki/code-nav.ts +4 -10
- package/src/tools/compete-judge-task.ts +71 -0
- package/src/tools/compete-worktrees.ts +34 -0
- package/src/tools/context/index.ts +32 -7
- package/src/tools/context/surface.ts +15 -4
- package/src/tools/decide.ts +1 -1
- package/src/tools/dispatch-admission.ts +12 -1
- package/src/tools/dispatch-arguments.ts +38 -1
- package/src/tools/dispatch-plan.ts +7 -7
- package/src/tools/dispatch-runner.ts +48 -32
- package/src/tools/dispatch-schema.ts +30 -23
- package/src/tools/dispatch-scout-admission.ts +10 -44
- package/src/tools/dispatch-scout.ts +2 -3
- package/src/tools/find.ts +13 -4
- package/src/tools/grep.ts +13 -1
- package/src/tools/ls.ts +7 -1
- package/src/tools/monitor.ts +26 -11
- package/src/tools/network-policy.ts +11 -24
- package/src/tools/observation.ts +39 -2
- package/src/tools/presentation.ts +1 -1
- package/src/tools/read.ts +112 -15
- package/src/tools/registry.ts +55 -18
- package/src/tools/result-shaping.ts +110 -2
- package/src/tools/tasks.ts +33 -7
- package/src/tools/verify/frontend.ts +67 -30
- package/src/tools/verify/numeric.ts +10 -5
- package/src/tools/web-fetch-network.ts +179 -0
- package/src/tools/web-fetch-surface.ts +2 -1
- package/src/tools/web-fetch.ts +15 -13
- package/src/tools/worker-evidence.ts +27 -0
- package/src/worker/spec-contract.ts +12 -8
- package/dist/builtins-WGALA46I.js +0 -22
- package/dist/chunk-2WZ546HR.js +0 -792
- package/dist/chunk-5PSMVOLM.js +0 -56
- package/dist/chunk-EL24TAU4.js +0 -1560
- package/dist/chunk-IZXGRF7P.js +0 -4048
- package/dist/chunk-JVCV3ICN.js +0 -47
- package/dist/chunk-MNJGS2IN.js +0 -33
- package/dist/chunk-O5CVSAG5.js +0 -122
- package/dist/chunk-ODGTEFFI.js +0 -50
- package/dist/chunk-OQE5J4C6.js +0 -73
- package/dist/chunk-UUVG37B4.js +0 -244
- package/dist/chunk-V6HJFQZE.js +0 -228
- package/dist/clio-QLICPCF5.js +0 -25
- package/dist/configure-VEPX4NMX.js +0 -55
- package/dist/context-clear-S4ZJCQUX.js +0 -182
- package/dist/detail-A7JAVSIG.js +0 -98
- package/dist/evidence-4F5USFKH.js +0 -208
- package/dist/fleet-view-MN2VG4MR.js +0 -101
- package/dist/inventory-C26CFDRR.js +0 -101
- package/dist/preload-P6DGH2PZ.js +0 -13
- package/dist/slash-commands-ZXPJD64J.js +0 -92
- package/dist/tasks-IPAGMEIX.js +0 -36
- package/dist/tools-EFFEAIDP.js +0 -28
- package/dist/verify-FWYGPKMR.js +0 -29
- package/dist/wiki-generate-743CIGJW.js +0 -476
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { createRequire as __clioCreateRequire } from "node:module"; const require = __clioCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
EVAL_SUITE_V2_VERSION
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5PHVPU4G.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./chunk-V6HJFQZE.js";
|
|
6
|
+
isProjectPreloadClass
|
|
7
|
+
} from "./chunk-5ZSZEYJK.js";
|
|
9
8
|
import {
|
|
10
9
|
discoverAgentRecipes
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VAHLPXPY.js";
|
|
11
|
+
import "./chunk-536HXRFE.js";
|
|
12
|
+
import "./chunk-DNCE23JJ.js";
|
|
13
|
+
import "./chunk-U7H5WRG5.js";
|
|
14
|
+
import "./chunk-5VTJP36Q.js";
|
|
12
15
|
import {
|
|
13
16
|
EvalTaskFileError,
|
|
14
17
|
TRUST_STATUS_AXES,
|
|
@@ -21,13 +24,15 @@ import {
|
|
|
21
24
|
formatTrustSummary,
|
|
22
25
|
inspectRunReceiptTrustStatus,
|
|
23
26
|
loadEvalTaskFile,
|
|
27
|
+
loadFragments,
|
|
28
|
+
renderCodewikiDigest,
|
|
24
29
|
summarizeTrustStatus,
|
|
25
30
|
verifyReceiptIntegrity
|
|
26
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-HZ2T2YED.js";
|
|
27
32
|
import {
|
|
28
33
|
listSessionLedgerRefs,
|
|
29
34
|
parseSessionEntries
|
|
30
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-DXLUVUD4.js";
|
|
31
36
|
import {
|
|
32
37
|
EVAL_BEHAVIOR_METRIC_DEFINITIONS_V1,
|
|
33
38
|
EVAL_EXECUTION_ENVELOPE_SCHEMA_V1,
|
|
@@ -42,104 +47,110 @@ import {
|
|
|
42
47
|
loadEvalArtifactV4,
|
|
43
48
|
normalizeEvalRunnerKind,
|
|
44
49
|
normalizeEvalSchemaId,
|
|
50
|
+
parseEvalArtifactV4,
|
|
45
51
|
parseEvalBehaviorScenarioV1,
|
|
46
52
|
parseEvalExecutionMatrixDimensionsV1,
|
|
47
53
|
parseEvalVerdictEnvelopeV1,
|
|
48
54
|
renderEvalServingConfiguration,
|
|
49
55
|
sameEvalServingConfiguration,
|
|
50
56
|
writeEvalArtifactV4
|
|
51
|
-
} from "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-3DPEIQKN.js";
|
|
58
|
-
import "./chunk-TQAHXW6Y.js";
|
|
59
|
-
import "./chunk-5MEZN6CB.js";
|
|
60
|
-
import "./chunk-3ODX73FK.js";
|
|
61
|
-
import "./chunk-HVDIIIQW.js";
|
|
57
|
+
} from "./chunk-U44YYLVV.js";
|
|
58
|
+
import "./chunk-O5F25NIE.js";
|
|
59
|
+
import "./chunk-CXQ37WJH.js";
|
|
60
|
+
import "./chunk-QH3ZTUOA.js";
|
|
61
|
+
import "./chunk-22PQ4TX4.js";
|
|
62
|
+
import "./chunk-DZK63TZJ.js";
|
|
62
63
|
import {
|
|
63
|
-
|
|
64
|
-
} from "./chunk-
|
|
65
|
-
import "./chunk-
|
|
66
|
-
import "./chunk-6PAZTBPA.js";
|
|
64
|
+
shellQuote
|
|
65
|
+
} from "./chunk-SD7SHNDW.js";
|
|
66
|
+
import "./chunk-DNHVRBH4.js";
|
|
67
67
|
import {
|
|
68
|
-
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import "./chunk-
|
|
68
|
+
printError
|
|
69
|
+
} from "./chunk-3T4DXWP6.js";
|
|
70
|
+
import "./chunk-K2HL3GBL.js";
|
|
71
|
+
import "./chunk-YPRSNUTC.js";
|
|
72
|
+
import "./chunk-LY4N4TTL.js";
|
|
71
73
|
import {
|
|
72
74
|
agentSpecFingerprint,
|
|
73
75
|
normalizeAgentSpec
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import "./chunk-
|
|
76
|
-
import
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
import "./chunk-
|
|
80
|
-
import "./chunk-
|
|
81
|
-
import "./chunk-54X7T7DK.js";
|
|
82
|
-
import "./chunk-I5FWO7L5.js";
|
|
83
|
-
import "./chunk-4NSRCOYP.js";
|
|
84
|
-
import "./chunk-CFGTUFWB.js";
|
|
76
|
+
} from "./chunk-OQM5IVJY.js";
|
|
77
|
+
import "./chunk-KAFMW7WM.js";
|
|
78
|
+
import {
|
|
79
|
+
createSafetyPolicyEngine
|
|
80
|
+
} from "./chunk-IKRWLEDA.js";
|
|
81
|
+
import "./chunk-NTK3WTHM.js";
|
|
82
|
+
import "./chunk-MCJKEGHO.js";
|
|
85
83
|
import {
|
|
86
84
|
extractReasoningTokens
|
|
87
|
-
} from "./chunk-
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import "./chunk-
|
|
85
|
+
} from "./chunk-77CZRFTE.js";
|
|
86
|
+
import "./chunk-LUL5Z66S.js";
|
|
87
|
+
import "./chunk-M6TAYK66.js";
|
|
88
|
+
import "./chunk-KQ6IDQIB.js";
|
|
89
|
+
import "./chunk-PZN2LQY6.js";
|
|
90
|
+
import "./chunk-R2P2U3ZS.js";
|
|
91
|
+
import "./chunk-NTTS3O53.js";
|
|
92
|
+
import "./chunk-M4KFUXS7.js";
|
|
93
|
+
import "./chunk-EM2WNQS2.js";
|
|
94
|
+
import "./chunk-WNGF5AJX.js";
|
|
90
95
|
import {
|
|
91
96
|
namingCompatibilityEnvironment
|
|
92
|
-
} from "./chunk-
|
|
93
|
-
import "./chunk-
|
|
97
|
+
} from "./chunk-DVNAPPXU.js";
|
|
98
|
+
import "./chunk-5CY4Q6QI.js";
|
|
99
|
+
import "./chunk-FQOOGXBH.js";
|
|
94
100
|
import {
|
|
95
101
|
InvalidIdError
|
|
96
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-UHW5V7HC.js";
|
|
103
|
+
import "./chunk-B6UM3OZC.js";
|
|
104
|
+
import {
|
|
105
|
+
ALL_TOOL_NAMES
|
|
106
|
+
} from "./chunk-EHOSNVVM.js";
|
|
97
107
|
import {
|
|
98
108
|
normalizeClioCoderEventRecord,
|
|
99
109
|
normalizeClioCoderEventType
|
|
100
|
-
} from "./chunk-
|
|
101
|
-
import "./chunk-
|
|
110
|
+
} from "./chunk-KMF54VH3.js";
|
|
111
|
+
import "./chunk-HL26ADLH.js";
|
|
102
112
|
import {
|
|
103
113
|
readCodewiki,
|
|
104
114
|
structuralCodewikiHash
|
|
105
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-W2RJEH6Q.js";
|
|
106
116
|
import {
|
|
107
117
|
detectProjectProfile
|
|
108
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-CVDAFGPW.js";
|
|
109
119
|
import {
|
|
110
120
|
enumerateWorkspaceFiles
|
|
111
|
-
} from "./chunk-
|
|
112
|
-
import "./chunk-
|
|
113
|
-
import "./chunk-
|
|
114
|
-
import "./chunk-
|
|
115
|
-
import "./chunk-
|
|
116
|
-
import "./chunk-
|
|
117
|
-
import "./chunk-
|
|
118
|
-
import "./chunk-
|
|
119
|
-
import "./chunk-
|
|
120
|
-
import "./chunk-
|
|
121
|
-
import "./chunk-
|
|
122
|
-
import "./chunk-
|
|
123
|
-
import "./chunk-
|
|
124
|
-
import "./chunk-
|
|
125
|
-
import "./chunk-
|
|
121
|
+
} from "./chunk-PPEZJWUG.js";
|
|
122
|
+
import "./chunk-WDV62RKY.js";
|
|
123
|
+
import "./chunk-GD55RTIW.js";
|
|
124
|
+
import "./chunk-E3LEPLQ2.js";
|
|
125
|
+
import "./chunk-3BJGMT2D.js";
|
|
126
|
+
import "./chunk-U2MSJ57E.js";
|
|
127
|
+
import "./chunk-C27U2TYG.js";
|
|
128
|
+
import "./chunk-GJ24ODAX.js";
|
|
129
|
+
import "./chunk-LTR5QCLS.js";
|
|
130
|
+
import "./chunk-6EXUUOSN.js";
|
|
131
|
+
import "./chunk-ZTNFYMIO.js";
|
|
132
|
+
import "./chunk-HXHFDHB6.js";
|
|
133
|
+
import "./chunk-VNBICSS2.js";
|
|
134
|
+
import "./chunk-2QPI3TR3.js";
|
|
135
|
+
import "./chunk-TK2BMCBZ.js";
|
|
126
136
|
import {
|
|
127
137
|
require_dist
|
|
128
|
-
} from "./chunk-
|
|
129
|
-
import "./chunk-
|
|
130
|
-
import "./chunk-
|
|
138
|
+
} from "./chunk-B5GGDIHT.js";
|
|
139
|
+
import "./chunk-ZZFWWYLX.js";
|
|
140
|
+
import "./chunk-DXVMLM3Z.js";
|
|
131
141
|
import {
|
|
132
142
|
clioDataDir,
|
|
133
143
|
clioStateDir
|
|
134
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-CTTI7G3T.js";
|
|
135
145
|
import {
|
|
136
146
|
__toESM,
|
|
137
147
|
init_esm_shims
|
|
138
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-ECBHH7LU.js";
|
|
139
149
|
|
|
140
150
|
// src/cli/eval.ts
|
|
141
151
|
init_esm_shims();
|
|
142
|
-
import {
|
|
152
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
153
|
+
import { resolve as resolve10 } from "node:path";
|
|
143
154
|
|
|
144
155
|
// src/domains/eval/compare/compare.ts
|
|
145
156
|
init_esm_shims();
|
|
@@ -238,28 +249,33 @@ init_esm_shims();
|
|
|
238
249
|
// src/domains/eval/compare/envelope.ts
|
|
239
250
|
init_esm_shims();
|
|
240
251
|
function compareEvalExecutionEnvelopesV1(identity, baseline, candidate, baselineDimensions, candidateDimensions) {
|
|
252
|
+
const mismatchIdentity = {
|
|
253
|
+
scenarioId: identity.scenarioId,
|
|
254
|
+
role: identity.role,
|
|
255
|
+
target: { id: identity.target.id, model: identity.target.model }
|
|
256
|
+
};
|
|
241
257
|
const leftDimensions = [...baselineDimensions].sort();
|
|
242
258
|
const rightDimensions = [...candidateDimensions].sort();
|
|
243
259
|
if (stableJson(leftDimensions) !== stableJson(rightDimensions)) {
|
|
244
|
-
return { ...
|
|
260
|
+
return { ...mismatchIdentity, fields: ["matrix.dimensions"] };
|
|
245
261
|
}
|
|
246
262
|
if (baseline.some((result) => result.executionEnvelope !== void 0) && baseline.some((result) => result.executionEnvelope === void 0) || candidate.some((result) => result.executionEnvelope !== void 0) && candidate.some((result) => result.executionEnvelope === void 0)) {
|
|
247
|
-
return { ...
|
|
263
|
+
return { ...mismatchIdentity, fields: ["executionEnvelope.missingTrial"] };
|
|
248
264
|
}
|
|
249
265
|
const ignored = new Set(leftDimensions);
|
|
250
266
|
const baselineEnvelopes = uniqueEnvelopes(baseline, ignored);
|
|
251
267
|
const candidateEnvelopes = uniqueEnvelopes(candidate, ignored);
|
|
252
268
|
if (baselineEnvelopes.length === 0 && candidateEnvelopes.length === 0) return null;
|
|
253
269
|
if (baselineEnvelopes.length === 0 || candidateEnvelopes.length === 0) {
|
|
254
|
-
return { ...
|
|
270
|
+
return { ...mismatchIdentity, fields: ["executionEnvelope"] };
|
|
255
271
|
}
|
|
256
272
|
if (baselineEnvelopes.length > 1 || candidateEnvelopes.length > 1) {
|
|
257
|
-
return { ...
|
|
273
|
+
return { ...mismatchIdentity, fields: ["executionEnvelope.withinRunVariance"] };
|
|
258
274
|
}
|
|
259
275
|
const left = baselineEnvelopes[0];
|
|
260
276
|
const right = candidateEnvelopes[0];
|
|
261
277
|
if (left === void 0 || right === void 0 || stableJson(left) === stableJson(right)) return null;
|
|
262
|
-
return { ...
|
|
278
|
+
return { ...mismatchIdentity, fields: differingFields(left, right, ignored) };
|
|
263
279
|
}
|
|
264
280
|
function uniqueEnvelopes(results, ignored) {
|
|
265
281
|
const byIdentity = /* @__PURE__ */ new Map();
|
|
@@ -322,26 +338,45 @@ function stableJson(value) {
|
|
|
322
338
|
|
|
323
339
|
// src/domains/eval/compare/behavioral.ts
|
|
324
340
|
function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
325
|
-
const
|
|
326
|
-
const
|
|
341
|
+
const baselineDimensions = baseline.matrix.dimensions ?? [];
|
|
342
|
+
const candidateDimensions = candidate.matrix.dimensions ?? [];
|
|
343
|
+
const varying = new Set(baselineDimensions.filter((dimension) => candidateDimensions.includes(dimension)));
|
|
344
|
+
const baselineGroups = behaviorGroups(baseline, varying);
|
|
345
|
+
const candidateGroups = behaviorGroups(candidate, varying);
|
|
327
346
|
const keys = /* @__PURE__ */ new Set([...baselineGroups.keys(), ...candidateGroups.keys()]);
|
|
328
347
|
const comparisons = [];
|
|
329
348
|
const envelopeMismatches = [];
|
|
330
|
-
const baselineDimensions = baseline.matrix.dimensions ?? [];
|
|
331
|
-
const candidateDimensions = candidate.matrix.dimensions ?? [];
|
|
332
349
|
for (const key of [...keys].sort((left, right) => left.localeCompare(right))) {
|
|
333
350
|
const baselineGroup = baselineGroups.get(key);
|
|
334
351
|
const candidateGroup = candidateGroups.get(key);
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
337
|
-
const
|
|
352
|
+
const group = baselineGroup ?? candidateGroup;
|
|
353
|
+
if (group === void 0) continue;
|
|
354
|
+
const identity = {
|
|
355
|
+
scenarioId: group.scenarioId,
|
|
356
|
+
role: group.role,
|
|
357
|
+
target: { id: group.target.id, model: group.target.model }
|
|
358
|
+
};
|
|
359
|
+
const routes = {
|
|
360
|
+
baselineTargets: baselineGroup?.targets ?? [],
|
|
361
|
+
candidateTargets: candidateGroup?.targets ?? []
|
|
362
|
+
};
|
|
363
|
+
let envelopeMismatch = compareEvalExecutionEnvelopesV1(
|
|
338
364
|
identity,
|
|
339
365
|
baselineGroup?.results ?? [],
|
|
340
366
|
candidateGroup?.results ?? [],
|
|
341
367
|
baselineDimensions,
|
|
342
368
|
candidateDimensions
|
|
343
369
|
);
|
|
344
|
-
if (
|
|
370
|
+
if (routes.baselineTargets.length > 1 || routes.candidateTargets.length > 1) {
|
|
371
|
+
envelopeMismatch = {
|
|
372
|
+
...identity,
|
|
373
|
+
fields: ["behavioralMetrics.ambiguousRouteGroup", ...envelopeMismatch?.fields ?? []]
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
if (envelopeMismatch !== null) {
|
|
377
|
+
envelopeMismatch = { ...envelopeMismatch, ...routes };
|
|
378
|
+
envelopeMismatches.push(envelopeMismatch);
|
|
379
|
+
}
|
|
345
380
|
const comparability = {
|
|
346
381
|
comparable: envelopeMismatch === null,
|
|
347
382
|
mismatchedFields: envelopeMismatch?.fields ?? []
|
|
@@ -349,18 +384,21 @@ function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
|
349
384
|
for (const definition of EVAL_BEHAVIOR_METRIC_DEFINITIONS_V1) {
|
|
350
385
|
const baselineDistribution = behaviorDistribution(baselineGroup?.results ?? [], definition);
|
|
351
386
|
const candidateDistribution = behaviorDistribution(candidateGroup?.results ?? [], definition);
|
|
387
|
+
const noiseBand = definition.family === "safety" ? 0 : distributionNoiseBand(baselineDistribution, candidateDistribution);
|
|
352
388
|
comparisons.push({
|
|
353
389
|
scenarioId: identity.scenarioId,
|
|
354
390
|
role: identity.role,
|
|
355
391
|
target: identity.target,
|
|
392
|
+
...routes,
|
|
356
393
|
metric: definition.name,
|
|
357
394
|
family: definition.family,
|
|
358
395
|
direction: definition.direction,
|
|
359
396
|
hardGate: definition.hardGate,
|
|
360
397
|
baseline: baselineDistribution,
|
|
361
398
|
candidate: candidateDistribution,
|
|
362
|
-
change: envelopeMismatch === null ? classifyChange(baselineDistribution.mean, candidateDistribution.mean, definition.direction) : "incomparable",
|
|
399
|
+
change: envelopeMismatch === null ? classifyChange(baselineDistribution.mean, candidateDistribution.mean, definition.direction, noiseBand) : "incomparable",
|
|
363
400
|
meanDelta: subtractNullable(candidateDistribution.mean, baselineDistribution.mean),
|
|
401
|
+
noiseBand,
|
|
364
402
|
varianceChange: envelopeMismatch === null ? classifyChange(baselineDistribution.variance, candidateDistribution.variance, "lower") : "incomparable",
|
|
365
403
|
varianceDelta: subtractNullable(candidateDistribution.variance, baselineDistribution.variance),
|
|
366
404
|
comparability
|
|
@@ -373,6 +411,8 @@ function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
|
373
411
|
scenarioId: comparison.scenarioId,
|
|
374
412
|
role: comparison.role,
|
|
375
413
|
target: comparison.target,
|
|
414
|
+
baselineTargets: comparison.baselineTargets,
|
|
415
|
+
candidateTargets: comparison.candidateTargets,
|
|
376
416
|
metric: comparison.metric,
|
|
377
417
|
change: comparison.change
|
|
378
418
|
}
|
|
@@ -388,24 +428,28 @@ function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
|
388
428
|
envelopeMismatches
|
|
389
429
|
};
|
|
390
430
|
}
|
|
391
|
-
function classifyChange(baseline, candidate, direction) {
|
|
431
|
+
function classifyChange(baseline, candidate, direction, noiseBand = 0) {
|
|
392
432
|
if (baseline === null || candidate === null) return "incomparable";
|
|
393
|
-
if (baseline
|
|
433
|
+
if (Math.abs(candidate - baseline) <= noiseBand) return "unchanged";
|
|
394
434
|
if (direction === "higher") return candidate > baseline ? "improved" : "regressed";
|
|
395
435
|
return candidate < baseline ? "improved" : "regressed";
|
|
396
436
|
}
|
|
397
|
-
function behaviorGroups(artifact) {
|
|
437
|
+
function behaviorGroups(artifact, varying) {
|
|
398
438
|
const groups = /* @__PURE__ */ new Map();
|
|
399
439
|
for (const result of artifact.results) {
|
|
400
440
|
const behavioral = result.behavioralMetrics;
|
|
401
441
|
if (behavioral === void 0) continue;
|
|
402
|
-
const key = groupKey(behavioral.scenarioId, behavioral.role, behavioral.target);
|
|
442
|
+
const key = groupKey(behavioral.scenarioId, behavioral.role, behavioral.target, varying);
|
|
403
443
|
const group = groups.get(key) ?? {
|
|
404
444
|
scenarioId: behavioral.scenarioId,
|
|
405
445
|
role: behavioral.role,
|
|
406
446
|
target: behavioral.target,
|
|
447
|
+
targets: [],
|
|
407
448
|
results: []
|
|
408
449
|
};
|
|
450
|
+
if (!group.targets.some((target) => target.id === behavioral.target.id && target.model === behavioral.target.model)) {
|
|
451
|
+
group.targets.push(behavioral.target);
|
|
452
|
+
}
|
|
409
453
|
group.results.push(result);
|
|
410
454
|
groups.set(key, group);
|
|
411
455
|
}
|
|
@@ -444,12 +488,21 @@ function behaviorDistribution(results, definition) {
|
|
|
444
488
|
source: definition.source
|
|
445
489
|
};
|
|
446
490
|
}
|
|
447
|
-
function groupKey(scenarioId, role, target) {
|
|
448
|
-
return JSON.stringify([
|
|
491
|
+
function groupKey(scenarioId, role, target, varying) {
|
|
492
|
+
return JSON.stringify([
|
|
493
|
+
scenarioId,
|
|
494
|
+
role,
|
|
495
|
+
varying.has("target") ? null : target.id,
|
|
496
|
+
varying.has("wireModel") ? null : target.model
|
|
497
|
+
]);
|
|
449
498
|
}
|
|
450
499
|
function subtractNullable(left, right) {
|
|
451
500
|
return left === null || right === null ? null : left - right;
|
|
452
501
|
}
|
|
502
|
+
function distributionNoiseBand(baseline, candidate) {
|
|
503
|
+
if (baseline.measured < 2 || candidate.measured < 2 || baseline.unmeasured > 0 || candidate.unmeasured > 0) return 0;
|
|
504
|
+
return 2 * Math.sqrt((baseline.variance ?? 0) / (baseline.measured - 1) + (candidate.variance ?? 0) / (candidate.measured - 1));
|
|
505
|
+
}
|
|
453
506
|
|
|
454
507
|
// src/domains/eval/compare/compare.ts
|
|
455
508
|
var EvalServingConfigurationDriftError = class extends Error {
|
|
@@ -507,7 +560,7 @@ function compareEvalArtifactsV4(baseline, candidate, options = {}) {
|
|
|
507
560
|
}
|
|
508
561
|
function renderEvalComparisonV4(summary) {
|
|
509
562
|
const envelopeFailures = summary.envelopeMismatches.map(
|
|
510
|
-
(mismatch) => ` incomparable envelope: ${mismatch.scenarioId} ${mismatch.role} ${mismatch
|
|
563
|
+
(mismatch) => ` incomparable envelope: ${mismatch.scenarioId} ${mismatch.role} ${renderEvalComparisonRoutesV1(mismatch)} fields=${mismatch.fields.join(",")}`
|
|
511
564
|
);
|
|
512
565
|
const affected = summary.affectedCorpusResults.map(
|
|
513
566
|
(result) => ` affected corpus result: ${result.scenarioId} role=${result.role} changed=${result.changedFields.join(",")}`
|
|
@@ -515,7 +568,7 @@ function renderEvalComparisonV4(summary) {
|
|
|
515
568
|
const scenarioReports = renderRollups("per-scenario baseline/candidate report", summary.scenarioReports);
|
|
516
569
|
const roleReports = renderRollups("per-role baseline/candidate report", summary.roleReports);
|
|
517
570
|
const hardFailures = summary.hardGate.failures.map(
|
|
518
|
-
(failure) => ` hard failure: ${failure.scenarioId} ${failure.role} ${failure
|
|
571
|
+
(failure) => ` hard failure: ${failure.scenarioId} ${failure.role} ${renderEvalComparisonRoutesV1(failure)} ${failure.metric} ${failure.change}`
|
|
519
572
|
);
|
|
520
573
|
const tracked = summary.trackedMetrics.flatMap((row, index) => [
|
|
521
574
|
...index === 0 ? [
|
|
@@ -542,13 +595,12 @@ function renderEvalComparisonV4(summary) {
|
|
|
542
595
|
const behavioral = summary.behavioralMetrics.flatMap((row, index) => [
|
|
543
596
|
...index === 0 ? [
|
|
544
597
|
"behavioral metrics:",
|
|
545
|
-
"scenario role
|
|
598
|
+
"scenario role baseline_target/model -> candidate_target/model family metric baseline_mean baseline_variance baseline_coverage candidate_mean candidate_variance candidate_coverage mean_delta variance_delta noise_band change variance_change comparability gate source"
|
|
546
599
|
] : [],
|
|
547
600
|
[
|
|
548
601
|
row.scenarioId,
|
|
549
602
|
row.role,
|
|
550
|
-
row
|
|
551
|
-
row.target.model ?? "none",
|
|
603
|
+
renderEvalComparisonRoutesV1(row),
|
|
552
604
|
row.family,
|
|
553
605
|
row.metric,
|
|
554
606
|
formatMetric(row.baseline.mean),
|
|
@@ -559,6 +611,7 @@ function renderEvalComparisonV4(summary) {
|
|
|
559
611
|
`${row.candidate.measured}/${row.candidate.observations}`,
|
|
560
612
|
formatSignedMetric(row.meanDelta),
|
|
561
613
|
formatSignedMetric(row.varianceDelta),
|
|
614
|
+
formatMetric(row.noiseBand),
|
|
562
615
|
row.change,
|
|
563
616
|
row.varianceChange,
|
|
564
617
|
row.comparability.comparable ? "comparable" : `incomparable:${row.comparability.mismatchedFields.join(",")}`,
|
|
@@ -586,6 +639,10 @@ function renderEvalComparisonV4(summary) {
|
|
|
586
639
|
""
|
|
587
640
|
].join("\n");
|
|
588
641
|
}
|
|
642
|
+
function renderEvalComparisonRoutesV1(identity) {
|
|
643
|
+
const render = (targets) => targets.map((target) => `${target.id}/${target.model ?? "none"}`).join(",") || "missing";
|
|
644
|
+
return `${render(identity.baselineTargets ?? [identity.target])} -> ${render(identity.candidateTargets ?? [identity.target])}`;
|
|
645
|
+
}
|
|
589
646
|
function behaviorRollups(rows, keyOf) {
|
|
590
647
|
const groups = /* @__PURE__ */ new Map();
|
|
591
648
|
for (const row of rows) groups.set(keyOf(row), [...groups.get(keyOf(row)) ?? [], row]);
|
|
@@ -845,7 +902,7 @@ function renderEvalComparisonReportV1(summary, format2) {
|
|
|
845
902
|
}
|
|
846
903
|
function renderMarkdown(summary) {
|
|
847
904
|
const rows = summary.behavioralMetrics.map(
|
|
848
|
-
(row) => `| ${cell(row.scenarioId)} | ${cell(row.role)} | ${cell(
|
|
905
|
+
(row) => `| ${cell(row.scenarioId)} | ${cell(row.role)} | ${cell(renderEvalComparisonRoutesV1(row))} | ${row.family} | ${row.metric} | ${format(row.baseline.mean)} | ${format(row.baseline.variance)} | ${row.baseline.measured}/${row.baseline.observations} | ${format(row.candidate.mean)} | ${format(row.candidate.variance)} | ${row.candidate.measured}/${row.candidate.observations} | ${format(row.noiseBand)} | ${row.change} | ${row.varianceChange} | ${row.comparability.comparable ? "comparable" : cell(row.comparability.mismatchedFields.join(", "))} | ${row.hardGate ? "hard" : "informational"} |`
|
|
849
906
|
);
|
|
850
907
|
const scenarioRows = summary.scenarioReports.map(
|
|
851
908
|
(report) => `| ${cell(report.id)} | ${changeCounts2(report.metrics)} | ${changeCounts2(report.variance)} |`
|
|
@@ -858,10 +915,10 @@ function renderMarkdown(summary) {
|
|
|
858
915
|
"",
|
|
859
916
|
`Behavioral hard gate: **${summary.hardGate.pass ? "pass" : "fail"}**`,
|
|
860
917
|
...summary.hardGate.failures.map(
|
|
861
|
-
(failure) => `- Hard failure: ${failure.scenarioId} / ${failure.role} / ${failure
|
|
918
|
+
(failure) => `- Hard failure: ${failure.scenarioId} / ${failure.role} / ${renderEvalComparisonRoutesV1(failure)} / ${failure.metric}: ${failure.change}`
|
|
862
919
|
),
|
|
863
920
|
...summary.envelopeMismatches.map(
|
|
864
|
-
(mismatch) => `- Incomparable envelope: ${mismatch.scenarioId} / ${mismatch.role} / ${mismatch
|
|
921
|
+
(mismatch) => `- Incomparable envelope: ${mismatch.scenarioId} / ${mismatch.role} / ${renderEvalComparisonRoutesV1(mismatch)}: ${mismatch.fields.join(", ")}`
|
|
865
922
|
),
|
|
866
923
|
...summary.affectedCorpusResults.map(
|
|
867
924
|
(result) => `- Affected corpus result: ${result.scenarioId} / ${result.role}: ${result.changedFields.join(", ")}`
|
|
@@ -870,8 +927,8 @@ function renderMarkdown(summary) {
|
|
|
870
927
|
`Token delta: ${summary.tokenDelta === null ? "unmeasured" : summary.tokenDelta}`,
|
|
871
928
|
`Wall-time delta ms: ${summary.wallTimeDelta}`,
|
|
872
929
|
"",
|
|
873
|
-
"| Scenario | Role |
|
|
874
|
-
"
|
|
930
|
+
"| Scenario | Role | Baseline -> candidate target/model | Family | Metric | Baseline mean | Baseline variance | Baseline measured | Candidate mean | Candidate variance | Candidate measured | Noise band | Change | Variance | Comparability | Gate |",
|
|
931
|
+
"|---|---|---|---|---|---:|---:|---:|---:|---:|---:|---:|---|---|---|---|",
|
|
875
932
|
...rows,
|
|
876
933
|
"",
|
|
877
934
|
"## Per-scenario baseline/candidate report",
|
|
@@ -896,7 +953,7 @@ function renderJunit(summary) {
|
|
|
896
953
|
);
|
|
897
954
|
const represented = /* @__PURE__ */ new Set();
|
|
898
955
|
const cases = summary.behavioralMetrics.map((row) => {
|
|
899
|
-
const name = `${row.scenarioId}[${row.role}:${row
|
|
956
|
+
const name = `${row.scenarioId}[${row.role}:${renderEvalComparisonRoutesV1(row)}].${row.metric}`;
|
|
900
957
|
const key = JSON.stringify([row.scenarioId, row.role, row.target.id, row.target.model, row.metric]);
|
|
901
958
|
represented.add(key);
|
|
902
959
|
const detail = `change=${row.change} variance=${row.varianceChange} baseline=${format(row.baseline.mean)} candidate=${format(row.candidate.mean)}`;
|
|
@@ -911,13 +968,13 @@ function renderJunit(summary) {
|
|
|
911
968
|
failure.metric
|
|
912
969
|
]);
|
|
913
970
|
if (represented.has(key)) continue;
|
|
914
|
-
const name = `${failure.scenarioId}[${failure.role}:${failure
|
|
971
|
+
const name = `${failure.scenarioId}[${failure.role}:${renderEvalComparisonRoutesV1(failure)}].${failure.metric}`;
|
|
915
972
|
cases.push(
|
|
916
973
|
` <testcase classname="eval.behavior.hard" name="${escapeXml(name)}"><failure message="${escapeXml(failure.change)}">hard behavioral gate</failure></testcase>`
|
|
917
974
|
);
|
|
918
975
|
}
|
|
919
976
|
for (const failure of summary.hardGate.envelopeFailures) {
|
|
920
|
-
const name = `${failure.scenarioId}[${failure.role}:${failure
|
|
977
|
+
const name = `${failure.scenarioId}[${failure.role}:${renderEvalComparisonRoutesV1(failure)}].execution-envelope`;
|
|
921
978
|
cases.push(
|
|
922
979
|
` <testcase classname="eval.behavior.envelope" name="${escapeXml(name)}"><failure message="incomparable">${escapeXml(failure.fields.join(", "))}</failure></testcase>`
|
|
923
980
|
);
|
|
@@ -1261,6 +1318,7 @@ function readVerify(value, path, issues) {
|
|
|
1261
1318
|
return {
|
|
1262
1319
|
commands: readOptionalStringArray(value, "commands", `${path}.commands`, issues),
|
|
1263
1320
|
measure: readOptionalStringArray(value, "measure", `${path}.measure`, issues),
|
|
1321
|
+
protectedFiles: readOptionalStringArray(value, "protectedFiles", `${path}.protectedFiles`, issues),
|
|
1264
1322
|
assertions: readAssertions(value.assertions, `${path}.assertions`, issues),
|
|
1265
1323
|
forbidPaths: readOptionalStringArray(value, "forbidPaths", `${path}.forbidPaths`, issues)
|
|
1266
1324
|
};
|
|
@@ -1481,9 +1539,10 @@ function resolveTargets(targets, options) {
|
|
|
1481
1539
|
|
|
1482
1540
|
// src/domains/eval/suites/run.ts
|
|
1483
1541
|
init_esm_shims();
|
|
1484
|
-
import {
|
|
1542
|
+
import { constants } from "node:fs";
|
|
1543
|
+
import { lstat as lstat3, mkdir, mkdtemp as mkdtemp3, open, readdir, realpath, rm as rm3, writeFile } from "node:fs/promises";
|
|
1485
1544
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
1486
|
-
import { resolve as
|
|
1545
|
+
import { isAbsolute as isAbsolute3, relative as relative4, resolve as resolve9, sep as sep3 } from "node:path";
|
|
1487
1546
|
|
|
1488
1547
|
// src/domains/eval/execution-provenance.ts
|
|
1489
1548
|
init_esm_shims();
|
|
@@ -1644,6 +1703,9 @@ function sha256(value) {
|
|
|
1644
1703
|
|
|
1645
1704
|
// src/domains/eval/metrics/context.ts
|
|
1646
1705
|
init_esm_shims();
|
|
1706
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
1707
|
+
import { readFileSync as readFileSync2 } from "node:fs";
|
|
1708
|
+
import { join } from "node:path";
|
|
1647
1709
|
function collectContextMetrics(cwd) {
|
|
1648
1710
|
try {
|
|
1649
1711
|
const codewiki = readCodewiki(cwd);
|
|
@@ -1651,13 +1713,26 @@ function collectContextMetrics(cwd) {
|
|
|
1651
1713
|
const visiblePaths = new Set(enumerateWorkspaceFiles(cwd));
|
|
1652
1714
|
const artifactSourceFiles = codewiki.files.filter((file) => file.lang !== "config");
|
|
1653
1715
|
const indexedFiles = artifactSourceFiles.filter((file) => visiblePaths.has(file.path)).length;
|
|
1654
|
-
|
|
1716
|
+
let contentValidFiles = 0;
|
|
1717
|
+
let missingFiles = 0;
|
|
1718
|
+
for (const file of artifactSourceFiles) {
|
|
1719
|
+
try {
|
|
1720
|
+
const hash = createHash3("sha256").update(readFileSync2(join(cwd, file.path), "utf8")).digest("hex").slice(0, 16);
|
|
1721
|
+
if (visiblePaths.has(file.path) && file.hash === hash) contentValidFiles += 1;
|
|
1722
|
+
} catch (error) {
|
|
1723
|
+
const code = error.code;
|
|
1724
|
+
if (code === "ENOENT" || code === "ENOTDIR") missingFiles += 1;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
const staleFiles = artifactSourceFiles.length - contentValidFiles;
|
|
1655
1728
|
const sourceFiles = detectProjectProfile(cwd).sourceFiles;
|
|
1656
1729
|
const digest = renderCodewikiDigest(codewiki);
|
|
1657
1730
|
return {
|
|
1658
1731
|
"context.indexedFiles": indexedFiles,
|
|
1659
1732
|
"context.artifactFiles": artifactSourceFiles.length,
|
|
1660
1733
|
"context.staleFiles": staleFiles,
|
|
1734
|
+
"context.contentValidFiles": contentValidFiles,
|
|
1735
|
+
"context.missingFiles": missingFiles,
|
|
1661
1736
|
"context.coverage": sourceFiles === 0 ? artifactSourceFiles.length === 0 ? 1 : 0 : indexedFiles / sourceFiles,
|
|
1662
1737
|
"context.structuralHash": structuralCodewikiHash(codewiki),
|
|
1663
1738
|
"context.digestTokens": Math.ceil(digest.length / 4)
|
|
@@ -1667,6 +1742,8 @@ function collectContextMetrics(cwd) {
|
|
|
1667
1742
|
"context.indexedFiles": 0,
|
|
1668
1743
|
"context.artifactFiles": 0,
|
|
1669
1744
|
"context.staleFiles": 0,
|
|
1745
|
+
"context.contentValidFiles": 0,
|
|
1746
|
+
"context.missingFiles": 0,
|
|
1670
1747
|
"context.coverage": 0,
|
|
1671
1748
|
"context.structuralHash": null,
|
|
1672
1749
|
"context.digestTokens": 0
|
|
@@ -1769,13 +1846,13 @@ function isRecord3(value) {
|
|
|
1769
1846
|
|
|
1770
1847
|
// src/domains/eval/metrics/invariants.ts
|
|
1771
1848
|
init_esm_shims();
|
|
1772
|
-
import { existsSync, readdirSync, readFileSync as
|
|
1773
|
-
import { join } from "node:path";
|
|
1849
|
+
import { existsSync, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
1850
|
+
import { join as join2 } from "node:path";
|
|
1774
1851
|
function readRunJournal(stateDir) {
|
|
1775
1852
|
if (!existsSync(stateDir)) return null;
|
|
1776
1853
|
return {
|
|
1777
|
-
envelopes: readEnvelopes(
|
|
1778
|
-
...readReceipts(
|
|
1854
|
+
envelopes: readEnvelopes(join2(stateDir, "runs.json")),
|
|
1855
|
+
...readReceipts(join2(stateDir, "receipts"))
|
|
1779
1856
|
};
|
|
1780
1857
|
}
|
|
1781
1858
|
function readEnvelopes(runsPath) {
|
|
@@ -1783,7 +1860,7 @@ function readEnvelopes(runsPath) {
|
|
|
1783
1860
|
if (!existsSync(runsPath)) return envelopes;
|
|
1784
1861
|
let parsed;
|
|
1785
1862
|
try {
|
|
1786
|
-
parsed = JSON.parse(
|
|
1863
|
+
parsed = JSON.parse(readFileSync3(runsPath, "utf8"));
|
|
1787
1864
|
} catch {
|
|
1788
1865
|
return envelopes;
|
|
1789
1866
|
}
|
|
@@ -1804,7 +1881,7 @@ function readReceipts(receiptsDir) {
|
|
|
1804
1881
|
const receipts = [];
|
|
1805
1882
|
for (const name of names) {
|
|
1806
1883
|
try {
|
|
1807
|
-
const parsed = JSON.parse(
|
|
1884
|
+
const parsed = JSON.parse(readFileSync3(join2(receiptsDir, name), "utf8"));
|
|
1808
1885
|
if (isReceiptShaped(parsed)) receipts.push(parsed);
|
|
1809
1886
|
} catch {
|
|
1810
1887
|
}
|
|
@@ -1873,7 +1950,7 @@ function isRootReceipt(receipt) {
|
|
|
1873
1950
|
return receipt.lineage === void 0 || receipt.lineage.rootRunId === receipt.runId;
|
|
1874
1951
|
}
|
|
1875
1952
|
function sessionInvariantMetrics(stateDir) {
|
|
1876
|
-
const sessionDirs = findSessionDirs(
|
|
1953
|
+
const sessionDirs = findSessionDirs(join2(stateDir, "sessions"));
|
|
1877
1954
|
if (sessionDirs.length === 0) return {};
|
|
1878
1955
|
let formatVersion = Number.POSITIVE_INFINITY;
|
|
1879
1956
|
let toolPairsUnmatched = 0;
|
|
@@ -1882,7 +1959,7 @@ function sessionInvariantMetrics(stateDir) {
|
|
|
1882
1959
|
let answeredFromPreCompaction = false;
|
|
1883
1960
|
let turnsAfterCompaction = 0;
|
|
1884
1961
|
for (const sessionDir of sessionDirs) {
|
|
1885
|
-
const transcript = readSessionTranscript(
|
|
1962
|
+
const transcript = readSessionTranscript(join2(sessionDir, "current.jsonl"));
|
|
1886
1963
|
formatVersion = Math.min(formatVersion, transcript.formatVersion);
|
|
1887
1964
|
toolPairsUnmatched += transcript.toolPairsUnmatched;
|
|
1888
1965
|
assistantBetweenCallAndResult += transcript.assistantBetweenCallAndResult;
|
|
@@ -1905,10 +1982,10 @@ function findSessionDirs(sessionsRoot) {
|
|
|
1905
1982
|
const dirs = [];
|
|
1906
1983
|
for (const cwdDir of readdirSync(sessionsRoot, { withFileTypes: true })) {
|
|
1907
1984
|
if (!cwdDir.isDirectory()) continue;
|
|
1908
|
-
const cwdPath =
|
|
1985
|
+
const cwdPath = join2(sessionsRoot, cwdDir.name);
|
|
1909
1986
|
try {
|
|
1910
1987
|
for (const sessionDir of readdirSync(cwdPath, { withFileTypes: true })) {
|
|
1911
|
-
if (sessionDir.isDirectory()) dirs.push(
|
|
1988
|
+
if (sessionDir.isDirectory()) dirs.push(join2(cwdPath, sessionDir.name));
|
|
1912
1989
|
}
|
|
1913
1990
|
} catch {
|
|
1914
1991
|
}
|
|
@@ -1921,7 +1998,7 @@ function findSessionDirs(sessionsRoot) {
|
|
|
1921
1998
|
function readSessionTranscript(path) {
|
|
1922
1999
|
let lines;
|
|
1923
2000
|
try {
|
|
1924
|
-
lines =
|
|
2001
|
+
lines = readFileSync3(path, "utf8").split(/\r?\n/u);
|
|
1925
2002
|
} catch {
|
|
1926
2003
|
return {
|
|
1927
2004
|
formatVersion: 0,
|
|
@@ -2041,7 +2118,7 @@ function isProcessAlive(pid) {
|
|
|
2041
2118
|
}
|
|
2042
2119
|
}
|
|
2043
2120
|
function writeBoundaryInvariantMetrics(stateDir) {
|
|
2044
|
-
const files = findWriteBoundaryVerdicts(
|
|
2121
|
+
const files = findWriteBoundaryVerdicts(join2(stateDir, "write-boundaries"));
|
|
2045
2122
|
if (files.length === 0) return {};
|
|
2046
2123
|
let sealed = true;
|
|
2047
2124
|
let violationsDetected = 0;
|
|
@@ -2072,10 +2149,10 @@ function findWriteBoundaryVerdicts(root) {
|
|
|
2072
2149
|
try {
|
|
2073
2150
|
for (const rootDir of readdirSync(root, { withFileTypes: true })) {
|
|
2074
2151
|
if (!rootDir.isDirectory()) continue;
|
|
2075
|
-
const dir =
|
|
2152
|
+
const dir = join2(root, rootDir.name);
|
|
2076
2153
|
try {
|
|
2077
2154
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
2078
|
-
if (entry.isFile() && entry.name.endsWith(".json")) files.push(
|
|
2155
|
+
if (entry.isFile() && entry.name.endsWith(".json")) files.push(join2(dir, entry.name));
|
|
2079
2156
|
}
|
|
2080
2157
|
} catch {
|
|
2081
2158
|
}
|
|
@@ -2087,7 +2164,7 @@ function findWriteBoundaryVerdicts(root) {
|
|
|
2087
2164
|
}
|
|
2088
2165
|
function parseJsonFile(path) {
|
|
2089
2166
|
try {
|
|
2090
|
-
const parsed = JSON.parse(
|
|
2167
|
+
const parsed = JSON.parse(readFileSync3(path, "utf8"));
|
|
2091
2168
|
return isRecord4(parsed) ? parsed : void 0;
|
|
2092
2169
|
} catch {
|
|
2093
2170
|
return void 0;
|
|
@@ -2290,7 +2367,7 @@ function zeroToolCallMetrics() {
|
|
|
2290
2367
|
// src/domains/eval/metrics/tracked.ts
|
|
2291
2368
|
init_esm_shims();
|
|
2292
2369
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
2293
|
-
import { dirname as dirname2, join as
|
|
2370
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
2294
2371
|
function selectEvalLedgerEntries(durable, stream) {
|
|
2295
2372
|
const sessionCalls = assistantCalls(durable).length;
|
|
2296
2373
|
const streamCalls = assistantCalls(stream).length;
|
|
@@ -2314,7 +2391,7 @@ async function readEvalLedgerSnapshot(stateDir) {
|
|
|
2314
2391
|
} catch {
|
|
2315
2392
|
}
|
|
2316
2393
|
try {
|
|
2317
|
-
const manifest = await readFile2(
|
|
2394
|
+
const manifest = await readFile2(join3(dirname2(ref.path), "prompt-manifest.jsonl"), "utf8");
|
|
2318
2395
|
for (const line of manifest.split(/\r?\n/u)) {
|
|
2319
2396
|
const record = parseJsonRecord2(line);
|
|
2320
2397
|
if (record === null) continue;
|
|
@@ -2327,7 +2404,7 @@ async function readEvalLedgerSnapshot(stateDir) {
|
|
|
2327
2404
|
} catch {
|
|
2328
2405
|
}
|
|
2329
2406
|
try {
|
|
2330
|
-
const snapshots = await readFile2(
|
|
2407
|
+
const snapshots = await readFile2(join3(dirname2(ref.path), "context-snapshots.jsonl"), "utf8");
|
|
2331
2408
|
for (const line of snapshots.split(/\r?\n/u)) {
|
|
2332
2409
|
const record = parseJsonRecord2(line);
|
|
2333
2410
|
if (record === null) continue;
|
|
@@ -2580,14 +2657,7 @@ function promptManifestObservation(record) {
|
|
|
2580
2657
|
return contentHash === null ? [] : [{ id: entry.id, contentHash }];
|
|
2581
2658
|
});
|
|
2582
2659
|
const preload = record.projectPreload;
|
|
2583
|
-
const projectPreload =
|
|
2584
|
-
mode: preload.mode,
|
|
2585
|
-
chars: preload.chars,
|
|
2586
|
-
lines: preload.lines,
|
|
2587
|
-
reason: nullableString(preload.reason),
|
|
2588
|
-
nearLimit: preload.nearLimit,
|
|
2589
|
-
label: preload.label
|
|
2590
|
-
} : null;
|
|
2660
|
+
const projectPreload = isProjectPreloadClass(preload) ? preload : null;
|
|
2591
2661
|
return {
|
|
2592
2662
|
systemPromptHash,
|
|
2593
2663
|
thinkingLevel: nullableString(record.thinkingLevel),
|
|
@@ -2611,8 +2681,8 @@ import { isAbsolute, relative, resolve as resolve2, sep } from "node:path";
|
|
|
2611
2681
|
|
|
2612
2682
|
// src/domains/eval/metrics/evidence.ts
|
|
2613
2683
|
init_esm_shims();
|
|
2614
|
-
import { readFileSync as
|
|
2615
|
-
import { join as
|
|
2684
|
+
import { readFileSync as readFileSync4 } from "node:fs";
|
|
2685
|
+
import { join as join4 } from "node:path";
|
|
2616
2686
|
function dispatchScopeMetrics(receipt) {
|
|
2617
2687
|
const scope = receipt.pathScope;
|
|
2618
2688
|
if (scope === void 0) return {};
|
|
@@ -2676,7 +2746,7 @@ function evidenceTrustMetrics(receipt, envelope) {
|
|
|
2676
2746
|
}
|
|
2677
2747
|
function readRunEnvelopeForReceipt(receipt, stateDir) {
|
|
2678
2748
|
try {
|
|
2679
|
-
const parsed = JSON.parse(
|
|
2749
|
+
const parsed = JSON.parse(readFileSync4(join4(stateDir, "runs.json"), "utf8"));
|
|
2680
2750
|
if (!Array.isArray(parsed)) return null;
|
|
2681
2751
|
const row = parsed.find(
|
|
2682
2752
|
(entry) => typeof entry === "object" && entry !== null && entry.id === receipt.runId
|
|
@@ -3073,7 +3143,7 @@ async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
|
|
|
3073
3143
|
}
|
|
3074
3144
|
function runShellCommand(command, cwd, timeoutMs, env) {
|
|
3075
3145
|
const started = performance2.now();
|
|
3076
|
-
return new Promise((
|
|
3146
|
+
return new Promise((resolve11) => {
|
|
3077
3147
|
let stdout = "";
|
|
3078
3148
|
let stderr = "";
|
|
3079
3149
|
const metricCapture = createJsonlMetricCapture();
|
|
@@ -3109,7 +3179,7 @@ function runShellCommand(command, cwd, timeoutMs, env) {
|
|
|
3109
3179
|
if (settled) return;
|
|
3110
3180
|
settled = true;
|
|
3111
3181
|
clearTimeout(timer);
|
|
3112
|
-
|
|
3182
|
+
resolve11({
|
|
3113
3183
|
command: commandLine,
|
|
3114
3184
|
exitCode,
|
|
3115
3185
|
stdout,
|
|
@@ -3379,19 +3449,22 @@ function toolBehaviorMetricEntriesFromJsonl(stdout, cwd, readObservation) {
|
|
|
3379
3449
|
const terminals = canonicalFinishes.length > 0 ? canonicalFinishes : executionEnds;
|
|
3380
3450
|
const calls = /* @__PURE__ */ new Map();
|
|
3381
3451
|
const succeeded = /* @__PURE__ */ new Map();
|
|
3452
|
+
const failed = /* @__PURE__ */ new Map();
|
|
3382
3453
|
const blocked = /* @__PURE__ */ new Map();
|
|
3383
3454
|
for (const terminal of terminals) {
|
|
3384
3455
|
const tool = metricToolName(terminal.tool);
|
|
3385
3456
|
calls.set(tool, (calls.get(tool) ?? 0) + 1);
|
|
3386
3457
|
if (terminal.outcome === "ok") succeeded.set(tool, (succeeded.get(tool) ?? 0) + 1);
|
|
3387
3458
|
if (terminal.outcome === "blocked") blocked.set(tool, (blocked.get(tool) ?? 0) + 1);
|
|
3459
|
+
if (terminal.outcome === "error") failed.set(tool, (failed.get(tool) ?? 0) + 1);
|
|
3388
3460
|
}
|
|
3389
|
-
const namedTools = /* @__PURE__ */ new Set([
|
|
3461
|
+
const namedTools = /* @__PURE__ */ new Set([...ALL_TOOL_NAMES, ...calls.keys()]);
|
|
3390
3462
|
const entries = { "tools.read.distinctPaths": readPaths.size };
|
|
3391
3463
|
for (const tool of [...namedTools].sort()) {
|
|
3392
3464
|
entries[`tools.calls.${tool}`] = calls.get(tool) ?? 0;
|
|
3393
3465
|
entries[`tools.succeeded.${tool}`] = succeeded.get(tool) ?? 0;
|
|
3394
3466
|
entries[`tools.blocked.${tool}`] = blocked.get(tool) ?? 0;
|
|
3467
|
+
entries[`tools.failed.${tool}`] = failed.get(tool) ?? 0;
|
|
3395
3468
|
}
|
|
3396
3469
|
if (readObservation !== void 0) {
|
|
3397
3470
|
const allowed = readObservation.allowedPaths.map((path) => normalizeObservedPath(cwd, path));
|
|
@@ -3484,7 +3557,7 @@ function parseContextIndexOutput(stdout) {
|
|
|
3484
3557
|
// src/domains/eval/runners/context-init.ts
|
|
3485
3558
|
init_esm_shims();
|
|
3486
3559
|
import { existsSync as existsSync2, statSync } from "node:fs";
|
|
3487
|
-
import { join as
|
|
3560
|
+
import { join as join5 } from "node:path";
|
|
3488
3561
|
async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, env) {
|
|
3489
3562
|
const extraArgs = runner.args ?? [];
|
|
3490
3563
|
const args = [
|
|
@@ -3517,7 +3590,7 @@ async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, e
|
|
|
3517
3590
|
const effectiveRuntimeKind = stringField3(run, "runtimeKind");
|
|
3518
3591
|
const effectiveThinking = stringField3(run, "thinkingLevel");
|
|
3519
3592
|
const structuredOutputMode = stringField3(run, "structuredOutputMode");
|
|
3520
|
-
const clioMdPath =
|
|
3593
|
+
const clioMdPath = join5(cwd, "CLIO-CODER.md");
|
|
3521
3594
|
const clioMdBytes = existsSync2(clioMdPath) ? statSync(clioMdPath).size : 0;
|
|
3522
3595
|
return {
|
|
3523
3596
|
assignmentId: null,
|
|
@@ -3654,7 +3727,7 @@ function stringField3(value, field) {
|
|
|
3654
3727
|
|
|
3655
3728
|
// src/domains/eval/schema/adapter.ts
|
|
3656
3729
|
init_esm_shims();
|
|
3657
|
-
import { createHash as
|
|
3730
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
3658
3731
|
function adaptSuiteV2ResultToVerdictV1(result, trackedMetrics) {
|
|
3659
3732
|
const machinery = result.pass || result.failureClass === "grader_failed" ? "ok" : "infrastructure_failure";
|
|
3660
3733
|
const outcome = result.pass ? "pass" : "fail";
|
|
@@ -3688,7 +3761,7 @@ function adaptSuiteV2ResultToBehaviorV1(result, verdict, scenario) {
|
|
|
3688
3761
|
observedSources.add(source);
|
|
3689
3762
|
if (!requestedFacts.has(`${source}\0${key}`)) return [];
|
|
3690
3763
|
const serialized = JSON.stringify({ source, key, value });
|
|
3691
|
-
const digest =
|
|
3764
|
+
const digest = createHash4("sha256").update(serialized, "utf8").digest("hex");
|
|
3692
3765
|
const fact = {
|
|
3693
3766
|
id: `metric-${digest.slice(0, 16)}`,
|
|
3694
3767
|
source,
|
|
@@ -3743,12 +3816,93 @@ function forbiddenPathHits(cwd, paths) {
|
|
|
3743
3816
|
return paths.filter((path) => existsSync3(resolve3(cwd, path)));
|
|
3744
3817
|
}
|
|
3745
3818
|
|
|
3819
|
+
// src/domains/eval/verifiers/integrity.ts
|
|
3820
|
+
init_esm_shims();
|
|
3821
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
3822
|
+
import { lstat, readFile as readFile3 } from "node:fs/promises";
|
|
3823
|
+
import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve4, sep as sep2 } from "node:path";
|
|
3824
|
+
var EvalGraderIntegrityError = class extends Error {
|
|
3825
|
+
};
|
|
3826
|
+
async function protectGraderFiles(cwd, files) {
|
|
3827
|
+
const paths = files.map((file) => {
|
|
3828
|
+
const path = resolve4(cwd, file);
|
|
3829
|
+
const rel = relative2(cwd, path);
|
|
3830
|
+
if (isAbsolute2(file) || rel === ".." || rel.startsWith(`..${sep2}`))
|
|
3831
|
+
throw new EvalGraderIntegrityError(`grader dependency escapes workspace: ${file}`);
|
|
3832
|
+
return path;
|
|
3833
|
+
});
|
|
3834
|
+
const fingerprint = async (path) => {
|
|
3835
|
+
let current = path;
|
|
3836
|
+
while (current !== resolve4(cwd)) {
|
|
3837
|
+
if ((await lstat(current)).isSymbolicLink())
|
|
3838
|
+
throw new EvalGraderIntegrityError(`grader dependency is a symlink: ${path}`);
|
|
3839
|
+
current = resolve4(current, "..");
|
|
3840
|
+
}
|
|
3841
|
+
return createHash5("sha256").update(await readFile3(path)).digest("hex");
|
|
3842
|
+
};
|
|
3843
|
+
const hashes = await Promise.all(paths.map(fingerprint));
|
|
3844
|
+
return async () => {
|
|
3845
|
+
for (const [index, path] of paths.entries()) {
|
|
3846
|
+
try {
|
|
3847
|
+
if (await fingerprint(path) === hashes[index]) continue;
|
|
3848
|
+
} catch {
|
|
3849
|
+
}
|
|
3850
|
+
throw new EvalGraderIntegrityError(`grader dependency changed during trial: ${relative2(cwd, path)}`);
|
|
3851
|
+
}
|
|
3852
|
+
};
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3746
3855
|
// src/domains/eval/verifiers/patch.ts
|
|
3747
3856
|
init_esm_shims();
|
|
3748
3857
|
import { spawnSync } from "node:child_process";
|
|
3858
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
3859
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync5, readlinkSync } from "node:fs";
|
|
3860
|
+
import { join as join6, resolve as resolve5 } from "node:path";
|
|
3861
|
+
var baselines = /* @__PURE__ */ new Map();
|
|
3862
|
+
function recordPatchBaseline(cwd) {
|
|
3863
|
+
baselines.set(resolve5(cwd), snapshotFiles(cwd));
|
|
3864
|
+
}
|
|
3865
|
+
function forgetPatchBaseline(cwd) {
|
|
3866
|
+
baselines.delete(resolve5(cwd));
|
|
3867
|
+
}
|
|
3868
|
+
function snapshotFiles(cwd) {
|
|
3869
|
+
const files = /* @__PURE__ */ new Map();
|
|
3870
|
+
function walk(dir, prefix) {
|
|
3871
|
+
for (const entry of readdirSync2(dir, { withFileTypes: true })) {
|
|
3872
|
+
if (entry.name === ".git") continue;
|
|
3873
|
+
const path = join6(dir, entry.name);
|
|
3874
|
+
const relative5 = prefix + entry.name;
|
|
3875
|
+
if (entry.isDirectory()) walk(path, `${relative5}/`);
|
|
3876
|
+
else if (entry.isFile() || entry.isSymbolicLink()) {
|
|
3877
|
+
const bytes = entry.isSymbolicLink() ? Buffer.from(readlinkSync(path)) : readFileSync5(path);
|
|
3878
|
+
files.set(relative5, {
|
|
3879
|
+
hash: createHash6("sha256").update(entry.isSymbolicLink() ? "link:" : "file:").update(bytes).digest("hex"),
|
|
3880
|
+
bytes: bytes.length
|
|
3881
|
+
});
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
walk(cwd, "");
|
|
3886
|
+
return files;
|
|
3887
|
+
}
|
|
3749
3888
|
function collectPatchMetrics(cwd) {
|
|
3889
|
+
const baseline = baselines.get(resolve5(cwd));
|
|
3890
|
+
if (baseline !== void 0) {
|
|
3891
|
+
const current = snapshotFiles(cwd);
|
|
3892
|
+
const changed = [.../* @__PURE__ */ new Set([...baseline.keys(), ...current.keys()])].filter(
|
|
3893
|
+
(path) => baseline.get(path)?.hash !== current.get(path)?.hash
|
|
3894
|
+
);
|
|
3895
|
+
return {
|
|
3896
|
+
// For hash baselines this is changed file content bytes, including deleted
|
|
3897
|
+
// content, rather than a textual Git diff (which cannot represent all files).
|
|
3898
|
+
bytes: changed.reduce((sum2, path) => sum2 + (current.get(path)?.bytes ?? baseline.get(path)?.bytes ?? 0), 0),
|
|
3899
|
+
filesChanged: changed.length,
|
|
3900
|
+
testFilesModified: changed.filter((file) => /(^|\/)(test|tests|spec|__tests__)(\/|$)|\.(test|spec)\./.test(file)).length
|
|
3901
|
+
};
|
|
3902
|
+
}
|
|
3750
3903
|
const diff = spawnSync("git", ["diff", "--", "."], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
|
|
3751
|
-
|
|
3904
|
+
if (diff.status !== 0 || typeof diff.stdout !== "string") return null;
|
|
3905
|
+
const text = diff.stdout;
|
|
3752
3906
|
const files = text.split(/\r?\n/).filter((line) => line.startsWith("diff --git ")).map((line) => line.split(" b/")[1] ?? "");
|
|
3753
3907
|
return {
|
|
3754
3908
|
bytes: Buffer.byteLength(text, "utf8"),
|
|
@@ -3762,10 +3916,10 @@ init_esm_shims();
|
|
|
3762
3916
|
import { spawn as spawn2 } from "node:child_process";
|
|
3763
3917
|
import { mkdtemp, rm } from "node:fs/promises";
|
|
3764
3918
|
import { tmpdir } from "node:os";
|
|
3765
|
-
import { resolve as
|
|
3919
|
+
import { resolve as resolve6 } from "node:path";
|
|
3766
3920
|
async function prepareGitWorkspace(workspace) {
|
|
3767
3921
|
if (workspace.url === void 0) throw new Error("git workspace requires url");
|
|
3768
|
-
const dest = await mkdtemp(
|
|
3922
|
+
const dest = await mkdtemp(resolve6(tmpdir(), "clio-coder-eval-git-"));
|
|
3769
3923
|
try {
|
|
3770
3924
|
await runGit(["clone", "--quiet", workspace.url, dest], process.cwd());
|
|
3771
3925
|
const ref = workspace.checkout ?? workspace.commit;
|
|
@@ -3800,9 +3954,9 @@ function runGit(args, cwd) {
|
|
|
3800
3954
|
// src/domains/eval/workspaces/local.ts
|
|
3801
3955
|
init_esm_shims();
|
|
3802
3956
|
import { access } from "node:fs/promises";
|
|
3803
|
-
import { resolve as
|
|
3957
|
+
import { resolve as resolve7 } from "node:path";
|
|
3804
3958
|
async function prepareLocalWorkspace(baseDir, workspace) {
|
|
3805
|
-
const dir =
|
|
3959
|
+
const dir = resolve7(baseDir, workspace.path ?? ".");
|
|
3806
3960
|
await access(dir);
|
|
3807
3961
|
return { dir, cleanup: async () => {
|
|
3808
3962
|
} };
|
|
@@ -3811,26 +3965,28 @@ async function prepareLocalWorkspace(baseDir, workspace) {
|
|
|
3811
3965
|
// src/domains/eval/workspaces/temp-copy.ts
|
|
3812
3966
|
init_esm_shims();
|
|
3813
3967
|
import { execFile } from "node:child_process";
|
|
3814
|
-
import { cp, lstat, mkdtemp as mkdtemp2, rm as rm2 } from "node:fs/promises";
|
|
3968
|
+
import { cp, lstat as lstat2, mkdtemp as mkdtemp2, rm as rm2 } from "node:fs/promises";
|
|
3815
3969
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
3816
|
-
import { relative as
|
|
3970
|
+
import { relative as relative3, resolve as resolve8 } from "node:path";
|
|
3817
3971
|
import { promisify } from "node:util";
|
|
3818
3972
|
var execFileAsync = promisify(execFile);
|
|
3819
3973
|
var GIT_FILE_LIST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
3820
3974
|
async function prepareTempCopyWorkspace(baseDir, workspace, options = {}) {
|
|
3821
|
-
const source =
|
|
3822
|
-
const dest = await mkdtemp2(
|
|
3975
|
+
const source = resolve8(baseDir, workspace.path ?? ".");
|
|
3976
|
+
const dest = await mkdtemp2(resolve8(options.tempRoot ?? tmpdir2(), "clio-coder-eval-workspace-"));
|
|
3823
3977
|
try {
|
|
3824
3978
|
const selection = await gitCopySelection(source);
|
|
3825
3979
|
const excludes = workspace.excludes ?? [];
|
|
3826
3980
|
const copyWorkspace = options.copy ?? defaultCopy;
|
|
3827
3981
|
await copyWorkspace(source, dest, {
|
|
3828
3982
|
recursive: true,
|
|
3829
|
-
filter: (path) => shouldCopy(
|
|
3983
|
+
filter: (path) => shouldCopy(relative3(source, path), excludes, selection)
|
|
3830
3984
|
});
|
|
3985
|
+
recordPatchBaseline(dest);
|
|
3831
3986
|
return {
|
|
3832
3987
|
dir: dest,
|
|
3833
3988
|
cleanup: async () => {
|
|
3989
|
+
forgetPatchBaseline(dest);
|
|
3834
3990
|
await rm2(dest, { recursive: true, force: true });
|
|
3835
3991
|
}
|
|
3836
3992
|
};
|
|
@@ -3903,16 +4059,16 @@ function normalizeGitPath(path) {
|
|
|
3903
4059
|
return normalized;
|
|
3904
4060
|
}
|
|
3905
4061
|
async function hasGitMarker(source) {
|
|
3906
|
-
let current =
|
|
4062
|
+
let current = resolve8(source);
|
|
3907
4063
|
while (true) {
|
|
3908
4064
|
try {
|
|
3909
|
-
await
|
|
4065
|
+
await lstat2(resolve8(current, ".git"));
|
|
3910
4066
|
return true;
|
|
3911
4067
|
} catch (error) {
|
|
3912
4068
|
const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
3913
4069
|
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
|
|
3914
4070
|
}
|
|
3915
|
-
const parent =
|
|
4071
|
+
const parent = resolve8(current, "..");
|
|
3916
4072
|
if (parent === current) return false;
|
|
3917
4073
|
current = parent;
|
|
3918
4074
|
}
|
|
@@ -3959,7 +4115,8 @@ async function runEvalSuiteV2(loaded, options) {
|
|
|
3959
4115
|
item.repeatIndex,
|
|
3960
4116
|
options.clioEntry,
|
|
3961
4117
|
options.freshWorkspaces === true,
|
|
3962
|
-
options.tempCopy
|
|
4118
|
+
options.tempCopy,
|
|
4119
|
+
resolve9(clioDataDir(), "evals", evalId, "transcripts", String(results.length))
|
|
3963
4120
|
);
|
|
3964
4121
|
spentUsd += resultCostUsd(completed.result);
|
|
3965
4122
|
results.push(completed.result);
|
|
@@ -3996,27 +4153,33 @@ function budgetExhaustedResult(loaded, task, target, repeatIndex, spentUsd, maxC
|
|
|
3996
4153
|
attachExecutionEnvelope(result, task, target, loaded.baseDir, null, emptyLedgerSnapshot());
|
|
3997
4154
|
return result;
|
|
3998
4155
|
}
|
|
3999
|
-
async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, freshWorkspace, tempCopy) {
|
|
4156
|
+
async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, freshWorkspace, tempCopy, transcriptDir) {
|
|
4000
4157
|
let workspace = null;
|
|
4001
4158
|
let receipt = null;
|
|
4002
4159
|
let runnerWallTimeMs = 0;
|
|
4160
|
+
let runnerEvidence = null;
|
|
4161
|
+
let retention;
|
|
4003
4162
|
let executionObservation;
|
|
4004
|
-
const stateDir = await mkdtemp3(
|
|
4163
|
+
const stateDir = await mkdtemp3(resolve9(tempCopy?.tempRoot ?? tmpdir3(), "clio-coder-eval-state-"));
|
|
4005
4164
|
try {
|
|
4006
4165
|
workspace = await prepareWorkspace(loaded.baseDir, task, freshWorkspace, tempCopy);
|
|
4007
4166
|
const setup = await runCommandVerifiers(task.workspace.setup ?? [], workspace.dir, task.timeoutMs);
|
|
4008
4167
|
if (!setup.pass) throw new EvalWorkspaceSetupError(setup.exitCode, setup.stderr);
|
|
4168
|
+
if (task.workspace.kind !== "local" || freshWorkspace) recordPatchBaseline(workspace.dir);
|
|
4169
|
+
const checkGraderIntegrity = await protectGraderFiles(workspace.dir, task.verify.protectedFiles ?? []);
|
|
4009
4170
|
const runner = await runTaskRunner(task, target, workspace.dir, clioEntry, {
|
|
4010
4171
|
CLIO_CODER_STATE_DIR: stateDir,
|
|
4011
4172
|
CLIO_CODER_ENTRY: clioEntry
|
|
4012
4173
|
});
|
|
4013
|
-
|
|
4014
|
-
await writeFile(runnerStdoutFile, runner.stdout, "utf8");
|
|
4174
|
+
runnerEvidence = runner;
|
|
4015
4175
|
receipt = runner.receipt ?? null;
|
|
4016
4176
|
runnerWallTimeMs = runner.wallTimeMs;
|
|
4177
|
+
const runnerStdoutFile = resolve9(stateDir, "eval-runner-output.jsonl");
|
|
4178
|
+
await writeFile(runnerStdoutFile, runner.stdout, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
4017
4179
|
const patch = collectPatchMetrics(workspace.dir);
|
|
4018
4180
|
const receiptExitCode = runner.exitCode;
|
|
4019
4181
|
const journalMetrics = invariantMetrics(stateDir, receiptExitCode);
|
|
4182
|
+
await checkGraderIntegrity();
|
|
4020
4183
|
const measurement = await measureTaskOutcome(task, workspace.dir, {
|
|
4021
4184
|
...namingCompatibilityEnvironment(
|
|
4022
4185
|
"CLIO_CODER_EVAL_RUNNER_STDOUT_FILE",
|
|
@@ -4035,14 +4198,18 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4035
4198
|
// The one reading that needs both sides: what the loop reported it
|
|
4036
4199
|
// spent, and what the journal shows it sealed.
|
|
4037
4200
|
...fleetLoopReceiptAgreement(runner.metrics, journalMetrics),
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4201
|
+
...patch === null ? {} : {
|
|
4202
|
+
"patch.bytes": patch.bytes,
|
|
4203
|
+
"patch.filesChanged": patch.filesChanged,
|
|
4204
|
+
"patch.testFilesModified": patch.testFilesModified
|
|
4205
|
+
},
|
|
4041
4206
|
"result.pass": runner.exitCode === 0,
|
|
4042
4207
|
"result.failureClass": runner.exitCode === 0 ? null : "runner_failed",
|
|
4043
4208
|
...measurement.metrics
|
|
4044
4209
|
};
|
|
4210
|
+
await checkGraderIntegrity();
|
|
4045
4211
|
const verifier = await runVerifiers(task, workspace.dir, metrics);
|
|
4212
|
+
await checkGraderIntegrity();
|
|
4046
4213
|
const graderFailed = metrics["task.solved"] === false;
|
|
4047
4214
|
const pass = runner.exitCode === 0 && verifier.pass && !graderFailed;
|
|
4048
4215
|
const failureClass = pass ? null : runner.exitCode !== 0 ? "runner_failed" : !verifier.pass ? verifier.failureClass : "grader_failed";
|
|
@@ -4065,7 +4232,10 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4065
4232
|
...verifier.stderr.length > 0 ? { verifierStderr: verifier.stderr } : {}
|
|
4066
4233
|
}
|
|
4067
4234
|
};
|
|
4068
|
-
|
|
4235
|
+
retention ??= retainSessionLedgers(stateDir, transcriptDir, runnerEvidence?.stdout);
|
|
4236
|
+
const retained = await retention;
|
|
4237
|
+
applyRetainedSessionLedgers(result, retained);
|
|
4238
|
+
const snapshot = retained.errors.length > 0 ? emptyLedgerSnapshot() : await readEvalLedgerSnapshot(stateDir);
|
|
4069
4239
|
const selected = selectEvalLedgerEntries(snapshot.entries, runner.ledgerEntries ?? []);
|
|
4070
4240
|
result.artifacts.trackedMetricSources = JSON.stringify({
|
|
4071
4241
|
assistantCalls: selected.source,
|
|
@@ -4094,10 +4264,10 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4094
4264
|
serving: evalServingObservationFrom(target, receipt ?? null, snapshot.compiledPromptHashes)
|
|
4095
4265
|
};
|
|
4096
4266
|
} catch (error) {
|
|
4097
|
-
const failureClass = error instanceof EvalWorkspaceSetupError ? "setup_failed" : "command_error";
|
|
4267
|
+
const failureClass = error instanceof EvalGraderIntegrityError ? "grader_integrity" : error instanceof EvalWorkspaceSetupError ? "setup_failed" : "command_error";
|
|
4098
4268
|
const result = {
|
|
4099
|
-
assignmentId: null,
|
|
4100
|
-
terminalReceiptDigest: null,
|
|
4269
|
+
assignmentId: runnerEvidence?.assignmentId ?? null,
|
|
4270
|
+
terminalReceiptDigest: runnerEvidence?.terminalReceiptDigest ?? null,
|
|
4101
4271
|
taskId: task.id,
|
|
4102
4272
|
repeatIndex,
|
|
4103
4273
|
target: { id: target.id, model: target.model ?? null, thinking: target.thinking ?? null },
|
|
@@ -4110,11 +4280,15 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4110
4280
|
"latency.wallMs": 0
|
|
4111
4281
|
},
|
|
4112
4282
|
artifacts: {
|
|
4283
|
+
...runnerEvidence?.artifacts,
|
|
4113
4284
|
error: error instanceof Error ? error.message : String(error),
|
|
4114
4285
|
...workspace === null ? {} : { workspace: workspace.dir }
|
|
4115
4286
|
}
|
|
4116
4287
|
};
|
|
4117
|
-
|
|
4288
|
+
retention ??= retainSessionLedgers(stateDir, transcriptDir, runnerEvidence?.stdout);
|
|
4289
|
+
const retained = await retention;
|
|
4290
|
+
applyRetainedSessionLedgers(result, retained);
|
|
4291
|
+
const snapshot = retained.errors.length > 0 ? emptyLedgerSnapshot() : await readEvalLedgerSnapshot(stateDir);
|
|
4118
4292
|
result.verdict = adaptSuiteV2ResultToVerdictV1(
|
|
4119
4293
|
result,
|
|
4120
4294
|
buildEvalTrackedMetrics({
|
|
@@ -4139,6 +4313,7 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4139
4313
|
};
|
|
4140
4314
|
} finally {
|
|
4141
4315
|
try {
|
|
4316
|
+
if (workspace !== null) forgetPatchBaseline(workspace.dir);
|
|
4142
4317
|
await workspace?.cleanup();
|
|
4143
4318
|
} finally {
|
|
4144
4319
|
await rm3(stateDir, { recursive: true, force: true });
|
|
@@ -4328,6 +4503,128 @@ function nullableNonNegativeInteger(value) {
|
|
|
4328
4503
|
function stringArray(value) {
|
|
4329
4504
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
4330
4505
|
}
|
|
4506
|
+
function applyRetainedSessionLedgers(result, retained) {
|
|
4507
|
+
if (retained.runnerStdoutPath !== void 0) result.artifacts.runnerStdoutFile = retained.runnerStdoutPath;
|
|
4508
|
+
if (retained.paths.length > 0 || retained.errors.length > 0) result.artifacts.sessionLedgers = retained.paths;
|
|
4509
|
+
if (retained.errors.length === 0) return;
|
|
4510
|
+
result.artifacts.sessionLedgerErrors = retained.errors;
|
|
4511
|
+
result.metrics["evidence.retentionComplete"] = false;
|
|
4512
|
+
if (result.pass || result.failureClass === "grader_failed") {
|
|
4513
|
+
result.artifacts.outcomeBeforeEvidenceFailure = result.failureClass ?? "pass";
|
|
4514
|
+
result.pass = false;
|
|
4515
|
+
result.failureClass = "evidence_integrity";
|
|
4516
|
+
result.metrics["result.pass"] = false;
|
|
4517
|
+
result.metrics["result.failureClass"] = "evidence_integrity";
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
async function plainLedgerPath(root, path) {
|
|
4521
|
+
const rel = relative4(root, path);
|
|
4522
|
+
if (isAbsolute3(rel) || rel === ".." || rel.startsWith(`..${sep3}`)) throw new Error("unsafe ledger path");
|
|
4523
|
+
let current = root;
|
|
4524
|
+
for (const part of ["", ...rel.split(sep3)]) {
|
|
4525
|
+
current = resolve9(current, part);
|
|
4526
|
+
if ((await lstat3(current)).isSymbolicLink()) throw new Error("unsafe ledger symlink");
|
|
4527
|
+
}
|
|
4528
|
+
}
|
|
4529
|
+
async function readOwnedLedger(root, path) {
|
|
4530
|
+
await plainLedgerPath(root, path);
|
|
4531
|
+
const before = await lstat3(path);
|
|
4532
|
+
if (!before.isFile()) throw new Error("ledger is not a regular file");
|
|
4533
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
4534
|
+
try {
|
|
4535
|
+
const opened = await file.stat();
|
|
4536
|
+
await plainLedgerPath(root, path);
|
|
4537
|
+
if (opened.dev !== before.dev || opened.ino !== before.ino) throw new Error("ledger changed while opening");
|
|
4538
|
+
return await file.readFile();
|
|
4539
|
+
} finally {
|
|
4540
|
+
await file.close();
|
|
4541
|
+
}
|
|
4542
|
+
}
|
|
4543
|
+
async function transcriptCaptureDirectory(destination) {
|
|
4544
|
+
const base = clioDataDir();
|
|
4545
|
+
await mkdir(base, { recursive: true, mode: 448 });
|
|
4546
|
+
let current = await realpath(base);
|
|
4547
|
+
const rel = relative4(base, destination);
|
|
4548
|
+
if (isAbsolute3(rel) || rel === ".." || rel.startsWith(`..${sep3}`)) throw new Error("unsafe transcript destination");
|
|
4549
|
+
for (const part of rel.split(sep3)) {
|
|
4550
|
+
current = resolve9(current, part);
|
|
4551
|
+
try {
|
|
4552
|
+
await mkdir(current, { mode: 448 });
|
|
4553
|
+
} catch (error) {
|
|
4554
|
+
if (error.code !== "EEXIST") throw error;
|
|
4555
|
+
}
|
|
4556
|
+
const info = await lstat3(current);
|
|
4557
|
+
if (info.isSymbolicLink() || !info.isDirectory()) throw new Error("unsafe transcript destination");
|
|
4558
|
+
}
|
|
4559
|
+
return mkdtemp3(resolve9(current, "capture-"));
|
|
4560
|
+
}
|
|
4561
|
+
async function discoverOwnedLedgers(stateDir, errors) {
|
|
4562
|
+
const root = resolve9(stateDir, "sessions");
|
|
4563
|
+
try {
|
|
4564
|
+
await plainLedgerPath(stateDir, root);
|
|
4565
|
+
} catch (error) {
|
|
4566
|
+
if (error.code === "ENOENT") return [];
|
|
4567
|
+
throw error;
|
|
4568
|
+
}
|
|
4569
|
+
const paths = [];
|
|
4570
|
+
for (const cwd of await readdir(root, { withFileTypes: true })) {
|
|
4571
|
+
if (cwd.isSymbolicLink()) {
|
|
4572
|
+
errors.push("session directory rejected: symlink");
|
|
4573
|
+
continue;
|
|
4574
|
+
}
|
|
4575
|
+
if (!cwd.isDirectory()) continue;
|
|
4576
|
+
const cwdPath = resolve9(root, cwd.name);
|
|
4577
|
+
try {
|
|
4578
|
+
await plainLedgerPath(stateDir, cwdPath);
|
|
4579
|
+
for (const session of await readdir(cwdPath, { withFileTypes: true })) {
|
|
4580
|
+
if (session.isSymbolicLink()) {
|
|
4581
|
+
errors.push("session directory rejected: symlink");
|
|
4582
|
+
continue;
|
|
4583
|
+
}
|
|
4584
|
+
if (session.isDirectory()) paths.push(resolve9(cwdPath, session.name, "current.jsonl"));
|
|
4585
|
+
}
|
|
4586
|
+
} catch {
|
|
4587
|
+
errors.push("session directory unreadable or unsafe");
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
return paths.sort();
|
|
4591
|
+
}
|
|
4592
|
+
async function retainSessionLedgers(stateDir, destination, runnerStdout) {
|
|
4593
|
+
const retained = { paths: [], errors: [] };
|
|
4594
|
+
try {
|
|
4595
|
+
const refs = await discoverOwnedLedgers(stateDir, retained.errors);
|
|
4596
|
+
if (refs.length === 0 && !runnerStdout) return retained;
|
|
4597
|
+
const directory = await transcriptCaptureDirectory(destination);
|
|
4598
|
+
if (runnerStdout) {
|
|
4599
|
+
const path = resolve9(directory, "runner-stdout.jsonl");
|
|
4600
|
+
await writeFile(path, runnerStdout, { mode: 384, flag: "wx" });
|
|
4601
|
+
retained.runnerStdoutPath = path;
|
|
4602
|
+
}
|
|
4603
|
+
for (const [index, pathToLedger] of refs.entries()) {
|
|
4604
|
+
try {
|
|
4605
|
+
let content;
|
|
4606
|
+
try {
|
|
4607
|
+
content = await readOwnedLedger(stateDir, pathToLedger);
|
|
4608
|
+
} catch (error) {
|
|
4609
|
+
if (error.code !== "ENOENT") throw error;
|
|
4610
|
+
content = await readOwnedLedger(stateDir, `${pathToLedger}.tmp`);
|
|
4611
|
+
retained.errors.push(`ledger ${index}: incomplete current ledger; temporary evidence retained`);
|
|
4612
|
+
}
|
|
4613
|
+
const path = resolve9(directory, `${index}.jsonl`);
|
|
4614
|
+
await writeFile(path, content, { mode: 384, flag: "wx" });
|
|
4615
|
+
retained.paths.push(path);
|
|
4616
|
+
} catch (error) {
|
|
4617
|
+
const code = error.code;
|
|
4618
|
+
retained.errors.push(
|
|
4619
|
+
`ledger ${index}: retention failed (${code === "ENOENT" ? "missing" : "unsafe or unreadable"})`
|
|
4620
|
+
);
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
} catch {
|
|
4624
|
+
retained.errors.push("session ledger retention failed: artifact storage unavailable or unsafe");
|
|
4625
|
+
}
|
|
4626
|
+
return retained;
|
|
4627
|
+
}
|
|
4331
4628
|
|
|
4332
4629
|
// src/cli/eval.ts
|
|
4333
4630
|
var HELP = `clio-coder eval <command>
|
|
@@ -4421,6 +4718,11 @@ function parseEvalArgs(args) {
|
|
|
4421
4718
|
throw new Error(`unknown eval run argument: ${arg}`);
|
|
4422
4719
|
}
|
|
4423
4720
|
if (parsed.command === "report") {
|
|
4721
|
+
if (arg === "--artifact") {
|
|
4722
|
+
parsed.artifact = requiredValue(args, index, "--artifact");
|
|
4723
|
+
index += 1;
|
|
4724
|
+
continue;
|
|
4725
|
+
}
|
|
4424
4726
|
if (arg === "--format") {
|
|
4425
4727
|
parsed.format = reportFormat(requiredValue(args, index, "--format"));
|
|
4426
4728
|
index += 1;
|
|
@@ -4477,7 +4779,9 @@ function parseEvalArgs(args) {
|
|
|
4477
4779
|
if (parsed.command === "run" && parsed.suite === void 0 === (parsed.taskFile === void 0)) {
|
|
4478
4780
|
throw new Error("run requires exactly one of --suite or --task-file");
|
|
4479
4781
|
}
|
|
4480
|
-
if (parsed.command === "report" && parsed.evalId === void 0
|
|
4782
|
+
if (parsed.command === "report" && parsed.evalId === void 0 === (parsed.artifact === void 0)) {
|
|
4783
|
+
throw new Error("report requires exactly one of an eval id or --artifact <path>");
|
|
4784
|
+
}
|
|
4481
4785
|
if (parsed.command === "compare" && parsed.compareIds.length !== 2) {
|
|
4482
4786
|
throw new Error("compare requires <baselineEvalId> <candidateEvalId>");
|
|
4483
4787
|
}
|
|
@@ -4488,7 +4792,7 @@ function parseEvalArgs(args) {
|
|
|
4488
4792
|
}
|
|
4489
4793
|
async function runEvalCommand(args) {
|
|
4490
4794
|
if (args[0] === "inventory") {
|
|
4491
|
-
const { runEvalInventory } = await import("./eval-inventory-
|
|
4795
|
+
const { runEvalInventory } = await import("./eval-inventory-QOYZERXJ.js");
|
|
4492
4796
|
return runEvalInventory(args.slice(1));
|
|
4493
4797
|
}
|
|
4494
4798
|
let parsed;
|
|
@@ -4531,13 +4835,15 @@ async function runEvalRun(parsed) {
|
|
|
4531
4835
|
...resolveOptions,
|
|
4532
4836
|
...parsed.trials ? { trials: parsed.trials } : {}
|
|
4533
4837
|
});
|
|
4534
|
-
const clioEntry =
|
|
4838
|
+
const clioEntry = resolve10(parsed.clioEntry ?? process.argv[1] ?? "dist/cli/index.js");
|
|
4535
4839
|
const artifact = await runEvalSuiteV2(
|
|
4536
4840
|
{ ...loaded, suite },
|
|
4537
4841
|
{ clioEntry, freshWorkspaces: parsed.trials !== void 0 }
|
|
4538
4842
|
);
|
|
4539
4843
|
const artifactPath = await writeEvalArtifactV4(clioDataDir(), artifact, parsed.out);
|
|
4540
4844
|
process.stdout.write(`${renderEvalTextReportV4(artifact)}artifact: ${artifactPath}
|
|
4845
|
+
`);
|
|
4846
|
+
process.stdout.write(`report: clio-coder eval report --artifact ${shellQuote(resolve10(artifactPath))} --format md
|
|
4541
4847
|
`);
|
|
4542
4848
|
const gate = suite.thresholds === void 0 ? null : evaluateGate(artifact, suite.thresholds);
|
|
4543
4849
|
if (gate !== null && !gate.pass) {
|
|
@@ -4558,7 +4864,7 @@ async function runEvalRun(parsed) {
|
|
|
4558
4864
|
async function runEvalReportCommand(parsed) {
|
|
4559
4865
|
try {
|
|
4560
4866
|
const dataDir = clioDataDir();
|
|
4561
|
-
const artifact = await loadEvalArtifactV4(dataDir, parsed.evalId ?? "");
|
|
4867
|
+
const artifact = parsed.artifact === void 0 ? await loadEvalArtifactV4(dataDir, parsed.evalId ?? "") : parseEvalArtifactV4(JSON.parse(await readFile4(parsed.artifact, "utf8")), parsed.artifact);
|
|
4562
4868
|
process.stdout.write(renderArtifactReport(artifact, parsed.format, dataDir));
|
|
4563
4869
|
return 0;
|
|
4564
4870
|
} catch (error) {
|
|
@@ -4663,4 +4969,4 @@ function comparisonFormat(value) {
|
|
|
4663
4969
|
export {
|
|
4664
4970
|
runEvalCommand
|
|
4665
4971
|
};
|
|
4666
|
-
//# sourceMappingURL=eval-
|
|
4972
|
+
//# sourceMappingURL=eval-V2RTN3UH.js.map
|