@hawkeyexl/manni 4.20.1 → 4.21.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-J626LZ22.js → batch-C534YIAU.js} +14 -14
- package/dist/{build-AYLD6V6Y.js → build-SVKT7QFU.js} +15 -14
- package/dist/{calibrate-2HZFACIX.js → calibrate-AL3MH7TY.js} +15 -15
- package/dist/{capture-NMDIPC6S.js → capture-2F7B4DAD.js} +14 -14
- package/dist/check-BI7OGIVE.js +48 -0
- package/dist/{check-RCSQARQE.js → check-JZINDP3F.js} +13 -13
- package/dist/{check-PQ7S5I3I.js → check-LKPQPQWJ.js} +15 -15
- package/dist/check-OPUMZEVK.js +35 -0
- package/dist/{check-KNQV7GLU.js → check-OW7UD73D.js} +12 -12
- package/dist/{chunk-N3DYE6LJ.js → chunk-22WGKOQ7.js} +5 -5
- package/dist/{chunk-TAJYMXMM.js → chunk-2HOWRAWK.js} +2 -2
- package/dist/{chunk-ROZDHPKA.js → chunk-2NGFDLIM.js} +3 -3
- package/dist/{chunk-GGTCSMNX.js → chunk-2YKUSTHS.js} +4 -4
- package/dist/{chunk-S2HW3CBF.js → chunk-3SFAB75L.js} +5 -5
- package/dist/{chunk-E6JYRVR5.js → chunk-5LE4NH3Z.js} +24 -7
- package/dist/chunk-5LE4NH3Z.js.map +1 -0
- package/dist/{chunk-NDPQ2GQ4.js → chunk-5UJKXOAD.js} +5 -5
- package/dist/chunk-6XK3NTL5.js +706 -0
- package/dist/chunk-6XK3NTL5.js.map +1 -0
- package/dist/{chunk-XPO655IX.js → chunk-762MM6NA.js} +3 -3
- package/dist/{chunk-FIR2MAGS.js → chunk-A4QNKEX4.js} +2 -2
- package/dist/{chunk-YIHIRMXN.js → chunk-AE6KBAAU.js} +4 -4
- package/dist/{chunk-UVC3BUKU.js → chunk-APAF4VWW.js} +3 -3
- package/dist/{chunk-D54BQM5P.js → chunk-ARNI3SJT.js} +7 -7
- package/dist/{chunk-OXCWCEVV.js → chunk-BHGFLRXM.js} +5 -5
- package/dist/{chunk-WRWW6SGG.js → chunk-BJUEOC4G.js} +2 -2
- package/dist/{chunk-MPXMQGJI.js → chunk-BKY6GAFA.js} +8 -8
- package/dist/{chunk-ACJUZFRT.js → chunk-BLXRIAV2.js} +4 -4
- package/dist/{chunk-H3C3UXTA.js → chunk-BXCVOHEX.js} +7 -7
- package/dist/{chunk-ODSIHEIW.js → chunk-BXE4L52Q.js} +2 -2
- package/dist/{chunk-YM2W43DI.js → chunk-CLPC3LKX.js} +13 -9
- package/dist/chunk-CLPC3LKX.js.map +1 -0
- package/dist/{chunk-P6XZ44C2.js → chunk-CREFJCWZ.js} +4 -4
- package/dist/{chunk-OQR3VVAX.js → chunk-CZIO37J5.js} +3 -3
- package/dist/{chunk-OVUQNM7Y.js → chunk-D4QHRVDJ.js} +2 -2
- package/dist/{chunk-WI3PPQQX.js → chunk-D5GBYKDU.js} +2 -2
- package/dist/{chunk-A633WB3N.js → chunk-DENZLZ3Z.js} +22 -20
- package/dist/{chunk-A633WB3N.js.map → chunk-DENZLZ3Z.js.map} +1 -1
- package/dist/{chunk-P5DWBG6T.js → chunk-DMVBIIP3.js} +3 -3
- package/dist/{chunk-LPJ3IB26.js → chunk-DPDG3FHL.js} +17 -3
- package/dist/chunk-DPDG3FHL.js.map +1 -0
- package/dist/{chunk-MTMR65NM.js → chunk-E23KWEPL.js} +2 -2
- package/dist/{chunk-5E3ABFOQ.js → chunk-E7OG5F6S.js} +3 -3
- package/dist/{chunk-5CJ3P5O3.js → chunk-FHJIH6XP.js} +8 -98
- package/dist/chunk-FHJIH6XP.js.map +1 -0
- package/dist/{chunk-O4O6JOGD.js → chunk-GMLOAKOA.js} +16 -4
- package/dist/chunk-GMLOAKOA.js.map +1 -0
- package/dist/{chunk-YYWZ2MSL.js → chunk-H5YWCCBO.js} +16 -11
- package/dist/chunk-H5YWCCBO.js.map +1 -0
- package/dist/{chunk-2GTR24SA.js → chunk-HHJ2HFPP.js} +8 -8
- package/dist/{chunk-Z2T5U7HN.js → chunk-IN5T22FP.js} +2 -2
- package/dist/{chunk-RA2BER5P.js → chunk-IOJD2RFG.js} +2 -2
- package/dist/{chunk-MJZ5HYYL.js → chunk-JQA6RF4R.js} +2 -2
- package/dist/{chunk-MJZ5HYYL.js.map → chunk-JQA6RF4R.js.map} +1 -1
- package/dist/{chunk-ZB3OFSRB.js → chunk-JUUCCML3.js} +4 -4
- package/dist/{chunk-TDG2S5UE.js → chunk-KBSTXL6L.js} +3 -3
- package/dist/{chunk-MJZK7G4B.js → chunk-KCWNJMSS.js} +3 -3
- package/dist/{chunk-EOJEPEYY.js → chunk-KQDRO6N6.js} +2 -2
- package/dist/{chunk-ISDFYXLA.js → chunk-LWBNHK72.js} +15 -13
- package/dist/{chunk-ISDFYXLA.js.map → chunk-LWBNHK72.js.map} +1 -1
- package/dist/{chunk-HGUCJ3K3.js → chunk-MTCOBRCX.js} +4 -4
- package/dist/{chunk-N2VB6UUE.js → chunk-NLJ3XIKT.js} +7 -5
- package/dist/{chunk-N2VB6UUE.js.map → chunk-NLJ3XIKT.js.map} +1 -1
- package/dist/{chunk-FKELQCGN.js → chunk-OWJLB2AF.js} +2 -2
- package/dist/{chunk-D4XQX4W7.js → chunk-P7HAXMFN.js} +2 -2
- package/dist/{chunk-4F5WGZRP.js → chunk-PACZEDOH.js} +5 -5
- package/dist/{chunk-QSPH4F56.js → chunk-PTGXEZQD.js} +2 -2
- package/dist/chunk-PTGXEZQD.js.map +1 -0
- package/dist/{chunk-SUTY4VCZ.js → chunk-Q76T6Y6X.js} +6 -6
- package/dist/{chunk-CXL6ES7O.js → chunk-R2CR62JV.js} +4 -4
- package/dist/{chunk-RN7IA742.js → chunk-RKACUTY5.js} +7 -7
- package/dist/{chunk-JPXC62SD.js → chunk-RQPEKHZH.js} +8 -6
- package/dist/{chunk-JPXC62SD.js.map → chunk-RQPEKHZH.js.map} +1 -1
- package/dist/{chunk-CT5WSUUZ.js → chunk-RWXR3GJI.js} +2 -2
- package/dist/{chunk-4H3IOF52.js → chunk-S5G6T4VC.js} +3 -3
- package/dist/chunk-SHXPE4D4.js +100 -0
- package/dist/chunk-SHXPE4D4.js.map +1 -0
- package/dist/{chunk-6FY573GB.js → chunk-TFVNEPMF.js} +3 -3
- package/dist/{chunk-BM43RJIS.js → chunk-U4OJ7U45.js} +8 -8
- package/dist/{chunk-LXJ4FZ7Y.js → chunk-V2XJJEEF.js} +4 -4
- package/dist/{chunk-QGBNWEWS.js → chunk-VLRIP4BQ.js} +2 -2
- package/dist/{chunk-BY4THWAQ.js → chunk-WHVFHBL3.js} +3 -3
- package/dist/{chunk-KERICP5Y.js → chunk-XBJKYXOR.js} +6 -6
- package/dist/{chunk-C5BXSQDO.js → chunk-XI3BNZG4.js} +5 -5
- package/dist/{chunk-4DFBBU4A.js → chunk-YSZNJ2ID.js} +2 -2
- package/dist/{cli-IIFCE6GY.js → cli-3PBRPPMQ.js} +14 -14
- package/dist/{cli-ISKXSN3P.js → cli-6NKE6RMT.js} +18 -18
- package/dist/{cli-FTSJQSB4.js → cli-77A46SB2.js} +17 -17
- package/dist/{cli-PCZ7XNCO.js → cli-AVHLY2AI.js} +61 -45
- package/dist/cli-AVHLY2AI.js.map +1 -0
- package/dist/{cli-DQRFSU7U.js → cli-FDXU7CGZ.js} +15 -14
- package/dist/{cli-DQRFSU7U.js.map → cli-FDXU7CGZ.js.map} +1 -1
- package/dist/{cli-6J4P5MLU.js → cli-FSDJY5OC.js} +2 -2
- package/dist/{cli-K5635N25.js → cli-JNYL6LB7.js} +14 -14
- package/dist/{cli-TCHSYJLB.js → cli-K47XWDLJ.js} +21 -21
- package/dist/{cli-TM2JCTQT.js → cli-LP5OE3BL.js} +9 -9
- package/dist/{cli-4RTNEVVX.js → cli-MOKRUHZT.js} +9 -9
- package/dist/{cli-K5QWXB7H.js → cli-MQXOK64K.js} +26 -25
- package/dist/{cli-K5QWXB7H.js.map → cli-MQXOK64K.js.map} +1 -1
- package/dist/cli.js +15 -15
- package/dist/{config-7I5CHHRZ.js → config-BMWDC66C.js} +2 -2
- package/dist/docmeta.js +8 -8
- package/dist/github-6GYTPSGV.js +35 -0
- package/dist/{github-CMAZWS76.js → github-DJOLVNDD.js} +12 -12
- package/dist/{github-NXR4QMMM.js → github-ZF2TQ3RP.js} +14 -14
- package/dist/index.d.ts +2 -1
- package/dist/index.js +49 -47
- package/dist/index.js.map +1 -1
- package/dist/json-Y7625EFE.js +42 -0
- package/dist/{json-7Z2IFGB3.js → json-YIK72XAL.js} +12 -12
- package/dist/{labels-SE2WL7WD.js → labels-X633ZPK7.js} +11 -11
- package/dist/{lint-VUYM5PPM.js → lint-RF3B55W7.js} +12 -12
- package/dist/{list-WD3TZS5R.js → list-5DW4QZ7P.js} +12 -12
- package/dist/list-7CHWJ633.js +39 -0
- package/dist/{list-LTF25DQE.js → list-UNWG6NPD.js} +12 -12
- package/dist/{page-A2Y4ZMV4.js → page-OMPEACUN.js} +11 -11
- package/dist/{prepare-M2COBP5O.js → prepare-B4JVDVOV.js} +13 -13
- package/dist/{pretty-SFFOMSG5.js → pretty-PPNHHOEN.js} +13 -13
- package/dist/{pretty-D3DZFC5U.js → pretty-U7ATCFBN.js} +12 -12
- package/dist/pretty-XGYQ25PH.js +43 -0
- package/dist/{reporters-UTLJVSWX.js → reporters-FAIEOTC4.js} +11 -11
- package/dist/{reporters-TO7Q6JYF.js → reporters-KE7AZR6C.js} +4 -4
- package/dist/{run-BDGYRUXJ.js → run-MHJ3AYKG.js} +12 -12
- package/dist/{sarif-IAGMXA6C.js → sarif-DOGRSGTB.js} +10 -10
- package/dist/{sarif-GJYLRXLS.js → sarif-MIEMQOIK.js} +11 -11
- package/dist/{sarif-EHAMGCVR.js → sarif-RGRG7VFX.js} +15 -15
- package/dist/{strategy-UKRA6WO4.js → strategy-EK5VY5DG.js} +24 -23
- package/dist/{strategy-UKRA6WO4.js.map → strategy-EK5VY5DG.js.map} +1 -1
- package/dist/{term-AMORBEO7.js → term-MDN3NJDW.js} +17 -17
- package/dist/{validate-CDTKFZUV.js → validate-QDYQ642J.js} +5 -5
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +11 -3
- package/plugin/manni/hooks/hooks.json +4 -4
- package/plugin/manni/hooks/manni.mjs +18 -5
- package/plugin/manni/hooks/tracevals.mjs +7 -0
- package/plugin/manni/skills/fix/SKILL.md +5 -1
- package/dist/check-OH4KKXP3.js +0 -33
- package/dist/check-PRAMKQCI.js +0 -47
- package/dist/chunk-5CJ3P5O3.js.map +0 -1
- package/dist/chunk-DNF42MK7.js +0 -326
- package/dist/chunk-DNF42MK7.js.map +0 -1
- package/dist/chunk-E6JYRVR5.js.map +0 -1
- package/dist/chunk-LPJ3IB26.js.map +0 -1
- package/dist/chunk-O4O6JOGD.js.map +0 -1
- package/dist/chunk-QSPH4F56.js.map +0 -1
- package/dist/chunk-SIREOHLW.js +0 -233
- package/dist/chunk-SIREOHLW.js.map +0 -1
- package/dist/chunk-YM2W43DI.js.map +0 -1
- package/dist/chunk-YYWZ2MSL.js.map +0 -1
- package/dist/cli-PCZ7XNCO.js.map +0 -1
- package/dist/github-BUK5CVQW.js +0 -27
- package/dist/json-NZSGRYOE.js +0 -34
- package/dist/list-4JGOXLOZ.js +0 -33
- package/dist/pretty-R67YU6TU.js +0 -35
- /package/dist/{batch-J626LZ22.js.map → batch-C534YIAU.js.map} +0 -0
- /package/dist/{build-AYLD6V6Y.js.map → build-SVKT7QFU.js.map} +0 -0
- /package/dist/{calibrate-2HZFACIX.js.map → calibrate-AL3MH7TY.js.map} +0 -0
- /package/dist/{capture-NMDIPC6S.js.map → capture-2F7B4DAD.js.map} +0 -0
- /package/dist/{check-KNQV7GLU.js.map → check-BI7OGIVE.js.map} +0 -0
- /package/dist/{check-OH4KKXP3.js.map → check-JZINDP3F.js.map} +0 -0
- /package/dist/{check-PQ7S5I3I.js.map → check-LKPQPQWJ.js.map} +0 -0
- /package/dist/{check-PRAMKQCI.js.map → check-OPUMZEVK.js.map} +0 -0
- /package/dist/{check-RCSQARQE.js.map → check-OW7UD73D.js.map} +0 -0
- /package/dist/{chunk-N3DYE6LJ.js.map → chunk-22WGKOQ7.js.map} +0 -0
- /package/dist/{chunk-TAJYMXMM.js.map → chunk-2HOWRAWK.js.map} +0 -0
- /package/dist/{chunk-ROZDHPKA.js.map → chunk-2NGFDLIM.js.map} +0 -0
- /package/dist/{chunk-GGTCSMNX.js.map → chunk-2YKUSTHS.js.map} +0 -0
- /package/dist/{chunk-S2HW3CBF.js.map → chunk-3SFAB75L.js.map} +0 -0
- /package/dist/{chunk-NDPQ2GQ4.js.map → chunk-5UJKXOAD.js.map} +0 -0
- /package/dist/{chunk-XPO655IX.js.map → chunk-762MM6NA.js.map} +0 -0
- /package/dist/{chunk-FIR2MAGS.js.map → chunk-A4QNKEX4.js.map} +0 -0
- /package/dist/{chunk-YIHIRMXN.js.map → chunk-AE6KBAAU.js.map} +0 -0
- /package/dist/{chunk-UVC3BUKU.js.map → chunk-APAF4VWW.js.map} +0 -0
- /package/dist/{chunk-D54BQM5P.js.map → chunk-ARNI3SJT.js.map} +0 -0
- /package/dist/{chunk-OXCWCEVV.js.map → chunk-BHGFLRXM.js.map} +0 -0
- /package/dist/{chunk-WRWW6SGG.js.map → chunk-BJUEOC4G.js.map} +0 -0
- /package/dist/{chunk-MPXMQGJI.js.map → chunk-BKY6GAFA.js.map} +0 -0
- /package/dist/{chunk-ACJUZFRT.js.map → chunk-BLXRIAV2.js.map} +0 -0
- /package/dist/{chunk-H3C3UXTA.js.map → chunk-BXCVOHEX.js.map} +0 -0
- /package/dist/{chunk-ODSIHEIW.js.map → chunk-BXE4L52Q.js.map} +0 -0
- /package/dist/{chunk-P6XZ44C2.js.map → chunk-CREFJCWZ.js.map} +0 -0
- /package/dist/{chunk-OQR3VVAX.js.map → chunk-CZIO37J5.js.map} +0 -0
- /package/dist/{chunk-OVUQNM7Y.js.map → chunk-D4QHRVDJ.js.map} +0 -0
- /package/dist/{chunk-WI3PPQQX.js.map → chunk-D5GBYKDU.js.map} +0 -0
- /package/dist/{chunk-P5DWBG6T.js.map → chunk-DMVBIIP3.js.map} +0 -0
- /package/dist/{chunk-MTMR65NM.js.map → chunk-E23KWEPL.js.map} +0 -0
- /package/dist/{chunk-5E3ABFOQ.js.map → chunk-E7OG5F6S.js.map} +0 -0
- /package/dist/{chunk-2GTR24SA.js.map → chunk-HHJ2HFPP.js.map} +0 -0
- /package/dist/{chunk-Z2T5U7HN.js.map → chunk-IN5T22FP.js.map} +0 -0
- /package/dist/{chunk-RA2BER5P.js.map → chunk-IOJD2RFG.js.map} +0 -0
- /package/dist/{chunk-ZB3OFSRB.js.map → chunk-JUUCCML3.js.map} +0 -0
- /package/dist/{chunk-TDG2S5UE.js.map → chunk-KBSTXL6L.js.map} +0 -0
- /package/dist/{chunk-MJZK7G4B.js.map → chunk-KCWNJMSS.js.map} +0 -0
- /package/dist/{chunk-EOJEPEYY.js.map → chunk-KQDRO6N6.js.map} +0 -0
- /package/dist/{chunk-HGUCJ3K3.js.map → chunk-MTCOBRCX.js.map} +0 -0
- /package/dist/{chunk-FKELQCGN.js.map → chunk-OWJLB2AF.js.map} +0 -0
- /package/dist/{chunk-D4XQX4W7.js.map → chunk-P7HAXMFN.js.map} +0 -0
- /package/dist/{chunk-4F5WGZRP.js.map → chunk-PACZEDOH.js.map} +0 -0
- /package/dist/{chunk-SUTY4VCZ.js.map → chunk-Q76T6Y6X.js.map} +0 -0
- /package/dist/{chunk-CXL6ES7O.js.map → chunk-R2CR62JV.js.map} +0 -0
- /package/dist/{chunk-RN7IA742.js.map → chunk-RKACUTY5.js.map} +0 -0
- /package/dist/{chunk-CT5WSUUZ.js.map → chunk-RWXR3GJI.js.map} +0 -0
- /package/dist/{chunk-4H3IOF52.js.map → chunk-S5G6T4VC.js.map} +0 -0
- /package/dist/{chunk-6FY573GB.js.map → chunk-TFVNEPMF.js.map} +0 -0
- /package/dist/{chunk-BM43RJIS.js.map → chunk-U4OJ7U45.js.map} +0 -0
- /package/dist/{chunk-LXJ4FZ7Y.js.map → chunk-V2XJJEEF.js.map} +0 -0
- /package/dist/{chunk-QGBNWEWS.js.map → chunk-VLRIP4BQ.js.map} +0 -0
- /package/dist/{chunk-BY4THWAQ.js.map → chunk-WHVFHBL3.js.map} +0 -0
- /package/dist/{chunk-KERICP5Y.js.map → chunk-XBJKYXOR.js.map} +0 -0
- /package/dist/{chunk-C5BXSQDO.js.map → chunk-XI3BNZG4.js.map} +0 -0
- /package/dist/{chunk-4DFBBU4A.js.map → chunk-YSZNJ2ID.js.map} +0 -0
- /package/dist/{cli-IIFCE6GY.js.map → cli-3PBRPPMQ.js.map} +0 -0
- /package/dist/{cli-ISKXSN3P.js.map → cli-6NKE6RMT.js.map} +0 -0
- /package/dist/{cli-FTSJQSB4.js.map → cli-77A46SB2.js.map} +0 -0
- /package/dist/{cli-6J4P5MLU.js.map → cli-FSDJY5OC.js.map} +0 -0
- /package/dist/{cli-K5635N25.js.map → cli-JNYL6LB7.js.map} +0 -0
- /package/dist/{cli-TCHSYJLB.js.map → cli-K47XWDLJ.js.map} +0 -0
- /package/dist/{cli-TM2JCTQT.js.map → cli-LP5OE3BL.js.map} +0 -0
- /package/dist/{cli-4RTNEVVX.js.map → cli-MOKRUHZT.js.map} +0 -0
- /package/dist/{config-7I5CHHRZ.js.map → config-BMWDC66C.js.map} +0 -0
- /package/dist/{github-BUK5CVQW.js.map → github-6GYTPSGV.js.map} +0 -0
- /package/dist/{github-CMAZWS76.js.map → github-DJOLVNDD.js.map} +0 -0
- /package/dist/{github-NXR4QMMM.js.map → github-ZF2TQ3RP.js.map} +0 -0
- /package/dist/{json-7Z2IFGB3.js.map → json-Y7625EFE.js.map} +0 -0
- /package/dist/{json-NZSGRYOE.js.map → json-YIK72XAL.js.map} +0 -0
- /package/dist/{labels-SE2WL7WD.js.map → labels-X633ZPK7.js.map} +0 -0
- /package/dist/{lint-VUYM5PPM.js.map → lint-RF3B55W7.js.map} +0 -0
- /package/dist/{list-4JGOXLOZ.js.map → list-5DW4QZ7P.js.map} +0 -0
- /package/dist/{list-LTF25DQE.js.map → list-7CHWJ633.js.map} +0 -0
- /package/dist/{list-WD3TZS5R.js.map → list-UNWG6NPD.js.map} +0 -0
- /package/dist/{page-A2Y4ZMV4.js.map → page-OMPEACUN.js.map} +0 -0
- /package/dist/{prepare-M2COBP5O.js.map → prepare-B4JVDVOV.js.map} +0 -0
- /package/dist/{pretty-D3DZFC5U.js.map → pretty-PPNHHOEN.js.map} +0 -0
- /package/dist/{pretty-R67YU6TU.js.map → pretty-U7ATCFBN.js.map} +0 -0
- /package/dist/{pretty-SFFOMSG5.js.map → pretty-XGYQ25PH.js.map} +0 -0
- /package/dist/{reporters-TO7Q6JYF.js.map → reporters-FAIEOTC4.js.map} +0 -0
- /package/dist/{reporters-UTLJVSWX.js.map → reporters-KE7AZR6C.js.map} +0 -0
- /package/dist/{run-BDGYRUXJ.js.map → run-MHJ3AYKG.js.map} +0 -0
- /package/dist/{sarif-EHAMGCVR.js.map → sarif-DOGRSGTB.js.map} +0 -0
- /package/dist/{sarif-GJYLRXLS.js.map → sarif-MIEMQOIK.js.map} +0 -0
- /package/dist/{sarif-IAGMXA6C.js.map → sarif-RGRG7VFX.js.map} +0 -0
- /package/dist/{term-AMORBEO7.js.map → term-MDN3NJDW.js.map} +0 -0
- /package/dist/{validate-CDTKFZUV.js.map → validate-QDYQ642J.js.map} +0 -0
package/dist/chunk-DNF42MK7.js
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
PAGE_FIELDS,
|
|
4
|
-
PARENTS,
|
|
5
|
-
RECORD_TYPES,
|
|
6
|
-
STRATEGY_RULES,
|
|
7
|
-
isStrategyRule
|
|
8
|
-
} from "./chunk-O4O6JOGD.js";
|
|
9
|
-
import {
|
|
10
|
-
declaredAt,
|
|
11
|
-
metaPageView
|
|
12
|
-
} from "./chunk-MJZK7G4B.js";
|
|
13
|
-
import {
|
|
14
|
-
STDIN_REQUIRES_AS
|
|
15
|
-
} from "./chunk-ODSIHEIW.js";
|
|
16
|
-
import {
|
|
17
|
-
STDIN_LABEL,
|
|
18
|
-
STDIN_TOKEN,
|
|
19
|
-
assertNonEmpty,
|
|
20
|
-
extractorByName,
|
|
21
|
-
extractorForExtension,
|
|
22
|
-
gitignoreOptions,
|
|
23
|
-
resolveTargetSet,
|
|
24
|
-
supportedExtensions
|
|
25
|
-
} from "./chunk-WRWW6SGG.js";
|
|
26
|
-
import {
|
|
27
|
-
SEVERITIES
|
|
28
|
-
} from "./chunk-77AINBYM.js";
|
|
29
|
-
import {
|
|
30
|
-
findConfigFile,
|
|
31
|
-
readConfigFile,
|
|
32
|
-
selectCollections
|
|
33
|
-
} from "./chunk-B2242FYO.js";
|
|
34
|
-
import {
|
|
35
|
-
ToolError,
|
|
36
|
-
errorMessage
|
|
37
|
-
} from "./chunk-G3T47CFV.js";
|
|
38
|
-
|
|
39
|
-
// src/strategy/errors.ts
|
|
40
|
-
var StrategyError = class extends ToolError {
|
|
41
|
-
constructor(message) {
|
|
42
|
-
super(message);
|
|
43
|
-
this.name = "StrategyError";
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// src/strategy/core/config.ts
|
|
48
|
-
import { resolve } from "node:path";
|
|
49
|
-
var STRATEGY_SECTION = "strategy";
|
|
50
|
-
var DEFAULT_STRATEGY_BASELINE_PATH = ".manni-strategy-baseline.json";
|
|
51
|
-
var CONFIG_KEYS = ["severity", "baseline", "allowEmpty", "respectGitignore"];
|
|
52
|
-
var COLLECTION_KEYS = ["paths", "exclude"];
|
|
53
|
-
var SEVERITY_LEVELS = [...SEVERITIES, "off"];
|
|
54
|
-
var CONFIG_FILE = {
|
|
55
|
-
section: STRATEGY_SECTION,
|
|
56
|
-
legacyNames: [],
|
|
57
|
-
toError: (message) => new StrategyError(message)
|
|
58
|
-
};
|
|
59
|
-
function isMapping(value) {
|
|
60
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
61
|
-
}
|
|
62
|
-
function isLevel(value) {
|
|
63
|
-
return typeof value === "string" && SEVERITY_LEVELS.includes(value);
|
|
64
|
-
}
|
|
65
|
-
function rejectUnknownKeys(obj, allowed, where, source) {
|
|
66
|
-
for (const key of Object.keys(obj)) {
|
|
67
|
-
if (!allowed.includes(key)) {
|
|
68
|
-
throw new StrategyError(`Unknown key "${key}" under ${where}: in ${source}. Supported keys: ${allowed.join(", ")}.`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function wrongType(key, expected, source) {
|
|
73
|
-
return new StrategyError(`strategy.${key} in ${source} must be ${expected}.`);
|
|
74
|
-
}
|
|
75
|
-
function asBoolean(value, key, source) {
|
|
76
|
-
if (typeof value !== "boolean") throw wrongType(key, "a boolean", source);
|
|
77
|
-
return value;
|
|
78
|
-
}
|
|
79
|
-
function parseSeverity(value, source) {
|
|
80
|
-
if (!isMapping(value)) throw wrongType("severity", "a mapping", source);
|
|
81
|
-
rejectUnknownKeys(value, STRATEGY_RULES, "strategy.severity", source);
|
|
82
|
-
const severity = {};
|
|
83
|
-
for (const [rule, level] of Object.entries(value)) {
|
|
84
|
-
if (!isStrategyRule(rule)) continue;
|
|
85
|
-
if (!isLevel(level)) {
|
|
86
|
-
const quoted = typeof level === "string" ? ` "${level}"` : "";
|
|
87
|
-
throw new StrategyError(
|
|
88
|
-
`${source}: strategy.severity.${rule}${quoted} is not a level. Expected ${SEVERITY_LEVELS.join(" | ")}.`
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
severity[rule] = level;
|
|
92
|
-
}
|
|
93
|
-
return severity;
|
|
94
|
-
}
|
|
95
|
-
function parseStrategyConfig(raw, source) {
|
|
96
|
-
if (raw == null) return {};
|
|
97
|
-
if (!isMapping(raw)) throw new StrategyError(`strategy: in ${source} must be a mapping.`);
|
|
98
|
-
for (const key of COLLECTION_KEYS) {
|
|
99
|
-
if (Object.hasOwn(raw, key)) {
|
|
100
|
-
throw new StrategyError(`${source}: strategy does not carry "${key}". Name a collection under collections:.`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
rejectUnknownKeys(raw, CONFIG_KEYS, "strategy", source);
|
|
104
|
-
const config = {};
|
|
105
|
-
if (raw.severity !== void 0) config.severity = parseSeverity(raw.severity, source);
|
|
106
|
-
if (raw.baseline !== void 0) {
|
|
107
|
-
if (typeof raw.baseline !== "string") throw wrongType("baseline", "a string", source);
|
|
108
|
-
config.baseline = raw.baseline;
|
|
109
|
-
}
|
|
110
|
-
if (raw.allowEmpty !== void 0) config.allowEmpty = asBoolean(raw.allowEmpty, "allowEmpty", source);
|
|
111
|
-
if (raw.respectGitignore !== void 0) {
|
|
112
|
-
config.respectGitignore = asBoolean(raw.respectGitignore, "respectGitignore", source);
|
|
113
|
-
}
|
|
114
|
-
return config;
|
|
115
|
-
}
|
|
116
|
-
var STDIN = "-";
|
|
117
|
-
async function resolveStrategyRun(opts) {
|
|
118
|
-
const cwd = resolve(opts.cwd);
|
|
119
|
-
const wanted = opts.collection ?? [];
|
|
120
|
-
if (wanted.length > 0 && opts.inputs.some((input) => input !== STDIN)) {
|
|
121
|
-
throw new StrategyError("--collection selects a configured collection; it cannot be combined with paths.");
|
|
122
|
-
}
|
|
123
|
-
const file = opts.configPath ? await readConfigFile(opts.configPath, cwd, CONFIG_FILE) : await findConfigFile(cwd, CONFIG_FILE);
|
|
124
|
-
if (wanted.length > 0 && file === null) {
|
|
125
|
-
throw new StrategyError("--collection needs a config file to select from.");
|
|
126
|
-
}
|
|
127
|
-
const config = file === null ? null : parseStrategyConfig(file.value, file.source);
|
|
128
|
-
const collections = file ? selectCollections(file.collections, wanted, file.source, (message) => new StrategyError(message)) : [];
|
|
129
|
-
const fromCollections = opts.inputs.length === 0;
|
|
130
|
-
const inputs = fromCollections ? collections.flatMap((c) => c.paths) : opts.inputs;
|
|
131
|
-
const base = fromCollections && inputs.length > 0 && file ? file.dir : cwd;
|
|
132
|
-
return {
|
|
133
|
-
config,
|
|
134
|
-
inputs,
|
|
135
|
-
base,
|
|
136
|
-
collections,
|
|
137
|
-
fromCollections,
|
|
138
|
-
...file ? { configDir: file.dir, configPath: file.path, configSource: file.source, configFile: file } : {}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// src/strategy/commands/run.ts
|
|
143
|
-
import { isAbsolute, relative, resolve as resolve3 } from "node:path";
|
|
144
|
-
|
|
145
|
-
// src/strategy/core/load-set.ts
|
|
146
|
-
import { readFile } from "node:fs/promises";
|
|
147
|
-
import { basename, extname, resolve as resolve2 } from "node:path";
|
|
148
|
-
function isRecordType(value) {
|
|
149
|
-
return typeof value === "string" && RECORD_TYPES.includes(value);
|
|
150
|
-
}
|
|
151
|
-
function text(value) {
|
|
152
|
-
return typeof value === "string" && value.trim() !== "" ? value : void 0;
|
|
153
|
-
}
|
|
154
|
-
function extract(content, label, path, format) {
|
|
155
|
-
const extractor = extractorByName(format);
|
|
156
|
-
if (extractor === void 0) throw new StrategyError(`${label}: no reader for format "${format}".`);
|
|
157
|
-
try {
|
|
158
|
-
return { label, extracted: extractor.extract(content, path ?? label) };
|
|
159
|
-
} catch (error) {
|
|
160
|
-
throw new StrategyError(`${label}: could not be read as ${format}: ${errorMessage(error)}`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
async function readInput(path, label) {
|
|
164
|
-
try {
|
|
165
|
-
return await readFile(path, "utf8");
|
|
166
|
-
} catch (error) {
|
|
167
|
-
throw new StrategyError(`${label}: could not be read: ${errorMessage(error)}`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async function extractAll(opts, allowEmpty) {
|
|
171
|
-
const { run } = opts;
|
|
172
|
-
const exclude = opts.exclude ?? [];
|
|
173
|
-
const usingStdin = run.inputs.includes(STDIN_TOKEN);
|
|
174
|
-
const inputs = run.inputs.filter((input) => input !== STDIN_TOKEN);
|
|
175
|
-
if (usingStdin && (opts.as === void 0 || opts.as === "")) throw new StrategyError(STDIN_REQUIRES_AS);
|
|
176
|
-
if (inputs.length === 0 && !usingStdin) {
|
|
177
|
-
throw new StrategyError(
|
|
178
|
-
"No files to read. Pass paths/globs, or declare a collection under `collections:` in manni.config.yaml."
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
const out = [];
|
|
182
|
-
if (inputs.length > 0) {
|
|
183
|
-
const { files, gitignoreSkipped } = await resolveTargetSet({
|
|
184
|
-
inputs,
|
|
185
|
-
cwd: run.base,
|
|
186
|
-
exclude,
|
|
187
|
-
exts: opts.exts ?? supportedExtensions(),
|
|
188
|
-
allowEmpty,
|
|
189
|
-
...gitignoreOptions({
|
|
190
|
-
...opts.noGitignore === true ? { flag: false } : {},
|
|
191
|
-
...run.config?.respectGitignore === void 0 ? {} : { configured: run.config.respectGitignore },
|
|
192
|
-
...opts.onNotice ? { onNotice: opts.onNotice } : {}
|
|
193
|
-
})
|
|
194
|
-
});
|
|
195
|
-
assertNonEmpty({
|
|
196
|
-
files,
|
|
197
|
-
inputs,
|
|
198
|
-
usingStdin,
|
|
199
|
-
allowEmpty,
|
|
200
|
-
exclude,
|
|
201
|
-
...opts.exts === void 0 ? {} : { exts: opts.exts },
|
|
202
|
-
gitignoreSkipped,
|
|
203
|
-
action: "read"
|
|
204
|
-
});
|
|
205
|
-
for (const file of files) {
|
|
206
|
-
const extractor = extractorForExtension(extname(file));
|
|
207
|
-
if (extractor === void 0) {
|
|
208
|
-
throw new StrategyError(`${file}: no reader for its extension. Pass --as <format> through stdin to read it.`);
|
|
209
|
-
}
|
|
210
|
-
const path = resolve2(run.base, file);
|
|
211
|
-
out.push(extract(await readInput(path, file), file, path, extractor.name));
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (usingStdin && opts.as !== void 0) out.push(extract(opts.stdin ?? "", STDIN_LABEL, void 0, opts.as));
|
|
215
|
-
return out;
|
|
216
|
-
}
|
|
217
|
-
function valuesOf(data, field) {
|
|
218
|
-
const raw = data[field];
|
|
219
|
-
if (typeof raw === "string") return raw.trim() === "" ? [] : [{ value: raw, pointer: `/${field}` }];
|
|
220
|
-
if (!Array.isArray(raw)) return [];
|
|
221
|
-
return raw.flatMap(
|
|
222
|
-
(item, i) => typeof item === "string" && item.trim() !== "" ? [{ value: item, pointer: `/${field}/${String(i)}` }] : []
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
function stem(label) {
|
|
226
|
-
const name = basename(label);
|
|
227
|
-
return name.slice(0, name.length - extname(name).length);
|
|
228
|
-
}
|
|
229
|
-
async function loadStrategySet(opts) {
|
|
230
|
-
const { run } = opts;
|
|
231
|
-
const allowEmpty = opts.allowEmpty ?? run.config?.allowEmpty === true;
|
|
232
|
-
const inputs = await extractAll(opts, allowEmpty);
|
|
233
|
-
const view = await metaPageView({
|
|
234
|
-
cwd: run.base,
|
|
235
|
-
...run.configPath === void 0 ? { noConfig: true } : { configPath: run.configPath },
|
|
236
|
-
pages: inputs.filter((i) => i.label !== STDIN_LABEL).map((i) => resolve2(run.base, i.label))
|
|
237
|
-
});
|
|
238
|
-
const set = { records: [], references: [] };
|
|
239
|
-
for (const { label, extracted } of inputs) {
|
|
240
|
-
const merged = await view.merge(label, extracted);
|
|
241
|
-
const data = merged.extracted.data;
|
|
242
|
-
const at = (pointer) => declaredAt(label, pointer, { extracted: merged.extracted, locate: merged.locate });
|
|
243
|
-
const type = data["type"];
|
|
244
|
-
const isRecord = isRecordType(type);
|
|
245
|
-
if (isRecord) {
|
|
246
|
-
const declaredId = text(data["id"]);
|
|
247
|
-
const title = text(data["title"]);
|
|
248
|
-
const description = text(data["description"]);
|
|
249
|
-
const lifecycle = text(data["lifecycle"]);
|
|
250
|
-
const record = {
|
|
251
|
-
id: declaredId ?? stem(label),
|
|
252
|
-
type,
|
|
253
|
-
...title === void 0 ? {} : { title },
|
|
254
|
-
...description === void 0 ? {} : { description },
|
|
255
|
-
...lifecycle === void 0 ? {} : { lifecycle },
|
|
256
|
-
file: label,
|
|
257
|
-
line: 1,
|
|
258
|
-
...declaredId === void 0 ? {} : { idAt: at("/id") },
|
|
259
|
-
parents: type === "audience" ? [] : valuesOf(data, PARENTS[type]).map(({ value, pointer }) => ({ value, ...at(pointer) }))
|
|
260
|
-
};
|
|
261
|
-
set.records.push(record);
|
|
262
|
-
}
|
|
263
|
-
const parentField = isRecord && type !== "audience" ? PARENTS[type] : void 0;
|
|
264
|
-
for (const field of Object.values(PAGE_FIELDS)) {
|
|
265
|
-
if (field === parentField) continue;
|
|
266
|
-
for (const { value, pointer } of valuesOf(data, field)) {
|
|
267
|
-
const reference = { field, value, page: label, record: isRecord, ...at(pointer) };
|
|
268
|
-
set.references.push(reference);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
if (set.records.length === 0 && !allowEmpty) {
|
|
273
|
-
throw new StrategyError(
|
|
274
|
-
"no strategy records found. A record is a page declaring type: audience, type: persona or type: journey."
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
return set;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// src/strategy/commands/run.ts
|
|
281
|
-
async function loadStrategy(opts) {
|
|
282
|
-
const cwd = resolve3(opts.cwd ?? process.cwd());
|
|
283
|
-
const run = await resolveStrategyRun({
|
|
284
|
-
cwd,
|
|
285
|
-
inputs: opts.inputs,
|
|
286
|
-
...opts.configPath === void 0 ? {} : { configPath: opts.configPath },
|
|
287
|
-
...opts.collection === void 0 ? {} : { collection: opts.collection }
|
|
288
|
-
});
|
|
289
|
-
const exclude = [
|
|
290
|
-
.../* @__PURE__ */ new Set([...opts.exclude ?? [], ...run.fromCollections ? run.collections.flatMap((c) => c.exclude) : []])
|
|
291
|
-
];
|
|
292
|
-
const set = await loadStrategySet({
|
|
293
|
-
run,
|
|
294
|
-
exclude,
|
|
295
|
-
...opts.exts === void 0 ? {} : { exts: opts.exts },
|
|
296
|
-
...opts.allowEmpty === true ? { allowEmpty: true } : {},
|
|
297
|
-
...opts.noGitignore === true ? { noGitignore: true } : {},
|
|
298
|
-
...opts.stdin === void 0 ? {} : { stdin: opts.stdin },
|
|
299
|
-
...opts.as === void 0 ? {} : { as: opts.as },
|
|
300
|
-
...opts.onNotice === void 0 ? {} : { onNotice: opts.onNotice }
|
|
301
|
-
});
|
|
302
|
-
return { cwd, run, set };
|
|
303
|
-
}
|
|
304
|
-
function formatChoice(value, allowed) {
|
|
305
|
-
const found = allowed.find((candidate) => candidate === value);
|
|
306
|
-
if (found === void 0) throw new StrategyError(`unknown format "${value}". Expected ${allowed.join(" | ")}.`);
|
|
307
|
-
return found;
|
|
308
|
-
}
|
|
309
|
-
function displayPath(path, cwd, base = cwd) {
|
|
310
|
-
if (path.startsWith("<")) return path;
|
|
311
|
-
const rel = relative(cwd, isAbsolute(path) ? path : resolve3(base, path));
|
|
312
|
-
return (rel === "" ? "." : rel).replaceAll("\\", "/");
|
|
313
|
-
}
|
|
314
|
-
function plural(n, one, many = `${one}s`) {
|
|
315
|
-
return `${String(n)} ${n === 1 ? one : many}`;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
export {
|
|
319
|
-
StrategyError,
|
|
320
|
-
DEFAULT_STRATEGY_BASELINE_PATH,
|
|
321
|
-
loadStrategy,
|
|
322
|
-
formatChoice,
|
|
323
|
-
displayPath,
|
|
324
|
-
plural
|
|
325
|
-
};
|
|
326
|
-
//# sourceMappingURL=chunk-DNF42MK7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/strategy/errors.ts","../src/strategy/core/config.ts","../src/strategy/commands/run.ts","../src/strategy/core/load-set.ts"],"sourcesContent":["import { ToolError } from \"../shared/errors.js\";\n\n/** An operational or usage error in the strategy tool: exit 2. */\nexport class StrategyError extends ToolError {\n constructor(message: string) {\n super(message);\n this.name = \"StrategyError\";\n }\n}\n","/**\n * The `strategy:` section of manni.config.yaml, and the run resolution every\n * command shares (proposal 0102). Its keys mirror `term:`'s, and so do its\n * refusals: unknown keys, rules or levels are errors that name what is\n * supported and never echo a value. The document set is the family\n * `collections:`, so `paths` and `exclude` are refused by name.\n */\nimport { resolve } from \"node:path\";\nimport { selectCollections } from \"../../shared/collections.js\";\nimport { findConfigFile, readConfigFile, type ConfigFile, type ConfigFileOptions } from \"../../shared/config-file.js\";\nimport { SEVERITIES } from \"../../shared/severity.js\";\nimport { StrategyError } from \"../errors.js\";\nimport {\n STRATEGY_RULES,\n type StrategyConfig,\n type StrategyRule,\n type StrategyRun,\n type StrategySeverity,\n} from \"../types.js\";\nimport { isStrategyRule } from \"./severity.js\";\n\nexport const STRATEGY_SECTION = \"strategy\";\n\nexport const DEFAULT_STRATEGY_BASELINE_PATH = \".manni-strategy-baseline.json\";\n\n/** The keys `strategy:` accepts, in the order the reference lists them. */\nconst CONFIG_KEYS: readonly (keyof StrategyConfig)[] = [\"severity\", \"baseline\", \"allowEmpty\", \"respectGitignore\"];\n\n/** Keys that belong to the family, refused by name with where they live. */\nconst COLLECTION_KEYS: readonly string[] = [\"paths\", \"exclude\"];\n\n/** The family scale, least severe first, then `off`. */\nconst SEVERITY_LEVELS: readonly StrategySeverity[] = [...SEVERITIES, \"off\"];\n\nconst CONFIG_FILE: ConfigFileOptions = {\n section: STRATEGY_SECTION,\n legacyNames: [],\n toError: (message) => new StrategyError(message),\n};\n\nfunction isMapping(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isLevel(value: unknown): value is StrategySeverity {\n return typeof value === \"string\" && (SEVERITY_LEVELS as readonly string[]).includes(value);\n}\n\nfunction rejectUnknownKeys(obj: Record<string, unknown>, allowed: readonly string[], where: string, source: string): void {\n for (const key of Object.keys(obj)) {\n if (!allowed.includes(key)) {\n throw new StrategyError(`Unknown key \"${key}\" under ${where}: in ${source}. Supported keys: ${allowed.join(\", \")}.`);\n }\n }\n}\n\n/** A type error names the key and the type it wanted, never the value, which could be a pasted secret. */\nfunction wrongType(key: string, expected: string, source: string): StrategyError {\n return new StrategyError(`strategy.${key} in ${source} must be ${expected}.`);\n}\n\nfunction asBoolean(value: unknown, key: string, source: string): boolean {\n if (typeof value !== \"boolean\") throw wrongType(key, \"a boolean\", source);\n return value;\n}\n\nfunction parseSeverity(value: unknown, source: string): Partial<Record<StrategyRule, StrategySeverity>> {\n if (!isMapping(value)) throw wrongType(\"severity\", \"a mapping\", source);\n rejectUnknownKeys(value, STRATEGY_RULES, \"strategy.severity\", source);\n const severity: Partial<Record<StrategyRule, StrategySeverity>> = {};\n for (const [rule, level] of Object.entries(value)) {\n if (!isStrategyRule(rule)) continue;\n if (!isLevel(level)) {\n // A level is not a secret, so a string one is quoted back.\n const quoted = typeof level === \"string\" ? ` \"${level}\"` : \"\";\n throw new StrategyError(\n `${source}: strategy.severity.${rule}${quoted} is not a level. Expected ${SEVERITY_LEVELS.join(\" | \")}.`,\n );\n }\n severity[rule] = level;\n }\n return severity;\n}\n\n/** Validate the `strategy:` slice of a family file. `null` is an empty section. */\nexport function parseStrategyConfig(raw: unknown, source: string): StrategyConfig {\n if (raw == null) return {};\n if (!isMapping(raw)) throw new StrategyError(`strategy: in ${source} must be a mapping.`);\n // Before the unknown-key check, which would call a family setting a typo.\n for (const key of COLLECTION_KEYS) {\n if (Object.hasOwn(raw, key)) {\n throw new StrategyError(`${source}: strategy does not carry \"${key}\". Name a collection under collections:.`);\n }\n }\n rejectUnknownKeys(raw, CONFIG_KEYS, \"strategy\", source);\n\n const config: StrategyConfig = {};\n if (raw.severity !== undefined) config.severity = parseSeverity(raw.severity, source);\n if (raw.baseline !== undefined) {\n if (typeof raw.baseline !== \"string\") throw wrongType(\"baseline\", \"a string\", source);\n config.baseline = raw.baseline;\n }\n if (raw.allowEmpty !== undefined) config.allowEmpty = asBoolean(raw.allowEmpty, \"allowEmpty\", source);\n if (raw.respectGitignore !== undefined) {\n config.respectGitignore = asBoolean(raw.respectGitignore, \"respectGitignore\", source);\n }\n return config;\n}\n\nexport interface StrategyRunOptions {\n cwd: string;\n /** `-c/--config`. */\n configPath?: string;\n /** Positional inputs; empty means fall back to the selected collections' `paths:`. */\n inputs: string[];\n /** `--collection <name>`, repeatable. Empty means every declared collection. */\n collection?: string[];\n}\n\nconst STDIN = \"-\";\n\n/** Which config governs the run, and what to resolve from where. */\nexport async function resolveStrategyRun(opts: StrategyRunOptions): Promise<StrategyRun> {\n const cwd = resolve(opts.cwd);\n const wanted = opts.collection ?? [];\n if (wanted.length > 0 && opts.inputs.some((input) => input !== STDIN)) {\n throw new StrategyError(\"--collection selects a configured collection; it cannot be combined with paths.\");\n }\n\n const file: ConfigFile | null = opts.configPath\n ? await readConfigFile(opts.configPath, cwd, CONFIG_FILE)\n : await findConfigFile(cwd, CONFIG_FILE);\n if (wanted.length > 0 && file === null) {\n throw new StrategyError(\"--collection needs a config file to select from.\");\n }\n const config = file === null ? null : parseStrategyConfig(file.value, file.source);\n\n const collections = file\n ? selectCollections(file.collections, wanted, file.source, (message) => new StrategyError(message))\n : [];\n const fromCollections = opts.inputs.length === 0;\n const inputs = fromCollections ? collections.flatMap((c) => c.paths) : opts.inputs;\n const base = fromCollections && inputs.length > 0 && file ? file.dir : cwd;\n\n return {\n config,\n inputs,\n base,\n collections,\n fromCollections,\n ...(file ? { configDir: file.dir, configPath: file.path, configSource: file.source, configFile: file } : {}),\n };\n}\n","/**\n * What every `manni strategy` command core shares: resolve the run and load\n * the set. Kept free of commander and of stdout, so a core is called directly\n * by its tests; the CLI reads stdin once and hands it in.\n */\nimport { isAbsolute, relative, resolve } from \"node:path\";\nimport { resolveStrategyRun } from \"../core/config.js\";\nimport { loadStrategySet } from \"../core/load-set.js\";\nimport { StrategyError } from \"../errors.js\";\nimport type { StrategyRun, StrategySet } from \"../types.js\";\n\n/** The inputs and flags `list`, `get` and `check` share. */\nexport interface StrategyCommandOptions {\n /** Default `process.cwd()`. */\n cwd?: string;\n /** Positional `[paths...]`; `-` is stdin. Empty falls back to the collections. */\n inputs: string[];\n /** Stdin's content, read once by the CLI when `-` is among the inputs. */\n stdin?: string;\n /** `--as <format>`. */\n as?: string;\n /** `--exclude <glob>`, repeatable. */\n exclude?: string[];\n /** `--ext <list>`, already split. */\n exts?: string[];\n /** `--allow-empty`. */\n allowEmpty?: boolean;\n /** `--no-gitignore`. */\n noGitignore?: boolean;\n /** `--collection <name>`, repeatable. */\n collection?: string[];\n /** `-c, --config <path>`. */\n configPath?: string;\n onNotice?: (message: string) => void;\n}\n\nexport interface LoadedStrategy {\n cwd: string;\n run: StrategyRun;\n set: StrategySet;\n}\n\nexport async function loadStrategy(opts: StrategyCommandOptions): Promise<LoadedStrategy> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const run = await resolveStrategyRun({\n cwd,\n inputs: opts.inputs,\n ...(opts.configPath === undefined ? {} : { configPath: opts.configPath }),\n ...(opts.collection === undefined ? {} : { collection: opts.collection }),\n });\n // A collection's `exclude:` shapes the collection, so it applies when the\n // inputs came from the collections and never to a path the operator typed.\n const exclude = [\n ...new Set([...(opts.exclude ?? []), ...(run.fromCollections ? run.collections.flatMap((c) => c.exclude) : [])]),\n ];\n const set = await loadStrategySet({\n run,\n exclude,\n ...(opts.exts === undefined ? {} : { exts: opts.exts }),\n ...(opts.allowEmpty === true ? { allowEmpty: true } : {}),\n ...(opts.noGitignore === true ? { noGitignore: true } : {}),\n ...(opts.stdin === undefined ? {} : { stdin: opts.stdin }),\n ...(opts.as === undefined ? {} : { as: opts.as }),\n ...(opts.onNotice === undefined ? {} : { onNotice: opts.onNotice }),\n });\n return { cwd, run, set };\n}\n\n/** `value` when it is one of `allowed`, else the family's unknown-format refusal. */\nexport function formatChoice<T extends string>(value: string, allowed: readonly T[]): T {\n const found = allowed.find((candidate) => candidate === value);\n if (found === undefined) throw new StrategyError(`unknown format \"${value}\". Expected ${allowed.join(\" | \")}.`);\n return found;\n}\n\n/**\n * A path as a person standing in `cwd` would type it: relative, posix. A\n * label is relative to the run's base, which is the config directory for a\n * collection run, so it is resolved from there first.\n */\nexport function displayPath(path: string, cwd: string, base = cwd): string {\n if (path.startsWith(\"<\")) return path;\n const rel = relative(cwd, isAbsolute(path) ? path : resolve(base, path));\n return (rel === \"\" ? \".\" : rel).replaceAll(\"\\\\\", \"/\");\n}\n\n/** `1 record`, `2 records`. */\nexport function plural(n: number, one: string, many = `${one}s`): string {\n return `${String(n)} ${n === 1 ? one : many}`;\n}\n","/**\n * Load a strategy set: resolve the run's files, extract each one's metadata\n * with meta's extractor, merge in what its `{page}.meta.yaml` manifests\n * supply through `metaPageView`, and read the records and references out of\n * the merged view. Every value's file and line come from `declaredAt`, so a\n * value a sidecar holds is filed at the sidecar's line.\n *\n * A file that cannot be read or parsed is an error, not a skip: a set that\n * quietly lost a record would report the pages naming it as broken.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname, resolve } from \"node:path\";\nimport {\n STDIN_LABEL,\n STDIN_TOKEN,\n assertNonEmpty,\n declaredAt,\n extractorByName,\n extractorForExtension,\n gitignoreOptions,\n metaPageView,\n resolveTargetSet,\n supportedExtensions,\n} from \"../../meta/internal.js\";\nimport type { ExtractedMetadata } from \"../../meta/index.js\";\nimport { STDIN_REQUIRES_AS } from \"../../shared/cli-options.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { StrategyError } from \"../errors.js\";\nimport {\n PAGE_FIELDS,\n PARENTS,\n RECORD_TYPES,\n type At,\n type RecordType,\n type StrategyRecord,\n type StrategyReference,\n type StrategyRun,\n type StrategySet,\n} from \"../types.js\";\n\nexport interface LoadStrategySetOptions {\n run: StrategyRun;\n /** Stdin's content, when `-` is among the run's inputs. */\n stdin?: string;\n /** `--as <format>`, which stdin needs. */\n as?: string;\n /** `--exclude <glob>`, repeatable. */\n exclude?: string[];\n /** `--ext <list>`: the extensions a directory or glob walk keeps. */\n exts?: string[];\n /** `--allow-empty`: wins over `strategy.allowEmpty`. */\n allowEmpty?: boolean;\n /** `--no-gitignore`. */\n noGitignore?: boolean;\n onNotice?: (message: string) => void;\n}\n\ninterface Extracted {\n label: string;\n extracted: ExtractedMetadata;\n}\n\nfunction isRecordType(value: unknown): value is RecordType {\n return typeof value === \"string\" && (RECORD_TYPES as readonly string[]).includes(value);\n}\n\nfunction text(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim() !== \"\" ? value : undefined;\n}\n\nfunction extract(content: string, label: string, path: string | undefined, format: string): Extracted {\n const extractor = extractorByName(format);\n if (extractor === undefined) throw new StrategyError(`${label}: no reader for format \"${format}\".`);\n try {\n return { label, extracted: extractor.extract(content, path ?? label) };\n } catch (error) {\n throw new StrategyError(`${label}: could not be read as ${format}: ${errorMessage(error)}`);\n }\n}\n\nasync function readInput(path: string, label: string): Promise<string> {\n try {\n return await readFile(path, \"utf8\");\n } catch (error) {\n throw new StrategyError(`${label}: could not be read: ${errorMessage(error)}`);\n }\n}\n\n/** The files the run names, extracted. Stdin comes last, as one more input. */\nasync function extractAll(opts: LoadStrategySetOptions, allowEmpty: boolean): Promise<Extracted[]> {\n const { run } = opts;\n const exclude = opts.exclude ?? [];\n const usingStdin = run.inputs.includes(STDIN_TOKEN);\n const inputs = run.inputs.filter((input) => input !== STDIN_TOKEN);\n if (usingStdin && (opts.as === undefined || opts.as === \"\")) throw new StrategyError(STDIN_REQUIRES_AS);\n if (inputs.length === 0 && !usingStdin) {\n throw new StrategyError(\n \"No files to read. Pass paths/globs, or declare a collection under `collections:` in manni.config.yaml.\",\n );\n }\n\n const out: Extracted[] = [];\n if (inputs.length > 0) {\n const { files, gitignoreSkipped } = await resolveTargetSet({\n inputs,\n cwd: run.base,\n exclude,\n exts: opts.exts ?? supportedExtensions(),\n allowEmpty,\n ...gitignoreOptions({\n ...(opts.noGitignore === true ? { flag: false } : {}),\n ...(run.config?.respectGitignore === undefined ? {} : { configured: run.config.respectGitignore }),\n ...(opts.onNotice ? { onNotice: opts.onNotice } : {}),\n }),\n });\n assertNonEmpty({\n files,\n inputs,\n usingStdin,\n allowEmpty,\n exclude,\n ...(opts.exts === undefined ? {} : { exts: opts.exts }),\n gitignoreSkipped,\n action: \"read\",\n });\n for (const file of files) {\n const extractor = extractorForExtension(extname(file));\n if (extractor === undefined) {\n throw new StrategyError(`${file}: no reader for its extension. Pass --as <format> through stdin to read it.`);\n }\n const path = resolve(run.base, file);\n out.push(extract(await readInput(path, file), file, path, extractor.name));\n }\n }\n if (usingStdin && opts.as !== undefined) out.push(extract(opts.stdin ?? \"\", STDIN_LABEL, undefined, opts.as));\n return out;\n}\n\n/** One value or a list of them, with the pointer each sits at. Anything else contributes nothing. */\nfunction valuesOf(data: Record<string, unknown>, field: string): { value: string; pointer: string }[] {\n const raw = data[field];\n if (typeof raw === \"string\") return raw.trim() === \"\" ? [] : [{ value: raw, pointer: `/${field}` }];\n if (!Array.isArray(raw)) return [];\n return raw.flatMap((item: unknown, i) =>\n typeof item === \"string\" && item.trim() !== \"\" ? [{ value: item, pointer: `/${field}/${String(i)}` }] : [],\n );\n}\n\nfunction stem(label: string): string {\n const name = basename(label);\n return name.slice(0, name.length - extname(name).length);\n}\n\nexport async function loadStrategySet(opts: LoadStrategySetOptions): Promise<StrategySet> {\n const { run } = opts;\n const allowEmpty = opts.allowEmpty ?? run.config?.allowEmpty === true;\n const inputs = await extractAll(opts, allowEmpty);\n\n // Meta's view over the same config file, so a sidecar counts exactly as\n // `manni meta validate` merges it. Labels are relative to the run's base.\n const view = await metaPageView({\n cwd: run.base,\n ...(run.configPath === undefined ? { noConfig: true } : { configPath: run.configPath }),\n pages: inputs.filter((i) => i.label !== STDIN_LABEL).map((i) => resolve(run.base, i.label)),\n });\n\n const set: StrategySet = { records: [], references: [] };\n for (const { label, extracted } of inputs) {\n const merged = await view.merge(label, extracted);\n const data = merged.extracted.data;\n const at = (pointer: string): At => declaredAt(label, pointer, { extracted: merged.extracted, locate: merged.locate });\n const type = data[\"type\"];\n const isRecord = isRecordType(type);\n\n if (isRecord) {\n const declaredId = text(data[\"id\"]);\n const title = text(data[\"title\"]);\n const description = text(data[\"description\"]);\n const lifecycle = text(data[\"lifecycle\"]);\n const record: StrategyRecord = {\n id: declaredId ?? stem(label),\n type,\n ...(title === undefined ? {} : { title }),\n ...(description === undefined ? {} : { description }),\n ...(lifecycle === undefined ? {} : { lifecycle }),\n file: label,\n line: 1,\n ...(declaredId === undefined ? {} : { idAt: at(\"/id\") }),\n parents:\n type === \"audience\" ? [] : valuesOf(data, PARENTS[type]).map(({ value, pointer }) => ({ value, ...at(pointer) })),\n };\n set.records.push(record);\n }\n\n // A journey's `personas:` is its parent field, read above, so it is not a reference too.\n const parentField = isRecord && type !== \"audience\" ? PARENTS[type] : undefined;\n for (const field of Object.values(PAGE_FIELDS)) {\n if (field === parentField) continue;\n for (const { value, pointer } of valuesOf(data, field)) {\n const reference: StrategyReference = { field, value, page: label, record: isRecord, ...at(pointer) };\n set.references.push(reference);\n }\n }\n }\n\n if (set.records.length === 0 && !allowEmpty) {\n throw new StrategyError(\n \"no strategy records found. A record is a page declaring type: audience, type: persona or type: journey.\",\n );\n }\n return set;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAM,gBAAN,cAA4B,UAAU;AAAA,EAC3C,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;;;ACDA,SAAS,eAAe;AAcjB,IAAM,mBAAmB;AAEzB,IAAM,iCAAiC;AAG9C,IAAM,cAAiD,CAAC,YAAY,YAAY,cAAc,kBAAkB;AAGhH,IAAM,kBAAqC,CAAC,SAAS,SAAS;AAG9D,IAAM,kBAA+C,CAAC,GAAG,YAAY,KAAK;AAE1E,IAAM,cAAiC;AAAA,EACrC,SAAS;AAAA,EACT,aAAa,CAAC;AAAA,EACd,SAAS,CAAC,YAAY,IAAI,cAAc,OAAO;AACjD;AAEA,SAAS,UAAU,OAAkD;AACnE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK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AAI,KAAK,aAAa,SAAY,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACnE,CAAC;AACD,SAAO,EAAE,KAAK,KAAK,IAAI;AACzB;AAGO,SAAS,aAA+B,OAAe,SAA0B;AACtF,QAAM,QAAQ,QAAQ,KAAK,CAAC,cAAc,cAAc,KAAK;AAC7D,MAAI,UAAU,OAAW,OAAM,IAAI,cAAc,mBAAmB,KAAK,eAAe,QAAQ,KAAK,KAAK,CAAC,GAAG;AAC9G,SAAO;AACT;AAOO,SAAS,YAAY,MAAc,KAAa,OAAO,KAAa;AACzE,MAAI,KAAK,WAAW,GAAG,EAAG,QAAO;AACjC,QAAM,MAAM,SAAS,KAAK,WAAW,IAAI,IAAI,OAAOA,SAAQ,MAAM,IAAI,CAAC;AACvE,UAAQ,QAAQ,KAAK,MAAM,KAAK,WAAW,MAAM,GAAG;AACtD;AAGO,SAAS,OAAO,GAAW,KAAa,OAAO,GAAG,GAAG,KAAa;AACvE,SAAO,GAAG,OAAO,CAAC,CAAC,IAAI,MAAM,IAAI,MAAM,IAAI;AAC7C;","names":["resolve","resolve","resolve","resolve"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/strategy/reporters/pretty.ts"],"sourcesContent":["/**\n * Human output for every `manni strategy` command. `list` is a tree, `get` a\n * key column, and `check` term's layout: findings grouped under a bold\n * `file:line`, each message wrapped under its own column with the rule's\n * guidance dim beneath it.\n */\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport type { Severity } from \"../../shared/severity.js\";\nimport type { StrategyReport } from \"../commands/findings.js\";\nimport type { RecordEntry } from \"../commands/list.js\";\nimport { displayPath, plural } from \"../commands/run.js\";\nimport { PARENTS, RECORD_TYPES, type StrategyFinding, type StrategyRecord } from \"../types.js\";\n\nconst WIDTH = 80;\n\n/** A record's title, or its id when it has none. */\nexport function titleOf(record: StrategyRecord): string {\n return record.title ?? record.id;\n}\n\n/** `4 audiences, 4 personas, 74 journeys`. */\nexport function countsLine(records: readonly StrategyRecord[]): string {\n return RECORD_TYPES.map((type) => plural(records.filter((r) => r.type === type).length, type)).join(\", \");\n}\n\n// ---------------------------------------------------------------------------\n// list\n\nexport function renderListPretty(entries: readonly RecordEntry[]): string {\n const cell = (e: RecordEntry): string => `${\" \".repeat(e.depth)}${e.record.id}`;\n const recordWidth = Math.max(\"record\".length, ...entries.map((e) => cell(e).length)) + 4;\n const pagesWidth = Math.max(\"pages\".length, ...entries.map((e) => String(e.pages.length).length));\n const row = (record: string, pages: string, title: string): string =>\n `${record.padEnd(recordWidth)}${pages.padStart(pagesWidth)} ${title}`.trimEnd();\n return [\n row(\"record\", \"pages\", \"title\"),\n ...entries.map((e) => row(cell(e), String(e.pages.length), titleOf(e.record))),\n // A record under several parents is counted once.\n countsLine([...new Set(entries.map((e) => e.record))]),\n ].join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// get\n\nconst KEY_WIDTH = 14;\n\n/** Each record as `id title`, the ids padded so the titles line up. */\nfunction recordLines(records: readonly Pick<StrategyRecord, \"id\" | \"title\">[]): string[] {\n const width = Math.max(0, ...records.map((r) => r.id.length)) + 2;\n return records.map((r) => (r.title === undefined ? r.id : `${r.id.padEnd(width)}${r.title}`));\n}\n\nexport function renderGetPretty(entry: RecordEntry, opts: { color: boolean }): string {\n const c = palette(opts.color);\n const { record } = entry;\n const rows: [string, string[]][] = [\n [\"type\", [record.type]],\n [\"id\", [record.id]],\n ];\n if (record.description !== undefined) rows.push([\"description\", [record.description]]);\n if (record.lifecycle !== undefined) rows.push([\"lifecycle\", [record.lifecycle]]);\n if (record.type !== \"audience\" && record.parents.length > 0) {\n // A value no record answers to shows as written.\n const shown = record.parents.map(\n (p) => entry.parents.find((r) => r.id.toLowerCase() === p.value.toLowerCase()) ?? { id: p.value },\n );\n rows.push([PARENTS[record.type], recordLines(shown)]);\n }\n if (entry.children.length > 0) rows.push([record.type === \"audience\" ? \"personas\" : \"journeys\", recordLines(entry.children)]);\n rows.push([\"pages\", entry.pages.length === 0 ? [\"none\"] : entry.pages]);\n\n const where = `${entry.file}:${String(record.line)}`;\n const lines = [`${c.bold(titleOf(record).padEnd(44))} ${c.dim(where)}`];\n for (const [key, values] of rows) {\n values.forEach((value, i) => lines.push(` ${(i === 0 ? key : \"\").padEnd(KEY_WIDTH)}${value}`));\n }\n return lines.join(\"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// check\n\nconst RULE_WIDTH = 36;\n\n/** Sentences packed into lines of at most `width`; a message that fits stays whole. */\nfunction wrapSentences(text: string, width: number): string[] {\n if (text.length <= width) return [text];\n const lines: string[] = [];\n let line = \"\";\n // A sentence ends at `.` or `?` before a space and a capital, which every\n // message sentence starts with, so `m1.0`, a URL or `e.g. x` never splits.\n for (const sentence of text.split(/(?<=[.?])\\s+(?=[A-Z])/)) {\n if (line === \"\") line = sentence;\n else if (line.length + 1 + sentence.length <= width) line = `${line} ${sentence}`;\n else {\n lines.push(line);\n line = sentence;\n }\n }\n if (line !== \"\") lines.push(line);\n return lines;\n}\n\nfunction severityText(c: Colors, severity: Severity): string {\n const padded = severity.padEnd(7);\n if (severity === \"error\") return c.red(padded);\n if (severity === \"warning\") return c.yellow(padded);\n return c.cyan(padded);\n}\n\nfunction counts(findings: readonly StrategyFinding[]): string {\n const n = (severity: Severity): number => findings.filter((f) => f.severity === severity).length;\n const parts: string[] = [];\n if (n(\"error\") > 0) parts.push(plural(n(\"error\"), \"error\"));\n if (n(\"warning\") > 0) parts.push(plural(n(\"warning\"), \"warning\"));\n if (n(\"notice\") > 0) parts.push(plural(n(\"notice\"), \"notice\"));\n return parts.join(\", \");\n}\n\nexport function renderFindingsPretty(report: StrategyReport, opts: { color: boolean }): string {\n const c = palette(opts.color);\n const { baseline } = report;\n if (baseline?.written === true) {\n return `${c.green(\"✓\")} ${plural(report.found, \"finding\")} recorded in ${baseline.path}`;\n }\n const baselined = baseline !== undefined && baseline.suppressed > 0 ? `, ${String(baseline.suppressed)} baselined` : \"\";\n const records = plural(report.records, \"record\");\n if (report.findings.length === 0) {\n return `${c.green(\"✓\")} ${records}, ${plural(report.references, \"reference\")}, no findings${baselined}`;\n }\n\n const ruleWidth = Math.max(RULE_WIDTH, ...report.findings.map((f) => f.ruleId.length + 2));\n const prefixWidth = 2 + 7 + 1 + ruleWidth;\n const indent = \" \".repeat(prefixWidth);\n const lines: string[] = [];\n let group: string | undefined;\n for (const finding of report.findings) {\n const file = displayPath(finding.file, report.cwd, report.base);\n const header = finding.line === undefined ? file : `${file}:${String(finding.line)}`;\n if (header !== group) {\n lines.push(c.bold(header));\n group = header;\n }\n wrapSentences(finding.message, WIDTH - prefixWidth).forEach((text, i) => {\n lines.push(\n i === 0 ? ` ${severityText(c, finding.severity)} ${finding.ruleId.padEnd(ruleWidth)}${text}` : `${indent}${text}`,\n );\n });\n for (const line of guidanceLines(finding.guidance)) lines.push(`${indent}${c.dim(line)}`);\n }\n lines.push(\"\", `${counts(report.findings)} in ${records}${baselined}`);\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAcA,IAAM,QAAQ;AAGP,SAAS,QAAQ,QAAgC;AACtD,SAAO,OAAO,SAAS,OAAO;AAChC;AAGO,SAAS,WAAW,SAA4C;AACrE,SAAO,aAAa,IAAI,CAAC,SAAS,OAAO,QAAQ,OAAO,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,QAAQ,IAAI,CAAC,EAAE,KAAK,IAAI;AAC1G;AAKO,SAAS,iBAAiB,SAAyC;AACxE,QAAM,OAAO,CAAC,MAA2B,GAAG,KAAK,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE;AAC9E,QAAM,cAAc,KAAK,IAAI,SAAS,QAAQ,GAAG,QAAQ,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,CAAC,IAAI;AACvF,QAAM,aAAa,KAAK,IAAI,QAAQ,QAAQ,GAAG,QAAQ,IAAI,CAA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M,YAAY,KAAK,IAAI,YAAY,GAAG,OAAO,SAAS,IAAI,CAAC,MAAM,EAAE,OAAO,SAAS,CAAC,CAAC;AACzF,QAAM,cAAc,IAAI,IAAI,IAAI;AAChC,QAAM,SAAS,IAAI,OAAO,WAAW;AACrC,QAAM,QAAkB,CAAC;AACzB,MAAI;AACJ,aAAW,WAAW,OAAO,UAAU;AACrC,UAAM,OAAO,YAAY,QAAQ,MAAM,OAAO,KAAK,OAAO,IAAI;AAC9D,UAAM,SAAS,QAAQ,SAAS,SAAY,OAAO,GAAG,IAAI,IAAI,OAAO,QAAQ,IAAI,CAAC;AAClF,QAAI,WAAW,OAAO;AACpB,YAAM,KAAK,EAAE,KAAK,MAAM,CAAC;AACzB,cAAQ;AAAA,IACV;AACA,kBAAc,QAAQ,SAAS,QAAQ,WAAW,EAAE,QAAQ,CAAC,MAAM,MAAM;AACvE,YAAM;AAAA,QACJ,MAAM,IAAI,KAAK,aAAa,GAAG,QAAQ,QAAQ,CAAC,IAAI,QAAQ,OAAO,OAAO,SAAS,CAAC,GAAG,IAAI,KAAK,GAAG,MAAM,GAAG,IAAI;AAAA,MAClH;AAAA,IACF,CAAC;AACD,eAAW,QAAQ,cAAc,QAAQ,QAAQ,EAAG,OAAM,KAAK,GAAG,MAAM,GAAG,EAAE,IAAI,IAAI,CAAC,EAAE;AAAA,EAC1F;AACA,QAAM,KAAK,IAAI,GAAG,OAAO,OAAO,QAAQ,CAAC,OAAO,OAAO,GAAG,SAAS,EAAE;AACrE,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/strategy/reporters/json.ts"],"sourcesContent":["/**\n * JSON output for every `manni strategy` command. A record is the same object\n * in `list` and `get`: its fields, where it was read, its parent, and what\n * names it. Paths are relative to the working directory.\n */\nimport type { StrategyReport } from \"../commands/findings.js\";\nimport type { RecordEntry } from \"../commands/list.js\";\nimport { displayPath } from \"../commands/run.js\";\nimport { titleOf } from \"./pretty.js\";\n\nexport function recordJson(entry: RecordEntry): Record<string, unknown> {\n const { record } = entry;\n // `title` is never absent: an untitled record shows its id, as `list` does.\n const out: Record<string, unknown> = { id: record.id, type: record.type, title: titleOf(record) };\n if (record.description !== undefined) out[\"description\"] = record.description;\n if (record.lifecycle !== undefined) out[\"lifecycle\"] = record.lifecycle;\n out[\"file\"] = entry.file;\n out[\"line\"] = record.line;\n // A journey's `personas` is always a list. A persona's `audience` is one value, as it is written.\n const parents = record.parents.map((p) => p.value);\n if (record.type === \"journey\") out[\"personas\"] = parents;\n if (record.type === \"persona\" && parents.length > 0) out[\"audience\"] = parents.length === 1 ? parents[0] : parents;\n const children = entry.children.map((r) => r.id);\n out[\"namedBy\"] = {\n ...(record.type === \"audience\" ? { personas: children } : {}),\n ...(record.type === \"persona\" ? { journeys: children } : {}),\n pages: entry.pages,\n };\n return out;\n}\n\n/** Each record once, where the tree first reaches it. */\nexport function renderListJson(entries: readonly RecordEntry[]): string {\n const once = new Map(entries.map((entry) => [entry.record, entry]));\n return JSON.stringify({ records: [...once.values()].map(recordJson) }, null, 2);\n}\n\nexport function renderGetJson(entry: RecordEntry): string {\n return JSON.stringify(recordJson(entry), null, 2);\n}\n\nexport function renderFindingsJson(report: StrategyReport): string {\n const count = (severity: string): number => report.findings.filter((f) => f.severity === severity).length;\n return JSON.stringify(\n {\n // `key` is the baseline's identity for a finding, not something it says.\n findings: report.findings.map(({ key: _identity, ...finding }) => ({\n ...finding,\n file: displayPath(finding.file, report.cwd, report.base),\n })),\n summary: {\n records: report.records,\n references: report.references,\n errors: count(\"error\"),\n warnings: count(\"warning\"),\n notices: count(\"notice\"),\n ...(report.baseline === undefined ? {} : { baseline: report.baseline }),\n },\n },\n null,\n 2,\n );\n}\n"],"mappings":";;;;;;;;;AAUO,SAAS,WAAW,OAA6C;AACtE,QAAM,EAAE,OAAO,IAAI;AAEnB,QAAM,MAA+B,EAAE,IAAI,OAAO,IAAI,MAAM,OAAO,MA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O;AAAA,QACjE,GAAG;AAAA,QACH,MAAM,YAAY,QAAQ,MAAM,OAAO,KAAK,OAAO,IAAI;AAAA,MACzD,EAAE;AAAA,MACF,SAAS;AAAA,QACP,SAAS,OAAO;AAAA,QAChB,YAAY,OAAO;AAAA,QACnB,QAAQ,MAAM,OAAO;AAAA,QACrB,UAAU,MAAM,SAAS;AAAA,QACzB,SAAS,MAAM,QAAQ;AAAA,QACvB,GAAI,OAAO,aAAa,SAAY,CAAC,IAAI,EAAE,UAAU,OAAO,SAAS;AAAA,MACvE;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/strategy/types.ts","../src/strategy/core/severity.ts"],"sourcesContent":["/**\n * The strategy domain's records, references, findings and config (proposal\n * 0102). A record is a page declaring `type: audience`, `type: persona` or\n * `type: journey`. A reference is a value of a page's `audiences:`,\n * `personas:` or `journeys:`, read through meta's merged view so a value in a\n * `{page}.meta.yaml` counts. A journey's own `personas:` is its parent field,\n * not a reference.\n */\nimport type { Guidance } from \"../shared/guidance.js\";\nimport type { ConfigFile } from \"../shared/config-file.js\";\nimport type { CollectionConfig } from \"../shared/collections.js\";\nimport type { Severity } from \"../shared/severity.js\";\n\n/** The three record types, parent first. */\nexport const RECORD_TYPES = [\"audience\", \"persona\", \"journey\"] as const;\nexport type RecordType = (typeof RECORD_TYPES)[number];\n\n/** The page field that names records of each type. */\nexport const PAGE_FIELDS = { audience: \"audiences\", persona: \"personas\", journey: \"journeys\" } as const;\nexport type PageField = (typeof PAGE_FIELDS)[RecordType];\n\n/**\n * The field a record names its parents in: a persona's `audience:`, a\n * journey's `personas:`. Either holds one string or a list.\n */\nexport const PARENTS = { persona: \"audience\", journey: \"personas\" } as const;\nexport type ChildType = keyof typeof PARENTS;\nexport type ParentField = (typeof PARENTS)[ChildType];\n\n/** Every field whose value names a record. */\nexport type ReferenceField = PageField | ParentField;\n\n/** Every rule `strategy check` reports, in the order the rules page lists them. */\nexport const STRATEGY_RULES = [\n \"undefined-reference\",\n \"duplicate-id\",\n \"missing-parent\",\n \"orphan-record\",\n \"unserved-journey\",\n \"unused-record\",\n] as const;\nexport type StrategyRule = (typeof STRATEGY_RULES)[number];\n\n/** A rule's level: the family scale plus `off`, which drops the rule's findings. */\nexport type StrategySeverity = Severity | \"off\";\n\n/** A file, and the 1-based line in it when one is known. */\nexport interface At {\n file: string;\n line?: number;\n}\n\nexport interface StrategyRecord {\n /** `id:`, else the file stem. Compared case-folded. */\n id: string;\n type: RecordType;\n title?: string;\n description?: string;\n /** `lifecycle:`, from meta's `manni:lifecycle:1.0.0`. A `draft` or `archived` journey is exempt from `unserved-journey`. */\n lifecycle?: string;\n /** The page the record was read from, as the run labels it. */\n file: string;\n line: number;\n /** Where `id:` is declared, when the record declares one. */\n idAt?: At;\n /** The values of `audience:` on a persona or `personas:` on a journey, each where it is declared. Empty on an audience. */\n parents: (At & { value: string })[];\n}\n\nexport interface StrategyReference {\n field: PageField;\n value: string;\n /** Where the value is declared: the page, or the manifest that supplied it. */\n file: string;\n line?: number;\n /** The page the value belongs to. */\n page: string;\n /** Whether that page is itself a record. A record's values are checked, never counted as a page naming. */\n record: boolean;\n}\n\nexport interface StrategySet {\n records: StrategyRecord[];\n references: StrategyReference[];\n}\n\nexport interface StrategyFinding {\n rule: StrategyRule;\n /** `manni:strategy/<rule>`. */\n ruleId: string;\n severity: Severity;\n /** What happened, then what to do about it. */\n message: string;\n /** The message before its advice: the baseline's identity. Never printed. */\n key?: string;\n guidance: Guidance;\n file: string;\n line?: number;\n /** The record the finding is about, when it is about one. */\n id?: string;\n /** The field that breaks the rule, when one does. */\n field?: ReferenceField;\n}\n\n/** The `strategy:` section. Every key is optional. */\nexport interface StrategyConfig {\n severity?: Partial<Record<StrategyRule, StrategySeverity>>;\n baseline?: string;\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n}\n\n/** What every command core resolves before touching a file. */\nexport interface StrategyRun {\n config: StrategyConfig | null;\n /** The positional inputs, or the selected collections' `paths:`. */\n inputs: string[];\n /** Directory `inputs` resolve from: cwd for positional inputs, the config directory for collections. */\n base: string;\n collections: CollectionConfig[];\n fromCollections: boolean;\n configDir?: string;\n configPath?: string;\n configSource?: string;\n configFile?: ConfigFile;\n}\n","/** Rule ids, default levels and guidance for `strategy check` (proposal 0102). */\nimport type { Guidance } from \"../../shared/guidance.js\";\nimport { STRATEGY_RULES, type StrategyRule, type StrategySeverity } from \"../types.js\";\n\nexport const RULE_ID_PREFIX = \"manni:strategy\";\n\nexport const DEFAULT_SEVERITY: Readonly<Record<StrategyRule, StrategySeverity>> = {\n \"undefined-reference\": \"error\",\n \"duplicate-id\": \"error\",\n \"missing-parent\": \"warning\",\n \"orphan-record\": \"warning\",\n \"unserved-journey\": \"warning\",\n \"unused-record\": \"notice\",\n};\n\n/** The rules reference, whose sections are anchored by rule name. */\nexport const RULES_URI = \"https://hawkeyexl.github.io/manni/strategy/reference/rules/\";\n\n/**\n * When each rule fires, for the person who fixes it. The rules page's \"Fires\n * when\" column says the same, and a test holds the two equal.\n */\nexport const RULE_DESCRIPTIONS: Readonly<Record<StrategyRule, string>> = {\n \"undefined-reference\":\n \"A page's audiences:, personas: or journeys:, or a record's audience: or personas:, names no record of that type.\",\n \"duplicate-id\": \"Two records share an id, ignoring case.\",\n \"missing-parent\":\n \"A page names a journey but none of its personas in personas:, or a persona but not its audience in audiences:.\",\n \"orphan-record\":\n \"A persona names no audience, or a journey names no persona, while the set holds records of the parent type.\",\n \"unserved-journey\":\n \"No page names the journey in journeys:. Records do not count, and a draft or archived journey is exempt.\",\n \"unused-record\": \"No page and no record names an audience or a persona.\",\n};\n\nexport function guidanceFor(rule: StrategyRule): Guidance {\n return { id: RULE_ID_PREFIX, rule, description: RULE_DESCRIPTIONS[rule], guide: `${RULES_URI}#${rule}` };\n}\n\nexport function ruleId(rule: StrategyRule): string {\n return `${RULE_ID_PREFIX}/${rule}`;\n}\n\nexport function isStrategyRule(value: string): value is StrategyRule {\n return (STRATEGY_RULES as readonly string[]).includes(value);\n}\n\n/** The defaults with config's overrides laid over them. */\nexport function resolveSeverity(\n overrides?: Partial<Record<StrategyRule, StrategySeverity>>,\n): Record<StrategyRule, StrategySeverity> {\n return { ...DEFAULT_SEVERITY, ...overrides };\n}\n"],"mappings":";;;AAcO,IAAM,eAAe,CAAC,YAAY,WAAW,SAAS;AAItD,IAAM,cAAc,EAAE,UAAU,aAAa,SAAS,YAAY,SAAS,WAAW;AAOtF,IAAM,UAAU,EAAE,SAAS,YAAY,SAAS,WAAW;AAQ3D,IAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACpCO,IAAM,iBAAiB;AAEvB,IAAM,mBAAqE;AAAA,EAChF,uBAAuB;AAAA,EACvB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,iBAAiB;AACnB;AAGO,IAAM,YAAY;AAMlB,IAAM,oBAA4D;AAAA,EACvE,uBACE;AAAA,EACF,gBAAgB;AAAA,EAChB,kBACE;AAAA,EACF,iBACE;AAAA,EACF,oBACE;AAAA,EACF,iBAAiB;AACnB;AAEO,SAAS,YAAY,MAA8B;AACxD,SAAO,EAAE,IAAI,gBAAgB,MAAM,aAAa,kBAAkB,IAAI,GAAG,OAAO,GAAG,SAAS,IAAI,IAAI,GAAG;AACzG;AAEO,SAAS,OAAO,MAA4B;AACjD,SAAO,GAAG,cAAc,IAAI,IAAI;AAClC;AAEO,SAAS,eAAe,OAAsC;AACnE,SAAQ,eAAqC,SAAS,KAAK;AAC7D;AAGO,SAAS,gBACd,WACwC;AACxC,SAAO,EAAE,GAAG,kBAAkB,GAAG,UAAU;AAC7C;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tracevals/core/config.ts","../src/tracevals/core/config-schema.json","../src/tracevals/calibrate/labels.ts","../src/tracevals/calibrate/labels-schema.json"],"sourcesContent":["/**\n * Config loading. Every knob flows config → Ajv validate → defaults → CLI\n * override (`??` at the read site) → runtime; parseConfig() fills every\n * default so downstream code never re-applies one.\n *\n * Settings live under a `tracevals:` key in `manni.config.yaml`, one file\n * shared by the whole manni family. Sibling keys belong to other tools and are\n * ignored here, so parseConfig() validates the section — never the file root.\n * Finding the file is the shared loader's job (`src/shared/config-file.ts`).\n */\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\nimport configSchemaJson from \"./config-schema.json\" with { type: \"json\" };\nimport {\n FAMILY_CONFIG_NAMES,\n findConfigFileSync,\n readConfigFileSync,\n type ConfigFileOptions,\n} from \"../../shared/config-file.js\";\nimport type { CollectionConfig } from \"../../shared/collections.js\";\nimport {\n assertKnownProvider,\n type ProvidersConfig,\n} from \"../../shared/providers.js\";\nimport { compileRedactPatterns } from \"../judge/redact.js\";\nimport { JEV, JEV_OUT_OF_LOOP } from \"../judge/provider.js\";\nimport { DEFAULT_CAPTURE_DIR } from \"../capture/types.js\";\nimport { DEFAULT_LABELS_FILE } from \"../calibrate/labels.js\";\nimport { TracevalsError } from \"../types.js\";\nimport {\n configuredGrants,\n EXECUTION_GRANTS,\n isExecutionGrant,\n unknownGrantsMessage,\n type ExecutionGrant,\n} from \"../../shared/execution.js\";\n\nconst configSchema = configSchemaJson as Record<string, unknown>;\n\nexport const DEFAULT_CONFIG_FILENAME =\n FAMILY_CONFIG_NAMES[0] ?? \"manni.config.yaml\";\n\n/**\n * Top-level key holding this tool's settings inside the shared family config.\n * Sibling tools (meta, docevals) own their own keys in the same file.\n */\nexport const CONFIG_SECTION_KEY = \"tracevals\";\n\n/**\n * The section key as an error's instance path spells it. The schema describes\n * the section rather than the file, so Ajv's own paths start below it; a\n * message that said `/provider` would name a key nobody writes at the root.\n */\nconst CONFIG_SECTION_KEY_PATH = `/${CONFIG_SECTION_KEY}`;\n\n/**\n * No legacy filename. The family file is the only one read, so a file named\n * for the tool is not config however it is spelled, and nothing warns about\n * one because nothing looks for it.\n */\nconst CONFIG_FILE: ConfigFileOptions = {\n section: CONFIG_SECTION_KEY,\n legacyNames: [],\n toError: (message) => new TracevalsError(message),\n};\n\nexport interface TracevalsConfig {\n /**\n * Which provider judges, as `tracevals.provider` names it. `null` when the\n * key is absent, which defers to the family's `providers.provider`. The\n * connection settings are never here: they are `providers` below.\n */\n provider: string | null;\n /** The model within `provider`; `null` when unset. manni pins none. */\n model: string | null;\n /** The family's top-level `providers:` map, parsed by the shared loader. */\n providers: ProvidersConfig;\n /** The file as the user would name it, for messages. */\n configSource: string;\n judge: {\n ensembleRuns: number;\n temperature: number;\n zones: { autoPass: number; autoFail: number };\n cacheDir: string;\n /**\n * Ensemble runs this invocation may spend, or `null` for unbounded. A\n * cached ensemble spends none, and an eval the budget cannot cover is\n * `skipped` with the `turn budget` reason rather than dropped.\n */\n maxTurns: number | null;\n /**\n * Extra patterns scrubbed from the session digest before it reaches a\n * provider, applied *on top of* the built-in secret shapes (ADR 01020).\n * Always a list; validated for compilability at load time.\n */\n redact: string[];\n };\n render: {\n maxBlockChars: number;\n maxTotalChars: number;\n };\n /**\n * What content-authored code a run may execute: the grants it holds, every\n * one unless the operator narrows it (proposal 0075). A `command` eval runs\n * only under `frontmatter-commands`; `[]` runs none and reports them\n * `skipped`.\n */\n execution: { allow: ExecutionGrant[] };\n history: {\n file: string;\n };\n /**\n * Session manifests (ADR 01024). `capture` writes one here; `run` looks here\n * for the trace's own, and reports a `skipped` hash check when there is none.\n */\n capture: {\n /** Resolved against the project root, not the working directory. */\n dir: string;\n };\n fill: {\n /** Minimum self-reported confidence a proposal needs to be written. */\n confidenceThreshold: number;\n maxEvalsPerArtifact: number;\n temperature: number;\n cacheDir: string;\n /** Inference calls this invocation may spend, or `null` for unbounded. */\n maxTurns: number | null;\n };\n /**\n * `calibrate` — measuring the judge against a human's answers (ADR 01022).\n * The sweep grid lives here rather than behind flags because the useful\n * range is a property of a corpus, and a corpus outlives an invocation.\n */\n calibrate: {\n /** Labels sidecar, resolved against the config file's directory. */\n labels: string;\n /** Thresholds. Unset means the run measures without gating. */\n maxFalsePass?: number;\n maxFalseFail?: number;\n maxReview?: number;\n sweep: {\n ensembleRuns: number[];\n autoPass: number[];\n autoFail: number[];\n };\n };\n failOnReview: boolean;\n /**\n * Module specifiers imported before evals are planned, so a `registerGrader`\n * call from outside this package lands in time (ADR 01017). Resolved against\n * the config file's directory, in order — a later entry wins a colliding\n * kind. `--require` appends to this list rather than replacing it.\n */\n plugins: string[];\n /** List offered-but-unused artifacts in coverage, not just count them. */\n reportUnusedArtifacts: boolean;\n /**\n * Runtime evals, each turn checked against its rule sources (proposals 0079\n * and 0083). `null` when the section is absent, which keeps tracevals out of\n * every hook; `{}` puts it in play with these defaults.\n */\n runtime: RuntimeConfig | null;\n}\n\nexport interface RuntimeConfig {\n /** The in-loop judge. `null` falls back to `tracevals.provider` / `model`. */\n hook: { provider: string | null; model: string | null; runs: number };\n /** Globs of designated rule sources, in scope once read. */\n include: string[];\n /** Globs never treated as rule sources. */\n exclude: string[];\n /** Globs of files that say what to build, in scope once touched (proposal 0080). */\n plans: string[];\n}\n\n// `verbose` puts the parent schema on each error, so an unknown key can be\n// checked against the keys its section does have.\nconst ajv = new Ajv2020({ allErrors: true, verbose: true });\nconst validate = ajv.compile(configSchema);\n\n/**\n * `; did you mean \"ensembleRuns\"?` when `key` is the kebab spelling of a key\n * its section has. Only the exact counterpart: a guess at a near miss is\n * advice that can be wrong, and the kebab spelling is the one mistake a\n * reader of the frontmatter vocabulary is likely to make here.\n */\nfunction camelCaseHint(key: string, parentSchema: unknown): string {\n const camel = key.replace(/-([a-z0-9])/g, (_, c: string) => c.toUpperCase());\n if (camel === key || parentSchema === null || typeof parentSchema !== \"object\") {\n return \"\";\n }\n const properties = (parentSchema as { properties?: unknown }).properties;\n return properties !== null &&\n typeof properties === \"object\" &&\n Object.hasOwn(properties, camel)\n ? `; did you mean \"${camel}\"?`\n : \"\";\n}\n\n/**\n * The hint on the old `conformance:` section, renamed `runtime:` (proposal\n * 0083). Nothing reads the old key, so it stays an unknown key; the hint says\n * where its settings went. Only at the section root: a `conformance` key\n * nested anywhere else, as under `runtime:`, was never the old section.\n */\nfunction renamedRuntimeHint(instancePath: string, key: string): string {\n return instancePath === \"\" && key === \"conformance\" ? `; it is now \"runtime\"` : \"\";\n}\n\n/**\n * The hint on an old `provider:` object. The key used to hold a `default` and\n * a section per provider; it is now the provider's name, as `docevals.provider`\n * and `fill.provider` are, and the connection settings moved to the family's\n * top-level `providers:` map, which every tool reads. Ajv's own message says\n * it must be a string, which is true and leaves the reader to find out where\n * the settings went.\n */\nfunction movedProviderHint(instancePath: string, keyword: string): string {\n return instancePath === \"/provider\" && keyword === \"type\"\n ? `; \"provider\" is now a provider name; per-provider settings moved to the top-level providers: map`\n : \"\";\n}\n\n/**\n * The section as the schema admits it: every key optional, because\n * `parseConfig` supplies the defaults. Ajv has checked the document against\n * `config-schema.json` before it is read as this, so the one cast below is\n * where the validated document becomes a typed one.\n */\ninterface RawConfig {\n provider?: string;\n model?: string;\n judge?: {\n ensembleRuns?: number;\n temperature?: number;\n zones?: { autoPass?: number; autoFail?: number };\n cacheDir?: string;\n maxTurns?: number;\n redact?: string[];\n };\n render?: { maxBlockChars?: number; maxTotalChars?: number };\n execution?: { allow?: ExecutionGrant[] };\n history?: { file?: string };\n capture?: { dir?: string };\n fill?: {\n confidenceThreshold?: number;\n maxEvalsPerArtifact?: number;\n temperature?: number;\n cacheDir?: string;\n maxTurns?: number;\n };\n calibrate?: {\n labels?: string;\n maxFalsePass?: number;\n maxFalseFail?: number;\n maxReview?: number;\n sweep?: { ensembleRuns?: number[]; autoPass?: number[]; autoFail?: number[] };\n };\n failOnReview?: boolean;\n plugins?: string[];\n reportUnusedArtifacts?: boolean;\n runtime?: {\n hook?: { provider?: string; model?: string; runs?: number };\n include?: string[];\n exclude?: string[];\n plans?: string[];\n };\n}\n\n/** What the file the section came from carries beside it. */\nexport interface ConfigFileContext {\n /** The file as the user would name it, for messages. */\n source?: string;\n /** The file's top-level `providers:`; `{}` when it declares none. */\n providers?: ProvidersConfig;\n}\n\nexport function parseConfig(\n raw: unknown,\n file: ConfigFileContext = {},\n): TracevalsConfig {\n const source = file.source ?? DEFAULT_CONFIG_FILENAME;\n // Before the schema: Ajv's enum error names neither the value nor the\n // grants that exist, and a grant is the key where a misreading costs most.\n const unknownGrants = configuredGrants(raw).filter((g) => !isExecutionGrant(g));\n if (unknownGrants.length > 0) {\n throw new TracevalsError(`${source}: ${unknownGrantsMessage(unknownGrants)}`);\n }\n if (!validate(raw)) {\n const detail = (validate.errors ?? [])\n .map((e) => {\n // Ajv reports an unknown key against the *parent* object, so the bare\n // message (\"must NOT have additional properties\") leaves the reader to\n // diff their file against the schema to find which key it meant. Name\n // it: the common case is a removed key in an unmigrated config —\n // `judge.maxCostUsd` after the turn budget landed, say — and a\n // migration error that makes you guess is one people work around.\n const extra =\n e.keyword === \"additionalProperties\"\n ? (e.params as { additionalProperty?: string }).additionalProperty\n : undefined;\n return extra !== undefined\n ? `unknown key \"${extra}\"${camelCaseHint(extra, e.parentSchema)}${renamedRuntimeHint(e.instancePath, extra)}`\n : `${CONFIG_SECTION_KEY_PATH}${e.instancePath} ${e.message ?? \"is invalid\"}` +\n movedProviderHint(e.instancePath, e.keyword);\n })\n .join(\"; \");\n throw new TracevalsError(`${source}: ${detail}`);\n }\n const r = raw as RawConfig;\n // Checked here, with the message every other tool in the family gives, so a\n // typo is caught by every verb and not only the ones that reach a model.\n // Whether a model has a provider to own it waits for the flags: a\n // `--provider`, or the family's `providers.provider`, can supply the\n // provider a configured model needs.\n const provider = r.provider ?? null;\n if (provider !== null) {\n // jev only decides. Out of the loop a provider extracts rules and writes\n // verdicts, which are generations.\n if (provider === JEV) throw new TracevalsError(JEV_OUT_OF_LOOP);\n assertKnownProvider(provider, (message) => new TracevalsError(message));\n }\n const hookProvider = r.runtime?.hook?.provider ?? null;\n if (hookProvider !== null) {\n assertKnownProvider(hookProvider, (message) => new TracevalsError(message), { decisions: true });\n }\n const config: TracevalsConfig = {\n provider,\n model: r.model ?? null,\n providers: file.providers ?? {},\n configSource: source,\n judge: {\n ensembleRuns: r.judge?.ensembleRuns ?? 3,\n temperature: r.judge?.temperature ?? 0,\n zones: {\n autoPass: r.judge?.zones?.autoPass ?? 0.8,\n autoFail: r.judge?.zones?.autoFail ?? 0.8,\n },\n cacheDir: r.judge?.cacheDir ?? \".manni/tracevals/cache\",\n // `null`, not a number: unbounded is a state, and any number here would\n // be a ceiling nobody asked for.\n maxTurns: r.judge?.maxTurns ?? null,\n // Always a list: the render site concatenates nothing onto it, but a\n // hole here would be a special case in every consumer.\n redact: [...(r.judge?.redact ?? [])],\n },\n render: {\n maxBlockChars: r.render?.maxBlockChars ?? 2000,\n maxTotalChars: r.render?.maxTotalChars ?? 150000,\n },\n execution: { allow: [...(r.execution?.allow ?? EXECUTION_GRANTS)] },\n history: {\n file: r.history?.file ?? \".manni/tracevals/history.jsonl\",\n },\n capture: {\n // Beside the judge cache, under the state directory that already travels\n // with the project — which is what puts a manifest next to its trace in\n // the CI patterns the docs describe.\n dir: r.capture?.dir ?? DEFAULT_CAPTURE_DIR,\n },\n fill: {\n // 0.7 matches the manuscript's calibration bar for judged agreement.\n confidenceThreshold: r.fill?.confidenceThreshold ?? 0.7,\n maxEvalsPerArtifact: r.fill?.maxEvalsPerArtifact ?? 8,\n temperature: r.fill?.temperature ?? 0,\n // Separate from the judge cache: different key scheme and value shape.\n cacheDir: r.fill?.cacheDir ?? \".manni/tracevals/cache/fill\",\n maxTurns: r.fill?.maxTurns ?? null,\n },\n calibrate: {\n labels: r.calibrate?.labels ?? DEFAULT_LABELS_FILE,\n sweep: {\n // Spans the range rather than filling it: the first sweep judges the\n // corpus at the largest value here, so a wide grid is the one part of\n // calibration that does cost money.\n ensembleRuns: [...(r.calibrate?.sweep?.ensembleRuns ?? [1, 3, 5])],\n autoPass: [\n ...(r.calibrate?.sweep?.autoPass ?? [0.5, 0.6, 0.7, 0.8, 0.9, 0.95]),\n ],\n autoFail: [\n ...(r.calibrate?.sweep?.autoFail ?? [0.5, 0.6, 0.7, 0.8, 0.9, 0.95]),\n ],\n },\n },\n failOnReview: r.failOnReview ?? true,\n // Always a list, never undefined: the read site concatenates `--require`\n // onto it, and a hole there would be a special case in every caller.\n plugins: [...(r.plugins ?? [])],\n // An observation, not a gate: listing it is opt-in because a real roster\n // runs to hundreds of skills (ADR 01016).\n reportUnusedArtifacts: r.reportUnusedArtifacts ?? false,\n runtime:\n r.runtime === undefined\n ? null\n : {\n hook: {\n provider: hookProvider,\n model: r.runtime.hook?.model ?? null,\n runs: r.runtime.hook?.runs ?? 1,\n },\n include: [...(r.runtime.include ?? [])],\n exclude: [...(r.runtime.exclude ?? [])],\n plans: [...(r.runtime.plans ?? [])],\n },\n };\n // Compilability is not expressible in JSON Schema, and a pattern that cannot\n // compile must fail here rather than at the moment a digest is about to be\n // sent — a dropped redaction pattern is a silent leak.\n compileRedactPatterns(config.judge.redact);\n // Left absent rather than defaulted to a number: `0` is a meaningful limit\n // (\"no false pass at all\"), so it cannot double as \"unset\".\n for (const key of [\"maxFalsePass\", \"maxFalseFail\", \"maxReview\"] as const) {\n if (typeof r.calibrate?.[key] === \"number\") {\n config.calibrate[key] = r.calibrate[key];\n }\n }\n return config;\n}\n\n/** This tool's config, and the directory its relative paths resolve from. */\nexport interface LoadedConfig {\n config: TracevalsConfig;\n /**\n * The directory holding the config file, or `dir` when none was found.\n * Plugin specifiers and the labels default resolve against it, so a\n * committed config means the same thing from any working directory.\n */\n dir: string;\n /**\n * The file's top-level `collections:` (proposal 0041); `[]` with no config.\n *\n * Collections never choose tracevals' inputs — `run` and `calibrate` take\n * traces, `fill` detects artifacts under `--project` — and there is no\n * `--collection`. What they say is *where a relocated `metadata` block\n * lives*, so a declared manifest is read for the evals an artifact no longer\n * carries inline (proposals 0047 and 0049 §1).\n */\n collections: CollectionConfig[];\n /**\n * The config file's absolute path; absent when there is none. A keyless\n * manifest owns what an artifact's schemas mark external (proposal 0068),\n * and those schemas are read from meta's section of this same file.\n */\n path?: string;\n}\n\n/** How a command was told to find its config: `-c` and `--no-config`. */\nexport interface ConfigLookup {\n /** `-c/--config`: read this file instead of discovering one. */\n configPath?: string;\n /** `--no-config`: skip discovery and run on the built-in defaults. */\n noConfig?: boolean;\n}\n\n/**\n * Discover the family config from `dir` (cwd by default) upward to the\n * repository root and return this tool's section (`src/shared/config-file.ts`:\n * `manni.config.yaml` read at its `tracevals:` key, with the family's\n * top-level `providers:` beside it). An absent file — or one that carries only\n * other tools' sections — yields defaults.\n *\n * `-c` names a file and skips the walk; `--no-config` skips the file\n * altogether and runs on the built-in defaults, with `dir` still anchoring\n * whatever the config would otherwise have anchored.\n */\nexport async function discoverConfig(\n dir = process.cwd(),\n lookup: ConfigLookup = {},\n): Promise<LoadedConfig> {\n if (lookup.noConfig === true) {\n // No config means no collections, so no manifest owns anything and every\n // artifact's evals are its own front matter's — the same rule cite states.\n return { config: parseConfig({}), dir, collections: [] };\n }\n const file = await Promise.resolve().then(() =>\n lookup.configPath === undefined\n ? findConfigFileSync(dir, CONFIG_FILE)\n : readConfigFileSync(lookup.configPath, dir, CONFIG_FILE),\n );\n if (file === null) return { config: parseConfig({}), dir, collections: [] };\n return {\n config: parseConfig(file.value ?? {}, {\n source: file.source,\n ...(file.providers !== undefined ? { providers: file.providers } : {}),\n }),\n dir: file.dir,\n collections: file.collections,\n path: file.path,\n };\n}\n\n/** `discoverConfig`, for callers that only want the settings. */\nexport async function loadConfig(\n dir = process.cwd(),\n lookup: ConfigLookup = {},\n): Promise<TracevalsConfig> {\n return (await discoverConfig(dir, lookup)).config;\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:tracevals:config\",\n \"title\": \"tracevals section of manni.config.yaml\",\n \"description\": \"Settings for manni tracevals, held under the `tracevals` key of the config file shared by the manni family of tools. Sibling keys belong to other tools and are not validated here.\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"provider\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Which provider judges out of the loop, and extracts rules: auto, anthropic, openai, claude-cli, or llama-cpp. jev only decides, so it is refused here; name it as runtime.hook.provider. Overrides the family's top-level `providers.provider` for tracevals only. Connection settings — an endpoint, an API key's environment variable, the Claude CLI command — live in that top-level `providers:` map, never here.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The model within `provider`, which must be named at this level. Unset, the inference library's default for the winning provider is used; manni pins no model id of its own.\"\n },\n \"judge\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ensembleRuns\": { \"type\": \"integer\", \"minimum\": 1 },\n \"temperature\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 2 },\n \"zones\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"autoPass\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"autoFail\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n },\n \"cacheDir\": { \"type\": \"string\" },\n \"maxTurns\": { \"type\": \"integer\", \"minimum\": 1, \"description\": \"Stop after this many ensemble runs. A cached ensemble spends none. Unset means unbounded; the remaining evals report `skipped` with the reason `turn budget` rather than aborting the run.\" },\n \"redact\": {\n \"type\": \"array\",\n \"description\": \"Extra regular expressions scrubbed from the session digest before it is sent to a judge provider. Applied on top of the built-in secret shapes, never instead of them; each source is compiled with the `g` flag, and a match is replaced with `[redacted]`. Pattern matching is best-effort — --deterministic-only is the only setting that guarantees nothing leaves the machine.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n }\n }\n },\n \"execution\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Operator grant for executing content-authored code.\",\n \"properties\": {\n \"allow\": {\n \"type\": \"array\",\n \"items\": { \"enum\": [\"frontmatter-commands\"] },\n \"default\": [\"frontmatter-commands\"],\n \"description\": \"Which content-authored code a run may execute. Absent, every grant holds; list fewer to narrow it, or write [] to run none. frontmatter-commands lets `command` evals declared in an artifact's front matter run; without it they report `skipped` with a reason, never `pass`.\"\n }\n }\n },\n \"render\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"maxBlockChars\": { \"type\": \"integer\", \"minimum\": 100 },\n \"maxTotalChars\": {\n \"type\": \"integer\",\n \"minimum\": 1000,\n \"description\": \"Upper bound on the rendered digest, in characters. The timeline always keeps at least 200 characters, so a very long header can push the digest past this bound by up to 200.\"\n }\n }\n },\n \"history\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"file\": { \"type\": \"string\" }\n }\n },\n \"capture\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Session manifests — sha256 of every instruction artifact plus the git SHA, recorded at session start by `manni tracevals capture` and read back by `run` to make staleness exact instead of an mtime guess. See ADR 01024.\",\n \"properties\": {\n \"dir\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Directory manifests are written to and looked for, resolved against the project root. `run` also accepts one placed beside the trace as `<trace>.manifest.json`, and --manifest names one outright.\"\n }\n }\n },\n \"fill\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"confidenceThreshold\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"maxEvalsPerArtifact\": { \"type\": \"integer\", \"minimum\": 1 },\n \"temperature\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 2 },\n \"cacheDir\": { \"type\": \"string\" },\n \"maxTurns\": { \"type\": \"integer\", \"minimum\": 1, \"description\": \"Stop after this many inference calls, one per artifact filled. A cached artifact spends none. Unset means unbounded.\" }\n }\n },\n \"calibrate\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Settings for `manni tracevals calibrate` — measuring the tool's verdicts against a human's answers. See ADR 01022.\",\n \"properties\": {\n \"labels\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Default labels sidecar, resolved against this config file's directory. Overridden by --labels.\"\n },\n \"maxFalsePass\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Fail the calibration run (exit 1) above this many false passes — labelled fail, judged pass. Unset by default: a calibration run is a measurement, not a gate.\"\n },\n \"maxFalseFail\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Fail the calibration run above this many false fails — labelled pass, judged fail.\"\n },\n \"maxReview\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Fail the calibration run above this many needs-review outcomes across the whole corpus.\"\n },\n \"sweep\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Values --sweep tries on each axis, one axis at a time with the others held at their configured value. The corpus is judged once at the largest ensembleRuns here and every cell is re-scored from those cached runs, so the grid costs nothing beyond that one run.\",\n \"properties\": {\n \"ensembleRuns\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"type\": \"integer\", \"minimum\": 1 }\n },\n \"autoPass\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n },\n \"autoFail\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"items\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 }\n }\n }\n }\n }\n },\n \"runtime\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"Runtime evals: each turn checked against the rules the files that govern the agent declare. Present, even as {}, it puts tracevals in play under Claude Code hooks; absent, tracevals stays out of them.\",\n \"properties\": {\n \"hook\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"description\": \"The judge inside a Stop or SubagentStop hook. Each key falls back to the top-level one of the same name.\",\n \"properties\": {\n \"provider\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The provider that judges inside a hook. Default: tracevals.provider. jev is accepted here, and only here.\"\n },\n \"model\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The model that judges inside a hook. Default: tracevals.model.\"\n },\n \"runs\": {\n \"type\": \"integer\",\n \"minimum\": 1,\n \"description\": \"Judge calls per rule inside a hook. A rule blocks only when every run scores it not followed at the bar. jev makes one call and ignores it. Default 1.\"\n }\n }\n },\n \"include\": {\n \"type\": \"array\",\n \"description\": \"Globs, relative to the project root, naming files that govern agents beyond the known formats. Each applies to every turn.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n },\n \"exclude\": {\n \"type\": \"array\",\n \"description\": \"Globs, relative to the project root, naming files never treated as rule sources, in any format. It removes plan, spec and output style files too. It also matches the sources `prompt`, `plan` and `system-prompt` by name.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n },\n \"plans\": {\n \"type\": \"array\",\n \"default\": [],\n \"description\": \"Globs, relative to the project root, naming files that say what to build, beyond the known spec formats. Each is a rule source once the session touches it.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n }\n }\n },\n \"failOnReview\": { \"type\": \"boolean\" },\n \"plugins\": {\n \"type\": \"array\",\n \"description\": \"Modules imported before evals are planned, so one calling registerGrader() can add a grader kind the built-ins do not cover. A relative or absolute path resolves against this file's directory, not the working directory; a bare package name resolves the way an import from this file's directory would. Load order is significant: a later entry wins a colliding kind.\",\n \"items\": { \"type\": \"string\", \"minLength\": 1 }\n },\n \"reportUnusedArtifacts\": {\n \"type\": \"boolean\",\n \"description\": \"List every skill and agent the session was offered and never used, rather than only counting them. Off by default: a real roster runs to hundreds of skills.\"\n }\n }\n}\n","/**\n * The calibration labels sidecar (ADR 01022).\n *\n * A label is a human's answer for one `(trace, artifact, eval)`. It lives in\n * its own file rather than in the eval entry for two reasons: the vendored\n * `artifact-evals` vocabulary is docmeta's and `inlineEval` is closed to\n * additions (ADR 01010), and — more importantly — a label is a property of a\n * *corpus and a reviewer*, not of the artifact. Two teams calibrating the same\n * skill against different sessions hold different ground truth, and neither\n * belongs in the SKILL.md.\n */\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, resolve } from \"node:path\";\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\nimport { parse as parseYaml } from \"yaml\";\nimport labelsSchemaJson from \"./labels-schema.json\" with { type: \"json\" };\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { TracevalsError } from \"../types.js\";\nimport type { ArtifactType } from \"../artifacts/types.js\";\n\nconst labelsSchema = labelsSchemaJson as Record<string, unknown>;\n\n/** Conventional location inside a project; overridable with `--labels`. */\nexport const DEFAULT_LABELS_FILE = \"tracevals/labels.yaml\";\n\n/**\n * What a human decided. `needs-review` is a legitimate label, not a cop-out:\n * an eval you found genuinely ambiguous is the one that tells you whether the\n * review band is set sensibly, and the docs have always asked for a couple.\n */\nexport type LabelOutcome = \"pass\" | \"fail\" | \"needs-review\";\n\nexport interface EvalLabel {\n /** Path exactly as written in the file, for error messages. */\n trace: string;\n /** Resolved absolute path — the join key against the batch corpus. */\n traceFile: string;\n artifact: string;\n /** Only when the file disambiguates a name shared by two artifact kinds. */\n type?: ArtifactType;\n eval: string;\n expected: LabelOutcome;\n note?: string;\n}\n\nconst ajv = new Ajv2020({ allErrors: true });\nconst validate = ajv.compile(labelsSchema);\n\n/**\n * Stable identity for one label, and the duplicate-detection key.\n *\n * The separator is written as a backslash-u escape, never as a literal NUL:\n * the runtime value is identical, but a literal one makes git call the file\n * binary — its diff renders as `Bin 0 -> N bytes` and cannot be reviewed or\n * three-way merged, and `grep` answers `Binary file … matches` and stops.\n * `test/unit/source-text-safety.test.ts` holds the whole tree to this.\n */\nexport const labelKey = (\n traceFile: string,\n artifact: string,\n evalName: string,\n type?: ArtifactType,\n): string => `${traceFile}\\u0000${type ?? \"\"}\\u0000${artifact}\\u0000${evalName}`;\n\n/**\n * Validate a labels document and resolve its trace paths.\n *\n * `file` is the path the text came from; trace paths resolve against **its**\n * directory rather than the working directory, matching how `plugins` resolves\n * against the config file that names them. A labels file travels with its\n * corpus, so it must mean the same thing from any cwd.\n */\nexport function parseLabels(text: string, file: string): EvalLabel[] {\n let raw: unknown;\n try {\n raw = parseYaml(text);\n } catch (err) {\n throw new TracevalsError(\n `could not parse ${file}: ${errorMessage(err)}`,\n );\n }\n if (raw === null || raw === undefined) {\n throw new TracevalsError(`invalid labels file ${file}: it is empty`);\n }\n if (!validate(raw)) {\n const detail = (validate.errors ?? [])\n .map((e) => `${e.instancePath || \"/\"} ${e.message ?? \"invalid\"}`)\n .join(\"; \");\n // The empty-list case gets its own wording: \"must NOT have fewer than 1\n // items\" describes the schema, not the mistake.\n const empty = (validate.errors ?? []).some(\n (e) => e.instancePath === \"/labels\" && e.keyword === \"minItems\",\n );\n throw new TracevalsError(\n empty\n ? `invalid labels file ${file}: it must carry at least one label — an empty one measures nothing`\n : `invalid labels file ${file}: ${detail}`,\n );\n }\n\n const base = dirname(resolve(file));\n const labels: EvalLabel[] = [];\n const seen = new Set<string>();\n for (const entry of (raw as { labels: Record<string, string>[] }).labels) {\n const traceFile = resolve(base, entry.trace as string);\n const type = entry.type as ArtifactType | undefined;\n const key = labelKey(\n traceFile,\n entry.artifact as string,\n entry.eval as string,\n type,\n );\n if (seen.has(key)) {\n // Two answers for one question is not a merge problem to resolve at run\n // time — whichever won would silently decide the measurement.\n throw new TracevalsError(\n `invalid labels file ${file}: duplicate label for ${entry.artifact ?? \"?\"} › ${entry.eval ?? \"?\"} on ${entry.trace ?? \"?\"}`,\n );\n }\n seen.add(key);\n labels.push({\n trace: entry.trace as string,\n traceFile,\n artifact: entry.artifact as string,\n ...(type !== undefined ? { type } : {}),\n eval: entry.eval as string,\n expected: entry.expected as LabelOutcome,\n ...(entry.note !== undefined ? { note: entry.note } : {}),\n });\n }\n return labels;\n}\n\nexport async function loadLabels(file: string): Promise<EvalLabel[]> {\n let text: string;\n try {\n text = await readFile(file, \"utf-8\");\n } catch (err) {\n throw new TracevalsError(\n `could not read labels file ${file}: ${errorMessage(err)}`,\n );\n }\n return parseLabels(text, file);\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:tracevals:calibration-labels\",\n \"title\": \"manni tracevals calibration labels\",\n \"description\": \"Ground truth for `manni tracevals calibrate`: what a human decided a given eval should have produced on a given trace. A sidecar rather than an eval field, because a label belongs to a corpus and a reviewer, not to the artifact — and because the eval vocabulary is docmeta's, vendored byte-identical, with `inlineEval` closed to additions (ADR 01010).\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"version\", \"labels\"],\n \"properties\": {\n \"version\": {\n \"const\": 1,\n \"description\": \"Format version. Pinned so a future shape change is an explicit migration rather than a silently-reinterpreted file.\"\n },\n \"labels\": {\n \"type\": \"array\",\n \"minItems\": 1,\n \"description\": \"One entry per (trace, artifact, eval) you have judged by hand.\",\n \"items\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\"trace\", \"artifact\", \"eval\", \"expected\"],\n \"properties\": {\n \"trace\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Path to the trace file, resolved against this file's own directory — not the working directory.\"\n },\n \"artifact\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Artifact name as the report shows it: a skill name, a subagent_type, or a project-rules filename such as CLAUDE.md.\"\n },\n \"type\": {\n \"enum\": [\"skill\", \"agent\", \"project-rules\", \"slash-command\"],\n \"description\": \"Optional disambiguator, needed when one name resolves to two kinds of artifact — a skill and an agent, or a skill and the slash command that types it. Every `ArtifactType` the resolver can produce belongs here: a label whose type this rejects has no way to name the artifact it means.\"\n },\n \"eval\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"The eval's id. Shorthand entries with no declared id get a positional one (eval-1, eval-2, ...), so labelling those is only as stable as the order they are written in.\"\n },\n \"expected\": {\n \"enum\": [\"pass\", \"fail\", \"needs-review\"],\n \"description\": \"What you decided. `needs-review` means you found it genuinely ambiguous and want the tool to defer too.\"\n },\n \"note\": {\n \"type\": \"string\",\n \"description\": \"Why you decided that. Carried into the disagreement report, where it is the whole reason a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