@hawkeyexl/manni 4.29.0 → 4.31.0
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/README.md +1 -1
- package/dist/{batch-LKECW5WN.js → batch-P6LTMOZP.js} +12 -12
- package/dist/{build-PIWP7QEQ.js → build-V5JPMFTR.js} +14 -14
- package/dist/{calibrate-QBAVFCXX.js → calibrate-YS4NLIC3.js} +13 -13
- package/dist/{capture-VS4HY2FL.js → capture-YQDJSSKZ.js} +12 -12
- package/dist/check-DVMU74U3.js +58 -0
- package/dist/{check-6T3ZZTBW.js → check-FVL7G5PJ.js} +13 -13
- package/dist/{check-LKZ2D5Y3.js → check-OWGSBBU7.js} +13 -13
- package/dist/{check-C7GN5ZUC.js → check-QAVEMKP2.js} +10 -10
- package/dist/{check-HIIEDFCI.js → check-TUP4RG7G.js} +23 -23
- package/dist/{chunk-N7HOXMHV.js → chunk-2KGDXZMS.js} +3 -3
- package/dist/{chunk-D6HTXNFN.js → chunk-2NB7MT5I.js} +2 -2
- package/dist/{chunk-7SYTA2HW.js → chunk-3WX73ME2.js} +3 -3
- package/dist/{chunk-6FNRVJQC.js → chunk-4JDOHAHR.js} +6 -6
- package/dist/{chunk-HGL5VY2P.js → chunk-66A5PPWF.js} +4 -4
- package/dist/{chunk-WV5VMIC5.js → chunk-66U7KHZE.js} +5 -5
- package/dist/{chunk-PVAJUMDT.js → chunk-672TCM2Q.js} +4 -4
- package/dist/{chunk-OZH46DBT.js → chunk-7OMLNFP7.js} +6 -1
- package/dist/chunk-7OMLNFP7.js.map +1 -0
- package/dist/{chunk-3FDQKFNQ.js → chunk-7S6H5UML.js} +2 -2
- package/dist/{chunk-IYGSEC73.js → chunk-7URMU7S5.js} +2 -2
- package/dist/{chunk-OAA6SX2W.js → chunk-AD7IRC5T.js} +3 -3
- package/dist/{chunk-4AWM6625.js → chunk-AXIYZIHN.js} +4 -4
- package/dist/{chunk-YBDRFSOK.js → chunk-AXSCHC34.js} +5 -5
- package/dist/{chunk-NA3M7JLP.js → chunk-BBIEWUO6.js} +6 -6
- package/dist/{chunk-FRAEC2Y4.js → chunk-BKLXSWGX.js} +3 -3
- package/dist/{chunk-5BHBLVBD.js → chunk-BR6NGHRG.js} +3 -3
- package/dist/{chunk-YWHSZSQL.js → chunk-BVQEOF23.js} +3 -3
- package/dist/{chunk-4XTNIPXL.js → chunk-CCBIO2CB.js} +2 -2
- package/dist/{chunk-44N4NCOQ.js → chunk-CEPNSI4V.js} +2 -2
- package/dist/{chunk-Y7SBE6TC.js → chunk-CY4RNLFN.js} +3 -3
- package/dist/{chunk-A6FYDQC2.js → chunk-D2N3SAV6.js} +4 -4
- package/dist/{chunk-TWOWMTIH.js → chunk-DLIQJJAE.js} +3 -3
- package/dist/{chunk-YQG4YCQL.js → chunk-DO5CJVXR.js} +3 -3
- package/dist/{chunk-4ZKEJPRY.js → chunk-DOXZ3U4O.js} +50 -20
- package/dist/chunk-DOXZ3U4O.js.map +1 -0
- package/dist/{chunk-MD52QS2O.js → chunk-DSHAY6YM.js} +3 -3
- package/dist/{chunk-I4C5VROJ.js → chunk-EZBWGI25.js} +2 -2
- package/dist/{chunk-SF2WTUDR.js → chunk-F6FDIOKE.js} +3 -3
- package/dist/{chunk-C7KHPFDN.js → chunk-FJZZYY7Q.js} +8 -8
- package/dist/{chunk-A2DDN2HO.js → chunk-GTT7EQEV.js} +2 -2
- package/dist/{chunk-DA5RHOH4.js → chunk-GWOVEW53.js} +5 -5
- package/dist/{chunk-7QIYWXKX.js → chunk-HVYVIGBP.js} +10 -10
- package/dist/{chunk-DM64IZA5.js → chunk-I52GL7N6.js} +3 -3
- package/dist/{chunk-LPTOSRG4.js → chunk-ICUKYSPX.js} +2 -2
- package/dist/{chunk-KZK5JOET.js → chunk-INDMEKFB.js} +6 -6
- package/dist/{chunk-2A7L2AC2.js → chunk-J7OFPDCD.js} +4 -4
- package/dist/{chunk-ACHFEEYB.js → chunk-JVZAJBSS.js} +2 -2
- package/dist/{chunk-LD7BSZMJ.js → chunk-KPQFF62T.js} +40 -12
- package/dist/chunk-KPQFF62T.js.map +1 -0
- package/dist/{chunk-ZWE73OJR.js → chunk-KWK6VVK2.js} +7 -7
- package/dist/{chunk-IPET4C6M.js → chunk-LU6HSA2N.js} +10 -10
- package/dist/{chunk-OY7AMSDK.js → chunk-M5HDMQCI.js} +2 -2
- package/dist/{chunk-OPF3NOKF.js → chunk-M77SIRUX.js} +1 -1
- package/dist/{chunk-OPF3NOKF.js.map → chunk-M77SIRUX.js.map} +1 -1
- package/dist/{chunk-RZX6I2NY.js → chunk-MCUN2JP3.js} +3 -3
- package/dist/{chunk-3LAEG2JM.js → chunk-MQ34D4OP.js} +4 -4
- package/dist/{chunk-2AC35AS2.js → chunk-MREXYXMW.js} +8 -8
- package/dist/{chunk-2HZR3H2N.js → chunk-N7VIVL42.js} +2 -2
- package/dist/{chunk-HV6QKQTR.js → chunk-NH4RQUSD.js} +3 -3
- package/dist/{chunk-5LSQZBLS.js → chunk-P676AEK6.js} +4 -4
- package/dist/{chunk-QEFVMOWF.js → chunk-QYKTIRRE.js} +2 -2
- package/dist/{chunk-VGIKTY7D.js → chunk-R64PJYCT.js} +2 -2
- package/dist/{chunk-Z2KVPZYI.js → chunk-SORYKTNP.js} +3 -2
- package/dist/chunk-SORYKTNP.js.map +1 -0
- package/dist/{chunk-DT4VOGC6.js → chunk-SPYYVEWP.js} +8 -8
- package/dist/{chunk-C6M7SALA.js → chunk-STPT3WEC.js} +7 -7
- package/dist/{chunk-KCNRAZON.js → chunk-TE6SQVNO.js} +8 -8
- package/dist/{chunk-BS2HWHLN.js → chunk-TX7NPCCT.js} +6 -6
- package/dist/{chunk-XZFJAVX7.js → chunk-UH7KFBBM.js} +9 -8
- package/dist/chunk-UH7KFBBM.js.map +1 -0
- package/dist/{chunk-6QMD7FTM.js → chunk-VKAE3W6H.js} +4 -4
- package/dist/{chunk-Z3YNYZR2.js → chunk-VXZ2CIH7.js} +2 -2
- package/dist/{chunk-FR5IEI5I.js → chunk-WX77JHTU.js} +3 -3
- package/dist/{chunk-3NGA6KCU.js → chunk-X7UWDGQQ.js} +11 -8
- package/dist/chunk-X7UWDGQQ.js.map +1 -0
- package/dist/{chunk-AWJ7UWOH.js → chunk-XIEUUETR.js} +6 -6
- package/dist/{chunk-SFUKZRTP.js → chunk-YH6MWLDA.js} +2 -2
- package/dist/{chunk-TTHG53NH.js → chunk-YT55M4VQ.js} +6 -6
- package/dist/{chunk-VQB22TCH.js → chunk-Z7HBBFSZ.js} +578 -28
- package/dist/chunk-Z7HBBFSZ.js.map +1 -0
- package/dist/{chunk-SXWPKK4D.js → chunk-ZGLLJSL7.js} +2 -2
- package/dist/{chunk-77RJZP3W.js → chunk-ZMFSFXQX.js} +17 -12
- package/dist/chunk-ZMFSFXQX.js.map +1 -0
- package/dist/{chunk-ZMLGMLXE.js → chunk-ZY2XP3AS.js} +13 -13
- package/dist/{cli-56Z2RAWA.js → cli-5NIVQZIE.js} +31 -31
- package/dist/{cli-ZTSPDBDE.js → cli-7TW4HTQN.js} +14 -14
- package/dist/{cli-B3RIVCKY.js → cli-BG6WXYWT.js} +56 -56
- package/dist/{cli-YAG5OFYC.js → cli-ME4U7S7Q.js} +28 -28
- package/dist/{cli-OIYUAXPA.js → cli-NKGQZKXS.js} +34 -34
- package/dist/{cli-RMIZNJL3.js → cli-R5XYFIOY.js} +14 -14
- package/dist/{cli-Q3ZRWXB4.js → cli-T2AZSUSY.js} +19 -19
- package/dist/{cli-OY6RHP5P.js → cli-TA2IQRYK.js} +7 -7
- package/dist/{cli-AVOEQZZM.js → cli-UAM4MBRM.js} +17 -17
- package/dist/{cli-BI2GQEDM.js → cli-XVJ5G4EO.js} +27 -27
- package/dist/{cli-UINJ634O.js → cli-YKM5YZHY.js} +40 -9
- package/dist/cli-YKM5YZHY.js.map +1 -0
- package/dist/cli.js +15 -15
- package/dist/docmeta.js +6 -6
- package/dist/{github-PLPEWRPJ.js → github-SQ2ATTLV.js} +10 -10
- package/dist/{github-B3QCNYMP.js → github-X6F2FQL3.js} +13 -13
- package/dist/github-ZCA7TOJO.js +49 -0
- package/dist/index.d.ts +55 -3
- package/dist/index.js +57 -55
- package/dist/index.js.map +1 -1
- package/dist/{json-UNN7BJM6.js → json-L7QDREEX.js} +10 -10
- package/dist/{json-7ERIDOTV.js → json-NSLJFPWD.js} +14 -14
- package/dist/{labels-XUW7THEE.js → labels-C4HCKZMZ.js} +9 -9
- package/dist/{lint-NWSLIVHJ.js → lint-ODALAI2I.js} +12 -12
- package/dist/list-4JLKJOGX.js +56 -0
- package/dist/{list-TXOFFLES.js → list-CAE7T5HA.js} +10 -10
- package/dist/{list-BKD62XJ4.js → list-TQK3FWC2.js} +13 -13
- package/dist/{page-CFDNR2OB.js → page-GB5LHRHX.js} +9 -9
- package/dist/{prepare-Y7WBJ3RZ.js → prepare-VCJRE3EY.js} +11 -11
- package/dist/{pretty-MTAJRM7S.js → pretty-GP4R3UII.js} +10 -10
- package/dist/{pretty-ALGCRVPF.js → pretty-GXLKMUT4.js} +13 -13
- package/dist/{pretty-BX6RMDVM.js → pretty-KZPED6KN.js} +23 -23
- package/dist/{reporters-QSBVVOX7.js → reporters-GGP4YLIM.js} +11 -11
- package/dist/{reporters-OZPJP6UK.js → reporters-GQ2PUWQA.js} +4 -4
- package/dist/{reporters-MK62LRGW.js → reporters-Y2AUVODK.js} +4 -4
- package/dist/run-SVH32CBO.js +59 -0
- package/dist/sarif-CFQJ5HHP.js +50 -0
- package/dist/{sarif-JZSDSSBV.js → sarif-UG7F3WQD.js} +8 -8
- package/dist/{sarif-KTMQVMN5.js → sarif-UHZD2CJ3.js} +8 -8
- package/dist/{strategy-G25TI5UA.js → strategy-Y4NEJRSH.js} +20 -20
- package/dist/{term-YYIAR32K.js → term-LQ2F5WEN.js} +15 -15
- package/dist/{types-GV2THIRC.js → types-YREQ2DQG.js} +6 -4
- package/dist/{validate-VKZJAD77.js → validate-6WBRKEV5.js} +4 -4
- package/package.json +2 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/dist/check-3AZ33DIQ.js +0 -58
- package/dist/chunk-3NGA6KCU.js.map +0 -1
- package/dist/chunk-4ZKEJPRY.js.map +0 -1
- package/dist/chunk-77RJZP3W.js.map +0 -1
- package/dist/chunk-LD7BSZMJ.js.map +0 -1
- package/dist/chunk-OZH46DBT.js.map +0 -1
- package/dist/chunk-VQB22TCH.js.map +0 -1
- package/dist/chunk-XZFJAVX7.js.map +0 -1
- package/dist/chunk-Z2KVPZYI.js.map +0 -1
- package/dist/cli-UINJ634O.js.map +0 -1
- package/dist/github-XBGWVVIA.js +0 -49
- package/dist/list-WM4EHFC6.js +0 -56
- package/dist/run-UTKXWCM4.js +0 -59
- package/dist/sarif-6QY3B2KF.js +0 -50
- /package/dist/{batch-LKECW5WN.js.map → batch-P6LTMOZP.js.map} +0 -0
- /package/dist/{build-PIWP7QEQ.js.map → build-V5JPMFTR.js.map} +0 -0
- /package/dist/{calibrate-QBAVFCXX.js.map → calibrate-YS4NLIC3.js.map} +0 -0
- /package/dist/{capture-VS4HY2FL.js.map → capture-YQDJSSKZ.js.map} +0 -0
- /package/dist/{check-3AZ33DIQ.js.map → check-DVMU74U3.js.map} +0 -0
- /package/dist/{check-6T3ZZTBW.js.map → check-FVL7G5PJ.js.map} +0 -0
- /package/dist/{check-LKZ2D5Y3.js.map → check-OWGSBBU7.js.map} +0 -0
- /package/dist/{check-C7GN5ZUC.js.map → check-QAVEMKP2.js.map} +0 -0
- /package/dist/{check-HIIEDFCI.js.map → check-TUP4RG7G.js.map} +0 -0
- /package/dist/{chunk-N7HOXMHV.js.map → chunk-2KGDXZMS.js.map} +0 -0
- /package/dist/{chunk-D6HTXNFN.js.map → chunk-2NB7MT5I.js.map} +0 -0
- /package/dist/{chunk-7SYTA2HW.js.map → chunk-3WX73ME2.js.map} +0 -0
- /package/dist/{chunk-6FNRVJQC.js.map → chunk-4JDOHAHR.js.map} +0 -0
- /package/dist/{chunk-HGL5VY2P.js.map → chunk-66A5PPWF.js.map} +0 -0
- /package/dist/{chunk-WV5VMIC5.js.map → chunk-66U7KHZE.js.map} +0 -0
- /package/dist/{chunk-PVAJUMDT.js.map → chunk-672TCM2Q.js.map} +0 -0
- /package/dist/{chunk-3FDQKFNQ.js.map → chunk-7S6H5UML.js.map} +0 -0
- /package/dist/{chunk-IYGSEC73.js.map → chunk-7URMU7S5.js.map} +0 -0
- /package/dist/{chunk-OAA6SX2W.js.map → chunk-AD7IRC5T.js.map} +0 -0
- /package/dist/{chunk-4AWM6625.js.map → chunk-AXIYZIHN.js.map} +0 -0
- /package/dist/{chunk-YBDRFSOK.js.map → chunk-AXSCHC34.js.map} +0 -0
- /package/dist/{chunk-NA3M7JLP.js.map → chunk-BBIEWUO6.js.map} +0 -0
- /package/dist/{chunk-FRAEC2Y4.js.map → chunk-BKLXSWGX.js.map} +0 -0
- /package/dist/{chunk-5BHBLVBD.js.map → chunk-BR6NGHRG.js.map} +0 -0
- /package/dist/{chunk-YWHSZSQL.js.map → chunk-BVQEOF23.js.map} +0 -0
- /package/dist/{chunk-4XTNIPXL.js.map → chunk-CCBIO2CB.js.map} +0 -0
- /package/dist/{chunk-44N4NCOQ.js.map → chunk-CEPNSI4V.js.map} +0 -0
- /package/dist/{chunk-Y7SBE6TC.js.map → chunk-CY4RNLFN.js.map} +0 -0
- /package/dist/{chunk-A6FYDQC2.js.map → chunk-D2N3SAV6.js.map} +0 -0
- /package/dist/{chunk-TWOWMTIH.js.map → chunk-DLIQJJAE.js.map} +0 -0
- /package/dist/{chunk-YQG4YCQL.js.map → chunk-DO5CJVXR.js.map} +0 -0
- /package/dist/{chunk-MD52QS2O.js.map → chunk-DSHAY6YM.js.map} +0 -0
- /package/dist/{chunk-I4C5VROJ.js.map → chunk-EZBWGI25.js.map} +0 -0
- /package/dist/{chunk-SF2WTUDR.js.map → chunk-F6FDIOKE.js.map} +0 -0
- /package/dist/{chunk-C7KHPFDN.js.map → chunk-FJZZYY7Q.js.map} +0 -0
- /package/dist/{chunk-A2DDN2HO.js.map → chunk-GTT7EQEV.js.map} +0 -0
- /package/dist/{chunk-DA5RHOH4.js.map → chunk-GWOVEW53.js.map} +0 -0
- /package/dist/{chunk-7QIYWXKX.js.map → chunk-HVYVIGBP.js.map} +0 -0
- /package/dist/{chunk-DM64IZA5.js.map → chunk-I52GL7N6.js.map} +0 -0
- /package/dist/{chunk-LPTOSRG4.js.map → chunk-ICUKYSPX.js.map} +0 -0
- /package/dist/{chunk-KZK5JOET.js.map → chunk-INDMEKFB.js.map} +0 -0
- /package/dist/{chunk-2A7L2AC2.js.map → chunk-J7OFPDCD.js.map} +0 -0
- /package/dist/{chunk-ACHFEEYB.js.map → chunk-JVZAJBSS.js.map} +0 -0
- /package/dist/{chunk-ZWE73OJR.js.map → chunk-KWK6VVK2.js.map} +0 -0
- /package/dist/{chunk-IPET4C6M.js.map → chunk-LU6HSA2N.js.map} +0 -0
- /package/dist/{chunk-OY7AMSDK.js.map → chunk-M5HDMQCI.js.map} +0 -0
- /package/dist/{chunk-RZX6I2NY.js.map → chunk-MCUN2JP3.js.map} +0 -0
- /package/dist/{chunk-3LAEG2JM.js.map → chunk-MQ34D4OP.js.map} +0 -0
- /package/dist/{chunk-2AC35AS2.js.map → chunk-MREXYXMW.js.map} +0 -0
- /package/dist/{chunk-2HZR3H2N.js.map → chunk-N7VIVL42.js.map} +0 -0
- /package/dist/{chunk-HV6QKQTR.js.map → chunk-NH4RQUSD.js.map} +0 -0
- /package/dist/{chunk-5LSQZBLS.js.map → chunk-P676AEK6.js.map} +0 -0
- /package/dist/{chunk-QEFVMOWF.js.map → chunk-QYKTIRRE.js.map} +0 -0
- /package/dist/{chunk-VGIKTY7D.js.map → chunk-R64PJYCT.js.map} +0 -0
- /package/dist/{chunk-DT4VOGC6.js.map → chunk-SPYYVEWP.js.map} +0 -0
- /package/dist/{chunk-C6M7SALA.js.map → chunk-STPT3WEC.js.map} +0 -0
- /package/dist/{chunk-KCNRAZON.js.map → chunk-TE6SQVNO.js.map} +0 -0
- /package/dist/{chunk-BS2HWHLN.js.map → chunk-TX7NPCCT.js.map} +0 -0
- /package/dist/{chunk-6QMD7FTM.js.map → chunk-VKAE3W6H.js.map} +0 -0
- /package/dist/{chunk-Z3YNYZR2.js.map → chunk-VXZ2CIH7.js.map} +0 -0
- /package/dist/{chunk-FR5IEI5I.js.map → chunk-WX77JHTU.js.map} +0 -0
- /package/dist/{chunk-AWJ7UWOH.js.map → chunk-XIEUUETR.js.map} +0 -0
- /package/dist/{chunk-SFUKZRTP.js.map → chunk-YH6MWLDA.js.map} +0 -0
- /package/dist/{chunk-TTHG53NH.js.map → chunk-YT55M4VQ.js.map} +0 -0
- /package/dist/{chunk-SXWPKK4D.js.map → chunk-ZGLLJSL7.js.map} +0 -0
- /package/dist/{chunk-ZMLGMLXE.js.map → chunk-ZY2XP3AS.js.map} +0 -0
- /package/dist/{cli-56Z2RAWA.js.map → cli-5NIVQZIE.js.map} +0 -0
- /package/dist/{cli-ZTSPDBDE.js.map → cli-7TW4HTQN.js.map} +0 -0
- /package/dist/{cli-B3RIVCKY.js.map → cli-BG6WXYWT.js.map} +0 -0
- /package/dist/{cli-YAG5OFYC.js.map → cli-ME4U7S7Q.js.map} +0 -0
- /package/dist/{cli-OIYUAXPA.js.map → cli-NKGQZKXS.js.map} +0 -0
- /package/dist/{cli-RMIZNJL3.js.map → cli-R5XYFIOY.js.map} +0 -0
- /package/dist/{cli-Q3ZRWXB4.js.map → cli-T2AZSUSY.js.map} +0 -0
- /package/dist/{cli-OY6RHP5P.js.map → cli-TA2IQRYK.js.map} +0 -0
- /package/dist/{cli-AVOEQZZM.js.map → cli-UAM4MBRM.js.map} +0 -0
- /package/dist/{cli-BI2GQEDM.js.map → cli-XVJ5G4EO.js.map} +0 -0
- /package/dist/{github-B3QCNYMP.js.map → github-SQ2ATTLV.js.map} +0 -0
- /package/dist/{github-PLPEWRPJ.js.map → github-X6F2FQL3.js.map} +0 -0
- /package/dist/{github-XBGWVVIA.js.map → github-ZCA7TOJO.js.map} +0 -0
- /package/dist/{json-7ERIDOTV.js.map → json-L7QDREEX.js.map} +0 -0
- /package/dist/{json-UNN7BJM6.js.map → json-NSLJFPWD.js.map} +0 -0
- /package/dist/{labels-XUW7THEE.js.map → labels-C4HCKZMZ.js.map} +0 -0
- /package/dist/{lint-NWSLIVHJ.js.map → lint-ODALAI2I.js.map} +0 -0
- /package/dist/{list-BKD62XJ4.js.map → list-4JLKJOGX.js.map} +0 -0
- /package/dist/{list-TXOFFLES.js.map → list-CAE7T5HA.js.map} +0 -0
- /package/dist/{list-WM4EHFC6.js.map → list-TQK3FWC2.js.map} +0 -0
- /package/dist/{page-CFDNR2OB.js.map → page-GB5LHRHX.js.map} +0 -0
- /package/dist/{prepare-Y7WBJ3RZ.js.map → prepare-VCJRE3EY.js.map} +0 -0
- /package/dist/{pretty-ALGCRVPF.js.map → pretty-GP4R3UII.js.map} +0 -0
- /package/dist/{pretty-BX6RMDVM.js.map → pretty-GXLKMUT4.js.map} +0 -0
- /package/dist/{pretty-MTAJRM7S.js.map → pretty-KZPED6KN.js.map} +0 -0
- /package/dist/{reporters-MK62LRGW.js.map → reporters-GGP4YLIM.js.map} +0 -0
- /package/dist/{reporters-OZPJP6UK.js.map → reporters-GQ2PUWQA.js.map} +0 -0
- /package/dist/{reporters-QSBVVOX7.js.map → reporters-Y2AUVODK.js.map} +0 -0
- /package/dist/{run-UTKXWCM4.js.map → run-SVH32CBO.js.map} +0 -0
- /package/dist/{sarif-6QY3B2KF.js.map → sarif-CFQJ5HHP.js.map} +0 -0
- /package/dist/{sarif-JZSDSSBV.js.map → sarif-UG7F3WQD.js.map} +0 -0
- /package/dist/{sarif-KTMQVMN5.js.map → sarif-UHZD2CJ3.js.map} +0 -0
- /package/dist/{strategy-G25TI5UA.js.map → strategy-Y4NEJRSH.js.map} +0 -0
- /package/dist/{term-YYIAR32K.js.map → term-LQ2F5WEN.js.map} +0 -0
- /package/dist/{types-GV2THIRC.js.map → types-YREQ2DQG.js.map} +0 -0
- /package/dist/{validate-VKZJAD77.js.map → validate-6WBRKEV5.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/test/errors.ts","../src/test/commands/procedures.ts","../src/test/core/doc-detective.ts","../src/test/core/results.ts","../src/test/commands/tasks.ts","../src/test/core/claude-code.ts","../src/test/core/judge-run.ts","../src/test/core/evidence.ts","../src/test/core/prompts.ts","../src/test/core/task-records.ts","../src/test/core/workspace.ts","../src/test/reporters/finding.ts","../src/test/reporters/summary.ts","../src/test/reporters/github.ts","../src/test/reporters/json.ts","../src/test/reporters/pretty.ts","../src/test/reporters/tasks.ts"],"sourcesContent":["import { ToolError } from \"../shared/errors.js\";\n\n/** An operational or usage error in the test domain: exit 2. */\nexport class TestError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"TestError\";\n }\n}\n","/**\n * `manni test procedures`: run Doc Detective and read its verdict from its results.\n *\n * Input precedence is positional paths, then `--collection`, then Doc\n * Detective's own config `input`. Without `--collection`, manni's collections\n * are not read: Doc Detective's config is this tool's default input.\n *\n * Doc Detective exits 0 when tests fail, so the exit code only says whether it\n * ran. The verdict is the results file it writes under `-o`, which is a temp\n * directory removed afterwards.\n */\nimport { existsSync } from \"node:fs\";\nimport { mkdtemp, readdir, readFile, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join, relative, resolve } from \"node:path\";\nimport fg from \"fast-glob\";\nimport picomatch from \"picomatch\";\nimport { selectCollections } from \"../../shared/collections.js\";\nimport { findConfigFile, readConfigFile, type ConfigFile } from \"../../shared/config-file.js\";\nimport { ToolError } from \"../../shared/errors.js\";\nimport { outputTail } from \"../../shared/exec.js\";\nimport { docDetectiveConfigPath } from \"../../shared/tools.js\";\nimport { DEFAULT_IGNORE, notFoundMessage, resolveTargetSet, STDIN_TOKEN } from \"../../meta/internal.js\";\nimport { NOT_ON_PATH, realSpawn, type DocDetectiveSpawn } from \"../core/doc-detective.js\";\nimport {\n anyFailed,\n collectFindings,\n parseResults,\n testCounts,\n type DocDetectiveResults,\n type ResultCounts,\n type TestFinding,\n} from \"../core/results.js\";\nimport { TestError } from \"../errors.js\";\n\nexport interface RunProceduresOptions {\n /** Positional files, directories and globs. */\n paths?: string[];\n /** `--collection <name>`, repeatable. */\n collection?: string[];\n /** `-c, --config`: a manni config file. */\n configPath?: string;\n cwd?: string;\n /** Finding no tests, or no inputs, is a pass. */\n allowEmpty?: boolean;\n /** Stream Doc Detective's output to stderr as it runs. */\n progress?: boolean;\n /** Test seam: how Doc Detective is started. */\n spawn?: DocDetectiveSpawn;\n}\n\nexport interface ProceduresResult {\n /** Doc Detective's results object as it wrote it; `null` when it found no tests. */\n results: DocDetectiveResults | null;\n /** Every FAIL and WARNING step. */\n findings: TestFinding[];\n /** The test-level counts. */\n tests: ResultCounts;\n /** 1 when anything failed. */\n exitCode: 0 | 1;\n}\n\n/** What Doc Detective finds on its own in the working directory. */\nconst DOC_DETECTIVE_CONFIG_NAMES = [\".doc-detective.json\", \".doc-detective.yaml\", \".doc-detective.yml\"];\n\nconst NO_RESULTS = \"Doc Detective wrote no results to read. Run doc-detective directly to see why.\";\n\n/** A run with nothing to report; a fresh object each time, so no caller shares one. */\nfunction empty(results: DocDetectiveResults | null = null): ProceduresResult {\n return { results, findings: [], tests: { pass: 0, fail: 0, warning: 0, skipped: 0 }, exitCode: 0 };\n}\n\nconst toError = (message: string): Error => new TestError(message);\n\n/** A sibling's `ToolError` (meta's walk, say) reported as this domain's. */\nasync function asTestError<T>(work: () => Promise<T>): Promise<T> {\n try {\n return await work();\n } catch (err) {\n if (err instanceof ToolError && !(err instanceof TestError)) throw new TestError(err.message);\n throw err;\n }\n}\n\nasync function loadConfig(cwd: string, configPath: string | undefined): Promise<ConfigFile | null> {\n const opts = { section: \"test\", legacyNames: [], toError };\n const file =\n configPath === undefined ? await findConfigFile(cwd, opts) : await readConfigFile(configPath, cwd, opts);\n // The domain has no keys of its own, so a `test:` section is a setting that\n // would otherwise read as configured and do nothing.\n if (file !== null && file.wrapped && file.value !== null) {\n throw new TestError(\n `${file.source}: test has no keys. Doc Detective's settings live under tools.doc-detective, and Claude Code's under tools.claude-cli.`,\n );\n }\n return file;\n}\n\n/**\n * Positional inputs as Doc Detective takes them. Files and directories go as\n * typed, and Doc Detective walks a directory itself. A glob is expanded here.\n * A name that does not exist is refused, because Doc Detective skips one in\n * silence.\n */\nasync function positionalInputs(paths: string[], cwd: string, allowEmpty: boolean): Promise<string[]> {\n const inputs: string[] = [];\n const missing: string[] = [];\n for (const path of paths) {\n const posix = path.replace(/\\\\/g, \"/\");\n if (existsSync(resolve(cwd, posix))) {\n inputs.push(path);\n } else if (picomatch.scan(posix).isGlob) {\n const found = await fg(posix, { cwd, ignore: DEFAULT_IGNORE, onlyFiles: true, dot: false });\n inputs.push(...found.sort());\n } else {\n missing.push(posix);\n }\n }\n if (missing.length > 0 && !allowEmpty) throw new TestError(notFoundMessage(missing));\n return inputs;\n}\n\n/** The selected collections' files, minus their excludes, relative to `cwd`. */\nasync function collectionInputs(\n file: ConfigFile,\n names: string[],\n cwd: string,\n allowEmpty: boolean,\n): Promise<string[]> {\n const collections = selectCollections(file.collections, names, file.source, toError);\n const { files } = await asTestError(() =>\n resolveTargetSet({\n inputs: collections.flatMap((c) => c.paths),\n exclude: collections.flatMap((c) => c.exclude),\n cwd: file.dir,\n allowEmpty,\n }),\n );\n return files.map((f) => relative(cwd, resolve(file.dir, f)).replace(/\\\\/g, \"/\"));\n}\n\nasync function readResults(outDir: string): Promise<DocDetectiveResults | null> {\n const names = (await readdir(outDir)).filter((n) => /^testResults-.*\\.json$/.test(n)).sort();\n const last = names.at(-1);\n if (last === undefined) throw new TestError(NO_RESULTS);\n const results = parseResults(await readFile(join(outDir, last), \"utf8\"));\n if (results === undefined) throw new TestError(NO_RESULTS);\n return results;\n}\n\nexport async function runProcedures(opts: RunProceduresOptions = {}): Promise<ProceduresResult> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const paths = opts.paths ?? [];\n const wanted = opts.collection ?? [];\n const allowEmpty = opts.allowEmpty ?? false;\n\n if (paths.includes(STDIN_TOKEN)) {\n throw new TestError(\"test procedures reads files; Doc Detective has no stdin. Pass a path.\");\n }\n // lint's two sentences: a collection is a set the operator did not type, so\n // it composes with no typed path, and only a config can define one.\n if (wanted.length > 0 && paths.length > 0) {\n throw new TestError(\n \"--collection selects a configured collection; it cannot be combined with paths.\",\n );\n }\n const file = await loadConfig(cwd, opts.configPath);\n if (wanted.length > 0 && file === null) {\n throw new TestError(\"--collection needs a config file to select from.\");\n }\n\n // The path as written names the file in the refusal; the resolved one is\n // what Doc Detective is given.\n const written = file?.tools[\"doc-detective\"]?.config;\n let ddConfig: string | undefined;\n if (file !== null && written !== undefined) {\n ddConfig = docDetectiveConfigPath(file.tools, file.dir);\n if (ddConfig !== undefined && !existsSync(ddConfig)) {\n throw new TestError(`${file.source}: tools.doc-detective.config \"${written}\" does not exist.`);\n }\n }\n\n let inputs: string[] | undefined;\n if (paths.length > 0) {\n inputs = await positionalInputs(paths, cwd, allowEmpty);\n if (inputs.length === 0) {\n if (allowEmpty) return empty();\n const tried = paths.map((p) => `\"${p}\"`).join(\", \");\n throw new TestError(\n `No files matched. Patterns tried: ${tried}. Pass --allow-empty if that is expected.`,\n );\n }\n } else if (file !== null && wanted.length > 0) {\n inputs = await collectionInputs(file, wanted, cwd, allowEmpty);\n if (inputs.length === 0) {\n if (allowEmpty) return empty();\n throw new TestError(\"--collection matched no files. Pass --allow-empty if that is expected.\");\n }\n } else if (\n ddConfig === undefined &&\n !DOC_DETECTIVE_CONFIG_NAMES.some((name) => existsSync(join(cwd, name)))\n ) {\n throw new TestError(\n \"test procedures needs paths or a Doc Detective config. Pass paths, or add .doc-detective.json.\",\n );\n }\n\n const outDir = await mkdtemp(join(tmpdir(), \"manni-test-\"));\n try {\n const args = [\n // ponytail: Doc Detective splits -i on commas, so a path holding a comma\n // is two inputs. Upgrade path: a generated config whose input is a list.\n ...(inputs === undefined ? [] : [\"-i\", inputs.join(\",\")]),\n ...(ddConfig === undefined ? [] : [\"-c\", ddConfig]),\n \"-r\",\n \"json\",\n \"-o\",\n outDir,\n ];\n const run = await (opts.spawn ?? realSpawn)(args, { cwd, progress: opts.progress ?? false });\n if (run.spawnError !== undefined) throw new TestError(NOT_ON_PATH);\n if (run.code !== 0) {\n const how = run.code === null ? \"killed before exiting\" : `exit ${String(run.code)}`;\n throw new TestError(`Doc Detective failed (${how}):\\n${outputTail(run)}`);\n }\n\n const results = await readResults(outDir);\n const tests = testCounts(results);\n const total = tests.pass + tests.fail + tests.warning + tests.skipped;\n // A `null` results file counts as zero tests, so `total` covers it.\n if (total === 0) {\n if (allowEmpty) return empty(results);\n throw new TestError(\n \"Doc Detective found no tests in the inputs. Pass --allow-empty if that is expected.\",\n );\n }\n return {\n results,\n findings: collectFindings(results, cwd),\n tests,\n exitCode: anyFailed(results) ? 1 : 0,\n };\n } finally {\n await rm(outDir, { recursive: true, force: true });\n }\n}\n","/**\n * The Doc Detective process seam: the only module that starts `doc-detective`.\n * Unit tests inject a `DocDetectiveSpawn`; the real one is `realSpawn`.\n *\n * On Windows an npm global install puts a `.cmd` shim on PATH, and `cmd.exe`\n * caps the command line it runs at 8191 characters, which a collection of a\n * few hundred pages passes. So the bin script the shim points at is run with\n * node directly. Only when no script sits beside the shim does the shim run,\n * through `realExec`, which knows how to start one without a shell.\n */\nimport { spawn } from \"node:child_process\";\nimport { statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { ExecResult } from \"@hawkeyexl/inference\";\nimport { realExec } from \"../../shared/exec.js\";\nimport { TestError } from \"../errors.js\";\n\n/**\n * Start Doc Detective with `args` (its own flags, no program name) and wait\n * for it. `progress` streams its output to stderr as it runs; the output is\n * captured either way.\n */\nexport type DocDetectiveSpawn = (\n args: string[],\n opts: { cwd: string; progress: boolean },\n) => Promise<ExecResult>;\n\n/** How Doc Detective is started on this host. */\nexport interface Launch {\n command: string;\n args: string[];\n /** Started through a Windows `.cmd` shim, so `cmd.exe`'s cap applies. */\n viaShim: boolean;\n}\n\nexport const NOT_ON_PATH =\n \"doc-detective is not on PATH. Install Doc Detective (npm install -g doc-detective) to run doc tests.\";\n\nconst COMMAND_LINE_LIMIT =\n \"the selected inputs exceed the command-line limit. Narrow the collection, or set input in the Doc Detective config.\";\n\n/** No timeout: a docs suite runs as long as its tests do. */\nconst NO_TIMEOUT = 2 ** 31 - 1;\n\nexport function launchFor(\n args: string[],\n host: { platform: NodeJS.Platform; path: string; isFile: (path: string) => boolean },\n): Launch {\n if (host.platform !== \"win32\") return { command: \"doc-detective\", args, viaShim: false };\n // Windows lets a PATH entry be quoted, as in \"C:\\Program Files\\nodejs\".\n for (const entry of host.path.split(\";\")) {\n const dir = entry.replace(/^\"(.*)\"$/, \"$1\");\n if (dir === \"\" || !host.isFile(join(dir, \"doc-detective.cmd\"))) continue;\n const script = join(dir, \"node_modules\", \"doc-detective\", \"bin\", \"doc-detective.js\");\n if (host.isFile(script)) {\n return { command: process.execPath, args: [script, ...args], viaShim: false };\n }\n break;\n }\n return { command: \"doc-detective\", args, viaShim: true };\n}\n\n/**\n * Refuse a command line Windows would truncate or reject.\n *\n * ponytail: Windows caps a command line at 32,767 characters, and at 8,191\n * through a `.cmd` shim. Past the cap the run is refused. The upgrade path is\n * running the inputs in batches and merging the results files.\n */\nexport function assertFitsCommandLine(launch: Launch, platform: NodeJS.Platform): void {\n if (platform !== \"win32\") return;\n // Each argument costs its quotes and the space before it.\n const length = [launch.command, ...launch.args].reduce((n, arg) => n + arg.length + 3, 0);\n if (length > (launch.viaShim ? 8_191 : 32_767)) throw new TestError(COMMAND_LINE_LIMIT);\n}\n\nfunction isFile(path: string): boolean {\n try {\n return statSync(path).isFile();\n } catch {\n return false;\n }\n}\n\nfunction streamed(launch: Launch, opts: { cwd: string; progress: boolean }): Promise<ExecResult> {\n return new Promise((settle) => {\n let stdout = \"\";\n let stderr = \"\";\n const child = spawn(launch.command, launch.args, {\n cwd: opts.cwd,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n windowsHide: true,\n });\n child.stdout.setEncoding(\"utf8\");\n child.stderr.setEncoding(\"utf8\");\n child.stdout.on(\"data\", (chunk: string) => {\n stdout += chunk;\n if (opts.progress) process.stderr.write(chunk);\n });\n child.stderr.on(\"data\", (chunk: string) => {\n stderr += chunk;\n if (opts.progress) process.stderr.write(chunk);\n });\n child.on(\"error\", (err) => {\n settle({ code: null, stdout, stderr, timedOut: false, spawnError: err.message });\n });\n child.on(\"close\", (code) => {\n settle({ code, stdout, stderr, timedOut: false });\n });\n });\n}\n\nexport const realSpawn: DocDetectiveSpawn = async (args, opts) => {\n const launch = launchFor(args, {\n platform: process.platform,\n path: process.env[\"PATH\"] ?? \"\",\n isFile,\n });\n assertFitsCommandLine(launch, process.platform);\n if (!launch.viaShim) return streamed(launch, opts);\n // ponytail: the shim path captures and replays rather than streaming live.\n // It runs only when a shim has no bin script beside it.\n const result = await realExec([launch.command, ...launch.args], {\n cwd: opts.cwd,\n timeoutMs: NO_TIMEOUT,\n });\n if (opts.progress) process.stderr.write(result.stdout + result.stderr);\n return result;\n};\n","/**\n * Doc Detective's results file, read across a process boundary.\n *\n * The object is kept as Doc Detective wrote it, because `-f json` prints it\n * verbatim. Only the parts the verdict and the reports need are checked: the\n * test-level counts, and each step's result, description, line and action.\n */\nimport { relative } from \"node:path\";\nimport type { Guidance } from \"../../shared/guidance.js\";\n\n/** One level's counts in Doc Detective's `summary`. */\nexport interface ResultCounts {\n pass: number;\n fail: number;\n warning: number;\n skipped: number;\n}\n\n/** Doc Detective's results object, as it wrote it. */\nexport type DocDetectiveResults = Record<string, unknown>;\n\n/** A step that FAILed or WARNed, named by the page it came from. */\nexport interface TestFinding {\n /** The page, posix and relative to the run's working directory. */\n file: string;\n /** The step's line in the page, when Doc Detective located it. */\n line?: number;\n result: \"FAIL\" | \"WARNING\";\n /** Doc Detective's `resultDescription`, as it wrote it. */\n description: string;\n /** The Doc Detective action the step ran, such as `runShell`, when it is one Doc Detective documents. */\n action?: string;\n /** `Doc Detective`, the action, the step's own `description` and the action's guide. */\n guidance?: Guidance | null;\n}\n\n/** The step actions Doc Detective documents, each on a page of its own under `ACTIONS_GUIDE`. */\nconst ACTIONS = new Set([\n \"checkLink\",\n \"click\",\n \"dragAndDrop\",\n \"find\",\n \"goTo\",\n \"httpRequest\",\n \"loadCookie\",\n \"loadVariables\",\n \"record\",\n \"runCode\",\n \"runShell\",\n \"saveCookie\",\n \"screenshot\",\n \"stopRecord\",\n \"type\",\n \"wait\",\n]);\n\n// Each page is the action name lowercased with nothing between the words:\n// `draganddrop`, `checklink`, `httprequest`. Kebab-case slugs 404 there.\nconst ACTIONS_GUIDE = \"https://docs.doc-detective.com/docs/actions/\";\n\nexport const ZERO_COUNTS: ResultCounts = { pass: 0, fail: 0, warning: 0, skipped: 0 };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.filter(isRecord) : [];\n}\n\nfunction counts(value: unknown): ResultCounts | undefined {\n if (!isRecord(value)) return undefined;\n const out = { ...ZERO_COUNTS };\n for (const key of Object.keys(out) as (keyof ResultCounts)[]) {\n const n = value[key];\n if (typeof n !== \"number\") return undefined;\n out[key] = n;\n }\n return out;\n}\n\n/**\n * Parse a results file. `null` is what Doc Detective writes when it found no\n * tests. `undefined` is a file that is not a results object at all.\n */\nexport function parseResults(text: string): DocDetectiveResults | null | undefined {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return undefined;\n }\n if (parsed === null) return null;\n if (!isRecord(parsed) || !isRecord(parsed[\"summary\"])) return undefined;\n if (counts(parsed[\"summary\"][\"tests\"]) === undefined) return undefined;\n if (!Array.isArray(parsed[\"specs\"])) return undefined;\n return parsed;\n}\n\n/** The test-level counts, which the summary line reports. */\nexport function testCounts(results: DocDetectiveResults | null): ResultCounts {\n if (results === null || !isRecord(results[\"summary\"])) return { ...ZERO_COUNTS };\n return counts(results[\"summary\"][\"tests\"]) ?? { ...ZERO_COUNTS };\n}\n\n/** Whether anything failed, at any level Doc Detective counts. */\nexport function anyFailed(results: DocDetectiveResults | null): boolean {\n if (results === null) return false;\n const summary = results[\"summary\"];\n if (!isRecord(summary)) return false;\n return Object.values(summary).some((level) => (counts(level)?.fail ?? 0) > 0);\n}\n\n/**\n * Every FAIL and WARNING step, in the order Doc Detective ran them. A step\n * that fails the same way in several contexts, one per browser or platform,\n * is one finding.\n */\nexport function collectFindings(results: DocDetectiveResults | null, cwd: string): TestFinding[] {\n if (results === null) return [];\n const out: TestFinding[] = [];\n const seen = new Set<string>();\n for (const spec of records(results[\"specs\"])) {\n for (const test of records(spec[\"tests\"])) {\n const contentPath = test[\"contentPath\"] ?? spec[\"contentPath\"];\n // Without a contentPath the file is unknown, and `\"\"` says so: the\n // github reporter then leaves `file=` off the annotation. A URL input\n // is reported as Doc Detective names it; only a file path is relative.\n const file =\n typeof contentPath !== \"string\"\n ? \"\"\n : /^[a-z][a-z0-9+.-]*:\\/\\//i.test(contentPath)\n ? contentPath\n : relative(cwd, contentPath).replace(/\\\\/g, \"/\");\n for (const context of records(test[\"contexts\"])) {\n for (const step of records(context[\"steps\"])) {\n const result = step[\"result\"];\n if (result !== \"FAIL\" && result !== \"WARNING\") continue;\n const location = step[\"location\"];\n const line = isRecord(location) ? location[\"line\"] : undefined;\n const resultDescription = step[\"resultDescription\"];\n const description = typeof resultDescription === \"string\" ? resultDescription : \"\";\n const action = Object.keys(step).find((key) => ACTIONS.has(key));\n const key = JSON.stringify([file, line, action, result, description]);\n if (seen.has(key)) continue;\n seen.add(key);\n const stated = step[\"description\"];\n out.push({\n file,\n ...(typeof line === \"number\" ? { line } : {}),\n result,\n description,\n ...(action === undefined ? {} : { action }),\n guidance: {\n id: \"Doc Detective\",\n rule: action ?? null,\n description: typeof stated === \"string\" && stated !== \"\" ? stated : null,\n guide: action === undefined ? null : `${ACTIONS_GUIDE}${action.toLowerCase()}`,\n },\n });\n }\n }\n }\n }\n return out;\n}\n","/**\n * `manni test tasks`: a synthetic user attempts a task from a page, a URL or\n * a journey, and its trace and workspace are judged against the docs.\n *\n * A run is one start, one task and one persona (plan §4.2). Every run is\n * assembled and validated before the first starts, so a bad id or a missing\n * page stops the command before Claude Code spends a turn. Runs go one after\n * another. Each gets a fresh temp directory, its stream is saved under\n * `.manni/test/tasks/<run-id>/` as it arrives, and the judge reads the rest.\n */\nimport { existsSync } from \"node:fs\";\nimport { appendFile, mkdir, rm, writeFile } from \"node:fs/promises\";\nimport { join, relative, resolve, sep } from \"node:path\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport { findConfigFile, readConfigFile, type ConfigFile } from \"../../shared/config-file.js\";\nimport { errorMessage, ToolError } from \"../../shared/errors.js\";\nimport { claudeCliMcpConfigPath, DEFAULT_CLAUDE_CLI_MAX_TURNS } from \"../../shared/tools.js\";\nimport { notice, warn } from \"../../shared/warn.js\";\nimport { notFoundMessage, STDIN_TOKEN } from \"../../meta/internal.js\";\nimport { parseTraceFile } from \"../../tracevals/trace/claude.js\";\nimport {\n claudeCodeArgs,\n claudeCodeEnv,\n classifyRun,\n lineSplitter,\n mcpServerNames,\n progressLine,\n realClaudeCodeSpawn,\n toolUses,\n type ClaudeCodeSpawn,\n} from \"../core/claude-code.js\";\nimport { judgeRun } from \"../core/judge-run.js\";\nimport { rolePrompt, taskBriefFor } from \"../core/prompts.js\";\nimport { loadTaskRecords } from \"../core/task-records.js\";\nimport type {\n JudgeRun,\n SourceLocation,\n TaskEval,\n TaskJourney,\n TaskPersona,\n TaskSpec,\n TaskStart,\n WorkspaceChanges,\n} from \"../core/task-types.js\";\nimport { prepareRun, workspaceChanges } from \"../core/workspace.js\";\nimport { TestError } from \"../errors.js\";\n\nexport type { TaskEval } from \"../core/task-types.js\";\n\nexport interface RunTasksOptions {\n /** Page paths and `http(s)://` URLs: where the synthetic user starts. */\n targets?: string[];\n /** `--task <text>`. */\n task?: string;\n /** `--journey <id>`, repeatable. */\n journeys?: string[];\n /** `--persona <id>`, repeatable. */\n personas?: string[];\n /** `--workspace <dir>`: the seed, overriding a journey's. */\n workspace?: string;\n /** `-c, --config`. */\n configPath?: string;\n cwd?: string;\n /** `--provider`, the judge's. */\n provider?: string;\n /** `--model`, the judge's. */\n model?: string;\n /** Keep each run's temp directory and name it on stderr. */\n keep?: boolean;\n /** An empty golden set is a pass. */\n allowEmpty?: boolean;\n /** Stream each action to stderr. */\n progress?: boolean;\n /** Test seam: how Claude Code is started. */\n spawn?: ClaudeCodeSpawn;\n /** Test seam: the judge. */\n judge?: JudgeRun;\n /** Test seam: the judge's provider, handed to the judge. */\n judgeProvider?: InferenceProvider;\n /** Test seam: the clock run ids are stamped from. */\n now?: () => Date;\n}\n\nexport interface TaskRun {\n /** `<UTC timestamp>-<journey id or \"task\">-<persona id or \"newcomer\">`. */\n id: string;\n journey: string | null;\n /** The `--task` text, or the journey's title. */\n task: string;\n persona: string | null;\n /** The start: a path as given, or the URL. */\n start: string;\n /** The seed as given, or null for an empty workspace. */\n workspace: string | null;\n /** The kept workspace's absolute path under `--keep`. */\n kept: string | null;\n /** The saved stream, relative to the working directory. */\n trace: string;\n turns: number;\n durationMs: number;\n stoppedAtLimit: boolean;\n /** The turn limit the run had. */\n maxTurns: number;\n usage: { inputTokens: number; outputTokens: number; costUsd?: number };\n docs: string[];\n changes: WorkspaceChanges;\n /** The synthetic user's last message. */\n account: string;\n evals: TaskEval[];\n outcome: \"pass\" | \"fail\";\n}\n\nexport interface TasksReport {\n runs: TaskRun[];\n summary: { runs: number; passed: number; failed: number; warnings: number };\n exitCode: 0 | 1;\n}\n\nconst NOTHING_TO_RUN =\n \"nothing to run: no journey declares evals:. Pass --task with a page or URL, or --journey <id>.\";\n\nconst isUrl = (target: string): boolean => /^https?:\\/\\//i.test(target);\n\nconst toPosix = (path: string): string => path.split(sep).join(\"/\");\n\n/** A sibling's `ToolError` reported as this domain's. */\nasync function asTestError<T>(work: () => Promise<T>): Promise<T> {\n try {\n return await work();\n } catch (err) {\n if (err instanceof ToolError && !(err instanceof TestError)) throw new TestError(err.message);\n throw err;\n }\n}\n\nconst toError = (message: string): Error => new TestError(message);\n\nasync function loadConfig(cwd: string, configPath: string | undefined): Promise<ConfigFile | null> {\n const opts = { section: \"test\", legacyNames: [], toError };\n const file =\n configPath === undefined ? await findConfigFile(cwd, opts) : await readConfigFile(configPath, cwd, opts);\n if (file !== null && file.wrapped && file.value !== null) {\n throw new TestError(\n `${file.source}: test has no keys. Doc Detective's settings live under tools.doc-detective, and Claude Code's under tools.claude-cli.`,\n );\n }\n return file;\n}\n\n/** `20261023T140211Z`. */\nfunction stamp(date: Date): string {\n return date.toISOString().replace(/[-:]/g, \"\").replace(/\\.\\d+Z$/, \"Z\");\n}\n\nexport function labelOf(spec: Pick<TaskSpec, \"journey\" | \"persona\">): string {\n return `${spec.journey?.id ?? \"task\"} as ${spec.persona?.id ?? \"newcomer\"}`;\n}\n\n/** The run passes when no `error` eval failed, errored or needs review. */\nfunction runOutcome(evals: TaskEval[]): \"pass\" | \"fail\" {\n return evals.some((e) => e.severity === \"error\" && (e.outcome === \"fail\" || e.outcome === \"error\" || e.outcome === \"needs-review\"))\n ? \"fail\"\n : \"pass\";\n}\n\nexport async function runTasks(opts: RunTasksOptions = {}): Promise<TasksReport> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const targets = opts.targets ?? [];\n const journeyIds = opts.journeys ?? [];\n const personaIds = opts.personas ?? [];\n const task = opts.task;\n\n // Usage first: none of these needs a file read.\n if (targets.includes(STDIN_TOKEN)) {\n throw new TestError(\"manni test tasks reads no stdin. Pass a page path or URL.\");\n }\n if (task !== undefined && journeyIds.length > 0) {\n throw new TestError(\"--task and --journey both name the task. Pass one.\");\n }\n if (task !== undefined && targets.length === 0) {\n throw new TestError(\"--task needs a page or URL to start from.\");\n }\n if (task === undefined && journeyIds.length === 0 && targets.length > 0) {\n throw new TestError('a start page needs a task. Pass --task \"<what the reader wants>\" or --journey <id>.');\n }\n const missing = targets.filter((t) => !isUrl(t) && !existsSync(resolve(cwd, t))).map((t) => t.replace(/\\\\/g, \"/\"));\n if (missing.length > 0) throw new TestError(notFoundMessage(missing));\n let workspaceOverride: { abs: string; display: string } | undefined;\n if (opts.workspace !== undefined) {\n const abs = resolve(cwd, opts.workspace);\n if (!existsSync(abs)) throw new TestError(`--workspace \"${opts.workspace}\" does not exist.`);\n workspaceOverride = { abs, display: opts.workspace.replace(/\\\\/g, \"/\") };\n }\n\n const file = await loadConfig(cwd, opts.configPath);\n const configDir = file?.dir ?? cwd;\n const claude = file?.tools[\"claude-cli\"] ?? {};\n const mcpConfig = file === null ? undefined : claudeCliMcpConfigPath(file.tools, file.dir);\n let mcpServers: string[] = [];\n if (file !== null && mcpConfig !== undefined) {\n const label = `${file.source}: tools.claude-cli.mcpConfig \"${claude.mcpConfig ?? \"\"}\"`;\n if (!existsSync(mcpConfig)) throw new TestError(`${label} does not exist.`);\n mcpServers = mcpServerNames(mcpConfig, label);\n }\n const maxTurns = claude.maxTurns ?? DEFAULT_CLAUDE_CLI_MAX_TURNS;\n\n const records = loadTaskRecords(file, cwd);\n const pathStart = (abs: string): TaskStart => ({ kind: \"path\", display: toPosix(relative(cwd, abs)) || \".\", abs });\n const targetStarts: TaskStart[] = targets.map((t) =>\n isUrl(t) ? { kind: \"url\", url: t } : { kind: \"path\", display: t.replace(/\\\\/g, \"/\"), abs: resolve(cwd, t) },\n );\n const explicitPersonas: TaskPersona[] = [];\n for (const id of personaIds) explicitPersonas.push(await records.persona(id));\n\n // Each task with the journey it came from (none for `--task`).\n let journeys: TaskJourney[] = [];\n if (task === undefined) {\n if (journeyIds.length > 0) {\n for (const id of journeyIds) journeys.push(await records.journey(id));\n } else {\n journeys = await records.golden();\n if (journeys.length === 0) {\n if (opts.allowEmpty === true) return { runs: [], summary: { runs: 0, passed: 0, failed: 0, warnings: 0 }, exitCode: 0 };\n throw new TestError(NOTHING_TO_RUN);\n }\n }\n }\n\n const specs: TaskSpec[] = [];\n if (task !== undefined) {\n const personas = explicitPersonas.length > 0 ? explicitPersonas : [null];\n for (const start of targetStarts) {\n for (const persona of personas) {\n specs.push({\n task,\n journey: null,\n persona,\n start,\n workspaceSeed: workspaceOverride?.abs ?? null,\n workspaceDisplay: workspaceOverride?.display ?? null,\n });\n }\n }\n }\n for (const journey of journeys) {\n let starts = targetStarts;\n if (starts.length === 0) {\n const entry = journey.entryPoint;\n if (entry === undefined) {\n throw new TestError(\n `journey \"${journey.id}\" has no entry-point:. Add one to ${journey.file}, or pass the page to start from.`,\n );\n }\n if (isUrl(entry.value)) {\n starts = [{ kind: \"url\", url: entry.value }];\n } else {\n starts = [pathStart(recordedPath(\"entry-point\", entry, configDir))];\n }\n }\n let seed = workspaceOverride ?? null;\n if (seed === null && journey.workspace !== undefined) {\n const abs = recordedPath(\"workspace\", journey.workspace, configDir);\n seed = { abs, display: toPosix(relative(cwd, abs)) || \".\" };\n }\n let personas: (TaskPersona | null)[] = explicitPersonas;\n if (personas.length === 0) {\n personas = [];\n for (const id of journey.personas) personas.push(await records.persona(id, journey));\n if (personas.length === 0) personas = [null];\n }\n for (const start of starts) {\n for (const persona of personas) {\n specs.push({\n task: journey.title,\n journey,\n persona,\n start,\n workspaceSeed: seed?.abs ?? null,\n workspaceDisplay: seed?.display ?? null,\n });\n }\n }\n }\n\n const runs: TaskRun[] = [];\n for (const spec of specs) {\n runs.push(\n await asTestError(() =>\n runOne(spec, {\n cwd,\n file,\n configDir,\n maxTurns,\n ...(claude.model === undefined ? {} : { model: claude.model }),\n ...(mcpConfig === undefined ? {} : { mcpConfig }),\n mcpServers,\n opts,\n }),\n ),\n );\n }\n const passed = runs.filter((r) => r.outcome === \"pass\").length;\n const warnings = runs\n .flatMap((r) => r.evals)\n .filter((e) => e.severity === \"warning\" && e.outcome !== \"pass\" && e.outcome !== \"skipped\").length;\n return {\n runs,\n summary: { runs: runs.length, passed, failed: runs.length - passed, warnings },\n exitCode: passed === runs.length ? 0 : 1,\n };\n}\n\ninterface RunContext {\n cwd: string;\n file: ConfigFile | null;\n configDir: string;\n maxTurns: number;\n model?: string;\n mcpConfig?: string;\n mcpServers: string[];\n opts: RunTasksOptions;\n}\n\n/** A path a journey names, resolved; one that is not there is a broken record. */\nfunction recordedPath(\n key: string,\n path: { value: string; location: SourceLocation },\n configDir: string,\n): string {\n const abs = resolve(configDir, path.value);\n if (!existsSync(abs)) {\n throw new TestError(`${path.location.file}:${String(path.location.line)}: ${key} \"${path.value}\" does not exist.`);\n }\n return abs;\n}\n\n/**\n * Claim a run directory and return its id. Creating a directory either\n * succeeds or fails with `EEXIST`, so two runs started in the same second, in\n * this process or another, never share one; the later takes `-2`, `-3`, ….\n */\nasync function claimRunDir(dir: string, base: string): Promise<string> {\n await mkdir(dir, { recursive: true });\n for (let n = 1; ; n++) {\n const id = n === 1 ? base : `${base}-${String(n)}`;\n try {\n await mkdir(join(dir, id));\n return id;\n } catch (err) {\n if (!(err instanceof Error && \"code\" in err && err.code === \"EEXIST\")) throw err;\n }\n }\n}\n\nasync function runOne(spec: TaskSpec, ctx: RunContext): Promise<TaskRun> {\n const { opts } = ctx;\n const label = labelOf(spec);\n const who = spec.persona?.id ?? \"newcomer\";\n const tasksDir = join(ctx.configDir, \".manni\", \"test\", \"tasks\");\n const id = await claimRunDir(tasksDir, `${stamp((opts.now ?? (() => new Date()))())}-${spec.journey?.id ?? \"task\"}-${who}`);\n const runDir = join(tasksDir, id);\n const tracePath = join(runDir, \"trace.jsonl\");\n await writeFile(tracePath, \"\");\n\n const dirs = await prepareRun(spec.start, spec.workspaceSeed, ctx.file);\n try {\n const role = rolePrompt(spec.persona);\n const roleFile = join(dirs.root, \"role.md\");\n const startFromWorkspace =\n dirs.startCopy === null ? null : toPosix(relative(dirs.workspaceDir, dirs.startCopy));\n const brief = taskBriefFor(spec, startFromWorkspace);\n await writeFile(roleFile, role);\n await writeFile(join(runDir, \"role.md\"), role);\n await writeFile(join(runDir, \"brief.md\"), brief);\n\n if (opts.progress === true) {\n const where =\n spec.workspaceDisplay === null ? \"in an empty directory\" : `in a fresh copy of ${spec.workspaceDisplay}`;\n process.stderr.write(`${label}: starting ${where}\\n`);\n }\n const lines = lineSplitter((line) => {\n if (opts.progress !== true || line === \"\") return;\n for (const use of toolUses(line)) {\n process.stderr.write(`${progressLine(who, use.name, use.input, dirs.workspaceDir)}\\n`);\n }\n });\n // Appends are chained so the file keeps the stream's order.\n let writing = Promise.resolve();\n const result = await (opts.spawn ?? realClaudeCodeSpawn)(\n claudeCodeArgs({\n roleFile,\n maxTurns: ctx.maxTurns,\n ...(ctx.model === undefined ? {} : { model: ctx.model }),\n ...(ctx.mcpConfig === undefined ? {} : { mcpConfig: ctx.mcpConfig }),\n mcpServers: ctx.mcpServers,\n docsDir: dirs.docsDir,\n }),\n {\n cwd: dirs.workspaceDir,\n stdin: brief,\n env: claudeCodeEnv(dirs.globalDir),\n onStdout: (chunk) => {\n writing = writing.then(() => appendFile(tracePath, chunk));\n lines.push(chunk);\n },\n },\n );\n lines.end();\n await writing;\n const outcome = classifyRun(result, label);\n\n const trace = await parseTraceFile(tracePath);\n const changes = await workspaceChanges(spec.workspaceSeed, dirs.workspaceDir);\n const account = trace.assistantTexts.at(-1) ?? \"\";\n const judged = await (opts.judge ?? judgeRun)(\n {\n spec,\n trace,\n tracePath,\n workspaceDir: dirs.workspaceDir,\n docsDir: dirs.docsDir,\n startCopy: dirs.startCopy,\n account,\n changes,\n configDir: ctx.configDir,\n },\n {\n ...(opts.provider === undefined ? {} : { provider: opts.provider }),\n ...(opts.model === undefined ? {} : { model: opts.model }),\n providers: ctx.file?.providers ?? {},\n ...(opts.judgeProvider === undefined ? {} : { judgeProvider: opts.judgeProvider }),\n },\n );\n let kept: string | null = null;\n if (opts.keep === true) {\n kept = dirs.workspaceDir;\n notice(`kept ${label}'s workspace: ${kept}`);\n }\n const usage = trace.usage;\n return {\n id,\n journey: spec.journey?.id ?? null,\n task: spec.task,\n persona: spec.persona?.id ?? null,\n start: spec.start.kind === \"url\" ? spec.start.url : spec.start.display,\n workspace: spec.workspaceDisplay,\n kept,\n trace: toPosix(relative(ctx.cwd, tracePath)),\n turns: trace.turnCount,\n durationMs: outcome.durationMs,\n stoppedAtLimit: outcome.stoppedAtLimit,\n maxTurns: ctx.maxTurns,\n usage: {\n inputTokens: usage?.inputTokens ?? 0,\n outputTokens: usage?.outputTokens ?? 0,\n ...(usage?.totalCostUsd === undefined ? {} : { costUsd: usage.totalCostUsd }),\n },\n docs: judged.docs,\n changes,\n account,\n evals: judged.evals,\n outcome: runOutcome(judged.evals),\n };\n } finally {\n if (opts.keep !== true) await removeRunDir(dirs.root, label);\n }\n}\n\n/**\n * Remove a run's temp directory, or say why not. A process the synthetic\n * user started, such as a browser, can outlive Claude Code and hold a file\n * open, and on Windows that fails the removal. The run is over by then, so\n * its report still prints and its exit code stands.\n */\nasync function removeRunDir(root: string, label: string): Promise<void> {\n try {\n // Retries cover a process that is still exiting.\n await rm(root, { recursive: true, force: true, maxRetries: 3, retryDelay: 500 });\n } catch (err) {\n warn(\n `could not remove ${root} after ${label}: ${errorMessage(err)}. ` +\n \"A process the synthetic user started may still hold it; remove it by hand.\",\n );\n }\n}\n","/**\n * The Claude Code process seam: the only module that starts `claude`. Unit\n * tests inject a `ClaudeCodeSpawn`; the real one is `realClaudeCodeSpawn`.\n *\n * The argv is the one the build's spike settled (plan §4.5): stream-json out,\n * no session saved, none of the user's settings, plugins, hooks or MCP\n * servers, a fixed tool set, and permission to use exactly that set without\n * asking. Whether a run produced a result is read from its final `result`\n * event, never from the exit code, which is 1 both at the turn limit and\n * when Claude Code is signed out.\n */\nimport { spawn } from \"node:child_process\";\nimport { readFileSync, statSync } from \"node:fs\";\nimport { isAbsolute, join, relative, sep, win32 } from \"node:path\";\nimport type { ExecResult } from \"@hawkeyexl/inference\";\nimport { outputTail, realExec } from \"../../shared/exec.js\";\nimport { TestError } from \"../errors.js\";\n\n/**\n * Start Claude Code with `args` (its own flags, no program name), feed it\n * `stdin`, and wait. Each stdout chunk is handed to `onStdout` as it arrives;\n * the output is also returned whole.\n */\nexport type ClaudeCodeSpawn = (\n args: string[],\n opts: {\n cwd: string;\n stdin: string;\n env: Record<string, string | undefined>;\n onStdout: (chunk: string) => void;\n },\n) => Promise<ExecResult>;\n\nexport const CLAUDE_CODE_NOT_ON_PATH =\n \"Claude Code is not on PATH. Install it with npm install -g @anthropic-ai/claude-code, sign in, and run again.\";\n\n/** The tools the synthetic user gets. `Bash` and no `PowerShell`, so a golden eval naming `Bash` holds on Windows. */\nexport const TASK_TOOLS = [\"Read\", \"Write\", \"Edit\", \"Glob\", \"Grep\", \"Bash\", \"WebFetch\"] as const;\n\n/** No timeout: the turn limit bounds a run. */\nconst NO_TIMEOUT = 2 ** 31 - 1;\n\nexport interface ClaudeCodeArgs {\n roleFile: string;\n maxTurns: number;\n model?: string;\n /** Absolute. */\n mcpConfig?: string;\n /** The server names in `mcpConfig`, each allowed as `mcp__<name>`. */\n mcpServers: string[];\n /** The docs copy, for a path start. */\n docsDir: string | null;\n}\n\nexport function claudeCodeArgs(opts: ClaudeCodeArgs): string[] {\n // On purpose, the two lists differ. `--tools` picks from Claude Code's\n // built-in tools only; MCP tools arrive through `--mcp-config` and need\n // naming in `--allowedTools` alone to run without a prompt.\n const tools = TASK_TOOLS.join(\",\");\n const allowed = [...TASK_TOOLS, ...opts.mcpServers.map((name) => `mcp__${name}`)].join(\",\");\n return [\n \"-p\",\n \"--output-format\",\n \"stream-json\",\n \"--verbose\",\n \"--no-session-persistence\",\n \"--setting-sources\",\n \"\",\n \"--strict-mcp-config\",\n ...(opts.mcpConfig === undefined ? [] : [\"--mcp-config\", opts.mcpConfig]),\n \"--tools\",\n tools,\n \"--allowedTools\",\n allowed,\n \"--permission-mode\",\n \"dontAsk\",\n \"--append-system-prompt-file\",\n opts.roleFile,\n \"--max-turns\",\n String(opts.maxTurns),\n ...(opts.model === undefined ? [] : [\"--model\", opts.model]),\n ...(opts.docsDir === null ? [] : [\"--add-dir\", opts.docsDir]),\n ];\n}\n\n/** The `mcpServers` names in an MCP config file. */\nexport function mcpServerNames(path: string, label: string): string[] {\n let parsed: unknown;\n try {\n parsed = JSON.parse(readFileSync(path, \"utf8\"));\n } catch {\n throw new TestError(`${label} is not a JSON file Claude Code can read.`);\n }\n const servers =\n typeof parsed === \"object\" && parsed !== null ? (parsed as Record<string, unknown>)[\"mcpServers\"] : undefined;\n return typeof servers === \"object\" && servers !== null && !Array.isArray(servers) ? Object.keys(servers) : [];\n}\n\n/**\n * The environment Claude Code runs in: the caller's, with the npm global\n * prefix moved into the run, and that prefix's bin first on PATH, so a\n * global install the docs ask for lands in the run and goes with it.\n */\nexport function claudeCodeEnv(\n globalDir: string,\n env: NodeJS.ProcessEnv = process.env,\n platform: NodeJS.Platform = process.platform,\n): Record<string, string | undefined> {\n // Windows keeps the variable as `Path`; a second `PATH` beside it is ambiguous.\n const pathKey = Object.keys(env).find((key) => key.toUpperCase() === \"PATH\") ?? \"PATH\";\n const bin = platform === \"win32\" ? globalDir : join(globalDir, \"bin\");\n const current = env[pathKey];\n const sepr = platform === \"win32\" ? \";\" : \":\";\n return {\n ...env,\n NPM_CONFIG_PREFIX: globalDir,\n [pathKey]: current === undefined || current === \"\" ? bin : `${bin}${sepr}${current}`,\n };\n}\n\n/** One line per tool call, for `--progress`. */\nexport function progressLine(who: string, tool: string, input: Record<string, unknown>, workspaceDir: string): string {\n const main =\n [\"file_path\", \"path\", \"command\", \"pattern\", \"url\", \"query\"].map((k) => input[k]).find((v) => typeof v === \"string\") ??\n Object.values(input).find((v) => typeof v === \"string\");\n let shown = typeof main === \"string\" ? main.replace(/\\s+/g, \" \").trim() : \"\";\n if (isAbsolute(shown) && !/\\s/.test(shown)) {\n shown = relative(workspaceDir, shown).split(sep).join(\"/\");\n }\n return ` ${who} › ${tool}${shown === \"\" ? \"\" : ` ${shown.slice(0, 80)}`}`;\n}\n\n/** The `tool_use` blocks in one stream-json line. */\nexport function toolUses(line: string): { name: string; input: Record<string, unknown> }[] {\n const rec = parseLine(line);\n if (rec?.[\"type\"] !== \"assistant\") return [];\n const message = rec[\"message\"];\n const content =\n typeof message === \"object\" && message !== null ? (message as Record<string, unknown>)[\"content\"] : undefined;\n if (!Array.isArray(content)) return [];\n return content.flatMap((block: unknown) => {\n if (typeof block !== \"object\" || block === null) return [];\n const b = block as Record<string, unknown>;\n if (b[\"type\"] !== \"tool_use\" || typeof b[\"name\"] !== \"string\") return [];\n const input = typeof b[\"input\"] === \"object\" && b[\"input\"] !== null ? (b[\"input\"] as Record<string, unknown>) : {};\n return [{ name: b[\"name\"], input }];\n });\n}\n\nfunction parseLine(line: string): Record<string, unknown> | undefined {\n try {\n const rec: unknown = JSON.parse(line);\n return typeof rec === \"object\" && rec !== null && !Array.isArray(rec) ? (rec as Record<string, unknown>) : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Calls `onLine` with each complete line of a stream fed in chunks. */\nexport function lineSplitter(onLine: (line: string) => void): { push(chunk: string): void; end(): void } {\n let buffer = \"\";\n return {\n push(chunk) {\n buffer += chunk;\n let at = buffer.indexOf(\"\\n\");\n while (at !== -1) {\n onLine(buffer.slice(0, at).trim());\n buffer = buffer.slice(at + 1);\n at = buffer.indexOf(\"\\n\");\n }\n },\n end() {\n if (buffer.trim() !== \"\") onLine(buffer.trim());\n buffer = \"\";\n },\n };\n}\n\nexport interface RunOutcome {\n stoppedAtLimit: boolean;\n durationMs: number;\n}\n\n/**\n * Read the run's final `result` event. The turn limit is a normal end; an\n * error result, or none at all, means Claude Code never did the task.\n */\nexport function classifyRun(result: ExecResult, label: string): RunOutcome {\n if (result.spawnError !== undefined) throw new TestError(CLAUDE_CODE_NOT_ON_PATH);\n let last: Record<string, unknown> | undefined;\n for (const line of result.stdout.split(\"\\n\")) {\n const rec = parseLine(line.trim());\n if (rec?.[\"type\"] === \"result\") last = rec;\n }\n const durationMs = typeof last?.[\"duration_ms\"] === \"number\" ? last[\"duration_ms\"] : 0;\n if (last?.[\"subtype\"] === \"error_max_turns\") return { stoppedAtLimit: true, durationMs };\n if (last !== undefined && last[\"is_error\"] !== true) return { stoppedAtLimit: false, durationMs };\n const said = typeof last?.[\"result\"] === \"string\" && last[\"result\"].trim() !== \"\" ? last[\"result\"].trim() : undefined;\n const why = said ?? (outputTail(result) || `exit ${String(result.code)}`);\n throw new TestError(`Claude Code stopped without a result for ${label}: ${why}`);\n}\n\n/** How Claude Code is started on this host. */\nexport interface ClaudeLaunch {\n command: string;\n args: string[];\n /** Only a `.cmd` shim with no script to run directly: started through `realExec`, without streaming. */\n viaShim: boolean;\n}\n\n/**\n * On Windows, Node starts a `.exe` on PATH but not a `.cmd` shim. An npm\n * global install puts a shim there, so the program it points at is run\n * directly: a script with node, an executable as is.\n */\nexport function claudeLaunchFor(\n args: string[],\n host: { platform: NodeJS.Platform; path: string; isFile: (path: string) => boolean; read: (path: string) => string },\n): ClaudeLaunch {\n if (host.platform !== \"win32\") return { command: \"claude\", args, viaShim: false };\n for (const entry of host.path.split(\";\")) {\n const dir = entry.replace(/^\"(.*)\"$/, \"$1\");\n if (dir === \"\") continue;\n const exe = win32.join(dir, \"claude.exe\");\n if (host.isFile(exe)) return { command: exe, args, viaShim: false };\n const shim = win32.join(dir, \"claude.cmd\");\n if (!host.isFile(shim)) continue;\n const target = /\"%~?dp0%?\\\\([^\"]+)\"/.exec(host.read(shim))?.[1];\n const abs = target === undefined ? undefined : win32.resolve(win32.dirname(shim), target);\n if (abs !== undefined && host.isFile(abs)) {\n const ext = win32.extname(abs).toLowerCase();\n if (ext === \".js\" || ext === \".cjs\" || ext === \".mjs\") {\n return { command: process.execPath, args: [abs, ...args], viaShim: false };\n }\n if (ext === \".exe\") return { command: abs, args, viaShim: false };\n }\n break;\n }\n return { command: \"claude\", args, viaShim: true };\n}\n\nfunction isFile(path: string): boolean {\n try {\n return statSync(path).isFile();\n } catch {\n return false;\n }\n}\n\nexport const realClaudeCodeSpawn: ClaudeCodeSpawn = async (args, opts) => {\n const launch = claudeLaunchFor(args, {\n platform: process.platform,\n path: process.env[\"PATH\"] ?? \"\",\n isFile,\n read: (path) => readFileSync(path, \"utf8\"),\n });\n if (launch.viaShim) {\n // ponytail: a shim with no script beside it is captured and replayed\n // rather than streamed live.\n const result = await realExec([launch.command, ...launch.args], {\n cwd: opts.cwd,\n env: opts.env,\n input: opts.stdin,\n timeoutMs: NO_TIMEOUT,\n });\n opts.onStdout(result.stdout);\n return result;\n }\n return new Promise((settle) => {\n let stdout = \"\";\n let stderr = \"\";\n const child = spawn(launch.command, launch.args, {\n cwd: opts.cwd,\n env: opts.env,\n stdio: [\"pipe\", \"pipe\", \"pipe\"],\n windowsHide: true,\n });\n child.stdin.on(\"error\", () => undefined);\n child.stdin.end(opts.stdin);\n child.stdout.setEncoding(\"utf8\");\n child.stderr.setEncoding(\"utf8\");\n child.stdout.on(\"data\", (chunk: string) => {\n stdout += chunk;\n opts.onStdout(chunk);\n });\n child.stderr.on(\"data\", (chunk: string) => {\n stderr += chunk;\n });\n child.on(\"error\", (err) => {\n settle({ code: null, stdout, stderr, timedOut: false, spawnError: err.message });\n });\n child.on(\"close\", (code) => {\n settle({ code, stdout, stderr, timedOut: false });\n });\n });\n};\n","/**\n * Judging a finished run (plan §4.6, §4.7): the evals it carries, graded\n * against its trace, its workspace and the docs the reader had.\n *\n * Nothing here grades on its own. Deterministic evals run through tracevals'\n * grader registry with the workspace as the project root, judged evals through\n * tracevals' ensemble judge, and the judge's provider comes from tracevals'\n * own selection. A run is one session governed by one task, so each eval plan\n * carries a synthetic project-rules artifact: its window is the whole session,\n * and its content is the task brief the judge reads as the source.\n */\nimport { join, relative, sep } from \"node:path\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport { mapConcurrent } from \"../../shared/concurrency.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { LOCAL_PROVIDER } from \"../../shared/providers.js\";\nimport { evidenceVerdict } from \"../../shared/verdict-lines.js\";\nimport type { ResolvedArtifact } from \"../../tracevals/artifacts/types.js\";\nimport { parseConfig } from \"../../tracevals/core/config.js\";\nimport type { EvalLocation, EvalPlan } from \"../../tracevals/core/plan.js\";\nimport type { EvalEntry } from \"../../tracevals/evals/extract.js\";\nimport { graderFor } from \"../../tracevals/graders/registry.js\";\nimport { REDO_OR_FIX } from \"../../tracevals/graders/util.js\";\nimport {\n constructProvider,\n makeJudgeProvider,\n resolveProviderIdentity,\n} from \"../../tracevals/judge/provider.js\";\nimport { makeTraceJudge, type JudgedEval } from \"../../tracevals/judge/trace-judge.js\";\nimport { TracevalsError } from \"../../tracevals/types.js\";\nimport { TestError } from \"../errors.js\";\nimport { renderEvidence, taskBrief } from \"./evidence.js\";\nimport type {\n JudgeRun,\n JudgeRunOptions,\n RunEvidence,\n SourceLocation,\n TaskEval,\n} from \"./task-types.js\";\n\nexport const FOLLOWED_THE_DOCS_ID = \"followed-the-docs\";\nexport const FOLLOWED_THE_DOCS =\n \"Every step the reader took came from the docs it had, or from what the persona already knows. It did not guess or lean on outside knowledge.\";\nexport const SUCCESS_ID = \"success\";\nexport const COMPLETED_ID = \"completed\";\nexport const CONSTRAINT_ID = \"constraint\";\n\n/** One eval as reported, and the plan that grades it. */\ninterface Slot {\n base: Omit<TaskEval, \"outcome\">;\n plan: EvalPlan;\n}\n\nexport const judgeRun: JudgeRun = async (evidence, options) => {\n const { spec } = evidence;\n const seen = renderEvidence(evidence);\n const artifact: ResolvedArtifact = {\n name: spec.journey?.id ?? \"task\",\n type: \"project-rules\",\n path: spec.journey === null ? \"task\" : join(evidence.configDir, spec.journey.file),\n content: taskBrief(evidence),\n origin: \"project\",\n };\n const providers = await providersFor(options);\n const source = taskSource(evidence);\n\n const slots: Slot[] = [];\n const judged = (\n id: string,\n assertion: string,\n severity: TaskEval[\"severity\"],\n location: SourceLocation | null,\n ): Slot => ({\n base: { id, grader: \"ai\", severity, assertion, location },\n plan: {\n artifact,\n evalName: id,\n assertion,\n grader: \"ai\",\n severity,\n implicit: false,\n location: planLocation(location),\n },\n });\n\n const journey = spec.journey;\n if (journey?.successCriteria !== undefined) {\n const { text, location } = journey.successCriteria;\n slots.push(judged(SUCCESS_ID, text, \"error\", location));\n }\n for (const { entry, location } of journey?.evals ?? []) {\n slots.push({\n base: {\n id: entry.id,\n grader: entry.grader,\n severity: entry.severity,\n assertion: entry.assertion,\n location,\n },\n plan: planFor(entry, artifact, location),\n });\n }\n // A write-in task, or a journey that says nothing about done, is judged on\n // the task alone. Nothing is derived: evals drawn from the docs asked for\n // the docs' own extras (a screenshot the sample took) and failed runs the\n // trace showed were done.\n if (slots.length === 0) {\n slots.push(judged(COMPLETED_ID, `The reader completed the task: ${spec.task}`, \"error\", source));\n }\n slots.push(judged(FOLLOWED_THE_DOCS_ID, FOLLOWED_THE_DOCS, \"warning\", source));\n for (const c of spec.persona?.constraints ?? []) {\n slots.push(judged(CONSTRAINT_ID, c.text, \"warning\", c.location));\n }\n\n const outcomes: (Pick<TaskEval, \"outcome\" | \"message\" | \"consensus\"> | undefined)[] = [];\n const toJudge: { i: number; plan: EvalPlan }[] = [];\n for (const [i, slot] of slots.entries()) {\n if (slot.plan.skipped === true) {\n outcomes[i] = { outcome: \"skipped\", message: slot.plan.skipReason };\n } else if (slot.plan.grader === \"ai\") {\n toJudge.push({ i, plan: slot.plan });\n } else {\n outcomes[i] = await gradeDeterministic(slot.plan, evidence);\n }\n }\n\n if (toJudge.length > 0) {\n const judge = makeTraceJudge({\n provider: providers.judge,\n ...(providers.providerFor === undefined ? {} : { providerFor: providers.providerFor }),\n noCache: true,\n });\n // One eval per call, several calls at once: each is an ensemble of\n // model calls, and judged one after another a run's seven evals took\n // twelve minutes on claude-cli.\n const verdicts = await mapConcurrent(toJudge, providers.concurrency, async (j) =>\n judge([j.plan], () => seen.text, { trace: evidence.trace, projectRoot: evidence.workspaceDir }),\n );\n verdicts.forEach(([v], n) => {\n const i = toJudge[n]?.i;\n if (i !== undefined && v !== undefined) outcomes[i] = fromVerdict(v);\n });\n }\n\n return {\n evals: slots.map((slot, i) => ({\n ...slot.base,\n ...(outcomes[i] ?? { outcome: \"error\", message: \"the judge returned no verdict for this eval\" }),\n })),\n docs: seen.docs,\n };\n};\n\n/** Judged evals in flight at once, except on a local model. */\nconst JUDGE_CONCURRENCY = 4;\n\ninterface Providers {\n judge: InferenceProvider;\n /** One local model context at a time: four exhausted memory (docevals ADR 01039). */\n concurrency: number;\n providerFor?: (choice: { provider?: string; model?: string; origin?: string }) => Promise<InferenceProvider>;\n}\n\n/**\n * The judge. Selection is tracevals'\n * own (`--provider`/`--model`, then `providers:`, then `auto`); its errors\n * leave as `TestError`s, so the CLI exits 2 with the message unchanged.\n */\nasync function providersFor(options: JudgeRunOptions): Promise<Providers> {\n if (options.judgeProvider !== undefined) {\n return { judge: options.judgeProvider, concurrency: 1 };\n }\n try {\n const config = parseConfig({}, { providers: options.providers });\n const flags = {\n ...(options.provider === undefined ? {} : { provider: options.provider }),\n ...(options.model === undefined ? {} : { model: options.model }),\n };\n const identity = await resolveProviderIdentity(config, flags);\n return {\n judge: constructProvider(config, identity),\n providerFor: (choice) => makeJudgeProvider(config, flags, choice),\n concurrency: identity.provider === LOCAL_PROVIDER ? 1 : JUDGE_CONCURRENCY,\n };\n } catch (err) {\n if (err instanceof TracevalsError) throw new TestError(err.message);\n throw err;\n }\n}\n\n/**\n * Where `completed` and `followed-the-docs` are annotated: the journey's\n * `title:` line, the start page's first line, or nowhere for a URL.\n */\nfunction taskSource(evidence: RunEvidence): SourceLocation | null {\n const { journey, start } = evidence.spec;\n if (journey !== null) return journey.titleLocation;\n if (start.kind === \"url\") return null;\n return {\n file: relative(evidence.configDir, start.abs).split(sep).join(\"/\"),\n line: 1,\n };\n}\n\nfunction planLocation(location: SourceLocation | null): EvalLocation {\n return location ?? { file: \"task\" };\n}\n\n/** A golden eval as tracevals' graders and judge read it. */\nfunction planFor(entry: EvalEntry, artifact: ResolvedArtifact, location: SourceLocation): EvalPlan {\n return {\n artifact,\n evalName: entry.id,\n assertion: entry.assertion,\n grader: entry.grader,\n severity: entry.severity,\n implicit: false,\n location: planLocation(location),\n options: entry.options,\n evidence: entry.evidence,\n examples: entry.examples,\n provider: entry.provider,\n model: entry.model,\n runs: entry.runs,\n target: entry.target,\n command: entry.command,\n successExitCodes: entry.successExitCodes,\n timeoutMs: entry.timeoutMs,\n generatedAssertionHash: entry.generatedAssertionHash,\n ...(entry.skip === true ? { skipped: true, skipReason: \"eval skipped via its own skip: true\" } : {}),\n };\n}\n\n/**\n * A deterministic eval, graded in the workspace: `command` runs there and a\n * `{ source: file }` target reads it. Any finding fails the eval; whether\n * that fails the run is the eval's severity, which the caller reads.\n */\nasync function gradeDeterministic(\n plan: EvalPlan,\n evidence: RunEvidence,\n): Promise<Pick<TaskEval, \"outcome\" | \"message\">> {\n const grader = graderFor(plan.grader);\n if (grader === undefined) {\n return { outcome: \"error\", message: `no grader \"${plan.grader}\"` };\n }\n try {\n const result = await grader.grade({\n trace: evidence.trace,\n plan,\n projectRoot: evidence.workspaceDir,\n });\n if (result.error !== undefined) return { outcome: \"error\", message: result.error };\n if (result.skipped !== undefined) return { outcome: \"skipped\", message: result.skipped };\n if (result.findings.length === 0) return { outcome: \"pass\" };\n return {\n outcome: \"fail\",\n // tracevals' advice names an artifact; a run is graded against a task.\n message: result.findings.map((f) => f.message.replace(` ${REDO_OR_FIX}`, \"\")).join(\" \"),\n };\n } catch (err) {\n return { outcome: \"error\", message: `${plan.grader}: ${errorMessage(err)}` };\n }\n}\n\nfunction fromVerdict(v: JudgedEval): Pick<TaskEval, \"outcome\" | \"message\" | \"consensus\"> {\n const reasoning = v.consensus === undefined ? undefined : evidenceVerdict(v.consensus)?.reasoning;\n return {\n outcome: v.outcome,\n message: v.error ?? v.skipReason ?? reasoning,\n ...(v.consensus === undefined\n ? {}\n : {\n consensus: {\n votes: { ...v.consensus.votes },\n meanConfidence: v.consensus.meanConfidence,\n },\n }),\n };\n}\n","/**\n * What the judge sees of a finished run (proposal plan §4.6): the trace, the\n * workspace's changes and the docs the reader had. Built once per run, and\n * every judged eval reads the same text.\n *\n * Every block is redacted before it is cut, as tracevals' own render does, so\n * a cap never leaves the prefix of a secret behind.\n */\nimport { readFileSync, realpathSync } from \"node:fs\";\nimport { isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { makeRedactor } from \"../../tracevals/judge/redact.js\";\nimport type { TraceEvent } from \"../../tracevals/trace/types.js\";\nimport type { RunEvidence, TaskSpec } from \"./task-types.js\";\n\nexport const MAX_TOOL_RESULT_CHARS = 2_000;\nexport const MAX_FILE_CHARS = 4_000;\nexport const MAX_WORKSPACE_CHARS = 20_000;\nexport const MAX_DOCS_CHARS = 40_000;\n\nconst scrub = makeRedactor();\n\n/**\n * Redact, then cut to `max`, saying how much was left out. The note says the\n * cut is the judge's copy: a judge once read \"left out\" as the reader having\n * skimmed, and failed a constraint over it.\n */\nfunction clip(text: string, max: number): string {\n return budgeted(text, max).body;\n}\n\n/**\n * `clip`, plus how much of a shared budget the result uses: the redacted\n * text the judge is sent, never the raw length a redaction shortened.\n */\nfunction budgeted(text: string, max: number): { body: string; used: number } {\n const safe = scrub(text);\n if (safe.length <= max) return { body: safe, used: safe.length };\n return {\n body: `${safe.slice(0, max)} [manni shortened this for the judge; the reader received ${String(safe.length - max)} more characters]`,\n used: max,\n };\n}\n\n/** A page the reader had: its name in the `docs` list and its text. */\ninterface DocPage {\n name: string;\n text: string;\n}\n\nexport interface Evidence {\n /** The judge's view of the run, §4.6's three sections. */\n text: string;\n /** The docs section alone, as it appears inside `text`. */\n docsText: string;\n /** The pages in `docsText`, start page first: docs-relative POSIX paths, or URLs. */\n docs: string[];\n}\n\nexport function renderEvidence(evidence: RunEvidence): Evidence {\n const results = toolResults(evidence.trace.events);\n const { text: docsText, docs } = renderDocs(evidence, results);\n const text = [\n \"## The trace\",\n renderTrace(evidence, results),\n \"## The workspace\",\n renderWorkspace(evidence),\n \"## The docs the reader had\",\n docsText,\n ].join(\"\\n\\n\");\n return { text, docsText, docs };\n}\n\n/**\n * The task as the reader was told it: the task, what started it, when it is\n * done, and where to start. The judge reads it as the source its evals come\n * from.\n */\nexport function taskBrief(evidence: RunEvidence): string {\n const { spec } = evidence;\n const lines = [spec.task];\n if (spec.journey?.trigger !== undefined) lines.push(`What started this: ${spec.journey.trigger}`);\n if (spec.journey?.successCriteria !== undefined) {\n lines.push(`You're done when: ${spec.journey.successCriteria.text}`);\n }\n lines.push(`Start here: ${startName(evidence)}`);\n return [...lines, \"\", whoTheReaderIs(spec)].join(\"\\n\");\n}\n\n/** The start page as the docs list names it: docs-relative, or the URL. */\nfunction startName(evidence: RunEvidence): string {\n const { start } = evidence.spec;\n if (start.kind === \"url\") return start.url;\n if (evidence.docsDir !== null && evidence.startCopy !== null) {\n return toPosix(relative(real(evidence.docsDir), real(evidence.startCopy)));\n }\n return start.display;\n}\n\n/**\n * Who the reader played, so `followed-the-docs` can tell what the persona\n * already knew from what it guessed. Never the record's body.\n */\nfunction whoTheReaderIs(spec: TaskSpec): string {\n const p = spec.persona;\n if (p === null) return \"The reader: someone new to this product, with the task above and no other context.\";\n const lines = [`The reader: ${[p.title ?? p.id, p.description].filter(Boolean).join(\". \")}`];\n if (p.role !== undefined) lines.push(`Role: ${p.role}`);\n if (p.proficiency.length > 0) lines.push(`Already good at: ${p.proficiency.join(\"; \")}`);\n if (p.prerequisites.length > 0) lines.push(`Knows before starting: ${p.prerequisites.join(\"; \")}`);\n return lines.join(\"\\n\");\n}\n\n/** A tool result's text and the call it answers, keyed by `tool_use_id`. */\ninterface ToolResult {\n id: string;\n text: string;\n}\n\n/**\n * Each tool result in the stream, in order, keyed by the event it rode in.\n * One user record can carry several results.\n */\nfunction toolResults(events: TraceEvent[]): Map<number, ToolResult[]> {\n const out = new Map<number, ToolResult[]>();\n for (const event of events) {\n if (event.kind !== \"tool_result\") continue;\n const message = event.raw.message;\n const content = isRecord(message) ? message.content : undefined;\n if (!Array.isArray(content)) continue;\n const found: ToolResult[] = [];\n for (const block of content as unknown[]) {\n if (!isRecord(block) || block.type !== \"tool_result\") continue;\n if (typeof block.tool_use_id !== \"string\") continue;\n found.push({ id: block.tool_use_id, text: resultText(block.content) });\n }\n out.set(event.index, found);\n }\n return out;\n}\n\nfunction resultText(content: unknown): string {\n if (typeof content === \"string\") return content;\n if (!Array.isArray(content)) return \"\";\n return (content as unknown[])\n .map((b) => (isRecord(b) && typeof b.text === \"string\" ? b.text : \"\"))\n .filter((t) => t !== \"\")\n .join(\"\\n\");\n}\n\nfunction renderTrace(evidence: RunEvidence, results: Map<number, ToolResult[]>): string {\n const { trace } = evidence;\n const callName = new Map<string, string>();\n const lines: string[] = [];\n for (const event of trace.events) {\n switch (event.kind) {\n case \"user\":\n if (event.text) lines.push(`[user] ${clip(event.text, MAX_TOOL_RESULT_CHARS)}`);\n break;\n case \"assistant\":\n if (event.text) lines.push(`[assistant] ${clip(event.text, MAX_TOOL_RESULT_CHARS)}`);\n break;\n case \"tool_call\": {\n const name = event.toolName ?? \"?\";\n if (typeof event.raw.id === \"string\") callName.set(event.raw.id, name);\n const input = JSON.stringify(event.raw.input ?? {});\n lines.push(`[tool] ${name} ${clip(input, MAX_TOOL_RESULT_CHARS)}`);\n break;\n }\n case \"tool_result\":\n for (const r of results.get(event.index) ?? []) {\n lines.push(`[result of ${callName.get(r.id) ?? r.id}] ${clip(r.text, MAX_TOOL_RESULT_CHARS)}`);\n }\n break;\n default:\n break;\n }\n }\n return lines.length > 0 ? lines.join(\"\\n\") : \"(no events)\";\n}\n\nfunction renderWorkspace(evidence: RunEvidence): string {\n const { added, changed, removed } = evidence.changes;\n const lines: string[] = [];\n if (added.length > 0) lines.push(`added: ${added.join(\", \")}`);\n if (changed.length > 0) lines.push(`changed: ${changed.join(\", \")}`);\n if (removed.length > 0) lines.push(`removed: ${removed.join(\", \")}`);\n if (lines.length === 0) return \"No file was added, changed or removed.\";\n\n let room = MAX_WORKSPACE_CHARS;\n for (const file of [...added, ...changed]) {\n const content = readText(join(evidence.workspaceDir, file));\n if (content === undefined) continue;\n if (room <= 0) {\n lines.push(`\\n### ${file}\\n[left out: the workspace's ${String(MAX_WORKSPACE_CHARS)}-character limit is reached]`);\n continue;\n }\n const { body, used } = budgeted(content, Math.min(MAX_FILE_CHARS, room));\n room -= used;\n lines.push(`\\n### ${file}\\n${body}`);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * The start page, then each page the reader opened, in order and once each:\n * a Read inside the docs copy, or a WebFetch and what it returned.\n */\nfunction renderDocs(\n evidence: RunEvidence,\n results: Map<number, ToolResult[]>,\n): { text: string; docs: string[] } {\n const { trace, spec, docsDir, startCopy } = evidence;\n const fetched = new Map<string, string>();\n const byId = new Map<string, string>();\n for (const list of results.values()) for (const r of list) byId.set(r.id, r.text);\n\n const pages: DocPage[] = [];\n const seen = new Set<string>();\n const add = (key: string, page: DocPage | undefined): void => {\n if (page === undefined || seen.has(key)) return;\n seen.add(key);\n pages.push(page);\n };\n const docsRoot = docsDir === null ? null : real(docsDir);\n const docPage = (file: string): DocPage | undefined => {\n if (docsRoot === null) return undefined;\n const rel = relative(docsRoot, real(file));\n if (rel === \"\" || rel === \"..\" || rel.startsWith(`..${sep}`) || isAbsolute(rel)) return undefined;\n const text = readText(file);\n return text === undefined ? undefined : { name: toPosix(rel), text };\n };\n\n // WebFetch results by URL, for a URL start the reader fetched.\n for (const event of trace.events) {\n if (event.kind !== \"tool_call\" || event.toolName !== \"WebFetch\") continue;\n const url = inputOf(event).url;\n const id = event.raw.id;\n if (typeof url === \"string\" && typeof id === \"string\" && !fetched.has(url)) {\n fetched.set(url, byId.get(id) ?? \"\");\n }\n }\n\n if (spec.start.kind === \"url\") {\n const text = fetched.get(spec.start.url);\n if (text !== undefined) add(urlKey(spec.start.url), { name: spec.start.url, text });\n } else if (startCopy !== null) {\n add(pathKey(startCopy), docPage(startCopy));\n }\n\n for (const event of trace.events) {\n if (event.kind !== \"tool_call\") continue;\n const input = inputOf(event);\n if (event.toolName === \"Read\" && typeof input.file_path === \"string\") {\n add(pathKey(input.file_path), docPage(input.file_path));\n } else if (event.toolName === \"WebFetch\" && typeof input.url === \"string\") {\n add(urlKey(input.url), { name: input.url, text: fetched.get(input.url) ?? \"\" });\n }\n }\n\n const blocks: string[] = [];\n const docs: string[] = [];\n let room = MAX_DOCS_CHARS;\n for (const page of pages) {\n if (room <= 0) break;\n const { body, used } = budgeted(page.text, room);\n blocks.push(`### ${page.name}\\n${body}`);\n room -= used;\n docs.push(page.name);\n }\n return {\n text: blocks.length > 0 ? blocks.join(\"\\n\\n\") : \"The reader opened no page of the docs.\",\n docs,\n };\n}\n\nfunction inputOf(event: TraceEvent): Record<string, unknown> {\n const input = event.raw.input;\n return isRecord(input) ? input : {};\n}\n\n/**\n * One spelling per file. The stream can name the docs copy by its 8.3 short\n * form on Windows (`C:\\Users\\HAWKEY~1\\...`) and the long form elsewhere, and\n * Windows paths compare without case.\n */\nfunction pathKey(file: string): string {\n const key = real(file);\n return process.platform === \"win32\" ? `file:${key.toLowerCase()}` : `file:${key}`;\n}\n\nfunction urlKey(url: string): string {\n return `url:${url}`;\n}\n\n/** The long, canonical spelling of a path that exists; the resolved one otherwise. */\nfunction real(file: string): string {\n try {\n return realpathSync.native(file);\n } catch {\n return resolve(file);\n }\n}\n\n/** A text file's contents, or undefined for a missing or binary one. */\nfunction readText(file: string): string | undefined {\n let bytes: Buffer;\n try {\n bytes = readFileSync(file);\n } catch {\n return undefined;\n }\n if (bytes.subarray(0, 8_000).includes(0)) return undefined;\n return bytes.toString(\"utf8\");\n}\n\nfunction toPosix(path: string): string {\n return path.split(sep).join(\"/\");\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n","/**\n * What the synthetic user is told (plan §4.5): the role prompt, appended to\n * Claude Code's system prompt, and the task brief, its first message. A\n * persona's fields go in, one line each when set; its body never does.\n */\nimport type { TaskPersona, TaskSpec } from \"./task-types.js\";\n\nconst NEWCOMER = \"Someone new to this product, with the task below and no other context.\";\n\nconst HOW_TO_WORK = [\n \"How to work:\",\n \"- Use what the documentation tells you, and what this person would already know.\",\n \"- Nobody is available to answer questions. When stuck, do what this person\",\n \" would do, or give up.\",\n \"- The current directory is yours. Treat the documentation as read-only.\",\n \"- When you finish or give up, end with a short account in this person's voice:\",\n \" whether you got it done, where you got stuck, and what in the docs helped or\",\n \" confused you.\",\n];\n\n/** A label and its items, one per line, or nothing when there are none. */\nfunction items(label: string, values: string[]): string[] {\n return values.length === 0 ? [] : [`${label}:`, ...values.map((v) => `- ${v}`)];\n}\n\nfunction whoYouAre(persona: TaskPersona | null): string[] {\n if (persona === null) return [NEWCOMER];\n const lines = [[persona.title ?? persona.id, persona.description].filter((v): v is string => v !== undefined).join(\". \")];\n if (persona.role !== undefined) lines.push(`Role: ${persona.role}`);\n if (persona.teamContext !== undefined) lines.push(`Team: ${persona.teamContext}`);\n lines.push(\n ...items(\"Already good at\", persona.proficiency),\n ...items(\"Knows before starting\", persona.prerequisites),\n ...items(\"Wants\", persona.goals),\n ...items(\"Frustrated by\", persona.pains),\n ...items(\n \"Your constraints\",\n persona.constraints.map((c) => c.text),\n ),\n );\n return lines;\n}\n\nexport function rolePrompt(persona: TaskPersona | null): string {\n return [\n \"You are taking part in a usability test of some documentation. You are playing\",\n \"a person, not an assistant. Stay in that person's shoes for the whole session.\",\n \"\",\n \"Who you are:\",\n ...whoYouAre(persona),\n \"\",\n ...HOW_TO_WORK,\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * The task, what started it and when it is done (a journey's, when set), and\n * where to start: the URL, or the start page's copy as seen from the workspace.\n */\nexport function taskBriefFor(spec: TaskSpec, startFromWorkspace: string | null): string {\n const lines = [spec.task];\n if (spec.journey?.trigger !== undefined) lines.push(`What started this: ${spec.journey.trigger}`);\n if (spec.journey?.successCriteria !== undefined) {\n lines.push(`You're done when: ${spec.journey.successCriteria.text}`);\n }\n const start = spec.start.kind === \"url\" ? spec.start.url : (startFromWorkspace ?? spec.start.display);\n lines.push(`Start here: ${start}`);\n return `${lines.join(\"\\n\")}\\n`;\n}\n","/**\n * The journey and persona records `manni test tasks` reads (plan §4.3).\n *\n * Which records exist, and which id names which, is the strategy domain's\n * answer: its loader reads the config's collections and its index resolves an\n * id. Each record used is then re-read through meta's extractor for the\n * fields strategy does not keep, with the line each sits on. A persona's body\n * is never read into anything.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { extname, relative, resolve, sep } from \"node:path\";\nimport { extractorForExtension } from \"../../meta/internal.js\";\nimport type { ConfigFile } from \"../../shared/config-file.js\";\nimport { errorMessage, ToolError } from \"../../shared/errors.js\";\nimport { indexSet, type StrategyIndex } from \"../../strategy/core/check.js\";\nimport { unknownRecordMessage } from \"../../strategy/commands/get.js\";\nimport { loadStrategy } from \"../../strategy/commands/run.js\";\nimport type { RecordType, StrategyRecord, StrategySet } from \"../../strategy/types.js\";\nimport { artifactEvalsErrors } from \"../../tracevals/evals/schema.js\";\nimport { normalizeEntry } from \"../../tracevals/evals/extract.js\";\nimport { graderFor } from \"../../tracevals/graders/registry.js\";\nimport { TestError } from \"../errors.js\";\nimport type { SourceLocation, TaskJourney, TaskPersona } from \"./task-types.js\";\n\n/** The graders a task's eval may name. */\nexport const TASK_GRADERS = [\n \"ai\",\n \"command\",\n \"regex\",\n \"file-access\",\n \"tool-usage\",\n \"tool-order\",\n \"turn-count\",\n \"cost\",\n] as const;\n\nconst GRADER_LIST = `${TASK_GRADERS.slice(0, -1).join(\", \")} or ${TASK_GRADERS.at(-1) ?? \"\"}`;\n\nexport interface TaskRecords {\n /** `--journey <id>`: the journey, or a usage error. */\n journey(id: string): Promise<TaskJourney>;\n /** `--persona <id>`, or a name in a journey's `personas:` when `journey` is given. */\n persona(id: string, journey?: TaskJourney): Promise<TaskPersona>;\n /** Every journey that declares `evals:`, in set order. */\n golden(): Promise<TaskJourney[]>;\n}\n\n/** The fields read off a record file: its frontmatter and where each value sits. */\ninterface RecordFile {\n file: string;\n /** The config file's directory, which the record's paths resolve against. */\n dir: string;\n data: Record<string, unknown>;\n lineFor: (pointer: string) => number | undefined;\n}\n\nfunction text(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim() !== \"\" ? value : undefined;\n}\n\n/** A string or a list of strings, as a list. */\nfunction list(value: unknown): string[] {\n if (typeof value === \"string\") return value.trim() === \"\" ? [] : [value];\n if (!Array.isArray(value)) return [];\n return value.filter((v): v is string => typeof v === \"string\" && v.trim() !== \"\");\n}\n\n/** A sibling domain's `ToolError` reported as this domain's. */\nasync function asTestError<T>(work: () => Promise<T>): Promise<T> {\n try {\n return await work();\n } catch (err) {\n if (err instanceof ToolError && !(err instanceof TestError)) throw new TestError(err.message);\n throw err;\n }\n}\n\n/**\n * The records in the config's collections. A config with no collections holds\n * none, which is not an error until a record is asked for.\n */\nexport function loadTaskRecords(file: ConfigFile | null, cwd: string): TaskRecords {\n const configDir = file?.dir ?? cwd;\n let loaded: Promise<{ set: StrategySet; index: StrategyIndex; base: string }> | undefined;\n const load = (): Promise<{ set: StrategySet; index: StrategyIndex; base: string }> => {\n loaded ??= asTestError(async () => {\n if (file === null || file.collections.length === 0) {\n const set: StrategySet = { records: [], references: [] };\n return { set, index: indexSet(set), base: configDir };\n }\n const { set, run } = await loadStrategy({ cwd, inputs: [], configPath: file.path, allowEmpty: true });\n return { set, index: indexSet(set), base: run.base };\n });\n return loaded;\n };\n\n const readRecord = async (record: StrategyRecord, base: string): Promise<RecordFile> => {\n const abs = resolve(base, record.file);\n const file = relative(configDir, abs).split(sep).join(\"/\");\n const extractor = extractorForExtension(extname(abs));\n if (extractor === undefined) throw new TestError(`${file}: no reader for its extension.`);\n try {\n const extracted = extractor.extract(await readFile(abs, \"utf8\"), abs);\n return { file, dir: configDir, data: extracted.data, lineFor: extracted.lineFor };\n } catch (err) {\n throw new TestError(`${file}: could not be read: ${errorMessage(err)}`);\n }\n };\n\n const byId = async (id: string, type: RecordType, flag: string): Promise<RecordFile & { record: StrategyRecord }> => {\n const { set, index, base } = await load();\n const record = index.anyWithId(id);\n if (record === undefined) throw new TestError(unknownRecordMessage(id, set.records));\n if (record.type !== type) throw new TestError(`\"${id}\" is a ${record.type}; ${flag} takes a ${type}.`);\n return { record, ...(await readRecord(record, base)) };\n };\n\n const persona = async (id: string, journey?: TaskJourney): Promise<TaskPersona> => {\n if (journey === undefined) {\n const { record, ...rf } = await byId(id, \"persona\", \"--persona\");\n return personaOf(record.id, rf);\n }\n const { index, base } = await load();\n const record = index.resolve(\"persona\", id);\n if (record === undefined) {\n throw new TestError(`journey \"${journey.id}\" names persona \"${id}\", which has no record.`);\n }\n return personaOf(record.id, await readRecord(record, base));\n };\n\n return {\n journey: async (id) => {\n const { record, ...rf } = await byId(id, \"journey\", \"--journey\");\n return journeyOf(record.id, rf);\n },\n persona,\n golden: async () => {\n const { set, base } = await load();\n const out: TaskJourney[] = [];\n for (const record of set.records) {\n if (record.type !== \"journey\") continue;\n const rf = await readRecord(record, base);\n if (rf.data[\"evals\"] === undefined) continue;\n out.push(journeyOf(record.id, rf));\n }\n return out;\n },\n };\n}\n\nfunction at(rf: RecordFile, pointer: string): SourceLocation {\n return { file: rf.file, line: rf.lineFor(pointer) ?? 1 };\n}\n\nfunction personaOf(id: string, rf: RecordFile): TaskPersona {\n const { data } = rf;\n const title = text(data[\"title\"]);\n const description = text(data[\"description\"]);\n const role = text(data[\"role\"]);\n const teamContext = text(data[\"team-context\"]);\n const raw = data[\"constraints\"];\n const constraints = Array.isArray(raw)\n ? raw.flatMap((item: unknown, i) =>\n typeof item === \"string\" && item.trim() !== \"\"\n ? [{ text: item, location: at(rf, `/constraints/${String(i)}`) }]\n : [],\n )\n : list(raw).map((item) => ({ text: item, location: at(rf, \"/constraints\") }));\n return {\n id,\n file: rf.file,\n ...(title === undefined ? {} : { title }),\n ...(description === undefined ? {} : { description }),\n ...(role === undefined ? {} : { role }),\n ...(teamContext === undefined ? {} : { teamContext }),\n proficiency: list(data[\"proficiency\"]),\n prerequisites: list(data[\"prerequisites\"]),\n goals: list(data[\"goals\"]),\n pains: list(data[\"pains\"]),\n constraints,\n };\n}\n\nfunction journeyOf(id: string, rf: RecordFile): TaskJourney {\n const { data } = rf;\n const title = text(data[\"title\"]);\n const trigger = text(data[\"trigger\"]);\n const success = text(data[\"success-criteria\"]);\n const entryPoint = text(data[\"entry-point\"]);\n const workspace = text(data[\"workspace\"]);\n // Whether these exist is checked where they are used: a target or\n // `--workspace` that replaces one makes a missing path irrelevant.\n return {\n id,\n file: rf.file,\n title: title ?? id,\n titleLocation: title === undefined ? { file: rf.file, line: 1 } : at(rf, \"/title\"),\n ...(trigger === undefined ? {} : { trigger }),\n ...(success === undefined ? {} : { successCriteria: { text: success, location: at(rf, \"/success-criteria\") } }),\n ...(entryPoint === undefined ? {} : { entryPoint: { value: entryPoint, location: at(rf, \"/entry-point\") } }),\n ...(workspace === undefined ? {} : { workspace: { value: workspace, location: at(rf, \"/workspace\") } }),\n personas: list(data[\"personas\"]),\n evals: journeyEvals(rf),\n };\n}\n\n/**\n * A journey's `evals:`, validated as tracevals validates an artifact's block,\n * plus what a task adds: an id on every entry, ids unique, and only the\n * graders a synthetic run can be graded by. The first problem is the error.\n */\nfunction journeyEvals(rf: RecordFile): TaskJourney[\"evals\"] {\n const raw = rf.data[\"evals\"];\n if (raw === undefined) return [];\n const where = (pointer: string): string => `${rf.file}:${String(rf.lineFor(pointer) ?? 1)}`;\n if (!Array.isArray(raw)) throw new TestError(`${where(\"/evals\")}: evals must be a list of eval entries.`);\n\n const seen = new Map<string, number>();\n for (const [i, entry] of raw.entries()) {\n const n = String(i);\n const obj: Record<string, unknown> =\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry) ? (entry as Record<string, unknown>) : {};\n const id = text(obj[\"id\"]);\n if (id === undefined) throw new TestError(`${where(`/evals/${n}`)}: evals[${n}] needs an id.`);\n const grader = typeof obj[\"grader\"] === \"string\" ? obj[\"grader\"] : \"ai\";\n if (!(TASK_GRADERS as readonly string[]).includes(grader)) {\n throw new TestError(\n `${where(`/evals/${n}/grader`)}: evals[${n}].grader \"${grader}\" cannot grade a task. Use ${GRADER_LIST}.`,\n );\n }\n const first = seen.get(id);\n if (first !== undefined) {\n throw new TestError(`${where(`/evals/${n}/id`)}: evals[${n}].id \"${id}\" repeats evals[${String(first)}].`);\n }\n seen.set(id, i);\n }\n\n // The vocabulary is document-rooted, so the list is validated where an\n // artifact keeps it, and each pointer is mapped back to the journey's.\n const errors = artifactEvalsErrors({ metadata: { evals: raw } }, (pointer) =>\n rf.lineFor(pointer.replace(/^\\/metadata/, \"\")),\n );\n const firstError = errors[0];\n if (firstError !== undefined) {\n const path = firstError.instancePath.replace(/^\\/metadata/, \"\");\n const m = /^\\/evals\\/(\\d+)(.*)$/.exec(path);\n const label = m === null ? \"evals\" : `evals[${m[1] ?? \"\"}]${(m[2] ?? \"\").replaceAll(\"/\", \".\")}`;\n throw new TestError(`${where(path)}: ${label} ${firstError.message}.`);\n }\n\n return raw.map((entry: unknown, i) => {\n const n = String(i);\n const normalized = normalizeEntry(entry, i);\n const validate = graderFor(normalized.grader)?.validateOptions;\n const invalid = validate?.(normalized.options ?? {});\n if (invalid !== undefined) {\n const pointer = normalized.options === undefined ? `/evals/${n}` : `/evals/${n}/options`;\n throw new TestError(`${where(pointer)}: evals[${n}] ${invalid}`);\n }\n return { entry: normalized, location: at(rf, `/evals/${n}`) };\n });\n}\n","/**\n * A run's temp directory (plan §4.5): the workspace the synthetic user works\n * in, a copy of the docs for a path start, and its own npm global prefix.\n * Nothing it does touches the checkout.\n *\n * The directory is spelled the long way (`realpathSync.native`), because on\n * Windows `os.tmpdir()` can be an 8.3 short name, and Claude Code reports the\n * long one: paths compared or relativized across the two would never match.\n */\nimport { createHash } from \"node:crypto\";\nimport { realpathSync, statSync } from \"node:fs\";\nimport { cp, mkdir, mkdtemp, readdir, readFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { basename, dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport picomatch from \"picomatch\";\nimport { resolveTargetSet } from \"../../meta/internal.js\";\nimport { selectCollections } from \"../../shared/collections.js\";\nimport type { ConfigFile } from \"../../shared/config-file.js\";\nimport { TestError } from \"../errors.js\";\nimport type { TaskStart, WorkspaceChanges } from \"./task-types.js\";\n\nexport interface RunDirs {\n root: string;\n workspaceDir: string;\n /** The npm global prefix Claude Code is given. */\n globalDir: string;\n /** Null for a URL start. */\n docsDir: string | null;\n /** The start page's copy; null for a URL start. */\n startCopy: string | null;\n}\n\n/**\n * ponytail: dependency and VCS trees are not part of what a reader changed,\n * and a `npm install` would bury the list. Skipped on both sides of the diff\n * and in the docs copy.\n */\nconst SKIPPED_DIRS = new Set([\"node_modules\", \".git\"]);\n\nconst keep = (src: string): boolean => !SKIPPED_DIRS.has(basename(src));\n\nconst toPosix = (path: string): string => path.split(sep).join(\"/\");\n\nexport async function prepareRun(\n start: TaskStart,\n seed: string | null,\n file: ConfigFile | null,\n): Promise<RunDirs> {\n const root = realpathSync.native(await mkdtemp(join(tmpdir(), \"manni-task-\")));\n const workspaceDir = join(root, \"workspace\");\n const globalDir = join(root, \"global\");\n await mkdir(workspaceDir);\n await mkdir(globalDir);\n if (seed !== null) await cp(seed, workspaceDir, { recursive: true, filter: keep });\n if (start.kind === \"url\") return { root, workspaceDir, globalDir, docsDir: null, startCopy: null };\n\n const docsDir = join(root, \"docs\");\n const startCopy = join(docsDir, await copyDocs(start.abs, file, docsDir));\n return { root, workspaceDir, globalDir, docsDir, startCopy };\n}\n\n/**\n * Copy the collection holding `page` into `docsDir`, relative to the\n * collection's glob base, or the page's own directory when no collection\n * holds it. Returns the page's path inside the copy.\n */\nasync function copyDocs(page: string, file: ConfigFile | null, docsDir: string): Promise<string> {\n const collections = file === null ? [] : selectCollections(file.collections, [], file.source, (m) => new TestError(m));\n for (const collection of collections) {\n const dir = file?.dir ?? dirname(page);\n const { files } = await resolveTargetSet({\n inputs: collection.paths,\n exclude: collection.exclude,\n cwd: dir,\n allowEmpty: true,\n });\n const abs = files.map((f) => resolve(dir, f));\n if (!abs.some((f) => samePath(f, page))) continue;\n const base = globBase(collection.paths, dir);\n // A start page outside the base would have no place in the copy, so its\n // own directory is copied instead, below.\n const pageRel = copyPathFor(base, page);\n if (pageRel === undefined) break;\n for (const f of abs) {\n const rel = copyPathFor(base, f);\n if (rel === undefined) continue;\n const dest = join(docsDir, rel);\n await mkdir(dirname(dest), { recursive: true });\n await cp(f, dest);\n }\n return pageRel;\n }\n await cp(dirname(page), docsDir, { recursive: true, filter: keep });\n return basename(page);\n}\n\n/**\n * Where a collection file goes inside the docs copy, relative to the copy, or\n * `undefined` for a file that resolves outside the collection's base (through\n * a symlink, or on another drive). Nothing is ever written outside the copy.\n */\nexport function copyPathFor(base: string, file: string): string | undefined {\n const rel = relative(base, file);\n if (rel === \"\" || isAbsolute(rel) || rel === \"..\" || rel.startsWith(`..${sep}`)) return undefined;\n return rel;\n}\n\nfunction samePath(a: string, b: string): boolean {\n return process.platform === \"win32\" ? a.toLowerCase() === b.toLowerCase() : a === b;\n}\n\n/** The deepest directory every one of a collection's paths sits under. */\nfunction globBase(paths: string[], dir: string): string {\n const bases = paths.map((p) => {\n const scan = picomatch.scan(p.replace(/\\\\/g, \"/\"));\n const abs = resolve(dir, scan.isGlob ? scan.base : p);\n return scan.isGlob || isDirectory(abs) ? abs : dirname(abs);\n });\n const [first, ...rest] = bases.map((b) => b.split(sep));\n if (first === undefined) return dir;\n let depth = first.length;\n for (const parts of rest) {\n let i = 0;\n while (i < depth && i < parts.length && parts[i] === first[i]) i++;\n depth = i;\n }\n return first.slice(0, depth).join(sep) || sep;\n}\n\nfunction isDirectory(path: string): boolean {\n try {\n return statSync(path).isDirectory();\n } catch {\n return false;\n }\n}\n\n/** Every file under `dir` as a POSIX relative path → sha256 of its bytes. */\nasync function hashTree(dir: string): Promise<Map<string, string>> {\n const out = new Map<string, string>();\n const walk = async (at: string): Promise<void> => {\n for (const entry of await readdir(at, { withFileTypes: true })) {\n const abs = join(at, entry.name);\n if (entry.isDirectory()) {\n if (!SKIPPED_DIRS.has(entry.name)) await walk(abs);\n } else if (entry.isFile()) {\n out.set(toPosix(relative(dir, abs)), createHash(\"sha256\").update(await readFile(abs)).digest(\"hex\"));\n }\n }\n };\n await walk(dir);\n return out;\n}\n\n/** What the run added, changed and removed against the seed, by content. */\nexport async function workspaceChanges(seed: string | null, workspaceDir: string): Promise<WorkspaceChanges> {\n const before = seed === null ? new Map<string, string>() : await hashTree(seed);\n const after = await hashTree(workspaceDir);\n const added: string[] = [];\n const changed: string[] = [];\n for (const [path, hash] of after) {\n const was = before.get(path);\n if (was === undefined) added.push(path);\n else if (was !== hash) changed.push(path);\n }\n const removed = [...before.keys()].filter((path) => !after.has(path));\n return { added: added.sort(), changed: changed.sort(), removed: removed.sort() };\n}\n","import type { TestFinding } from \"../core/results.js\";\n\n/**\n * What a failed step asks of its reader. Doc Detective reports only what the\n * step expected against what happened, so it cannot tell which of the three\n * is wrong, and the sentence says so.\n */\nconst FAIL_ADVICE = \"Fix the step, fix the procedure it documents, or report a product regression.\";\n\n/** Doc Detective's description, and for a FAIL the advice after it. A WARNING is left as written. */\nexport function findingMessage(f: TestFinding): string {\n if (f.result !== \"FAIL\") return f.description;\n if (f.description === \"\") return FAIL_ADVICE;\n const stop = f.description.endsWith(\".\") ? \"\" : \".\";\n return `${f.description}${stop} ${FAIL_ADVICE}`;\n}\n","import type { ResultCounts } from \"../core/results.js\";\n\n/** `2 tests: 1 passed, 1 failed, 0 warnings, 0 skipped`, test-level counts. */\nexport function summaryLine(tests: ResultCounts): string {\n const total = tests.pass + tests.fail + tests.warning + tests.skipped;\n const plural = (n: number, word: string): string => `${String(n)} ${word}${n === 1 ? \"\" : \"s\"}`;\n return `${plural(total, \"test\")}: ${String(tests.pass)} passed, ${String(tests.fail)} failed, ${plural(tests.warning, \"warning\")}, ${String(tests.skipped)} skipped`;\n}\n","import {\n escapeWorkflowCommandMessage,\n escapeWorkflowCommandProperty,\n} from \"../../shared/github.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { ProceduresResult } from \"../commands/procedures.js\";\nimport { findingMessage } from \"./finding.js\";\nimport { summaryLine } from \"./summary.js\";\n\n/**\n * One workflow command per FAIL or WARNING step, then the summary line. The\n * step's action and its guide follow the message after `%0A`.\n */\nexport function renderGithub(result: ProceduresResult): string {\n const commands = result.findings.map((f) => {\n const level = f.result === \"FAIL\" ? \"error\" : \"warning\";\n const props = [\n ...(f.file === \"\" ? [] : [`file=${escapeWorkflowCommandProperty(f.file)}`]),\n ...(f.line === undefined ? [] : [`line=${String(f.line)}`]),\n \"title=Doc Detective\",\n ].join(\",\");\n const message = [findingMessage(f), ...guidanceLines(f.guidance)].join(\"\\n\");\n return `::${level} ${props}::${escapeWorkflowCommandMessage(message)}`;\n });\n return [...commands, summaryLine(result.tests)].join(\"\\n\");\n}\n","import type { ProceduresResult } from \"../commands/procedures.js\";\n\n/**\n * Doc Detective's results object, verbatim, so a script written against its\n * schema reads manni's output unchanged. `null` when it found no tests.\n */\nexport function renderJson(result: ProceduresResult): string {\n return JSON.stringify(result.results, null, 2);\n}\n","import { palette } from \"../../shared/color.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { ProceduresResult } from \"../commands/procedures.js\";\nimport type { TestFinding } from \"../core/results.js\";\nimport { findingMessage } from \"./finding.js\";\nimport { summaryLine } from \"./summary.js\";\n\n/**\n * Each FAIL and WARNING step under its page, with its line, then the\n * test-level summary. The step's action and its guide follow, dim, under the\n * message. A run with neither prints the summary alone.\n */\nexport function renderPretty(result: ProceduresResult, opts: { color: boolean }): string {\n const c = palette(opts.color);\n const byFile = new Map<string, TestFinding[]>();\n for (const finding of result.findings) {\n const list = byFile.get(finding.file);\n if (list === undefined) byFile.set(finding.file, [finding]);\n else list.push(finding);\n }\n const width = Math.max(0, ...result.findings.map((f) => String(f.line ?? \"\").length));\n // The guidance lines sit under the message column: the line, the result, and their gaps.\n const indent = \" \".repeat(2 + width + 2 + 7 + 2);\n const blocks = [...byFile].map(([file, findings]) =>\n [\n c.bold(file),\n ...findings.flatMap((f) => {\n const label = f.result.padEnd(7);\n const tag = f.result === \"FAIL\" ? c.red(label) : c.yellow(label);\n return [\n ` ${String(f.line ?? \"\").padStart(width)} ${tag} ${findingMessage(f)}`,\n ...guidanceLines(f.guidance).map((line) => c.dim(`${indent}${line}`)),\n ];\n }),\n ].join(\"\\n\"),\n );\n return [...blocks, summaryLine(result.tests)].join(\"\\n\\n\");\n}\n","/**\n * `manni test tasks`'s three formats (plan §4.8): a block per run then a\n * total, the report as JSON, or a workflow command per eval that did not pass.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport { escapeWorkflowCommandMessage, escapeWorkflowCommandProperty } from \"../../shared/github.js\";\nimport type { TaskRun, TasksReport } from \"../commands/tasks.js\";\nimport type { TaskEval } from \"../core/task-types.js\";\n\nexport type TasksFormat = \"pretty\" | \"json\" | \"github\";\n\nconst WIDTH = 78;\n\nconst plural = (n: number, one: string): string => `${String(n)} ${one}${n === 1 ? \"\" : \"s\"}`;\n\n/** `1 run: 0 passed, 1 failed · 1 warning`, zero failures and warnings left out. */\nexport function tasksTotal(summary: TasksReport[\"summary\"]): string {\n let line = `${plural(summary.runs, \"run\")}: ${String(summary.passed)} passed`;\n if (summary.failed > 0) line += `, ${String(summary.failed)} failed`;\n if (summary.warnings > 0) line += ` · ${plural(summary.warnings, \"warning\")}`;\n return line;\n}\n\nexport function renderTasks(report: TasksReport, format: TasksFormat, opts: { color: boolean }): string {\n if (format === \"json\") return renderJson(report);\n if (report.runs.length === 0) return \"No tasks to run.\";\n if (format === \"github\") return renderGithub(report);\n const c = palette(opts.color);\n return [...report.runs.map((run) => runBlock(run, c)), tasksTotal(report.summary)].join(\"\\n\\n\");\n}\n\nfunction renderJson(report: TasksReport): string {\n const runs = report.runs.map(({ maxTurns: _maxTurns, ...run }) => run);\n return JSON.stringify({ runs, summary: report.summary, exitCode: report.exitCode }, null, 2);\n}\n\nconst label = (run: TaskRun): string => `${run.journey ?? \"task\"} as ${run.persona ?? \"newcomer\"}`;\n\nconst at = (e: TaskEval): string => (e.location === null ? \"(no location)\" : `${e.location.file}:${String(e.location.line)}`);\n\nfunction tag(e: TaskEval): string {\n if (e.outcome === \"pass\") return \"PASS\";\n if (e.outcome === \"skipped\") return \"SKIP\";\n if (e.severity === \"warning\") return \"WARN\";\n if (e.severity === \"notice\") return \"NOTE\";\n return e.outcome === \"fail\" ? \"FAIL\" : e.outcome === \"error\" ? \"ERROR\" : \"REVIEW\";\n}\n\nfunction paint(text: string, e: TaskEval, c: Colors): string {\n const t = tag(e);\n if (t === \"PASS\") return c.green(text);\n if (t === \"WARN\") return c.yellow(text);\n if (t === \"NOTE\" || t === \"SKIP\") return c.dim(text);\n return c.red(text);\n}\n\nfunction duration(ms: number): string {\n const s = Math.round(ms / 1000);\n return `${String(Math.floor(s / 60))}m ${String(s % 60).padStart(2, \"0\")}s`;\n}\n\n/** `text` wrapped at the report's width, each line indented. */\nfunction wrap(text: string, indent: string): string[] {\n const out: string[] = [];\n for (const paragraph of text.split(\"\\n\")) {\n let line = \"\";\n for (const word of paragraph.split(/\\s+/).filter((w) => w !== \"\")) {\n if (line !== \"\" && indent.length + line.length + 1 + word.length > WIDTH) {\n out.push(indent + line);\n line = word;\n } else {\n line = line === \"\" ? word : `${line} ${word}`;\n }\n }\n out.push(line === \"\" ? \"\" : indent + line);\n }\n return out;\n}\n\n/** What a judged eval's verdict says, or the grader's own message. */\nfunction said(e: TaskEval): string | undefined {\n if (e.consensus !== undefined) {\n const verdict = `AI judge: ${e.outcome} (confidence ${e.consensus.meanConfidence.toFixed(2)}).`;\n return e.message === undefined ? verdict : `${verdict} ${e.message}`;\n }\n return e.message;\n}\n\nfunction runBlock(run: TaskRun, c: Colors): string {\n const title = run.journey === null && run.task.length > 60 ? `${run.task.slice(0, 60)}…` : run.task;\n const lines = [c.bold(`${run.journey ?? \"task\"} · ${title} · as ${run.persona ?? \"newcomer\"}`)];\n const field = (name: string, value: string): string => ` ${name.padEnd(10)}${value}`;\n lines.push(field(\"start\", run.start));\n if (run.docs.length > 0) lines.push(field(\"docs\", run.docs.join(\", \")));\n if (run.changes.added.length > 0) lines.push(field(\"added\", run.changes.added.join(\", \")));\n if (run.changes.changed.length > 0) lines.push(field(\"changed\", run.changes.changed.join(\", \")));\n if (run.changes.removed.length > 0) lines.push(field(\"removed\", run.changes.removed.join(\", \")));\n lines.push(` ${plural(run.turns, \"turn\")} · ${duration(run.durationMs)}`);\n\n const tagWidth = Math.max(4, ...run.evals.map((e) => tag(e).length));\n const idWidth = Math.max(0, ...run.evals.map((e) => e.id.length)) + 5;\n const detail = \" \".repeat(2 + tagWidth + 1);\n for (const e of run.evals) {\n lines.push(` ${paint(tag(e).padEnd(tagWidth), e, c)} ${e.id.padEnd(idWidth)}${c.dim(at(e))}`);\n if (e.outcome === \"pass\") continue;\n if (e.assertion !== undefined) lines.push(...wrap(e.assertion, detail));\n const message = said(e);\n if (message !== undefined) lines.push(...wrap(message, detail).map((l) => c.dim(l)));\n }\n if (run.stoppedAtLimit) lines.push(` stopped at the ${String(run.maxTurns)}-turn limit`);\n if (run.account.trim() !== \"\") lines.push(\" Account\", ...wrap(run.account.trim(), \" \"));\n if (run.kept !== null) lines.push(field(\"kept\", run.kept));\n lines.push(field(\"trace\", run.trace));\n return lines.join(\"\\n\");\n}\n\nfunction githubLine(run: TaskRun, e: TaskEval): string {\n const level = e.severity === \"notice\" ? \"notice\" : e.severity === \"warning\" ? \"warning\" : \"error\";\n const props = [\n ...(e.location === null\n ? []\n : [`file=${escapeWorkflowCommandProperty(e.location.file)}`, `line=${String(e.location.line)}`]),\n \"title=manni test tasks\",\n ].join(\",\");\n const what =\n e.id === \"constraint\" && e.outcome === \"fail\"\n ? `constraint \"${e.assertion ?? \"\"}\" not honored.`\n : `${e.id} ${e.outcome === \"fail\" ? \"failed\" : e.outcome === \"error\" ? \"could not be graded\" : \"needs review\"}.`;\n const message = [`${label(run)}: ${what}`, e.message].filter((m) => m !== undefined && m !== \"\").join(\" \");\n return `::${level} ${props}::${escapeWorkflowCommandMessage(message)}`;\n}\n\nfunction renderGithub(report: TasksReport): string {\n const commands = report.runs.flatMap((run) =>\n run.evals.filter((e) => e.outcome !== \"pass\" && e.outcome !== \"skipped\").map((e) => githubLine(run, e)),\n );\n return [...commands, tasksTotal(report.summary)].join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,YAAN,cAAwB,UAAU;AAAA,EACvC,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;;;ACGA,SAAS,kBAAkB;AAC3B,SAAS,SAAS,SAAS,UAAU,UAAU;AAC/C,SAAS,cAAc;AACvB,SAAS,QAAAA,OAAM,YAAAC,WAAU,eAAe;AACxC,OAAO,QAAQ;AACf,OAAO,eAAe;;;ACNtB,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AAuBd,IAAM,cACX;AAEF,IAAM,qBACJ;AAGF,IAAM,aAAa,KAAK,KAAK;AAEtB,SAAS,UACd,MACA,MACQ;AACR,MAAI,KAAK,aAAa,QAAS,QAAO,EAAE,SAAS,iBAAiB,MAAM,SAAS,MAAM;AAEvF,aAAW,SAAS,KAAK,KAAK,MAAM,GAAG,GAAG;AACxC,UAAM,MAAM,MAAM,QAAQ,YAAY,IAAI;AAC1C,QAAI,QAAQ,MAAM,CAAC,KAAK,OAAO,KAAK,KAAK,mBAAmB,CAAC,EAAG;AAChE,UAAM,SAAS,KAAK,KAAK,gBAAgB,iBAAiB,OAAO,kBAAkB;AACnF,QAAI,KAAK,OAAO,MAAM,GAAG;AACvB,aAAO,EAAE,SAA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G;AAAA,EACF,EAAE,KAAK,GAAG;AACV,QAAM,OACJ,EAAE,OAAO,gBAAgB,EAAE,YAAY,SACnC,eAAe,EAAE,aAAa,EAAE,mBAChC,GAAG,EAAE,EAAE,IAAI,EAAE,YAAY,SAAS,WAAW,EAAE,YAAY,UAAU,wBAAwB,cAAc;AACjH,QAAM,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,KAAK,IAAI,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,MAAM,UAAa,MAAM,EAAE,EAAE,KAAK,GAAG;AACzG,SAAO,KAAK,KAAK,IAAI,KAAK,KAAK,6BAA6B,OAAO,CAAC;AACtE;AAEA,SAASD,cAAa,QAA6B;AACjD,QAAM,WAAW,OAAO,KAAK;AAAA,IAAQ,CAAC,QACpC,IAAI,MAAM,OAAO,CAAC,MAAM,EAAE,YAAY,UAAU,EAAE,YAAY,SAAS,EAAE,IAAI,CAAC,MAAM,WAAW,KAAK,CAAC,CAAC;AAAA,EACxG;AACA,SAAO,CAAC,GAAG,UAAU,WAAW,OAAO,OAAO,CAAC,EAAE,KAAK,IAAI;AAC5D;","names":["join","relative","text","key","relative","join","existsSync","mkdir","rm","join","relative","resolve","sep","spawn","statSync","join","relative","NO_TIMEOUT","label","pathKey","join","relative","at","said","isFile","statSync","spawn","join","relative","sep","readFileSync","isAbsolute","join","relative","resolve","sep","text","relative","isRecord","join","list","sep","isAbsolute","resolve","readFileSync","join","text","relative","sep","label","readFile","relative","resolve","sep","asTestError","set","resolve","file","relative","sep","readFile","record","label","realpathSync","statSync","mkdtemp","readdir","readFile","tmpdir","isAbsolute","join","relative","resolve","sep","picomatch","toPosix","sep","realpathSync","mkdtemp","join","tmpdir","resolve","relative","isAbsolute","picomatch","statSync","at","readdir","readFile","toPosix","sep","asTestError","toError","loadConfig","resolve","existsSync","label","records","relative","mkdir","join","rm","plural","list","label","tag","renderJson","renderGithub","at","text"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lint/core/rule-id.ts","../src/lint/reporters/junit.ts","../src/lint/reporters/sarif.ts","../src/lint/reporters/alignment.ts","../src/lint/reporters/index.ts"],"sourcesContent":["/**\n * A finding's **rule identity**: `manni:lint/<job>/<rule>`.\n *\n * One id, in one place, for every consumer that files or correlates findings -\n * the SARIF `ruleId`, the JUnit `<failure type>`, the GitHub annotation's\n * `title`, and the `ruleId` the JSON reporter carries beside `type`. A rule id\n * is durable by contract: rename one and every historical alert in a\n * dashboard closes, then reopens as new.\n *\n * Three segments rather than cite's two. The job is what makes a second lint\n * tool possible without collisions: a prose job will report\n * `manni:lint/prose/Google.Passive`, keeping Vale's own rule name because that\n * is the name Vale's documentation uses, and nothing about it can be confused\n * with a structure rule. Proposal 0050 records the shape, and warns that\n * anything parsing family rule ids must not assume two segments.\n *\n * The rule half is derived from the finding's `type` rather than authored\n * beside it. `type` is already the machine-readable name the JSON reporter\n * publishes - manni docevals' grader reads it - so a hand-maintained second\n * table would be one more thing to keep in step, and the derivation cannot\n * drift. `_error` is dropped because it says only that a finding is a finding;\n * `heading_pattern_error` is the rule \"heading-pattern\".\n */\nimport type { LintJob } from \"./config.js\";\n\n/** Every lint rule id starts here. */\nexport const RULE_ID_PREFIX = \"manni:lint\";\n\n/** The tool that performs the structure job, reported beside every finding. */\nexport const TOOL_NAME = \"manni\";\n\n/** The job every finding in this pipeline reports under. */\nexport const STRUCTURE_JOB: LintJob = \"structure\";\n\n/**\n * `heading_pattern_error` -> `heading-pattern`; `parse_error` -> `parse`.\n *\n * Only a trailing `_error` is dropped, so a rule that is genuinely *about*\n * errors keeps the word.\n */\nexport function ruleName(type: string): string {\n return type.replace(/_error$/, \"\").replace(/_/g, \"-\");\n}\n\n/** `manni:lint/<job>/<rule>` for one finding `type`. */\nexport function ruleId(type: string, job: LintJob = STRUCTURE_JOB): string {\n return `${RULE_ID_PREFIX}/${job}/${ruleName(type)}`;\n}\n","/**\n * JUnit XML, rendered through **meta's** writer rather than a second one.\n *\n * There is no authoritative JUnit schema, and the escaping is the part a\n * hand-rolled writer gets wrong - XML 1.0 forbids characters that sit quite\n * happily in a JavaScript string, and one of them makes the whole document\n * unparseable rather than merely mis-rendered. That work is done once, in\n * `src/meta/reporters/junit.ts`, and cite already rides it. So does lint:\n * adapt the run onto meta's `ValidationResult`, hand it to that writer, and\n * the family ships one XML writer, one escaping rule, and one\n * testcase-per-file convention.\n *\n * What is lint's is the two strings that identify the findings as lint's:\n * the `classname` on every `<testcase>`, and the `<failure type>`, which is\n * the namespaced rule id. A finding's template rides along as meta's\n * `guidance`, so each `<failure>` body says what the template asks for.\n */\nimport {\n isErrorSeverity,\n renderJunit as renderJunitXml,\n type FieldError,\n type ValidationResult,\n} from \"../../meta/index.js\";\nimport { RULE_ID_PREFIX, ruleName, STRUCTURE_JOB } from \"../core/rule-id.js\";\nimport type { LintRun } from \"../commands/lint.js\";\n\n/** JUnit `classname` for this tool's findings, as cite's is `manni.cite`. */\nconst JUNIT_CLASSNAME = \"manni.lint\";\n\n/**\n * One finding as a `FieldError`.\n *\n * `schema` and `keyword` are split where they are because meta's `ruleIdFor`\n * joins them with a `/`, and the id it has to produce is\n * `manni:lint/<job>/<rule>`. The prefix is the schema half and stays one\n * segment, which is what keeps it a built-in-shaped ref: a ref containing a\n * slash classifies as a local file, and a caller that passed a path frame\n * would see it rewritten into a relative path. The job and the rule travel\n * together as the keyword.\n *\n * `instancePath` is `\"\"`, the whole document. A structural finding is about a\n * document's shape and not about a pointer into its metadata, so there is no\n * honest pointer to give; meta spells that `(root)`, as it does for its own\n * parse failures. The section the finding is anchored to is already in the\n * message.\n */\nfunction toFieldError(\n finding: LintRun[\"results\"][number][\"findings\"][number],\n): FieldError {\n return {\n schema: RULE_ID_PREFIX,\n instancePath: \"\",\n message:\n finding.heading != null\n ? `${finding.heading}: ${finding.message}`\n : finding.message,\n keyword: `${STRUCTURE_JOB}/${ruleName(finding.type)}`,\n severity: finding.severity,\n line: finding.position.start.line,\n col: finding.position.start.column,\n // What the template asks for, which meta's writer prints in the\n // `<failure>` body, as pretty, GitHub and SARIF print it under the finding.\n guidance: finding.template ?? null,\n };\n}\n\n/**\n * The files this run actually checked, as meta's results.\n *\n * The skipped ones are **not** here, and that is the one place this reporter\n * parts company with the others. A skip has to be reported, or a file nothing\n * looked at is indistinguishable from a file that passed - so pretty says so\n * in words and SARIF files a `toolExecutionNotification`. JUnit has neither:\n * meta's writer emits a testcase or a testcase with a failure, so a skipped\n * file can only arrive as a green test. That is worse than absent. It claims a\n * pass on evidence nobody gathered, and it puts the suite's `tests` count three\n * above the `2 files checked, 3 skipped` the same run prints.\n *\n * So the count here is the run's `checked`, by construction: one testcase per\n * file that was linted.\n */\nexport function toValidationResults(run: LintRun): ValidationResult[] {\n return run.results\n .filter((result) => result.skipped == null)\n .map((result) => ({\n file: result.file,\n // meta's `format` is the extractor that read the file. A lint result does\n // not carry the parser that produced its tree, and no reporter reached\n // through here reads the field, so it names the domain rather than\n // inventing a format the run never recorded.\n format: \"lint\",\n // meta's invariant, not a count: `ok` is \"no error-severity finding\".\n // Read as \"no findings at all\", a file whose only finding is a warning\n // renders as a `✗` through meta's own pretty reporter - which is a\n // legitimate consumer, since this function is exported - while lint's\n // exit code says the run passed.\n ok: !result.findings.some(isErrorSeverity),\n schemas: [RULE_ID_PREFIX],\n errors: result.findings.map(toFieldError),\n }));\n}\n\n/**\n * Straight to meta's JUnit writer rather than through its `render`, which\n * takes a `RunSummary` its junit branch does not forward. Building one here\n * only to have it dropped read as though the suite's counts came from the run,\n * and they do not: they are the length of the list above and how much of it\n * carries an error-severity finding.\n */\nexport function renderJunit(run: LintRun): string {\n return renderJunitXml(toValidationResults(run), {\n classname: JUNIT_CLASSNAME,\n });\n}\n","/**\n * SARIF 2.1.0, the format GitHub code scanning ingests.\n *\n * `github` annotations live and die with one check run: no history, nothing to\n * query, and nothing outside GitHub Actions reads them at all. SARIF is the\n * same findings as a durable artifact - uploaded once, tracked across commits,\n * and understood by every dashboard that speaks the standard.\n *\n * The format's failure mode is silence. A SARIF file with a malformed URI, or\n * with results whose `ruleId` names no declared rule, uploads successfully and\n * then annotates nothing: a green check and an empty dashboard. So the two\n * things most likely to be wrong are the two things this module is most\n * careful about - rule descriptors, and URIs.\n */\nimport type {\n Finding,\n FindingTemplate,\n Position,\n Severity,\n SkipReason,\n} from \"../types.js\";\nimport type { LintFileResult, LintRun } from \"../commands/lint.js\";\nimport { ruleId, ruleName } from \"../core/rule-id.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport {\n artifactLocation,\n fileUri,\n normalizeRoot,\n URI_BASE_ID,\n type ArtifactLocation,\n} from \"../../shared/sarif-location.js\";\n\nconst SARIF_VERSION = \"2.1.0\";\nconst SARIF_SCHEMA =\n \"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json\";\n/**\n * Where code scanning sends someone who clicks \"more information\" on an alert.\n *\n * Deliberately the post-rename URL, which 404s until `doc-structure-lint` is\n * renamed on GitHub - a manual step outside this repo. Pointing it at the\n * current name instead would mean every SARIF report published from the day of\n * the rename onward links somewhere that has moved, and reports outlive the\n * rename; a link that is briefly wrong beats one that is permanently wrong.\n * `package.json`'s `repository` and `bugs` URLs are forward-looking for the\n * same reason, so all three flip together or not at all.\n */\nconst INFORMATION_URI = \"https://github.com/hawkeyexl/manni\";\n\ntype SarifLevel = \"error\" | \"warning\" | \"note\" | \"none\";\n\ninterface SarifMessage {\n text: string;\n}\n\ninterface ReportingDescriptor {\n id: string;\n name: string;\n shortDescription: SarifMessage;\n defaultConfiguration?: { level: SarifLevel };\n}\n\ninterface Region {\n startLine: number;\n startColumn: number;\n endLine: number;\n endColumn: number;\n}\n\ninterface SarifLocation {\n physicalLocation: { artifactLocation: ArtifactLocation; region?: Region };\n}\n\ninterface SarifResult {\n ruleId: string;\n ruleIndex?: number;\n level: SarifLevel;\n message: SarifMessage;\n locations: SarifLocation[];\n properties?: { heading?: string; template?: FindingTemplate };\n}\n\ninterface SarifNotification {\n descriptor: { id: string; index: number };\n level: SarifLevel;\n message: SarifMessage;\n locations: SarifLocation[];\n}\n\ninterface SarifInvocation {\n executionSuccessful: boolean;\n toolExecutionNotifications?: SarifNotification[];\n}\n\ninterface SarifDriver {\n name: string;\n informationUri: string;\n version: string;\n rules: ReportingDescriptor[];\n notifications?: ReportingDescriptor[];\n}\n\ninterface SarifLog {\n $schema: string;\n version: string;\n runs: {\n tool: { driver: SarifDriver };\n originalUriBaseIds: Record<string, { uri: string }>;\n invocations: SarifInvocation[];\n results: SarifResult[];\n }[];\n}\n\nexport interface SarifOptions {\n /**\n * Directory the relative paths in `LintRun` are relative to - the lint run's\n * `cwd`. Defaults to the process cwd, which is what `runLint` itself\n * defaults to. It is a parameter rather than a bare read of `process.cwd()`\n * so the URI mapping, the part most likely to be silently wrong, is testable\n * without moving the whole process into a fixture directory.\n */\n root?: string;\n}\n\n/**\n * The family scale -> SARIF `level`. A total map rather than a ternary, so a\n * fourth severity fails to compile here instead of quietly becoming `error`.\n *\n * The family's three values were chosen to be GitHub's, and SARIF agrees on\n * two of them; it spells the lowest one `note`. meta's reporter folds\n * `notice` onto `note` the same way, so a repository uploading both tools'\n * reports sees one scale. SARIF's `none` has no `Severity` that means it.\n */\nconst LEVELS: Record<Severity, SarifLevel> = {\n notice: \"note\",\n warning: \"warning\",\n error: \"error\",\n};\n\n/**\n * Why a file went unlinted, in words. `Record<SkipReason, ...>` on purpose: a\n * new skip reason should fail to compile until someone has decided what the\n * report says about it.\n */\nconst SKIP_DESCRIPTIONS: Record<SkipReason, string> = {\n \"no-template\": \"File was not linted: no template resolved for it.\",\n \"unsupported-format\": \"File was not linted: no parser handles its format.\",\n unreadable: \"File was not linted: it could not be read.\",\n excluded: \"File was not linted: the Flare target excludes it by its conditions.\",\n};\n\n/**\n * Positions map straight across, with no arithmetic.\n *\n * Both sides are 1-based in line and column. Both also treat the end column as\n * exclusive: SARIF defines `endColumn` as \"the column number of the character\n * following the end of the region\", and `Position` in types.ts is documented\n * as a half-open span with `end` exclusive. Checked against what the parser\n * actually emits rather than taken on trust - remark gives `# Hi`, four\n * characters on line 1, an `end.column` of 5, one past the last character,\n * which is precisely SARIF's convention. So no +1 and no -1 in either\n * direction. A zero-width span (`origin()`, used by findings with nowhere\n * better to point) becomes a zero-length region, which SARIF allows.\n */\nfunction region(position: Position): Region {\n return {\n startLine: position.start.line,\n startColumn: position.start.column,\n endLine: position.end.line,\n endColumn: position.end.column,\n };\n}\n\nfunction location(\n file: string,\n root: string,\n position?: Position,\n): SarifLocation {\n return {\n physicalLocation: {\n artifactLocation: artifactLocation(file, root),\n region: position ? region(position) : undefined,\n },\n };\n}\n\n/**\n * The heading goes in the message *and* in `properties`.\n *\n * In the message because most SARIF viewers show the message and nothing else\n * beside the line: \"Expected at least 2 paragraphs, found 1\" is a different\n * sentence depending on which section it is about, and dropping the heading\n * would make the SARIF annotation less informative than the `github` one for\n * the very same finding. In `properties.heading` because a message is prose\n * and nothing can group or filter on it - a consumer asking for \"every finding\n * under Prerequisites\" should not have to parse English back out.\n *\n * Unlike `renderGithub`, newlines are left intact. A workflow command is one\n * line by definition; a SARIF message is a JSON string with no such limit.\n */\nfunction messageText(finding: Finding): string {\n const text =\n finding.heading != null ? `${finding.heading}: ${finding.message}` : finding.message;\n return [text, ...guidanceLines(finding.template)].join(\"\\n\");\n}\n\nfunction words(id: string): string[] {\n return id.split(/[^A-Za-z0-9]+/).filter(Boolean);\n}\n\n/**\n * `missing_section` -> `MissingSection`. SARIF asks a descriptor `name` to be\n * a single Pascal-case identifier, and GitHub shows it in the rule list.\n */\nfunction pascalCase(id: string): string {\n return words(id)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\"\");\n}\n\n/**\n * `missing_section` -> `Missing section`. Derived from the id, not authored:\n * there is no rule catalog to draw a real description from, and the first\n * finding's message describes one occurrence rather than the rule. Restating\n * the id in prose says nothing new, but it beats an empty column in GitHub's\n * rule list and it can never drift out of step with the rule it describes.\n */\nfunction humanize(id: string): string {\n const text = words(id).join(\" \");\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\ninterface RuleIndex {\n descriptors: ReportingDescriptor[];\n indexOf: Map<string, number>;\n}\n\n/**\n * One `reportingDescriptor` per distinct finding type, in order of first\n * appearance.\n *\n * This is not optional decoration. A result carrying a `ruleId` that matches\n * no descriptor is accepted by GitHub code scanning and then rendered without\n * a rule name, a description, or a working filter - the alert arrives stripped\n * of everything that makes a dashboard usable, and with no error to explain\n * why.\n */\nfunction buildRules(run: LintRun): RuleIndex {\n const indexOf = new Map<string, number>();\n const order: string[] = [];\n const severities = new Map<string, Set<Severity>>();\n\n for (const result of run.results) {\n for (const finding of result.findings) {\n let seen = severities.get(finding.type);\n if (!seen) {\n seen = new Set<Severity>();\n severities.set(finding.type, seen);\n indexOf.set(finding.type, order.length);\n order.push(finding.type);\n }\n seen.add(finding.severity);\n }\n }\n\n const descriptors = order.map((type) => {\n // The descriptor id is the **family** rule id, not the internal `type`:\n // it is what an alert is filed and de-duplicated under, and it has to be\n // the string every other reporter uses for the same finding. `name` and\n // `shortDescription` are derived from the rule half alone, so GitHub's\n // rule list reads \"MissingSection\", not \"ManniLintStructureMissingSection\".\n const rule = ruleName(type);\n const descriptor: ReportingDescriptor = {\n id: ruleId(type),\n name: pascalCase(rule),\n shortDescription: { text: humanize(rule) },\n };\n // Only when every finding of this type agreed on a severity. Severity is\n // per finding, not per rule, so a type that appeared as both an error and\n // a warning has no honest default - and every result states its own\n // `level` regardless, which is what a consumer actually reads.\n const [only, ...rest] = [...(severities.get(type) ?? [])];\n if (only !== undefined && rest.length === 0) {\n descriptor.defaultConfiguration = { level: LEVELS[only] };\n }\n return descriptor;\n });\n\n return { descriptors, indexOf };\n}\n\nfunction propertiesOf(finding: Finding): SarifResult[\"properties\"] {\n const properties: NonNullable<SarifResult[\"properties\"]> = {};\n if (finding.heading != null) properties.heading = finding.heading;\n if (finding.template != null) properties.template = finding.template;\n return Object.keys(properties).length > 0 ? properties : undefined;\n}\n\nfunction toResult(\n finding: Finding,\n file: string,\n rules: RuleIndex,\n root: string,\n): SarifResult {\n return {\n ruleId: ruleId(finding.type),\n // Always populated in practice, since the index is built from these same\n // findings. Omitted rather than faked if it ever is not: a wrong index\n // points the alert at somebody else's rule, which is worse than none.\n ruleIndex: rules.indexOf.get(finding.type),\n level: LEVELS[finding.severity],\n message: { text: messageText(finding) },\n locations: [location(file, root, finding.position)],\n properties: propertiesOf(finding),\n };\n}\n\ninterface SkipReport {\n descriptors: ReportingDescriptor[];\n notifications: SarifNotification[];\n}\n\n/**\n * Skipped files become `toolExecutionNotifications`, not results.\n *\n * They cannot simply be dropped - the pretty reporter's rule applies here too:\n * a file that leaves no trace in the report is indistinguishable from a file\n * that passed, and a docset mid-onboarding is mostly unrouted pages. Reading\n * that as a clean bill of health is the exact failure this format exists to\n * prevent.\n *\n * They are not results either. A result is a statement about the content of a\n * document; a skip is a statement about the tool, which declined to look. As\n * results they would open code-scanning alerts against files nothing has\n * examined, and each of those would then have to be triaged and dismissed by\n * hand. `toolExecutionNotifications` is the slot SARIF defines for \"the tool\n * has something to say about its own execution\", which is what a skip is.\n *\n * Level `note` rather than SARIF's default of `warning`: on a repository that\n * has not adopted doctypes yet nearly every page is skipped, and a warning\n * stream that long is one nobody reads.\n */\nfunction buildSkips(run: LintRun, root: string): SkipReport {\n const indexOf = new Map<string, number>();\n const descriptors: ReportingDescriptor[] = [];\n const notifications: SarifNotification[] = [];\n\n for (const result of run.results) {\n const reason = result.skipped;\n if (reason == null) continue;\n\n let index = indexOf.get(reason);\n if (index === undefined) {\n index = descriptors.length;\n indexOf.set(reason, index);\n descriptors.push({\n id: reason,\n name: pascalCase(reason),\n shortDescription: { text: SKIP_DESCRIPTIONS[reason] },\n });\n }\n\n notifications.push({\n // Declared in `tool.driver.notifications` and referenced by id *and*\n // index, for the same reason results reference their rules both ways.\n descriptor: { id: reason, index },\n level: \"note\",\n message: { text: skipMessage(result, reason) },\n locations: [location(result.file, root)],\n });\n }\n\n return { descriptors, notifications };\n}\n\n/** The specific reason when the run recorded one, the generic one otherwise. */\nfunction skipMessage(result: LintFileResult, reason: SkipReason): string {\n return result.reason ?? SKIP_DESCRIPTIONS[reason];\n}\n\nexport function renderSarif(run: LintRun, opts: SarifOptions = {}): string {\n const root = normalizeRoot(opts.root ?? process.cwd());\n const rules = buildRules(run);\n const skips = buildSkips(run, root);\n\n const results = run.results.flatMap((result) =>\n result.findings.map((finding) =>\n toResult(finding, result.file, rules, root),\n ),\n );\n\n const driver: SarifDriver = {\n name: \"manni-lint\",\n informationUri: INFORMATION_URI,\n version: pkg.version,\n // Emitted even when empty: results point into this array, so a consumer\n // always looks here, and a stable shape is cheaper than a special case.\n rules: rules.descriptors,\n notifications: skips.descriptors.length > 0 ? skips.descriptors : undefined,\n };\n\n const invocation: SarifInvocation = {\n // Findings are the tool doing its job, not failing at it. This would only\n // be false if manni lint itself could not run, and that path exits 2\n // before any report is rendered.\n executionSuccessful: true,\n toolExecutionNotifications:\n skips.notifications.length > 0 ? skips.notifications : undefined,\n };\n\n const log: SarifLog = {\n $schema: SARIF_SCHEMA,\n version: SARIF_VERSION,\n runs: [\n {\n tool: { driver },\n // Declared unconditionally: it is what makes every relative `uri` in\n // this report mean anything, and a reader should not have to infer the\n // base from whether some result happened to use it.\n originalUriBaseIds: { [URI_BASE_ID]: { uri: fileUri(root) } },\n invocations: [invocation],\n results,\n },\n ],\n };\n\n return JSON.stringify(log, null, 2);\n}\n","/**\n * The alignment block `--explain` prints under each routed file: which rule\n * claimed which section, and why. It is lint's answer to \"why did it say\n * that\" for the matcher in `core/match.ts` - proposal 0061's stress test 3\n * names this as the cost of an alignment matcher over a left-to-right one: a\n * tie is invisible unless something prints the pairing it chose.\n *\n * This module recomputes the alignment itself by calling the matcher's own,\n * already-exported `matchSections` - it does not reach into `align()`'s\n * internal step sequence, which is module-private. That has one visible\n * consequence: this file has no way to know the *document position* a missing\n * rule or an unexpected section falls at relative to the other, so a missing\n * rule is placed among the sections that did match using rule order alone\n * (`insertMissing` below), which is exact whenever - as in every template this\n * repository ships - the missing rule is not sandwiched between two unexpected\n * sections with nothing matched between them. `core/match.ts` is read-only\n * from here; exporting the step sequence, if this ever needs to be exact, is a\n * change to that file rather than to this one.\n *\n * The other thing this module cannot get from an export: which key in a\n * page's frontmatter is its title. It assumes `title`, the same key\n * `manni meta`'s own schemas require, and re-reads `tree.frontmatter`\n * directly rather than asking a caller to resolve it, so the assumption lives\n * in exactly one place.\n *\n * **The seam this depends on.** `commands/lint.ts` parses every file and\n * loads its template before `--explain` returns - both already exist at that\n * point in `lintOne` - but neither is currently attached to the\n * `LintFileResult` it returns. `render()` (`reporters/index.ts`) reads them\n * off a result through `ExplainSource`, structurally: a result carrying\n * `tree` and `template` gets an alignment block, and one that does not is\n * printed exactly as before. Wiring `commands/lint.ts` to attach them is\n * outside this chunk's files (`src/lint/commands/lint.ts` is not among them).\n */\nimport { LintError, type DocumentTree, type SectionNode } from \"../types.js\";\nimport { matchSections, type Match } from \"../core/match.js\";\nimport { occurrenceRange, type Rule, type Template } from \"../core/template.js\";\n\n/** What a caller must attach to a `LintFileResult` for the block to render. */\nexport interface ExplainSource {\n tree: DocumentTree;\n template: Template;\n}\n\n/** One line of the block, before indentation is joined on. */\nexport interface AlignmentRow {\n depth: number;\n text: string;\n}\n\nconst LABEL_WIDTH = 22;\nconst ARROW = \"←\"; // ←\nconst ELLIPSIS = \"…\"; // …\nconst TIMES = \"×\"; // ×\n\nfunction pad(label: string): string {\n return label.length >= LABEL_WIDTH ? `${label} ` : label.padEnd(LABEL_WIDTH + 1);\n}\n\n/** A section's title, quoted, or `(no heading)` for one that has none. */\nfunction titleText(title: string | null): string {\n return title === null ? \"(no heading)\" : `\"${title}\"`;\n}\n\n/**\n * A rule's display name: its `id` where it has one, else a literal string\n * `heading`, else `(any)` for anything else - an array, a `{ pattern }`,\n * `heading: false`, or a bare wildcard. Mirrors the priority `--explain`'s\n * spec states, which is not the same order `missingMessage` in `match.ts`\n * uses for its prose: that picks the heading first because it is read as a\n * sentence, and this picks the id first because it is a column header.\n */\nfunction ruleLabel(rule: Rule): string {\n if (rule.id !== undefined) return rule.id;\n if (typeof rule.heading === \"string\") return rule.heading;\n return \"(any)\";\n}\n\n/**\n * The page's own heading, and the note explaining where it came from.\n *\n * Mirrors `validator.ts`'s private `pageSection`: a lone top-level heading\n * *is* the page. Most of the time that heading is not literal, though - every\n * parser with both frontmatter and headings (`parsers/metadata.ts`'s\n * `withMetadataTitle`) already synthesizes an H1 from `frontmatter.title` when\n * the body has none, positioned on the frontmatter block itself, precisely so\n * a template written against \"the page's title is its outermost rule\" does\n * not have to know the difference. By the time a tree reaches here that\n * difference is gone from the section's own fields - so it is recovered the\n * same way `titlePosition` was set: a synthesized heading's position is\n * `tree.frontmatterPosition`, verbatim.\n *\n * `frontmatter.title` is read directly only as a fallback, for a tree a\n * caller built by some other means - the programmatic API accepts one from\n * anywhere - where no such synthesis ran at all.\n */\nfunction pageHeading(tree: DocumentTree): { text: string | null; note: string | null } {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) {\n const text = only.title || null;\n if (text === null) return { text: null, note: \"no heading\" };\n const synthesized =\n only.titlePosition !== null &&\n tree.frontmatterPosition !== null &&\n only.titlePosition.start.offset === tree.frontmatterPosition.start.offset &&\n only.titlePosition.end.offset === tree.frontmatterPosition.end.offset;\n return { text, note: synthesized ? \"synthesized from frontmatter\" : null };\n }\n const raw = tree.frontmatter?.[\"title\"];\n const text = typeof raw === \"string\" && raw !== \"\" ? raw : null;\n return { text, note: text === null ? \"no heading\" : \"synthesized from frontmatter\" };\n}\n\n/** The sections a template's `sections:` rules describe - `pageSection`'s subject. */\nfunction pageSections(tree: DocumentTree): SectionNode[] {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) return only.sections;\n return tree.sections;\n}\n\n/**\n * One matched or collapsed run of matches, rendered as a single row.\n *\n * Both call sites build `run` by pushing one already-known `Match` before\n * ever calling this, so it is never empty; the guard below exists to let the\n * checker see that rather than to handle a real empty-run case.\n */\nfunction matchedRow(depth: number, run: Match[]): AlignmentRow {\n const head = run[0];\n if (!head) return { depth, text: `${pad(\"(empty run)\")}${ARROW} (missing)` };\n const rule = head.rule;\n const first = head.section;\n const last = (run[run.length - 1] ?? head).section;\n const label = run.length === 1 ? ruleLabel(rule) : `${ruleLabel(rule)} ${TIMES}${run.length}`;\n // Coercion can only ever land on a run of length 1: `ALIGNMENT_COSTS.coerce`\n // is open only to a required occurrence whose `max` is 1 (`match.ts`'s\n // header explains why), and a rule with `max: 1` can never contribute a\n // second match to a run.\n const coerced = run.length === 1 && head.coerced ? \" (coerced)\" : \"\";\n const arrow =\n run.length === 1\n ? `${titleText(first.title || null)}${coerced}`\n : `${titleText(first.title || null)} ${ELLIPSIS} ${titleText(last.title || null)}`;\n return { depth, text: `${pad(label)}${ARROW} ${arrow}` };\n}\n\n/**\n * What an absent rule is called.\n *\n * `(missing)` means exactly what produces a `missing_section` finding, so it\n * is reserved for a rule that had to appear. An optional rule that took\n * nothing is `(none)`: absent, and fine. Sharing one word made a page that\n * lints clean print a row saying something was missing from it, which is the\n * opposite of what `--explain` is for.\n */\nfunction absentLabel(rule: Rule): string {\n return occurrenceRange(rule).min > 0 ? \"(missing)\" : \"(none)\";\n}\n\n/** A rule with nothing to show, or a `repeat` group with nothing at all. */\nfunction missingRows(depth: number, rule: Rule): AlignmentRow[] {\n if (!rule.repeat) {\n return [{ depth, text: `${pad(ruleLabel(rule))}${ARROW} ${absentLabel(rule)}` }];\n }\n // A group's members inherit the group's own occurrence: a member of an\n // optional group is not missing when the whole group never ran.\n const label = absentLabel(rule);\n const rows: AlignmentRow[] = [{ depth, text: pad(rule.id ?? \"(repeat)\").trimEnd() }];\n for (const member of rule.repeat) {\n rows.push({ depth: depth + 1, text: `${pad(ruleLabel(member))}${ARROW} ${label}` });\n }\n return rows;\n}\n\n/**\n * Insert `missing`, each tagged with the index of the rule it is about, among\n * `matched` entries tagged the same way (`null` for one that has no rule -\n * an unexpected section). A missing rule never displaces an unexpected\n * section: only a matched entry's index gates it, so an unexpected section is\n * carried along in whichever position document order already put it in.\n */\nfunction insertMissing(\n matched: { index: number | null; rows: AlignmentRow[] }[],\n missing: { index: number; rows: AlignmentRow[] }[],\n): AlignmentRow[] {\n const out: AlignmentRow[] = [];\n let mi = 0;\n for (const entry of matched) {\n while (mi < missing.length) {\n // `mi < missing.length` just guarded this, so `next` is always here;\n // the check only lets the type checker see the invariant the loop\n // bound already established.\n const next = missing[mi];\n if (!next || (entry.index !== null && next.index >= entry.index)) break;\n out.push(...next.rows);\n mi++;\n }\n out.push(...entry.rows);\n }\n while (mi < missing.length) {\n const next = missing[mi];\n if (!next) break;\n out.push(...next.rows);\n mi++;\n }\n return out;\n}\n\n/**\n * One level: `rules` against `sections`, and every matched pair's own\n * subsections.\n *\n * A `repeat` member's `Match.rule` is the member itself, never the group\n * (`match.ts`'s `compile` only ever assigns an occurrence to a leaf rule), so\n * a group is never a key in `matches`. `rootOf` recovers \"which top-level\n * rule is this a member of\" - itself, for a rule with no group - which is\n * what lets a group be judged matched or missing as one thing while still\n * naming which of its members carried the section.\n */\nfunction alignLevel(\n rules: Rule[] | undefined,\n sections: SectionNode[],\n parent: SectionNode | null,\n depth: number,\n): AlignmentRow[] {\n // `undefined` is the template saying nothing about this level - silence,\n // not \"no sections allowed\" - so there is nothing to align and nothing to\n // print. `matchSections` draws the same line; this mirrors it rather than\n // passing `[]` through, which would turn silence into every section here\n // reading as unexpected.\n if (rules === undefined) return [];\n\n const { matches } = matchSections(sections, rules, { parent });\n const ruleIndex = new Map<Rule, number>(rules.map((r, i) => [r, i]));\n const rootOf = new Map<Rule, Rule>();\n for (const rule of rules) {\n if (rule.repeat) for (const member of rule.repeat) rootOf.set(member, rule);\n else rootOf.set(rule, rule);\n }\n const rootOfRule = (rule: Rule): Rule => rootOf.get(rule) ?? rule;\n const matchedRoots = new Set(matches.map((m) => rootOfRule(m.rule)));\n const bySection = new Map<SectionNode, Match>(matches.map((m) => [m.section, m]));\n\n const matched: { index: number | null; rows: AlignmentRow[] }[] = [];\n let i = 0;\n while (i < sections.length) {\n // `i < sections.length` just guarded this; `section` always exists.\n const section = sections[i];\n if (!section) break;\n const match = bySection.get(section);\n if (!match) {\n matched.push({\n index: null,\n rows: [{ depth, text: `(unexpected) ${titleText(section.title || null)}` }],\n });\n i++;\n continue;\n }\n\n const root = rootOfRule(match.rule);\n if (root.repeat) {\n // Every section, in this run, that belongs to this same group - by\n // whichever member took it, not necessarily the same one twice.\n const taken: Match[] = [];\n while (i < sections.length) {\n const here = sections[i];\n if (!here) break;\n const next = bySection.get(here);\n if (!next || rootOfRule(next.rule) !== root) break;\n taken.push(next);\n i++;\n }\n const rows: AlignmentRow[] = [{ depth, text: pad(root.id ?? \"(repeat)\").trimEnd() }];\n let run: Match[] = [];\n const flushMember = (): void => {\n if (run.length === 0) return;\n rows.push(matchedRow(depth + 1, run));\n for (const m of run) {\n rows.push(...alignLevel(m.rule.sections, m.section.sections, m.section, depth + 2));\n }\n run = [];\n };\n for (const m of taken) {\n const first = run[0];\n if (first && first.rule !== m.rule) flushMember();\n run.push(m);\n }\n flushMember();\n // A member this occurrence never reached prints missing beside the\n // members it did, the same information `missingRows` gives a group with\n // nothing at all.\n const takenMembers = new Set(taken.map((m) => m.rule));\n for (const member of root.repeat) {\n if (takenMembers.has(member)) continue;\n rows.push({ depth: depth + 1, text: `${pad(ruleLabel(member))}${ARROW} (missing)` });\n }\n matched.push({ index: ruleIndex.get(root) ?? null, rows });\n continue;\n }\n\n // A plain rule: gather the run of consecutive sections it claimed.\n const run: Match[] = [match];\n i++;\n while (i < sections.length) {\n const here = sections[i];\n if (!here) break;\n const next = bySection.get(here);\n if (!next || next.rule !== match.rule) break;\n run.push(next);\n i++;\n }\n const rows = [matchedRow(depth, run)];\n for (const m of run) {\n rows.push(...alignLevel(m.rule.sections, m.section.sections, m.section, depth + 1));\n }\n matched.push({ index: ruleIndex.get(match.rule) ?? null, rows });\n }\n\n const missing = rules\n .filter((rule) => !matchedRoots.has(rule))\n .map((rule) => {\n const index = ruleIndex.get(rule);\n if (index === undefined) {\n // `ruleIndex` is built from this exact `rules` array above, so every\n // rule reached here (it came from filtering `rules` itself) has an\n // entry; this is unreachable.\n //\n // `LintError` rather than `Error` even so. Everything this tool throws\n // is caught by the bin runner and exits 2, an operational error; a bare\n // `Error` would escape that and exit 1, which means \"the documents have\n // findings\". An internal fault must never be reported as a lint result.\n throw new LintError(\"alignLevel: rule missing from its own index\");\n }\n return { index, rows: missingRows(depth, rule) };\n });\n\n return insertMissing(matched, missing);\n}\n\n/** The full alignment block for one file: the page row, then its sections. */\nexport function explainAlignment(tree: DocumentTree, template: Template): AlignmentRow[] {\n const heading = pageHeading(tree);\n const arrow =\n heading.text !== null\n ? `${titleText(heading.text)}${heading.note ? ` (${heading.note})` : \"\"}`\n : `(${heading.note ?? \"no heading\"})`;\n const rows: AlignmentRow[] = [{ depth: 0, text: `${pad(\"(page)\")}${ARROW} ${arrow}` }];\n rows.push(...alignLevel(template.sections, pageSections(tree), null, 1));\n return rows;\n}\n\n/** `AlignmentRow[]` as the indented text `renderExplain` prints, two spaces per depth. */\nexport function formatAlignment(rows: AlignmentRow[]): string[] {\n return rows.map((row) => `${\" \".repeat(row.depth)}${row.text}`);\n}\n","/**\n * Reporters render a run to a string. The CLI writes the result to stdout;\n * diagnostics go to stderr separately, so a report is never interleaved with\n * anything a consumer has to parse around.\n */\nimport { LintError, type Finding } from \"../types.js\";\nimport type { LintFileResult, LintRun } from \"../commands/lint.js\";\nimport type { FormatInfo, ToolInfo } from \"../commands/tools.js\";\nimport type { TemplateInfo, TemplatesInfo } from \"../commands/templates.js\";\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport {\n escapeWorkflowCommandMessage,\n escapeWorkflowCommandProperty,\n} from \"../../shared/github.js\";\nimport type { ReportFormat as FamilyFormat } from \"../../meta/index.js\";\nimport { REPORT_FORMAT_LIST } from \"../../meta/internal.js\";\nimport { ruleId, TOOL_NAME } from \"../core/rule-id.js\";\nimport { renderJunit } from \"./junit.js\";\nimport { renderSarif } from \"./sarif.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport { explainAlignment, formatAlignment, type ExplainSource } from \"./alignment.js\";\n\nexport { renderJunit, toValidationResults } from \"./junit.js\";\n\n/**\n * Every `-f` value, plus `--explain`.\n *\n * The findings formats are the family's, taken from meta rather than restated,\n * so a format added there is available here the moment lint's `render` grows a\n * case for it - and a value lint does not handle is a compile error instead of\n * a silent fall-through to pretty. `explain` is lint's own: it is reachable\n * through `--explain` and never through `-f`, because it reports on\n * configuration rather than on documents.\n */\nexport type ReportFormat = FamilyFormat | \"explain\";\n\n/** Listing commands have nothing to annotate, so they offer no `github`. */\nexport type ListFormat = \"pretty\" | \"json\";\n\nexport interface ReportOptions {\n color?: boolean;\n /**\n * Directory the run's relative paths are relative to, forwarded to the SARIF\n * reporter and ignored by the others. Defaults to the process cwd, which is\n * right for the CLI because `runLint` defaults its `cwd` the same way.\n *\n * It is here rather than only on `renderSarif` because `render` is the entry\n * point a library caller reaches for, and without it that caller was pinned\n * to the process cwd with no way out short of bypassing `render` entirely -\n * for the one reporter whose whole output is paths.\n */\n root?: string;\n}\n\nfunction plural(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? \"\" : \"s\"}`;\n}\n\n/** `line:column` of a finding, the anchor an editor can jump to. */\nfunction locate(finding: Finding): string {\n return `${finding.position.start.line}:${finding.position.start.column}`;\n}\n\n/** A finding as prose: the heading it is about, then what is wrong with it. */\nfunction describeFinding(finding: Finding): string {\n return finding.heading != null\n ? `${finding.heading}: ${finding.message}`\n : finding.message;\n}\n\n/**\n * A finding's level prefix, meta's shape: nothing for an error, since the\n * `✗`/`✓` mark already says that; the word itself, coloured, for anything\n * milder. Keeps a passing file's warning from reading as just another\n * anonymous line once it is printed beside real errors on a failing one.\n */\nfunction levelPrefix(c: Colors, severity: Finding[\"severity\"]): string {\n if (severity === \"error\") return \"\";\n return `${severity === \"notice\" ? c.dim(\"notice\") : c.yellow(\"warning\")} `;\n}\n\nexport function renderPretty(run: LintRun, opts: ReportOptions = {}): string {\n const c = palette(opts.color ?? false);\n const lines: string[] = [];\n let warnings = 0;\n let notices = 0;\n\n for (const result of run.results) {\n // A skip is reported, never silently dropped: an unreadable format that\n // leaves no trace is indistinguishable from a file that passed.\n if (result.skipped != null) {\n const why = result.reason ?? result.skipped;\n lines.push(`${c.yellow(\"-\")} ${result.file} ${c.dim(`skipped: ${why}`)}`);\n continue;\n }\n if (result.success && result.findings.length === 0) {\n lines.push(`${c.green(\"✓\")} ${result.file}`);\n continue;\n }\n // `success` means \"no error-severity finding\", not \"no findings\" - a\n // passing file can still hold a warning, such as\n // `unsupported_content_kind`. Reusing `✓` for it would hide the warning\n // behind the same glyph a clean file gets; reusing `✗` would fail a file\n // nothing actually failed. `⚠` (meta's and cite's mark for the same case)\n // says \"passing, but read this\" without claiming either extreme.\n const mark = result.success ? c.yellow(\"⚠\") : c.red(\"✗\");\n lines.push(`${mark} ${result.file}`);\n for (const finding of result.findings) {\n // Counted apart, because they are not the same thing to a reader. Every\n // structure finding used to be an `error` or the occasional `warning`,\n // so \"not an error\" and \"a warning\" were the same set. DITA-OT reports an\n // undefined key reference at `notice`, and calling that a warning on the\n // summary line overstates it.\n if (finding.severity === \"warning\") warnings++;\n else if (finding.severity === \"notice\") notices++;\n // The namespaced id rather than the bare `type`: it is what SARIF,\n // JUnit and the GitHub annotation file the finding under, so the string\n // a reader copies out of the terminal is the one they can search for.\n lines.push(\n ` ${c.dim(locate(finding))} ${c.cyan(ruleId(finding.type))} ` +\n `${levelPrefix(c, finding.severity)}${describeFinding(finding)}`,\n );\n // What the template asks for, under the rule id it explains.\n const indent = \" \".repeat(6 + locate(finding).length);\n for (const line of guidanceLines(finding.template)) lines.push(`${indent}${c.dim(line)}`);\n }\n }\n\n const { checked, passed, failed, skipped } = run.summary;\n // Named only when there are any, as meta and cite do: every run against a\n // format that reports every content kind has none.\n const warningsText = warnings > 0 ? `, ${plural(warnings, \"warning\")}` : \"\";\n const noticesText = notices > 0 ? `, ${plural(notices, \"notice\")}` : \"\";\n const summary = `${plural(checked, \"file\")} checked, ${passed} passed, ${failed} failed, ${skipped} skipped${warningsText}${noticesText}`;\n if (lines.length > 0) lines.push(\"\");\n lines.push(failed > 0 ? c.red(summary) : c.green(summary));\n return lines.join(\"\\n\");\n}\n\n/**\n * The published JSON shape, and the reason this builds objects by hand rather\n * than stringifying `run.results` directly.\n *\n * manni docevals reads `[{ file, success, errors: [{ type, heading, message,\n * position: { start: { line, column } } }] }]` off stdout, and it parses\n * rather than validates - a renamed key produces zero findings, not an error.\n * So: a bare array at the top level, and `errors`, even though the internal\n * field is `findings`. Adding keys is safe; renaming or nesting is not.\n */\nexport function renderJson(run: LintRun): string {\n const results = run.results.map((result) => ({\n file: result.file,\n success: result.success,\n errors: result.findings.map((finding) => ({\n type: finding.type,\n // Additive, and deliberately beside `type` rather than instead of it.\n // `ruleId` is the family id every other reporter files this finding\n // under; `tool` names which tool produced it, the question a second\n // lint job makes worth asking.\n ruleId: ruleId(finding.type),\n tool: TOOL_NAME,\n heading: finding.heading,\n message: finding.message,\n position: finding.position,\n // Additive too, and the reason it has to be: `success: true` beside a\n // non-empty `errors` array is exactly what a warning-only file looks\n // like now that `success` means \"no error-severity finding\" rather than\n // \"no findings\". Without this key a consumer has no way to tell that\n // apart from an error the JSON shape simply forgot to fail on.\n severity: finding.severity,\n // Additive: the template that judged the page and the rule this finding\n // is about, or null when no template stands behind it.\n template: finding.template ?? null,\n })),\n // Additive, and the one thing this shape could not say. A skipped file is\n // `{success: false, errors: []}`, which is also what a failure whose\n // finding vanished looks like - so a consumer counting failures counted a\n // file nothing read as a file that was read and found wanting. Null rather\n // than absent, because a key that comes and goes makes \"not skipped\" and\n // \"an older manni\" the same observation. The prose `reason` stays off the\n // wire; it is a diagnostic for the pretty and SARIF reports.\n skipped: result.skipped ?? null,\n }));\n return JSON.stringify(results, null, 2);\n}\n\n/**\n * GitHub workflow commands: one annotation per finding, shaped as cite's are -\n * `::<severity> file=…,line=…,col=…,title=<ruleId>::<message>`.\n *\n * The rule id is a `title=` property rather than a `[type]` prefix inside the\n * message. GitHub renders the title as the alert's own heading, so the prefix\n * spelled the rule's name a second time; and `title` is the field a reader can\n * group and filter on, which prose can never be.\n *\n * The level is the severity, not a constant `error`. The family scale was\n * chosen to be GitHub's for exactly this: `::warning` and `::notice` render\n * inline like `::error` but do not fail the check, which is the severity\n * invariant in GitHub's terms, and it is load-bearing rather than theoretical:\n * `unsupported_content_kind` is a `warning`, so it annotates the file without\n * failing the job.\n *\n * Line breaks are escaped rather than collapsed to spaces, as this once did.\n * `%0A` is the format's own answer and GitHub renders it as a multi-line\n * annotation, so the message arrives whole; collapsing threw away the author's\n * line breaks to solve a problem the escape already solves, and its `\\r?\\n`\n * pattern let a bare carriage return through into the command untouched.\n *\n * The escaping itself is the family's, from `src/shared/github.ts`. It lives\n * there precisely so a second renderer cannot re-derive it: the replacements\n * are order-dependent (`%` first, or the escape sequences get escaped again),\n * and a local copy that got the order wrong would look identical in review and\n * only show itself on a message carrying a literal `%`.\n */\nexport function renderGithub(run: LintRun): string {\n const lines: string[] = [];\n for (const result of run.results) {\n for (const finding of result.findings) {\n const params = [\n `file=${escapeWorkflowCommandProperty(result.file)}`,\n `line=${finding.position.start.line}`,\n `col=${finding.position.start.column}`,\n `title=${escapeWorkflowCommandProperty(ruleId(finding.type))}`,\n ];\n const message = escapeWorkflowCommandMessage(\n [describeFinding(finding), ...guidanceLines(finding.template)].join(\"\\n\"),\n );\n lines.push(`::${finding.severity} ${params.join(\",\")}::${message}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * `--explain`: the resolution chain per file, rather than findings.\n *\n * Printing every stage, including the ones that had nothing to say, is the\n * point. \"Which template linted this page?\" is usually asked because the answer\n * was surprising, and the surprising part is almost always a stage the reader\n * forgot applies - a stray `$template`, an override glob matching more than\n * intended. A report that showed only the winning stage would hide exactly the\n * thing being looked for.\n */\n/**\n * The alignment block riding on a result. `commands/lint.ts` attaches the tree\n * and the loaded template under `alignment` when `--explain` asked for them,\n * and only for a file that routed; a result without it prints as it always did.\n *\n * It is a nested key rather than two flat ones because `template` at the top\n * level is already the template's *ref*, the string the routing line shows.\n */\nfunction alignmentFor(result: LintFileResult): string[] | null {\n const source: ExplainSource | undefined = result.alignment;\n if (!source) return null;\n return formatAlignment(explainAlignment(source.tree, source.template));\n}\n\nexport function renderExplain(run: LintRun, opts: ReportOptions = {}): string {\n const c = palette(opts.color ?? false);\n const lines: string[] = [];\n\n for (const result of run.results) {\n // Not the pass/fail glyphs: `--explain` reports whether a page was routed,\n // and a routed page may still be full of findings. Reusing the tick would\n // read as a clean bill of health for a document nothing has looked at yet.\n const chosen = result.template;\n lines.push(`${chosen ? c.cyan(\"▸\") : c.dim(\"-\")} ${c.bold(result.file)}`);\n\n // What a Flare topic resolved against, ahead of the routing it fed.\n if (result.flare !== undefined) {\n const { project, target } = result.flare;\n const detail =\n target === undefined\n ? `${project}, no target`\n : `${project}, target ${target.name} (${target.from})`;\n lines.push(` ${c.dim(\"·\")} ${\"flare\".padEnd(20)} ${c.dim(detail)}`);\n }\n\n const steps = result.resolution?.steps ?? [];\n if (steps.length === 0) {\n lines.push(` ${c.dim(\"(no resolution recorded)\")}`);\n }\n for (const step of steps) {\n const mark = step.ref ? c.green(\"→\") : c.dim(\"·\");\n const label = step.ref ? c.bold(step.ref) : c.dim(step.detail);\n const suffix = step.ref ? ` ${c.dim(step.detail)}` : \"\";\n lines.push(` ${mark} ${step.stage.padEnd(20)} ${label}${suffix}`);\n }\n\n const alignment = chosen ? alignmentFor(result) : null;\n if (alignment && alignment.length > 0) {\n lines.push(` ${c.dim(\"alignment\")}`);\n for (const row of alignment) lines.push(` ${row}`);\n }\n\n const cause = result.resolution?.cause;\n if (cause === \"unknown-type\") {\n const type = result.resolution?.unknownType ?? \"(none recorded)\";\n const near = result.resolution?.suggestions ?? [];\n const known = result.resolution?.knownTypes ?? [];\n // The same fallback the pretty reporter gives. Without it a typo with no\n // near miss - which is most of them, since a near miss needs the typo to\n // be close - printed the failure and nothing to act on, while the plain\n // lint output for that page listed every doctype available.\n const hint = near.length\n ? `; did you mean ${near.join(\", \")}?`\n : known.length\n ? `; known doctypes: ${known.join(\", \")}`\n : \"\";\n lines.push(` ${c.red(\"✗\")} no template serves type \"${type}\"${hint}`);\n } else if (result.skipped === \"excluded\") {\n lines.push(` ${c.dim(`skipped: ${result.reason ?? \"excluded\"}`)}`);\n } else if (cause === \"no-type\") {\n lines.push(` ${c.dim(\"skipped: the page declares no type\")}`);\n }\n lines.push(\"\");\n }\n\n const routed = run.results.filter((r) => r.template != null).length;\n lines.push(\n `${run.results.length} file${run.results.length === 1 ? \"\" : \"s\"}, ` +\n `${routed} routed, ${run.results.length - routed} unrouted`,\n );\n return lines.join(\"\\n\");\n}\n\nexport function render(\n run: LintRun,\n format: ReportFormat,\n opts: ReportOptions = {},\n): string {\n switch (format) {\n case \"json\":\n return renderJson(run);\n case \"github\":\n return renderGithub(run);\n case \"sarif\":\n return renderSarif(run, opts.root === undefined ? {} : { root: opts.root });\n case \"junit\":\n return renderJunit(run);\n case \"explain\":\n return renderExplain(run, opts);\n case \"pretty\":\n return renderPretty(run, opts);\n default: {\n // Exhaustive, and the guard is what makes the claim true: sharing an arm\n // with `pretty` narrowed nothing, so a format added to meta's\n // `REPORT_FORMATS` - which is what the CLI validates `-f` against - was\n // accepted here and silently rendered as a human report. Now it is a\n // compile error, and this is its runtime half for library callers.\n const unreachable: never = format;\n throw new LintError(\n `Unknown report format ${JSON.stringify(unreachable)}. Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n }\n}\n\n/** One template per line: the ref to pass, its title, and the types it serves. */\nfunction templateLine(c: Colors, entry: TemplateInfo): string {\n const title = entry.title !== \"\" ? ` ${c.dim(\"—\")} ${entry.title}` : \"\";\n const types =\n entry.types.length > 0 ? entry.types.join(\", \") : \"(no types declared)\";\n return ` ${c.cyan(entry.id)}${title} ${c.dim(`types: ${types}`)} ${c.dim(`[${entry.source}]`)}`;\n}\n\nexport function renderTemplates(\n info: TemplatesInfo,\n format: ListFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(info, null, 2);\n\n const c = palette(opts.color ?? false);\n const lines: string[] = [c.bold(\"Templates:\")];\n if (info.templates.length === 0) {\n lines.push(c.dim(\" (none)\"));\n } else {\n for (const entry of info.templates) lines.push(templateLine(c, entry));\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * One input format as `markdown Markdown (.md, .markdown) kinds: paragraph,\n * codeBlock, list`.\n *\n * The kinds are left out entirely when there are none, rather than printed as\n * an empty list. A tool outside the package answers the job without parsing\n * into the content model, so it has no kinds to report, and a bare `kinds:`\n * label reads as a rendering fault rather than as the answer.\n */\nfunction formatLine(c: Colors, entry: FormatInfo): string {\n const head = ` ${c.cyan(entry.name)} ${entry.label} (${entry.extensions.join(\", \")})`;\n if (entry.kinds.length === 0) return head;\n return `${head} ${c.dim(`kinds: ${entry.kinds.join(\", \")}`)}`;\n}\n\n/**\n * `manni lint tools`: one block per job. Every column is printed for every\n * job, the negatives included - \"not configured\" beside a job that still runs\n * on defaults is the answer someone ran this command to get.\n */\nexport function renderTools(\n tools: ToolInfo[],\n format: ListFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(tools, null, 2);\n\n const c = palette(opts.color ?? false);\n const lines: string[] = [c.bold(\"Jobs:\")];\n for (const entry of tools) {\n const state = [\n entry.configured ? \"configured\" : \"not configured\",\n entry.available ? \"available\" : \"unavailable\",\n ].join(\", \");\n // A tool that is not here has no version to report, and the row still\n // prints: \"unavailable\" beside a blank cell reads as a rendering fault\n // rather than as the answer. The dash is a cell standing in for a missing\n // value, which is why it is an em dash in a house style that bans them in\n // prose.\n const version = entry.version ?? \"—\";\n lines.push(\n ` ${c.cyan(entry.job)} tool: ${c.bold(entry.tool)} ${version} [${state}]`,\n );\n lines.push(` config: ${c.dim(entry.config)}`);\n lines.push(` ${c.dim(\"formats:\")}`);\n for (const info of entry.formats) lines.push(formatLine(c, info));\n }\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAM,iBAAiB;AAGvB,IAAM,YAAY;AAGlB,IAAM,gBAAyB;AAQ/B,SAAS,SAAS,MAAsB;AAC7C,SAAO,KAAK,QAAQ,WAAW,EAAE,EAAE,QAAQ,MAAM,GAAG;AACtD;AAGO,SAAS,OAAO,MAAc,MAAe,eAAuB;AACzE,SAAO,GAAG,cAAc,IAAI,GAAG,IAAI,SAAS,IAAI,CAAC;AACnD;;;ACpBA,IAAM,kBAAkB;AAmBxB,SAAS,aACP,SACY;AACZ,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SACE,QAAQ,WAAW,OACf,GAAG,QAAQ,OAAO,KAAK,QAAQ,OAAO,KACtC,QAAQ;AAAA,IACd,SAAS,GAAG,aAAa,IAAI,SAAS,QAAQ,IAAI,CAAC;AAAA,IACnD,UAAU,QAAQ;AAAA,IAClB,MAAM,QAAQ,SAAS,MAAM;AAAA,IAC7B,KAAK,QAAQ,SAAS,MAAM;AAAA;AAAA;AAAA,IAG5B,UAAU,QAAQ,YAAY;AAAA,EAChC;AACF;AAiBO,SAAS,oBAAoB,KAAkC;AACpE,SAAO,IAAI,QACR,OAAO,CAAC,WAAW,OAAO,WAAW,IAAI,EACzC,IAAI,CAAC,YAAY;AAAA,IAChB,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKb,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMR,IAAI,CAAC,OAAO,SAAS,KAAK,eAAe;AAAA,IACzC,SAAS,CAAC,cAAc;AAAA,IACxB,QAAQ,OAAO,SAAS,IAAI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