@hawkeyexl/manni 4.12.4 → 4.14.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-TKNIUBLK.js +48 -0
- package/dist/build-6G7PEAG4.js +37 -0
- package/dist/calibrate-BDCXDZV5.js +43 -0
- package/dist/capture-NQJLZD66.js +39 -0
- package/dist/check-552X5I2J.js +36 -0
- package/dist/{check-3O2PZ7TZ.js → check-5HMDJOFP.js} +15 -14
- package/dist/check-BSB4FF4L.js +33 -0
- package/dist/{check-V7JUDAPS.js → check-QIZCTAIR.js} +33 -32
- package/dist/{check-V7JUDAPS.js.map → check-QIZCTAIR.js.map} +1 -1
- package/dist/{chunk-Z42MO7SO.js → chunk-2A6XYSXO.js} +58 -10
- package/dist/chunk-2A6XYSXO.js.map +1 -0
- package/dist/{chunk-HP43LH7E.js → chunk-2HQSMZ4N.js} +11 -5
- package/dist/chunk-2HQSMZ4N.js.map +1 -0
- package/dist/{chunk-EBZ4QKKX.js → chunk-36FJWJSK.js} +132 -27
- package/dist/chunk-36FJWJSK.js.map +1 -0
- package/dist/{chunk-WWKXPPN5.js → chunk-3BMTCS4H.js} +33 -18
- package/dist/chunk-3BMTCS4H.js.map +1 -0
- package/dist/{chunk-7QH2ZI4F.js → chunk-3CCY7M3R.js} +56 -29
- package/dist/chunk-3CCY7M3R.js.map +1 -0
- package/dist/{chunk-PNUM6RHR.js → chunk-3MTZZJKH.js} +3 -3
- package/dist/chunk-4U3X7LYV.js +236 -0
- package/dist/chunk-4U3X7LYV.js.map +1 -0
- package/dist/{chunk-ZCJUSQM7.js → chunk-56URKBXQ.js} +17 -17
- package/dist/chunk-56URKBXQ.js.map +1 -0
- package/dist/{chunk-PP22XDW2.js → chunk-66MKBRTA.js} +88 -12
- package/dist/chunk-66MKBRTA.js.map +1 -0
- package/dist/{chunk-7JUIJ7Q5.js → chunk-6VT3Z352.js} +24 -7
- package/dist/chunk-6VT3Z352.js.map +1 -0
- package/dist/{chunk-CU57HT2E.js → chunk-6WJUZQQX.js} +2 -2
- package/dist/{chunk-KRKNZ3IV.js → chunk-6XFSZCLT.js} +31 -13
- package/dist/chunk-6XFSZCLT.js.map +1 -0
- package/dist/{chunk-VFL3ERMI.js → chunk-742G2QCV.js} +4 -3
- package/dist/{chunk-VFL3ERMI.js.map → chunk-742G2QCV.js.map} +1 -1
- package/dist/chunk-7AXJY4FX.js +83 -0
- package/dist/chunk-7AXJY4FX.js.map +1 -0
- package/dist/{chunk-PSPNIAOP.js → chunk-7KOWE4F4.js} +14 -16
- package/dist/chunk-7KOWE4F4.js.map +1 -0
- package/dist/{chunk-J4ZOTZII.js → chunk-7PENJOI6.js} +14 -8
- package/dist/{chunk-J4ZOTZII.js.map → chunk-7PENJOI6.js.map} +1 -1
- package/dist/chunk-7WVWGULD.js +81 -0
- package/dist/chunk-7WVWGULD.js.map +1 -0
- package/dist/{chunk-4IW6FAUN.js → chunk-A7MNH4YI.js} +88 -7
- package/dist/chunk-A7MNH4YI.js.map +1 -0
- package/dist/{chunk-4TGIGVFO.js → chunk-AJYUJ37M.js} +65 -8
- package/dist/chunk-AJYUJ37M.js.map +1 -0
- package/dist/{chunk-OTJOBZJ5.js → chunk-B2242FYO.js} +2 -1
- package/dist/chunk-B2242FYO.js.map +1 -0
- package/dist/{chunk-U4SY2TJS.js → chunk-B6GUSA53.js} +15 -10
- package/dist/chunk-B6GUSA53.js.map +1 -0
- package/dist/{chunk-5NNPEPVM.js → chunk-BA4TCCOO.js} +5 -5
- package/dist/{chunk-X4GQ4HPY.js → chunk-BAWKNF6U.js} +3 -3
- package/dist/{chunk-Y4TDIUG6.js → chunk-BIRGZEWO.js} +86 -10
- package/dist/chunk-BIRGZEWO.js.map +1 -0
- package/dist/chunk-BREAC43H.js +85 -0
- package/dist/chunk-BREAC43H.js.map +1 -0
- package/dist/{chunk-YQV75FIL.js → chunk-CFMI74TP.js} +3 -3
- package/dist/{chunk-DTXLFSAB.js → chunk-CZJNYHK7.js} +2 -2
- package/dist/{chunk-AATCO43N.js → chunk-D2TIZOMN.js} +6 -5
- package/dist/chunk-D2TIZOMN.js.map +1 -0
- package/dist/{chunk-3FXPIZXL.js → chunk-EXAZ7K25.js} +5 -5
- package/dist/{chunk-BGRP44SX.js → chunk-GHZAOPGK.js} +148 -92
- package/dist/chunk-GHZAOPGK.js.map +1 -0
- package/dist/{chunk-XP4RNQZL.js → chunk-HGU4FDRY.js} +242 -15
- package/dist/chunk-HGU4FDRY.js.map +1 -0
- package/dist/{chunk-ZXRAE55H.js → chunk-IGRXQC3H.js} +2 -2
- package/dist/{chunk-6KONPVHQ.js → chunk-IOYEPB27.js} +5 -5
- package/dist/{chunk-U6IHLEWT.js → chunk-JCTHXG33.js} +2 -2
- package/dist/{chunk-TBAMBLF3.js → chunk-JNMY7KZG.js} +132 -15
- package/dist/chunk-JNMY7KZG.js.map +1 -0
- package/dist/{chunk-QWE3WLV4.js → chunk-JTEWU4C6.js} +26 -16
- package/dist/chunk-JTEWU4C6.js.map +1 -0
- package/dist/{chunk-KQRYW4DN.js → chunk-JWBS7YDI.js} +8 -8
- package/dist/chunk-JWBS7YDI.js.map +1 -0
- package/dist/{chunk-EX6E2P6Z.js → chunk-LCRBR7KW.js} +10 -4
- package/dist/chunk-LCRBR7KW.js.map +1 -0
- package/dist/{chunk-JAPSZ44X.js → chunk-M43NTWVH.js} +10 -7
- package/dist/chunk-M43NTWVH.js.map +1 -0
- package/dist/chunk-M534DYAJ.js +76 -0
- package/dist/chunk-M534DYAJ.js.map +1 -0
- package/dist/chunk-MC7U5IH4.js +126 -0
- package/dist/chunk-MC7U5IH4.js.map +1 -0
- package/dist/{chunk-7TVIFCGT.js → chunk-MIGFQP5N.js} +2 -2
- package/dist/{chunk-TZOYZK2E.js → chunk-OZUPJB4J.js} +2 -2
- package/dist/{chunk-J67EOBN3.js → chunk-QEZQ7MGH.js} +53 -13
- package/dist/chunk-QEZQ7MGH.js.map +1 -0
- package/dist/{chunk-5OKSFNUV.js → chunk-QF7EIRMU.js} +29 -23
- package/dist/chunk-QF7EIRMU.js.map +1 -0
- package/dist/chunk-QK6VYJHV.js +26 -0
- package/dist/chunk-QK6VYJHV.js.map +1 -0
- package/dist/chunk-QS2Z3SWL.js +21 -0
- package/dist/chunk-QS2Z3SWL.js.map +1 -0
- package/dist/{chunk-OKMTUAWO.js → chunk-QSPH4F56.js} +5 -5
- package/dist/{chunk-XEYS3KAZ.js → chunk-STM3G7WJ.js} +207 -79
- package/dist/chunk-STM3G7WJ.js.map +1 -0
- package/dist/{chunk-GNUZ37L2.js → chunk-T3BBNLAT.js} +2 -2
- package/dist/{chunk-GNUZ37L2.js.map → chunk-T3BBNLAT.js.map} +1 -1
- package/dist/{chunk-YGFIQ6Y5.js → chunk-TKINOTVS.js} +1 -1
- package/dist/chunk-TKINOTVS.js.map +1 -0
- package/dist/{chunk-QUG53QGZ.js → chunk-USKTLEPZ.js} +4 -4
- package/dist/{chunk-EU4HDGG4.js → chunk-V6OCE4ND.js} +129 -59
- package/dist/chunk-V6OCE4ND.js.map +1 -0
- package/dist/{chunk-SSDSV52B.js → chunk-VBBJGFME.js} +6 -7
- package/dist/chunk-VBBJGFME.js.map +1 -0
- package/dist/{chunk-CWXZ2MRT.js → chunk-VHJ72YCD.js} +4 -3
- package/dist/chunk-VHJ72YCD.js.map +1 -0
- package/dist/{chunk-PAU352SV.js → chunk-W4GTMOJW.js} +2 -2
- package/dist/{chunk-JEUFYSFQ.js → chunk-W5DO426O.js} +114 -70
- package/dist/chunk-W5DO426O.js.map +1 -0
- package/dist/{chunk-LWMB7JRE.js → chunk-W6B24IMO.js} +3 -3
- package/dist/{chunk-SE4JN5XN.js → chunk-WDENIUC7.js} +3 -1
- package/dist/chunk-WDENIUC7.js.map +1 -0
- package/dist/{chunk-NLELGEKL.js → chunk-WIPTWZVH.js} +6 -6
- package/dist/{chunk-RLPWXF5R.js → chunk-Y36PNW6J.js} +9 -9
- package/dist/{chunk-TR2XFZPR.js → chunk-Y37VJFX2.js} +9 -9
- package/dist/{chunk-3QUCVYNX.js → chunk-YJ3EG2D5.js} +12 -124
- package/dist/chunk-YJ3EG2D5.js.map +1 -0
- package/dist/{chunk-UKZNLVJW.js → chunk-ZINZTHWO.js} +4 -2
- package/dist/chunk-ZINZTHWO.js.map +1 -0
- package/dist/{chunk-N5JSOJY6.js → chunk-ZPLIXZZ6.js} +7 -5
- package/dist/chunk-ZPLIXZZ6.js.map +1 -0
- package/dist/{chunk-VXU75N5R.js → chunk-ZRQUQS7P.js} +5 -79
- package/dist/chunk-ZRQUQS7P.js.map +1 -0
- package/dist/{cli-RQRMZKKM.js → cli-5XKHMRZ5.js} +317 -28
- package/dist/cli-5XKHMRZ5.js.map +1 -0
- package/dist/{cli-5QGP6R63.js → cli-7QHJW5GH.js} +69 -26
- package/dist/cli-7QHJW5GH.js.map +1 -0
- package/dist/{cli-UL2IFH3R.js → cli-BUV3DRUH.js} +29 -83
- package/dist/cli-BUV3DRUH.js.map +1 -0
- package/dist/{cli-RQSCBJJY.js → cli-IKDX2I5X.js} +20 -18
- package/dist/{cli-RQSCBJJY.js.map → cli-IKDX2I5X.js.map} +1 -1
- package/dist/{cli-2Q5FODAX.js → cli-LOND37OA.js} +383 -247
- package/dist/cli-LOND37OA.js.map +1 -0
- package/dist/{cli-4ANSKDPD.js → cli-O6Y2KVWD.js} +11 -11
- package/dist/{cli-2OQKCKRD.js → cli-QTLOAVOY.js} +11 -10
- package/dist/{cli-2OQKCKRD.js.map → cli-QTLOAVOY.js.map} +1 -1
- package/dist/{cli-IE3CYYHA.js → cli-SOA2E26G.js} +62 -22
- package/dist/cli-SOA2E26G.js.map +1 -0
- package/dist/{cli-SDTXHLCA.js → cli-VQYB3663.js} +19 -18
- package/dist/{cli-SDTXHLCA.js.map → cli-VQYB3663.js.map} +1 -1
- package/dist/{cli-SGSS6FXE.js → cli-X6IWTDFK.js} +31 -29
- package/dist/{cli-SGSS6FXE.js.map → cli-X6IWTDFK.js.map} +1 -1
- package/dist/{cli-USPQURPP.js → cli-XAT673VB.js} +3 -3
- package/dist/cli.js +14 -14
- package/dist/{config-JJW75SBX.js → config-7I5CHHRZ.js} +6 -6
- package/dist/docmeta.js +10 -10
- package/dist/github-IPBOTQBN.js +36 -0
- package/dist/github-XM36D7ZH.js +32 -0
- package/dist/graph/runtime.js.map +1 -1
- package/dist/index.d.ts +157 -13
- package/dist/index.js +147 -131
- package/dist/index.js.map +1 -1
- package/dist/{json-PQURAHQ5.js → json-225TND7K.js} +15 -13
- package/dist/{labels-FMLO2URZ.js → labels-CTLHIRC4.js} +14 -12
- package/dist/{labels-FMLO2URZ.js.map → labels-CTLHIRC4.js.map} +1 -1
- package/dist/lint-NP3PC3SO.js +35 -0
- package/dist/list-JJGNKO6S.js +36 -0
- package/dist/list-Q457TIMA.js +34 -0
- package/dist/{page-X3HYSH6D.js → page-FJW7J2EU.js} +13 -12
- package/dist/{picker-3XF36MJF.js → picker-FPUC5UGM.js} +3 -3
- package/dist/{prepare-IQMB262G.js → prepare-RKJEKHAG.js} +21 -20
- package/dist/{prepare-IQMB262G.js.map → prepare-RKJEKHAG.js.map} +1 -1
- package/dist/{pretty-22PXIEOV.js → pretty-ECBO3EVT.js} +15 -14
- package/dist/{pretty-K5BOCKBB.js → pretty-QFEN2SIA.js} +15 -13
- package/dist/{provider-LBX4IXGX.js → provider-JY2I3VLF.js} +3 -3
- package/dist/{release-VV3UTKE5.js → release-Z3ASYZ3S.js} +3 -3
- package/dist/{reporters-5LIYYE6M.js → reporters-IKKL5RHS.js} +15 -14
- package/dist/{reporters-26H3N2KW.js → reporters-TDQDQHKE.js} +6 -5
- package/dist/{reporters-324OWH36.js → reporters-WGLQKW2Y.js} +6 -6
- package/dist/run-BTETGGLW.js +39 -0
- package/dist/sarif-K4SMB563.js +31 -0
- package/dist/sarif-ZHFK6PZY.js +37 -0
- package/dist/{term-2ADSKGZW.js → term-2M7APX2A.js} +58 -109
- package/dist/term-2M7APX2A.js.map +1 -0
- package/dist/types-VMOT7RAL.js +12 -0
- package/dist/types-VMOT7RAL.js.map +1 -0
- package/dist/{validate-LRYUEZLJ.js → validate-GBM5STKS.js} +6 -6
- package/dist/validate-GBM5STKS.js.map +1 -0
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/plugin/manni/skills/check/SKILL.md +2 -2
- package/plugin/manni/skills/evals/SKILL.md +1 -1
- package/plugin/manni/skills/fix/SKILL.md +99 -18
- package/plugin/manni/skills/setup/SKILL.md +1 -1
- package/schemas/lint/template.json +6 -1
- package/shapes/graph/shapes-1.1.1.ttl +953 -0
- package/templates/lint/tgdp/concept.yaml +27 -13
- package/templates/lint/tgdp/how-to.yaml +35 -21
- package/templates/lint/tgdp/readme.yaml +69 -25
- package/templates/lint/tgdp/reference.yaml +44 -31
- package/templates/lint/tgdp/release-notes.yaml +48 -19
- package/templates/lint/tgdp/troubleshooting.yaml +45 -31
- package/templates/lint/tgdp/tutorial.yaml +35 -19
- package/dist/batch-UHLVBMYM.js +0 -46
- package/dist/build-4RPXBSAO.js +0 -36
- package/dist/calibrate-POL5DCJ6.js +0 -41
- package/dist/capture-I7ZYG7NZ.js +0 -38
- package/dist/check-6TEG5TM6.js +0 -34
- package/dist/check-DGOUTC3V.js +0 -30
- package/dist/chunk-3QUCVYNX.js.map +0 -1
- package/dist/chunk-4IW6FAUN.js.map +0 -1
- package/dist/chunk-4TGIGVFO.js.map +0 -1
- package/dist/chunk-5OKSFNUV.js.map +0 -1
- package/dist/chunk-7JUIJ7Q5.js.map +0 -1
- package/dist/chunk-7QH2ZI4F.js.map +0 -1
- package/dist/chunk-AATCO43N.js.map +0 -1
- package/dist/chunk-BGRP44SX.js.map +0 -1
- package/dist/chunk-CWXZ2MRT.js.map +0 -1
- package/dist/chunk-EBZ4QKKX.js.map +0 -1
- package/dist/chunk-EU4HDGG4.js.map +0 -1
- package/dist/chunk-EX6E2P6Z.js.map +0 -1
- package/dist/chunk-HP43LH7E.js.map +0 -1
- package/dist/chunk-J67EOBN3.js.map +0 -1
- package/dist/chunk-JAPSZ44X.js.map +0 -1
- package/dist/chunk-JEUFYSFQ.js.map +0 -1
- package/dist/chunk-KQRYW4DN.js.map +0 -1
- package/dist/chunk-KRKNZ3IV.js.map +0 -1
- package/dist/chunk-MNH7QO4Z.js +0 -15
- package/dist/chunk-MNH7QO4Z.js.map +0 -1
- package/dist/chunk-N5JSOJY6.js.map +0 -1
- package/dist/chunk-OTJOBZJ5.js.map +0 -1
- package/dist/chunk-PP22XDW2.js.map +0 -1
- package/dist/chunk-PSPNIAOP.js.map +0 -1
- package/dist/chunk-QWE3WLV4.js.map +0 -1
- package/dist/chunk-SE4JN5XN.js.map +0 -1
- package/dist/chunk-SSDSV52B.js.map +0 -1
- package/dist/chunk-TBAMBLF3.js.map +0 -1
- package/dist/chunk-U4SY2TJS.js.map +0 -1
- package/dist/chunk-UKZNLVJW.js.map +0 -1
- package/dist/chunk-VXU75N5R.js.map +0 -1
- package/dist/chunk-W7EZJPRX.js +0 -117
- package/dist/chunk-W7EZJPRX.js.map +0 -1
- package/dist/chunk-WWKXPPN5.js.map +0 -1
- package/dist/chunk-XEYS3KAZ.js.map +0 -1
- package/dist/chunk-XP4RNQZL.js.map +0 -1
- package/dist/chunk-Y4TDIUG6.js.map +0 -1
- package/dist/chunk-YGFIQ6Y5.js.map +0 -1
- package/dist/chunk-Z42MO7SO.js.map +0 -1
- package/dist/chunk-ZCJUSQM7.js.map +0 -1
- package/dist/cli-2Q5FODAX.js.map +0 -1
- package/dist/cli-5QGP6R63.js.map +0 -1
- package/dist/cli-IE3CYYHA.js.map +0 -1
- package/dist/cli-RQRMZKKM.js.map +0 -1
- package/dist/cli-UL2IFH3R.js.map +0 -1
- package/dist/github-PBIYRH5S.js +0 -35
- package/dist/github-RJG2MAWB.js +0 -30
- package/dist/lint-N2CY66JX.js +0 -34
- package/dist/list-OMHTVFDY.js +0 -32
- package/dist/list-VBFNFEXV.js +0 -35
- package/dist/run-4EKG6EMI.js +0 -37
- package/dist/term-2ADSKGZW.js.map +0 -1
- package/dist/types-Y6TXHM7M.js +0 -10
- /package/dist/{batch-UHLVBMYM.js.map → batch-TKNIUBLK.js.map} +0 -0
- /package/dist/{build-4RPXBSAO.js.map → build-6G7PEAG4.js.map} +0 -0
- /package/dist/{calibrate-POL5DCJ6.js.map → calibrate-BDCXDZV5.js.map} +0 -0
- /package/dist/{capture-I7ZYG7NZ.js.map → capture-NQJLZD66.js.map} +0 -0
- /package/dist/{check-3O2PZ7TZ.js.map → check-552X5I2J.js.map} +0 -0
- /package/dist/{check-6TEG5TM6.js.map → check-5HMDJOFP.js.map} +0 -0
- /package/dist/{check-DGOUTC3V.js.map → check-BSB4FF4L.js.map} +0 -0
- /package/dist/{chunk-PNUM6RHR.js.map → chunk-3MTZZJKH.js.map} +0 -0
- /package/dist/{chunk-CU57HT2E.js.map → chunk-6WJUZQQX.js.map} +0 -0
- /package/dist/{chunk-5NNPEPVM.js.map → chunk-BA4TCCOO.js.map} +0 -0
- /package/dist/{chunk-X4GQ4HPY.js.map → chunk-BAWKNF6U.js.map} +0 -0
- /package/dist/{chunk-YQV75FIL.js.map → chunk-CFMI74TP.js.map} +0 -0
- /package/dist/{chunk-DTXLFSAB.js.map → chunk-CZJNYHK7.js.map} +0 -0
- /package/dist/{chunk-3FXPIZXL.js.map → chunk-EXAZ7K25.js.map} +0 -0
- /package/dist/{chunk-ZXRAE55H.js.map → chunk-IGRXQC3H.js.map} +0 -0
- /package/dist/{chunk-6KONPVHQ.js.map → chunk-IOYEPB27.js.map} +0 -0
- /package/dist/{chunk-U6IHLEWT.js.map → chunk-JCTHXG33.js.map} +0 -0
- /package/dist/{chunk-7TVIFCGT.js.map → chunk-MIGFQP5N.js.map} +0 -0
- /package/dist/{chunk-TZOYZK2E.js.map → chunk-OZUPJB4J.js.map} +0 -0
- /package/dist/{chunk-OKMTUAWO.js.map → chunk-QSPH4F56.js.map} +0 -0
- /package/dist/{chunk-QUG53QGZ.js.map → chunk-USKTLEPZ.js.map} +0 -0
- /package/dist/{chunk-PAU352SV.js.map → chunk-W4GTMOJW.js.map} +0 -0
- /package/dist/{chunk-LWMB7JRE.js.map → chunk-W6B24IMO.js.map} +0 -0
- /package/dist/{chunk-NLELGEKL.js.map → chunk-WIPTWZVH.js.map} +0 -0
- /package/dist/{chunk-RLPWXF5R.js.map → chunk-Y36PNW6J.js.map} +0 -0
- /package/dist/{chunk-TR2XFZPR.js.map → chunk-Y37VJFX2.js.map} +0 -0
- /package/dist/{cli-4ANSKDPD.js.map → cli-O6Y2KVWD.js.map} +0 -0
- /package/dist/{cli-USPQURPP.js.map → cli-XAT673VB.js.map} +0 -0
- /package/dist/{config-JJW75SBX.js.map → config-7I5CHHRZ.js.map} +0 -0
- /package/dist/{github-PBIYRH5S.js.map → github-IPBOTQBN.js.map} +0 -0
- /package/dist/{github-RJG2MAWB.js.map → github-XM36D7ZH.js.map} +0 -0
- /package/dist/{json-PQURAHQ5.js.map → json-225TND7K.js.map} +0 -0
- /package/dist/{lint-N2CY66JX.js.map → lint-NP3PC3SO.js.map} +0 -0
- /package/dist/{list-OMHTVFDY.js.map → list-JJGNKO6S.js.map} +0 -0
- /package/dist/{list-VBFNFEXV.js.map → list-Q457TIMA.js.map} +0 -0
- /package/dist/{page-X3HYSH6D.js.map → page-FJW7J2EU.js.map} +0 -0
- /package/dist/{picker-3XF36MJF.js.map → picker-FPUC5UGM.js.map} +0 -0
- /package/dist/{pretty-22PXIEOV.js.map → pretty-ECBO3EVT.js.map} +0 -0
- /package/dist/{pretty-K5BOCKBB.js.map → pretty-QFEN2SIA.js.map} +0 -0
- /package/dist/{provider-LBX4IXGX.js.map → provider-JY2I3VLF.js.map} +0 -0
- /package/dist/{release-VV3UTKE5.js.map → release-Z3ASYZ3S.js.map} +0 -0
- /package/dist/{reporters-26H3N2KW.js.map → reporters-IKKL5RHS.js.map} +0 -0
- /package/dist/{reporters-324OWH36.js.map → reporters-TDQDQHKE.js.map} +0 -0
- /package/dist/{reporters-5LIYYE6M.js.map → reporters-WGLQKW2Y.js.map} +0 -0
- /package/dist/{run-4EKG6EMI.js.map → run-BTETGGLW.js.map} +0 -0
- /package/dist/{types-Y6TXHM7M.js.map → sarif-K4SMB563.js.map} +0 -0
- /package/dist/{validate-LRYUEZLJ.js.map → sarif-ZHFK6PZY.js.map} +0 -0
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
errorSite,
|
|
4
4
|
messageFor,
|
|
5
|
+
remedyFor,
|
|
5
6
|
shortCommit,
|
|
6
7
|
shortPin,
|
|
7
8
|
shortSrc,
|
|
8
9
|
spellAt
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AJYUJ37M.js";
|
|
10
11
|
import {
|
|
11
12
|
parseSrc
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QEZQ7MGH.js";
|
|
14
|
+
import {
|
|
15
|
+
guidanceLines
|
|
16
|
+
} from "./chunk-QK6VYJHV.js";
|
|
13
17
|
import {
|
|
14
18
|
palette
|
|
15
19
|
} from "./chunk-RNVYGWIC.js";
|
|
@@ -181,6 +185,7 @@ function renderCheckPretty(run, opts) {
|
|
|
181
185
|
if (file === void 0) return c.dim(` (line ${String(line)})`);
|
|
182
186
|
return c.dim(` (${file}:${String(line)})`);
|
|
183
187
|
};
|
|
188
|
+
const guidance = (finding, indent) => guidanceLines(finding.guidance).map((line) => `${" ".repeat(indent)}${c.dim(line)}`);
|
|
184
189
|
run.pages.forEach((page, index) => {
|
|
185
190
|
const { reported, baselined: baselined2 } = splitBaselined(page, resultFor(run, index));
|
|
186
191
|
const errors = reported.filter((f) => f.severity === "error").length;
|
|
@@ -209,9 +214,16 @@ function renderCheckPretty(run, opts) {
|
|
|
209
214
|
const under = [];
|
|
210
215
|
for (const finding of own) {
|
|
211
216
|
const isEnd = [...endRules].some((prefix) => finding.rule.startsWith(prefix));
|
|
212
|
-
if (isEnd)
|
|
217
|
+
if (isEnd) {
|
|
218
|
+
if (isBaselined.has(finding)) continue;
|
|
219
|
+
const remedy = remedyFor(finding.rule, result);
|
|
220
|
+
if (remedy !== void 0) under.push(` ${remedy}`);
|
|
221
|
+
under.push(...guidance(finding, 6));
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
213
224
|
const text = isBaselined.has(finding) ? c.dim(`${finding.message} (baselined)`) : finding.message;
|
|
214
225
|
under.push(` ${severityMark(finding.severity, c)} ${text}${location(finding)}`);
|
|
226
|
+
if (!isBaselined.has(finding)) under.push(...guidance(finding, 8));
|
|
215
227
|
}
|
|
216
228
|
if (opts.showDiff) {
|
|
217
229
|
if (own.some((f) => f.rule === "source-changed")) under.push(...diffLines(result, c.dim));
|
|
@@ -244,9 +256,14 @@ function renderCheckPretty(run, opts) {
|
|
|
244
256
|
for (const finding of page.findings) {
|
|
245
257
|
if (placed.has(finding)) continue;
|
|
246
258
|
const label = c.cyan(labelOfFinding(finding));
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
259
|
+
if (isBaselined.has(finding)) {
|
|
260
|
+
lines.push(
|
|
261
|
+
` ${c.dim("\xB7")} ${label} ${c.dim(`${finding.message} (baselined)`)}${location(finding)}`
|
|
262
|
+
);
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
lines.push(` ${severityMark(finding.severity, c)} ${label} ${finding.message}${location(finding)}`);
|
|
266
|
+
lines.push(...guidance(finding, 6));
|
|
250
267
|
}
|
|
251
268
|
});
|
|
252
269
|
const { summary } = run;
|
|
@@ -452,4 +469,4 @@ export {
|
|
|
452
469
|
removalLine,
|
|
453
470
|
renderRemovePretty
|
|
454
471
|
};
|
|
455
|
-
//# sourceMappingURL=chunk-
|
|
472
|
+
//# sourceMappingURL=chunk-6VT3Z352.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cite/reporters/pretty.ts"],"sourcesContent":["/**\n * Pretty output for `check` and `update`.\n *\n * A citation is one row: its name, its claim end, its source end, and, when a\n * manifest owns the entry, where that is. Both ends read in file lines, the\n * only lines a person sees. Marks: ✓ current, ✗ error, ↕ warning, ℹ notice,\n * · skipped or baselined; a file line is ✓, ✗ (an error), ⚠ (a warning, no\n * error) or ℹ (notices only). Diffs, commit subjects and a changed claim's\n * current lines print only under `showDiff`; a decrypted path only under\n * `reveal`. Colour via `shouldColor`; never under `--no-color`/`NO_COLOR`.\n */\nimport type { ValidationResult } from \"../../meta/index.js\";\nimport { palette } from \"../../shared/color.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport { errorSite, messageFor, remedyFor } from \"../core/adapt.js\";\nimport { parseSrc } from \"../core/range.js\";\nimport { shortCommit, shortPin, shortSrc, spellAt } from \"../core/spell.js\";\nimport type {\n CheckRun,\n CitationFinding,\n CitationResult,\n PageCitationReport,\n RecommitReason,\n Removal,\n RemoveRun,\n UpdateRewrite,\n UpdateRun,\n} from \"../types.js\";\n\nexport interface PrettyOptions {\n color: boolean;\n quiet?: boolean;\n showDiff?: boolean;\n reveal?: boolean;\n /** `remove --dry-run`: the footer says what the run would have removed. */\n dryRun?: boolean;\n}\n\n/** Diff lines printed under a `changed` row before the rest is elided. */\nexport const DIFF_LINE_CAP = 60;\n\nconst plural = (n: number, one: string, many = `${one}s`): string =>\n `${String(n)} ${n === 1 ? one : many}`;\n\n/** A finding's mark, by severity: ✗ error, ↕ warning, ℹ notice. */\nfunction severityMark(severity: CitationFinding[\"severity\"], c: ReturnType<typeof palette>): string {\n switch (severity) {\n case \"error\":\n return c.red(\"✗\");\n case \"warning\":\n return c.yellow(\"↕\");\n case \"notice\":\n return c.dim(\"ℹ\");\n }\n}\n\n/** A page's findings, split into the ones the baseline let through and the ones it forgave. */\nexport interface SplitFindings {\n reported: CitationFinding[];\n baselined: CitationFinding[];\n}\n\n/**\n * Which of a page's findings the run actually reported.\n *\n * The baseline works on the adapted `ValidationResult`: a forgiven finding is\n * removed from `errors` and counted in `baselined`, while `pages[].findings`\n * keeps every finding the check produced. So a finding is baselined exactly\n * when no error in the adapted result is left to account for it. Each error\n * is consumed once, so two identical findings need two identical errors.\n */\nexport function splitBaselined(\n page: PageCitationReport,\n result: ValidationResult | undefined,\n): SplitFindings {\n if (result === undefined) return { reported: [...page.findings], baselined: [] };\n const pool = [...result.errors];\n const out: SplitFindings = { reported: [], baselined: [] };\n for (const finding of page.findings) {\n const instancePath =\n finding.index === undefined ? \"\" : `/citations/${String(finding.index)}`;\n // A finding that sits on a manifest carries that file's line, and one\n // whose manifest lies outside the tree carries no line at all.\n const line = errorSite(finding).line;\n const at = pool.findIndex(\n (e) =>\n e.keyword === finding.rule &&\n e.instancePath === instancePath &&\n e.message === finding.message &&\n (e.line ?? null) === (line ?? null),\n );\n if (at === -1) {\n out.baselined.push(finding);\n } else {\n pool.splice(at, 1);\n out.reported.push(finding);\n }\n }\n return out;\n}\n\n/** The adapted result for a page: same position first, then by file label. */\nexport function resultFor(run: CheckRun, index: number): ValidationResult | undefined {\n const page = run.pages[index];\n if (page === undefined) return undefined;\n const aligned = run.results[index];\n if (aligned !== undefined && aligned.file === page.file) return aligned;\n return run.results.find((r) => r.file === page.file);\n}\n\n/** Whether a finding is about this citation. Every entry has an index, in either channel. */\nfunction belongsTo(finding: CitationFinding, result: CitationResult): boolean {\n return finding.index !== undefined && finding.index === result.origin.index;\n}\n\n/** `<id>`, else nothing: the ends say which entry it is. */\nfunction labelOf(result: CitationResult): string {\n return result.citation.id ?? \"\";\n}\n\n/** A page-level finding's label: its id, its index, or the source it names. */\nfunction labelOfFinding(finding: CitationFinding): string {\n if (finding.id !== undefined) return finding.id;\n if (finding.index !== undefined) return `#${String(finding.index)}`;\n return finding.src ?? \"page\";\n}\n\n/** Whether the entry spelled this source encrypted. */\nfunction citesEncrypted(src: string): boolean {\n try {\n return parseSrc(src).encrypted;\n } catch {\n return false;\n }\n}\n\n/**\n * The claim end column: where it is, in file lines, and how it reads. A marker\n * says where it is and, when it is misplaced, where it belongs. Its claim\n * status reads bare: the marker's own line is what a reader acts on.\n */\nfunction claimColumn(result: CitationResult): string {\n const { claim, marker } = result;\n const anchoredByMarker = result.anchor === \"marker\" && result.markerLine !== undefined;\n const moves = marker?.misplaced === undefined ? \"\" : ` -> :${String(marker.misplaced.to)}`;\n const where = anchoredByMarker\n ? `marker :${String(result.markerLine ?? 0)}${moves}`\n : claim?.fileLines === undefined\n ? \"\"\n : `:${claim.fileLines}`;\n if (claim === null) return where;\n let status: string;\n switch (claim.status) {\n case \"moved\":\n status = anchoredByMarker ? \"moved\" : `moved -> :${claim.newFileLines ?? \"?\"}`;\n break;\n case \"moved-ambiguous\": {\n const at = (claim.candidateFileLines ?? []).map((lines) => `:${lines}`);\n status = `moved, ${plural(at.length, \"candidate\")} (${at.join(\", \")})`;\n break;\n }\n case \"reanchored\": {\n const since = claim.commitSha === undefined ? \"\" : ` since ${shortCommit(claim.commitSha)}`;\n const to = claim.newFileLines === undefined ? \"\" : ` -> :${claim.newFileLines}`;\n status = `reanchored${since}${to}`;\n break;\n }\n case \"changed\":\n status = changedText(claim);\n break;\n default:\n status = claim.status;\n }\n return where === \"\" ? status : `${where} ${status}`;\n}\n\n/** How a changed claim's column says since when, as the source column does. */\nfunction changedText(claim: NonNullable<CitationResult[\"claim\"]>): string {\n if (claim.historyAvailable === false) return \"changed (history unavailable; fetch-depth: 0)\";\n if (claim.commitSha === undefined) return \"changed\";\n const since = claim.commitsSince ?? [];\n const count = since.length === 0 ? \"uncommitted\" : plural(since.length, \"commit\");\n return `changed since ${shortCommit(claim.commitSha)}, ${count}`;\n}\n\n/**\n * The source end column: the source as the entry spelled it, plus the\n * decrypted path only under `reveal`, and only beside an encrypted source,\n * the one spelling that hides it.\n */\nfunction sourceColumn(\n result: CitationResult,\n opts: PrettyOptions,\n dim: (s: string) => string,\n): string {\n const { source } = result;\n const src = shortSrc(source.src);\n const encrypted = citesEncrypted(source.src);\n const reveal = (path: string | undefined): string =>\n opts.reveal === true && path !== undefined && encrypted ? ` ${dim(`(${path})`)}` : \"\";\n // A source that followed its text to another file has a second ciphertext\n // in the message, and `--reveal` is the one place either is a path.\n return `${src}${reveal(source.resolvedPath)} ${messageFor(source)}${reveal(source.resolvedNewPath)}`;\n}\n\n/** The subjects and diff under a changed source, dim, the diff capped. */\nfunction diffLines(result: CitationResult, dim: (s: string) => string): string[] {\n const out: string[] = [];\n for (const subject of result.source.commitsSince ?? []) out.push(dim(` ${subject}`));\n const diff = result.source.diff;\n if (diff === undefined || diff === \"\") return out;\n const lines = diff.split(/\\r?\\n/);\n while (lines.length > 0 && lines[lines.length - 1] === \"\") lines.pop();\n const shown = lines.slice(0, DIFF_LINE_CAP);\n for (const line of shown) out.push(dim(` ${line}`));\n const more = lines.length - shown.length;\n if (more > 0) out.push(dim(` … (${plural(more, \"more line\")})`));\n return out;\n}\n\n/**\n * What `--show-diff` adds under a claim row: the page's commit subjects since\n * the baseline and the claim's own diff. With no baseline there is no diff to\n * print, so a changed claim shows the lines it covers now instead.\n */\nfunction claimLines(result: CitationResult, dim: (s: string) => string): string[] {\n const claim = result.claim;\n const diff = claim?.diff;\n if (claim === null || diff === undefined || diff === \"\") {\n return capped(claim?.text ?? [], dim);\n }\n const out: string[] = [];\n for (const subject of claim.commitsSince ?? []) out.push(dim(` ${subject}`));\n return [...out, ...capped(diff.split(/\\r?\\n/), dim)];\n}\n\n/** Lines under a row, dim and capped, with a count of the ones left out. */\nfunction capped(lines: readonly string[], dim: (s: string) => string): string[] {\n const shown = lines.slice(0, DIFF_LINE_CAP);\n const out = shown.map((line) => dim(` ${line}`));\n const more = lines.length - shown.length;\n if (more > 0) out.push(dim(` … (${plural(more, \"more line\")})`));\n return out;\n}\n\n/**\n * The line a row sorts on: the marker's line for a marker-anchored entry,\n * else the claim's first file line. That is the line the row opens with, so\n * the claim column climbs down the page. A bare pin anchors nowhere and has\n * none.\n */\nfunction anchorSortLine(result: CitationResult): number | undefined {\n if (result.anchor === \"marker\" && result.markerLine !== undefined) return result.markerLine;\n const first = result.claim?.fileLines?.split(\"-\")[0];\n if (first === undefined) return undefined;\n const line = Number.parseInt(first, 10);\n return Number.isNaN(line) ? undefined : line;\n}\n\n/**\n * A page's citations in the order their rows print: by anchor line, with the\n * bare pins after them in the order the page keeps them. The entries\n * themselves are left alone, so json and the findings keep frontmatter order.\n */\nfunction rowOrder(citations: readonly CitationResult[]): CitationResult[] {\n return [...citations].sort((a, b) => {\n const left = anchorSortLine(a);\n const right = anchorSortLine(b);\n if (left === undefined) return right === undefined ? 0 : 1;\n if (right === undefined) return -1;\n return left - right;\n });\n}\n\n/** One row of a page's citation table, before the columns are padded. */\ninterface Row {\n mark: string;\n label: string;\n claim: string;\n source: string;\n where: string;\n /** Lines printed under the row: findings that are not an end, and diffs. */\n under: string[];\n}\n\n/**\n * The one manifest every citation of a page came from, or `undefined` when\n * the page has none, or when its rows come from more than one place (a\n * frontmatter entry among them counts as another place).\n */\nfunction oneManifest(citations: readonly CitationResult[]): string | undefined {\n const files = new Set(\n citations.map((result) => (result.origin.kind === \"manifest\" ? result.origin.file : undefined)),\n );\n const [only, ...rest] = [...files];\n return rest.length === 0 ? only : undefined;\n}\n\nfunction padTo(text: string, width: number, plain: number): string {\n // Colour codes are not width, so the visible length is passed in.\n return width <= plain ? text : text + \" \".repeat(width - plain);\n}\n\nexport function renderCheckPretty(run: CheckRun, opts: PrettyOptions): string {\n const c = palette(opts.color);\n const lines: string[] = [];\n const quiet = opts.quiet ?? false;\n // A finding about an entry a manifest owns names the manifest, because\n // its line is a line of that file and not of the page above it.\n const location = (finding: CitationFinding): string => {\n const { file, line } = errorSite(finding);\n if (line === undefined) return \"\";\n if (file === undefined) return c.dim(` (line ${String(line)})`);\n return c.dim(` (${file}:${String(line)})`);\n };\n // The rule behind a finding, dim, two spaces deeper than the finding's line.\n const guidance = (finding: CitationFinding, indent: number): string[] =>\n guidanceLines(finding.guidance).map((line) => `${\" \".repeat(indent)}${c.dim(line)}`);\n\n run.pages.forEach((page, index) => {\n const { reported, baselined } = splitBaselined(page, resultFor(run, index));\n const errors = reported.filter((f) => f.severity === \"error\").length;\n const warned = reported.some((f) => f.severity === \"warning\");\n // \"baselined\" is a participle, not a noun: 1 baselined, 2 baselined.\n const forgiven =\n baselined.length > 0 ? c.dim(` (${String(baselined.length)} baselined)`) : \"\";\n // Every row names one manifest: a page's own under `{page}` (proposal\n // 0058), or a shared one. Said once on the page's line, not on each row.\n const manifest = oneManifest(page.citations);\n const heading = manifest === undefined ? page.file : `${page.file} ${c.dim(manifest)}`;\n\n if (reported.length === 0) {\n if (quiet) return;\n lines.push(`${c.green(\"✓\")} ${heading}${forgiven}`);\n } else {\n // The most severe finding marks the file. Only ✗ is a failure.\n const mark = errors > 0 ? c.red(\"✗\") : warned ? c.yellow(\"⚠\") : c.dim(\"ℹ\");\n lines.push(`${mark} ${heading}${forgiven}`);\n }\n\n const isBaselined = new Set(baselined);\n const placed = new Set<CitationFinding>();\n const rows: Row[] = [];\n\n for (const result of rowOrder(page.citations)) {\n const own = page.findings.filter((f) => belongsTo(f, result) && !placed.has(f));\n for (const finding of own) placed.add(finding);\n const live = own.filter((f) => !isBaselined.has(f));\n if (own.length === 0 && quiet) continue;\n const worst =\n live.find((f) => f.severity === \"error\") ??\n live.find((f) => f.severity === \"warning\") ??\n live[0];\n const mark =\n worst !== undefined\n ? severityMark(worst.severity, c)\n : own.length > 0\n ? c.dim(\"·\")\n : result.source.status === \"skipped\" && result.claim === null\n ? c.dim(\"·\")\n : c.green(\"✓\");\n\n // The ends are the row; anything else about the entry is a line under\n // it. A misplaced marker is part of the row too: it reads there as\n // `marker :<line> -> :<place>`.\n const endRules = new Set([\"claim-\", \"source-\", \"marker-misplaced\"]);\n const under: string[] = [];\n for (const finding of own) {\n const isEnd = [...endRules].some((prefix) => finding.rule.startsWith(prefix));\n if (isEnd) {\n // The row says the status; what to do and the rule go under it.\n // finding.message carries the remedy too, for the formats that print\n // one line per finding, but the row prints the status alone, so the\n // remedy is derived here rather than cut back out of the message.\n if (isBaselined.has(finding)) continue;\n const remedy = remedyFor(finding.rule, result);\n if (remedy !== undefined) under.push(` ${remedy}`);\n under.push(...guidance(finding, 6));\n continue;\n }\n const text = isBaselined.has(finding)\n ? c.dim(`${finding.message} (baselined)`)\n : finding.message;\n under.push(` ${severityMark(finding.severity, c)} ${text}${location(finding)}`);\n if (!isBaselined.has(finding)) under.push(...guidance(finding, 8));\n }\n if (opts.showDiff) {\n if (own.some((f) => f.rule === \"source-changed\")) under.push(...diffLines(result, c.dim));\n if (own.some((f) => f.rule === \"claim-changed\" || f.rule === \"claim-reanchored\")) {\n under.push(...claimLines(result, c.dim));\n }\n }\n const forgivenEnd = own.length > 0 && live.length === 0 ? c.dim(\" (baselined)\") : \"\";\n rows.push({\n mark,\n label: labelOf(result),\n claim: claimColumn(result),\n source: `${sourceColumn(result, opts, c.dim)}${forgivenEnd}`,\n where:\n result.origin.kind === \"manifest\" && manifest === undefined\n ? `${result.origin.file}${result.origin.line === undefined ? \"\" : `:${String(result.origin.line)}`}`\n : \"\",\n under,\n });\n }\n\n // Columns are as wide as this page needs them, and no wider.\n const width = (pick: (row: Row) => string): number =>\n rows.reduce((n, row) => Math.max(n, pick(row).length), 0);\n const labelWidth = width((row) => row.label);\n const claimWidth = width((row) => row.claim);\n const anyWhere = rows.some((row) => row.where !== \"\");\n const sourceWidth = anyWhere ? width((row) => row.source) : 0;\n for (const row of rows) {\n const label = padTo(c.cyan(row.label), labelWidth, row.label.length);\n const source = padTo(row.source, sourceWidth, row.source.length);\n const text = ` ${row.mark} ${label} ${padTo(row.claim, claimWidth, row.claim.length)} ${source}${row.where === \"\" ? \"\" : ` ${c.dim(row.where)}`}`;\n lines.push(text.replace(/\\s+$/, \"\"));\n lines.push(...row.under);\n }\n\n // Findings about no entry: a marker naming nothing, a reserved page key.\n for (const finding of page.findings) {\n if (placed.has(finding)) continue;\n const label = c.cyan(labelOfFinding(finding));\n if (isBaselined.has(finding)) {\n lines.push(\n ` ${c.dim(\"·\")} ${label} ${c.dim(`${finding.message} (baselined)`)}${location(finding)}`,\n );\n continue;\n }\n lines.push(` ${severityMark(finding.severity, c)} ${label} ${finding.message}${location(finding)}`);\n lines.push(...guidance(finding, 6));\n }\n });\n\n const { summary } = run;\n const warnings = summary.warnings ?? 0;\n const notices = summary.notices ?? 0;\n const baselined = summary.baseline?.suppressed ?? 0;\n const findings = summary.errors + warnings + notices + baselined;\n const parts = [plural(findings, \"finding\")];\n if (warnings > 0) parts.push(`(${plural(warnings, \"warning\")})`);\n if (notices > 0) parts.push(`(${plural(notices, \"notice\")})`);\n if (baselined > 0) parts.push(`(${String(baselined)} baselined)`);\n const summaryText = `${plural(summary.files, \"file\")} checked, ${String(summary.passed)} passed, ${String(summary.failed)} failed, ${parts.join(\" \")}`;\n if (lines.length > 0) lines.push(\"\");\n lines.push(summary.failed > 0 ? c.red(summaryText) : c.green(summaryText));\n if (summary.baseline?.written) {\n lines.push(c.dim(`Baseline written to ${summary.baseline.path}`));\n }\n return lines.join(\"\\n\");\n}\n\n/** `line 9`, or `lines 9-12`, from a line spec. */\nfunction spellAtSpec(spec: string): string {\n const span = spanOf(spec);\n return span === undefined ? `lines ${spec}` : spellAt(span);\n}\n\n/** A line spec as numbers, or undefined when it does not read as one. */\nfunction spanOf(spec: string): { start: number; end: number } | undefined {\n const [first, second] = spec.split(\"-\");\n const start = Number(first);\n const end = second === undefined ? start : Number(second);\n if (!Number.isFinite(start) || !Number.isFinite(end)) return undefined;\n return { start, end };\n}\n\n/**\n * What a re-pin over the unit newly covers, so the widening is in the log as\n * well as in the diff. A span that only lost marker lines gains nothing, and\n * says that instead.\n */\nfunction widening(held: string, now: string): string {\n const was = spanOf(held);\n const is = spanOf(now);\n if (was === undefined || is === undefined) return \"\";\n const parts: string[] = [];\n if (is.start < was.start) {\n parts.push(spellAt({ start: is.start, end: Math.min(was.start - 1, is.end) }));\n }\n if (is.end > was.end) {\n parts.push(spellAt({ start: Math.max(was.end + 1, is.start), end: is.end }));\n }\n if (parts.length === 0) return \", which held a marker line\";\n return `, ${parts.join(\" and \")} newly pinned`;\n}\n\n/** Whether a re-pin covered a span other than the stored one. */\nfunction widened(rewrite: UpdateRewrite): boolean {\n return (\n rewrite.fromLines !== undefined &&\n rewrite.toLines !== undefined &&\n rewrite.fromLines !== rewrite.toLines\n );\n}\n\n/** `lines 9 -> 9-12` for a re-pin that moved, `at line 9` for one that did not. */\nfunction movedSpan(rewrite: UpdateRewrite): string {\n if (widened(rewrite)) return `lines ${rewrite.fromLines ?? \"\"} -> ${rewrite.toLines ?? \"\"}`;\n const at = rewrite.toLines ?? rewrite.fromLines ?? String(rewrite.at ?? 0);\n return `at ${spellAtSpec(at)}`;\n}\n\n/**\n * What one claim `--accept` refused to re-pin says, and what to do about it.\n * The line names which test refused it: the share is printed when overlap is\n * what fired, and the text is called different when no sentence was shared.\n */\nexport function refusalLine(rewrite: UpdateRewrite): string {\n const at = shortCommit(rewrite.commitSha ?? \"\");\n const where = `claim at ${spellAtSpec(String(rewrite.at ?? 0))} skipped:`;\n if (rewrite.wordShare !== undefined) {\n const share = Math.round(rewrite.wordShare * 100);\n return `${where} that line now holds text sharing ${String(share)}% of the claim's words at ${at}. Re-add it with cite add.`;\n }\n return `${where} that line now holds different text than the claim at ${at}. Re-add it with cite add.`;\n}\n\n/**\n * Why a pin was re-committed, as its row says it. Exhaustive, so a new reason\n * is a type error here rather than a row that quietly reads as the old one. No\n * reason at all is the containment case, which is all `--recommit` once knew.\n */\nfunction recommitWhy(because: RecommitReason | undefined): string {\n switch (because) {\n case \"not-in-history\":\n return \"not in this branch's history\";\n case \"not-contained\":\n case undefined:\n return \"did not contain the pinned lines\";\n }\n}\n\n/** What one rewritten end says it did. */\nexport function rewriteLine(rewrite: UpdateRewrite): string {\n const word = rewrite.from.includes(\"-\") ? \"lines\" : \"line\";\n const status = rewrite.status === \"never-true\" ? \"never true\" : rewrite.status;\n if (rewrite.end === \"marker\") {\n return `marker line ${rewrite.from} -> ${rewrite.to} (misplaced)`;\n }\n // The pin held; only its date was wrong. The row names both commits, so the\n // log says what the entry claimed before it was corrected.\n if (rewrite.reason === \"recommitted\") {\n const from = shortCommit(rewrite.fromCommit ?? \"\");\n const to = shortCommit(rewrite.toCommit ?? \"\");\n return `source ${shortSrc(rewrite.src ?? \"\")} commit ${from} -> ${to} (${recommitWhy(rewrite.because)})`;\n }\n if (rewrite.reason === \"shifted\") {\n return `claim ${word} ${rewrite.from} -> ${rewrite.to} (shifted by a marker)`;\n }\n // The words held while the anchor moved (0053). A claim-lines entry moved\n // onto its new run, so the row names both spans.\n if (rewrite.reason === \"re-anchored\" && rewrite.status === \"reanchored\") {\n const since = rewrite.commitSha === undefined ? \"\" : ` since ${shortCommit(rewrite.commitSha)}`;\n return `claim ${movedSpan(rewrite)} re-pinned (reanchored; words unchanged${since})`;\n }\n if (rewrite.reason === \"re-anchored\") {\n const held = rewrite.lines ?? \"\";\n const now = rewrite.newLines ?? \"\";\n return `claim re-pinned over ${spellAtSpec(now)} (moved; was ${spellAtSpec(held)}${widening(held, now)})`;\n }\n if (rewrite.reason === \"moved\") {\n return rewrite.end === \"claim\"\n ? `claim ${word} ${rewrite.from} -> ${rewrite.to} (moved)`\n : `source ${shortSrc(rewrite.from)} -> ${shortSrc(rewrite.to)} (moved)`;\n }\n if (rewrite.end === \"claim\") {\n // A re-pin over a unit wider than the stored lines names both spans, so\n // the widening is in the log as well as in the diff.\n if (widened(rewrite)) {\n return `claim ${movedSpan(rewrite)} re-pinned (${status}; now \"${rewrite.text ?? \"\"}\")`;\n }\n // A marker anchors its claim, so the marker's line is where the entry is,\n // as `check` reports it. A claim-lines entry reads at the claim.\n const where =\n rewrite.markerLine === undefined\n ? `line ${String(rewrite.at ?? 0)}`\n : `marker line ${String(rewrite.markerLine)}`;\n return `claim at ${where} re-pinned (${status}; now \"${rewrite.text ?? \"\"}\")`;\n }\n const at = rewrite.commitSha === undefined ? \"\" : ` at ${shortCommit(rewrite.commitSha)}`;\n const src = shortSrc(rewrite.src ?? \"\");\n // A re-mint over the span the old first and last line now bracket names both\n // ranges, so the log says which lines were accepted.\n const where = rewrite.toLines === undefined ? src : `${src} -> ${atLines(src, rewrite.toLines)}`;\n return `source ${where} re-pinned${at} (${status}; ${shortPin(rewrite.from)} -> ${shortPin(rewrite.to)})`;\n}\n\n/** The same source spelled at other lines: `path:200-212` and `\"200-215\"` read `path:200-215`. */\nfunction atLines(src: string, lines: string): string {\n const colon = src.lastIndexOf(\":\");\n return `${colon === -1 ? src : src.slice(0, colon)}:${lines}`;\n}\n\nexport function renderUpdatePretty(run: UpdateRun, opts: PrettyOptions): string {\n const c = palette(opts.color);\n const lines: string[] = [];\n let files = 0;\n for (const page of run.pages) {\n if (page.rewritten.length > 0) files += 1;\n if (opts.showDiff && page.diff !== \"\") {\n for (const line of page.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n for (const rewrite of page.rewritten) {\n const label = rewrite.id ?? `#${String(rewrite.index)}`;\n lines.push(`${page.file}: ${c.cyan(label)} ${rewriteLine(rewrite)}`);\n }\n // A claim `--accept` refused reads beside the rewrites, because it is the\n // one row `--accept` was asked for and did not write.\n for (const rewrite of page.refused) {\n const label = rewrite.id ?? `#${String(rewrite.index)}`;\n lines.push(`${page.file}: ${c.cyan(label)} ${refusalLine(rewrite)}`);\n }\n for (const finding of page.skipped) {\n const mark = severityMark(finding.severity, c);\n lines.push(\n `${page.file}: ${c.cyan(labelOfFinding(finding))} ${mark} skipped: ${finding.message}`,\n );\n }\n }\n // The manifests, after the pages: a dry run owes the diff of every file it\n // would have written, and an entry a manifest owns is written there.\n if (opts.showDiff) {\n for (const manifest of run.manifests ?? []) {\n for (const line of manifest.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n }\n const summary = `${plural(run.rewritten, \"citation\")} rewritten in ${plural(files, \"file\")}, ${String(run.skipped)} skipped`;\n lines.push(run.exitCode === 0 ? c.green(summary) : c.red(summary));\n return lines.join(\"\\n\");\n}\n\n/** `line 30`, or `lines 30 and 42` for several, as a sentence reads them. */\nfunction spellLineList(at: readonly number[], noun: string): string {\n // No lines is the noun alone. Every caller has at least one, and a\n // sentence reading \"lines and \" would be the only sign that one did not.\n if (at.length === 0) return noun;\n const spelled = at.map((line) => String(line));\n if (spelled.length === 1) return `${noun} ${spelled[0] ?? \"\"}`;\n const last = spelled[spelled.length - 1] ?? \"\";\n return `${noun}s ${spelled.slice(0, -1).join(\", \")} and ${last}`;\n}\n\n/** What one removal says it did: the entry, where it was kept, and its markers. */\nexport function removalLine(removal: Removal, c: ReturnType<typeof palette>): string {\n const markers = spellLineList(removal.markerLines, \"line\");\n if (removal.origin === undefined) {\n // A marker naming no entry: there is nothing else to report about it.\n const named = removal.markerLines.length === 1 ? \"the marker\" : \"the markers\";\n return `removed ${named} ${c.cyan(removal.id ?? \"\")} at ${markers}, which named no entry`;\n }\n const name = removal.id ?? `/citations/${String(removal.index ?? 0)}`;\n const where =\n removal.origin.kind === \"manifest\"\n ? `${removal.origin.file}${removal.origin.line === undefined ? \"\" : `:${String(removal.origin.line)}`}`\n : \"frontmatter\";\n const also =\n removal.markerLines.length === 0\n ? \"\"\n : `, and ${removal.markerLines.length === 1 ? \"its marker\" : \"its markers\"} at ${markers}`;\n return `removed ${c.cyan(name)} from ${where}${also}`;\n}\n\nexport function renderRemovePretty(run: RemoveRun, opts: PrettyOptions): string {\n const c = palette(opts.color);\n const lines: string[] = [];\n let files = 0;\n for (const page of run.pages) {\n if (page.removed.length > 0) files += 1;\n if (opts.showDiff && page.diff !== \"\") {\n for (const line of page.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n for (const removal of page.removed) {\n lines.push(`${page.file}: ${removalLine(removal, c)}`);\n }\n }\n // The manifests, after the pages, as `update` prints them.\n if (opts.showDiff) {\n for (const manifest of run.manifests ?? []) {\n for (const line of manifest.diff.split(/\\r?\\n/)) {\n if (line !== \"\") lines.push(c.dim(line));\n }\n }\n }\n const verb = opts.dryRun === true ? \"would be removed\" : \"removed\";\n lines.push(c.green(`${plural(run.removed, \"citation\")} ${verb} from ${plural(files, \"file\")}`));\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCO,IAAM,gBAAgB;AAE7B,IAAM,SAAS,CAAC,GAAW,KAAa,OAAO,GAAG,GAAG,QACnD,GAAG,OAAO,CAAC,CAAC,IAAI,MAAM,IAAI,MAAM,IAAI;AAGtC,SAAS,aAAa,UAAuC,GAAuC;AAClG,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,EAAE,IAAI,QAAG;AAAA,IAClB,KAAK;AACH,aAAO,EAAE,OAAO,QAAG;AAAA,IACrB,KAAK;AACH,aAAO,EAAE,IAAI,QAAG;AAAA,EACpB;AACF;AAiBO,SAAS,eACd,MACA,QACe;AACf,MAAI,WAAW,OAAW,QAAO,EAAE,UAAU,CAAC,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,EAAE;AAC/E,QAAM,OAAO,CAAC,GAAG,OAAO,MAAM;AAC9B,QAAM,MAAqB,EAAE,UAAU,CAAC,GAAG,WAAW,CAAC,EAAE;AACzD,aAAW,WAAW,KAAK,UAAU;AACnC,UAAM,eACJ,QAAQ,UAAU,SAAY,KAAK,cAAc,OAAO,QAAQ,KAAK,CAAC;AAGxE,UAAM,OAAO,UAAU,OAAO,EAAE;AAChC,UAAM,KAAK,KAAK;AAAA,MACd,CAAC,MACC,EAAE,YAAY,QAAQ,QACtB,EAAE,iBAAiB,gBACnB,EAAE,YAAY,QAAQ,YACrB,EAAE,QAAQ,WAAW,QAAQ;AAAA,IAClC;AACA,QAAI,OAAO,IAAI;AACb,UAAI,UAAU,KAAK,OAAO;AAAA,IAC5B,OAAO;AACL,WAAK,OAAO,IAAI,CAAC;AACjB,UAAI,SAAS,KAAK,OAAO;AAAA,IAC3B;AAAA,EACF;AACA,SAAO;AACT;AAGO,SAAS,UAAU,KAAe,OAA6C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OAAO,MAAM,CAAC,EAAE,CAAC;AAC9F,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["baselined","where"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
TracevalsError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZINZTHWO.js";
|
|
5
5
|
|
|
6
6
|
// src/tracevals/judge/redact.ts
|
|
7
7
|
var SECRET_NAME = "(?:(?:[A-Za-z0-9]+[_\\-.])*(?:api[_\\-.]?key|access[_\\-.]?key|secret[_\\-.]?key|auth[_\\-.]?token|access[_\\-.]?token|refresh[_\\-.]?token|client[_\\-.]?secret|session[_\\-.]?token|key|token|secret|password|passwd|passphrase|credentials?|authorization)|AWS_[A-Za-z0-9_]+)";
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
MANIFEST_VERSION,
|
|
114
114
|
DEFAULT_CAPTURE_DIR
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-6WJUZQQX.js.map
|
|
@@ -8,27 +8,28 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
matchSections,
|
|
10
10
|
occurrenceRange
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JNMY7KZG.js";
|
|
12
12
|
import {
|
|
13
13
|
LintError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-TKINOTVS.js";
|
|
15
15
|
import {
|
|
16
16
|
REPORT_FORMAT_LIST,
|
|
17
17
|
renderJunit
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3BMTCS4H.js";
|
|
19
19
|
import {
|
|
20
20
|
isErrorSeverity
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BIRGZEWO.js";
|
|
22
22
|
import {
|
|
23
23
|
escapeWorkflowCommandMessage,
|
|
24
|
-
escapeWorkflowCommandProperty
|
|
25
|
-
|
|
24
|
+
escapeWorkflowCommandProperty,
|
|
25
|
+
guidanceLines
|
|
26
|
+
} from "./chunk-QK6VYJHV.js";
|
|
26
27
|
import {
|
|
27
28
|
palette
|
|
28
29
|
} from "./chunk-RNVYGWIC.js";
|
|
29
30
|
import {
|
|
30
31
|
package_default
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-T3BBNLAT.js";
|
|
32
33
|
|
|
33
34
|
// src/lint/core/rule-id.ts
|
|
34
35
|
var RULE_ID_PREFIX = "manni:lint";
|
|
@@ -51,7 +52,10 @@ function toFieldError(finding) {
|
|
|
51
52
|
keyword: `${STRUCTURE_JOB}/${ruleName(finding.type)}`,
|
|
52
53
|
severity: finding.severity,
|
|
53
54
|
line: finding.position.start.line,
|
|
54
|
-
col: finding.position.start.column
|
|
55
|
+
col: finding.position.start.column,
|
|
56
|
+
// What the template asks for, which meta's writer prints in the
|
|
57
|
+
// `<failure>` body, as pretty, GitHub and SARIF print it under the finding.
|
|
58
|
+
guidance: finding.template ?? null
|
|
55
59
|
};
|
|
56
60
|
}
|
|
57
61
|
function toValidationResults(run) {
|
|
@@ -109,7 +113,8 @@ function location(file, root, position) {
|
|
|
109
113
|
};
|
|
110
114
|
}
|
|
111
115
|
function messageText(finding) {
|
|
112
|
-
|
|
116
|
+
const text = finding.heading != null ? `${finding.heading}: ${finding.message}` : finding.message;
|
|
117
|
+
return [text, ...guidanceLines(finding.template)].join("\n");
|
|
113
118
|
}
|
|
114
119
|
function words(id) {
|
|
115
120
|
return id.split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
@@ -152,6 +157,12 @@ function buildRules(run) {
|
|
|
152
157
|
});
|
|
153
158
|
return { descriptors, indexOf };
|
|
154
159
|
}
|
|
160
|
+
function propertiesOf(finding) {
|
|
161
|
+
const properties = {};
|
|
162
|
+
if (finding.heading != null) properties.heading = finding.heading;
|
|
163
|
+
if (finding.template != null) properties.template = finding.template;
|
|
164
|
+
return Object.keys(properties).length > 0 ? properties : void 0;
|
|
165
|
+
}
|
|
155
166
|
function toResult(finding, file, rules, root) {
|
|
156
167
|
return {
|
|
157
168
|
ruleId: ruleId(finding.type),
|
|
@@ -162,7 +173,7 @@ function toResult(finding, file, rules, root) {
|
|
|
162
173
|
level: LEVELS[finding.severity],
|
|
163
174
|
message: { text: messageText(finding) },
|
|
164
175
|
locations: [location(file, root, finding.position)],
|
|
165
|
-
properties: finding
|
|
176
|
+
properties: propertiesOf(finding)
|
|
166
177
|
};
|
|
167
178
|
}
|
|
168
179
|
function buildSkips(run, root) {
|
|
@@ -451,6 +462,8 @@ function renderPretty(run, opts = {}) {
|
|
|
451
462
|
lines.push(
|
|
452
463
|
` ${c.dim(locate(finding))} ${c.cyan(ruleId(finding.type))} ${levelPrefix(c, finding.severity)}${describeFinding(finding)}`
|
|
453
464
|
);
|
|
465
|
+
const indent = " ".repeat(6 + locate(finding).length);
|
|
466
|
+
for (const line of guidanceLines(finding.template)) lines.push(`${indent}${c.dim(line)}`);
|
|
454
467
|
}
|
|
455
468
|
}
|
|
456
469
|
const { checked, passed, failed, skipped } = run.summary;
|
|
@@ -481,7 +494,10 @@ function renderJson(run) {
|
|
|
481
494
|
// like now that `success` means "no error-severity finding" rather than
|
|
482
495
|
// "no findings". Without this key a consumer has no way to tell that
|
|
483
496
|
// apart from an error the JSON shape simply forgot to fail on.
|
|
484
|
-
severity: finding.severity
|
|
497
|
+
severity: finding.severity,
|
|
498
|
+
// Additive: the template that judged the page and the rule this finding
|
|
499
|
+
// is about, or null when no template stands behind it.
|
|
500
|
+
template: finding.template ?? null
|
|
485
501
|
})),
|
|
486
502
|
// Additive, and the one thing this shape could not say. A skipped file is
|
|
487
503
|
// `{success: false, errors: []}`, which is also what a failure whose
|
|
@@ -504,7 +520,9 @@ function renderGithub(run) {
|
|
|
504
520
|
`col=${finding.position.start.column}`,
|
|
505
521
|
`title=${escapeWorkflowCommandProperty(ruleId(finding.type))}`
|
|
506
522
|
];
|
|
507
|
-
const message = escapeWorkflowCommandMessage(
|
|
523
|
+
const message = escapeWorkflowCommandMessage(
|
|
524
|
+
[describeFinding(finding), ...guidanceLines(finding.template)].join("\n")
|
|
525
|
+
);
|
|
508
526
|
lines.push(`::${finding.severity} ${params.join(",")}::${message}`);
|
|
509
527
|
}
|
|
510
528
|
}
|
|
@@ -633,4 +651,4 @@ export {
|
|
|
633
651
|
renderTemplates,
|
|
634
652
|
renderTools
|
|
635
653
|
};
|
|
636
|
-
//# sourceMappingURL=chunk-
|
|
654
|
+
//# sourceMappingURL=chunk-6XFSZCLT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lint/core/rule-id.ts","../src/lint/reporters/junit.ts","../src/lint/reporters/sarif.ts","../src/lint/reporters/alignment.ts","../src/lint/reporters/index.ts"],"sourcesContent":["/**\n * A finding's **rule identity**: `manni:lint/<job>/<rule>`.\n *\n * One id, in one place, for every consumer that files or correlates findings -\n * the SARIF `ruleId`, the JUnit `<failure type>`, the GitHub annotation's\n * `title`, and the `ruleId` the JSON reporter carries beside `type`. A rule id\n * is durable by contract: rename one and every historical alert in a\n * dashboard closes, then reopens as new.\n *\n * Three segments rather than cite's two. The job is what makes a second lint\n * tool possible without collisions: a prose job will report\n * `manni:lint/prose/Google.Passive`, keeping Vale's own rule name because that\n * is the name Vale's documentation uses, and nothing about it can be confused\n * with a structure rule. Proposal 0050 records the shape, and warns that\n * anything parsing family rule ids must not assume two segments.\n *\n * The rule half is derived from the finding's `type` rather than authored\n * beside it. `type` is already the machine-readable name the JSON reporter\n * publishes - manni docevals' grader reads it - so a hand-maintained second\n * table would be one more thing to keep in step, and the derivation cannot\n * drift. `_error` is dropped because it says only that a finding is a finding;\n * `heading_pattern_error` is the rule \"heading-pattern\".\n */\nimport type { LintJob } from \"./config.js\";\n\n/** Every lint rule id starts here. */\nexport const RULE_ID_PREFIX = \"manni:lint\";\n\n/** The tool that performs the structure job, reported beside every finding. */\nexport const TOOL_NAME = \"manni\";\n\n/** The job every finding in this pipeline reports under. */\nexport const STRUCTURE_JOB: LintJob = \"structure\";\n\n/**\n * `heading_pattern_error` -> `heading-pattern`; `parse_error` -> `parse`.\n *\n * Only a trailing `_error` is dropped, so a rule that is genuinely *about*\n * errors keeps the word.\n */\nexport function ruleName(type: string): string {\n return type.replace(/_error$/, \"\").replace(/_/g, \"-\");\n}\n\n/** `manni:lint/<job>/<rule>` for one finding `type`. */\nexport function ruleId(type: string, job: LintJob = STRUCTURE_JOB): string {\n return `${RULE_ID_PREFIX}/${job}/${ruleName(type)}`;\n}\n","/**\n * JUnit XML, rendered through **meta's** writer rather than a second one.\n *\n * There is no authoritative JUnit schema, and the escaping is the part a\n * hand-rolled writer gets wrong - XML 1.0 forbids characters that sit quite\n * happily in a JavaScript string, and one of them makes the whole document\n * unparseable rather than merely mis-rendered. That work is done once, in\n * `src/meta/reporters/junit.ts`, and cite already rides it. So does lint:\n * adapt the run onto meta's `ValidationResult`, hand it to that writer, and\n * the family ships one XML writer, one escaping rule, and one\n * testcase-per-file convention.\n *\n * What is lint's is the two strings that identify the findings as lint's:\n * the `classname` on every `<testcase>`, and the `<failure type>`, which is\n * the namespaced rule id. A finding's template rides along as meta's\n * `guidance`, so each `<failure>` body says what the template asks for.\n */\nimport {\n isErrorSeverity,\n renderJunit as renderJunitXml,\n type FieldError,\n type ValidationResult,\n} from \"../../meta/index.js\";\nimport { RULE_ID_PREFIX, ruleName, STRUCTURE_JOB } from \"../core/rule-id.js\";\nimport type { LintRun } from \"../commands/lint.js\";\n\n/** JUnit `classname` for this tool's findings, as cite's is `manni.cite`. */\nconst JUNIT_CLASSNAME = \"manni.lint\";\n\n/**\n * One finding as a `FieldError`.\n *\n * `schema` and `keyword` are split where they are because meta's `ruleIdFor`\n * joins them with a `/`, and the id it has to produce is\n * `manni:lint/<job>/<rule>`. The prefix is the schema half and stays one\n * segment, which is what keeps it a built-in-shaped ref: a ref containing a\n * slash classifies as a local file, and a caller that passed a path frame\n * would see it rewritten into a relative path. The job and the rule travel\n * together as the keyword.\n *\n * `instancePath` is `\"\"`, the whole document. A structural finding is about a\n * document's shape and not about a pointer into its metadata, so there is no\n * honest pointer to give; meta spells that `(root)`, as it does for its own\n * parse failures. The section the finding is anchored to is already in the\n * message.\n */\nfunction toFieldError(\n finding: LintRun[\"results\"][number][\"findings\"][number],\n): FieldError {\n return {\n schema: RULE_ID_PREFIX,\n instancePath: \"\",\n message:\n finding.heading != null\n ? `${finding.heading}: ${finding.message}`\n : finding.message,\n keyword: `${STRUCTURE_JOB}/${ruleName(finding.type)}`,\n severity: finding.severity,\n line: finding.position.start.line,\n col: finding.position.start.column,\n // What the template asks for, which meta's writer prints in the\n // `<failure>` body, as pretty, GitHub and SARIF print it under the finding.\n guidance: finding.template ?? null,\n };\n}\n\n/**\n * The files this run actually checked, as meta's results.\n *\n * The skipped ones are **not** here, and that is the one place this reporter\n * parts company with the others. A skip has to be reported, or a file nothing\n * looked at is indistinguishable from a file that passed - so pretty says so\n * in words and SARIF files a `toolExecutionNotification`. JUnit has neither:\n * meta's writer emits a testcase or a testcase with a failure, so a skipped\n * file can only arrive as a green test. That is worse than absent. It claims a\n * pass on evidence nobody gathered, and it puts the suite's `tests` count three\n * above the `2 files checked, 3 skipped` the same run prints.\n *\n * So the count here is the run's `checked`, by construction: one testcase per\n * file that was linted.\n */\nexport function toValidationResults(run: LintRun): ValidationResult[] {\n return run.results\n .filter((result) => result.skipped == null)\n .map((result) => ({\n file: result.file,\n // meta's `format` is the extractor that read the file. A lint result does\n // not carry the parser that produced its tree, and no reporter reached\n // through here reads the field, so it names the domain rather than\n // inventing a format the run never recorded.\n format: \"lint\",\n // meta's invariant, not a count: `ok` is \"no error-severity finding\".\n // Read as \"no findings at all\", a file whose only finding is a warning\n // renders as a `✗` through meta's own pretty reporter - which is a\n // legitimate consumer, since this function is exported - while lint's\n // exit code says the run passed.\n ok: !result.findings.some(isErrorSeverity),\n schemas: [RULE_ID_PREFIX],\n errors: result.findings.map(toFieldError),\n }));\n}\n\n/**\n * Straight to meta's JUnit writer rather than through its `render`, which\n * takes a `RunSummary` its junit branch does not forward. Building one here\n * only to have it dropped read as though the suite's counts came from the run,\n * and they do not: they are the length of the list above and how much of it\n * carries an error-severity finding.\n */\nexport function renderJunit(run: LintRun): string {\n return renderJunitXml(toValidationResults(run), {\n classname: JUNIT_CLASSNAME,\n });\n}\n","/**\n * SARIF 2.1.0, the format GitHub code scanning ingests.\n *\n * `github` annotations live and die with one check run: no history, nothing to\n * query, and nothing outside GitHub Actions reads them at all. SARIF is the\n * same findings as a durable artifact - uploaded once, tracked across commits,\n * and understood by every dashboard that speaks the standard.\n *\n * The format's failure mode is silence. A SARIF file with a malformed URI, or\n * with results whose `ruleId` names no declared rule, uploads successfully and\n * then annotates nothing: a green check and an empty dashboard. So the two\n * things most likely to be wrong are the two things this module is most\n * careful about - rule descriptors, and URIs.\n */\nimport type {\n Finding,\n FindingTemplate,\n Position,\n Severity,\n SkipReason,\n} from \"../types.js\";\nimport type { LintFileResult, LintRun } from \"../commands/lint.js\";\nimport { ruleId, ruleName } from \"../core/rule-id.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport {\n artifactLocation,\n fileUri,\n normalizeRoot,\n URI_BASE_ID,\n type ArtifactLocation,\n} from \"../../shared/sarif-location.js\";\n\nconst SARIF_VERSION = \"2.1.0\";\nconst SARIF_SCHEMA =\n \"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json\";\n/**\n * Where code scanning sends someone who clicks \"more information\" on an alert.\n *\n * Deliberately the post-rename URL, which 404s until `doc-structure-lint` is\n * renamed on GitHub - a manual step outside this repo. Pointing it at the\n * current name instead would mean every SARIF report published from the day of\n * the rename onward links somewhere that has moved, and reports outlive the\n * rename; a link that is briefly wrong beats one that is permanently wrong.\n * `package.json`'s `repository` and `bugs` URLs are forward-looking for the\n * same reason, so all three flip together or not at all.\n */\nconst INFORMATION_URI = \"https://github.com/hawkeyexl/manni\";\n\ntype SarifLevel = \"error\" | \"warning\" | \"note\" | \"none\";\n\ninterface SarifMessage {\n text: string;\n}\n\ninterface ReportingDescriptor {\n id: string;\n name: string;\n shortDescription: SarifMessage;\n defaultConfiguration?: { level: SarifLevel };\n}\n\ninterface Region {\n startLine: number;\n startColumn: number;\n endLine: number;\n endColumn: number;\n}\n\ninterface SarifLocation {\n physicalLocation: { artifactLocation: ArtifactLocation; region?: Region };\n}\n\ninterface SarifResult {\n ruleId: string;\n ruleIndex?: number;\n level: SarifLevel;\n message: SarifMessage;\n locations: SarifLocation[];\n properties?: { heading?: string; template?: FindingTemplate };\n}\n\ninterface SarifNotification {\n descriptor: { id: string; index: number };\n level: SarifLevel;\n message: SarifMessage;\n locations: SarifLocation[];\n}\n\ninterface SarifInvocation {\n executionSuccessful: boolean;\n toolExecutionNotifications?: SarifNotification[];\n}\n\ninterface SarifDriver {\n name: string;\n informationUri: string;\n version: string;\n rules: ReportingDescriptor[];\n notifications?: ReportingDescriptor[];\n}\n\ninterface SarifLog {\n $schema: string;\n version: string;\n runs: {\n tool: { driver: SarifDriver };\n originalUriBaseIds: Record<string, { uri: string }>;\n invocations: SarifInvocation[];\n results: SarifResult[];\n }[];\n}\n\nexport interface SarifOptions {\n /**\n * Directory the relative paths in `LintRun` are relative to - the lint run's\n * `cwd`. Defaults to the process cwd, which is what `runLint` itself\n * defaults to. It is a parameter rather than a bare read of `process.cwd()`\n * so the URI mapping, the part most likely to be silently wrong, is testable\n * without moving the whole process into a fixture directory.\n */\n root?: string;\n}\n\n/**\n * The family scale -> SARIF `level`. A total map rather than a ternary, so a\n * fourth severity fails to compile here instead of quietly becoming `error`.\n *\n * The family's three values were chosen to be GitHub's, and SARIF agrees on\n * two of them; it spells the lowest one `note`. meta's reporter folds\n * `notice` onto `note` the same way, so a repository uploading both tools'\n * reports sees one scale. SARIF's `none` has no `Severity` that means it.\n */\nconst LEVELS: Record<Severity, SarifLevel> = {\n notice: \"note\",\n warning: \"warning\",\n error: \"error\",\n};\n\n/**\n * Why a file went unlinted, in words. `Record<SkipReason, ...>` on purpose: a\n * new skip reason should fail to compile until someone has decided what the\n * report says about it.\n */\nconst SKIP_DESCRIPTIONS: Record<SkipReason, string> = {\n \"no-template\": \"File was not linted: no template resolved for it.\",\n \"unsupported-format\": \"File was not linted: no parser handles its format.\",\n unreadable: \"File was not linted: it could not be read.\",\n};\n\n/**\n * Positions map straight across, with no arithmetic.\n *\n * Both sides are 1-based in line and column. Both also treat the end column as\n * exclusive: SARIF defines `endColumn` as \"the column number of the character\n * following the end of the region\", and `Position` in types.ts is documented\n * as a half-open span with `end` exclusive. Checked against what the parser\n * actually emits rather than taken on trust - remark gives `# Hi`, four\n * characters on line 1, an `end.column` of 5, one past the last character,\n * which is precisely SARIF's convention. So no +1 and no -1 in either\n * direction. A zero-width span (`origin()`, used by findings with nowhere\n * better to point) becomes a zero-length region, which SARIF allows.\n */\nfunction region(position: Position): Region {\n return {\n startLine: position.start.line,\n startColumn: position.start.column,\n endLine: position.end.line,\n endColumn: position.end.column,\n };\n}\n\nfunction location(\n file: string,\n root: string,\n position?: Position,\n): SarifLocation {\n return {\n physicalLocation: {\n artifactLocation: artifactLocation(file, root),\n region: position ? region(position) : undefined,\n },\n };\n}\n\n/**\n * The heading goes in the message *and* in `properties`.\n *\n * In the message because most SARIF viewers show the message and nothing else\n * beside the line: \"Expected at least 2 paragraphs, found 1\" is a different\n * sentence depending on which section it is about, and dropping the heading\n * would make the SARIF annotation less informative than the `github` one for\n * the very same finding. In `properties.heading` because a message is prose\n * and nothing can group or filter on it - a consumer asking for \"every finding\n * under Prerequisites\" should not have to parse English back out.\n *\n * Unlike `renderGithub`, newlines are left intact. A workflow command is one\n * line by definition; a SARIF message is a JSON string with no such limit.\n */\nfunction messageText(finding: Finding): string {\n const text =\n finding.heading != null ? `${finding.heading}: ${finding.message}` : finding.message;\n return [text, ...guidanceLines(finding.template)].join(\"\\n\");\n}\n\nfunction words(id: string): string[] {\n return id.split(/[^A-Za-z0-9]+/).filter(Boolean);\n}\n\n/**\n * `missing_section` -> `MissingSection`. SARIF asks a descriptor `name` to be\n * a single Pascal-case identifier, and GitHub shows it in the rule list.\n */\nfunction pascalCase(id: string): string {\n return words(id)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\"\");\n}\n\n/**\n * `missing_section` -> `Missing section`. Derived from the id, not authored:\n * there is no rule catalog to draw a real description from, and the first\n * finding's message describes one occurrence rather than the rule. Restating\n * the id in prose says nothing new, but it beats an empty column in GitHub's\n * rule list and it can never drift out of step with the rule it describes.\n */\nfunction humanize(id: string): string {\n const text = words(id).join(\" \");\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\ninterface RuleIndex {\n descriptors: ReportingDescriptor[];\n indexOf: Map<string, number>;\n}\n\n/**\n * One `reportingDescriptor` per distinct finding type, in order of first\n * appearance.\n *\n * This is not optional decoration. A result carrying a `ruleId` that matches\n * no descriptor is accepted by GitHub code scanning and then rendered without\n * a rule name, a description, or a working filter - the alert arrives stripped\n * of everything that makes a dashboard usable, and with no error to explain\n * why.\n */\nfunction buildRules(run: LintRun): RuleIndex {\n const indexOf = new Map<string, number>();\n const order: string[] = [];\n const severities = new Map<string, Set<Severity>>();\n\n for (const result of run.results) {\n for (const finding of result.findings) {\n let seen = severities.get(finding.type);\n if (!seen) {\n seen = new Set<Severity>();\n severities.set(finding.type, seen);\n indexOf.set(finding.type, order.length);\n order.push(finding.type);\n }\n seen.add(finding.severity);\n }\n }\n\n const descriptors = order.map((type) => {\n // The descriptor id is the **family** rule id, not the internal `type`:\n // it is what an alert is filed and de-duplicated under, and it has to be\n // the string every other reporter uses for the same finding. `name` and\n // `shortDescription` are derived from the rule half alone, so GitHub's\n // rule list reads \"MissingSection\", not \"ManniLintStructureMissingSection\".\n const rule = ruleName(type);\n const descriptor: ReportingDescriptor = {\n id: ruleId(type),\n name: pascalCase(rule),\n shortDescription: { text: humanize(rule) },\n };\n // Only when every finding of this type agreed on a severity. Severity is\n // per finding, not per rule, so a type that appeared as both an error and\n // a warning has no honest default - and every result states its own\n // `level` regardless, which is what a consumer actually reads.\n const [only, ...rest] = [...(severities.get(type) ?? [])];\n if (only !== undefined && rest.length === 0) {\n descriptor.defaultConfiguration = { level: LEVELS[only] };\n }\n return descriptor;\n });\n\n return { descriptors, indexOf };\n}\n\nfunction propertiesOf(finding: Finding): SarifResult[\"properties\"] {\n const properties: NonNullable<SarifResult[\"properties\"]> = {};\n if (finding.heading != null) properties.heading = finding.heading;\n if (finding.template != null) properties.template = finding.template;\n return Object.keys(properties).length > 0 ? properties : undefined;\n}\n\nfunction toResult(\n finding: Finding,\n file: string,\n rules: RuleIndex,\n root: string,\n): SarifResult {\n return {\n ruleId: ruleId(finding.type),\n // Always populated in practice, since the index is built from these same\n // findings. Omitted rather than faked if it ever is not: a wrong index\n // points the alert at somebody else's rule, which is worse than none.\n ruleIndex: rules.indexOf.get(finding.type),\n level: LEVELS[finding.severity],\n message: { text: messageText(finding) },\n locations: [location(file, root, finding.position)],\n properties: propertiesOf(finding),\n };\n}\n\ninterface SkipReport {\n descriptors: ReportingDescriptor[];\n notifications: SarifNotification[];\n}\n\n/**\n * Skipped files become `toolExecutionNotifications`, not results.\n *\n * They cannot simply be dropped - the pretty reporter's rule applies here too:\n * a file that leaves no trace in the report is indistinguishable from a file\n * that passed, and a docset mid-onboarding is mostly unrouted pages. Reading\n * that as a clean bill of health is the exact failure this format exists to\n * prevent.\n *\n * They are not results either. A result is a statement about the content of a\n * document; a skip is a statement about the tool, which declined to look. As\n * results they would open code-scanning alerts against files nothing has\n * examined, and each of those would then have to be triaged and dismissed by\n * hand. `toolExecutionNotifications` is the slot SARIF defines for \"the tool\n * has something to say about its own execution\", which is what a skip is.\n *\n * Level `note` rather than SARIF's default of `warning`: on a repository that\n * has not adopted doctypes yet nearly every page is skipped, and a warning\n * stream that long is one nobody reads.\n */\nfunction buildSkips(run: LintRun, root: string): SkipReport {\n const indexOf = new Map<string, number>();\n const descriptors: ReportingDescriptor[] = [];\n const notifications: SarifNotification[] = [];\n\n for (const result of run.results) {\n const reason = result.skipped;\n if (reason == null) continue;\n\n let index = indexOf.get(reason);\n if (index === undefined) {\n index = descriptors.length;\n indexOf.set(reason, index);\n descriptors.push({\n id: reason,\n name: pascalCase(reason),\n shortDescription: { text: SKIP_DESCRIPTIONS[reason] },\n });\n }\n\n notifications.push({\n // Declared in `tool.driver.notifications` and referenced by id *and*\n // index, for the same reason results reference their rules both ways.\n descriptor: { id: reason, index },\n level: \"note\",\n message: { text: skipMessage(result, reason) },\n locations: [location(result.file, root)],\n });\n }\n\n return { descriptors, notifications };\n}\n\n/** The specific reason when the run recorded one, the generic one otherwise. */\nfunction skipMessage(result: LintFileResult, reason: SkipReason): string {\n return result.reason ?? SKIP_DESCRIPTIONS[reason];\n}\n\nexport function renderSarif(run: LintRun, opts: SarifOptions = {}): string {\n const root = normalizeRoot(opts.root ?? process.cwd());\n const rules = buildRules(run);\n const skips = buildSkips(run, root);\n\n const results = run.results.flatMap((result) =>\n result.findings.map((finding) =>\n toResult(finding, result.file, rules, root),\n ),\n );\n\n const driver: SarifDriver = {\n name: \"manni-lint\",\n informationUri: INFORMATION_URI,\n version: pkg.version,\n // Emitted even when empty: results point into this array, so a consumer\n // always looks here, and a stable shape is cheaper than a special case.\n rules: rules.descriptors,\n notifications: skips.descriptors.length > 0 ? skips.descriptors : undefined,\n };\n\n const invocation: SarifInvocation = {\n // Findings are the tool doing its job, not failing at it. This would only\n // be false if manni lint itself could not run, and that path exits 2\n // before any report is rendered.\n executionSuccessful: true,\n toolExecutionNotifications:\n skips.notifications.length > 0 ? skips.notifications : undefined,\n };\n\n const log: SarifLog = {\n $schema: SARIF_SCHEMA,\n version: SARIF_VERSION,\n runs: [\n {\n tool: { driver },\n // Declared unconditionally: it is what makes every relative `uri` in\n // this report mean anything, and a reader should not have to infer the\n // base from whether some result happened to use it.\n originalUriBaseIds: { [URI_BASE_ID]: { uri: fileUri(root) } },\n invocations: [invocation],\n results,\n },\n ],\n };\n\n return JSON.stringify(log, null, 2);\n}\n","/**\n * The alignment block `--explain` prints under each routed file: which rule\n * claimed which section, and why. It is lint's answer to \"why did it say\n * that\" for the matcher in `core/match.ts` - proposal 0061's stress test 3\n * names this as the cost of an alignment matcher over a left-to-right one: a\n * tie is invisible unless something prints the pairing it chose.\n *\n * This module recomputes the alignment itself by calling the matcher's own,\n * already-exported `matchSections` - it does not reach into `align()`'s\n * internal step sequence, which is module-private. That has one visible\n * consequence: this file has no way to know the *document position* a missing\n * rule or an unexpected section falls at relative to the other, so a missing\n * rule is placed among the sections that did match using rule order alone\n * (`insertMissing` below), which is exact whenever - as in every template this\n * repository ships - the missing rule is not sandwiched between two unexpected\n * sections with nothing matched between them. `core/match.ts` is read-only\n * from here; exporting the step sequence, if this ever needs to be exact, is a\n * change to that file rather than to this one.\n *\n * The other thing this module cannot get from an export: which key in a\n * page's frontmatter is its title. It assumes `title`, the same key\n * `manni meta`'s own schemas require, and re-reads `tree.frontmatter`\n * directly rather than asking a caller to resolve it, so the assumption lives\n * in exactly one place.\n *\n * **The seam this depends on.** `commands/lint.ts` parses every file and\n * loads its template before `--explain` returns - both already exist at that\n * point in `lintOne` - but neither is currently attached to the\n * `LintFileResult` it returns. `render()` (`reporters/index.ts`) reads them\n * off a result through `ExplainSource`, structurally: a result carrying\n * `tree` and `template` gets an alignment block, and one that does not is\n * printed exactly as before. Wiring `commands/lint.ts` to attach them is\n * outside this chunk's files (`src/lint/commands/lint.ts` is not among them).\n */\nimport { LintError, type DocumentTree, type SectionNode } from \"../types.js\";\nimport { matchSections, type Match } from \"../core/match.js\";\nimport { occurrenceRange, type Rule, type Template } from \"../core/template.js\";\n\n/** What a caller must attach to a `LintFileResult` for the block to render. */\nexport interface ExplainSource {\n tree: DocumentTree;\n template: Template;\n}\n\n/** One line of the block, before indentation is joined on. */\nexport interface AlignmentRow {\n depth: number;\n text: string;\n}\n\nconst LABEL_WIDTH = 22;\nconst ARROW = \"←\"; // ←\nconst ELLIPSIS = \"…\"; // …\nconst TIMES = \"×\"; // ×\n\nfunction pad(label: string): string {\n return label.length >= LABEL_WIDTH ? `${label} ` : label.padEnd(LABEL_WIDTH + 1);\n}\n\n/** A section's title, quoted, or `(no heading)` for one that has none. */\nfunction titleText(title: string | null): string {\n return title === null ? \"(no heading)\" : `\"${title}\"`;\n}\n\n/**\n * A rule's display name: its `id` where it has one, else a literal string\n * `heading`, else `(any)` for anything else - an array, a `{ pattern }`,\n * `heading: false`, or a bare wildcard. Mirrors the priority `--explain`'s\n * spec states, which is not the same order `missingMessage` in `match.ts`\n * uses for its prose: that picks the heading first because it is read as a\n * sentence, and this picks the id first because it is a column header.\n */\nfunction ruleLabel(rule: Rule): string {\n if (rule.id !== undefined) return rule.id;\n if (typeof rule.heading === \"string\") return rule.heading;\n return \"(any)\";\n}\n\n/**\n * The page's own heading, and the note explaining where it came from.\n *\n * Mirrors `validator.ts`'s private `pageSection`: a lone top-level heading\n * *is* the page. Most of the time that heading is not literal, though - every\n * parser with both frontmatter and headings (`parsers/metadata.ts`'s\n * `withMetadataTitle`) already synthesizes an H1 from `frontmatter.title` when\n * the body has none, positioned on the frontmatter block itself, precisely so\n * a template written against \"the page's title is its outermost rule\" does\n * not have to know the difference. By the time a tree reaches here that\n * difference is gone from the section's own fields - so it is recovered the\n * same way `titlePosition` was set: a synthesized heading's position is\n * `tree.frontmatterPosition`, verbatim.\n *\n * `frontmatter.title` is read directly only as a fallback, for a tree a\n * caller built by some other means - the programmatic API accepts one from\n * anywhere - where no such synthesis ran at all.\n */\nfunction pageHeading(tree: DocumentTree): { text: string | null; note: string | null } {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) {\n const text = only.title || null;\n if (text === null) return { text: null, note: \"no heading\" };\n const synthesized =\n only.titlePosition !== null &&\n tree.frontmatterPosition !== null &&\n only.titlePosition.start.offset === tree.frontmatterPosition.start.offset &&\n only.titlePosition.end.offset === tree.frontmatterPosition.end.offset;\n return { text, note: synthesized ? \"synthesized from frontmatter\" : null };\n }\n const raw = tree.frontmatter?.[\"title\"];\n const text = typeof raw === \"string\" && raw !== \"\" ? raw : null;\n return { text, note: text === null ? \"no heading\" : \"synthesized from frontmatter\" };\n}\n\n/** The sections a template's `sections:` rules describe - `pageSection`'s subject. */\nfunction pageSections(tree: DocumentTree): SectionNode[] {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) return only.sections;\n return tree.sections;\n}\n\n/**\n * One matched or collapsed run of matches, rendered as a single row.\n *\n * Both call sites build `run` by pushing one already-known `Match` before\n * ever calling this, so it is never empty; the guard below exists to let the\n * checker see that rather than to handle a real empty-run case.\n */\nfunction matchedRow(depth: number, run: Match[]): AlignmentRow {\n const head = run[0];\n if (!head) return { depth, text: `${pad(\"(empty run)\")}${ARROW} (missing)` };\n const rule = head.rule;\n const first = head.section;\n const last = (run[run.length - 1] ?? head).section;\n const label = run.length === 1 ? ruleLabel(rule) : `${ruleLabel(rule)} ${TIMES}${run.length}`;\n // Coercion can only ever land on a run of length 1: `ALIGNMENT_COSTS.coerce`\n // is open only to a required occurrence whose `max` is 1 (`match.ts`'s\n // header explains why), and a rule with `max: 1` can never contribute a\n // second match to a run.\n const coerced = run.length === 1 && head.coerced ? \" (coerced)\" : \"\";\n const arrow =\n run.length === 1\n ? `${titleText(first.title || null)}${coerced}`\n : `${titleText(first.title || null)} ${ELLIPSIS} ${titleText(last.title || null)}`;\n return { depth, text: `${pad(label)}${ARROW} ${arrow}` };\n}\n\n/**\n * What an absent rule is called.\n *\n * `(missing)` means exactly what produces a `missing_section` finding, so it\n * is reserved for a rule that had to appear. An optional rule that took\n * nothing is `(none)`: absent, and fine. Sharing one word made a page that\n * lints clean print a row saying something was missing from it, which is the\n * opposite of what `--explain` is for.\n */\nfunction absentLabel(rule: Rule): string {\n return occurrenceRange(rule).min > 0 ? \"(missing)\" : \"(none)\";\n}\n\n/** A rule with nothing to show, or a `repeat` group with nothing at all. */\nfunction missingRows(depth: number, rule: Rule): AlignmentRow[] {\n if (!rule.repeat) {\n return [{ depth, text: `${pad(ruleLabel(rule))}${ARROW} ${absentLabel(rule)}` }];\n }\n // A group's members inherit the group's own occurrence: a member of an\n // optional group is not missing when the whole group never ran.\n const label = absentLabel(rule);\n const rows: AlignmentRow[] = [{ depth, text: pad(rule.id ?? \"(repeat)\").trimEnd() }];\n for (const member of rule.repeat) {\n rows.push({ depth: depth + 1, text: `${pad(ruleLabel(member))}${ARROW} ${label}` });\n }\n return rows;\n}\n\n/**\n * Insert `missing`, each tagged with the index of the rule it is about, among\n * `matched` entries tagged the same way (`null` for one that has no rule -\n * an unexpected section). A missing rule never displaces an unexpected\n * section: only a matched entry's index gates it, so an unexpected section is\n * carried along in whichever position document order already put it in.\n */\nfunction insertMissing(\n matched: { index: number | null; rows: AlignmentRow[] }[],\n missing: { index: number; rows: AlignmentRow[] }[],\n): AlignmentRow[] {\n const out: AlignmentRow[] = [];\n let mi = 0;\n for (const entry of matched) {\n while (mi < missing.length) {\n // `mi < missing.length` just guarded this, so `next` is always here;\n // the check only lets the type checker see the invariant the loop\n // bound already established.\n const next = missing[mi];\n if (!next || (entry.index !== null && next.index >= entry.index)) break;\n out.push(...next.rows);\n mi++;\n }\n out.push(...entry.rows);\n }\n while (mi < missing.length) {\n const next = missing[mi];\n if (!next) break;\n out.push(...next.rows);\n mi++;\n }\n return out;\n}\n\n/**\n * One level: `rules` against `sections`, and every matched pair's own\n * subsections.\n *\n * A `repeat` member's `Match.rule` is the member itself, never the group\n * (`match.ts`'s `compile` only ever assigns an occurrence to a leaf rule), so\n * a group is never a key in `matches`. `rootOf` recovers \"which top-level\n * rule is this a member of\" - itself, for a rule with no group - which is\n * what lets a group be judged matched or missing as one thing while still\n * naming which of its members carried the section.\n */\nfunction alignLevel(\n rules: Rule[] | undefined,\n sections: SectionNode[],\n parent: SectionNode | null,\n depth: number,\n): AlignmentRow[] {\n // `undefined` is the template saying nothing about this level - silence,\n // not \"no sections allowed\" - so there is nothing to align and nothing to\n // print. `matchSections` draws the same line; this mirrors it rather than\n // passing `[]` through, which would turn silence into every section here\n // reading as unexpected.\n if (rules === undefined) return [];\n\n const { matches } = matchSections(sections, rules, { parent });\n const ruleIndex = new Map<Rule, number>(rules.map((r, i) => [r, i]));\n const rootOf = new Map<Rule, Rule>();\n for (const rule of rules) {\n if (rule.repeat) for (const member of rule.repeat) rootOf.set(member, rule);\n else rootOf.set(rule, rule);\n }\n const rootOfRule = (rule: Rule): Rule => rootOf.get(rule) ?? rule;\n const matchedRoots = new Set(matches.map((m) => rootOfRule(m.rule)));\n const bySection = new Map<SectionNode, Match>(matches.map((m) => [m.section, m]));\n\n const matched: { index: number | null; rows: AlignmentRow[] }[] = [];\n let i = 0;\n while (i < sections.length) {\n // `i < sections.length` just guarded this; `section` always exists.\n const section = sections[i];\n if (!section) break;\n const match = bySection.get(section);\n if (!match) {\n matched.push({\n index: null,\n rows: [{ depth, text: `(unexpected) ${titleText(section.title || null)}` }],\n });\n i++;\n continue;\n }\n\n const root = rootOfRule(match.rule);\n if (root.repeat) {\n // Every section, in this run, that belongs to this same group - by\n // whichever member took it, not necessarily the same one twice.\n const taken: Match[] = [];\n while (i < sections.length) {\n const here = sections[i];\n if (!here) break;\n const next = bySection.get(here);\n if (!next || rootOfRule(next.rule) !== root) break;\n taken.push(next);\n i++;\n }\n const rows: AlignmentRow[] = [{ depth, text: pad(root.id ?? \"(repeat)\").trimEnd() }];\n let run: Match[] = [];\n const flushMember = (): void => {\n if (run.length === 0) return;\n rows.push(matchedRow(depth + 1, run));\n for (const m of run) {\n rows.push(...alignLevel(m.rule.sections, m.section.sections, m.section, depth + 2));\n }\n run = [];\n };\n for (const m of taken) {\n const first = run[0];\n if (first && first.rule !== m.rule) flushMember();\n run.push(m);\n }\n flushMember();\n // A member this occurrence never reached prints missing beside the\n // members it did, the same information `missingRows` gives a group with\n // nothing at all.\n const takenMembers = new Set(taken.map((m) => m.rule));\n for (const member of root.repeat) {\n if (takenMembers.has(member)) continue;\n rows.push({ depth: depth + 1, text: `${pad(ruleLabel(member))}${ARROW} (missing)` });\n }\n matched.push({ index: ruleIndex.get(root) ?? null, rows });\n continue;\n }\n\n // A plain rule: gather the run of consecutive sections it claimed.\n const run: Match[] = [match];\n i++;\n while (i < sections.length) {\n const here = sections[i];\n if (!here) break;\n const next = bySection.get(here);\n if (!next || next.rule !== match.rule) break;\n run.push(next);\n i++;\n }\n const rows = [matchedRow(depth, run)];\n for (const m of run) {\n rows.push(...alignLevel(m.rule.sections, m.section.sections, m.section, depth + 1));\n }\n matched.push({ index: ruleIndex.get(match.rule) ?? null, rows });\n }\n\n const missing = rules\n .filter((rule) => !matchedRoots.has(rule))\n .map((rule) => {\n const index = ruleIndex.get(rule);\n if (index === undefined) {\n // `ruleIndex` is built from this exact `rules` array above, so every\n // rule reached here (it came from filtering `rules` itself) has an\n // entry; this is unreachable.\n //\n // `LintError` rather than `Error` even so. Everything this tool throws\n // is caught by the bin runner and exits 2, an operational error; a bare\n // `Error` would escape that and exit 1, which means \"the documents have\n // findings\". An internal fault must never be reported as a lint result.\n throw new LintError(\"alignLevel: rule missing from its own index\");\n }\n return { index, rows: missingRows(depth, rule) };\n });\n\n return insertMissing(matched, missing);\n}\n\n/** The full alignment block for one file: the page row, then its sections. */\nexport function explainAlignment(tree: DocumentTree, template: Template): AlignmentRow[] {\n const heading = pageHeading(tree);\n const arrow =\n heading.text !== null\n ? `${titleText(heading.text)}${heading.note ? ` (${heading.note})` : \"\"}`\n : `(${heading.note ?? \"no heading\"})`;\n const rows: AlignmentRow[] = [{ depth: 0, text: `${pad(\"(page)\")}${ARROW} ${arrow}` }];\n rows.push(...alignLevel(template.sections, pageSections(tree), null, 1));\n return rows;\n}\n\n/** `AlignmentRow[]` as the indented text `renderExplain` prints, two spaces per depth. */\nexport function formatAlignment(rows: AlignmentRow[]): string[] {\n return rows.map((row) => `${\" \".repeat(row.depth)}${row.text}`);\n}\n","/**\n * Reporters render a run to a string. The CLI writes the result to stdout;\n * diagnostics go to stderr separately, so a report is never interleaved with\n * anything a consumer has to parse around.\n */\nimport { LintError, type Finding } from \"../types.js\";\nimport type { LintFileResult, LintRun } from \"../commands/lint.js\";\nimport type { FormatInfo, ToolInfo } from \"../commands/tools.js\";\nimport type { TemplateInfo, TemplatesInfo } from \"../commands/templates.js\";\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport {\n escapeWorkflowCommandMessage,\n escapeWorkflowCommandProperty,\n} from \"../../shared/github.js\";\nimport type { ReportFormat as FamilyFormat } from \"../../meta/index.js\";\nimport { REPORT_FORMAT_LIST } from \"../../meta/internal.js\";\nimport { ruleId, TOOL_NAME } from \"../core/rule-id.js\";\nimport { renderJunit } from \"./junit.js\";\nimport { renderSarif } from \"./sarif.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport { explainAlignment, formatAlignment, type ExplainSource } from \"./alignment.js\";\n\nexport { renderJunit, toValidationResults } from \"./junit.js\";\n\n/**\n * Every `-f` value, plus `--explain`.\n *\n * The findings formats are the family's, taken from meta rather than restated,\n * so a format added there is available here the moment lint's `render` grows a\n * case for it - and a value lint does not handle is a compile error instead of\n * a silent fall-through to pretty. `explain` is lint's own: it is reachable\n * through `--explain` and never through `-f`, because it reports on\n * configuration rather than on documents.\n */\nexport type ReportFormat = FamilyFormat | \"explain\";\n\n/** Listing commands have nothing to annotate, so they offer no `github`. */\nexport type ListFormat = \"pretty\" | \"json\";\n\nexport interface ReportOptions {\n color?: boolean;\n /**\n * Directory the run's relative paths are relative to, forwarded to the SARIF\n * reporter and ignored by the others. Defaults to the process cwd, which is\n * right for the CLI because `runLint` defaults its `cwd` the same way.\n *\n * It is here rather than only on `renderSarif` because `render` is the entry\n * point a library caller reaches for, and without it that caller was pinned\n * to the process cwd with no way out short of bypassing `render` entirely -\n * for the one reporter whose whole output is paths.\n */\n root?: string;\n}\n\nfunction plural(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? \"\" : \"s\"}`;\n}\n\n/** `line:column` of a finding, the anchor an editor can jump to. */\nfunction locate(finding: Finding): string {\n return `${finding.position.start.line}:${finding.position.start.column}`;\n}\n\n/** A finding as prose: the heading it is about, then what is wrong with it. */\nfunction describeFinding(finding: Finding): string {\n return finding.heading != null\n ? `${finding.heading}: ${finding.message}`\n : finding.message;\n}\n\n/**\n * A finding's level prefix, meta's shape: nothing for an error, since the\n * `✗`/`✓` mark already says that; the word itself, coloured, for anything\n * milder. Keeps a passing file's warning from reading as just another\n * anonymous line once it is printed beside real errors on a failing one.\n */\nfunction levelPrefix(c: Colors, severity: Finding[\"severity\"]): string {\n if (severity === \"error\") return \"\";\n return `${severity === \"notice\" ? c.dim(\"notice\") : c.yellow(\"warning\")} `;\n}\n\nexport function renderPretty(run: LintRun, opts: ReportOptions = {}): string {\n const c = palette(opts.color ?? false);\n const lines: string[] = [];\n let warnings = 0;\n let notices = 0;\n\n for (const result of run.results) {\n // A skip is reported, never silently dropped: an unreadable format that\n // leaves no trace is indistinguishable from a file that passed.\n if (result.skipped != null) {\n const why = result.reason ?? result.skipped;\n lines.push(`${c.yellow(\"-\")} ${result.file} ${c.dim(`skipped: ${why}`)}`);\n continue;\n }\n if (result.success && result.findings.length === 0) {\n lines.push(`${c.green(\"✓\")} ${result.file}`);\n continue;\n }\n // `success` means \"no error-severity finding\", not \"no findings\" - a\n // passing file can still hold a warning, such as\n // `unsupported_content_kind`. Reusing `✓` for it would hide the warning\n // behind the same glyph a clean file gets; reusing `✗` would fail a file\n // nothing actually failed. `⚠` (meta's and cite's mark for the same case)\n // says \"passing, but read this\" without claiming either extreme.\n const mark = result.success ? c.yellow(\"⚠\") : c.red(\"✗\");\n lines.push(`${mark} ${result.file}`);\n for (const finding of result.findings) {\n // Counted apart, because they are not the same thing to a reader. Every\n // structure finding used to be an `error` or the occasional `warning`,\n // so \"not an error\" and \"a warning\" were the same set. DITA-OT reports an\n // undefined key reference at `notice`, and calling that a warning on the\n // summary line overstates it.\n if (finding.severity === \"warning\") warnings++;\n else if (finding.severity === \"notice\") notices++;\n // The namespaced id rather than the bare `type`: it is what SARIF,\n // JUnit and the GitHub annotation file the finding under, so the string\n // a reader copies out of the terminal is the one they can search for.\n lines.push(\n ` ${c.dim(locate(finding))} ${c.cyan(ruleId(finding.type))} ` +\n `${levelPrefix(c, finding.severity)}${describeFinding(finding)}`,\n );\n // What the template asks for, under the rule id it explains.\n const indent = \" \".repeat(6 + locate(finding).length);\n for (const line of guidanceLines(finding.template)) lines.push(`${indent}${c.dim(line)}`);\n }\n }\n\n const { checked, passed, failed, skipped } = run.summary;\n // Named only when there are any, as meta and cite do: every run against a\n // format that reports every content kind has none.\n const warningsText = warnings > 0 ? `, ${plural(warnings, \"warning\")}` : \"\";\n const noticesText = notices > 0 ? `, ${plural(notices, \"notice\")}` : \"\";\n const summary = `${plural(checked, \"file\")} checked, ${passed} passed, ${failed} failed, ${skipped} skipped${warningsText}${noticesText}`;\n if (lines.length > 0) lines.push(\"\");\n lines.push(failed > 0 ? c.red(summary) : c.green(summary));\n return lines.join(\"\\n\");\n}\n\n/**\n * The published JSON shape, and the reason this builds objects by hand rather\n * than stringifying `run.results` directly.\n *\n * manni docevals reads `[{ file, success, errors: [{ type, heading, message,\n * position: { start: { line, column } } }] }]` off stdout, and it parses\n * rather than validates - a renamed key produces zero findings, not an error.\n * So: a bare array at the top level, and `errors`, even though the internal\n * field is `findings`. Adding keys is safe; renaming or nesting is not.\n */\nexport function renderJson(run: LintRun): string {\n const results = run.results.map((result) => ({\n file: result.file,\n success: result.success,\n errors: result.findings.map((finding) => ({\n type: finding.type,\n // Additive, and deliberately beside `type` rather than instead of it.\n // `ruleId` is the family id every other reporter files this finding\n // under; `tool` names which tool produced it, the question a second\n // lint job makes worth asking.\n ruleId: ruleId(finding.type),\n tool: TOOL_NAME,\n heading: finding.heading,\n message: finding.message,\n position: finding.position,\n // Additive too, and the reason it has to be: `success: true` beside a\n // non-empty `errors` array is exactly what a warning-only file looks\n // like now that `success` means \"no error-severity finding\" rather than\n // \"no findings\". Without this key a consumer has no way to tell that\n // apart from an error the JSON shape simply forgot to fail on.\n severity: finding.severity,\n // Additive: the template that judged the page and the rule this finding\n // is about, or null when no template stands behind it.\n template: finding.template ?? null,\n })),\n // Additive, and the one thing this shape could not say. A skipped file is\n // `{success: false, errors: []}`, which is also what a failure whose\n // finding vanished looks like - so a consumer counting failures counted a\n // file nothing read as a file that was read and found wanting. Null rather\n // than absent, because a key that comes and goes makes \"not skipped\" and\n // \"an older manni\" the same observation. The prose `reason` stays off the\n // wire; it is a diagnostic for the pretty and SARIF reports.\n skipped: result.skipped ?? null,\n }));\n return JSON.stringify(results, null, 2);\n}\n\n/**\n * GitHub workflow commands: one annotation per finding, shaped as cite's are -\n * `::<severity> file=…,line=…,col=…,title=<ruleId>::<message>`.\n *\n * The rule id is a `title=` property rather than a `[type]` prefix inside the\n * message. GitHub renders the title as the alert's own heading, so the prefix\n * spelled the rule's name a second time; and `title` is the field a reader can\n * group and filter on, which prose can never be.\n *\n * The level is the severity, not a constant `error`. The family scale was\n * chosen to be GitHub's for exactly this: `::warning` and `::notice` render\n * inline like `::error` but do not fail the check, which is the severity\n * invariant in GitHub's terms, and it is load-bearing rather than theoretical:\n * `unsupported_content_kind` is a `warning`, so it annotates the file without\n * failing the job.\n *\n * Line breaks are escaped rather than collapsed to spaces, as this once did.\n * `%0A` is the format's own answer and GitHub renders it as a multi-line\n * annotation, so the message arrives whole; collapsing threw away the author's\n * line breaks to solve a problem the escape already solves, and its `\\r?\\n`\n * pattern let a bare carriage return through into the command untouched.\n *\n * The escaping itself is the family's, from `src/shared/github.ts`. It lives\n * there precisely so a second renderer cannot re-derive it: the replacements\n * are order-dependent (`%` first, or the escape sequences get escaped again),\n * and a local copy that got the order wrong would look identical in review and\n * only show itself on a message carrying a literal `%`.\n */\nexport function renderGithub(run: LintRun): string {\n const lines: string[] = [];\n for (const result of run.results) {\n for (const finding of result.findings) {\n const params = [\n `file=${escapeWorkflowCommandProperty(result.file)}`,\n `line=${finding.position.start.line}`,\n `col=${finding.position.start.column}`,\n `title=${escapeWorkflowCommandProperty(ruleId(finding.type))}`,\n ];\n const message = escapeWorkflowCommandMessage(\n [describeFinding(finding), ...guidanceLines(finding.template)].join(\"\\n\"),\n );\n lines.push(`::${finding.severity} ${params.join(\",\")}::${message}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * `--explain`: the resolution chain per file, rather than findings.\n *\n * Printing every stage, including the ones that had nothing to say, is the\n * point. \"Which template linted this page?\" is usually asked because the answer\n * was surprising, and the surprising part is almost always a stage the reader\n * forgot applies - a stray `$template`, an override glob matching more than\n * intended. A report that showed only the winning stage would hide exactly the\n * thing being looked for.\n */\n/**\n * The alignment block riding on a result. `commands/lint.ts` attaches the tree\n * and the loaded template under `alignment` when `--explain` asked for them,\n * and only for a file that routed; a result without it prints as it always did.\n *\n * It is a nested key rather than two flat ones because `template` at the top\n * level is already the template's *ref*, the string the routing line shows.\n */\nfunction alignmentFor(result: LintFileResult): string[] | null {\n const source: ExplainSource | undefined = result.alignment;\n if (!source) return null;\n return formatAlignment(explainAlignment(source.tree, source.template));\n}\n\nexport function renderExplain(run: LintRun, opts: ReportOptions = {}): string {\n const c = palette(opts.color ?? false);\n const lines: string[] = [];\n\n for (const result of run.results) {\n // Not the pass/fail glyphs: `--explain` reports whether a page was routed,\n // and a routed page may still be full of findings. Reusing the tick would\n // read as a clean bill of health for a document nothing has looked at yet.\n const chosen = result.template;\n lines.push(`${chosen ? c.cyan(\"▸\") : c.dim(\"-\")} ${c.bold(result.file)}`);\n\n const steps = result.resolution?.steps ?? [];\n if (steps.length === 0) {\n lines.push(` ${c.dim(\"(no resolution recorded)\")}`);\n }\n for (const step of steps) {\n const mark = step.ref ? c.green(\"→\") : c.dim(\"·\");\n const label = step.ref ? c.bold(step.ref) : c.dim(step.detail);\n const suffix = step.ref ? ` ${c.dim(step.detail)}` : \"\";\n lines.push(` ${mark} ${step.stage.padEnd(20)} ${label}${suffix}`);\n }\n\n const alignment = chosen ? alignmentFor(result) : null;\n if (alignment && alignment.length > 0) {\n lines.push(` ${c.dim(\"alignment\")}`);\n for (const row of alignment) lines.push(` ${row}`);\n }\n\n const cause = result.resolution?.cause;\n if (cause === \"unknown-type\") {\n const type = result.resolution?.unknownType ?? \"(none recorded)\";\n const near = result.resolution?.suggestions ?? [];\n const known = result.resolution?.knownTypes ?? [];\n // The same fallback the pretty reporter gives. Without it a typo with no\n // near miss - which is most of them, since a near miss needs the typo to\n // be close - printed the failure and nothing to act on, while the plain\n // lint output for that page listed every doctype available.\n const hint = near.length\n ? `; did you mean ${near.join(\", \")}?`\n : known.length\n ? `; known doctypes: ${known.join(\", \")}`\n : \"\";\n lines.push(` ${c.red(\"✗\")} no template serves type \"${type}\"${hint}`);\n } else if (cause === \"no-type\") {\n lines.push(` ${c.dim(\"skipped: the page declares no type\")}`);\n }\n lines.push(\"\");\n }\n\n const routed = run.results.filter((r) => r.template != null).length;\n lines.push(\n `${run.results.length} file${run.results.length === 1 ? \"\" : \"s\"}, ` +\n `${routed} routed, ${run.results.length - routed} unrouted`,\n );\n return lines.join(\"\\n\");\n}\n\nexport function render(\n run: LintRun,\n format: ReportFormat,\n opts: ReportOptions = {},\n): string {\n switch (format) {\n case \"json\":\n return renderJson(run);\n case \"github\":\n return renderGithub(run);\n case \"sarif\":\n return renderSarif(run, opts.root === undefined ? {} : { root: opts.root });\n case \"junit\":\n return renderJunit(run);\n case \"explain\":\n return renderExplain(run, opts);\n case \"pretty\":\n return renderPretty(run, opts);\n default: {\n // Exhaustive, and the guard is what makes the claim true: sharing an arm\n // with `pretty` narrowed nothing, so a format added to meta's\n // `REPORT_FORMATS` - which is what the CLI validates `-f` against - was\n // accepted here and silently rendered as a human report. Now it is a\n // compile error, and this is its runtime half for library callers.\n const unreachable: never = format;\n throw new LintError(\n `Unknown report format ${JSON.stringify(unreachable)}. Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n }\n}\n\n/** One template per line: the ref to pass, its title, and the types it serves. */\nfunction templateLine(c: Colors, entry: TemplateInfo): string {\n const title = entry.title !== \"\" ? ` ${c.dim(\"—\")} ${entry.title}` : \"\";\n const types =\n entry.types.length > 0 ? entry.types.join(\", \") : \"(no types declared)\";\n return ` ${c.cyan(entry.id)}${title} ${c.dim(`types: ${types}`)} ${c.dim(`[${entry.source}]`)}`;\n}\n\nexport function renderTemplates(\n info: TemplatesInfo,\n format: ListFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(info, null, 2);\n\n const c = palette(opts.color ?? false);\n const lines: string[] = [c.bold(\"Templates:\")];\n if (info.templates.length === 0) {\n lines.push(c.dim(\" (none)\"));\n } else {\n for (const entry of info.templates) lines.push(templateLine(c, entry));\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * One input format as `markdown Markdown (.md, .markdown) kinds: paragraph,\n * codeBlock, list`.\n *\n * The kinds are left out entirely when there are none, rather than printed as\n * an empty list. A tool outside the package answers the job without parsing\n * into the content model, so it has no kinds to report, and a bare `kinds:`\n * label reads as a rendering fault rather than as the answer.\n */\nfunction formatLine(c: Colors, entry: FormatInfo): string {\n const head = ` ${c.cyan(entry.name)} ${entry.label} (${entry.extensions.join(\", \")})`;\n if (entry.kinds.length === 0) return head;\n return `${head} ${c.dim(`kinds: ${entry.kinds.join(\", \")}`)}`;\n}\n\n/**\n * `manni lint tools`: one block per job. Every column is printed for every\n * job, the negatives included - \"not configured\" beside a job that still runs\n * on defaults is the answer someone ran this command to get.\n */\nexport function renderTools(\n tools: ToolInfo[],\n format: ListFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(tools, null, 2);\n\n const c = palette(opts.color ?? false);\n const lines: string[] = [c.bold(\"Jobs:\")];\n for (const entry of tools) {\n const state = [\n entry.configured ? \"configured\" : \"not configured\",\n entry.available ? \"available\" : \"unavailable\",\n ].join(\", \");\n // A tool that is not here has no version to report, and the row still\n // prints: \"unavailable\" beside a blank cell reads as a rendering fault\n // rather than as the answer. The dash is a cell standing in for a missing\n // value, which is why it is an em dash in a house style that bans them in\n // prose.\n const version = entry.version ?? \"—\";\n lines.push(\n ` ${c.cyan(entry.job)} tool: ${c.bold(entry.tool)} ${version} [${state}]`,\n );\n lines.push(` config: ${c.dim(entry.config)}`);\n lines.push(` ${c.dim(\"formats:\")}`);\n for (const info of entry.formats) lines.push(formatLine(c, info));\n }\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAM,iBAAiB;AAGvB,IAAM,YAAY;AAGlB,IAAM,gBAAyB;AAQ/B,SAAS,SAAS,MAAsB;AAC7C,SAAO,KAAK,QAAQ,WAAW,EAAE,EAAE,QAAQ,MAAM,GAAG;AACtD;AAGO,SAAS,OAAO,MAAc,MAAe,eAAuB;AACzE,SAAO,GAAG,cAAc,IAAI,GAAG,IAAI,SAAS,IAAI,CAAC;AACnD;;;ACpBA,IAAM,kBAAkB;AAmBxB,SAAS,aACP,SACY;AACZ,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SACE,QAAQ,WAAW,OACf,GAAG,QAAQ,OAAO,KAAK,QAAQ,OAAO,KACtC,QAAQ;AAAA,IACd,SAAS,GAAG,aAAa,IAAI,SAAS,QAAQ,IAAI,CAAC;AAAA,IACnD,UAAU,QAAQ;AAAA,IAClB,MAAM,QAAQ,SAAS,MAAM;AAAA,IAC7B,KAAK,QAAQ,SAAS,MAAM;AAAA;AAAA;AAAA,IAG5B,UAAU,QAAQ,YAAY;AAAA,EAChC;AACF;AAiBO,SAAS,oBAAoB,KAAkC;AACpE,SAAO,IAAI,QACR,OAAO,CAAC,WAAW,OAAO,WAAW,IAAI,EACzC,IAAI,CAAC,YAAY;AAAA,IAChB,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKb,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMR,IAAI,CA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M,KAAK,eAAe,EAAE,IAAI,MAAM,MAAM,CAAC,EAAE;AAC/C,UAAM,KAAK,OAAO,EAAE,IAAI,UAAU,CAAC,EAAE;AACrC,eAAW,QAAQ,MAAM,QAAS,OAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAAA,EAClE;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["renderJunit","text","i","rows","run","renderJunit"]}
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
resolvePages,
|
|
9
9
|
runConfigOptions,
|
|
10
10
|
withExternalMetadata
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JTEWU4C6.js";
|
|
12
12
|
import {
|
|
13
13
|
SUMMARY_FORMATS,
|
|
14
14
|
parseFormat
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IGRXQC3H.js";
|
|
16
16
|
import {
|
|
17
17
|
palette
|
|
18
18
|
} from "./chunk-RNVYGWIC.js";
|
|
@@ -76,6 +76,7 @@ function renderList(run, format, opts = {}) {
|
|
|
76
76
|
if (e.grader === "command" && !e.command) bits.push(pc.yellow("needs generation"));
|
|
77
77
|
if (e.skip) bits.push(pc.yellow("skip"));
|
|
78
78
|
lines.push(` - ${e.name} ${pc.dim(`[${bits.join(", ")}]`)}`);
|
|
79
|
+
if (e.assertion !== void 0) lines.push(pc.dim(` ${e.assertion}`));
|
|
79
80
|
}
|
|
80
81
|
for (const pr of plan.problems) {
|
|
81
82
|
const tag = pr.level === "error" ? pc.red("error") : pc.yellow("warn");
|
|
@@ -93,4 +94,4 @@ export {
|
|
|
93
94
|
runList,
|
|
94
95
|
renderList
|
|
95
96
|
};
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-742G2QCV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/docevals/commands/list.ts"],"sourcesContent":["/**\n * `manni docevals list` — dry-run: show the resolved eval plan for each discovered\n * page without executing anything. The fastest way to debug suite/frontmatter\n * resolution.\n */\nimport { palette } from \"../../shared/color.js\";\nimport type { ColorOptions } from \"../reporters/pretty.js\";\nimport { loadRunConfig } from \"../core/config.js\";\nimport {\n discoverPages,\n documentSet,\n runConfigOptions,\n type DocumentInputOptions,\n} from \"../core/discover.js\";\nimport { withExternalMetadata } from \"../core/external.js\";\nimport { resolvePages, type ResolvedPagePlan } from \"../core/resolve.js\";\nimport { applySelection } from \"../core/engine.js\";\nimport { assertRegisteredGraders } from \"../core/feasibility.js\";\nimport {\n parseFormat,\n SUMMARY_FORMATS,\n type SummaryFormat,\n} from \"../reporters/format.js\";\n\nexport interface ListOptions extends DocumentInputOptions {\n format?: SummaryFormat;\n /** Show only these evals by name (ADR 01018). */\n evalNames?: string[];\n /** Show only evals in this suite. */\n suite?: string;\n cwd?: string;\n}\n\nexport interface ListRun {\n plans: ResolvedPagePlan[];\n /** 0 = clean, 1 = resolution errors present. */\n exitCode: 0 | 1;\n}\n\n/**\n * Asynchronous because a page's evals may not be in the page: an owning\n * manifest is a file to read (proposal 0037). `list` and `run` have to answer\n * the same question about the same corpus, so it reads them the same way.\n */\nexport async function runList(\n paths: string[],\n options: ListOptions = {},\n): Promise<ListRun> {\n const cwd = options.cwd ?? process.cwd();\n const config = loadRunConfig(runConfigOptions(paths, options), cwd);\n const pages = await withExternalMetadata(\n discoverPages(config, documentSet(paths, options, \"list\"), cwd),\n config,\n cwd,\n );\n const plans = resolvePages(pages, config);\n assertRegisteredGraders(plans, config);\n // `false`: list executes nothing, so an eval that resolves but is skipped is\n // a legitimate answer here — and this is the command `run`'s empty-match\n // error tells the user to reach for.\n applySelection(plans, config, options, false);\n const hasErrors = plans.some((p) =>\n p.problems.some((pr) => pr.level === \"error\"),\n );\n return { plans, exitCode: hasErrors ? 1 : 0 };\n}\n\nexport function renderList(\n run: ListRun,\n format: SummaryFormat,\n opts: ColorOptions = {},\n): string {\n // Exported from src/index.ts, so library callers reach this without the CLI\n // parser in front. Falling through to the pretty renderer is the silent\n // degradation ADR 01007 removes; it is no less silent off the CLI path.\n parseFormat(format, SUMMARY_FORMATS, \"format\");\n if (format === \"json\") {\n return JSON.stringify(\n run.plans.map((p) => ({\n file: p.page.file,\n skip: p.skip,\n suite: p.suite,\n evals: p.evals.map((e) => ({\n name: e.name,\n suite: e.suite,\n type: e.type,\n grader: e.grader,\n source: e.source,\n skip: e.skip,\n hasCommand: e.command != null,\n assertion: e.assertion,\n })),\n problems: p.problems,\n })),\n null,\n 2,\n );\n }\n\n const pc = palette(opts.color === true);\n const lines: string[] = [];\n for (const plan of run.plans) {\n const suite = plan.suite ? pc.dim(` (suite: ${plan.suite})`) : \"\";\n const skip = plan.skip ? pc.yellow(\" [skipped]\") : \"\";\n lines.push(`${pc.bold(plan.page.file)}${suite}${skip}`);\n if (plan.evals.length === 0 && plan.problems.length === 0) {\n lines.push(pc.dim(\" no evals\"));\n }\n for (const e of plan.evals) {\n const bits = [\n pc.cyan(e.grader),\n e.type,\n e.source === \"page\" ? \"page\" : \"config\",\n ];\n if (e.grader === \"command\" && !e.command) bits.push(pc.yellow(\"needs generation\"));\n if (e.skip) bits.push(pc.yellow(\"skip\"));\n lines.push(` - ${e.name} ${pc.dim(`[${bits.join(\", \")}]`)}`);\n }\n for (const pr of plan.problems) {\n const tag = pr.level === \"error\" ? pc.red(\"error\") : pc.yellow(\"warn\");\n const line = pr.line != null ? pc.dim(`:${pr.line}`) : \"\";\n lines.push(` ${tag}${line} ${pr.message}`);\n }\n }\n const total = run.plans.reduce((n, p) => n + p.evals.length, 0);\n lines.push(\"\");\n lines.push(pc.dim(`${run.plans.length} pages, ${total} evals resolved`));\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,eAAsB,QACpB,OACA,UAAuB,CAAC,GACN;AAClB,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,SAAS,cAAc,iBAAiB,OAAO,OAAO,GAAG,GAAG;AAClE,QAAM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,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE;AACtD,QAAI,KAAK,MAAM,WAAW,KAAK,KAAK,SAAS,WAAW,GAAG;AACzD,YAAM,KAAK,GAAG,IAAI,YAAY,CAAC;AAAA,IACjC;AACA,eAAW,KAAK,KAAK,OAAO;AAC1B,YAAM,OAAO;AAAA,QACX,GAAG,KAAK,EAAE,MAAM;AAAA,QAChB,EAAE;AAAA,QACF,EAAE,WAAW,SAAS,SAAS;AAAA,MACjC;AACA,UAAI,EAAE,WAAW,aAAa,CAAC,EAAE,QAAS,MAAK,KAAK,GAAG,OAAO,kBAAkB,CAAC;AACjF,UAAI,EAAE,KAAM,MAAK,KAAK,GAAG,OAAO,MAAM,CAAC;AACvC,YAAM,KAAK,OAAO,EAAE,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/docevals/commands/list.ts"],"sourcesContent":["/**\n * `manni docevals list` — dry-run: show the resolved eval plan for each discovered\n * page without executing anything. The fastest way to debug suite/frontmatter\n * resolution.\n */\nimport { palette } from \"../../shared/color.js\";\nimport type { ColorOptions } from \"../reporters/pretty.js\";\nimport { loadRunConfig } from \"../core/config.js\";\nimport {\n discoverPages,\n documentSet,\n runConfigOptions,\n type DocumentInputOptions,\n} from \"../core/discover.js\";\nimport { withExternalMetadata } from \"../core/external.js\";\nimport { resolvePages, type ResolvedPagePlan } from \"../core/resolve.js\";\nimport { applySelection } from \"../core/engine.js\";\nimport { assertRegisteredGraders } from \"../core/feasibility.js\";\nimport {\n parseFormat,\n SUMMARY_FORMATS,\n type SummaryFormat,\n} from \"../reporters/format.js\";\n\nexport interface ListOptions extends DocumentInputOptions {\n format?: SummaryFormat;\n /** Show only these evals by name (ADR 01018). */\n evalNames?: string[];\n /** Show only evals in this suite. */\n suite?: string;\n cwd?: string;\n}\n\nexport interface ListRun {\n plans: ResolvedPagePlan[];\n /** 0 = clean, 1 = resolution errors present. */\n exitCode: 0 | 1;\n}\n\n/**\n * Asynchronous because a page's evals may not be in the page: an owning\n * manifest is a file to read (proposal 0037). `list` and `run` have to answer\n * the same question about the same corpus, so it reads them the same way.\n */\nexport async function runList(\n paths: string[],\n options: ListOptions = {},\n): Promise<ListRun> {\n const cwd = options.cwd ?? process.cwd();\n const config = loadRunConfig(runConfigOptions(paths, options), cwd);\n const pages = await withExternalMetadata(\n discoverPages(config, documentSet(paths, options, \"list\"), cwd),\n config,\n cwd,\n );\n const plans = resolvePages(pages, config);\n assertRegisteredGraders(plans, config);\n // `false`: list executes nothing, so an eval that resolves but is skipped is\n // a legitimate answer here — and this is the command `run`'s empty-match\n // error tells the user to reach for.\n applySelection(plans, config, options, false);\n const hasErrors = plans.some((p) =>\n p.problems.some((pr) => pr.level === \"error\"),\n );\n return { plans, exitCode: hasErrors ? 1 : 0 };\n}\n\nexport function renderList(\n run: ListRun,\n format: SummaryFormat,\n opts: ColorOptions = {},\n): string {\n // Exported from src/index.ts, so library callers reach this without the CLI\n // parser in front. Falling through to the pretty renderer is the silent\n // degradation ADR 01007 removes; it is no less silent off the CLI path.\n parseFormat(format, SUMMARY_FORMATS, \"format\");\n if (format === \"json\") {\n return JSON.stringify(\n run.plans.map((p) => ({\n file: p.page.file,\n skip: p.skip,\n suite: p.suite,\n evals: p.evals.map((e) => ({\n name: e.name,\n suite: e.suite,\n type: e.type,\n grader: e.grader,\n source: e.source,\n skip: e.skip,\n hasCommand: e.command != null,\n assertion: e.assertion,\n })),\n problems: p.problems,\n })),\n null,\n 2,\n );\n }\n\n const pc = palette(opts.color === true);\n const lines: string[] = [];\n for (const plan of run.plans) {\n const suite = plan.suite ? pc.dim(` (suite: ${plan.suite})`) : \"\";\n const skip = plan.skip ? pc.yellow(\" [skipped]\") : \"\";\n lines.push(`${pc.bold(plan.page.file)}${suite}${skip}`);\n if (plan.evals.length === 0 && plan.problems.length === 0) {\n lines.push(pc.dim(\" no evals\"));\n }\n for (const e of plan.evals) {\n const bits = [\n pc.cyan(e.grader),\n e.type,\n e.source === \"page\" ? \"page\" : \"config\",\n ];\n if (e.grader === \"command\" && !e.command) bits.push(pc.yellow(\"needs generation\"));\n if (e.skip) bits.push(pc.yellow(\"skip\"));\n lines.push(` - ${e.name} ${pc.dim(`[${bits.join(\", \")}]`)}`);\n // What the eval asks for, so an author reads it before a run fails.\n if (e.assertion !== undefined) lines.push(pc.dim(` ${e.assertion}`));\n }\n for (const pr of plan.problems) {\n const tag = pr.level === \"error\" ? pc.red(\"error\") : pc.yellow(\"warn\");\n const line = pr.line != null ? pc.dim(`:${pr.line}`) : \"\";\n lines.push(` ${tag}${line} ${pr.message}`);\n }\n }\n const total = run.plans.reduce((n, p) => n + p.evals.length, 0);\n lines.push(\"\");\n lines.push(pc.dim(`${run.plans.length} pages, ${total} evals resolved`));\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,eAAsB,QACpB,OACA,UAAuB,CAAC,GACN;AAClB,QAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;AACvC,QAAM,SAAS,cAAc,iBAAiB,OAAO,OAAO,GAAG,GAAG;AAClE,QAAM,QAAQ,MAAM;AAAA,IAClB,cAAc,QAAQ,YAAY,OAAO,SAAS,MAAM,GAAG,GAAG;AAAA,IAC9D;AAAA,IACA;AAAA,EACF;AACA,QAAM,QAAQ,aAAa,OAAO,MAAM;AACxC,0BAAwB,OAAO,MAAM;AAIrC,iBAAe,OAAO,QAAQ,SAAS,KAAK;AAC5C,QAAM,YAAY,MAAM;AAAA,IAAK,CAAC,MAC5B,EAAE,SAAS,KAAK,CAAC,OAAO,GAAG,UAAU,OAAO;AAAA,EAC9C;AACA,SAAO,EAAE,OAAO,UAAU,YAAY,IAAI,EAAE;AAC9C;AAEO,SAAS,WACd,KACA,QACA,OAAqB,CAAC,GACd;AAIR,cAAY,QAAQ,iBAAiB,QAAQ;AAC7C,MAAI,WAAW,QAAQ;AAC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