@iowarp/clio-coder 0.4.3 → 0.4.5
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 +153 -0
- package/CONTRIBUTING.md +25 -15
- package/README.md +340 -27
- package/dist/{acp-H2NGRPWO.js → acp-H3CU2HBQ.js} +25 -25
- package/dist/{agents-TL5LLUQP.js → agents-IXQQZ7BD.js} +77 -75
- package/dist/assets/codewiki.json +1 -1
- package/dist/{auth-E5SW4HMS.js → auth-R7KYF7N3.js} +38 -39
- package/dist/builtins-CRFDQUVP.js +22 -0
- package/dist/{chunk-7DRAWPTZ.js → chunk-22PQ4TX4.js} +4 -4
- 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-5TSRNF4G.js → chunk-3T4DXWP6.js} +170 -12
- package/dist/{chunk-DR52UMZW.js → chunk-3UW3KU4A.js} +2 -2
- package/dist/{chunk-XIVNBFZS.js → chunk-4SVIVOMC.js} +208 -39
- package/dist/{chunk-NMJXSHBJ.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-5DDOTTG4.js +402 -0
- package/dist/{chunk-D4CJV46V.js → chunk-5GZICIYO.js} +3 -3
- package/dist/{chunk-4IUZQIJ3.js → chunk-5PHVPU4G.js} +2 -2
- package/dist/{chunk-PUVDKJ2Y.js → chunk-5VTJP36Q.js} +5 -7
- package/dist/{chunk-JGRC33J2.js → chunk-5ZMXGW7P.js} +90 -9
- package/dist/chunk-5ZSZEYJK.js +119 -0
- package/dist/chunk-633EXGZA.js +44 -0
- package/dist/{chunk-IWT4SF4R.js → chunk-6CDNRHWH.js} +361 -89
- package/dist/{chunk-EBY63B7G.js → chunk-6EXUUOSN.js} +2 -2
- package/dist/{chunk-SVNXH4L2.js → chunk-6ICZKDUC.js} +2 -2
- package/dist/{chunk-INY6HTFL.js → chunk-6SYEGZI3.js} +12 -12
- package/dist/{chunk-SKHCAU7K.js → chunk-6YA46L5A.js} +5 -4
- package/dist/{chunk-NZMNUPZZ.js → chunk-77CZRFTE.js} +3 -3
- package/dist/{chunk-L47TF46W.js → chunk-7HBHHVCK.js} +24 -3
- package/dist/{chunk-DWUOQKRU.js → chunk-7TKWWPD7.js} +5 -4
- package/dist/{chunk-2VTFPG5O.js → chunk-7WLRF2U5.js} +2 -2
- package/dist/chunk-7WUZEB2M.js +165 -0
- package/dist/{chunk-6PTFB5VS.js → chunk-7YJWEF2L.js} +59 -28
- package/dist/{chunk-3EBYEESD.js → chunk-A46ILRS2.js} +5 -5
- package/dist/{chunk-UOIZ7DA4.js → chunk-AP7HDJOP.js} +2 -2
- package/dist/{chunk-APJ265NV.js → chunk-B5GGDIHT.js} +146 -146
- package/dist/{chunk-PMZVFWSR.js → chunk-B5ZTR6KZ.js} +2 -2
- package/dist/chunk-B6UM3OZC.js +15 -0
- package/dist/{chunk-MCEPRMZW.js → chunk-BBV5TKE6.js} +5 -5
- package/dist/{chunk-4O6MANBS.js → chunk-BS4GAMUB.js} +14 -10
- package/dist/{chunk-S66XZJOF.js → chunk-C27U2TYG.js} +2 -2
- package/dist/{chunk-42FMPA75.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-WCXUNS7U.js → chunk-DIMRLNIC.js} +35 -66
- package/dist/{chunk-NDDGJUXD.js → chunk-DNCE23JJ.js} +2 -2
- package/dist/{chunk-HVDIIIQW.js → chunk-DNHVRBH4.js} +3 -3
- package/dist/{chunk-2UG5F4C5.js → chunk-DRD2A54W.js} +116 -52
- package/dist/{chunk-D7E7WCDF.js → chunk-DVNAPPXU.js} +2 -2
- package/dist/{chunk-YXLYO42X.js → chunk-DXVMLM3Z.js} +3 -2
- package/dist/{chunk-5MEZN6CB.js → chunk-DZK63TZJ.js} +6 -6
- package/dist/{chunk-IGLP3ODT.js → chunk-E3BQTQUP.js} +15 -15
- package/dist/{chunk-IWHMRKLL.js → chunk-E3LEPLQ2.js} +2 -2
- 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-IJNZMHLA.js → chunk-EHCPSZJF.js} +4 -4
- package/dist/{chunk-K6BSR66V.js → chunk-EHOSNVVM.js} +6 -2
- package/dist/{chunk-RRNP2ANY.js → chunk-EQEJJ53P.js} +10 -10
- package/dist/{chunk-GWZNEVM2.js → chunk-EWD5P3GK.js} +9 -9
- package/dist/{chunk-JKKCYP3C.js → chunk-F34AR6O3.js} +21 -15
- package/dist/{chunk-GHS5EBTQ.js → chunk-FKIOX6DS.js} +29 -20
- package/dist/{chunk-HAXOFFRH.js → chunk-FQOOGXBH.js} +7 -7
- package/dist/{chunk-MWUZBSAQ.js → chunk-FSTIBAGM.js} +358 -63
- 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-JSC3U7TI.js → chunk-GJ24ODAX.js} +5 -5
- package/dist/{chunk-B4VEBZKF.js → chunk-GNQRWTMY.js} +139 -52
- package/dist/{chunk-5ICU3EUH.js → chunk-GVYWZNRK.js} +5 -5
- package/dist/chunk-GXCCHKN6.js +59 -0
- package/dist/{chunk-V2ANDPVT.js → chunk-HGSLRG33.js} +170 -8
- package/dist/{chunk-LLDJM5XK.js → chunk-HHVJNVUJ.js} +6 -6
- package/dist/{chunk-F4EKGO4N.js → chunk-HL26ADLH.js} +4 -2
- package/dist/{chunk-VA5FNYMT.js → chunk-HR3HPQ76.js} +42 -5
- package/dist/{chunk-ID64D7PE.js → chunk-HXHFDHB6.js} +24 -24
- package/dist/{chunk-OML5D5V5.js → chunk-I7VLWRK2.js} +8 -8
- package/dist/{chunk-VW6DOEDG.js → chunk-ICO4TQ2F.js} +16 -5
- package/dist/{chunk-SZAA6XDG.js → chunk-IFDRAD6F.js} +2 -2
- package/dist/{chunk-WBKFA554.js → chunk-ILJ7DWGE.js} +9 -9
- package/dist/{chunk-2JH2WHGE.js → chunk-J2FYEQ5L.js} +4 -4
- package/dist/{chunk-BMS5RKQY.js → chunk-JABWPKFY.js} +3 -3
- package/dist/{chunk-QDC3K2U3.js → chunk-K2BLQC5E.js} +3 -3
- package/dist/{chunk-EKCHAPYA.js → chunk-K2HL3GBL.js} +4 -4
- package/dist/{chunk-N2Z7HLVY.js → chunk-K6RDB7IA.js} +28 -28
- package/dist/{chunk-TM6LQDI3.js → chunk-KDWLXVMN.js} +85 -335
- package/dist/{chunk-OZNBF4L3.js → chunk-KECNXMDE.js} +2 -2
- package/dist/{chunk-RSJ25QSL.js → chunk-KF6GFW6O.js} +217 -50
- 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-IUE3Y34X.js → chunk-KTFSFCVN.js} +20 -9
- package/dist/{chunk-7E7I3WLS.js → chunk-KYKNBD4Y.js} +36 -34
- package/dist/chunk-L4N3DWNW.js +539 -0
- package/dist/{chunk-LCGCVYZ4.js → chunk-LQTKDAUO.js} +2 -2
- package/dist/{chunk-JIEGK6UF.js → chunk-LTR5QCLS.js} +51 -7
- package/dist/chunk-LUL5Z66S.js +221 -0
- package/dist/chunk-LVFANMOH.js +466 -0
- 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-I7ZPNEJM.js → chunk-M6TAYK66.js} +8 -8
- package/dist/{chunk-NEKRRTYW.js → chunk-MC3JSVR6.js} +2 -2
- package/dist/{chunk-CFGTUFWB.js → chunk-MCJKEGHO.js} +2 -2
- package/dist/chunk-MDU3C27C.js +674 -0
- package/dist/{chunk-6XLNIQDB.js → chunk-MYI32N4R.js} +2 -2
- package/dist/{chunk-4UVU7BJ5.js → chunk-NC4KV7EL.js} +6 -6
- package/dist/{chunk-JEQ3XTHC.js → chunk-NF3BK5WR.js} +5 -5
- package/dist/chunk-NTK3WTHM.js +141 -0
- package/dist/{chunk-GYV6VZOC.js → chunk-NTTS3O53.js} +2 -2
- package/dist/{chunk-UPZU6GE4.js → chunk-NY6IWDVU.js} +6 -6
- package/dist/chunk-O2RQ7LCK.js +283 -0
- package/dist/{chunk-4BJ5BYCE.js → chunk-O3VV6IVK.js} +2 -2
- package/dist/{chunk-W6GROXXM.js → chunk-O5F25NIE.js} +2 -2
- package/dist/{chunk-WRBAGUNF.js → chunk-ODUTYZIU.js} +5 -5
- package/dist/{chunk-E3TPLWFX.js → chunk-ONRTXOZY.js} +4 -4
- package/dist/{chunk-B4OAX3SI.js → chunk-OQM5IVJY.js} +118 -225
- package/dist/{chunk-XRZT5WY5.js → chunk-P5SC4DLJ.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-64I3JVYM.js → chunk-PWWSIB2A.js} +5 -5
- package/dist/{chunk-2STGEDFV.js → chunk-QEQISF75.js} +2 -2
- package/dist/{chunk-3DPEIQKN.js → chunk-QH3ZTUOA.js} +2 -2
- package/dist/{chunk-YAKGTXEV.js → chunk-QRFXEO6Y.js} +2 -2
- package/dist/{chunk-35MSIRKH.js → chunk-QUIJZSDW.js} +2 -2
- package/dist/{chunk-HHV2GANA.js → chunk-R2P2U3ZS.js} +2 -2
- package/dist/chunk-R6MAYTMS.js +108 -0
- package/dist/{chunk-MUW2BDDH.js → chunk-R6MICQYU.js} +6 -6
- package/dist/{chunk-JDAY6FIL.js → chunk-RLTT5GVY.js} +132 -17
- package/dist/{chunk-ZWPRK62N.js → chunk-RXIOCVBZ.js} +24 -6
- package/dist/{chunk-NIQJ66N4.js → chunk-S32UQ5GL.js} +62 -35
- package/dist/{chunk-AX2THNSA.js → chunk-SBZX6ARC.js} +12 -12
- package/dist/{chunk-TXOTCRLG.js → chunk-SD7SHNDW.js} +2 -2
- package/dist/{chunk-AF4YM7Z4.js → chunk-SDWNDICN.js} +10284 -3756
- package/dist/{chunk-UXCU4E3T.js → chunk-SE4ZKILO.js} +6 -6
- package/dist/chunk-SL2RDHKO.js +19 -0
- package/dist/{chunk-NUGM5KR6.js → chunk-SRCEQKQS.js} +2 -2
- package/dist/{chunk-KKOJXO6R.js → chunk-SRZOW5L2.js} +46 -14
- package/dist/{chunk-3M6DQK6S.js → chunk-T334FW2H.js} +7 -7
- package/dist/chunk-T52TPHYC.js +318 -0
- package/dist/{chunk-I7XBWTYH.js → chunk-T53XI6I7.js} +5 -5
- package/dist/{chunk-LDJG7DW3.js → chunk-T7FDXNRU.js} +13 -13
- package/dist/{chunk-XPWWI35G.js → chunk-TEG3RYVZ.js} +59 -41
- package/dist/{chunk-3I7MS7N2.js → chunk-TK2BMCBZ.js} +2 -2
- package/dist/{chunk-5OIVVPHF.js → chunk-TN5FW4XY.js} +13 -6
- package/dist/{chunk-PAJQJ7BS.js → chunk-TZ7MFRG4.js} +1263 -835
- package/dist/{chunk-GI7YYQ3F.js → chunk-U2JOLB7O.js} +415 -83
- package/dist/{chunk-LL4KHSZI.js → chunk-U2MSJ57E.js} +2 -2
- package/dist/{chunk-FTMGRKEF.js → chunk-U44YYLVV.js} +4 -4
- package/dist/{chunk-CE5AX47J.js → chunk-U7H5WRG5.js} +5 -5
- package/dist/{chunk-G76U63X4.js → chunk-U7VQ4NI4.js} +22 -22
- package/dist/{chunk-7ZYNNDKC.js → chunk-UFYNOQK4.js} +7 -7
- package/dist/{chunk-R346GLFC.js → chunk-UHW5V7HC.js} +2 -2
- package/dist/{chunk-QWGDJJYJ.js → chunk-UL36QJX6.js} +14 -14
- package/dist/{chunk-VIA6RFQZ.js → chunk-UQIVHSE4.js} +4 -4
- package/dist/{chunk-HEQY7ZFI.js → chunk-URBGEOH3.js} +5 -5
- package/dist/chunk-USZA7GWL.js +341 -0
- package/dist/{chunk-W6RRQCPQ.js → chunk-UTUNT5QL.js} +48 -579
- package/dist/{chunk-ZA4VCIGV.js → chunk-UUQ5G6EZ.js} +60 -41
- package/dist/{chunk-F5JHEYZM.js → chunk-UXAC2FX4.js} +73 -41
- package/dist/{chunk-VG7TBQIY.js → chunk-V552WL53.js} +68 -4
- package/dist/{chunk-BWH6N36D.js → chunk-VHKTOLEW.js} +272 -42
- package/dist/chunk-VLPTKCKT.js +396 -0
- 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-2UH2KFUP.js → chunk-WFKDPU7U.js} +4 -4
- package/dist/{chunk-ZDN3Y73Y.js → chunk-WJIMKGD6.js} +9 -51
- package/dist/{chunk-YQWYVTMC.js → chunk-WLMSOT73.js} +59 -12
- package/dist/{chunk-MXHC5QYU.js → chunk-WTQGRBHV.js} +5 -144
- package/dist/chunk-WXA2CFJO.js +23 -0
- package/dist/{chunk-QSNYB6ZV.js → chunk-XCUDZQLX.js} +3 -3
- package/dist/{chunk-2APPQIER.js → chunk-XXBQKW32.js} +11 -11
- package/dist/{chunk-2VIKGWFZ.js → chunk-YEJIG7LN.js} +332 -332
- package/dist/chunk-YGDMBK7O.js +567 -0
- package/dist/{chunk-4WR7VSYB.js → chunk-YYB3MC65.js} +23 -9
- package/dist/{chunk-2IR2NMPA.js → chunk-ZIDFQJRB.js} +2 -2
- package/dist/{chunk-54CBCGIR.js → chunk-ZMZQEBKI.js} +136 -81
- 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 +45 -44
- package/dist/clio-5I2IBFYL.js +26 -0
- package/dist/{code-nav-MDZNQS33.js → code-nav-YXIAEZVS.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-UCUQ4QXW.js → components-TNIKXCBH.js} +13 -14
- package/dist/{config-SVM5P5YI.js → config-Y2JDJ3JJ.js} +210 -119
- package/dist/configure-SML6UBZ5.js +55 -0
- package/dist/{context-2OHRKS42.js → context-P5YSEO55.js} +125 -115
- package/dist/{context-VNCR7KAG.js → context-QQ53HSGJ.js} +91 -62
- package/dist/{context-E3VC7RX5.js → context-S2EEC3EJ.js} +62 -31
- package/dist/context-clear-TMEQCOTH.js +183 -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-VDS25HXZ.js → context-working-set-CNLSQN5K.js} +31 -31
- package/dist/detail-5572VLBO.js +114 -0
- package/dist/{dispatch-runner-5AHT53RF.js → dispatch-runner-FRHD6P2O.js} +214 -126
- package/dist/{docs-PD3EXDKU.js → docs-BL7ROUFN.js} +5 -7
- package/dist/{doctor-WNNVO6FY.js → doctor-N3LCM2LG.js} +89 -66
- package/dist/{eval-7G7SGAYO.js → eval-BUU3ZOUZ.js} +493 -197
- package/dist/{eval-inventory-Y6QRFOH5.js → eval-inventory-QOYZERXJ.js} +7 -7
- package/dist/evidence-DTGEN456.js +224 -0
- package/dist/{evidence-VD6736FQ.js → evidence-SQ5DNFEN.js} +114 -195
- package/dist/{evolve-AL3NGVRL.js → evolve-IJNUFZDS.js} +107 -88
- package/dist/{extensions-MOVJ32NM.js → extensions-YVRHX6ZI.js} +16 -17
- package/dist/{fleet-QZHUMAGI.js → fleet-ZNNVSYFO.js} +147 -141
- package/dist/{fleet-commands-BAYT5FJZ.js → fleet-commands-5YE7NPJL.js} +27 -23
- package/dist/{fleet-decisions-IREVMRU4.js → fleet-decisions-3SBSCTCW.js} +16 -15
- package/dist/{fleet-graph-YCTT3HTI.js → fleet-graph-6HHPWF5T.js} +39 -38
- package/dist/{fleet-inspect-QVJTDAVB.js → fleet-inspect-JEYMGCGC.js} +107 -87
- package/dist/{fleet-new-RDVJLHHH.js → fleet-new-RCKGSRDV.js} +3 -3
- package/dist/{fleet-preflight-25QAFPK4.js → fleet-preflight-QRSHIIDE.js} +10 -10
- package/dist/{fleet-validate-5O57AAJ7.js → fleet-validate-4PM4GDDL.js} +46 -42
- package/dist/{fleet-verify-CPH2W2T6.js → fleet-verify-NJDTHTO3.js} +105 -85
- package/dist/fleet-view-UP2BWQQY.js +117 -0
- package/dist/{init-J477LKZH.js → init-S3GZQ5ZF.js} +123 -117
- package/dist/{install-NKNG7KD4.js → install-3RZDDP23.js} +5 -5
- package/dist/{interop-3FCM6XLG.js → interop-YOTGXFJM.js} +25 -26
- package/dist/inventory-K2OZ36YJ.js +117 -0
- package/dist/{library-QUQEIUG6.js → library-GJI6W6OK.js} +45 -45
- package/dist/{memory-SGGSEP65.js → memory-OQOXQGYD.js} +107 -90
- package/dist/{models-HEKUAXXK.js → models-3IK2Y5WE.js} +64 -65
- package/dist/{monitor-HKU57TYQ.js → monitor-FTJLTKCQ.js} +136 -101
- package/dist/{orchestrator-VDFAEFAI.js → orchestrator-N47O7SFD.js} +1442 -1671
- package/dist/{panes-DN2SSFOH.js → panes-7BTYH3XQ.js} +8 -8
- package/dist/{panes-TALGNPZT.js → panes-WPOMEMRH.js} +22 -23
- package/dist/{paths-NBMFAIEZ.js → paths-J3KN7UAO.js} +12 -13
- package/dist/preload-65U34NG6.js +115 -0
- package/dist/{registry-LG64LTF4.js → registry-DESGAXWK.js} +3 -3
- package/dist/{reset-EAJFFJVB.js → reset-MUVQDLNL.js} +20 -21
- package/dist/{resources-OVKSEFVE.js → resources-LM76COAO.js} +41 -40
- package/dist/{run-7DP7ZF2J.js → run-3VFZQ33N.js} +168 -166
- package/dist/{share-WML67FT3.js → share-4JUB4BL7.js} +43 -43
- package/dist/{skills-SG662R2K.js → skills-S36AAJHU.js} +47 -47
- package/dist/{skills-eval-VVZEUU46.js → skills-eval-G6T57L7M.js} +127 -104
- package/dist/{skills-inventory-I2E23GET.js → skills-inventory-WLM46PJH.js} +41 -40
- package/dist/slash-commands-GBARG3Y7.js +91 -0
- package/dist/{steer-2LQOMCPB.js → steer-S7D7IKPU.js} +7 -7
- package/dist/{support-CC2UJBJ6.js → support-5VAEC32W.js} +14 -14
- package/dist/{targets-4QC3HIEW.js → targets-N5REUETU.js} +147 -98
- package/dist/tasks-6BVY5YZF.js +36 -0
- package/dist/{terminal-lease-TUHIJ6Y2.js → terminal-lease-57UEOJKS.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-5PEVOE5B.js → uninstall-FXYMFFRT.js} +19 -20
- package/dist/{upgrade-M4WXY6KN.js → upgrade-4HD5HAIV.js} +49 -45
- package/dist/{usage-N7ZNVLEM.js → usage-4GWM2WWP.js} +143 -103
- package/dist/{verifiers-DJTP4XX6.js → verifiers-GSKWKWVG.js} +162 -28
- package/dist/verify-3AS3ULCY.js +30 -0
- package/dist/{version-KGEG7EPO.js → version-RFPKO6T7.js} +4 -4
- package/dist/{web-fetch-MPARV2K7.js → web-fetch-MQN4FH3X.js} +169 -18
- package/dist/wiki-generate-7BV7XWIY.js +614 -0
- package/dist/{with-panes-4GCGSL7J.js → with-panes-OFTNAR4Y.js} +34 -20
- package/dist/worker/entry.js +99 -85
- package/dist/{workspace-ZJ6BFM3Q.js → workspace-DZ7JADBG.js} +6 -6
- package/docs/README.md +10 -8
- package/docs/architecture/acp.md +27 -0
- package/docs/architecture/architecture.md +5 -5
- package/docs/architecture/artifact-versions.md +1 -1
- package/docs/architecture/context-engine.md +44 -59
- package/docs/architecture/context-working-set.md +7 -9
- package/docs/architecture/dispatch-architecture-rationale.md +1 -1
- package/docs/architecture/dispatch-typed-intent.md +1 -1
- package/docs/architecture/evidence-and-memory.md +11 -1
- package/docs/architecture/observability.md +7 -1
- package/docs/architecture/pi-boundary.md +37 -7
- package/docs/architecture/prompt-envelope-and-tools.md +22 -12
- package/docs/architecture/safety-model.md +10 -17
- package/docs/architecture/session-lifecycle.md +4 -4
- package/docs/architecture/tui-design.md +1 -1
- package/docs/architecture/worker-dispatch-mechanics.md +4 -0
- package/docs/guide/built-in-agents.md +8 -8
- package/docs/guide/commands-and-modes.md +66 -38
- package/docs/guide/configuration-and-targets.md +10 -3
- package/docs/guide/configuration-reference.md +23 -8
- package/docs/guide/environment-variables.md +8 -4
- package/docs/guide/fleet-dispatch.md +12 -0
- package/docs/guide/installation-and-lifecycle.md +35 -9
- package/docs/guide/proactive-memory.md +1 -1
- package/docs/guide/skills-marketplace.md +11 -3
- package/docs/guide/tool-usage.md +87 -5
- package/docs/history/config-knobs-audit.md +2 -2
- package/docs/process/development-pipeline.md +15 -10
- 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/git-commit-provenance.md +15 -0
- package/docs/process/release-cut-checklist.md +207 -0
- package/docs/process/scientific-validation.md +18 -17
- package/evals/README.md +4 -0
- package/evals/behavioral-corpus-grader.mjs +147 -14
- package/evals/behavioral-machinery-support.ts +1 -0
- package/evals/behavioral-machinery.yaml +1 -1
- 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/coding/coding-standards/SKILL.md +14 -4
- package/skills/context/context-handoff/SKILL.md +3 -3
- package/skills/context/context-prime/SKILL.md +3 -3
- package/skills/planning/architecture/SKILL.md +5 -5
- package/skills/planning/backlog/SKILL.md +4 -4
- package/skills/planning/prd/SKILL.md +4 -3
- package/skills/planning/product-intent/SKILL.md +8 -8
- package/skills/planning/tech-spec/SKILL.md +4 -4
- package/skills/registry.yaml +33 -33
- package/skills/research/arxiv-literature/SKILL.md +3 -3
- package/skills/research/experiment-protocol/SKILL.md +3 -3
- package/skills/research/scientific-debugging/SKILL.md +3 -2
- package/skills/research/scientific-modernization/SKILL.md +3 -3
- package/skills/skill-marketplace.json +17 -17
- package/skills/workflow/cut-it/SKILL.md +3 -4
- package/skills/workflow/design-council/SKILL.md +5 -10
- package/skills/workflow/grill-me/SKILL.md +14 -15
- package/skills/workflow/workflow-distiller/SKILL.md +4 -4
- package/src/cli/args.ts +0 -8
- 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.ts +2 -1
- package/src/cli/context-map.ts +75 -14
- package/src/cli/context.ts +46 -17
- package/src/cli/doctor-state-size.ts +1 -12
- package/src/cli/doctor-validation-contract.ts +28 -0
- package/src/cli/doctor.ts +5 -0
- package/src/cli/eval.ts +17 -3
- package/src/cli/evidence-detail.ts +1 -75
- package/src/cli/evidence-inventory.ts +1 -167
- package/src/cli/index.ts +2 -0
- package/src/cli/modes/print.ts +32 -4
- package/src/cli/run.ts +16 -16
- package/src/cli/skills-eval.ts +10 -8
- package/src/cli/steer-channel.ts +31 -18
- package/src/cli/targets.ts +84 -32
- package/src/cli/tasks.ts +93 -0
- package/src/cli/upgrade.ts +19 -11
- package/src/cli/usage.ts +30 -0
- package/src/cli/verifiers.ts +147 -1
- package/src/cli/wiki-generate.ts +240 -96
- package/src/core/bash-exec.ts +43 -15
- package/src/core/bus-events.ts +15 -0
- package/src/core/commit-attribution.ts +41 -1
- package/src/core/config.ts +33 -14
- package/src/core/defaults.ts +5 -4
- package/src/core/file-references.ts +11 -1
- package/src/core/git-commit-attribution.ts +46 -3
- package/src/core/incomplete-installation.ts +3 -1
- package/src/core/run-overrides.ts +0 -5
- package/src/core/settings-layers.ts +21 -5
- package/src/core/skill-activation.ts +3 -0
- package/src/core/termination.ts +26 -9
- package/src/core/tool-names.ts +5 -2
- package/src/core/untrusted-content.ts +16 -0
- package/src/core/workspace-trust.ts +179 -0
- package/src/domains/agents/builtins/architect.md +1 -1
- package/src/domains/agents/builtins/coder.md +5 -3
- package/src/domains/agents/builtins/context-bootstrap.md +3 -1
- package/src/domains/agents/builtins/documenter.md +8 -5
- package/src/domains/agents/builtins/git-master.md +1 -1
- package/src/domains/agents/builtins/provenance.md +7 -7
- package/src/domains/agents/builtins/researcher.md +1 -0
- package/src/domains/agents/builtins/scout.md +7 -1
- package/src/domains/agents/builtins/tester.md +1 -1
- package/src/domains/agents/builtins/verifier.md +2 -2
- package/src/domains/agents/builtins/wiki-writer.md +4 -3
- package/src/domains/agents/result-contract.ts +199 -26
- 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 +97 -11
- 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 +12 -57
- package/src/domains/context/wiki/assemble.ts +14 -10
- package/src/domains/context/wiki/evidence.ts +209 -0
- package/src/domains/context/wiki/frontmatter.ts +5 -2
- package/src/domains/context/wiki/generate.ts +207 -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 +85 -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 +10 -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/code-step.ts +11 -4
- package/src/domains/dispatch/contract.ts +41 -9
- 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 +4 -0
- package/src/domains/dispatch/extension.ts +240 -132
- package/src/domains/dispatch/fleet-commit-attribution.ts +5 -0
- package/src/domains/dispatch/fleet-run.ts +21 -0
- package/src/domains/dispatch/gate-role-prompts.ts +4 -2
- package/src/domains/dispatch/host-verification.ts +114 -13
- package/src/domains/dispatch/intent.ts +28 -18
- package/src/domains/dispatch/orphan-recovery.ts +2 -0
- package/src/domains/dispatch/parallel-writers.ts +34 -0
- package/src/domains/dispatch/receipt-integrity.ts +4 -0
- package/src/domains/dispatch/reservation-store.ts +13 -37
- 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/state.ts +15 -2
- package/src/domains/dispatch/types.ts +21 -5
- 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 +17 -10
- package/src/domains/eval/runners/context-index.ts +2 -7
- package/src/domains/eval/runners/context-init.ts +3 -6
- package/src/domains/eval/runners/external-command.ts +29 -11
- 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 +106 -17
- package/src/domains/evidence/detail.ts +69 -0
- package/src/domains/evidence/eval.ts +13 -1
- package/src/domains/evidence/finish-contract-map.ts +5 -1
- package/src/domains/evidence/inventory.ts +167 -0
- package/src/domains/evidence/store.ts +16 -0
- package/src/domains/evidence/types.ts +12 -0
- package/src/domains/extensions/resources.ts +7 -0
- 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/marketplace-offer.ts +20 -1
- package/src/domains/middleware/rules.ts +5 -1
- package/src/domains/middleware/runtime.ts +7 -3
- 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/detect.ts +3 -6
- 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/accountability.ts +15 -1
- package/src/domains/observability/contract.ts +54 -9
- package/src/domains/observability/evidence-index.ts +10 -0
- package/src/domains/observability/extension.ts +9 -5
- package/src/domains/observability/projection.ts +423 -53
- package/src/{interactive → domains/observability}/worker-progress.ts +3 -3
- 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 +12 -0
- package/src/domains/prompts/fragments/operating/delegation.md +5 -0
- package/src/domains/prompts/fragments/wiki/page.md +36 -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/model-discovery.ts +1 -4
- package/src/domains/providers/models/local-models/clio-coder-local-coding-targets.yaml +16 -14
- package/src/domains/providers/runtime-resolution.ts +11 -9
- package/src/domains/providers/runtimes/claude/claude-code.ts +9 -0
- package/src/domains/providers/runtimes/cloud/openrouter.ts +2 -0
- package/src/domains/providers/support.ts +1 -1
- package/src/domains/providers/types/runtime-descriptor.ts +1 -1
- package/src/domains/resources/skills/promotion.ts +8 -1
- package/src/domains/safety/action-classifier.ts +16 -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 +13 -0
- package/src/domains/safety/extension.ts +11 -2
- package/src/domains/safety/finish-contract-registration.ts +29 -14
- package/src/domains/safety/finish-contract.ts +252 -40
- package/src/domains/safety/index.ts +20 -1
- package/src/domains/safety/policy-engine.ts +211 -34
- package/src/domains/safety/project-policy.ts +7 -2
- package/src/domains/safety/rigor.ts +53 -39
- package/src/domains/safety/validation-contract.ts +388 -0
- package/src/domains/safety/workspace-trust.ts +43 -0
- package/src/domains/session/archive-readers.ts +10 -1
- 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 +137 -28
- package/src/domains/session/entries.ts +213 -11
- package/src/domains/session/extension.ts +4 -4
- package/src/domains/session/handoff.ts +2 -1
- package/src/domains/session/manager.ts +2 -3
- package/src/domains/session/prompt-manifest.ts +47 -8
- package/src/domains/session/task-board.ts +32 -1
- package/src/domains/session/tree/fork.ts +1 -2
- package/src/domains/session/tree/navigator.ts +1 -1
- package/src/domains/user-tasks/acceptance.ts +56 -0
- package/src/domains/user-tasks/active-acceptance.ts +40 -0
- package/src/domains/user-tasks/handoff.ts +16 -0
- package/src/domains/user-tasks/store.ts +34 -3
- package/src/engine/acp/adapter.ts +60 -10
- package/src/engine/acp/server.ts +22 -4
- package/src/engine/acp/transport.ts +55 -9
- package/src/engine/acp/types.ts +9 -0
- package/src/engine/antigravity/subprocess-runtime.ts +20 -4
- package/src/engine/api-registry.ts +19 -2
- package/src/engine/apis/ollama-native.ts +15 -0
- 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/claude/subprocess-runtime.ts +107 -60
- package/src/engine/env-api-keys.ts +2 -1
- package/src/engine/external-subprocess.ts +26 -7
- 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 +64 -17
- package/src/interactive/chat-loop-messages.ts +12 -4
- package/src/interactive/chat-loop.ts +115 -45
- package/src/interactive/chat-renderer.ts +60 -0
- package/src/interactive/context-recall-command.ts +2 -1
- package/src/interactive/dispatch-board.ts +58 -714
- package/src/interactive/editor-submit.ts +13 -0
- package/src/interactive/fleet-run-preview.ts +2 -1
- package/src/interactive/interactive-application.ts +11 -4
- package/src/interactive/interactive-event-projection.ts +7 -1
- package/src/interactive/interactive-presentation.ts +63 -12
- package/src/interactive/interactive-slash-runtime.ts +4 -1
- package/src/interactive/layout.ts +2 -1
- package/src/interactive/model-session-replay.ts +2 -2
- package/src/interactive/oracle.ts +5 -2
- package/src/interactive/overlay-frame.ts +1 -0
- package/src/interactive/overlay-general-openers.ts +3 -1
- package/src/interactive/overlay-session-lifecycle.ts +6 -0
- package/src/interactive/overlays/ask-user.ts +1 -0
- package/src/interactive/overlays/fleet-run-approval.ts +3 -2
- package/src/interactive/overlays/message-picker.ts +3 -3
- package/src/interactive/overlays/settings.ts +2 -2
- package/src/interactive/overlays/tree-selector.ts +2 -2
- package/src/interactive/renderers/branch-summary.ts +1 -1
- package/src/interactive/renderers/tool-execution.ts +17 -1
- package/src/interactive/renderers/worker-entry.ts +25 -10
- package/src/interactive/slash-autocomplete.ts +4 -6
- package/src/interactive/slash-commands.ts +31 -43
- package/src/interactive/slash-spec.ts +28 -0
- 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 +2 -0
- package/src/interactive/watch-pane.ts +18 -4
- package/src/interactive/worker-stream.ts +14 -10
- package/src/tools/agent-tools.ts +6 -3
- package/src/tools/bash.ts +1 -1
- package/src/tools/bootstrap.ts +4 -0
- package/src/tools/builtin-tool-catalog.ts +40 -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 +41 -1
- package/src/tools/context/index.ts +32 -7
- package/src/tools/context/surface.ts +15 -4
- package/src/tools/core-bootstrap.ts +16 -0
- package/src/tools/decide.ts +136 -0
- package/src/tools/dispatch-admission.ts +33 -1
- package/src/tools/dispatch-arguments.ts +38 -1
- package/src/tools/dispatch-plan.ts +12 -9
- package/src/tools/dispatch-runner.ts +63 -33
- 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/dispatch-types.ts +6 -0
- package/src/tools/evidence.ts +96 -0
- package/src/tools/find.ts +13 -4
- package/src/tools/grep.ts +13 -1
- package/src/tools/limitation.ts +76 -0
- 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/policy.ts +9 -0
- package/src/tools/presentation.ts +3 -0
- package/src/tools/read.ts +112 -15
- package/src/tools/registry.ts +55 -18
- package/src/tools/result-shaping.ts +127 -7
- package/src/tools/task-worktree.ts +13 -3
- package/src/tools/tasks.ts +40 -5
- package/src/tools/verify/authoring.ts +170 -83
- package/src/tools/verify/catalog.ts +122 -5
- package/src/tools/verify/frontend.ts +67 -30
- package/src/tools/verify/index.ts +2 -1
- package/src/tools/verify/numeric.ts +303 -0
- package/src/tools/verify/perf.ts +143 -0
- package/src/tools/verify/scripts.ts +229 -2
- 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-IA7V7FUC.js +0 -22
- package/dist/chunk-2WZ546HR.js +0 -792
- package/dist/chunk-5PSMVOLM.js +0 -56
- package/dist/chunk-7DICMOS6.js +0 -313
- package/dist/chunk-BEPZRGGU.js +0 -1560
- package/dist/chunk-JVCV3ICN.js +0 -47
- package/dist/chunk-KK4JZPBQ.js +0 -3982
- package/dist/chunk-MNJGS2IN.js +0 -33
- package/dist/chunk-NDINPTJ4.js +0 -641
- package/dist/chunk-O5CVSAG5.js +0 -122
- package/dist/chunk-OQE5J4C6.js +0 -73
- package/dist/chunk-RVG5JXAL.js +0 -41
- package/dist/chunk-T56WDKA5.js +0 -183
- package/dist/chunk-UUVG37B4.js +0 -244
- package/dist/chunk-VPKWYKEY.js +0 -169
- package/dist/chunk-Y3CBHOR6.js +0 -228
- package/dist/clio-CMMK4KRR.js +0 -25
- package/dist/configure-LE3IK2TJ.js +0 -56
- package/dist/context-clear-BW4O37TG.js +0 -176
- package/dist/fleet-view-SWBR3VGQ.js +0 -97
- package/dist/preload-P6DGH2PZ.js +0 -13
- package/dist/slash-commands-S7MBJDQK.js +0 -83
- package/dist/tools-TFGJICCU.js +0 -29
- package/dist/verify-RWE4PPEK.js +0 -27
- package/dist/wiki-generate-C7IQOXSP.js +0 -469
|
@@ -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-Y3CBHOR6.js";
|
|
6
|
+
isProjectPreloadClass
|
|
7
|
+
} from "./chunk-5ZSZEYJK.js";
|
|
9
8
|
import {
|
|
10
9
|
discoverAgentRecipes
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EQEJJ53P.js";
|
|
11
|
+
import "./chunk-T7FDXNRU.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-6CDNRHWH.js";
|
|
27
32
|
import {
|
|
28
33
|
listSessionLedgerRefs,
|
|
29
34
|
parseSessionEntries
|
|
30
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-F34AR6O3.js";
|
|
31
36
|
import {
|
|
32
37
|
EVAL_BEHAVIOR_METRIC_DEFINITIONS_V1,
|
|
33
38
|
EVAL_EXECUTION_ENVELOPE_SCHEMA_V1,
|
|
@@ -42,107 +47,109 @@ 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-
|
|
57
|
+
} from "./chunk-U44YYLVV.js";
|
|
58
|
+
import "./chunk-O5F25NIE.js";
|
|
59
|
+
import "./chunk-CXQ37WJH.js";
|
|
54
60
|
import {
|
|
55
61
|
shellQuote
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-7DRAWPTZ.js";
|
|
62
|
-
import "./chunk-5MEZN6CB.js";
|
|
63
|
-
import "./chunk-PUVDKJ2Y.js";
|
|
64
|
-
import "./chunk-HVDIIIQW.js";
|
|
62
|
+
} from "./chunk-SD7SHNDW.js";
|
|
63
|
+
import "./chunk-QH3ZTUOA.js";
|
|
64
|
+
import "./chunk-22PQ4TX4.js";
|
|
65
|
+
import "./chunk-DZK63TZJ.js";
|
|
66
|
+
import "./chunk-DNHVRBH4.js";
|
|
65
67
|
import {
|
|
66
68
|
printError
|
|
67
|
-
} from "./chunk-
|
|
68
|
-
import "./chunk-
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import "./chunk-L47TF46W.js";
|
|
69
|
+
} from "./chunk-3T4DXWP6.js";
|
|
70
|
+
import "./chunk-K2HL3GBL.js";
|
|
71
|
+
import "./chunk-7HBHHVCK.js";
|
|
71
72
|
import {
|
|
72
73
|
createSafetyPolicyEngine
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
76
|
-
import "./chunk-HHV2GANA.js";
|
|
74
|
+
} from "./chunk-4SVIVOMC.js";
|
|
75
|
+
import "./chunk-NTK3WTHM.js";
|
|
76
|
+
import "./chunk-LY4N4TTL.js";
|
|
77
77
|
import {
|
|
78
78
|
agentSpecFingerprint,
|
|
79
79
|
normalizeAgentSpec
|
|
80
|
-
} from "./chunk-
|
|
81
|
-
import "./chunk-
|
|
82
|
-
import "./chunk-
|
|
83
|
-
import "./chunk-
|
|
84
|
-
import "./chunk-
|
|
85
|
-
import "./chunk-
|
|
86
|
-
import "./chunk-
|
|
87
|
-
import "./chunk-
|
|
80
|
+
} from "./chunk-OQM5IVJY.js";
|
|
81
|
+
import "./chunk-LUL5Z66S.js";
|
|
82
|
+
import "./chunk-M6TAYK66.js";
|
|
83
|
+
import "./chunk-KQ6IDQIB.js";
|
|
84
|
+
import "./chunk-MDU3C27C.js";
|
|
85
|
+
import "./chunk-R2P2U3ZS.js";
|
|
86
|
+
import "./chunk-NTTS3O53.js";
|
|
87
|
+
import "./chunk-M4KFUXS7.js";
|
|
88
|
+
import "./chunk-5ZMXGW7P.js";
|
|
89
|
+
import "./chunk-B6UM3OZC.js";
|
|
88
90
|
import {
|
|
89
|
-
|
|
90
|
-
} from "./chunk-
|
|
91
|
-
import "./chunk-
|
|
91
|
+
ALL_TOOL_NAMES
|
|
92
|
+
} from "./chunk-EHOSNVVM.js";
|
|
93
|
+
import "./chunk-MCJKEGHO.js";
|
|
92
94
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
95
|
-
import "./chunk-
|
|
96
|
-
import "./chunk-GHS5EBTQ.js";
|
|
95
|
+
extractReasoningTokens
|
|
96
|
+
} from "./chunk-77CZRFTE.js";
|
|
97
|
+
import "./chunk-FKIOX6DS.js";
|
|
97
98
|
import {
|
|
98
99
|
namingCompatibilityEnvironment
|
|
99
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-DVNAPPXU.js";
|
|
101
|
+
import "./chunk-5CY4Q6QI.js";
|
|
102
|
+
import "./chunk-FQOOGXBH.js";
|
|
103
|
+
import {
|
|
104
|
+
InvalidIdError
|
|
105
|
+
} from "./chunk-UHW5V7HC.js";
|
|
100
106
|
import {
|
|
101
107
|
normalizeClioCoderEventRecord,
|
|
102
108
|
normalizeClioCoderEventType
|
|
103
|
-
} from "./chunk-
|
|
104
|
-
import "./chunk-
|
|
109
|
+
} from "./chunk-KMF54VH3.js";
|
|
110
|
+
import "./chunk-HL26ADLH.js";
|
|
105
111
|
import {
|
|
106
112
|
readCodewiki,
|
|
107
113
|
structuralCodewikiHash
|
|
108
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-W2RJEH6Q.js";
|
|
109
115
|
import {
|
|
110
116
|
detectProjectProfile
|
|
111
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-CVDAFGPW.js";
|
|
112
118
|
import {
|
|
113
119
|
enumerateWorkspaceFiles
|
|
114
|
-
} from "./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-
|
|
126
|
-
import "./chunk-
|
|
127
|
-
import "./chunk-
|
|
128
|
-
import "./chunk-
|
|
120
|
+
} from "./chunk-PPEZJWUG.js";
|
|
121
|
+
import "./chunk-WDV62RKY.js";
|
|
122
|
+
import "./chunk-GD55RTIW.js";
|
|
123
|
+
import "./chunk-E3LEPLQ2.js";
|
|
124
|
+
import "./chunk-SE4ZKILO.js";
|
|
125
|
+
import "./chunk-U2MSJ57E.js";
|
|
126
|
+
import "./chunk-C27U2TYG.js";
|
|
127
|
+
import "./chunk-GJ24ODAX.js";
|
|
128
|
+
import "./chunk-LTR5QCLS.js";
|
|
129
|
+
import "./chunk-6EXUUOSN.js";
|
|
130
|
+
import "./chunk-ZTNFYMIO.js";
|
|
131
|
+
import "./chunk-HXHFDHB6.js";
|
|
132
|
+
import "./chunk-VNBICSS2.js";
|
|
133
|
+
import "./chunk-2QPI3TR3.js";
|
|
134
|
+
import "./chunk-TK2BMCBZ.js";
|
|
129
135
|
import {
|
|
130
136
|
require_dist
|
|
131
|
-
} from "./chunk-
|
|
132
|
-
import "./chunk-
|
|
133
|
-
import "./chunk-
|
|
137
|
+
} from "./chunk-B5GGDIHT.js";
|
|
138
|
+
import "./chunk-ZZFWWYLX.js";
|
|
139
|
+
import "./chunk-DXVMLM3Z.js";
|
|
134
140
|
import {
|
|
135
141
|
clioDataDir,
|
|
136
142
|
clioStateDir
|
|
137
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-CTTI7G3T.js";
|
|
138
144
|
import {
|
|
139
145
|
__toESM,
|
|
140
146
|
init_esm_shims
|
|
141
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-ECBHH7LU.js";
|
|
142
148
|
|
|
143
149
|
// src/cli/eval.ts
|
|
144
150
|
init_esm_shims();
|
|
145
|
-
import {
|
|
151
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
152
|
+
import { resolve as resolve10 } from "node:path";
|
|
146
153
|
|
|
147
154
|
// src/domains/eval/compare/compare.ts
|
|
148
155
|
init_esm_shims();
|
|
@@ -241,28 +248,33 @@ init_esm_shims();
|
|
|
241
248
|
// src/domains/eval/compare/envelope.ts
|
|
242
249
|
init_esm_shims();
|
|
243
250
|
function compareEvalExecutionEnvelopesV1(identity, baseline, candidate, baselineDimensions, candidateDimensions) {
|
|
251
|
+
const mismatchIdentity = {
|
|
252
|
+
scenarioId: identity.scenarioId,
|
|
253
|
+
role: identity.role,
|
|
254
|
+
target: { id: identity.target.id, model: identity.target.model }
|
|
255
|
+
};
|
|
244
256
|
const leftDimensions = [...baselineDimensions].sort();
|
|
245
257
|
const rightDimensions = [...candidateDimensions].sort();
|
|
246
258
|
if (stableJson(leftDimensions) !== stableJson(rightDimensions)) {
|
|
247
|
-
return { ...
|
|
259
|
+
return { ...mismatchIdentity, fields: ["matrix.dimensions"] };
|
|
248
260
|
}
|
|
249
261
|
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)) {
|
|
250
|
-
return { ...
|
|
262
|
+
return { ...mismatchIdentity, fields: ["executionEnvelope.missingTrial"] };
|
|
251
263
|
}
|
|
252
264
|
const ignored = new Set(leftDimensions);
|
|
253
265
|
const baselineEnvelopes = uniqueEnvelopes(baseline, ignored);
|
|
254
266
|
const candidateEnvelopes = uniqueEnvelopes(candidate, ignored);
|
|
255
267
|
if (baselineEnvelopes.length === 0 && candidateEnvelopes.length === 0) return null;
|
|
256
268
|
if (baselineEnvelopes.length === 0 || candidateEnvelopes.length === 0) {
|
|
257
|
-
return { ...
|
|
269
|
+
return { ...mismatchIdentity, fields: ["executionEnvelope"] };
|
|
258
270
|
}
|
|
259
271
|
if (baselineEnvelopes.length > 1 || candidateEnvelopes.length > 1) {
|
|
260
|
-
return { ...
|
|
272
|
+
return { ...mismatchIdentity, fields: ["executionEnvelope.withinRunVariance"] };
|
|
261
273
|
}
|
|
262
274
|
const left = baselineEnvelopes[0];
|
|
263
275
|
const right = candidateEnvelopes[0];
|
|
264
276
|
if (left === void 0 || right === void 0 || stableJson(left) === stableJson(right)) return null;
|
|
265
|
-
return { ...
|
|
277
|
+
return { ...mismatchIdentity, fields: differingFields(left, right, ignored) };
|
|
266
278
|
}
|
|
267
279
|
function uniqueEnvelopes(results, ignored) {
|
|
268
280
|
const byIdentity = /* @__PURE__ */ new Map();
|
|
@@ -325,26 +337,45 @@ function stableJson(value) {
|
|
|
325
337
|
|
|
326
338
|
// src/domains/eval/compare/behavioral.ts
|
|
327
339
|
function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
328
|
-
const
|
|
329
|
-
const
|
|
340
|
+
const baselineDimensions = baseline.matrix.dimensions ?? [];
|
|
341
|
+
const candidateDimensions = candidate.matrix.dimensions ?? [];
|
|
342
|
+
const varying = new Set(baselineDimensions.filter((dimension) => candidateDimensions.includes(dimension)));
|
|
343
|
+
const baselineGroups = behaviorGroups(baseline, varying);
|
|
344
|
+
const candidateGroups = behaviorGroups(candidate, varying);
|
|
330
345
|
const keys = /* @__PURE__ */ new Set([...baselineGroups.keys(), ...candidateGroups.keys()]);
|
|
331
346
|
const comparisons = [];
|
|
332
347
|
const envelopeMismatches = [];
|
|
333
|
-
const baselineDimensions = baseline.matrix.dimensions ?? [];
|
|
334
|
-
const candidateDimensions = candidate.matrix.dimensions ?? [];
|
|
335
348
|
for (const key of [...keys].sort((left, right) => left.localeCompare(right))) {
|
|
336
349
|
const baselineGroup = baselineGroups.get(key);
|
|
337
350
|
const candidateGroup = candidateGroups.get(key);
|
|
338
|
-
const
|
|
339
|
-
if (
|
|
340
|
-
const
|
|
351
|
+
const group = baselineGroup ?? candidateGroup;
|
|
352
|
+
if (group === void 0) continue;
|
|
353
|
+
const identity = {
|
|
354
|
+
scenarioId: group.scenarioId,
|
|
355
|
+
role: group.role,
|
|
356
|
+
target: { id: group.target.id, model: group.target.model }
|
|
357
|
+
};
|
|
358
|
+
const routes = {
|
|
359
|
+
baselineTargets: baselineGroup?.targets ?? [],
|
|
360
|
+
candidateTargets: candidateGroup?.targets ?? []
|
|
361
|
+
};
|
|
362
|
+
let envelopeMismatch = compareEvalExecutionEnvelopesV1(
|
|
341
363
|
identity,
|
|
342
364
|
baselineGroup?.results ?? [],
|
|
343
365
|
candidateGroup?.results ?? [],
|
|
344
366
|
baselineDimensions,
|
|
345
367
|
candidateDimensions
|
|
346
368
|
);
|
|
347
|
-
if (
|
|
369
|
+
if (routes.baselineTargets.length > 1 || routes.candidateTargets.length > 1) {
|
|
370
|
+
envelopeMismatch = {
|
|
371
|
+
...identity,
|
|
372
|
+
fields: ["behavioralMetrics.ambiguousRouteGroup", ...envelopeMismatch?.fields ?? []]
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
if (envelopeMismatch !== null) {
|
|
376
|
+
envelopeMismatch = { ...envelopeMismatch, ...routes };
|
|
377
|
+
envelopeMismatches.push(envelopeMismatch);
|
|
378
|
+
}
|
|
348
379
|
const comparability = {
|
|
349
380
|
comparable: envelopeMismatch === null,
|
|
350
381
|
mismatchedFields: envelopeMismatch?.fields ?? []
|
|
@@ -352,18 +383,21 @@ function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
|
352
383
|
for (const definition of EVAL_BEHAVIOR_METRIC_DEFINITIONS_V1) {
|
|
353
384
|
const baselineDistribution = behaviorDistribution(baselineGroup?.results ?? [], definition);
|
|
354
385
|
const candidateDistribution = behaviorDistribution(candidateGroup?.results ?? [], definition);
|
|
386
|
+
const noiseBand = definition.family === "safety" ? 0 : distributionNoiseBand(baselineDistribution, candidateDistribution);
|
|
355
387
|
comparisons.push({
|
|
356
388
|
scenarioId: identity.scenarioId,
|
|
357
389
|
role: identity.role,
|
|
358
390
|
target: identity.target,
|
|
391
|
+
...routes,
|
|
359
392
|
metric: definition.name,
|
|
360
393
|
family: definition.family,
|
|
361
394
|
direction: definition.direction,
|
|
362
395
|
hardGate: definition.hardGate,
|
|
363
396
|
baseline: baselineDistribution,
|
|
364
397
|
candidate: candidateDistribution,
|
|
365
|
-
change: envelopeMismatch === null ? classifyChange(baselineDistribution.mean, candidateDistribution.mean, definition.direction) : "incomparable",
|
|
398
|
+
change: envelopeMismatch === null ? classifyChange(baselineDistribution.mean, candidateDistribution.mean, definition.direction, noiseBand) : "incomparable",
|
|
366
399
|
meanDelta: subtractNullable(candidateDistribution.mean, baselineDistribution.mean),
|
|
400
|
+
noiseBand,
|
|
367
401
|
varianceChange: envelopeMismatch === null ? classifyChange(baselineDistribution.variance, candidateDistribution.variance, "lower") : "incomparable",
|
|
368
402
|
varianceDelta: subtractNullable(candidateDistribution.variance, baselineDistribution.variance),
|
|
369
403
|
comparability
|
|
@@ -376,6 +410,8 @@ function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
|
376
410
|
scenarioId: comparison.scenarioId,
|
|
377
411
|
role: comparison.role,
|
|
378
412
|
target: comparison.target,
|
|
413
|
+
baselineTargets: comparison.baselineTargets,
|
|
414
|
+
candidateTargets: comparison.candidateTargets,
|
|
379
415
|
metric: comparison.metric,
|
|
380
416
|
change: comparison.change
|
|
381
417
|
}
|
|
@@ -391,24 +427,28 @@ function compareEvalBehaviorMetricsV1(baseline, candidate) {
|
|
|
391
427
|
envelopeMismatches
|
|
392
428
|
};
|
|
393
429
|
}
|
|
394
|
-
function classifyChange(baseline, candidate, direction) {
|
|
430
|
+
function classifyChange(baseline, candidate, direction, noiseBand = 0) {
|
|
395
431
|
if (baseline === null || candidate === null) return "incomparable";
|
|
396
|
-
if (baseline
|
|
432
|
+
if (Math.abs(candidate - baseline) <= noiseBand) return "unchanged";
|
|
397
433
|
if (direction === "higher") return candidate > baseline ? "improved" : "regressed";
|
|
398
434
|
return candidate < baseline ? "improved" : "regressed";
|
|
399
435
|
}
|
|
400
|
-
function behaviorGroups(artifact) {
|
|
436
|
+
function behaviorGroups(artifact, varying) {
|
|
401
437
|
const groups = /* @__PURE__ */ new Map();
|
|
402
438
|
for (const result of artifact.results) {
|
|
403
439
|
const behavioral = result.behavioralMetrics;
|
|
404
440
|
if (behavioral === void 0) continue;
|
|
405
|
-
const key = groupKey(behavioral.scenarioId, behavioral.role, behavioral.target);
|
|
441
|
+
const key = groupKey(behavioral.scenarioId, behavioral.role, behavioral.target, varying);
|
|
406
442
|
const group = groups.get(key) ?? {
|
|
407
443
|
scenarioId: behavioral.scenarioId,
|
|
408
444
|
role: behavioral.role,
|
|
409
445
|
target: behavioral.target,
|
|
446
|
+
targets: [],
|
|
410
447
|
results: []
|
|
411
448
|
};
|
|
449
|
+
if (!group.targets.some((target) => target.id === behavioral.target.id && target.model === behavioral.target.model)) {
|
|
450
|
+
group.targets.push(behavioral.target);
|
|
451
|
+
}
|
|
412
452
|
group.results.push(result);
|
|
413
453
|
groups.set(key, group);
|
|
414
454
|
}
|
|
@@ -447,12 +487,21 @@ function behaviorDistribution(results, definition) {
|
|
|
447
487
|
source: definition.source
|
|
448
488
|
};
|
|
449
489
|
}
|
|
450
|
-
function groupKey(scenarioId, role, target) {
|
|
451
|
-
return JSON.stringify([
|
|
490
|
+
function groupKey(scenarioId, role, target, varying) {
|
|
491
|
+
return JSON.stringify([
|
|
492
|
+
scenarioId,
|
|
493
|
+
role,
|
|
494
|
+
varying.has("target") ? null : target.id,
|
|
495
|
+
varying.has("wireModel") ? null : target.model
|
|
496
|
+
]);
|
|
452
497
|
}
|
|
453
498
|
function subtractNullable(left, right) {
|
|
454
499
|
return left === null || right === null ? null : left - right;
|
|
455
500
|
}
|
|
501
|
+
function distributionNoiseBand(baseline, candidate) {
|
|
502
|
+
if (baseline.measured < 2 || candidate.measured < 2 || baseline.unmeasured > 0 || candidate.unmeasured > 0) return 0;
|
|
503
|
+
return 2 * Math.sqrt((baseline.variance ?? 0) / (baseline.measured - 1) + (candidate.variance ?? 0) / (candidate.measured - 1));
|
|
504
|
+
}
|
|
456
505
|
|
|
457
506
|
// src/domains/eval/compare/compare.ts
|
|
458
507
|
var EvalServingConfigurationDriftError = class extends Error {
|
|
@@ -510,7 +559,7 @@ function compareEvalArtifactsV4(baseline, candidate, options = {}) {
|
|
|
510
559
|
}
|
|
511
560
|
function renderEvalComparisonV4(summary) {
|
|
512
561
|
const envelopeFailures = summary.envelopeMismatches.map(
|
|
513
|
-
(mismatch) => ` incomparable envelope: ${mismatch.scenarioId} ${mismatch.role} ${mismatch
|
|
562
|
+
(mismatch) => ` incomparable envelope: ${mismatch.scenarioId} ${mismatch.role} ${renderEvalComparisonRoutesV1(mismatch)} fields=${mismatch.fields.join(",")}`
|
|
514
563
|
);
|
|
515
564
|
const affected = summary.affectedCorpusResults.map(
|
|
516
565
|
(result) => ` affected corpus result: ${result.scenarioId} role=${result.role} changed=${result.changedFields.join(",")}`
|
|
@@ -518,7 +567,7 @@ function renderEvalComparisonV4(summary) {
|
|
|
518
567
|
const scenarioReports = renderRollups("per-scenario baseline/candidate report", summary.scenarioReports);
|
|
519
568
|
const roleReports = renderRollups("per-role baseline/candidate report", summary.roleReports);
|
|
520
569
|
const hardFailures = summary.hardGate.failures.map(
|
|
521
|
-
(failure) => ` hard failure: ${failure.scenarioId} ${failure.role} ${failure
|
|
570
|
+
(failure) => ` hard failure: ${failure.scenarioId} ${failure.role} ${renderEvalComparisonRoutesV1(failure)} ${failure.metric} ${failure.change}`
|
|
522
571
|
);
|
|
523
572
|
const tracked = summary.trackedMetrics.flatMap((row, index) => [
|
|
524
573
|
...index === 0 ? [
|
|
@@ -545,13 +594,12 @@ function renderEvalComparisonV4(summary) {
|
|
|
545
594
|
const behavioral = summary.behavioralMetrics.flatMap((row, index) => [
|
|
546
595
|
...index === 0 ? [
|
|
547
596
|
"behavioral metrics:",
|
|
548
|
-
"scenario role
|
|
597
|
+
"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"
|
|
549
598
|
] : [],
|
|
550
599
|
[
|
|
551
600
|
row.scenarioId,
|
|
552
601
|
row.role,
|
|
553
|
-
row
|
|
554
|
-
row.target.model ?? "none",
|
|
602
|
+
renderEvalComparisonRoutesV1(row),
|
|
555
603
|
row.family,
|
|
556
604
|
row.metric,
|
|
557
605
|
formatMetric(row.baseline.mean),
|
|
@@ -562,6 +610,7 @@ function renderEvalComparisonV4(summary) {
|
|
|
562
610
|
`${row.candidate.measured}/${row.candidate.observations}`,
|
|
563
611
|
formatSignedMetric(row.meanDelta),
|
|
564
612
|
formatSignedMetric(row.varianceDelta),
|
|
613
|
+
formatMetric(row.noiseBand),
|
|
565
614
|
row.change,
|
|
566
615
|
row.varianceChange,
|
|
567
616
|
row.comparability.comparable ? "comparable" : `incomparable:${row.comparability.mismatchedFields.join(",")}`,
|
|
@@ -589,6 +638,10 @@ function renderEvalComparisonV4(summary) {
|
|
|
589
638
|
""
|
|
590
639
|
].join("\n");
|
|
591
640
|
}
|
|
641
|
+
function renderEvalComparisonRoutesV1(identity) {
|
|
642
|
+
const render = (targets) => targets.map((target) => `${target.id}/${target.model ?? "none"}`).join(",") || "missing";
|
|
643
|
+
return `${render(identity.baselineTargets ?? [identity.target])} -> ${render(identity.candidateTargets ?? [identity.target])}`;
|
|
644
|
+
}
|
|
592
645
|
function behaviorRollups(rows, keyOf) {
|
|
593
646
|
const groups = /* @__PURE__ */ new Map();
|
|
594
647
|
for (const row of rows) groups.set(keyOf(row), [...groups.get(keyOf(row)) ?? [], row]);
|
|
@@ -848,7 +901,7 @@ function renderEvalComparisonReportV1(summary, format2) {
|
|
|
848
901
|
}
|
|
849
902
|
function renderMarkdown(summary) {
|
|
850
903
|
const rows = summary.behavioralMetrics.map(
|
|
851
|
-
(row) => `| ${cell(row.scenarioId)} | ${cell(row.role)} | ${cell(
|
|
904
|
+
(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"} |`
|
|
852
905
|
);
|
|
853
906
|
const scenarioRows = summary.scenarioReports.map(
|
|
854
907
|
(report) => `| ${cell(report.id)} | ${changeCounts2(report.metrics)} | ${changeCounts2(report.variance)} |`
|
|
@@ -861,10 +914,10 @@ function renderMarkdown(summary) {
|
|
|
861
914
|
"",
|
|
862
915
|
`Behavioral hard gate: **${summary.hardGate.pass ? "pass" : "fail"}**`,
|
|
863
916
|
...summary.hardGate.failures.map(
|
|
864
|
-
(failure) => `- Hard failure: ${failure.scenarioId} / ${failure.role} / ${failure
|
|
917
|
+
(failure) => `- Hard failure: ${failure.scenarioId} / ${failure.role} / ${renderEvalComparisonRoutesV1(failure)} / ${failure.metric}: ${failure.change}`
|
|
865
918
|
),
|
|
866
919
|
...summary.envelopeMismatches.map(
|
|
867
|
-
(mismatch) => `- Incomparable envelope: ${mismatch.scenarioId} / ${mismatch.role} / ${mismatch
|
|
920
|
+
(mismatch) => `- Incomparable envelope: ${mismatch.scenarioId} / ${mismatch.role} / ${renderEvalComparisonRoutesV1(mismatch)}: ${mismatch.fields.join(", ")}`
|
|
868
921
|
),
|
|
869
922
|
...summary.affectedCorpusResults.map(
|
|
870
923
|
(result) => `- Affected corpus result: ${result.scenarioId} / ${result.role}: ${result.changedFields.join(", ")}`
|
|
@@ -873,8 +926,8 @@ function renderMarkdown(summary) {
|
|
|
873
926
|
`Token delta: ${summary.tokenDelta === null ? "unmeasured" : summary.tokenDelta}`,
|
|
874
927
|
`Wall-time delta ms: ${summary.wallTimeDelta}`,
|
|
875
928
|
"",
|
|
876
|
-
"| Scenario | Role |
|
|
877
|
-
"
|
|
929
|
+
"| 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 |",
|
|
930
|
+
"|---|---|---|---|---|---:|---:|---:|---:|---:|---:|---:|---|---|---|---|",
|
|
878
931
|
...rows,
|
|
879
932
|
"",
|
|
880
933
|
"## Per-scenario baseline/candidate report",
|
|
@@ -899,7 +952,7 @@ function renderJunit(summary) {
|
|
|
899
952
|
);
|
|
900
953
|
const represented = /* @__PURE__ */ new Set();
|
|
901
954
|
const cases = summary.behavioralMetrics.map((row) => {
|
|
902
|
-
const name = `${row.scenarioId}[${row.role}:${row
|
|
955
|
+
const name = `${row.scenarioId}[${row.role}:${renderEvalComparisonRoutesV1(row)}].${row.metric}`;
|
|
903
956
|
const key = JSON.stringify([row.scenarioId, row.role, row.target.id, row.target.model, row.metric]);
|
|
904
957
|
represented.add(key);
|
|
905
958
|
const detail = `change=${row.change} variance=${row.varianceChange} baseline=${format(row.baseline.mean)} candidate=${format(row.candidate.mean)}`;
|
|
@@ -914,13 +967,13 @@ function renderJunit(summary) {
|
|
|
914
967
|
failure.metric
|
|
915
968
|
]);
|
|
916
969
|
if (represented.has(key)) continue;
|
|
917
|
-
const name = `${failure.scenarioId}[${failure.role}:${failure
|
|
970
|
+
const name = `${failure.scenarioId}[${failure.role}:${renderEvalComparisonRoutesV1(failure)}].${failure.metric}`;
|
|
918
971
|
cases.push(
|
|
919
972
|
` <testcase classname="eval.behavior.hard" name="${escapeXml(name)}"><failure message="${escapeXml(failure.change)}">hard behavioral gate</failure></testcase>`
|
|
920
973
|
);
|
|
921
974
|
}
|
|
922
975
|
for (const failure of summary.hardGate.envelopeFailures) {
|
|
923
|
-
const name = `${failure.scenarioId}[${failure.role}:${failure
|
|
976
|
+
const name = `${failure.scenarioId}[${failure.role}:${renderEvalComparisonRoutesV1(failure)}].execution-envelope`;
|
|
924
977
|
cases.push(
|
|
925
978
|
` <testcase classname="eval.behavior.envelope" name="${escapeXml(name)}"><failure message="incomparable">${escapeXml(failure.fields.join(", "))}</failure></testcase>`
|
|
926
979
|
);
|
|
@@ -1264,6 +1317,7 @@ function readVerify(value, path, issues) {
|
|
|
1264
1317
|
return {
|
|
1265
1318
|
commands: readOptionalStringArray(value, "commands", `${path}.commands`, issues),
|
|
1266
1319
|
measure: readOptionalStringArray(value, "measure", `${path}.measure`, issues),
|
|
1320
|
+
protectedFiles: readOptionalStringArray(value, "protectedFiles", `${path}.protectedFiles`, issues),
|
|
1267
1321
|
assertions: readAssertions(value.assertions, `${path}.assertions`, issues),
|
|
1268
1322
|
forbidPaths: readOptionalStringArray(value, "forbidPaths", `${path}.forbidPaths`, issues)
|
|
1269
1323
|
};
|
|
@@ -1484,9 +1538,10 @@ function resolveTargets(targets, options) {
|
|
|
1484
1538
|
|
|
1485
1539
|
// src/domains/eval/suites/run.ts
|
|
1486
1540
|
init_esm_shims();
|
|
1487
|
-
import {
|
|
1541
|
+
import { constants } from "node:fs";
|
|
1542
|
+
import { lstat as lstat3, mkdir, mkdtemp as mkdtemp3, open, readdir, realpath, rm as rm3, writeFile } from "node:fs/promises";
|
|
1488
1543
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
1489
|
-
import { resolve as
|
|
1544
|
+
import { isAbsolute as isAbsolute3, relative as relative4, resolve as resolve9, sep as sep3 } from "node:path";
|
|
1490
1545
|
|
|
1491
1546
|
// src/domains/eval/execution-provenance.ts
|
|
1492
1547
|
init_esm_shims();
|
|
@@ -1647,6 +1702,9 @@ function sha256(value) {
|
|
|
1647
1702
|
|
|
1648
1703
|
// src/domains/eval/metrics/context.ts
|
|
1649
1704
|
init_esm_shims();
|
|
1705
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
1706
|
+
import { readFileSync as readFileSync2 } from "node:fs";
|
|
1707
|
+
import { join } from "node:path";
|
|
1650
1708
|
function collectContextMetrics(cwd) {
|
|
1651
1709
|
try {
|
|
1652
1710
|
const codewiki = readCodewiki(cwd);
|
|
@@ -1654,13 +1712,26 @@ function collectContextMetrics(cwd) {
|
|
|
1654
1712
|
const visiblePaths = new Set(enumerateWorkspaceFiles(cwd));
|
|
1655
1713
|
const artifactSourceFiles = codewiki.files.filter((file) => file.lang !== "config");
|
|
1656
1714
|
const indexedFiles = artifactSourceFiles.filter((file) => visiblePaths.has(file.path)).length;
|
|
1657
|
-
|
|
1715
|
+
let contentValidFiles = 0;
|
|
1716
|
+
let missingFiles = 0;
|
|
1717
|
+
for (const file of artifactSourceFiles) {
|
|
1718
|
+
try {
|
|
1719
|
+
const hash = createHash3("sha256").update(readFileSync2(join(cwd, file.path), "utf8")).digest("hex").slice(0, 16);
|
|
1720
|
+
if (visiblePaths.has(file.path) && file.hash === hash) contentValidFiles += 1;
|
|
1721
|
+
} catch (error) {
|
|
1722
|
+
const code = error.code;
|
|
1723
|
+
if (code === "ENOENT" || code === "ENOTDIR") missingFiles += 1;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
const staleFiles = artifactSourceFiles.length - contentValidFiles;
|
|
1658
1727
|
const sourceFiles = detectProjectProfile(cwd).sourceFiles;
|
|
1659
1728
|
const digest = renderCodewikiDigest(codewiki);
|
|
1660
1729
|
return {
|
|
1661
1730
|
"context.indexedFiles": indexedFiles,
|
|
1662
1731
|
"context.artifactFiles": artifactSourceFiles.length,
|
|
1663
1732
|
"context.staleFiles": staleFiles,
|
|
1733
|
+
"context.contentValidFiles": contentValidFiles,
|
|
1734
|
+
"context.missingFiles": missingFiles,
|
|
1664
1735
|
"context.coverage": sourceFiles === 0 ? artifactSourceFiles.length === 0 ? 1 : 0 : indexedFiles / sourceFiles,
|
|
1665
1736
|
"context.structuralHash": structuralCodewikiHash(codewiki),
|
|
1666
1737
|
"context.digestTokens": Math.ceil(digest.length / 4)
|
|
@@ -1670,6 +1741,8 @@ function collectContextMetrics(cwd) {
|
|
|
1670
1741
|
"context.indexedFiles": 0,
|
|
1671
1742
|
"context.artifactFiles": 0,
|
|
1672
1743
|
"context.staleFiles": 0,
|
|
1744
|
+
"context.contentValidFiles": 0,
|
|
1745
|
+
"context.missingFiles": 0,
|
|
1673
1746
|
"context.coverage": 0,
|
|
1674
1747
|
"context.structuralHash": null,
|
|
1675
1748
|
"context.digestTokens": 0
|
|
@@ -1772,13 +1845,13 @@ function isRecord3(value) {
|
|
|
1772
1845
|
|
|
1773
1846
|
// src/domains/eval/metrics/invariants.ts
|
|
1774
1847
|
init_esm_shims();
|
|
1775
|
-
import { existsSync, readdirSync, readFileSync as
|
|
1776
|
-
import { join } from "node:path";
|
|
1848
|
+
import { existsSync, readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
1849
|
+
import { join as join2 } from "node:path";
|
|
1777
1850
|
function readRunJournal(stateDir) {
|
|
1778
1851
|
if (!existsSync(stateDir)) return null;
|
|
1779
1852
|
return {
|
|
1780
|
-
envelopes: readEnvelopes(
|
|
1781
|
-
...readReceipts(
|
|
1853
|
+
envelopes: readEnvelopes(join2(stateDir, "runs.json")),
|
|
1854
|
+
...readReceipts(join2(stateDir, "receipts"))
|
|
1782
1855
|
};
|
|
1783
1856
|
}
|
|
1784
1857
|
function readEnvelopes(runsPath) {
|
|
@@ -1786,7 +1859,7 @@ function readEnvelopes(runsPath) {
|
|
|
1786
1859
|
if (!existsSync(runsPath)) return envelopes;
|
|
1787
1860
|
let parsed;
|
|
1788
1861
|
try {
|
|
1789
|
-
parsed = JSON.parse(
|
|
1862
|
+
parsed = JSON.parse(readFileSync3(runsPath, "utf8"));
|
|
1790
1863
|
} catch {
|
|
1791
1864
|
return envelopes;
|
|
1792
1865
|
}
|
|
@@ -1807,7 +1880,7 @@ function readReceipts(receiptsDir) {
|
|
|
1807
1880
|
const receipts = [];
|
|
1808
1881
|
for (const name of names) {
|
|
1809
1882
|
try {
|
|
1810
|
-
const parsed = JSON.parse(
|
|
1883
|
+
const parsed = JSON.parse(readFileSync3(join2(receiptsDir, name), "utf8"));
|
|
1811
1884
|
if (isReceiptShaped(parsed)) receipts.push(parsed);
|
|
1812
1885
|
} catch {
|
|
1813
1886
|
}
|
|
@@ -1876,7 +1949,7 @@ function isRootReceipt(receipt) {
|
|
|
1876
1949
|
return receipt.lineage === void 0 || receipt.lineage.rootRunId === receipt.runId;
|
|
1877
1950
|
}
|
|
1878
1951
|
function sessionInvariantMetrics(stateDir) {
|
|
1879
|
-
const sessionDirs = findSessionDirs(
|
|
1952
|
+
const sessionDirs = findSessionDirs(join2(stateDir, "sessions"));
|
|
1880
1953
|
if (sessionDirs.length === 0) return {};
|
|
1881
1954
|
let formatVersion = Number.POSITIVE_INFINITY;
|
|
1882
1955
|
let toolPairsUnmatched = 0;
|
|
@@ -1885,7 +1958,7 @@ function sessionInvariantMetrics(stateDir) {
|
|
|
1885
1958
|
let answeredFromPreCompaction = false;
|
|
1886
1959
|
let turnsAfterCompaction = 0;
|
|
1887
1960
|
for (const sessionDir of sessionDirs) {
|
|
1888
|
-
const transcript = readSessionTranscript(
|
|
1961
|
+
const transcript = readSessionTranscript(join2(sessionDir, "current.jsonl"));
|
|
1889
1962
|
formatVersion = Math.min(formatVersion, transcript.formatVersion);
|
|
1890
1963
|
toolPairsUnmatched += transcript.toolPairsUnmatched;
|
|
1891
1964
|
assistantBetweenCallAndResult += transcript.assistantBetweenCallAndResult;
|
|
@@ -1908,10 +1981,10 @@ function findSessionDirs(sessionsRoot) {
|
|
|
1908
1981
|
const dirs = [];
|
|
1909
1982
|
for (const cwdDir of readdirSync(sessionsRoot, { withFileTypes: true })) {
|
|
1910
1983
|
if (!cwdDir.isDirectory()) continue;
|
|
1911
|
-
const cwdPath =
|
|
1984
|
+
const cwdPath = join2(sessionsRoot, cwdDir.name);
|
|
1912
1985
|
try {
|
|
1913
1986
|
for (const sessionDir of readdirSync(cwdPath, { withFileTypes: true })) {
|
|
1914
|
-
if (sessionDir.isDirectory()) dirs.push(
|
|
1987
|
+
if (sessionDir.isDirectory()) dirs.push(join2(cwdPath, sessionDir.name));
|
|
1915
1988
|
}
|
|
1916
1989
|
} catch {
|
|
1917
1990
|
}
|
|
@@ -1924,7 +1997,7 @@ function findSessionDirs(sessionsRoot) {
|
|
|
1924
1997
|
function readSessionTranscript(path) {
|
|
1925
1998
|
let lines;
|
|
1926
1999
|
try {
|
|
1927
|
-
lines =
|
|
2000
|
+
lines = readFileSync3(path, "utf8").split(/\r?\n/u);
|
|
1928
2001
|
} catch {
|
|
1929
2002
|
return {
|
|
1930
2003
|
formatVersion: 0,
|
|
@@ -2044,7 +2117,7 @@ function isProcessAlive(pid) {
|
|
|
2044
2117
|
}
|
|
2045
2118
|
}
|
|
2046
2119
|
function writeBoundaryInvariantMetrics(stateDir) {
|
|
2047
|
-
const files = findWriteBoundaryVerdicts(
|
|
2120
|
+
const files = findWriteBoundaryVerdicts(join2(stateDir, "write-boundaries"));
|
|
2048
2121
|
if (files.length === 0) return {};
|
|
2049
2122
|
let sealed = true;
|
|
2050
2123
|
let violationsDetected = 0;
|
|
@@ -2075,10 +2148,10 @@ function findWriteBoundaryVerdicts(root) {
|
|
|
2075
2148
|
try {
|
|
2076
2149
|
for (const rootDir of readdirSync(root, { withFileTypes: true })) {
|
|
2077
2150
|
if (!rootDir.isDirectory()) continue;
|
|
2078
|
-
const dir =
|
|
2151
|
+
const dir = join2(root, rootDir.name);
|
|
2079
2152
|
try {
|
|
2080
2153
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
2081
|
-
if (entry.isFile() && entry.name.endsWith(".json")) files.push(
|
|
2154
|
+
if (entry.isFile() && entry.name.endsWith(".json")) files.push(join2(dir, entry.name));
|
|
2082
2155
|
}
|
|
2083
2156
|
} catch {
|
|
2084
2157
|
}
|
|
@@ -2090,7 +2163,7 @@ function findWriteBoundaryVerdicts(root) {
|
|
|
2090
2163
|
}
|
|
2091
2164
|
function parseJsonFile(path) {
|
|
2092
2165
|
try {
|
|
2093
|
-
const parsed = JSON.parse(
|
|
2166
|
+
const parsed = JSON.parse(readFileSync3(path, "utf8"));
|
|
2094
2167
|
return isRecord4(parsed) ? parsed : void 0;
|
|
2095
2168
|
} catch {
|
|
2096
2169
|
return void 0;
|
|
@@ -2293,7 +2366,7 @@ function zeroToolCallMetrics() {
|
|
|
2293
2366
|
// src/domains/eval/metrics/tracked.ts
|
|
2294
2367
|
init_esm_shims();
|
|
2295
2368
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
2296
|
-
import { dirname as dirname2, join as
|
|
2369
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
2297
2370
|
function selectEvalLedgerEntries(durable, stream) {
|
|
2298
2371
|
const sessionCalls = assistantCalls(durable).length;
|
|
2299
2372
|
const streamCalls = assistantCalls(stream).length;
|
|
@@ -2317,7 +2390,7 @@ async function readEvalLedgerSnapshot(stateDir) {
|
|
|
2317
2390
|
} catch {
|
|
2318
2391
|
}
|
|
2319
2392
|
try {
|
|
2320
|
-
const manifest = await readFile2(
|
|
2393
|
+
const manifest = await readFile2(join3(dirname2(ref.path), "prompt-manifest.jsonl"), "utf8");
|
|
2321
2394
|
for (const line of manifest.split(/\r?\n/u)) {
|
|
2322
2395
|
const record = parseJsonRecord2(line);
|
|
2323
2396
|
if (record === null) continue;
|
|
@@ -2330,7 +2403,7 @@ async function readEvalLedgerSnapshot(stateDir) {
|
|
|
2330
2403
|
} catch {
|
|
2331
2404
|
}
|
|
2332
2405
|
try {
|
|
2333
|
-
const snapshots = await readFile2(
|
|
2406
|
+
const snapshots = await readFile2(join3(dirname2(ref.path), "context-snapshots.jsonl"), "utf8");
|
|
2334
2407
|
for (const line of snapshots.split(/\r?\n/u)) {
|
|
2335
2408
|
const record = parseJsonRecord2(line);
|
|
2336
2409
|
if (record === null) continue;
|
|
@@ -2583,14 +2656,7 @@ function promptManifestObservation(record) {
|
|
|
2583
2656
|
return contentHash === null ? [] : [{ id: entry.id, contentHash }];
|
|
2584
2657
|
});
|
|
2585
2658
|
const preload = record.projectPreload;
|
|
2586
|
-
const projectPreload =
|
|
2587
|
-
mode: preload.mode,
|
|
2588
|
-
chars: preload.chars,
|
|
2589
|
-
lines: preload.lines,
|
|
2590
|
-
reason: nullableString(preload.reason),
|
|
2591
|
-
nearLimit: preload.nearLimit,
|
|
2592
|
-
label: preload.label
|
|
2593
|
-
} : null;
|
|
2659
|
+
const projectPreload = isProjectPreloadClass(preload) ? preload : null;
|
|
2594
2660
|
return {
|
|
2595
2661
|
systemPromptHash,
|
|
2596
2662
|
thinkingLevel: nullableString(record.thinkingLevel),
|
|
@@ -2614,8 +2680,8 @@ import { isAbsolute, relative, resolve as resolve2, sep } from "node:path";
|
|
|
2614
2680
|
|
|
2615
2681
|
// src/domains/eval/metrics/evidence.ts
|
|
2616
2682
|
init_esm_shims();
|
|
2617
|
-
import { readFileSync as
|
|
2618
|
-
import { join as
|
|
2683
|
+
import { readFileSync as readFileSync4 } from "node:fs";
|
|
2684
|
+
import { join as join4 } from "node:path";
|
|
2619
2685
|
function dispatchScopeMetrics(receipt) {
|
|
2620
2686
|
const scope = receipt.pathScope;
|
|
2621
2687
|
if (scope === void 0) return {};
|
|
@@ -2679,7 +2745,7 @@ function evidenceTrustMetrics(receipt, envelope) {
|
|
|
2679
2745
|
}
|
|
2680
2746
|
function readRunEnvelopeForReceipt(receipt, stateDir) {
|
|
2681
2747
|
try {
|
|
2682
|
-
const parsed = JSON.parse(
|
|
2748
|
+
const parsed = JSON.parse(readFileSync4(join4(stateDir, "runs.json"), "utf8"));
|
|
2683
2749
|
if (!Array.isArray(parsed)) return null;
|
|
2684
2750
|
const row = parsed.find(
|
|
2685
2751
|
(entry) => typeof entry === "object" && entry !== null && entry.id === receipt.runId
|
|
@@ -3016,6 +3082,7 @@ var OUTPUT_HEAD_LIMIT = 2e4;
|
|
|
3016
3082
|
var OUTPUT_TRUNCATION_MARKER = "\n[output middle truncated; tail preserved]\n";
|
|
3017
3083
|
var METRIC_JSONL_LIMIT = 256e3;
|
|
3018
3084
|
var METRIC_JSONL_LINE_LIMIT = 64e3;
|
|
3085
|
+
var TIMEOUT_KILL_GRACE_MS = 5e3;
|
|
3019
3086
|
async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
|
|
3020
3087
|
const runnerCommands = runner.commands ?? [];
|
|
3021
3088
|
const commands = runnerCommands.length > 0 ? runnerCommands : runner.command === void 0 ? [] : [runner.command];
|
|
@@ -3075,7 +3142,7 @@ async function runExternalCommandRunner(runner, cwd, timeoutMs, env) {
|
|
|
3075
3142
|
}
|
|
3076
3143
|
function runShellCommand(command, cwd, timeoutMs, env) {
|
|
3077
3144
|
const started = performance2.now();
|
|
3078
|
-
return new Promise((
|
|
3145
|
+
return new Promise((resolve11) => {
|
|
3079
3146
|
let stdout = "";
|
|
3080
3147
|
let stderr = "";
|
|
3081
3148
|
const metricCapture = createJsonlMetricCapture();
|
|
@@ -3085,14 +3152,10 @@ function runShellCommand(command, cwd, timeoutMs, env) {
|
|
|
3085
3152
|
const callLedgerFold = createEvalCallLedgerFold();
|
|
3086
3153
|
let timedOut = false;
|
|
3087
3154
|
let settled = false;
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
// The overlay is additive: an eval item pins where Clio writes its
|
|
3093
|
-
// journal, and inherits everything else the operator's shell provides.
|
|
3094
|
-
env: env === void 0 ? process.env : { ...process.env, ...env }
|
|
3095
|
-
});
|
|
3155
|
+
const spawnEnv = env === void 0 ? process.env : { ...process.env, ...env };
|
|
3156
|
+
const [file, args, shell] = typeof command === "string" ? [command, [], true] : [command[0], command.slice(1), false];
|
|
3157
|
+
const child = spawn(file, args, { cwd, shell, stdio: ["ignore", "pipe", "pipe"], env: spawnEnv });
|
|
3158
|
+
const commandLine = typeof command === "string" ? command : command.join(" ");
|
|
3096
3159
|
child.stdout.setEncoding("utf8");
|
|
3097
3160
|
child.stderr.setEncoding("utf8");
|
|
3098
3161
|
child.stdout.on("data", (chunk) => {
|
|
@@ -3109,14 +3172,14 @@ function runShellCommand(command, cwd, timeoutMs, env) {
|
|
|
3109
3172
|
const timer = setTimeout(() => {
|
|
3110
3173
|
timedOut = true;
|
|
3111
3174
|
child.kill("SIGTERM");
|
|
3112
|
-
setTimeout(() => child.kill("SIGKILL"),
|
|
3175
|
+
setTimeout(() => child.kill("SIGKILL"), TIMEOUT_KILL_GRACE_MS);
|
|
3113
3176
|
}, timeoutMs);
|
|
3114
3177
|
const finish = (exitCode) => {
|
|
3115
3178
|
if (settled) return;
|
|
3116
3179
|
settled = true;
|
|
3117
3180
|
clearTimeout(timer);
|
|
3118
|
-
|
|
3119
|
-
command,
|
|
3181
|
+
resolve11({
|
|
3182
|
+
command: commandLine,
|
|
3120
3183
|
exitCode,
|
|
3121
3184
|
stdout,
|
|
3122
3185
|
metricJsonl: metricCapture.finish(),
|
|
@@ -3252,18 +3315,19 @@ function stringField(record, field) {
|
|
|
3252
3315
|
async function runClioRunRunner(runner, cwd, clioEntry, timeoutMs, target, env, readObservation) {
|
|
3253
3316
|
const prompt = runner.prompt ?? "";
|
|
3254
3317
|
const args = [
|
|
3255
|
-
|
|
3318
|
+
process.execPath,
|
|
3319
|
+
clioEntry,
|
|
3256
3320
|
"run",
|
|
3257
3321
|
"--json",
|
|
3258
|
-
...runner.agent === void 0 ? [] : ["--agent",
|
|
3322
|
+
...runner.agent === void 0 ? [] : ["--agent", runner.agent],
|
|
3259
3323
|
"--target",
|
|
3260
|
-
|
|
3261
|
-
...target.model === void 0 ? [] : ["--model",
|
|
3262
|
-
...target.thinking === void 0 ? [] : ["--thinking",
|
|
3324
|
+
target.id,
|
|
3325
|
+
...target.model === void 0 ? [] : ["--model", target.model],
|
|
3326
|
+
...target.thinking === void 0 ? [] : ["--thinking", target.thinking],
|
|
3263
3327
|
...runner.autonomy === void 0 ? [] : ["--autonomy", runner.autonomy],
|
|
3264
|
-
|
|
3328
|
+
prompt
|
|
3265
3329
|
];
|
|
3266
|
-
const result = await runShellCommand(
|
|
3330
|
+
const result = await runShellCommand(args, cwd, runner.timeoutMs ?? timeoutMs, env);
|
|
3267
3331
|
const tokens = result.usage;
|
|
3268
3332
|
const toolMetricStream = result.metricJsonl.length > 0 ? result.metricJsonl : result.stdout;
|
|
3269
3333
|
const tools = toolCallMetricsFromJsonl(toolMetricStream);
|
|
@@ -3384,19 +3448,22 @@ function toolBehaviorMetricEntriesFromJsonl(stdout, cwd, readObservation) {
|
|
|
3384
3448
|
const terminals = canonicalFinishes.length > 0 ? canonicalFinishes : executionEnds;
|
|
3385
3449
|
const calls = /* @__PURE__ */ new Map();
|
|
3386
3450
|
const succeeded = /* @__PURE__ */ new Map();
|
|
3451
|
+
const failed = /* @__PURE__ */ new Map();
|
|
3387
3452
|
const blocked = /* @__PURE__ */ new Map();
|
|
3388
3453
|
for (const terminal of terminals) {
|
|
3389
3454
|
const tool = metricToolName(terminal.tool);
|
|
3390
3455
|
calls.set(tool, (calls.get(tool) ?? 0) + 1);
|
|
3391
3456
|
if (terminal.outcome === "ok") succeeded.set(tool, (succeeded.get(tool) ?? 0) + 1);
|
|
3392
3457
|
if (terminal.outcome === "blocked") blocked.set(tool, (blocked.get(tool) ?? 0) + 1);
|
|
3458
|
+
if (terminal.outcome === "error") failed.set(tool, (failed.get(tool) ?? 0) + 1);
|
|
3393
3459
|
}
|
|
3394
|
-
const namedTools = /* @__PURE__ */ new Set([
|
|
3460
|
+
const namedTools = /* @__PURE__ */ new Set([...ALL_TOOL_NAMES, ...calls.keys()]);
|
|
3395
3461
|
const entries = { "tools.read.distinctPaths": readPaths.size };
|
|
3396
3462
|
for (const tool of [...namedTools].sort()) {
|
|
3397
3463
|
entries[`tools.calls.${tool}`] = calls.get(tool) ?? 0;
|
|
3398
3464
|
entries[`tools.succeeded.${tool}`] = succeeded.get(tool) ?? 0;
|
|
3399
3465
|
entries[`tools.blocked.${tool}`] = blocked.get(tool) ?? 0;
|
|
3466
|
+
entries[`tools.failed.${tool}`] = failed.get(tool) ?? 0;
|
|
3400
3467
|
}
|
|
3401
3468
|
if (readObservation !== void 0) {
|
|
3402
3469
|
const allowed = readObservation.allowedPaths.map((path) => normalizeObservedPath(cwd, path));
|
|
@@ -3449,12 +3516,8 @@ function isRecord9(value) {
|
|
|
3449
3516
|
// src/domains/eval/runners/context-index.ts
|
|
3450
3517
|
init_esm_shims();
|
|
3451
3518
|
async function runContextIndexRunner(cwd, clioEntry, timeoutMs, target, env) {
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3454
|
-
cwd,
|
|
3455
|
-
timeoutMs,
|
|
3456
|
-
env
|
|
3457
|
-
);
|
|
3519
|
+
const args = [process.execPath, clioEntry, "context", "index", "--json"];
|
|
3520
|
+
const result = await runShellCommand(args, cwd, timeoutMs, env);
|
|
3458
3521
|
const parsed = parseContextIndexOutput(result.stdout);
|
|
3459
3522
|
return {
|
|
3460
3523
|
assignmentId: null,
|
|
@@ -3493,10 +3556,10 @@ function parseContextIndexOutput(stdout) {
|
|
|
3493
3556
|
// src/domains/eval/runners/context-init.ts
|
|
3494
3557
|
init_esm_shims();
|
|
3495
3558
|
import { existsSync as existsSync2, statSync } from "node:fs";
|
|
3496
|
-
import { join as
|
|
3559
|
+
import { join as join5 } from "node:path";
|
|
3497
3560
|
async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, env) {
|
|
3498
3561
|
const extraArgs = runner.args ?? [];
|
|
3499
|
-
const
|
|
3562
|
+
const args = [
|
|
3500
3563
|
process.execPath,
|
|
3501
3564
|
clioEntry,
|
|
3502
3565
|
"context",
|
|
@@ -3508,8 +3571,8 @@ async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, e
|
|
|
3508
3571
|
...target.model === void 0 ? [] : ["--model", target.model],
|
|
3509
3572
|
...target.thinking === void 0 ? [] : ["--thinking", target.thinking],
|
|
3510
3573
|
...extraArgs
|
|
3511
|
-
]
|
|
3512
|
-
const result = await runShellCommand(
|
|
3574
|
+
];
|
|
3575
|
+
const result = await runShellCommand(args, cwd, runner.timeoutMs ?? timeoutMs, env);
|
|
3513
3576
|
const payload = parseInitPayload(result.stdout);
|
|
3514
3577
|
const candidateGeneration = recordField2(payload, "generation");
|
|
3515
3578
|
const generation = isValidGenerationPayload(payload, candidateGeneration) ? candidateGeneration : null;
|
|
@@ -3526,7 +3589,7 @@ async function runContextInitRunner(runner, cwd, clioEntry, timeoutMs, target, e
|
|
|
3526
3589
|
const effectiveRuntimeKind = stringField3(run, "runtimeKind");
|
|
3527
3590
|
const effectiveThinking = stringField3(run, "thinkingLevel");
|
|
3528
3591
|
const structuredOutputMode = stringField3(run, "structuredOutputMode");
|
|
3529
|
-
const clioMdPath =
|
|
3592
|
+
const clioMdPath = join5(cwd, "CLIO-CODER.md");
|
|
3530
3593
|
const clioMdBytes = existsSync2(clioMdPath) ? statSync(clioMdPath).size : 0;
|
|
3531
3594
|
return {
|
|
3532
3595
|
assignmentId: null,
|
|
@@ -3663,7 +3726,7 @@ function stringField3(value, field) {
|
|
|
3663
3726
|
|
|
3664
3727
|
// src/domains/eval/schema/adapter.ts
|
|
3665
3728
|
init_esm_shims();
|
|
3666
|
-
import { createHash as
|
|
3729
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
3667
3730
|
function adaptSuiteV2ResultToVerdictV1(result, trackedMetrics) {
|
|
3668
3731
|
const machinery = result.pass || result.failureClass === "grader_failed" ? "ok" : "infrastructure_failure";
|
|
3669
3732
|
const outcome = result.pass ? "pass" : "fail";
|
|
@@ -3697,7 +3760,7 @@ function adaptSuiteV2ResultToBehaviorV1(result, verdict, scenario) {
|
|
|
3697
3760
|
observedSources.add(source);
|
|
3698
3761
|
if (!requestedFacts.has(`${source}\0${key}`)) return [];
|
|
3699
3762
|
const serialized = JSON.stringify({ source, key, value });
|
|
3700
|
-
const digest =
|
|
3763
|
+
const digest = createHash4("sha256").update(serialized, "utf8").digest("hex");
|
|
3701
3764
|
const fact = {
|
|
3702
3765
|
id: `metric-${digest.slice(0, 16)}`,
|
|
3703
3766
|
source,
|
|
@@ -3752,12 +3815,93 @@ function forbiddenPathHits(cwd, paths) {
|
|
|
3752
3815
|
return paths.filter((path) => existsSync3(resolve3(cwd, path)));
|
|
3753
3816
|
}
|
|
3754
3817
|
|
|
3818
|
+
// src/domains/eval/verifiers/integrity.ts
|
|
3819
|
+
init_esm_shims();
|
|
3820
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
3821
|
+
import { lstat, readFile as readFile3 } from "node:fs/promises";
|
|
3822
|
+
import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve4, sep as sep2 } from "node:path";
|
|
3823
|
+
var EvalGraderIntegrityError = class extends Error {
|
|
3824
|
+
};
|
|
3825
|
+
async function protectGraderFiles(cwd, files) {
|
|
3826
|
+
const paths = files.map((file) => {
|
|
3827
|
+
const path = resolve4(cwd, file);
|
|
3828
|
+
const rel = relative2(cwd, path);
|
|
3829
|
+
if (isAbsolute2(file) || rel === ".." || rel.startsWith(`..${sep2}`))
|
|
3830
|
+
throw new EvalGraderIntegrityError(`grader dependency escapes workspace: ${file}`);
|
|
3831
|
+
return path;
|
|
3832
|
+
});
|
|
3833
|
+
const fingerprint = async (path) => {
|
|
3834
|
+
let current = path;
|
|
3835
|
+
while (current !== resolve4(cwd)) {
|
|
3836
|
+
if ((await lstat(current)).isSymbolicLink())
|
|
3837
|
+
throw new EvalGraderIntegrityError(`grader dependency is a symlink: ${path}`);
|
|
3838
|
+
current = resolve4(current, "..");
|
|
3839
|
+
}
|
|
3840
|
+
return createHash5("sha256").update(await readFile3(path)).digest("hex");
|
|
3841
|
+
};
|
|
3842
|
+
const hashes = await Promise.all(paths.map(fingerprint));
|
|
3843
|
+
return async () => {
|
|
3844
|
+
for (const [index, path] of paths.entries()) {
|
|
3845
|
+
try {
|
|
3846
|
+
if (await fingerprint(path) === hashes[index]) continue;
|
|
3847
|
+
} catch {
|
|
3848
|
+
}
|
|
3849
|
+
throw new EvalGraderIntegrityError(`grader dependency changed during trial: ${relative2(cwd, path)}`);
|
|
3850
|
+
}
|
|
3851
|
+
};
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3755
3854
|
// src/domains/eval/verifiers/patch.ts
|
|
3756
3855
|
init_esm_shims();
|
|
3757
3856
|
import { spawnSync } from "node:child_process";
|
|
3857
|
+
import { createHash as createHash6 } from "node:crypto";
|
|
3858
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync5, readlinkSync } from "node:fs";
|
|
3859
|
+
import { join as join6, resolve as resolve5 } from "node:path";
|
|
3860
|
+
var baselines = /* @__PURE__ */ new Map();
|
|
3861
|
+
function recordPatchBaseline(cwd) {
|
|
3862
|
+
baselines.set(resolve5(cwd), snapshotFiles(cwd));
|
|
3863
|
+
}
|
|
3864
|
+
function forgetPatchBaseline(cwd) {
|
|
3865
|
+
baselines.delete(resolve5(cwd));
|
|
3866
|
+
}
|
|
3867
|
+
function snapshotFiles(cwd) {
|
|
3868
|
+
const files = /* @__PURE__ */ new Map();
|
|
3869
|
+
function walk(dir, prefix) {
|
|
3870
|
+
for (const entry of readdirSync2(dir, { withFileTypes: true })) {
|
|
3871
|
+
if (entry.name === ".git") continue;
|
|
3872
|
+
const path = join6(dir, entry.name);
|
|
3873
|
+
const relative5 = prefix + entry.name;
|
|
3874
|
+
if (entry.isDirectory()) walk(path, `${relative5}/`);
|
|
3875
|
+
else if (entry.isFile() || entry.isSymbolicLink()) {
|
|
3876
|
+
const bytes = entry.isSymbolicLink() ? Buffer.from(readlinkSync(path)) : readFileSync5(path);
|
|
3877
|
+
files.set(relative5, {
|
|
3878
|
+
hash: createHash6("sha256").update(entry.isSymbolicLink() ? "link:" : "file:").update(bytes).digest("hex"),
|
|
3879
|
+
bytes: bytes.length
|
|
3880
|
+
});
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
}
|
|
3884
|
+
walk(cwd, "");
|
|
3885
|
+
return files;
|
|
3886
|
+
}
|
|
3758
3887
|
function collectPatchMetrics(cwd) {
|
|
3888
|
+
const baseline = baselines.get(resolve5(cwd));
|
|
3889
|
+
if (baseline !== void 0) {
|
|
3890
|
+
const current = snapshotFiles(cwd);
|
|
3891
|
+
const changed = [.../* @__PURE__ */ new Set([...baseline.keys(), ...current.keys()])].filter(
|
|
3892
|
+
(path) => baseline.get(path)?.hash !== current.get(path)?.hash
|
|
3893
|
+
);
|
|
3894
|
+
return {
|
|
3895
|
+
// For hash baselines this is changed file content bytes, including deleted
|
|
3896
|
+
// content, rather than a textual Git diff (which cannot represent all files).
|
|
3897
|
+
bytes: changed.reduce((sum2, path) => sum2 + (current.get(path)?.bytes ?? baseline.get(path)?.bytes ?? 0), 0),
|
|
3898
|
+
filesChanged: changed.length,
|
|
3899
|
+
testFilesModified: changed.filter((file) => /(^|\/)(test|tests|spec|__tests__)(\/|$)|\.(test|spec)\./.test(file)).length
|
|
3900
|
+
};
|
|
3901
|
+
}
|
|
3759
3902
|
const diff = spawnSync("git", ["diff", "--", "."], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] });
|
|
3760
|
-
|
|
3903
|
+
if (diff.status !== 0 || typeof diff.stdout !== "string") return null;
|
|
3904
|
+
const text = diff.stdout;
|
|
3761
3905
|
const files = text.split(/\r?\n/).filter((line) => line.startsWith("diff --git ")).map((line) => line.split(" b/")[1] ?? "");
|
|
3762
3906
|
return {
|
|
3763
3907
|
bytes: Buffer.byteLength(text, "utf8"),
|
|
@@ -3771,10 +3915,10 @@ init_esm_shims();
|
|
|
3771
3915
|
import { spawn as spawn2 } from "node:child_process";
|
|
3772
3916
|
import { mkdtemp, rm } from "node:fs/promises";
|
|
3773
3917
|
import { tmpdir } from "node:os";
|
|
3774
|
-
import { resolve as
|
|
3918
|
+
import { resolve as resolve6 } from "node:path";
|
|
3775
3919
|
async function prepareGitWorkspace(workspace) {
|
|
3776
3920
|
if (workspace.url === void 0) throw new Error("git workspace requires url");
|
|
3777
|
-
const dest = await mkdtemp(
|
|
3921
|
+
const dest = await mkdtemp(resolve6(tmpdir(), "clio-coder-eval-git-"));
|
|
3778
3922
|
try {
|
|
3779
3923
|
await runGit(["clone", "--quiet", workspace.url, dest], process.cwd());
|
|
3780
3924
|
const ref = workspace.checkout ?? workspace.commit;
|
|
@@ -3809,9 +3953,9 @@ function runGit(args, cwd) {
|
|
|
3809
3953
|
// src/domains/eval/workspaces/local.ts
|
|
3810
3954
|
init_esm_shims();
|
|
3811
3955
|
import { access } from "node:fs/promises";
|
|
3812
|
-
import { resolve as
|
|
3956
|
+
import { resolve as resolve7 } from "node:path";
|
|
3813
3957
|
async function prepareLocalWorkspace(baseDir, workspace) {
|
|
3814
|
-
const dir =
|
|
3958
|
+
const dir = resolve7(baseDir, workspace.path ?? ".");
|
|
3815
3959
|
await access(dir);
|
|
3816
3960
|
return { dir, cleanup: async () => {
|
|
3817
3961
|
} };
|
|
@@ -3820,26 +3964,28 @@ async function prepareLocalWorkspace(baseDir, workspace) {
|
|
|
3820
3964
|
// src/domains/eval/workspaces/temp-copy.ts
|
|
3821
3965
|
init_esm_shims();
|
|
3822
3966
|
import { execFile } from "node:child_process";
|
|
3823
|
-
import { cp, lstat, mkdtemp as mkdtemp2, rm as rm2 } from "node:fs/promises";
|
|
3967
|
+
import { cp, lstat as lstat2, mkdtemp as mkdtemp2, rm as rm2 } from "node:fs/promises";
|
|
3824
3968
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
3825
|
-
import { relative as
|
|
3969
|
+
import { relative as relative3, resolve as resolve8 } from "node:path";
|
|
3826
3970
|
import { promisify } from "node:util";
|
|
3827
3971
|
var execFileAsync = promisify(execFile);
|
|
3828
3972
|
var GIT_FILE_LIST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
3829
3973
|
async function prepareTempCopyWorkspace(baseDir, workspace, options = {}) {
|
|
3830
|
-
const source =
|
|
3831
|
-
const dest = await mkdtemp2(
|
|
3974
|
+
const source = resolve8(baseDir, workspace.path ?? ".");
|
|
3975
|
+
const dest = await mkdtemp2(resolve8(options.tempRoot ?? tmpdir2(), "clio-coder-eval-workspace-"));
|
|
3832
3976
|
try {
|
|
3833
3977
|
const selection = await gitCopySelection(source);
|
|
3834
3978
|
const excludes = workspace.excludes ?? [];
|
|
3835
3979
|
const copyWorkspace = options.copy ?? defaultCopy;
|
|
3836
3980
|
await copyWorkspace(source, dest, {
|
|
3837
3981
|
recursive: true,
|
|
3838
|
-
filter: (path) => shouldCopy(
|
|
3982
|
+
filter: (path) => shouldCopy(relative3(source, path), excludes, selection)
|
|
3839
3983
|
});
|
|
3984
|
+
recordPatchBaseline(dest);
|
|
3840
3985
|
return {
|
|
3841
3986
|
dir: dest,
|
|
3842
3987
|
cleanup: async () => {
|
|
3988
|
+
forgetPatchBaseline(dest);
|
|
3843
3989
|
await rm2(dest, { recursive: true, force: true });
|
|
3844
3990
|
}
|
|
3845
3991
|
};
|
|
@@ -3912,16 +4058,16 @@ function normalizeGitPath(path) {
|
|
|
3912
4058
|
return normalized;
|
|
3913
4059
|
}
|
|
3914
4060
|
async function hasGitMarker(source) {
|
|
3915
|
-
let current =
|
|
4061
|
+
let current = resolve8(source);
|
|
3916
4062
|
while (true) {
|
|
3917
4063
|
try {
|
|
3918
|
-
await
|
|
4064
|
+
await lstat2(resolve8(current, ".git"));
|
|
3919
4065
|
return true;
|
|
3920
4066
|
} catch (error) {
|
|
3921
4067
|
const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
3922
4068
|
if (code !== "ENOENT" && code !== "ENOTDIR") throw error;
|
|
3923
4069
|
}
|
|
3924
|
-
const parent =
|
|
4070
|
+
const parent = resolve8(current, "..");
|
|
3925
4071
|
if (parent === current) return false;
|
|
3926
4072
|
current = parent;
|
|
3927
4073
|
}
|
|
@@ -3968,7 +4114,8 @@ async function runEvalSuiteV2(loaded, options) {
|
|
|
3968
4114
|
item.repeatIndex,
|
|
3969
4115
|
options.clioEntry,
|
|
3970
4116
|
options.freshWorkspaces === true,
|
|
3971
|
-
options.tempCopy
|
|
4117
|
+
options.tempCopy,
|
|
4118
|
+
resolve9(clioDataDir(), "evals", evalId, "transcripts", String(results.length))
|
|
3972
4119
|
);
|
|
3973
4120
|
spentUsd += resultCostUsd(completed.result);
|
|
3974
4121
|
results.push(completed.result);
|
|
@@ -4005,27 +4152,33 @@ function budgetExhaustedResult(loaded, task, target, repeatIndex, spentUsd, maxC
|
|
|
4005
4152
|
attachExecutionEnvelope(result, task, target, loaded.baseDir, null, emptyLedgerSnapshot());
|
|
4006
4153
|
return result;
|
|
4007
4154
|
}
|
|
4008
|
-
async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, freshWorkspace, tempCopy) {
|
|
4155
|
+
async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, freshWorkspace, tempCopy, transcriptDir) {
|
|
4009
4156
|
let workspace = null;
|
|
4010
4157
|
let receipt = null;
|
|
4011
4158
|
let runnerWallTimeMs = 0;
|
|
4159
|
+
let runnerEvidence = null;
|
|
4160
|
+
let retention;
|
|
4012
4161
|
let executionObservation;
|
|
4013
|
-
const stateDir = await mkdtemp3(
|
|
4162
|
+
const stateDir = await mkdtemp3(resolve9(tempCopy?.tempRoot ?? tmpdir3(), "clio-coder-eval-state-"));
|
|
4014
4163
|
try {
|
|
4015
4164
|
workspace = await prepareWorkspace(loaded.baseDir, task, freshWorkspace, tempCopy);
|
|
4016
4165
|
const setup = await runCommandVerifiers(task.workspace.setup ?? [], workspace.dir, task.timeoutMs);
|
|
4017
4166
|
if (!setup.pass) throw new EvalWorkspaceSetupError(setup.exitCode, setup.stderr);
|
|
4167
|
+
if (task.workspace.kind !== "local" || freshWorkspace) recordPatchBaseline(workspace.dir);
|
|
4168
|
+
const checkGraderIntegrity = await protectGraderFiles(workspace.dir, task.verify.protectedFiles ?? []);
|
|
4018
4169
|
const runner = await runTaskRunner(task, target, workspace.dir, clioEntry, {
|
|
4019
4170
|
CLIO_CODER_STATE_DIR: stateDir,
|
|
4020
4171
|
CLIO_CODER_ENTRY: clioEntry
|
|
4021
4172
|
});
|
|
4022
|
-
|
|
4023
|
-
await writeFile(runnerStdoutFile, runner.stdout, "utf8");
|
|
4173
|
+
runnerEvidence = runner;
|
|
4024
4174
|
receipt = runner.receipt ?? null;
|
|
4025
4175
|
runnerWallTimeMs = runner.wallTimeMs;
|
|
4176
|
+
const runnerStdoutFile = resolve9(stateDir, "eval-runner-output.jsonl");
|
|
4177
|
+
await writeFile(runnerStdoutFile, runner.stdout, { encoding: "utf8", mode: 384, flag: "wx" });
|
|
4026
4178
|
const patch = collectPatchMetrics(workspace.dir);
|
|
4027
4179
|
const receiptExitCode = runner.exitCode;
|
|
4028
4180
|
const journalMetrics = invariantMetrics(stateDir, receiptExitCode);
|
|
4181
|
+
await checkGraderIntegrity();
|
|
4029
4182
|
const measurement = await measureTaskOutcome(task, workspace.dir, {
|
|
4030
4183
|
...namingCompatibilityEnvironment(
|
|
4031
4184
|
"CLIO_CODER_EVAL_RUNNER_STDOUT_FILE",
|
|
@@ -4044,14 +4197,18 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4044
4197
|
// The one reading that needs both sides: what the loop reported it
|
|
4045
4198
|
// spent, and what the journal shows it sealed.
|
|
4046
4199
|
...fleetLoopReceiptAgreement(runner.metrics, journalMetrics),
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4200
|
+
...patch === null ? {} : {
|
|
4201
|
+
"patch.bytes": patch.bytes,
|
|
4202
|
+
"patch.filesChanged": patch.filesChanged,
|
|
4203
|
+
"patch.testFilesModified": patch.testFilesModified
|
|
4204
|
+
},
|
|
4050
4205
|
"result.pass": runner.exitCode === 0,
|
|
4051
4206
|
"result.failureClass": runner.exitCode === 0 ? null : "runner_failed",
|
|
4052
4207
|
...measurement.metrics
|
|
4053
4208
|
};
|
|
4209
|
+
await checkGraderIntegrity();
|
|
4054
4210
|
const verifier = await runVerifiers(task, workspace.dir, metrics);
|
|
4211
|
+
await checkGraderIntegrity();
|
|
4055
4212
|
const graderFailed = metrics["task.solved"] === false;
|
|
4056
4213
|
const pass = runner.exitCode === 0 && verifier.pass && !graderFailed;
|
|
4057
4214
|
const failureClass = pass ? null : runner.exitCode !== 0 ? "runner_failed" : !verifier.pass ? verifier.failureClass : "grader_failed";
|
|
@@ -4074,7 +4231,10 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4074
4231
|
...verifier.stderr.length > 0 ? { verifierStderr: verifier.stderr } : {}
|
|
4075
4232
|
}
|
|
4076
4233
|
};
|
|
4077
|
-
|
|
4234
|
+
retention ??= retainSessionLedgers(stateDir, transcriptDir, runnerEvidence?.stdout);
|
|
4235
|
+
const retained = await retention;
|
|
4236
|
+
applyRetainedSessionLedgers(result, retained);
|
|
4237
|
+
const snapshot = retained.errors.length > 0 ? emptyLedgerSnapshot() : await readEvalLedgerSnapshot(stateDir);
|
|
4078
4238
|
const selected = selectEvalLedgerEntries(snapshot.entries, runner.ledgerEntries ?? []);
|
|
4079
4239
|
result.artifacts.trackedMetricSources = JSON.stringify({
|
|
4080
4240
|
assistantCalls: selected.source,
|
|
@@ -4103,10 +4263,10 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4103
4263
|
serving: evalServingObservationFrom(target, receipt ?? null, snapshot.compiledPromptHashes)
|
|
4104
4264
|
};
|
|
4105
4265
|
} catch (error) {
|
|
4106
|
-
const failureClass = error instanceof EvalWorkspaceSetupError ? "setup_failed" : "command_error";
|
|
4266
|
+
const failureClass = error instanceof EvalGraderIntegrityError ? "grader_integrity" : error instanceof EvalWorkspaceSetupError ? "setup_failed" : "command_error";
|
|
4107
4267
|
const result = {
|
|
4108
|
-
assignmentId: null,
|
|
4109
|
-
terminalReceiptDigest: null,
|
|
4268
|
+
assignmentId: runnerEvidence?.assignmentId ?? null,
|
|
4269
|
+
terminalReceiptDigest: runnerEvidence?.terminalReceiptDigest ?? null,
|
|
4110
4270
|
taskId: task.id,
|
|
4111
4271
|
repeatIndex,
|
|
4112
4272
|
target: { id: target.id, model: target.model ?? null, thinking: target.thinking ?? null },
|
|
@@ -4119,11 +4279,15 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4119
4279
|
"latency.wallMs": 0
|
|
4120
4280
|
},
|
|
4121
4281
|
artifacts: {
|
|
4282
|
+
...runnerEvidence?.artifacts,
|
|
4122
4283
|
error: error instanceof Error ? error.message : String(error),
|
|
4123
4284
|
...workspace === null ? {} : { workspace: workspace.dir }
|
|
4124
4285
|
}
|
|
4125
4286
|
};
|
|
4126
|
-
|
|
4287
|
+
retention ??= retainSessionLedgers(stateDir, transcriptDir, runnerEvidence?.stdout);
|
|
4288
|
+
const retained = await retention;
|
|
4289
|
+
applyRetainedSessionLedgers(result, retained);
|
|
4290
|
+
const snapshot = retained.errors.length > 0 ? emptyLedgerSnapshot() : await readEvalLedgerSnapshot(stateDir);
|
|
4127
4291
|
result.verdict = adaptSuiteV2ResultToVerdictV1(
|
|
4128
4292
|
result,
|
|
4129
4293
|
buildEvalTrackedMetrics({
|
|
@@ -4148,6 +4312,7 @@ async function runMatrixItem(loaded, task, target, repeatIndex, clioEntry, fresh
|
|
|
4148
4312
|
};
|
|
4149
4313
|
} finally {
|
|
4150
4314
|
try {
|
|
4315
|
+
if (workspace !== null) forgetPatchBaseline(workspace.dir);
|
|
4151
4316
|
await workspace?.cleanup();
|
|
4152
4317
|
} finally {
|
|
4153
4318
|
await rm3(stateDir, { recursive: true, force: true });
|
|
@@ -4337,6 +4502,128 @@ function nullableNonNegativeInteger(value) {
|
|
|
4337
4502
|
function stringArray(value) {
|
|
4338
4503
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
4339
4504
|
}
|
|
4505
|
+
function applyRetainedSessionLedgers(result, retained) {
|
|
4506
|
+
if (retained.runnerStdoutPath !== void 0) result.artifacts.runnerStdoutFile = retained.runnerStdoutPath;
|
|
4507
|
+
if (retained.paths.length > 0 || retained.errors.length > 0) result.artifacts.sessionLedgers = retained.paths;
|
|
4508
|
+
if (retained.errors.length === 0) return;
|
|
4509
|
+
result.artifacts.sessionLedgerErrors = retained.errors;
|
|
4510
|
+
result.metrics["evidence.retentionComplete"] = false;
|
|
4511
|
+
if (result.pass || result.failureClass === "grader_failed") {
|
|
4512
|
+
result.artifacts.outcomeBeforeEvidenceFailure = result.failureClass ?? "pass";
|
|
4513
|
+
result.pass = false;
|
|
4514
|
+
result.failureClass = "evidence_integrity";
|
|
4515
|
+
result.metrics["result.pass"] = false;
|
|
4516
|
+
result.metrics["result.failureClass"] = "evidence_integrity";
|
|
4517
|
+
}
|
|
4518
|
+
}
|
|
4519
|
+
async function plainLedgerPath(root, path) {
|
|
4520
|
+
const rel = relative4(root, path);
|
|
4521
|
+
if (isAbsolute3(rel) || rel === ".." || rel.startsWith(`..${sep3}`)) throw new Error("unsafe ledger path");
|
|
4522
|
+
let current = root;
|
|
4523
|
+
for (const part of ["", ...rel.split(sep3)]) {
|
|
4524
|
+
current = resolve9(current, part);
|
|
4525
|
+
if ((await lstat3(current)).isSymbolicLink()) throw new Error("unsafe ledger symlink");
|
|
4526
|
+
}
|
|
4527
|
+
}
|
|
4528
|
+
async function readOwnedLedger(root, path) {
|
|
4529
|
+
await plainLedgerPath(root, path);
|
|
4530
|
+
const before = await lstat3(path);
|
|
4531
|
+
if (!before.isFile()) throw new Error("ledger is not a regular file");
|
|
4532
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
4533
|
+
try {
|
|
4534
|
+
const opened = await file.stat();
|
|
4535
|
+
await plainLedgerPath(root, path);
|
|
4536
|
+
if (opened.dev !== before.dev || opened.ino !== before.ino) throw new Error("ledger changed while opening");
|
|
4537
|
+
return await file.readFile();
|
|
4538
|
+
} finally {
|
|
4539
|
+
await file.close();
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
async function transcriptCaptureDirectory(destination) {
|
|
4543
|
+
const base = clioDataDir();
|
|
4544
|
+
await mkdir(base, { recursive: true, mode: 448 });
|
|
4545
|
+
let current = await realpath(base);
|
|
4546
|
+
const rel = relative4(base, destination);
|
|
4547
|
+
if (isAbsolute3(rel) || rel === ".." || rel.startsWith(`..${sep3}`)) throw new Error("unsafe transcript destination");
|
|
4548
|
+
for (const part of rel.split(sep3)) {
|
|
4549
|
+
current = resolve9(current, part);
|
|
4550
|
+
try {
|
|
4551
|
+
await mkdir(current, { mode: 448 });
|
|
4552
|
+
} catch (error) {
|
|
4553
|
+
if (error.code !== "EEXIST") throw error;
|
|
4554
|
+
}
|
|
4555
|
+
const info = await lstat3(current);
|
|
4556
|
+
if (info.isSymbolicLink() || !info.isDirectory()) throw new Error("unsafe transcript destination");
|
|
4557
|
+
}
|
|
4558
|
+
return mkdtemp3(resolve9(current, "capture-"));
|
|
4559
|
+
}
|
|
4560
|
+
async function discoverOwnedLedgers(stateDir, errors) {
|
|
4561
|
+
const root = resolve9(stateDir, "sessions");
|
|
4562
|
+
try {
|
|
4563
|
+
await plainLedgerPath(stateDir, root);
|
|
4564
|
+
} catch (error) {
|
|
4565
|
+
if (error.code === "ENOENT") return [];
|
|
4566
|
+
throw error;
|
|
4567
|
+
}
|
|
4568
|
+
const paths = [];
|
|
4569
|
+
for (const cwd of await readdir(root, { withFileTypes: true })) {
|
|
4570
|
+
if (cwd.isSymbolicLink()) {
|
|
4571
|
+
errors.push("session directory rejected: symlink");
|
|
4572
|
+
continue;
|
|
4573
|
+
}
|
|
4574
|
+
if (!cwd.isDirectory()) continue;
|
|
4575
|
+
const cwdPath = resolve9(root, cwd.name);
|
|
4576
|
+
try {
|
|
4577
|
+
await plainLedgerPath(stateDir, cwdPath);
|
|
4578
|
+
for (const session of await readdir(cwdPath, { withFileTypes: true })) {
|
|
4579
|
+
if (session.isSymbolicLink()) {
|
|
4580
|
+
errors.push("session directory rejected: symlink");
|
|
4581
|
+
continue;
|
|
4582
|
+
}
|
|
4583
|
+
if (session.isDirectory()) paths.push(resolve9(cwdPath, session.name, "current.jsonl"));
|
|
4584
|
+
}
|
|
4585
|
+
} catch {
|
|
4586
|
+
errors.push("session directory unreadable or unsafe");
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
return paths.sort();
|
|
4590
|
+
}
|
|
4591
|
+
async function retainSessionLedgers(stateDir, destination, runnerStdout) {
|
|
4592
|
+
const retained = { paths: [], errors: [] };
|
|
4593
|
+
try {
|
|
4594
|
+
const refs = await discoverOwnedLedgers(stateDir, retained.errors);
|
|
4595
|
+
if (refs.length === 0 && !runnerStdout) return retained;
|
|
4596
|
+
const directory = await transcriptCaptureDirectory(destination);
|
|
4597
|
+
if (runnerStdout) {
|
|
4598
|
+
const path = resolve9(directory, "runner-stdout.jsonl");
|
|
4599
|
+
await writeFile(path, runnerStdout, { mode: 384, flag: "wx" });
|
|
4600
|
+
retained.runnerStdoutPath = path;
|
|
4601
|
+
}
|
|
4602
|
+
for (const [index, pathToLedger] of refs.entries()) {
|
|
4603
|
+
try {
|
|
4604
|
+
let content;
|
|
4605
|
+
try {
|
|
4606
|
+
content = await readOwnedLedger(stateDir, pathToLedger);
|
|
4607
|
+
} catch (error) {
|
|
4608
|
+
if (error.code !== "ENOENT") throw error;
|
|
4609
|
+
content = await readOwnedLedger(stateDir, `${pathToLedger}.tmp`);
|
|
4610
|
+
retained.errors.push(`ledger ${index}: incomplete current ledger; temporary evidence retained`);
|
|
4611
|
+
}
|
|
4612
|
+
const path = resolve9(directory, `${index}.jsonl`);
|
|
4613
|
+
await writeFile(path, content, { mode: 384, flag: "wx" });
|
|
4614
|
+
retained.paths.push(path);
|
|
4615
|
+
} catch (error) {
|
|
4616
|
+
const code = error.code;
|
|
4617
|
+
retained.errors.push(
|
|
4618
|
+
`ledger ${index}: retention failed (${code === "ENOENT" ? "missing" : "unsafe or unreadable"})`
|
|
4619
|
+
);
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
} catch {
|
|
4623
|
+
retained.errors.push("session ledger retention failed: artifact storage unavailable or unsafe");
|
|
4624
|
+
}
|
|
4625
|
+
return retained;
|
|
4626
|
+
}
|
|
4340
4627
|
|
|
4341
4628
|
// src/cli/eval.ts
|
|
4342
4629
|
var HELP = `clio-coder eval <command>
|
|
@@ -4430,6 +4717,11 @@ function parseEvalArgs(args) {
|
|
|
4430
4717
|
throw new Error(`unknown eval run argument: ${arg}`);
|
|
4431
4718
|
}
|
|
4432
4719
|
if (parsed.command === "report") {
|
|
4720
|
+
if (arg === "--artifact") {
|
|
4721
|
+
parsed.artifact = requiredValue(args, index, "--artifact");
|
|
4722
|
+
index += 1;
|
|
4723
|
+
continue;
|
|
4724
|
+
}
|
|
4433
4725
|
if (arg === "--format") {
|
|
4434
4726
|
parsed.format = reportFormat(requiredValue(args, index, "--format"));
|
|
4435
4727
|
index += 1;
|
|
@@ -4486,7 +4778,9 @@ function parseEvalArgs(args) {
|
|
|
4486
4778
|
if (parsed.command === "run" && parsed.suite === void 0 === (parsed.taskFile === void 0)) {
|
|
4487
4779
|
throw new Error("run requires exactly one of --suite or --task-file");
|
|
4488
4780
|
}
|
|
4489
|
-
if (parsed.command === "report" && parsed.evalId === void 0
|
|
4781
|
+
if (parsed.command === "report" && parsed.evalId === void 0 === (parsed.artifact === void 0)) {
|
|
4782
|
+
throw new Error("report requires exactly one of an eval id or --artifact <path>");
|
|
4783
|
+
}
|
|
4490
4784
|
if (parsed.command === "compare" && parsed.compareIds.length !== 2) {
|
|
4491
4785
|
throw new Error("compare requires <baselineEvalId> <candidateEvalId>");
|
|
4492
4786
|
}
|
|
@@ -4497,7 +4791,7 @@ function parseEvalArgs(args) {
|
|
|
4497
4791
|
}
|
|
4498
4792
|
async function runEvalCommand(args) {
|
|
4499
4793
|
if (args[0] === "inventory") {
|
|
4500
|
-
const { runEvalInventory } = await import("./eval-inventory-
|
|
4794
|
+
const { runEvalInventory } = await import("./eval-inventory-QOYZERXJ.js");
|
|
4501
4795
|
return runEvalInventory(args.slice(1));
|
|
4502
4796
|
}
|
|
4503
4797
|
let parsed;
|
|
@@ -4540,13 +4834,15 @@ async function runEvalRun(parsed) {
|
|
|
4540
4834
|
...resolveOptions,
|
|
4541
4835
|
...parsed.trials ? { trials: parsed.trials } : {}
|
|
4542
4836
|
});
|
|
4543
|
-
const clioEntry =
|
|
4837
|
+
const clioEntry = resolve10(parsed.clioEntry ?? process.argv[1] ?? "dist/cli/index.js");
|
|
4544
4838
|
const artifact = await runEvalSuiteV2(
|
|
4545
4839
|
{ ...loaded, suite },
|
|
4546
4840
|
{ clioEntry, freshWorkspaces: parsed.trials !== void 0 }
|
|
4547
4841
|
);
|
|
4548
4842
|
const artifactPath = await writeEvalArtifactV4(clioDataDir(), artifact, parsed.out);
|
|
4549
4843
|
process.stdout.write(`${renderEvalTextReportV4(artifact)}artifact: ${artifactPath}
|
|
4844
|
+
`);
|
|
4845
|
+
process.stdout.write(`report: clio-coder eval report --artifact ${shellQuote(resolve10(artifactPath))} --format md
|
|
4550
4846
|
`);
|
|
4551
4847
|
const gate = suite.thresholds === void 0 ? null : evaluateGate(artifact, suite.thresholds);
|
|
4552
4848
|
if (gate !== null && !gate.pass) {
|
|
@@ -4567,7 +4863,7 @@ async function runEvalRun(parsed) {
|
|
|
4567
4863
|
async function runEvalReportCommand(parsed) {
|
|
4568
4864
|
try {
|
|
4569
4865
|
const dataDir = clioDataDir();
|
|
4570
|
-
const artifact = await loadEvalArtifactV4(dataDir, parsed.evalId ?? "");
|
|
4866
|
+
const artifact = parsed.artifact === void 0 ? await loadEvalArtifactV4(dataDir, parsed.evalId ?? "") : parseEvalArtifactV4(JSON.parse(await readFile4(parsed.artifact, "utf8")), parsed.artifact);
|
|
4571
4867
|
process.stdout.write(renderArtifactReport(artifact, parsed.format, dataDir));
|
|
4572
4868
|
return 0;
|
|
4573
4869
|
} catch (error) {
|
|
@@ -4672,4 +4968,4 @@ function comparisonFormat(value) {
|
|
|
4672
4968
|
export {
|
|
4673
4969
|
runEvalCommand
|
|
4674
4970
|
};
|
|
4675
|
-
//# sourceMappingURL=eval-
|
|
4971
|
+
//# sourceMappingURL=eval-BUU3ZOUZ.js.map
|