@hawkeyexl/manni 4.23.0 → 4.25.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-DPYBMRVD.js → batch-VP7VAFFA.js} +12 -12
- package/dist/{build-LEKUMGEC.js → build-44OHCP5P.js} +13 -13
- package/dist/{calibrate-TYONPNG4.js → calibrate-5X3V3IFG.js} +13 -13
- package/dist/{capture-2EPHIAZT.js → capture-QUDOYQOS.js} +12 -12
- package/dist/{check-J2KQI7IW.js → check-IF6WXUEI.js} +14 -14
- package/dist/check-LNCNERTV.js +57 -0
- package/dist/check-MZWAI5CR.js +57 -0
- package/dist/{check-SQVQE4E4.js → check-QSW4PTDL.js} +13 -13
- package/dist/{check-HWEDHABD.js → check-ZNGJ3QPU.js} +10 -10
- package/dist/{chunk-KX6HRTLH.js → chunk-2LF3NIWH.js} +17 -2
- package/dist/chunk-2LF3NIWH.js.map +1 -0
- package/dist/{chunk-EPN67ZNX.js → chunk-3J6O3ID5.js} +9 -9
- package/dist/{chunk-VTJAY3WN.js → chunk-3ZKW6ILQ.js} +12 -8
- package/dist/chunk-3ZKW6ILQ.js.map +1 -0
- package/dist/{chunk-XVL7DYWM.js → chunk-3ZWKN3JF.js} +130 -8
- package/dist/chunk-3ZWKN3JF.js.map +1 -0
- package/dist/{chunk-7NSFGAAQ.js → chunk-44ETYRW3.js} +5 -5
- package/dist/{chunk-RZ6OONZU.js → chunk-4UHRMUV3.js} +4 -4
- package/dist/{chunk-Y4O737F7.js → chunk-5XVS7OLH.js} +13 -10
- package/dist/chunk-5XVS7OLH.js.map +1 -0
- package/dist/{chunk-CLUUSZDY.js → chunk-6NN7VGDU.js} +10 -10
- package/dist/{chunk-LHP56Q45.js → chunk-6RFNXPVZ.js} +5 -5
- package/dist/{chunk-I4KDAO6P.js → chunk-6T4AJ2L6.js} +3 -3
- package/dist/{chunk-SZMJ24FR.js → chunk-6Z3XOK52.js} +8 -8
- package/dist/{chunk-WHECOVH2.js → chunk-7QIUCIOS.js} +7 -5
- package/dist/chunk-7QIUCIOS.js.map +1 -0
- package/dist/{chunk-BA7BQBWV.js → chunk-A7Z74ZVA.js} +13 -13
- package/dist/{chunk-LT3STF5K.js → chunk-ADZH6SFC.js} +4 -4
- package/dist/{chunk-AJCUKL43.js → chunk-AFTHVJYK.js} +13 -7
- package/dist/{chunk-AJCUKL43.js.map → chunk-AFTHVJYK.js.map} +1 -1
- package/dist/{chunk-EAF4K7IK.js → chunk-BNCI4B5B.js} +65 -17
- package/dist/chunk-BNCI4B5B.js.map +1 -0
- package/dist/{chunk-VSDXZAQU.js → chunk-BXQLKOOR.js} +2 -2
- package/dist/{chunk-K4YR4PY2.js → chunk-CI655H5P.js} +6 -6
- package/dist/{chunk-MDZXRHIJ.js → chunk-CLH4ZYNG.js} +1 -1
- package/dist/chunk-CLH4ZYNG.js.map +1 -0
- package/dist/{chunk-2QK25SLZ.js → chunk-CSZIHCPC.js} +3 -3
- package/dist/{chunk-OL3Z7KPQ.js → chunk-CU2RHHDC.js} +131 -23
- package/dist/chunk-CU2RHHDC.js.map +1 -0
- package/dist/{chunk-WPHPLVS3.js → chunk-DM37LCWS.js} +8 -8
- package/dist/{chunk-TVLIJ6ZM.js → chunk-DP2YVP7S.js} +4 -4
- package/dist/{chunk-P6LRDWMJ.js → chunk-E4A2OW24.js} +7 -7
- package/dist/{chunk-2UJOQ6CB.js → chunk-FKM3GGP4.js} +9 -9
- package/dist/{chunk-BOCJTOKA.js → chunk-G7DHWDSI.js} +2 -2
- package/dist/{chunk-2GPF4OEF.js → chunk-GQQGKKXK.js} +2 -2
- package/dist/{chunk-AOLCEULZ.js → chunk-GVG6LI5Q.js} +4 -4
- package/dist/{chunk-N25KDXOV.js → chunk-H7UPMVBK.js} +2 -2
- package/dist/{chunk-GIHIONJH.js → chunk-IM7C3H4W.js} +10 -2
- package/dist/chunk-IM7C3H4W.js.map +1 -0
- package/dist/{chunk-QWVIGKBM.js → chunk-IQ4YRTPO.js} +404 -136
- package/dist/chunk-IQ4YRTPO.js.map +1 -0
- package/dist/{chunk-B4POKRCS.js → chunk-ITEGS3X3.js} +5 -5
- package/dist/{chunk-MPRVAMO3.js → chunk-J3LMV74L.js} +4 -4
- package/dist/{chunk-INOVEO32.js → chunk-JBOXCSTN.js} +1 -1
- package/dist/chunk-JBOXCSTN.js.map +1 -0
- package/dist/{chunk-JZWQQOUN.js → chunk-JNG6N5YH.js} +6 -6
- package/dist/{chunk-6QNA7UX2.js → chunk-JPIWDKSR.js} +2 -2
- package/dist/{chunk-EBBJFXMX.js → chunk-KG7ZP7Z6.js} +3 -3
- package/dist/{chunk-2MOXVM6H.js → chunk-LTCAXNJS.js} +2 -2
- package/dist/{chunk-76Y3JATE.js → chunk-M4OGE7AL.js} +2 -2
- package/dist/{chunk-3CBGLUJX.js → chunk-MUPA2MUK.js} +7 -7
- package/dist/chunk-MUPA2MUK.js.map +1 -0
- package/dist/{chunk-GCHEVTCJ.js → chunk-MXRFHC7I.js} +2 -2
- package/dist/{chunk-CWPRB7SA.js → chunk-NQFSXLYK.js} +258 -145
- package/dist/chunk-NQFSXLYK.js.map +1 -0
- package/dist/{chunk-QJL57GPX.js → chunk-OG6OJC64.js} +3 -3
- package/dist/{chunk-72UN462G.js → chunk-OIGFV4BG.js} +26 -7
- package/dist/chunk-OIGFV4BG.js.map +1 -0
- package/dist/{chunk-N2T6RLSE.js → chunk-PMRBTUCZ.js} +2 -2
- package/dist/{chunk-N2T6RLSE.js.map → chunk-PMRBTUCZ.js.map} +1 -1
- package/dist/{chunk-UQYDLEBS.js → chunk-PYCKKLN2.js} +7 -7
- package/dist/{chunk-6RENCXLC.js → chunk-PZLJQE2S.js} +3 -3
- package/dist/{chunk-E75CMOR3.js → chunk-Q44S7QYO.js} +3 -3
- package/dist/{chunk-QJGPOFNB.js → chunk-R3EJQKGM.js} +3 -3
- package/dist/{chunk-C2QE4FSZ.js → chunk-RIKCEIS7.js} +3 -3
- package/dist/{chunk-5JXA75XB.js → chunk-S6TCOSAY.js} +24 -11
- package/dist/chunk-S6TCOSAY.js.map +1 -0
- package/dist/{chunk-YJHH2DHV.js → chunk-SBPIX4DE.js} +2 -2
- package/dist/{chunk-B4ECIBLF.js → chunk-SHDMHEY6.js} +3 -3
- package/dist/{chunk-TLY44PCL.js → chunk-SNNT4A3J.js} +2 -2
- package/dist/{chunk-DWUK6YNX.js → chunk-SPGRVFWW.js} +6 -6
- package/dist/{chunk-3USSSKLA.js → chunk-TX6WDFGT.js} +2 -2
- package/dist/{chunk-FJYIPHWK.js → chunk-V3CE2MQV.js} +9 -7
- package/dist/chunk-V3CE2MQV.js.map +1 -0
- package/dist/{chunk-QR55QXJ7.js → chunk-W4W3NHK4.js} +4 -4
- package/dist/{chunk-YBPXVBSY.js → chunk-WCMO7DTA.js} +3 -3
- package/dist/{chunk-TOVSR2YO.js → chunk-WFSZVCTZ.js} +2 -2
- package/dist/{chunk-AZKNB2T3.js → chunk-WMJ2FXYV.js} +11 -28
- package/dist/chunk-WMJ2FXYV.js.map +1 -0
- package/dist/{chunk-MGQNGW6I.js → chunk-X64BY7TV.js} +2 -2
- package/dist/{chunk-YUCH6WJY.js → chunk-XWPKJD45.js} +2 -2
- package/dist/{chunk-NPZWOPOH.js → chunk-XX7GNK4F.js} +5 -4
- package/dist/chunk-XX7GNK4F.js.map +1 -0
- package/dist/{chunk-L3DOX3UL.js → chunk-Y2GYB3SB.js} +4 -4
- package/dist/{chunk-7M3MBFG7.js → chunk-YBWDATJO.js} +5 -5
- package/dist/chunk-YBWDATJO.js.map +1 -0
- package/dist/{chunk-FBIBR4CH.js → chunk-ZPKPL52R.js} +33 -16
- package/dist/chunk-ZPKPL52R.js.map +1 -0
- package/dist/{cli-TBAOKTMV.js → cli-4WOYZQQF.js} +13 -13
- package/dist/{cli-NDYBQ755.js → cli-5HRQSZJG.js} +18 -18
- package/dist/{cli-BF6KB3EJ.js → cli-AISVPF4O.js} +30 -30
- package/dist/{cli-DXOHHWZK.js → cli-DFUPK6NY.js} +32 -18
- package/dist/{cli-DXOHHWZK.js.map → cli-DFUPK6NY.js.map} +1 -1
- package/dist/{cli-SJA66MIP.js → cli-H2RUHLCF.js} +19 -19
- package/dist/{cli-4R5HIGG4.js → cli-HXFFCF5U.js} +34 -30
- package/dist/cli-HXFFCF5U.js.map +1 -0
- package/dist/{cli-XXN75A42.js → cli-JH67BLTC.js} +7 -7
- package/dist/{cli-V2BJYNMF.js → cli-KLOTJTBA.js} +2 -2
- package/dist/{cli-MPMECIQH.js → cli-MCFDABF3.js} +57 -57
- package/dist/{cli-XGCK2LUV.js → cli-MVWF3ZJL.js} +12 -12
- package/dist/{cli-TWGGMUXX.js → cli-UUJQ2MA5.js} +36 -36
- package/dist/cli.js +15 -15
- package/dist/docmeta.js +6 -6
- package/dist/github-JHXSVOLR.js +48 -0
- package/dist/{github-WBIEYSM7.js → github-X3JHTWYZ.js} +10 -10
- package/dist/{github-NQQTH5JK.js → github-ZARIFMCP.js} +14 -14
- package/dist/index.d.ts +69 -13
- package/dist/index.js +55 -55
- package/dist/{json-J4TONMKY.js → json-CG2WAD5V.js} +2 -2
- package/dist/{json-QQAK73QQ.js → json-MOKARROA.js} +10 -10
- package/dist/{json-IVHRVOGQ.js → json-O6KJT3C3.js} +15 -15
- package/dist/{labels-VI2I5YFD.js → labels-6IEBGB7P.js} +9 -9
- package/dist/{lint-VB5A3ENL.js → lint-W6KQ7QGB.js} +10 -10
- package/dist/{list-LMYCD5G5.js → list-EOWL6REV.js} +14 -14
- package/dist/list-LIP6QOWF.js +48 -0
- package/dist/{list-LOS7FTFD.js → list-UXJ2NK7K.js} +10 -10
- package/dist/{page-3Y4EGYUO.js → page-U4D4RT4T.js} +12 -9
- package/dist/{prepare-JK6XKBZB.js → prepare-EP7RFG3W.js} +11 -11
- package/dist/{pretty-G2J5UEXC.js → pretty-U5HUKTPN.js} +14 -14
- package/dist/{pretty-DR4GHOJG.js → pretty-YFAKTBDO.js} +10 -10
- package/dist/{pretty-GCEIQ3FP.js → pretty-YXK7QWYR.js} +24 -24
- package/dist/{reporters-6TEJDXXO.js → reporters-6CNOPRDA.js} +4 -4
- package/dist/{reporters-OWYFZD4S.js → reporters-GGPH44QS.js} +4 -4
- package/dist/{reporters-43LBUWEE.js → reporters-SJW725TW.js} +9 -9
- package/dist/run-WAIHWCOH.js +51 -0
- package/dist/{sarif-CN7RSIKH.js → sarif-IY6OTG4M.js} +8 -8
- package/dist/{sarif-GWTNYCZJ.js → sarif-QYID4Z4M.js} +10 -10
- package/dist/sarif-SJ27UD3T.js +49 -0
- package/dist/strategy-3B6KJNFA.js +63 -0
- package/dist/{term-5WITRS3M.js → term-M63KLMUK.js} +15 -15
- package/dist/{types-7N7ETP3W.js → types-VWL35P4F.js} +2 -2
- package/dist/{validate-TDIEFXRQ.js → validate-XW5WSXKU.js} +4 -4
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/dist/check-ADCSXGBK.js +0 -57
- package/dist/check-L5AUSTE6.js +0 -57
- package/dist/chunk-3CBGLUJX.js.map +0 -1
- package/dist/chunk-5JXA75XB.js.map +0 -1
- package/dist/chunk-72UN462G.js.map +0 -1
- package/dist/chunk-7M3MBFG7.js.map +0 -1
- package/dist/chunk-AZKNB2T3.js.map +0 -1
- package/dist/chunk-CWPRB7SA.js.map +0 -1
- package/dist/chunk-EAF4K7IK.js.map +0 -1
- package/dist/chunk-FBIBR4CH.js.map +0 -1
- package/dist/chunk-FJYIPHWK.js.map +0 -1
- package/dist/chunk-GIHIONJH.js.map +0 -1
- package/dist/chunk-INOVEO32.js.map +0 -1
- package/dist/chunk-KX6HRTLH.js.map +0 -1
- package/dist/chunk-MDZXRHIJ.js.map +0 -1
- package/dist/chunk-NPZWOPOH.js.map +0 -1
- package/dist/chunk-OL3Z7KPQ.js.map +0 -1
- package/dist/chunk-QWVIGKBM.js.map +0 -1
- package/dist/chunk-VTJAY3WN.js.map +0 -1
- package/dist/chunk-WHECOVH2.js.map +0 -1
- package/dist/chunk-XVL7DYWM.js.map +0 -1
- package/dist/chunk-Y4O737F7.js.map +0 -1
- package/dist/cli-4R5HIGG4.js.map +0 -1
- package/dist/github-NWL2XGE7.js +0 -48
- package/dist/list-3XRFX2Y3.js +0 -33
- package/dist/run-G6G55SWJ.js +0 -36
- package/dist/sarif-FR26WNVT.js +0 -49
- package/dist/strategy-3EZUOE2T.js +0 -59
- /package/dist/{batch-DPYBMRVD.js.map → batch-VP7VAFFA.js.map} +0 -0
- /package/dist/{build-LEKUMGEC.js.map → build-44OHCP5P.js.map} +0 -0
- /package/dist/{calibrate-TYONPNG4.js.map → calibrate-5X3V3IFG.js.map} +0 -0
- /package/dist/{capture-2EPHIAZT.js.map → capture-QUDOYQOS.js.map} +0 -0
- /package/dist/{check-ADCSXGBK.js.map → check-IF6WXUEI.js.map} +0 -0
- /package/dist/{check-HWEDHABD.js.map → check-LNCNERTV.js.map} +0 -0
- /package/dist/{check-J2KQI7IW.js.map → check-MZWAI5CR.js.map} +0 -0
- /package/dist/{check-SQVQE4E4.js.map → check-QSW4PTDL.js.map} +0 -0
- /package/dist/{check-L5AUSTE6.js.map → check-ZNGJ3QPU.js.map} +0 -0
- /package/dist/{chunk-EPN67ZNX.js.map → chunk-3J6O3ID5.js.map} +0 -0
- /package/dist/{chunk-7NSFGAAQ.js.map → chunk-44ETYRW3.js.map} +0 -0
- /package/dist/{chunk-RZ6OONZU.js.map → chunk-4UHRMUV3.js.map} +0 -0
- /package/dist/{chunk-CLUUSZDY.js.map → chunk-6NN7VGDU.js.map} +0 -0
- /package/dist/{chunk-LHP56Q45.js.map → chunk-6RFNXPVZ.js.map} +0 -0
- /package/dist/{chunk-I4KDAO6P.js.map → chunk-6T4AJ2L6.js.map} +0 -0
- /package/dist/{chunk-SZMJ24FR.js.map → chunk-6Z3XOK52.js.map} +0 -0
- /package/dist/{chunk-BA7BQBWV.js.map → chunk-A7Z74ZVA.js.map} +0 -0
- /package/dist/{chunk-LT3STF5K.js.map → chunk-ADZH6SFC.js.map} +0 -0
- /package/dist/{chunk-VSDXZAQU.js.map → chunk-BXQLKOOR.js.map} +0 -0
- /package/dist/{chunk-K4YR4PY2.js.map → chunk-CI655H5P.js.map} +0 -0
- /package/dist/{chunk-2QK25SLZ.js.map → chunk-CSZIHCPC.js.map} +0 -0
- /package/dist/{chunk-WPHPLVS3.js.map → chunk-DM37LCWS.js.map} +0 -0
- /package/dist/{chunk-TVLIJ6ZM.js.map → chunk-DP2YVP7S.js.map} +0 -0
- /package/dist/{chunk-P6LRDWMJ.js.map → chunk-E4A2OW24.js.map} +0 -0
- /package/dist/{chunk-2UJOQ6CB.js.map → chunk-FKM3GGP4.js.map} +0 -0
- /package/dist/{chunk-BOCJTOKA.js.map → chunk-G7DHWDSI.js.map} +0 -0
- /package/dist/{chunk-2GPF4OEF.js.map → chunk-GQQGKKXK.js.map} +0 -0
- /package/dist/{chunk-AOLCEULZ.js.map → chunk-GVG6LI5Q.js.map} +0 -0
- /package/dist/{chunk-N25KDXOV.js.map → chunk-H7UPMVBK.js.map} +0 -0
- /package/dist/{chunk-B4POKRCS.js.map → chunk-ITEGS3X3.js.map} +0 -0
- /package/dist/{chunk-MPRVAMO3.js.map → chunk-J3LMV74L.js.map} +0 -0
- /package/dist/{chunk-JZWQQOUN.js.map → chunk-JNG6N5YH.js.map} +0 -0
- /package/dist/{chunk-6QNA7UX2.js.map → chunk-JPIWDKSR.js.map} +0 -0
- /package/dist/{chunk-EBBJFXMX.js.map → chunk-KG7ZP7Z6.js.map} +0 -0
- /package/dist/{chunk-2MOXVM6H.js.map → chunk-LTCAXNJS.js.map} +0 -0
- /package/dist/{chunk-76Y3JATE.js.map → chunk-M4OGE7AL.js.map} +0 -0
- /package/dist/{chunk-GCHEVTCJ.js.map → chunk-MXRFHC7I.js.map} +0 -0
- /package/dist/{chunk-QJL57GPX.js.map → chunk-OG6OJC64.js.map} +0 -0
- /package/dist/{chunk-UQYDLEBS.js.map → chunk-PYCKKLN2.js.map} +0 -0
- /package/dist/{chunk-6RENCXLC.js.map → chunk-PZLJQE2S.js.map} +0 -0
- /package/dist/{chunk-E75CMOR3.js.map → chunk-Q44S7QYO.js.map} +0 -0
- /package/dist/{chunk-QJGPOFNB.js.map → chunk-R3EJQKGM.js.map} +0 -0
- /package/dist/{chunk-C2QE4FSZ.js.map → chunk-RIKCEIS7.js.map} +0 -0
- /package/dist/{chunk-YJHH2DHV.js.map → chunk-SBPIX4DE.js.map} +0 -0
- /package/dist/{chunk-B4ECIBLF.js.map → chunk-SHDMHEY6.js.map} +0 -0
- /package/dist/{chunk-TLY44PCL.js.map → chunk-SNNT4A3J.js.map} +0 -0
- /package/dist/{chunk-DWUK6YNX.js.map → chunk-SPGRVFWW.js.map} +0 -0
- /package/dist/{chunk-3USSSKLA.js.map → chunk-TX6WDFGT.js.map} +0 -0
- /package/dist/{chunk-QR55QXJ7.js.map → chunk-W4W3NHK4.js.map} +0 -0
- /package/dist/{chunk-YBPXVBSY.js.map → chunk-WCMO7DTA.js.map} +0 -0
- /package/dist/{chunk-TOVSR2YO.js.map → chunk-WFSZVCTZ.js.map} +0 -0
- /package/dist/{chunk-MGQNGW6I.js.map → chunk-X64BY7TV.js.map} +0 -0
- /package/dist/{chunk-YUCH6WJY.js.map → chunk-XWPKJD45.js.map} +0 -0
- /package/dist/{chunk-L3DOX3UL.js.map → chunk-Y2GYB3SB.js.map} +0 -0
- /package/dist/{cli-TBAOKTMV.js.map → cli-4WOYZQQF.js.map} +0 -0
- /package/dist/{cli-NDYBQ755.js.map → cli-5HRQSZJG.js.map} +0 -0
- /package/dist/{cli-BF6KB3EJ.js.map → cli-AISVPF4O.js.map} +0 -0
- /package/dist/{cli-SJA66MIP.js.map → cli-H2RUHLCF.js.map} +0 -0
- /package/dist/{cli-XXN75A42.js.map → cli-JH67BLTC.js.map} +0 -0
- /package/dist/{cli-V2BJYNMF.js.map → cli-KLOTJTBA.js.map} +0 -0
- /package/dist/{cli-MPMECIQH.js.map → cli-MCFDABF3.js.map} +0 -0
- /package/dist/{cli-XGCK2LUV.js.map → cli-MVWF3ZJL.js.map} +0 -0
- /package/dist/{cli-TWGGMUXX.js.map → cli-UUJQ2MA5.js.map} +0 -0
- /package/dist/{github-NQQTH5JK.js.map → github-JHXSVOLR.js.map} +0 -0
- /package/dist/{github-NWL2XGE7.js.map → github-X3JHTWYZ.js.map} +0 -0
- /package/dist/{github-WBIEYSM7.js.map → github-ZARIFMCP.js.map} +0 -0
- /package/dist/{json-IVHRVOGQ.js.map → json-CG2WAD5V.js.map} +0 -0
- /package/dist/{json-J4TONMKY.js.map → json-MOKARROA.js.map} +0 -0
- /package/dist/{json-QQAK73QQ.js.map → json-O6KJT3C3.js.map} +0 -0
- /package/dist/{labels-VI2I5YFD.js.map → labels-6IEBGB7P.js.map} +0 -0
- /package/dist/{lint-VB5A3ENL.js.map → lint-W6KQ7QGB.js.map} +0 -0
- /package/dist/{list-3XRFX2Y3.js.map → list-EOWL6REV.js.map} +0 -0
- /package/dist/{list-LMYCD5G5.js.map → list-LIP6QOWF.js.map} +0 -0
- /package/dist/{list-LOS7FTFD.js.map → list-UXJ2NK7K.js.map} +0 -0
- /package/dist/{page-3Y4EGYUO.js.map → page-U4D4RT4T.js.map} +0 -0
- /package/dist/{prepare-JK6XKBZB.js.map → prepare-EP7RFG3W.js.map} +0 -0
- /package/dist/{pretty-DR4GHOJG.js.map → pretty-U5HUKTPN.js.map} +0 -0
- /package/dist/{pretty-G2J5UEXC.js.map → pretty-YFAKTBDO.js.map} +0 -0
- /package/dist/{pretty-GCEIQ3FP.js.map → pretty-YXK7QWYR.js.map} +0 -0
- /package/dist/{reporters-43LBUWEE.js.map → reporters-6CNOPRDA.js.map} +0 -0
- /package/dist/{reporters-6TEJDXXO.js.map → reporters-GGPH44QS.js.map} +0 -0
- /package/dist/{reporters-OWYFZD4S.js.map → reporters-SJW725TW.js.map} +0 -0
- /package/dist/{run-G6G55SWJ.js.map → run-WAIHWCOH.js.map} +0 -0
- /package/dist/{sarif-CN7RSIKH.js.map → sarif-IY6OTG4M.js.map} +0 -0
- /package/dist/{sarif-FR26WNVT.js.map → sarif-QYID4Z4M.js.map} +0 -0
- /package/dist/{sarif-GWTNYCZJ.js.map → sarif-SJ27UD3T.js.map} +0 -0
- /package/dist/{strategy-3EZUOE2T.js.map → strategy-3B6KJNFA.js.map} +0 -0
- /package/dist/{term-5WITRS3M.js.map → term-M63KLMUK.js.map} +0 -0
- /package/dist/{types-7N7ETP3W.js.map → types-VWL35P4F.js.map} +0 -0
- /package/dist/{validate-TDIEFXRQ.js.map → validate-XW5WSXKU.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/docevals/judge/judge.ts","../src/docevals/judge/verdict-schema.json","../src/docevals/core/reviews.ts","../src/docevals/judge/provider.ts","../src/docevals/graders/scriptgen.ts","../src/docevals/core/frontmatter-edit.ts","../src/docevals/core/write-location.ts","../src/docevals/commands/run.ts"],"sourcesContent":["/**\n * The ensemble judge: N independent runs per (page, eval), each a fresh\n * request with no shared context (eval isolation), aggregated by consensus\n * and routed through confidence zones. Persisted human reviews resolve\n * needs-review outcomes for unchanged pages.\n *\n * The ensemble mechanics — retry-once, errored runs counting against\n * consensus, cache replay — live in `@hawkeyexl/inference` (ADR 01002). What\n * stays here is manni docevals' own orchestration: the bounded-concurrency pool\n * across targets, the turn budget, the self-judgment warning, and human-review\n * resolution.\n */\nimport {\n computeConsensus,\n runEnsemble,\n zoneFor,\n type InferenceProvider,\n} from \"@hawkeyexl/inference\";\nimport verdictSchemaJson from \"./verdict-schema.json\" with { type: \"json\" };\nimport type { EvalResult } from \"../types.js\";\nimport type { DocevalsConfig } from \"../core/config.js\";\nimport type { JudgeFn, JudgeOptions } from \"../core/engine.js\";\nimport type { GraderTarget } from \"../graders/types.js\";\nimport { findReview, loadReviews } from \"../core/reviews.js\";\nimport { cacheKey, judgeCacheBody, VerdictCache } from \"./cache.js\";\nimport { turnBudgetSkipReason } from \"./budget.js\";\nimport {\n JUDGE_SYSTEM_PROMPT,\n buildUserContent,\n EVIDENCE_SYSTEM_PROMPT,\n EVIDENCE_SCHEMA,\n buildEvidenceUser,\n renderEvidence,\n type PartEvidence,\n} from \"./prompt.js\";\nimport { splitBody } from \"../core/split.js\";\nimport { readTarget } from \"../core/target.js\";\nimport { selfPreferenceOf } from \"./self-preference.js\";\nimport {\n announceSelection,\n assertProviderSelection,\n makeProvider,\n selectProvider,\n} from \"./provider.js\";\nimport { DocevalsError } from \"../types.js\";\nimport type { ResolvedEval } from \"../core/resolve.js\";\nimport { resolve as resolvePath } from \"node:path\";\nimport { warn } from \"../../shared/warn.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\n\n/**\n * manni docevals' own verdict wording. Structurally identical to the library's\n * canonical schema, but the field descriptions talk about pages rather than\n * generic subjects — and descriptions are prompt surface that steers the\n * model, so they are worth keeping (the inference library's own ADR 01001,\n * not this repo's).\n */\nconst verdictSchema = verdictSchemaJson as Record<string, unknown>;\n\nexport interface JudgeStageDeps {\n /** Provider for evals that do not override `provider`/`model`. */\n provider: InferenceProvider;\n root: string;\n /**\n * Build a provider for an eval that overrides `provider` or `model`.\n *\n * Injected so the engine's tests can drive per-eval overrides with a mock.\n * When absent, one is built from the resolved config — without it `provider`\n * and `model` would validate, appear in the schema, and do nothing, which is\n * worse than not offering them.\n */\n providerFor?: (ev: ResolvedEval) => InferenceProvider | Promise<InferenceProvider>;\n}\n\n/** Build the engine's judge stage around a concrete provider. */\nexport function makeJudge(deps: JudgeStageDeps): JudgeFn {\n return async (\n targets: GraderTarget[],\n config: DocevalsConfig,\n options: JudgeOptions,\n ): Promise<EvalResult[]> => {\n const { provider, root } = deps;\n\n // CLI > eval > config, the same precedence `runsFor` uses, settled by\n // `selectProvider` so the run's provider and an eval's are chosen by one\n // rule. Providers are memoized on the selection an eval *resolves to*, not\n // on what it wrote: with `--provider anthropic` in force, an eval naming\n // `openai` and one naming `mock` both resolve to the same provider, and\n // keying on the authored value would build it twice. The effective pair is\n // also what decides the short-circuit — an eval whose selection is the\n // run's own needs no provider of its own.\n //\n // Memoized as a promise, so a selection that detects or fails does so\n // once, and every eval sharing it gets the same provider or the same error.\n const overridden = new Map<string, Promise<InferenceProvider>>();\n const buildProvider =\n deps.providerFor ??\n ((ev: ResolvedEval): Promise<InferenceProvider> => makeProvider(config, options, ev));\n const keyOf = (s: { provider: string; model: string | undefined }): string =>\n `${s.provider}:${s.model ?? \"\"}`;\n const defaultKey = keyOf(selectProvider(config, options));\n const providerFor = (ev: ResolvedEval, file: string): Promise<InferenceProvider> => {\n // Only the eval's own two fields: a `ResolvedEval` carries a `source` of\n // its own, and the origin a `--local` notice names is the page's.\n const selection = selectProvider(config, options, {\n ...(ev.provider !== undefined ? { provider: ev.provider } : {}),\n ...(ev.model !== undefined ? { model: ev.model } : {}),\n origin: `eval \"${ev.name}\" in ${file}`,\n });\n // Said before the short-circuit: under `--local` an eval naming a hosted\n // provider resolves to the run's own selection, and is still replaced.\n announceSelection(selection);\n const key = keyOf(selection);\n if (key === defaultKey) return Promise.resolve(provider);\n let p = overridden.get(key);\n if (p === undefined) {\n // The eval's own choice follows the run's rules: an unknown name or a\n // model with no provider to own it is refused before anything is built.\n p = (async () => {\n assertProviderSelection(selection);\n return buildProvider(ev);\n })();\n overridden.set(key, p);\n }\n return p;\n };\n // CLI > eval > config. The flag is an explicit operator act (\"run cheap\n // right now\"), so it outranks a page asking for more agreement; the page\n // outranks the corpus default, which is the point of having it.\n const runsFor = (ev: ResolvedEval): number =>\n options.runs ?? ev.runs ?? config.judge.ensembleRuns;\n const temperature = config.judge.temperature;\n const chunkChars = options.chunkChars ?? config.judge.chunkChars;\n const cache = new VerdictCache(\n resolvePath(root, config.judge.cacheDir),\n options.noCache !== true,\n \"manni-docevals\",\n );\n const reviews = loadReviews(root);\n const maxTurns = options.maxTurns ?? config.judge.maxTurns;\n let turnsSpent = 0;\n\n const results: EvalResult[] = [];\n // `makeJudge` is a published export taking a caller-supplied config, so a\n // JS consumer can hand us one shaped for a version before `judge.concurrency`\n // existed. The type says that cannot happen; at a package boundary it can.\n // Unguarded it is `Math.min(undefined, n)` -> NaN -> `Array.from({length:\n // NaN})` -> zero workers, and every AI eval vanishes from the results —\n // not skipped, not errored, absent — with the run exiting 0.\n //\n // Tested with `Number.isFinite` rather than `??` because the value is typed\n // non-optional: `??` is dead code to the compiler and the lint rejects it,\n // while the runtime hazard is real. This says what is actually being\n // checked (ADR 01039).\n // `Number.isInteger(n) && n >= 1`, not `Number.isFinite`: the hazard is a\n // worker pool of zero, and `Number.isFinite(0)` is `true`. A caller-supplied\n // `judge.concurrency: 0` sails past a finite check into\n // `Array.from({length: 0})`, which builds no workers at all — every AI eval\n // then vanishes from the results, not skipped and not errored but absent,\n // with the run exiting 0. The config file cannot express it (`minimum: 1`),\n // but `makeJudge` is exported and takes a caller-supplied config.\n const configured = config.judge.concurrency;\n const concurrency =\n Number.isInteger(configured) && configured >= 1\n ? configured\n : config.defaults.concurrency;\n let index = 0;\n\n const judgeTarget = async (target: GraderTarget): Promise<EvalResult> => {\n const { plan, eval: ev } = target;\n const start = Date.now();\n const runsPerEval = runsFor(ev);\n // A provider the eval chose that cannot be had is that eval's error, as a\n // target it cannot serve is below: the rest of the corpus still gets its\n // verdicts, and the run exits 1 rather than stopping.\n let judgeProvider: InferenceProvider;\n try {\n judgeProvider = await providerFor(ev, plan.page.file);\n } catch (e) {\n if (!(e instanceof DocevalsError)) throw e;\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: e.message,\n durationMs: Date.now() - start,\n };\n }\n\n // Self-preference, compared against the model that judges *this eval*,\n // not the run's default: an eval naming its own provider or model is\n // exactly the case a run-wide comparison would miss. Said per page and\n // eval rather than deduplicated by model name, so a corpus with several\n // affected pages names each one instead of only the first. Marked on the\n // result too: a verdict formed under self-preference must not look\n // identical to any other in JSON, SARIF, JUnit or the HTML report.\n const preference = selfPreferenceOf(plan, ev, judgeProvider.modelName());\n if (preference) warn(`${plan.page.file}: ${preference.message}`);\n\n // Read what the eval asked to be graded. A target that cannot be served\n // errors here rather than falling back to the page body: a verdict about\n // the wrong bytes is worse than no verdict (ADR 01022).\n const selected = readTarget(ev.target, plan);\n if (!selected.ok) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: selected.reason,\n durationMs: Date.now() - start,\n };\n }\n\n // A page longer than the chunk budget is read in parts: each part\n // contributes the passages bearing on the assertion, and one judge then\n // answers the original question against the collection. Merging\n // per-part *verdicts* would be unsound — see EVIDENCE_SYSTEM_PROMPT.\n //\n // Content that fits skips this entirely and is judged exactly as before,\n // so the common path costs nothing and its cached verdicts stay valid.\n const chunks = splitBody(selected.text, chunkChars);\n let judged = selected.text;\n let judgedLabel = selected.label;\n\n // The key is built from what was *selected*, never from the evidence.\n // Evidence is model output: keying on it would change every run, so a\n // split page could never hit its cached verdict — and the committed docs\n // fixtures for long pages would be dead weight. The chunk budget rides\n // along because it decides how the page was read.\n const key = cacheKey(\n judgeProvider.provider(),\n judgeProvider.modelName(),\n runsPerEval,\n temperature,\n judgeCacheBody(chunkChars, selected.text),\n ev,\n );\n const cached = cache.get(key) !== undefined;\n\n // Gathering evidence costs one call per part, so it happens only on a\n // miss. A cached ensemble must make no inference call at all (ADR 01019).\n if (chunks.length > 1 && !cached) {\n const gathered: PartEvidence[] = [];\n for (const [i, chunk] of chunks.entries()) {\n if (maxTurns != null && turnsSpent >= maxTurns) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"skipped\",\n skipReason: `${turnBudgetSkipReason(maxTurns)} (after ${String(i)} of ${String(chunks.length)} parts)`,\n durationMs: Date.now() - start,\n };\n }\n turnsSpent += 1;\n try {\n const res = await judgeProvider.completeJSON({\n system: EVIDENCE_SYSTEM_PROMPT,\n user: buildEvidenceUser(ev, chunk, {\n index: i,\n total: chunks.length,\n }),\n schema: EVIDENCE_SCHEMA,\n temperature,\n });\n const json = res.json as Partial<PartEvidence>;\n gathered.push({\n supports: json.supports ?? [],\n contradicts: json.contradicts ?? [],\n });\n } catch (e) {\n // A part that could not be read leaves the collection incomplete,\n // and a verdict over incomplete evidence is exactly the silent\n // wrong answer this stage exists to avoid (ADR 01022).\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: `gathering evidence from part ${String(i + 1)} of ${String(chunks.length)} failed: ${errorMessage(e)}`,\n durationMs: Date.now() - start,\n };\n }\n }\n judged = renderEvidence(gathered, chunks.length);\n judgedLabel = `${selected.label}, ${String(chunks.length)} parts`;\n }\n\n // A cached ensemble makes no inference call, so it never touches the\n // budget — the docs corpus replays committed fixtures under any cap.\n // For an uncached one the turns are claimed *before* dispatching, which\n // is the whole point of counting turns rather than dollars: the claim is\n // synchronous, so two workers cannot both clear an almost-exhausted\n // budget and then both spend. See ADR 01019.\n if (maxTurns != null && !cached) {\n if (turnsSpent + runsPerEval > maxTurns) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"skipped\",\n skipReason: turnBudgetSkipReason(maxTurns),\n durationMs: 0,\n };\n }\n // One turn per ensemble run. A run can make a second provider call\n // when the first response fails schema validation (the inference\n // layer retries once), so this is a floor on calls, not an exact\n // count — the cap is exact in *runs*, which is the unit the ensemble\n // is configured in.\n turnsSpent += runsPerEval;\n }\n\n const runs = await runEnsemble({\n provider: judgeProvider,\n system: JUDGE_SYSTEM_PROMPT,\n user: buildUserContent(ev, judged, judgedLabel),\n runs: runsPerEval,\n temperature,\n schema: verdictSchema,\n cache,\n cacheKey: key,\n label: \"manni-docevals\",\n });\n\n const consensusBase = computeConsensus(runs);\n const zone = zoneFor(consensusBase, config.judge.zones);\n const consensus = { ...consensusBase, zone };\n\n let outcome: EvalResult[\"outcome\"] =\n zone === \"auto-pass\" ? \"pass\" : zone === \"auto-fail\" ? \"fail\" : \"needs-review\";\n let via: EvalResult[\"via\"];\n if (outcome === \"needs-review\") {\n const review = findReview(reviews, plan.page.file, ev.name, plan.page.body);\n if (review) {\n outcome = review.verdict;\n via = \"human-review\";\n }\n }\n\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome,\n consensus,\n via,\n ...(preference\n ? { selfPreference: { axis: preference.axis, model: preference.model } }\n : {}),\n durationMs: Date.now() - start,\n };\n };\n\n // Simple bounded-concurrency pool across targets; runs within one eval\n // stay sequential (independent requests, no shared context).\n const workers = Array.from(\n { length: Math.min(concurrency, targets.length) },\n async () => {\n while (index < targets.length) {\n const i = index++;\n const target = targets[i];\n if (target === undefined) break;\n results[i] = await judgeTarget(target);\n }\n },\n );\n await Promise.all(workers);\n return results;\n };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:docevals:verdict\",\n \"title\": \"manni docevals judge verdict\",\n \"type\": \"object\",\n \"required\": [\"claim\", \"observed\", \"match\", \"confidence\", \"reasoning\"],\n \"properties\": {\n \"claim\": {\n \"type\": \"string\",\n \"description\": \"The specific documented assertion under evaluation.\"\n },\n \"observed\": {\n \"type\": \"string\",\n \"description\": \"What was actually observed in the page, quoting evidence where possible.\"\n },\n \"match\": {\n \"enum\": [\"pass\", \"fail\", \"partial\"],\n \"description\": \"pass only if the assertion is fully satisfied; partial for partial compliance.\"\n },\n \"confidence\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Self-reported confidence in this verdict.\"\n },\n \"reasoning\": {\n \"type\": \"string\",\n \"description\": \"Why this conclusion was reached.\"\n }\n },\n \"additionalProperties\": false\n}\n","/**\n * Persisted human reviews (Level 3 grading). `.manni/docevals/reviews.yaml` records\n * human verdicts for evals that landed in the human-review zone. A review\n * applies only while the page body it reviewed is unchanged (contentHash);\n * stale reviews silently return the eval to needs-review.\n */\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { parse as parseYaml, stringify as stringifyYaml } from \"yaml\";\nimport { sha256 } from \"../judge/cache.js\";\n\nexport interface ReviewEntry {\n file: string;\n evalName: string;\n /** sha256 of the page body at review time. */\n contentHash: string;\n verdict: \"pass\" | \"fail\";\n reviewer?: string;\n date?: string;\n note?: string;\n}\n\nexport const REVIEWS_PATH = join(\".manni/docevals\", \"reviews.yaml\");\n\nexport function loadReviews(root: string): ReviewEntry[] {\n const path = join(root, REVIEWS_PATH);\n if (!existsSync(path)) return [];\n const raw = parseYaml(readFileSync(path, \"utf8\")) as unknown;\n if (!Array.isArray(raw)) return [];\n return raw as ReviewEntry[];\n}\n\nexport function saveReviews(root: string, reviews: ReviewEntry[]): void {\n const path = join(root, REVIEWS_PATH);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, stringifyYaml(reviews));\n}\n\n/** Record (or replace) a review for a (file, eval) pair. */\nexport function recordReview(root: string, entry: ReviewEntry): void {\n const reviews = loadReviews(root).filter(\n (r) => !(r.file === entry.file && r.evalName === entry.evalName),\n );\n reviews.push(entry);\n saveReviews(root, reviews);\n}\n\n/** Find the applicable (non-stale) review for a page body, if any. */\nexport function findReview(\n reviews: ReviewEntry[],\n file: string,\n evalName: string,\n body: string,\n): ReviewEntry | undefined {\n const entry = reviews.find(\n (r) => r.file === file && r.evalName === evalName,\n );\n if (!entry) return undefined;\n return entry.contentHash === sha256(body) ? entry : undefined;\n}\n\nexport { sha256 as contentHash };\n","/**\n * Choosing the provider and model, and building the shared inference\n * library's `ProviderSpec` for it.\n *\n * The providers themselves live in `@hawkeyexl/inference` (ADR 01002). The\n * names a provider may have, the two refusals, the detection call, the\n * level-bound precedence and the mapping of the family's `providers:`\n * connection settings are `src/shared/providers.ts`, the same code\n * `manni meta fill` runs. What stays here is what only manni docevals can\n * decide: which levels it reads (a flag, an eval's own `provider:`/`model:`,\n * `docevals.provider`/`model`, then the family's `providers:`), and the\n * judge-shaped options a verdict call wants.\n */\nimport {\n makeProvider as makeInferenceProvider,\n type InferenceProvider,\n type ProviderName as ConcreteProvider,\n type ProviderSelector,\n type ProviderSpec,\n} from \"@hawkeyexl/inference\";\nimport { DocevalsError } from \"../types.js\";\nimport type { DocevalsConfig } from \"../core/config.js\";\nimport {\n assertKnownProvider,\n assertLocalFlag,\n assertModelHasProvider,\n localNotice,\n providerSpecFor as sharedProviderSpecFor,\n resolveIdentity,\n selectProvider as selectFromLevels,\n type ProviderChoice,\n type ProviderFlags,\n type ProviderSelection,\n} from \"../../shared/providers.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { noticeOnce } from \"../../shared/warn.js\";\n\nexport type { ProviderChoice, ProviderFlags, ProviderSelection };\n\n/** The key a docevals user writes, named by the refusal a bare model gets. */\nconst CONFIG_KEY = \"docevals.provider\";\n\nconst toDocevalsError = (message: string): Error => new DocevalsError(message);\n\n/**\n * The provider and model in force: a flag, then the eval's own choice, then\n * `docevals.provider`/`model`, then the family's `providers.provider`/`model`,\n * then `auto`. A model is carried only to the provider its own level names,\n * so an eval that names a different provider takes that provider's default\n * instead of a model it cannot run (`selectProvider` in the shared module).\n *\n * `--local` runs llama-cpp over all of them. A `--provider` it contradicts is\n * refused here, so no path selects past it. `ev.origin` names the eval in the\n * notice for a provider `--local` replaced; the caller knows its page.\n */\nexport function selectProvider(\n config: DocevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): ProviderSelection {\n assertLocalFlag(flags, toDocevalsError);\n return selectFromLevels(flags, [\n {\n ...(ev.provider !== undefined ? { provider: ev.provider } : {}),\n ...(ev.model !== undefined ? { model: ev.model } : {}),\n ...(ev.origin !== undefined ? { origin: ev.origin } : {}),\n },\n {\n ...(config.provider !== null ? { provider: config.provider } : {}),\n ...(config.model !== null ? { model: config.model } : {}),\n origin: CONFIG_KEY,\n },\n {\n ...(config.providers.provider !== undefined ? { provider: config.providers.provider } : {}),\n ...(config.providers.model !== undefined ? { model: config.providers.model } : {}),\n origin: \"providers.provider\",\n },\n ]);\n}\n\n/**\n * Say what `--local` set aside, once per source. Called where a selection is\n * about to be used, never where it is only checked, so a run that sends\n * nothing to a model says nothing.\n */\nexport function announceSelection(selection: ProviderSelection): void {\n const message = localNotice(selection);\n if (message !== undefined) noticeOnce(message);\n}\n\n/**\n * Refuse a selection that cannot be right, with `manni meta fill`'s messages:\n * an unknown name, or a model under `auto`. Both are `DocevalsError`s.\n */\nexport function assertProviderSelection(selection: ProviderSelection): void {\n assertKnownProvider(selection.provider, toDocevalsError);\n assertModelHasProvider(selection.provider, selection.model, CONFIG_KEY, toDocevalsError);\n}\n\n/**\n * The spec for a selection, with the family's connection settings for the\n * provider it names, and under `auto` the settings detection reads.\n */\nexport function providerSpecFor(\n config: DocevalsConfig,\n selection: { provider: ProviderSelector; model: string | null },\n): ProviderSpec {\n const spec = sharedProviderSpecFor(config.providers, selection);\n switch (selection.provider) {\n case \"anthropic\":\n // A verdict-shaped tool name steers the model better than a generic\n // one, and it is free to keep.\n return { ...spec, anthropic: { toolName: \"record_verdict\" } };\n case \"openai\":\n return { ...spec, openai: { schemaName: \"verdict\" } };\n default:\n return spec;\n }\n}\n\n/**\n * The concrete provider and model, WITHOUT constructing the provider: cache\n * keys need it, and a fully cached run must not require an API key.\n *\n * Under `auto` this is where detection runs, exactly as `manni meta fill` runs\n * it, seeing the same connection settings. The model is the RESOLVED one (the\n * provider's default when none was named, a llama-cpp tier's concrete\n * weights), so a library default that changes changes every cache key built\n * from it.\n */\nexport async function resolveProviderIdentity(\n config: DocevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): Promise<{ provider: ConcreteProvider; model: string }> {\n const selection = selectProvider(config, flags, ev);\n const { provider, model } = selection;\n assertKnownProvider(provider, toDocevalsError);\n assertModelHasProvider(provider, model, CONFIG_KEY, toDocevalsError);\n announceSelection(selection);\n return resolveIdentity(providerSpecFor(config, { provider, model: model ?? null }), toDocevalsError);\n}\n\n/** Construct a provider for an identity already resolved. */\nexport function constructProvider(\n config: DocevalsConfig,\n identity: { provider: ConcreteProvider; model: string },\n): InferenceProvider {\n try {\n return makeInferenceProvider(providerSpecFor(config, identity));\n } catch (e) {\n // The library raises its own InferenceError (missing API key). It must\n // surface as a DocevalsError: `run` degrades to deterministic-only evals on\n // a DocevalsError and rethrows anything else, and cli.ts fail() maps only\n // DocevalsError to exit 2. Letting a foreign error type through turns \"no\n // API key configured\" from a warning into an unhandled stack trace.\n throw new DocevalsError(errorMessage(e));\n }\n}\n\n/** Select, check, detect and construct: the provider a verb sends pages to. */\nexport async function makeProvider(\n config: DocevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): Promise<InferenceProvider> {\n return constructProvider(config, await resolveProviderIdentity(config, flags, ev));\n}\n","/**\n * Script generation: turns a plain-language deterministic assertion (a\n * command-graded eval with no command) into a standalone Node .mjs check\n * script written parallel to the documentation, then persists the command\n * reference back into the frontmatter (or config) — no inline scripts.\n * Generation is single-shot: the output is code, verified by execution and\n * version-control review rather than ensemble consensus.\n */\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, extname, join, relative, resolve } from \"node:path\";\nimport type { DocevalsConfig } from \"../core/config.js\";\nimport type {\n GenerateFn,\n GenerationRefusal,\n JudgeOptions,\n} from \"../core/engine.js\";\nimport { updateConfigEval, updatePageEval } from \"../core/frontmatter-edit.js\";\nimport {\n EVALS_KEY,\n EvalWriter,\n manifestEvalList,\n updateManifestEval,\n type WriteHome,\n} from \"../core/write-location.js\";\nimport { sha256 } from \"../judge/cache.js\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport type { GraderTarget } from \"./types.js\";\nimport { DocevalsError } from \"../types.js\";\n\nexport const SCRIPTGEN_VERSION = 2;\n\nexport const SCRIPTGEN_SYSTEM_PROMPT = [\n \"You write small, self-contained Node.js check scripts that verify a\",\n \"deterministic assertion about a documentation page.\",\n \"\",\n \"Contract for every script:\",\n \"- ES module (.mjs) using only Node.js built-in modules. No dependencies.\",\n \"- The page's absolute path arrives as process.argv[2] (also MANNI_DOCEVALS_FILE).\",\n \"- Exit 0 when the assertion holds, 1 when it fails, 2 on operational error.\",\n \"- On failure, print a short human-readable reason to stderr.\",\n \"- Deterministic: no network access, no spawning processes, no randomness.\",\n \"- The page content may start with a YAML frontmatter block fenced by ---\",\n \" lines; account for it when checking body content.\",\n \"- Prefer simple, reviewable logic (regex/string checks) over cleverness.\",\n \"Respond with JSON: { \\\"code\\\": \\\"<the full script source>\\\" }.\",\n].join(\"\\n\");\n\nconst SCRIPT_SCHEMA = {\n type: \"object\",\n required: [\"code\"],\n properties: {\n code: { type: \"string\", minLength: 1 },\n notes: { type: \"string\" },\n },\n additionalProperties: false,\n} as const;\n\nexport function buildScriptgenUser(\n assertion: string,\n evalName: string,\n file: string,\n body: string,\n): string {\n // No cap. Generation produces one script, so there is nothing to merge and\n // splitting has no meaning here — but truncating was worse than either: a\n // script generated from the first 6000 characters expresses an assertion\n // about a page whose rest the model never read, and nothing downstream could\n // tell that from a script generated with full sight of it. If the body\n // overflows the model's context the call fails, and a failed generation is\n // already an errored result (ADR 01022) rather than a half-informed script.\n return [\n `# Assertion to check`,\n assertion,\n \"\",\n `# Eval name`,\n evalName,\n \"\",\n `# Page path`,\n file,\n \"\",\n \"# Current page content (for grounding — the script must express the\",\n \"# assertion generally, not hardcode this exact content)\",\n \"\",\n body,\n ].join(\"\\n\");\n}\n\nexport interface ScriptLocation {\n /** Absolute path the script file is written to. */\n scriptAbsPath: string;\n /** Command array persisted into the eval (path relative to its cwd). */\n command: string[];\n}\n\n/** Where a generated script lives and how the eval invokes it. */\nexport function scriptLocationFor(\n target: GraderTarget,\n config: DocevalsConfig,\n root: string,\n): ScriptLocation {\n const ev = target.eval;\n const page = target.plan.page;\n if (ev.source === \"page\") {\n const pageDir = dirname(page.absPath);\n const pattern = config.scripts.dir;\n const dir = pattern.includes(\"{docDir}\")\n ? pattern.replaceAll(\"{docDir}\", pageDir)\n : resolve(root, pattern);\n const base = basename(page.absPath, extname(page.absPath));\n const scriptAbsPath = join(dir, `${base}.${ev.name}.mjs`);\n const rel = relative(pageDir, scriptAbsPath).replace(/\\\\/g, \"/\");\n return { scriptAbsPath, command: [\"node\", rel, \"{file}\"] };\n }\n const dir = resolve(config.configDir, config.scripts.configDir);\n const scriptAbsPath = join(dir, `${ev.name}.mjs`);\n const rel = relative(config.configDir, scriptAbsPath).replace(/\\\\/g, \"/\");\n return { scriptAbsPath, command: [\"node\", rel, \"{file}\"] };\n}\n\nfunction header(assertion: string, evalName: string): string {\n return [\n \"// manni docevals generated check\",\n `// Eval: ${evalName}`,\n `// Assertion: ${assertion.replace(/\\s+/g, \" \").trim()}`,\n \"// Exit 0 = pass, 1 = fail, 2 = operational error.\",\n \"\",\n ].join(\"\\n\");\n}\n\nexport interface ScriptgenDeps {\n /**\n * The provider, or how to get one. A function is called only when a target\n * actually needs a script, so a run with nothing to generate never resolves\n * (and, under `auto`, never detects) a provider.\n */\n provider: InferenceProvider | (() => Promise<InferenceProvider>);\n root: string;\n}\n\n/** Build the engine's generation stage around a concrete provider. */\nexport function makeGenerateScripts(deps: ScriptgenDeps): GenerateFn {\n return async (\n targets: GraderTarget[],\n config: DocevalsConfig,\n _options: JudgeOptions,\n ) => {\n const generatedPaths: string[] = [];\n const refusals: GenerationRefusal[] = [];\n // Config-sourced evals generate once even when used by many pages.\n const doneConfigEvals = new Set<string>();\n let provider: InferenceProvider | undefined;\n // Proposal 0047: the command reference goes where the eval lives. Built\n // once per generation pass, and only when a page-sourced eval needs it.\n let writer: EvalWriter | undefined;\n const getWriter = (): EvalWriter => (writer ??= EvalWriter.for(config, deps.root, []));\n\n for (const target of targets) {\n const ev = target.eval;\n if (!ev.assertion) continue; // Nothing to generate from.\n if (ev.source === \"config\" && doneConfigEvals.has(ev.name)) continue;\n\n // Where the reference will be persisted, decided before the model is\n // asked: a page whose manifest has no entry for it can hold no command,\n // and paying for a script that cannot be referenced helps nobody.\n const page = target.plan.page;\n let home: WriteHome | undefined;\n if (ev.source === \"page\") {\n home = await getWriter().homeFor(\n page.file,\n page.frontmatter.data,\n EVALS_KEY,\n );\n if (home.kind === \"url\") {\n throw getWriter().urlRefusal(home, EVALS_KEY);\n }\n if (home.kind === \"no-entry\") {\n refusals.push({ file: page.file, evalName: ev.name, message: home.message });\n continue;\n }\n }\n\n if (provider === undefined) {\n try {\n provider =\n typeof deps.provider === \"function\" ? await deps.provider() : deps.provider;\n } catch (e) {\n // No provider for any target: say why once, and let the engine\n // report each eval it could not generate for.\n if (!(e instanceof DocevalsError)) throw e;\n return { generatedPaths, refusals, unavailable: e.message };\n }\n }\n\n const location = scriptLocationFor(target, config, deps.root);\n let code: string;\n try {\n const response = await provider.completeJSON({\n system: SCRIPTGEN_SYSTEM_PROMPT,\n user: buildScriptgenUser(\n ev.assertion,\n ev.name,\n target.plan.page.file,\n target.plan.page.body,\n ),\n schema: SCRIPT_SCHEMA,\n temperature: 0,\n });\n const json = response.json as { code?: unknown };\n if (typeof json.code !== \"string\" || json.code.length === 0) {\n continue; // Generation failed; the engine reports the eval as errored.\n }\n code = json.code;\n } catch {\n continue;\n }\n\n mkdirSync(dirname(location.scriptAbsPath), { recursive: true });\n writeFileSync(\n location.scriptAbsPath,\n // Exactly one final newline, whatever the model sent: the script is\n // committed and reviewed, and a missing one shows in every diff.\n `${header(ev.assertion, ev.name)}${code.trim()}\\n`,\n );\n generatedPaths.push(\n relative(deps.root, location.scriptAbsPath).replace(/\\\\/g, \"/\"),\n );\n\n const updates = {\n command: location.command,\n \"generated-assertion-hash\": sha256(ev.assertion),\n };\n if (ev.source === \"page\" && home?.kind === \"manifest\") {\n // The evals live in the manifest, so the command reference does too:\n // the one entry is rewritten and no other byte of the file changes.\n const at = getWriter();\n const list = manifestEvalList(\n await at.readManifest(home, EVALS_KEY),\n home.file,\n home.entry,\n );\n const next = updateManifestEval(list, ev.name, updates);\n if (next === undefined) {\n throw new DocevalsError(\n `${home.file}: eval \"${ev.name}\" not found in the entry for ${home.entry}`,\n );\n }\n await at.writeManifest(home, EVALS_KEY, next);\n } else if (ev.source === \"page\") {\n const abs = page.absPath;\n const updated = updatePageEval(\n readFileSync(abs, \"utf8\"),\n page.file,\n ev.name,\n updates,\n );\n writeFileSync(abs, updated);\n } else {\n const updated = updateConfigEval(\n readFileSync(config.configPath, \"utf8\"),\n config.configPath,\n ev.name,\n updates,\n );\n writeFileSync(config.configPath, updated);\n doneConfigEvals.add(ev.name);\n }\n\n // Mutate the in-memory eval so this run executes the fresh script.\n if (ev.source === \"config\") {\n // A config-sourced eval appears once per page; every target shares\n // the same central definition and script.\n for (const t of targets) {\n if (t.eval.name === ev.name && t.eval.source === \"config\") {\n t.eval.command = scriptLocationFor(t, config, deps.root).command;\n t.eval.generatedAssertionHash =\n updates[\"generated-assertion-hash\"];\n }\n }\n } else {\n // Page-sourced evals are per-page: same-named inline evals on other\n // pages have their own assertions and generate independently.\n target.eval.command = location.command;\n target.eval.generatedAssertionHash = updates[\"generated-assertion-hash\"];\n }\n }\n return { generatedPaths, refusals };\n };\n}\n","/**\n * Surgical YAML edits. Only the frontmatter block (or the named config eval)\n * is re-serialized via the `yaml` Document API — the page body is carried\n * over byte-for-byte, and untouched YAML keeps its comments and ordering.\n * YAML frontmatter only; TOML/JSON frontmatter cannot be edited in place.\n */\nimport { parseDocument, Document, YAMLMap, YAMLSeq, isMap, isScalar } from \"yaml\";\nimport { DocevalsError } from \"../types.js\";\nimport { leadingFrontmatterFormat } from \"./discover.js\";\n\n/** Top-level key manni docevals owns inside the shared manni config. */\nconst NAMESPACE = \"docevals\";\n\n/** The byte-order mark a page may open with, carried through edits untouched. */\nconst BOM = \"\\uFEFF\";\n\nexport interface EvalUpdates {\n grader?: string;\n command?: string[];\n /** sha256 of the assertion at generation time; flat, per the vocabulary. */\n \"generated-assertion-hash\"?: string;\n}\n\ninterface Split {\n /** The opening fence line including its newline. */\n open: string;\n /** Raw YAML between the fences. */\n block: string;\n /** Everything from the closing fence to EOF, byte-identical. */\n suffix: string;\n /** Line ending style of the file. */\n eol: \"\\n\" | \"\\r\\n\";\n}\n\nfunction splitYamlFrontmatter(content: string, path: string): Split {\n const bom = content.startsWith(BOM) ? BOM : \"\";\n const body = bom ? content.slice(1) : content;\n const openMatch = /^---(\\r?\\n)/.exec(body);\n if (!openMatch) {\n throw new DocevalsError(\n `${path}: no YAML frontmatter block to edit (only YAML frontmatter is editable)`,\n );\n }\n const eol: \"\\n\" | \"\\r\\n\" = openMatch[1] === \"\\r\\n\" ? \"\\r\\n\" : \"\\n\";\n // Keep line endings. The match above guarantees an opening line.\n const [openLine = \"\", ...rest] = body.split(/(?<=\\n)/);\n let offset = openLine.length;\n for (const line of rest) {\n const stripped = line.replace(/\\r?\\n$/, \"\");\n if (stripped === \"---\" || stripped === \"...\") {\n const blockEnd = offset;\n return {\n open: bom + openLine,\n block: body.slice(openLine.length, blockEnd),\n suffix: body.slice(blockEnd),\n eol,\n };\n }\n offset += line.length;\n }\n throw new DocevalsError(`${path}: unterminated frontmatter block`);\n}\n\nfunction applyUpdates(\n doc: Document,\n node: YAMLMap,\n updates: EvalUpdates,\n): void {\n if (updates.grader !== undefined) node.set(\"grader\", updates.grader);\n if (updates.command !== undefined) {\n const seq = doc.createNode(updates.command) as YAMLSeq;\n seq.flow = true; // [\"node\", \"script.mjs\", \"{file}\"] on one line\n node.set(\"command\", seq);\n }\n const hash = updates[\"generated-assertion-hash\"];\n if (hash !== undefined) node.set(\"generated-assertion-hash\", hash);\n}\n\n/**\n * The eval list. `evals` is the list itself, or the single-assertion string\n * shorthand — which has no map node to edit, so it is not a sequence here.\n */\nfunction evalSeq(doc: Document): YAMLSeq | undefined {\n const node = doc.get(\"evals\", true);\n return node instanceof YAMLSeq ? node : undefined;\n}\n\nfunction findEvalNode(\n doc: Document,\n evalName: string,\n): YAMLMap | undefined {\n const evals = evalSeq(doc);\n if (!evals) return undefined;\n for (const item of evals.items) {\n if (isMap(item)) {\n const name = item.get(\"id\") ?? item.get(\"use\");\n if (name === evalName) return item;\n }\n }\n return undefined;\n}\n\n/**\n * Update an inline eval in a page's YAML frontmatter. Returns the new file\n * content; the body after the closing fence is byte-identical to the input.\n */\nexport function updatePageEval(\n content: string,\n path: string,\n evalName: string,\n updates: EvalUpdates,\n): string {\n const { open, block, suffix, eol } = splitYamlFrontmatter(content, path);\n const doc = parseDocument(block);\n if (doc.errors.length > 0) {\n throw new DocevalsError(\n `${path}: cannot edit frontmatter — ${doc.errors[0]?.message ?? \"parse error\"}`,\n );\n }\n const node = findEvalNode(doc, evalName);\n if (!node) {\n throw new DocevalsError(\n `${path}: eval \"${evalName}\" not found in frontmatter`,\n );\n }\n applyUpdates(doc, node, updates);\n let newBlock = doc.toString();\n if (eol === \"\\r\\n\") newBlock = newBlock.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return open + newBlock + suffix;\n}\n\n/**\n * Update a named eval in manni.config.yaml text.\n *\n * The eval library lives under the tool's own namespace — `manni.config.yaml`\n * is shared across the manni family. Navigating to a root `evals:` finds\n * nothing in a real config, so generation for a config-sourced eval failed\n * with \"eval not found in config\" against every file the loader accepts.\n */\nexport function updateConfigEval(\n configText: string,\n configPath: string,\n evalName: string,\n updates: EvalUpdates,\n): string {\n const doc = parseDocument(configText);\n if (doc.errors.length > 0) {\n throw new DocevalsError(\n `${configPath}: cannot edit config — ${doc.errors[0]?.message ?? \"parse error\"}`,\n );\n }\n const node = doc.getIn([NAMESPACE, \"evals\", evalName]);\n if (!isMap(node)) {\n throw new DocevalsError(\n `${configPath}: eval \"${evalName}\" not found in config`,\n );\n }\n applyUpdates(doc, node, updates);\n return doc.toString();\n}\n\nexport interface NewEvalEntry {\n /** Kebab-case id. Required on object entries — position-derived names\n * orphan cached verdicts whenever entries move. */\n id: string;\n assertion: string;\n type?: string;\n grader?: string;\n evidence?: string;\n examples?: { pass?: string | string[]; fail?: string | string[] };\n severity?: string;\n}\n\n/**\n * Ordered plain object for a new inline eval, with undefined fields dropped.\n * Exported because an eval whose location puts it in a manifest is written as\n * this same object, spliced into the page's entry rather than appended here.\n */\nexport function entryObject(entry: NewEvalEntry): Record<string, unknown> {\n const obj: Record<string, unknown> = { id: entry.id, assertion: entry.assertion };\n if (entry.type !== undefined) obj.type = entry.type;\n if (entry.grader !== undefined) obj.grader = entry.grader;\n if (entry.evidence !== undefined) obj.evidence = entry.evidence;\n if (entry.examples !== undefined) obj.examples = entry.examples;\n if (entry.severity !== undefined) obj.severity = entry.severity;\n return obj;\n}\n\n/** The page-level key `fill` records machine-proposed evals in (proposal 0046). */\nconst META_PROVENANCE_KEY = \"meta-provenance\";\n\nfunction assertNoCollision(seq: YAMLSeq, name: string, path: string): void {\n for (const item of seq.items) {\n const existing = isMap(item)\n ? item.get(\"id\") ?? item.get(\"use\")\n : isScalar(item)\n ? item.value\n : undefined;\n if (existing === name) {\n throw new DocevalsError(\n `${path}: eval \"${name}\" already exists in frontmatter`,\n );\n }\n }\n}\n\n/**\n * Append inline evals to a page's YAML frontmatter, creating the `evals` key\n * — or the frontmatter block itself — when missing. The body stays\n * byte-identical; existing evals are never modified or reordered.\n *\n * `metaProvenance`, when given, is the page's whole `meta-provenance` list with\n * the new evals already merged in, written in the same edit. The merge is the\n * caller's, as `manni meta fill`'s is, so both tools record attribution one\n * way.\n */\nexport function appendPageEvals(\n content: string,\n path: string,\n entries: NewEvalEntry[],\n metaProvenance?: readonly unknown[],\n): string {\n const format = leadingFrontmatterFormat(content);\n if (format === \"toml\" || format === \"json\") {\n // Synthesizing a YAML block here would leave the page with two\n // frontmatter blocks. Only YAML frontmatter can be edited in place.\n throw new DocevalsError(\n `${path}: only YAML frontmatter can be edited (found ${format} frontmatter)`,\n );\n }\n\n const bom = content.startsWith(BOM) ? BOM : \"\";\n const stripped = bom ? content.slice(1) : content;\n const eol: \"\\n\" | \"\\r\\n\" = stripped.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n\n if (format === undefined) {\n // No frontmatter: synthesize a block above the untouched body.\n const doc = new Document(\n entries.length === 0 ? {} : { evals: entries.map(entryObject) },\n );\n if (metaProvenance) doc.set(META_PROVENANCE_KEY, doc.createNode(metaProvenance));\n let block = doc.toString();\n if (eol === \"\\r\\n\") block = block.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return `${bom}---${eol}${block}---${eol}${stripped}`;\n }\n\n const { open, block, suffix, eol: blockEol } = splitYamlFrontmatter(content, path);\n const doc = parseDocument(block);\n if (doc.errors.length > 0) {\n throw new DocevalsError(\n `${path}: cannot edit frontmatter — ${doc.errors[0]?.message ?? \"parse error\"}`,\n );\n }\n\n // Nothing to append: the evals of this page went to the manifest that owns\n // them, and only `meta-provenance` is left for the page. Creating an empty\n // `evals:` here would put the key in both places, which is exactly the\n // collision routing the write exists to avoid.\n if (entries.length === 0) {\n if (metaProvenance) doc.set(META_PROVENANCE_KEY, doc.createNode(metaProvenance));\n let onlyEntry = doc.toString();\n if (blockEol === \"\\r\\n\") onlyEntry = onlyEntry.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return open + onlyEntry + suffix;\n }\n\n let seq = evalSeq(doc);\n if (!seq) {\n const node = doc.get(\"evals\", true);\n if (node !== undefined) {\n // A single-assertion string, or something else entirely. Appending would\n // have to rewrite the existing declaration, which is the caller's call to\n // make, not a silent side effect of adding one eval.\n throw new DocevalsError(\n `${path}: the evals key in frontmatter is not a list — expand the ` +\n `string shorthand into a list before appending`,\n );\n }\n seq = doc.createNode([]);\n doc.set(\"evals\", seq);\n }\n for (const entry of entries) {\n assertNoCollision(seq, entry.id, path);\n seq.add(doc.createNode(entryObject(entry)));\n }\n if (metaProvenance) doc.set(META_PROVENANCE_KEY, doc.createNode(metaProvenance));\n let newBlock = doc.toString();\n if (blockEol === \"\\r\\n\") newBlock = newBlock.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return open + newBlock + suffix;\n}\n\n/** True when the eval exists as an editable (map) entry in the frontmatter. */\nexport function hasEditableEval(content: string, evalName: string): boolean {\n try {\n const { block } = splitYamlFrontmatter(content, \"\");\n const doc = parseDocument(block);\n return findEvalNode(doc, evalName) !== undefined;\n } catch {\n return false;\n }\n}\n\n/** Used by promote: check a string-shorthand eval entry (not editable in place). */\nexport function isScalarEvalEntry(content: string, evalName: string): boolean {\n try {\n const { block } = splitYamlFrontmatter(content, \"\");\n const doc = parseDocument(block);\n const evals = evalSeq(doc);\n if (!evals) return false;\n return evals.items.some((i) => isScalar(i) && i.value === evalName);\n } catch {\n return false;\n }\n}\n","/**\n * Where docevals writes each key it owns (proposal 0047, §3 and §4).\n *\n * Chunk 1 made reading follow a key's location: a manifest that owns `evals`\n * supplies them, and everything downstream sees them as the page's own. A\n * tool that reads that way and writes to the page anyway puts the value in\n * two places at once, which `meta validate` then reports as an\n * `external:owned` collision on every page it touched.\n *\n * So every write goes through the rule `manni meta fill` already follows:\n *\n * - a **local manifest** of one of the page's collections owns the key: the\n * value is spliced into the page's entry there, and nothing else in the\n * file changes;\n * - the manifest **joins on a field the page lacks**: there is no entry to\n * hold the value, and the write is refused for that file, in meta's own\n * sentence;\n * - a **URL manifest** owns it: nothing can be written to a fetched file,\n * and for an eval key that is the refusal chunk 1 already makes at load;\n * - **no manifest owns it**: the page keeps it, with the offer (P1) and the\n * warnings (W1, W2) meta's writers use when the schema prefers external\n * metadata.\n *\n * The rule is meta's, and so is every helper that decides it: `keyHome`,\n * `offerExternalHomes`, `externalWriteWarnings` and `spliceManifestValue`,\n * all reached through `src/meta/internal.ts`. What is docevals' own is the\n * preference, which comes from the evals vocabulary rather than a validator:\n * the vocabulary this tool implements marks its three keys, so the answer is\n * in the schema docevals already bundles.\n */\nimport { resolve } from \"node:path\";\nimport {\n LOCATION_KEYWORD,\n Validator,\n writeFileAtomic,\n} from \"../../meta/index.js\";\nimport {\n externalWriteWarnings,\n keyHome,\n offerExternalHomes,\n readManifestValue,\n spliceManifestValue,\n type ExternalWrite,\n type ProposedHome,\n type RelocateResult,\n type RelocationContext,\n} from \"../../meta/internal.js\";\nimport { readManifestOrEmpty } from \"../../shared/manifest-cas.js\";\nimport type { Confirm } from \"../../shared/prompt.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { DocevalsError } from \"../types.js\";\nimport { frontmatterSchema } from \"../schema.js\";\nimport type { DocevalsConfig } from \"./config.js\";\nimport { urlManifestRefusal } from \"./external.js\";\n\n/** The page key holding the eval list, the one docevals appends to and edits. */\nexport const EVALS_KEY = \"evals\";\n\n/** The key `fill` records machine-proposed evals in (proposal 0046). */\nexport const META_PROVENANCE_KEY = \"meta-provenance\";\n\n/**\n * Whether `manni:evals:1.0.0` marks `key` as belonging in external metadata.\n *\n * Read from the bundled vocabulary rather than from a resolved schema set.\n * Every docevals page is validated against it (`core/resolve.ts`), so it is\n * the schema that governs these keys, and a preference read from it cannot\n * disagree with the one `meta validate` reads. A key it does not mark stays\n * on the page with no warning.\n */\nexport function prefersExternal(key: string): boolean {\n const properties = frontmatterSchema.properties;\n if (typeof properties !== \"object\" || properties === null) return false;\n const property = (properties as Record<string, unknown>)[key];\n if (typeof property !== \"object\" || property === null) return false;\n return (property as Record<string, unknown>)[LOCATION_KEYWORD] === \"external\";\n}\n\n/** Where one key of one page goes. */\nexport type WriteHome =\n /** The page's own frontmatter. `proposed` is the home relocation would give it. */\n | { kind: \"page\"; prefersExternal: boolean; proposed: ProposedHome }\n /** The page's entry in a local manifest. */\n | {\n kind: \"manifest\";\n /** As the run reports it. */\n file: string;\n absPath: string;\n /** `path`, or the page field the manifest joins on. */\n join: string;\n entry: string;\n /**\n * The manifest is the page's own, resolved from a `{page}` pattern\n * (proposal 0058). It may not exist yet: the first write creates it,\n * and a read of it before then holds nothing.\n */\n perPage: boolean;\n }\n /** A manifest joins on a field this page does not carry. */\n | { kind: \"no-entry\"; message: string }\n /** A URL manifest owns the key; nothing fetched can be written. */\n | { kind: \"url\"; collection: string; file: string };\n\n/** meta's sentence for a page a joined manifest has no entry for. */\nexport function noEntryMessage(\n label: string,\n join: string,\n file: string,\n key: string,\n): string {\n return `${label} carries no ${join}, which ${file} joins on, so its ${key} has no entry there.`;\n}\n\n/** What `offer` reports back while it asks. */\nexport interface OfferHooks {\n confirm: Confirm;\n onNotice?: (message: string) => void;\n onRelocated?: (result: RelocateResult) => void;\n}\n\n/**\n * The run's writer: where each key goes, and the manifest splices that put it\n * there. One per run, because the relocation context it reads is the config\n * as the run found it, and an accepted offer changes that config.\n */\nexport class EvalWriter {\n private readonly landed: ExternalWrite[] = [];\n\n private constructor(\n private readonly ctx: RelocationContext,\n private readonly configSource: string,\n ) {}\n\n /**\n * Build the writer for a run. `targets` are the positional paths as typed,\n * which is where a page in no collection gets its proposed home from; a run\n * that took its paths from the collections passes none.\n *\n * The context is built from the config docevals already loaded rather than\n * by loading it again through meta. A `manni.config.yaml` carrying only a\n * `docevals:` key is a single-tool file to the metadata tool, which refuses\n * it; docevals reads it every run, and where its own evals go cannot depend\n * on whether a sibling can read the same file. The collections are the\n * declared ones, since a page named by path is still a member of whatever\n * contains it. `config: null` leaves the page's schema set to the page,\n * which is enough: the keys this writer homes are named outright in the\n * relocation it plans.\n */\n static for(\n config: DocevalsConfig,\n cwd: string,\n targets: readonly string[],\n ): EvalWriter {\n const noConfig = config.configSource === null;\n const collections = config.collections;\n return new EvalWriter(\n {\n cwd,\n // Page labels are relative to the run's discovery root, so a manifest\n // path this writer reports is spelled against the same directory\n // `core/external.ts` reports a merged value's source against.\n base: cwd,\n noConfig,\n config: null,\n ...(noConfig ? {} : { configDir: config.configDir, configPath: config.configPath }),\n collections,\n declaredCollections: collections,\n targets,\n validator: new Validator(),\n },\n config.configSource ?? cwd,\n );\n }\n\n /** Where `key` of the page labelled `label` goes. `data` is its metadata. */\n async homeFor(\n label: string,\n data: Readonly<Record<string, unknown>>,\n key: string,\n ): Promise<WriteHome> {\n const home = await keyHome(this.ctx, label, data, key);\n if (home.kind === \"url\") {\n return { kind: \"url\", collection: home.collection, file: home.file };\n }\n if (home.kind === \"manifest\") {\n if (home.entry === undefined) {\n return {\n kind: \"no-entry\",\n message: noEntryMessage(label, home.join, home.file, key),\n };\n }\n return {\n kind: \"manifest\",\n file: home.file,\n absPath: home.absPath,\n join: home.join,\n entry: home.entry,\n perPage: home.perPage,\n };\n }\n return { kind: \"page\", prefersExternal: prefersExternal(key), proposed: home.home };\n }\n\n /**\n * The refusal for an eval key a URL manifest owns, in chunk 1's wording. A\n * run reaches it only where the load-time refusal could not: a manifest\n * declared for a collection whose pages this run never merged.\n */\n urlRefusal(home: { collection: string }, key: string): DocevalsError {\n return new DocevalsError(urlManifestRefusal(this.configSource, home.collection, key));\n }\n\n /** Record that `key` stayed on the page, for the W1 and W2 lines. */\n stayedOnPage(label: string, key: string, proposed: ProposedHome): void {\n this.landed.push({ label, key, home: proposed });\n }\n\n /** The W1 and W2 lines for everything that stayed on a page. Without the prefix. */\n warnings(dryRun: boolean): string[] {\n return this.landed.length === 0 ? [] : externalWriteWarnings(this.landed, dryRun);\n }\n\n /**\n * Ask P1 once per collection the flagged writes would be homed in. Returns\n * true when a relocation was applied, which leaves the caller's config,\n * pages and this writer stale: rebuild all three before writing.\n */\n async offer(writes: readonly ExternalWrite[], hooks: OfferHooks): Promise<boolean> {\n if (writes.length === 0) return false;\n const applied = await offerExternalHomes(this.ctx, writes, hooks);\n return applied.size > 0;\n }\n\n /** The value the manifest holds for this page's entry, or `undefined`. */\n async readManifest(\n home: { absPath: string; entry: string; join: string; perPage: boolean },\n key: string,\n ): Promise<unknown> {\n return readManifestValue(await this.text(home.absPath, home.perPage), {\n entry: home.entry,\n key,\n join: home.join,\n });\n }\n\n /** Write `value` into this page's entry, changing no other byte of the file. */\n async writeManifest(\n home: { absPath: string; entry: string; join: string; file: string; perPage: boolean },\n key: string,\n value: unknown,\n ): Promise<void> {\n const text = await this.text(home.absPath, home.perPage);\n let spliced: string;\n try {\n spliced = spliceManifestValue(text, {\n entry: home.entry,\n key,\n value,\n join: home.join,\n file: home.file,\n }).text;\n } catch (e) {\n // meta's refusal, in this tool's error class, exactly as cite reports it.\n throw new DocevalsError(errorMessage(e));\n }\n // A per-page manifest may be the first file in its directory.\n if (spliced !== text) {\n await writeFileAtomic(home.absPath, spliced, { createParents: true });\n }\n }\n\n /**\n * The manifest's bytes. A per-page manifest that is not on disk yet is a\n * page with nothing recorded, held as empty text and created by the write,\n * exactly as `manni meta fill` holds one. A missing concrete manifest is\n * refused, as it always was.\n */\n private async text(absPath: string, perPage: boolean): Promise<string> {\n try {\n return await readManifestOrEmpty(absPath, perPage);\n } catch (e) {\n throw new DocevalsError(\n `${resolve(absPath)} could not be read: ${errorMessage(e)}`,\n );\n }\n }\n}\n\n/**\n * The eval list a manifest holds, as a list. An entry whose `evals` is a\n * string shorthand, or anything else, is refused rather than rewritten: the\n * page's own shorthand is refused the same way, and expanding one is the\n * author's call rather than a silent side effect of adding an eval.\n */\nexport function manifestEvalList(value: unknown, file: string, entry: string): unknown[] {\n if (value === undefined || value === null) return [];\n if (Array.isArray(value)) return [...(value as readonly unknown[])];\n throw new DocevalsError(\n `${file}: the evals key of ${entry} is not a list — expand the string ` +\n `shorthand into a list before appending`,\n );\n}\n\n/** The updates `generate` and `promote` persist onto one eval entry. */\nexport interface ManifestEvalUpdates {\n grader?: string;\n command?: string[];\n \"generated-assertion-hash\"?: string;\n}\n\n/**\n * Apply `updates` to the entry named `name` in a manifest's eval list, and\n * return the new list. `undefined` when the list holds no such entry, which\n * is a caller's refusal rather than a silent no-op.\n */\nexport function updateManifestEval(\n list: readonly unknown[],\n name: string,\n updates: ManifestEvalUpdates,\n): unknown[] | undefined {\n const index = list.findIndex((item) => named(item) === name);\n const held = index === -1 ? undefined : list[index];\n if (held === undefined) return undefined;\n // Only the fields actually being set. An `undefined` in the value would be\n // dropped on the way to YAML and then fail the splice's read-back, which\n // compares what it wrote against what the file now holds.\n const set: Record<string, unknown> = { ...(held as Record<string, unknown>) };\n if (updates.grader !== undefined) set.grader = updates.grader;\n if (updates.command !== undefined) set.command = updates.command;\n const hash = updates[\"generated-assertion-hash\"];\n if (hash !== undefined) set[\"generated-assertion-hash\"] = hash;\n const next = [...list];\n next[index] = set;\n return next;\n}\n\n/** The id a manifest's eval entry answers to, or `undefined` for a shorthand. */\nfunction named(item: unknown): string | undefined {\n if (typeof item !== \"object\" || item === null || Array.isArray(item)) return undefined;\n const entry = item as Record<string, unknown>;\n const id = entry.id ?? entry.use;\n return typeof id === \"string\" ? id : undefined;\n}\n","/**\n * `manni docevals run` — execute the full pipeline. Deterministic graders run\n * first (cheap-first ordering); the AI judge stage runs when a provider is\n * available and not disabled.\n */\nimport { runEvals, type EngineReport, type JudgeFn, type RunOptions } from \"../core/engine.js\";\nimport { loadRunConfig, type DocevalsConfig } from \"../core/config.js\";\nimport { runConfigOptions, type DocumentInputOptions } from \"../core/discover.js\";\nimport { render, type ReportFormat } from \"../reporters/index.js\";\nimport { makeJudge } from \"../judge/judge.js\";\nimport {\n assertProviderSelection,\n makeProvider,\n selectProvider,\n} from \"../judge/provider.js\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport { makeGenerateScripts } from \"../graders/scriptgen.js\";\nimport type { GenerateFn } from \"../core/engine.js\";\nimport { DocevalsError } from \"../types.js\";\nimport {\n isExecutionGrant,\n unknownGrantsMessage,\n type ExecutionGrant,\n} from \"../../shared/execution.js\";\nimport { warn } from \"../../shared/warn.js\";\n\nexport interface RunCommandOptions extends DocumentInputOptions {\n format?: ReportFormat;\n deterministicOnly?: boolean;\n aiOnly?: boolean;\n /**\n * Run only these execution grants, of those the config holds. Absent keeps\n * every grant `execution.allow` holds, which is every grant by default.\n */\n allowExecution?: string[];\n /** `false` clears every grant for this run. */\n execution?: boolean;\n generate?: boolean;\n cache?: boolean;\n failOnReview?: boolean;\n provider?: string;\n model?: string;\n /** Run inference on this machine, with llama-cpp, over any configured or eval-level provider. */\n local?: boolean;\n runs?: number;\n chunkChars?: number;\n maxTurns?: number;\n evalNames?: string[];\n suite?: string;\n /** Evaluate only pages that differ between this git ref and HEAD (ADR 01040). */\n since?: string;\n /**\n * Evaluate only pages whose file or eval manifest changed within this\n * duration back from now, such as `7d`. With `since`, a page must satisfy both.\n */\n newerThan?: string;\n baseline?: string | boolean;\n writeBaseline?: string | boolean;\n toolVersion?: string;\n cwd?: string;\n}\n\n/**\n * Grants, checked rather than asserted.\n *\n * The CLI validates in `collectGrant`, but this is also the entry point for\n * programmatic callers. An unknown grant that silently matched nothing would\n * narrow the run to no grant at all: every command eval skipped, exit 0, which\n * reads as a clean corpus rather than a misspelled grant.\n */\nfunction asGrants(values: string[] | undefined): ExecutionGrant[] | undefined {\n if (values === undefined) return undefined;\n const unknown = values.filter((v) => !isExecutionGrant(v));\n if (unknown.length > 0) {\n throw new DocevalsError(unknownGrantsMessage(unknown));\n }\n return values as ExecutionGrant[];\n}\n\nexport async function runRun(\n paths: string[],\n options: RunCommandOptions = {},\n engineOverrides: Partial<RunOptions> = {},\n): Promise<EngineReport> {\n const cwd = options.cwd ?? process.cwd();\n const judgeOptions = {\n provider: options.provider,\n model: options.model,\n local: options.local,\n runs: options.runs,\n chunkChars: options.chunkChars,\n noCache: options.cache === false,\n maxTurns: options.maxTurns ?? null,\n };\n\n // Loaded once and passed through to the engine — a run must not validate\n // the config twice or observe two different versions of it.\n const config: DocevalsConfig = loadRunConfig(runConfigOptions(paths, options), cwd);\n\n // A selection that cannot be right is a usage error, exit 2, whatever else\n // the run was asked to do: an unknown name or a model with no provider to\n // own it is a typo to fix, not a missing provider to degrade around.\n assertProviderSelection(selectProvider(config, judgeOptions));\n\n // Build the judge and generation stages unless deterministic-only or an\n // override supplies them. Both share one provider, resolved at most once.\n let judge: JudgeFn | undefined;\n let generateScripts: GenerateFn | undefined;\n let resolving: Promise<InferenceProvider> | undefined;\n const provider = (): Promise<InferenceProvider> =>\n (resolving ??= makeProvider(config, judgeOptions));\n // Per key, not per pair: an override supplying `judge` but not\n // `generateScripts` used to resolve a provider and build a judge that the\n // spread below then threw away.\n const wantsJudge = !(\"judge\" in engineOverrides);\n const wantsGeneration = !(\"generateScripts\" in engineOverrides);\n if (wantsJudge || wantsGeneration) {\n if (!options.deterministicOnly) {\n try {\n const resolved = await provider();\n if (wantsJudge) judge = makeJudge({ provider: resolved, root: cwd });\n if (wantsGeneration && options.generate !== false) {\n generateScripts = makeGenerateScripts({ provider: resolved, root: cwd });\n }\n } catch (e) {\n if (options.aiOnly || !(e instanceof DocevalsError)) throw e;\n // The warning is about the *judge*, and only the judge (ADR 01043).\n //\n // It used to read `|| options.generate === true`, meaning to fire when\n // generation had been explicitly requested. Commander cannot express\n // that: there is no `--generate` flag, so it defaults a `--no-generate`\n // key to `true` and the clause held on every invocation that was not\n // `--no-generate`. The only silent combination was the accidental\n // `--deterministic-only --no-generate`, and the standard no-key CI run\n // warned about the provider it had just been told to skip.\n warn(`provider unavailable — ${e.message}. Running deterministic evals only.`);\n }\n } else if (wantsGeneration && options.generate !== false) {\n // No judge, so the provider is wanted only if the corpus holds a command\n // eval with no command, which is not knowable here. It is resolved when\n // generation first needs it, so a deterministic run never detects a\n // provider — never probes the machine, never spawns the Claude CLI — to\n // generate nothing. Generation's own need for a provider it cannot have\n // is reported by the engine, where it is, as an `error` result naming\n // the eval and exiting 1.\n generateScripts = makeGenerateScripts({ provider, root: cwd });\n }\n }\n\n return runEvals({\n judge,\n generateScripts,\n config,\n configPath: options.config,\n noConfig: options.noConfig,\n paths,\n collection: options.collection,\n exclude: options.exclude,\n cwd: options.cwd,\n deterministicOnly: options.deterministicOnly,\n aiOnly: options.aiOnly,\n allowExecution: asGrants(options.allowExecution),\n execution: options.execution,\n generate: options.generate,\n failOnReview: options.failOnReview,\n evalNames: options.evalNames,\n suite: options.suite,\n since: options.since,\n newerThan: options.newerThan,\n baseline: options.baseline,\n writeBaseline: options.writeBaseline,\n toolVersion: options.toolVersion,\n judgeOptions,\n ...engineOverrides,\n });\n}\n\nexport { render };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO,SAAS;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,QAAQ;AAAA,IACpB,UAAU,QAAQ;AAAA,IAClB;AAAA,IACA,YAAY,QAAQ;AAAA,IACpB,SAAS,QAAQ;AAAA,IACjB,KAAK,QAAQ;AAAA,IACb,mBAAmB,QAAQ;AAAA,IAC3B,QAAQ,QAAQ;AAAA,IAChB,gBAAgB,SAAS,QAAQ,cAAc;AAAA,IAC/C,WAAW,QAAQ;AAAA,IACnB,UAAU,QAAQ;AAAA,IAClB,cAAc,QAAQ;AAAA,IACtB,WAAW,QAAQ;AAAA,IACnB,OAAO,QAAQ;AAAA,IACf,OAAO,QAAQ;AAAA,IACf,WAAW,QAAQ;AAAA,IACnB,UAAU,QAAQ;AAAA,IAClB,eAAe,QAAQ;AAAA,IACvB,aAAa,QAAQ;AAAA,IACrB;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;","names":["selectProvider","providerSpecFor","selectProvider","mkdirSync","readFileSync","writeFileSync","dirname","join","resolve","doc","block","META_PROVENANCE_KEY","join","dirname","dir","resolve","scriptAbsPath","join","rel","mkdirSync","writeFileSync","readFileSync","selectProvider"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/strategy/reporters/json.ts"],"sourcesContent":["/**\n * JSON output for every `manni strategy` command. A record is the same object\n * in `list` and `get`: its fields, where it was read, its parent, and what\n * names it. Paths are relative to the working directory.\n */\nimport type { StrategyReport } from \"../commands/findings.js\";\nimport type { RecordEntry } from \"../commands/list.js\";\nimport { displayPath } from \"../commands/run.js\";\nimport { titleOf } from \"./pretty.js\";\n\nexport function recordJson(entry: RecordEntry): Record<string, unknown> {\n const { record } = entry;\n // `title` is never absent: an untitled record shows its id, as `list` does.\n const out: Record<string, unknown> = { id: record.id, type: record.type, title: titleOf(record) };\n if (record.description !== undefined) out[\"description\"] = record.description;\n if (record.lifecycle !== undefined) out[\"lifecycle\"] = record.lifecycle;\n out[\"file\"] = entry.file;\n out[\"line\"] = record.line;\n // A journey's `personas` is always a list. A persona's `audience` is one value, as it is written.\n const parents = record.parents.map((p) => p.value);\n if (record.type === \"journey\") out[\"personas\"] = parents;\n if (record.type === \"persona\" && parents.length > 0) out[\"audience\"] = parents.length === 1 ? parents[0] : parents;\n if (entry.steps !== undefined && entry.coverage !== undefined) {\n out[\"steps\"] = entry.steps.map((step) => ({\n ...(step.stage === undefined ? {} : { stage: step.stage }),\n ...(step.doc === undefined ? {} : { doc: step.doc }),\n ...(step.exists === undefined ? {} : { exists: step.exists }),\n ...(step.note === undefined ? {} : { note: step.note }),\n ...(step.line === undefined ? {} : { line: step.line }),\n state: step.state,\n ...(step.page === undefined ? {} : { page: step.page }),\n }));\n out[\"coverage\"] = entry.coverage;\n }\n const children = entry.children.map((r) => r.id);\n out[\"namedBy\"] = {\n ...(record.type === \"audience\" ? { personas: children } : {}),\n ...(record.type === \"persona\" ? { journeys: children } : {}),\n pages: entry.pages,\n };\n return out;\n}\n\n/** Each record once, where the tree first reaches it. */\nexport function renderListJson(entries: readonly RecordEntry[]): string {\n const once = new Map(entries.map((entry) => [entry.record, entry]));\n return JSON.stringify({ records: [...once.values()].map(recordJson) }, null, 2);\n}\n\nexport function renderGetJson(entry: RecordEntry): string {\n return JSON.stringify(recordJson(entry), null, 2);\n}\n\nexport function renderFindingsJson(report: StrategyReport): string {\n const count = (severity: string): number => report.findings.filter((f) => f.severity === severity).length;\n return JSON.stringify(\n {\n // `key` is the baseline's identity for a finding, not something it says.\n findings: report.findings.map(({ key: _identity, ...finding }) => ({\n ...finding,\n file: displayPath(finding.file, report.cwd, report.base),\n })),\n summary: {\n records: report.records,\n references: report.references,\n // Only a set with steps carries the key, so a set without them prints as it always has.\n ...(report.steps > 0 ? { steps: report.steps } : {}),\n errors: count(\"error\"),\n warnings: count(\"warning\"),\n notices: count(\"notice\"),\n ...(report.baseline === undefined ? {} : { baseline: report.baseline }),\n },\n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AAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cite/core/spell.ts","../src/cite/core/adapt.ts","../src/cite/core/reanchor.ts","../src/cite/core/claims.ts"],"sourcesContent":["/**\n * How a citation reads on a terminal. A pin is sixty-four hex digits and a\n * ciphertext is longer still, so both are abbreviated for a person, and every\n * report and every `add` line abbreviates them the same way.\n */\nimport type { PageLines } from \"../types.js\";\n\n/** `sha256-78af1d33…`, `hmac-sha256-5e0c1a2b…`: the prefix and eight hex digits. */\nexport function shortPin(integrity: string): string {\n const m = /^((?:hmac-)?sha256-)([0-9a-f]{8})/i.exec(integrity);\n const prefix = m?.[1];\n const digits = m?.[2];\n if (prefix === undefined || digits === undefined) return integrity;\n return `${prefix}${digits}…`;\n}\n\n/** The seven characters a person reads a commit by. */\nexport function shortCommit(commit: string): string {\n return commit.slice(0, 7);\n}\n\n/**\n * `~AQx7…:2`, `sdk:~AQx7…:2`: an encrypted source, abbreviated, with its repo\n * and line suffix kept. A plain path is spelled in full, because that is what\n * a reader has to find.\n */\nexport function shortSrc(src: string): string {\n const m = /^((?:[a-z0-9][a-z0-9-]*:)?)(~[^:]*)(.*)$/.exec(src);\n const repo = m?.[1];\n const token = m?.[2];\n const lines = m?.[3];\n if (repo === undefined || token === undefined || lines === undefined || token.length <= 5) return src;\n return `${repo}${token.slice(0, 5)}…${lines}`;\n}\n\n/** The widest a quoted line of a file is printed at. */\nconst LINE_WIDTH = 60;\n\n/**\n * A line of a file as a report quotes it: whitespace collapsed to single\n * spaces, then sixty characters and an ellipsis. The report is one line, so\n * neither an indented source line nor a long one decides how it reads.\n */\nexport function shortLine(text: string): string {\n const one = text.replace(/\\s+/g, \" \").trim();\n return one.length <= LINE_WIDTH ? one : `${one.slice(0, LINE_WIDTH)}…`;\n}\n\n/**\n * `line 9`, or `lines 9-12`: where on a page a span sits. Every refusal,\n * report and message that names one reads it this way, so `add`, `update`\n * and the reporters spell it once.\n */\nexport function spellAt(lines: PageLines): string {\n return lines.start === lines.end\n ? `line ${String(lines.start)}`\n : `lines ${String(lines.start)}-${String(lines.end)}`;\n}\n\n/** `a`, `a and b`, `a, b and c`: a list as a sentence reads it, or with `or`. */\nexport function listOf(values: readonly string[], conjunction: \"and\" | \"or\" = \"and\"): string {\n if (values.length <= 1) return values.join(\"\");\n return `${values.slice(0, -1).join(\", \")} ${conjunction} ${values[values.length - 1] ?? \"\"}`;\n}\n","/**\n * Findings, their messages, and the bridge to meta's `ValidationResult`, so\n * the github/sarif/junit reporters and the baseline ratchet work unchanged.\n *\n * A claim or marker finding sits on the page line a reviewer reads. A finding\n * about the entry itself, `entry-invalid` or a bare pin whose source changed,\n * sits on the entry's own line, in the manifest when one owns it.\n *\n * FieldError: schema \"manni:cite\" (matches BUILTIN_ID, so canonicalSchemaRef\n * leaves it alone), keyword = rule, instancePath \"/citations/N\", subject =\n * id ?? source.integrity, never the claim's pin, so accepting a claim does\n * not reopen baselined findings. `ok` is true iff no error-severity finding.\n *\n * Every message spells the source as the entry spelled it. `resolvedPath`,\n * `commitsSince` and `diff` never enter a message: they are pretty-only\n * fields, shown under `--reveal` and `--show-diff`.\n */\nimport { isAbsolute } from \"node:path\";\nimport { isErrorSeverity, type FieldError, type ValidationResult } from \"../../meta/index.js\";\nimport type {\n CitationFinding,\n CitationResult,\n CiteRule,\n CiteSeverity,\n ClaimEnd,\n PageCitationReport,\n SourceEnd,\n SourceStatus,\n} from \"../types.js\";\nimport { claimLine } from \"./claims.js\";\nimport { parseSrc } from \"./range.js\";\nimport { RULE_ID_PREFIX, ruleId } from \"./severity.js\";\nimport { listOf, shortSrc } from \"./spell.js\";\n\n/** The seven characters a person reads a commit by. */\nfunction short(commit: string): string {\n return commit.slice(0, 7);\n}\n\nfunction plural(n: number, noun: string): string {\n return `${String(n)} ${noun}${n === 1 ? \"\" : \"s\"}`;\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 file half of a source as the entry spelled it: a plain path in full, a\n * ciphertext abbreviated, so no message names an encrypted path.\n */\nfunction sourceFile(src: string): string {\n try {\n const { path } = parseSrc(src);\n return shortSrc(path);\n } catch {\n return shortSrc(src);\n }\n}\n\n/**\n * Why an encrypted source is missing, in words that never name the path. A\n * plain path names its own file, so the bare status says the rest, unless\n * the repo it names is one nothing declares.\n */\nfunction missingMessage(source: SourceEnd): string {\n const { repo } = source;\n if (source.missingReason === \"unknown-repo\") {\n return `missing (no repo named ${repo ?? \"?\"} is declared)`;\n }\n if (!citesEncrypted(source.src)) return \"missing\";\n switch (source.missingReason) {\n case \"no-key\":\n return \"missing (no encryption key is available to decrypt it)\";\n case \"undecryptable\":\n return \"missing (does not decrypt under the current key)\";\n case \"untracked\":\n return repo === undefined\n ? \"missing (no tracked file matches; wrong --root?)\"\n : `missing (no tracked file matches in ${repo}; wrong cite.repos.${repo}?)`;\n case \"unreadable\":\n case undefined:\n return \"missing\";\n }\n}\n\n/** The one place a source end's message is composed, per status. */\nexport function messageFor(source: SourceEnd): string {\n switch (source.status) {\n case \"current\":\n return \"current\";\n case \"skipped\":\n return \"skipped\";\n case \"moved\":\n // An encrypted source's new path is a ciphertext, abbreviated as the\n // entry's own is: `--reveal` stays the only way to read either.\n return `moved -> ${shortSrc(source.newSrc ?? \"?\")}`;\n case \"moved-ambiguous\": {\n const candidates = source.candidates ?? [];\n return `moved, ${plural(candidates.length, \"candidate\")} (${candidates.map(shortSrc).join(\", \")})`;\n }\n case \"changed\": {\n // Where the old first and last line sit now, when the in-range search\n // found each exactly once: the span `update --accept` re-mints at.\n const span = source.newLines === undefined ? \"\" : `; now at lines ${source.newLines}`;\n if (source.historyAvailable === false) return \"changed (history unavailable; fetch-depth: 0)\";\n // The derived baseline when history found one (0097). Without git\n // there is none, and the recorded commit is all the entry says.\n const since = source.baselineSha ?? source.commitSha;\n if (since === undefined) return `changed${span}`;\n const at = short(since);\n if (source.commitsSince === undefined) return `changed since ${at}${span}`;\n return `changed since ${at}, ${plural(source.commitsSince.length, \"commit\")}${span}`;\n }\n case \"never-true\":\n return `never true: the pin held at no commit in the history of ${sourceFile(source.src)}`;\n case \"missing\":\n return missingMessage(source);\n }\n}\n\n/** `<id>: <text>`, or the text alone for an entry with no id. */\nfunction named(id: string | undefined, text: string): string {\n return id === undefined ? text : `${id}: ${text}`;\n}\n\n/** `line 9`, or `lines 9-10` when the claim covers several. */\nfunction at(spec: string): string {\n return spec.includes(\"-\") ? `lines ${spec}` : `line ${spec}`;\n}\n\n/** The one place a claim end's message is composed, per status. */\nexport function claimMessageFor(result: CitationResult): string {\n const claim = result.claim;\n const id = result.citation.id;\n if (claim === null) return \"\";\n // A marker-anchored claim has no lines of its own; it is judged where the\n // marker's text sits, and that is what the message names.\n const where =\n claim.fileLines ??\n (result.markerLine === undefined ? undefined : String(result.markerLine));\n switch (claim.status) {\n case \"moved\":\n return named(\n id,\n `the claim moved from ${at(where ?? \"?\")} to ${at(claim.newFileLines ?? \"?\")}.`,\n );\n case \"moved-ambiguous\":\n return named(\n id,\n `the claim at ${at(where ?? \"?\")} now appears at lines ${listOf(claim.candidateFileLines ?? [])}.`,\n );\n case \"reanchored\": {\n const since = claim.commitSha === undefined ? \"\" : ` since ${short(claim.commitSha)}`;\n // A claim-lines entry moved onto its new run; a marker-anchored one\n // never moves, because the marker travels with its own text.\n const to =\n claim.newFileLines === undefined ? \"\" : `, to ${at(claim.newFileLines)}`;\n return named(\n id,\n `the claim at ${at(where ?? \"?\")} was reanchored${since}${to}. Its words are unchanged.`,\n );\n }\n case \"changed\":\n if (where === undefined) {\n return named(\n id,\n \"the claim has no lines and no marker names the entry, so its pin anchors nothing.\",\n );\n }\n return named(id, `the claim at ${at(where)} has ${claimChange(claim)}`);\n case \"current\":\n case \"skipped\":\n return \"\";\n }\n}\n\n/** How a changed claim says since when, which is what its history could say. */\nfunction claimChange(claim: ClaimEnd): string {\n if (claim.historyAvailable === false) {\n return \"changed since it was pinned (history unavailable; fetch-depth: 0).\";\n }\n if (claim.commitSha === undefined) return \"changed since it was pinned.\";\n const at = short(claim.commitSha);\n // Zero commits since would read as \"just now\". The working tree holding the\n // change is what it actually means, so it says that.\n const since = claim.commitsSince ?? [];\n const count = since.length === 0 ? \"uncommitted\" : plural(since.length, \"commit\");\n return `changed since ${at}, ${count}.`;\n}\n\n/**\n * The one place a `marker-misplaced` message is composed. A quote marker's\n * place is above the block it anchors; every other marker's is the first line\n * of the paragraph its run splits.\n */\nexport function misplacedMessageFor(\n id: string | undefined,\n marker: { line: number; unit: string; place: number; block: boolean },\n): string {\n const place = marker.block\n ? `above the block at line ${String(marker.place)}`\n : `above line ${String(marker.place)}`;\n return named(\n id,\n `the marker at line ${String(marker.line)} splits the paragraph at ${at(marker.unit)}. Its place is ${place}.`,\n );\n}\n\n/** The rule a source status reports under, or undefined for one that is not a finding. */\nfunction sourceRuleOf(status: SourceStatus): CiteRule | undefined {\n if (status === \"skipped\" || status === \"current\") return undefined;\n return `source-${status}`;\n}\n\n/** The rule a claim status reports under, or undefined. */\nfunction claimRuleOf(claim: ClaimEnd): CiteRule | undefined {\n const status = claim.status;\n if (status === \"skipped\" || status === \"current\") return undefined;\n return `claim-${status}`;\n}\n\n/** Where a finding about a whole entry sits: its own line, in its own file. */\nfunction entrySite(result: CitationResult): Pick<CitationFinding, \"line\" | \"file\"> {\n const site: Pick<CitationFinding, \"line\" | \"file\"> = {};\n if (result.origin.line !== undefined) site.line = result.origin.line;\n if (result.origin.kind === \"manifest\") site.file = result.origin.file;\n return site;\n}\n\n/** Where a finding about an anchored citation sits: the page line it anchors to. */\nfunction anchorSite(result: CitationResult): Pick<CitationFinding, \"line\" | \"file\"> {\n if (result.anchorLine !== undefined) return { line: result.anchorLine };\n return entrySite(result);\n}\n\n/** Findings for classified citations under a severity table; `off` rules produce none. */\nexport function findingsFor(\n results: readonly CitationResult[],\n severity: Readonly<Record<CiteRule, CiteSeverity>>,\n): CitationFinding[] {\n const out: CitationFinding[] = [];\n const push = (\n result: CitationResult,\n rule: CiteRule,\n message: string,\n site: Pick<CitationFinding, \"line\" | \"file\">,\n extra?: Pick<CitationFinding, \"newSrc\">,\n ): void => {\n const level = severity[rule];\n if (level === \"off\") return;\n const finding: CitationFinding = {\n rule,\n ruleId: ruleId(rule),\n severity: level,\n message,\n src: result.source.src,\n index: result.origin.index,\n };\n if (site.line !== undefined) finding.line = site.line;\n if (site.file !== undefined) finding.file = site.file;\n if (result.citation.id !== undefined) finding.id = result.citation.id;\n if (extra?.newSrc !== undefined) finding.newSrc = extra.newSrc;\n out.push(finding);\n };\n\n for (const result of results) {\n const claim = result.claim;\n if (claim !== null) {\n const rule = claimRuleOf(claim);\n // A claim pin that anchors nothing has no page line to sit on.\n if (rule !== undefined) {\n const site =\n claimLine(claim) === undefined && result.markerLine === undefined\n ? entrySite(result)\n : { line: claimLine(claim) ?? result.markerLine };\n push(result, rule, withRemedy(claimMessageFor(result), remedyFor(rule, result)), site);\n }\n }\n const rule = sourceRuleOf(result.source.status);\n if (rule === undefined) continue;\n const extra =\n result.source.newSrc === undefined ? undefined : { newSrc: result.source.newSrc };\n push(\n result,\n rule,\n withRemedy(messageFor(result.source), remedyFor(rule, result)),\n anchorSite(result),\n extra,\n );\n }\n return out;\n}\n\n/**\n * The pin of the citation a finding is about, for the fingerprint subject of\n * an entry with no id. Always the source's: accepting a changed claim must\n * not reopen a baselined finding.\n */\nfunction integrityFor(\n finding: CitationFinding,\n results: readonly CitationResult[],\n): string | undefined {\n if (finding.index === undefined) return undefined;\n return results.find((r) => r.origin.index === finding.index)?.citation.source.integrity;\n}\n\n/**\n * Where a finding is located once it becomes a `FieldError`: the page, or\n * the manifest the entry sits in.\n *\n * A manifest outside the repository has no location any reporter can use —\n * SARIF drops a uri that rebases to `../…`, and a GitHub annotation on one\n * lands nowhere — so the finding falls back to the page, and its line goes\n * with the file it belonged to. Inside the tree, both travel, and `file`\n * is what every reporter reads to annotate the manifest instead.\n */\nexport function errorSite(\n finding: CitationFinding,\n): Pick<CitationFinding, \"line\" | \"file\"> {\n if (finding.file === undefined) {\n return finding.line === undefined ? {} : { line: finding.line };\n }\n if (finding.file.startsWith(\"../\") || isAbsolute(finding.file)) return {};\n return {\n file: finding.file,\n ...(finding.line === undefined ? {} : { line: finding.line }),\n };\n}\n\nexport function toValidationResult(report: PageCitationReport): ValidationResult {\n const errors: FieldError[] = report.findings.map((finding) => {\n const error: FieldError = {\n schema: RULE_ID_PREFIX,\n instancePath: finding.index === undefined ? \"\" : `/citations/${String(finding.index)}`,\n message: finding.message,\n keyword: finding.rule,\n severity: finding.severity,\n };\n const subject = finding.id ?? integrityFor(finding, report.citations);\n if (subject !== undefined) error.subject = subject;\n const site = errorSite(finding);\n if (site.file !== undefined) error.file = site.file;\n if (site.line !== undefined) error.line = site.line;\n return error;\n });\n return {\n file: report.file,\n format: report.format,\n ok: !errors.some(isErrorSeverity),\n schemas: [RULE_ID_PREFIX],\n errors,\n };\n}\n\n/**\n * A message, then what to do about it. A message that ends a sentence keeps\n * its stop; a status such as `changed` gains one.\n */\nexport function withRemedy(message: string, remedy: string | undefined): string {\n if (remedy === undefined) return message;\n return `${message}${/[.?!]$/.test(message) ? \"\" : \".\"} ${remedy}`;\n}\n\n/** What to do about a missing source: the cause in its message decides. */\nfunction missingRemedy(result: CitationResult): string {\n const { repo } = result.source;\n if (result.source.missingReason === \"unknown-repo\") {\n const name = repo ?? \"<name>\";\n return `Declare ${name} under cite.repos in manni.config.yaml, or pass --repo ${name}=<dir>.`;\n }\n if (citesEncrypted(result.source.src)) {\n switch (result.source.missingReason) {\n case \"no-key\":\n return \"Set MANNI_ENCRYPTION_KEY, or encryptionKey: at the top of manni.config.yaml.\";\n case \"undecryptable\":\n return \"Use the key the source was encrypted with. After a key rotation, update the secret too.\";\n case \"untracked\":\n return repo === undefined\n ? \"Point --root at the code checkout, or re-add the citation against the new path.\"\n : `Point cite.repos.${repo} at the ${repo} checkout, or re-add the citation against the new path.`;\n case \"unreadable\":\n case undefined:\n break;\n }\n }\n const id = result.citation.id;\n return id === undefined\n ? \"Remove the entry, then add it again against the file's new path.\"\n : `Run manni cite remove --only ${id}, then manni cite add against the file's new path.`;\n}\n\n/**\n * What to do about an end finding, in one sentence: the command that clears\n * it, with `--only <id>` when the entry has an id. Any other finding's\n * message says what to do where it is composed, so it has none here.\n *\n * The message carries it after the status, and pretty output prints it under\n * the row, since the status column has no room for it.\n */\nexport function remedyFor(rule: CiteRule, result: CitationResult | undefined): string | undefined {\n if (rule === \"marker-misplaced\") return \"Run manni cite update to move it.\";\n if (result === undefined) return undefined;\n const id = result.citation.id;\n const accept = `manni cite update --accept${id === undefined ? \"\" : ` --only ${id}`}`;\n switch (rule) {\n case \"source-moved\":\n case \"claim-moved\":\n case \"claim-reanchored\":\n return \"Run manni cite update.\";\n case \"source-moved-ambiguous\":\n return `Widen source.lines until the range occurs once, then run ${accept}.`;\n case \"source-changed\":\n case \"source-never-true\":\n return `Check the sentence against the source, then run ${accept}.`;\n case \"source-missing\":\n return missingRemedy(result);\n case \"claim-moved-ambiguous\":\n return \"Pin a range that occurs once, or anchor the claim with a marker.\";\n case \"claim-changed\":\n if (result.claim?.fileLines === undefined && result.markerLine === undefined) {\n return id === undefined ? \"Add claim.lines.\" : `Add claim.lines, or a marker that names ${id}.`;\n }\n return `Check it still matches the source, then run ${accept}.`;\n default:\n return undefined;\n }\n}\n","/**\n * Misplaced markers, and what to do about them. Proposal 0054 is the record.\n *\n * A **marker run** is one or more consecutive lines that each hold one marker\n * and nothing else. A run is **misplaced** when the line directly above it and\n * the line directly below it are both unit text: deleting the run would join\n * them into one paragraph. Such a marker splits the paragraph for the renderer\n * and for the tool, and the lines above it are anchored by nothing.\n *\n * A misplaced marker belongs where `add --marker` writes one: above the first\n * line of the unit, or, for a `quote: true` entry, above the block it anchors.\n * A run moves in its own order, so two markers that were stacked stay stacked.\n *\n * The claim of a marker-anchored entry is read against three spans, in order:\n * the unit the marker belongs to, the span it anchors now, and the span it was\n * pinned over before PR #43 (marker lines included, down to the next blank\n * line or fence). The second or third holding means the pinned text is on the\n * page and the marker anchors a different span: `claim-moved`.\n */\nimport type { ClaimEnd, PageCitation, PageCitations, PageLines } from \"../types.js\";\nimport { hashLines } from \"./hash.js\";\nimport { MAX_MARKERS_PER_PAGE } from \"./page.js\";\nimport { spellLines } from \"../../shared/pin.js\";\nimport { ANY_FENCE, anchoredLines, isMarkerLine, markerRunAt, splitUnit } from \"./statements.js\";\n\n// The run and unit helpers live in the shared scanner (proposal 0099), where\n// meta reads a misplaced statement by them. cite still imports them from here.\nexport { isUnitText, markerRunAt, splitUnit } from \"./statements.js\";\n\n/** Whether the file line `n` holds one marker and nothing else. */\nfunction markerAt(lines: readonly string[], n: number, format: string): boolean {\n const line = lines[n - 1];\n return line !== undefined && isMarkerLine(line, format);\n}\n\n/**\n * The span a marker was pinned over before PR #43: from the line below it\n * through the next blank line or fence, marker lines included. `undefined`\n * when the line below is blank or a fence, so the old reading covered nothing.\n */\nexport function pre43Span(\n lines: readonly string[],\n markerLine: number,\n): PageLines | undefined {\n const start = markerLine + 1;\n const first = lines[start - 1];\n if (first === undefined || first.trim() === \"\" || ANY_FENCE.test(first)) return undefined;\n let end = start;\n while (end + 1 <= lines.length) {\n const next = lines[end];\n if (next === undefined || next.trim() === \"\" || ANY_FENCE.test(next)) break;\n end++;\n }\n return { start, end };\n}\n\n/** One marker line that splits a paragraph. */\nexport interface MisplacedMarker {\n /** File line of the marker. */\n line: number;\n /** The whole run of marker-only lines it belongs to. */\n run: PageLines;\n /** Its position in that run, counted from zero, so stacked markers keep their order. */\n order: number;\n /** The paragraph the run splits, in file lines as the page reads now. */\n unit: PageLines;\n /** The file line the marker belongs above. */\n place: number;\n /** Whether `place` is a fenced block the entry quotes rather than the unit's first line. */\n block: boolean;\n /** The file line the marker takes once the whole run has moved. */\n to: number;\n /** The entry the marker names, when one is anchored by it. */\n entry?: PageCitation;\n}\n\n/** The lines of a run, which is `end - start + 1` markers. */\nfunction runLength(run: PageLines): number {\n return run.end - run.start + 1;\n}\n\n/** Whether a misplaced marker at `line` splits a paragraph, and where it belongs. */\nexport function misplacedMarkerAt(\n page: PageCitations,\n lines: readonly string[],\n line: number,\n entry?: PageCitation,\n): MisplacedMarker | undefined {\n if (!markerAt(lines, line, page.format)) return undefined;\n const run = markerRunAt(lines, line, page.format, page.bodyLine);\n const unit = splitUnit(lines, run, page.format, page.bodyLine);\n if (unit === undefined) return undefined;\n const order = line - run.start;\n const quote = entry?.citation.quote === true;\n const marker = entry?.marker;\n const blockAt =\n quote && marker !== undefined\n ? anchoredLines(page.content, marker.end, page.format, true)?.start\n : undefined;\n const out: MisplacedMarker = blockAt === undefined\n ? { line, run, order, unit, place: unit.start, block: false, to: unit.start + order }\n : {\n line,\n run,\n order,\n unit,\n place: blockAt,\n block: true,\n to: blockAt - runLength(run) + order,\n };\n if (entry !== undefined) out.entry = entry;\n return out;\n}\n\n/**\n * Every misplaced marker on a page, in the order the page reads. An orphan,\n * repeated or invalid marker is reported like any other: it splits the\n * paragraph whether or not it names an entry.\n */\nexport function misplacedMarkers(\n page: PageCitations,\n lines: readonly string[],\n): MisplacedMarker[] {\n const out: MisplacedMarker[] = [];\n for (const statement of page.statements.slice(0, MAX_MARKERS_PER_PAGE)) {\n const entry = page.citations.find((c) => c.marker?.line === statement.line);\n const found = misplacedMarkerAt(page, lines, statement.line, entry);\n if (found !== undefined) out.push(found);\n }\n return out;\n}\n\n/**\n * The span the pin covers once a misplaced run has moved: the joined unit,\n * pushed down by the markers now above it. A quote marker's pin covers its\n * block, which no move touches, so this is never asked of one.\n */\nexport function movedUnit(misplaced: MisplacedMarker): PageLines {\n return { start: misplaced.unit.start + runLength(misplaced.run), end: misplaced.unit.end };\n}\n\n/** The unit's text, the run's marker lines left out: what the pin covers after the move. */\nexport function unitText(lines: readonly string[], misplaced: MisplacedMarker): string[] {\n const { unit, run } = misplaced;\n const out: string[] = [];\n for (let n = unit.start; n <= unit.end; n++) {\n if (n >= run.start && n <= run.end) continue;\n const line = lines[n - 1];\n if (line !== undefined) out.push(line);\n }\n return out;\n}\n\n/** One marker line a rewrite moves, and the file line it goes above. */\nexport interface MarkerMove {\n from: number;\n place: number;\n}\n\n/** A page with its markers moved, and where its lines went. */\nexport interface MovedPage {\n content: string;\n /** The new file line of an old one. */\n line(old: number): number;\n}\n\n/** A page split into line texts and the terminator each position carries. */\nfunction splitKeepingEol(content: string): { texts: string[]; eols: string[] } {\n const parts = content.match(/[^\\n]*\\n|[^\\n]+$/g) ?? [];\n const texts: string[] = [];\n const eols: string[] = [];\n for (const part of parts) {\n const eol = /\\r?\\n$/.exec(part)?.[0] ?? \"\";\n texts.push(part.slice(0, part.length - eol.length));\n eols.push(eol);\n }\n return { texts, eols };\n}\n\n/**\n * The page with each named marker line lifted out and written above its place,\n * in the order the moves are given, so a run that was stacked stays stacked.\n * A moved marker takes the indentation `add` would write it at, and the file's\n * terminators stay where they are: the lines are permuted, never re-joined.\n *\n * Read the join carefully. A line's text comes from where it was, and its\n * terminator from where it now sits. That asymmetry is deliberate: the last\n * position of a page with no final newline carries no terminator, and it has\n * to stay the last position. Were terminators to travel with their lines, a\n * move that lifted that last line would carry the missing terminator into the\n * middle of the page and glue two lines together.\n *\n * The cost is that a page mixing `\\r\\n` and `\\n` has the endings of the two\n * swapped positions trade places. No byte is gained or lost, and the file\n * still ends as it began. A uniform page, which is what a checkout gives,\n * cannot tell the difference.\n */\nexport function applyMarkerMoves(\n content: string,\n moves: readonly MarkerMove[],\n indentAt: (line: number) => string,\n): MovedPage {\n const { texts, eols } = splitKeepingEol(content);\n const moving = new Set(moves.map((move) => move.from));\n const inserts = new Map<number, number[]>();\n for (const move of moves) {\n const list = inserts.get(move.place) ?? [];\n list.push(move.from);\n inserts.set(move.place, list);\n }\n const order: number[] = [];\n for (let n = 1; n <= texts.length; n++) {\n for (const from of inserts.get(n) ?? []) order.push(from);\n if (!moving.has(n)) order.push(n);\n }\n const moved = new Map<number, string>();\n for (const move of moves) {\n moved.set(move.from, indentAt(move.place) + (texts[move.from - 1] ?? \"\").trim());\n }\n const at = new Map<number, number>();\n order.forEach((old, index) => at.set(old, index + 1));\n const out = order\n .map((old, index) => (moved.get(old) ?? texts[old - 1] ?? \"\") + (eols[index] ?? \"\"))\n .join(\"\");\n return { content: out, line: (old) => at.get(old) ?? old };\n}\n\n/** The plain pin of a span of lines, or of an explicit list of them. */\nfunction pinOf(lines: readonly string[], span: PageLines): string | undefined {\n if (span.start < 1 || span.end > lines.length || span.end < span.start) return undefined;\n return hashLines(lines.slice(span.start - 1, span.end).join(\"\\n\"));\n}\n\n/**\n * The claim end of a marker-anchored entry, read against proposal 0054's\n * three spans. `misplaced` is the marker's misplacement, when it has one.\n *\n * For a misplaced marker at `moved`, `fileLines` is the span that held and\n * `newLines` the span the pin will cover once the marker moves. Both are file\n * lines: a marker-anchored claim has no body lines of its own.\n */\nexport function markerClaimEnd(\n page: PageCitations,\n entry: PageCitation,\n lines: readonly string[],\n misplaced: MisplacedMarker | undefined,\n): ClaimEnd {\n const { citation, marker } = entry;\n const pin = citation.claim?.integrity;\n const quote = citation.quote === true;\n if (marker === undefined || pin === undefined) return { status: \"changed\" };\n const current = anchoredLines(page.content, marker.end, page.format, quote);\n if (current === undefined) return { status: \"changed\" };\n\n /** The claim end this span reads as, and where the move will take it. */\n const claimAt = (span: PageLines, status: ClaimEnd[\"status\"], to?: PageLines): ClaimEnd => {\n const end: ClaimEnd = { fileLines: spellLines(span), status };\n if (to !== undefined) {\n end.newLines = spellLines(to);\n end.newFileLines = end.newLines;\n }\n if (status === \"changed\") end.text = lines.slice(span.start - 1, Math.min(span.end, lines.length));\n return end;\n };\n\n // A quote marker's pin covers its block, which no move touches, and the\n // block reading never changed, so there is one span to read it against.\n if (quote) {\n return claimAt(current, pinOf(lines, current) === pin ? \"current\" : \"changed\");\n }\n\n if (misplaced !== undefined) {\n const to = movedUnit(misplaced);\n if (hashLines(unitText(lines, misplaced).join(\"\\n\")) === pin) return claimAt(to, \"current\");\n if (pinOf(lines, current) === pin) return claimAt(current, \"moved\", to);\n const pre43 = pre43Span(lines, marker.line);\n if (pre43 !== undefined && pinOf(lines, pre43) === pin) return claimAt(pre43, \"moved\", to);\n return claimAt(current, \"changed\");\n }\n\n if (pinOf(lines, current) === pin) return claimAt(current, \"current\");\n // Stacked markers written before PR #43 were pinned over a sibling marker\n // line and the paragraph. That renders fine, so only the pin is repaired.\n const pre43 = pre43Span(lines, marker.line);\n if (pre43 !== undefined && pinOf(lines, pre43) === pin) return claimAt(pre43, \"moved\", current);\n return claimAt(current, \"changed\");\n}\n","/**\n * The claim end: the page text a citation supports, classified by the same\n * machinery as the source end and against the page as it is now.\n *\n * The claim's lines are body-relative, so editing the frontmatter never moves\n * them; every line a person reads is a file line, translated here. The pin\n * holds at the recorded lines: `current`. The same text is found verbatim\n * elsewhere in the body: `moved`, once, or `moved-ambiguous`. Nowhere:\n * `changed`, the sentence was edited. A marker-anchored claim pins what the\n * marker anchors, so its text never moves on the page; it is `current`,\n * `changed`, or, when the pin holds over a span the marker no longer anchors,\n * `moved`. `src/cite/core/reanchor.ts` reads those spans.\n */\nimport type {\n ClaimEnd,\n PageCitation,\n PageCitations,\n PageLines,\n} from \"../types.js\";\nimport {\n findWindows,\n parseLines,\n pinOfLines,\n spellLines,\n toBodyLines,\n toFileLines,\n} from \"../../shared/pin.js\";\nimport {\n markerClaimEnd,\n misplacedMarkerAt,\n type MisplacedMarker,\n} from \"./reanchor.js\";\nimport {\n anchoredLines,\n fenceAround,\n fenceSpanAt,\n isMarkerLine,\n isTableRow,\n isTableSeparator,\n lineAt,\n offsetOfLine,\n paragraphAfter,\n} from \"./statements.js\";\n\n// The line translation and the claim pin are the shared pin engine's; this path keeps cite's imports working.\nexport { pinOfLines, toBodyLines, toFileLines } from \"../../shared/pin.js\";\n\nexport function normalizeWhitespace(text: string): string {\n return text.replace(/\\s+/g, \" \").trim();\n}\n\n/**\n * The hashing rule's normalization for a whole quoted block: one BOM, CRLF →\n * LF, and one trailing LF dropped. It differs from the shared `normalizeText`\n * only in that last step, because a quote is compared as one joined block\n * rather than split into lines first.\n */\nfunction normalizeBlock(text: string): string {\n let out = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;\n out = out.replace(/\\r\\n/g, \"\\n\");\n return out.endsWith(\"\\n\") ? out.slice(0, -1) : out;\n}\n\n/** `true` when the block's normalized text equals the cited lines under the hashing rule. */\nexport function blockMatches(blockText: string, citedJoined: string): boolean {\n return normalizeBlock(blockText) === normalizeBlock(citedJoined);\n}\n\n/** The page lines a range covers, as far as the page reaches. */\nfunction textAt(lines: readonly string[], range: PageLines): string[] {\n return lines.slice(range.start - 1, Math.min(range.end, lines.length));\n}\n\n/** The first file line of a classified claim: where its findings sit. */\nexport function claimLine(claim: ClaimEnd): number | undefined {\n const at = claim.fileLines === undefined ? undefined : parseLines(claim.fileLines);\n return at?.start;\n}\n\n/** Where the claim is now: the moved-to lines when it moved, else the recorded ones. */\nexport function claimLineNow(claim: ClaimEnd): number | undefined {\n const spec = claim.newFileLines ?? claim.candidateFileLines?.[0] ?? claim.fileLines;\n const at = spec === undefined ? undefined : parseLines(spec);\n return at?.start;\n}\n\n/** The file lines the claim occupies now, for the quote check. */\nexport function claimLinesNow(claim: ClaimEnd): PageLines | undefined {\n const spec = claim.newFileLines ?? claim.candidateFileLines?.[0] ?? claim.fileLines;\n return spec === undefined ? undefined : parseLines(spec);\n}\n\n/**\n * Classify one entry's claim end against the page. `lines` is the page under\n * the hashing rule (`splitLines`). `null` for an entry with no `claim`: a\n * bare pin, or a marker with no drift check on its sentence.\n */\nexport function claimEnd(\n page: PageCitations,\n entry: PageCitation,\n lines: readonly string[],\n misplaced?: MisplacedMarker,\n): ClaimEnd | null {\n const { citation, marker } = entry;\n const claim = citation.claim;\n if (claim === undefined) return null;\n const body = page.bodyLine;\n\n if (claim.lines !== undefined) {\n const recorded = parseLines(claim.lines);\n // An unreadable range is `entry-invalid`, and that entry is never classified.\n if (recorded === undefined) return { status: \"skipped\" };\n const file = toFileLines(recorded, body);\n const end: ClaimEnd = {\n lines: spellLines(recorded),\n fileLines: spellLines(file),\n status: \"changed\",\n };\n // Lines and a marker both: `anchor-invalid`, and neither anchor is judged.\n if (marker !== undefined) return { ...end, status: \"skipped\" };\n if (pinOfLines(lines, file) === claim.integrity) return { ...end, status: \"current\" };\n\n const width = recorded.end - recorded.start + 1;\n const found = findWindows(lines.slice(body - 1), width, claim.integrity, undefined, {\n around: recorded.start,\n });\n const spans = found.starts.map((start) => ({ start, end: start + width - 1 }));\n const [only] = spans;\n if (spans.length === 1 && only !== undefined) {\n return {\n ...end,\n status: \"moved\",\n newLines: spellLines(only),\n newFileLines: spellLines(toFileLines(only, body)),\n };\n }\n if (spans.length > 1) {\n return {\n ...end,\n status: \"moved-ambiguous\",\n candidates: spans.map(spellLines),\n candidateFileLines: spans.map((span) => spellLines(toFileLines(span, body))),\n };\n }\n return { ...end, text: textAt(lines, file) };\n }\n\n if (marker !== undefined) {\n // The marker travels with its text, so what moves is the span the marker\n // anchors, not the text. `reanchor.ts` reads the three spans.\n return markerClaimEnd(\n page,\n entry,\n lines,\n misplaced ?? misplacedMarkerAt(page, lines, marker.line, entry),\n );\n }\n\n // A claim pin with neither lines nor a marker anchors nothing at all.\n return { status: \"changed\" };\n}\n\n/**\n * Where else in the body the claim's text sits, as file lines. A claim whose\n * text repeats is `moved-ambiguous` the moment it moves, so `add` says so\n * while the pin is still being written, and `update --accept` says so before\n * it mints a pin that cannot tell two copies apart. The search is the\n * classifier's own.\n */\nexport function otherClaimSpans(\n lines: readonly string[],\n pageLines: PageLines,\n pin: string,\n bodyLine: number,\n): PageLines[] {\n const width = pageLines.end - pageLines.start + 1;\n const found = findWindows(lines.slice(bodyLine - 1), width, pin, undefined, {\n around: toBodyLines(pageLines, bodyLine).start,\n });\n return found.starts\n .map((start) => toFileLines({ start, end: start + width - 1 }, bodyLine))\n .filter((span) => span.start !== pageLines.start);\n}\n\n/** How many other locations a notice names before it starts counting them. */\nconst NAMED_SPANS = 3;\n\n/** `line 17`, `lines 16 and 18`, `lines 16, 18, 20 and 2 more`. */\nexport function spellElsewhere(spans: readonly PageLines[]): string {\n const first = spans[0];\n const noun = spans.length === 1 && first !== undefined && first.start === first.end ? \"line\" : \"lines\";\n const named = spans.slice(0, NAMED_SPANS).map((span) => spellLines(span));\n const rest = spans.length - named.length;\n if (rest > 0) return `${noun} ${named.join(\", \")} and ${String(rest)} more`;\n const last = named.pop() ?? \"\";\n return named.length === 0 ? `${noun} ${last}` : `${noun} ${named.join(\", \")} and ${last}`;\n}\n\n/**\n * What `update --accept` re-pins over: the paragraph, whole fenced block, or\n * lines inside a fenced block at a line.\n *\n * The three kinds are not interchangeable. `\"block\"` covers a fence, its\n * content and its closing fence, which is the only shape a `quote: true`\n * entry may hold. `\"fenced-lines\"` covers content lines inside a block and\n * neither fence, which is what a claim minted over part of a code sample\n * holds. `\"paragraph\"` covers prose, and table rows too, since `ClaimUnit`\n * draws no line between them.\n */\nexport interface ClaimUnit {\n lines: PageLines;\n kind: \"paragraph\" | \"block\" | \"fenced-lines\";\n text: string[];\n}\n\n/**\n * Why no unit sits at a file line. Each one is a different problem with a\n * different repair, so `update --accept` names which it hit rather than\n * leaving the entry skipped with no reason.\n */\nexport type NoUnit =\n | \"outside\"\n | \"blank\"\n | \"fence-crossed\"\n | \"marker\"\n | \"not-a-paragraph\"\n | \"table-short\"\n | \"table-rule\";\n\n/**\n * The span a claim of the recorded width holds at a line. A unit whose extent\n * is the author's, rather than the page's, keeps the number of lines it was\n * minted over: table rows and lines inside a fenced block both. One recorded\n * line gives one line, and five give five.\n */\nfunction spanOf(line: number, recorded: PageLines | undefined): PageLines {\n const width = recorded === undefined ? 1 : Math.max(1, recorded.end - recorded.start + 1);\n return { start: line, end: line + width - 1 };\n}\n\n/**\n * The rows a claim on a table re-pins over, or why there are none.\n *\n * A row is a statement, so a claim over N rows is a claim over N statements.\n * The extent is the author's, and re-pinning re-mints the hash over it rather\n * than redesigning it: one recorded line gives one row, and five give five.\n * Rows below a one-line claim are other statements, and a table that no longer\n * reaches the recorded end is a question only the author can answer.\n *\n * The unit comes back as `kind: \"paragraph\"`, since `ClaimUnit` names how a\n * unit is bounded and not what it holds. A caller wanting to know whether it\n * holds rows has to ask `isTableRow` about the text, not read `kind`.\n *\n * A span of nothing but `|---|---|` rules is refused. Those lines carry no\n * words, so a pin over them says nothing about what the page claims, and a\n * claim that shifted onto one is a claim the page lost. A header, its rule and\n * a body row is three rows and keeps all three.\n */\nfunction rowsAt(\n line: number,\n lines: readonly string[],\n recorded: PageLines | undefined,\n named: boolean,\n): ClaimUnit | NoUnit {\n const end = spanOf(line, recorded).end;\n if (end > lines.length) return \"table-short\";\n for (let n = line; n <= end; n++) {\n if (!isTableRow(lines[n - 1] ?? \"\")) return \"table-short\";\n }\n const text = lines.slice(line - 1, end);\n if (!named && text.every((row) => isTableSeparator(row))) return \"table-rule\";\n return { lines: { start: line, end }, kind: \"paragraph\", text };\n}\n\n/**\n * The unit at a file line, or why there is none. `unitAt` and `noUnitAt` are\n * the two halves a caller reads, so the guards are written once. `recorded` is\n * the span the claim holds now, which only a table reads. `named` is the\n * operator having named the entry with `--only`: the structural refusals a\n * blanket accept would hit are the ones they have looked at, so they stand\n * down and the line is read as the text it is.\n */\nfunction unitOrWhy(\n page: PageCitations,\n line: number,\n lines: readonly string[],\n recorded?: PageLines,\n named = false,\n): ClaimUnit | NoUnit {\n if (line < page.bodyLine || line > lines.length) return \"outside\";\n const own = lines[line - 1] ?? \"\";\n if (own.trim() === \"\") return \"blank\";\n // A line that is one marker and nothing else is another entry's anchor, not\n // claim text. Reading it as text is how a shifted claim gets a confident pin\n // over a comment.\n const marker = isMarkerLine(own, page.format);\n if (marker && !named) return \"marker\";\n const block = fenceSpanAt(page.content, line, page.format);\n if (block !== undefined) {\n return { lines: block, kind: \"block\", text: lines.slice(block.start - 1, block.end) };\n }\n const around = fenceAround(page.content, page.bodyOffset, line, page.format);\n if (around !== undefined) {\n // The claim was minted over lines inside this block, so it is re-pinned\n // over as many lines as it recorded, at the line it starts on. Re-pinning\n // the block around them would widen what the pin covers, which is the one\n // thing an accept may never do. A span reaching the closing fence, or past\n // it, is not lines inside a block at all, and stays refused.\n const span = spanOf(line, recorded);\n return span.end < around.end\n ? { lines: span, kind: \"fenced-lines\", text: lines.slice(span.start - 1, span.end) }\n : \"fence-crossed\";\n }\n // A table row is a statement of its own, and nothing between two rows ends a\n // paragraph, so the walk below would read the rest of the table as one.\n if (isTableRow(own)) return rowsAt(line, lines, recorded, named);\n // The format ends the paragraph at a marker under it, so a re-pin never\n // swallows another entry's anchor. A named entry sitting on a marker is read\n // without it, because there the marker is the line being accepted.\n const paragraph = paragraphAfter(\n page.content,\n offsetOfLine(page.content, line),\n marker ? undefined : page.format,\n );\n if (paragraph === undefined || paragraph.line !== line) return \"not-a-paragraph\";\n const span: PageLines = { start: line, end: lineAt(page.content, paragraph.end) };\n return { lines: span, kind: \"paragraph\", text: lines.slice(span.start - 1, span.end) };\n}\n\n/**\n * The paragraph, fenced block, fenced lines or table rows at a file line.\n * Undefined when the line holds no claim at all: it is blank, outside the\n * body, another entry's marker, a table rule, or a line whose claim runs out\n * of the fenced block it starts in. Those are the claims `update --accept`\n * skips, and `noUnitAt` says which of them it is.\n *\n * A paragraph runs from this line to its end, not from the paragraph's own\n * first line. The line asked about is the claim's first line, and re-pinning\n * has to leave that where it is, so a claim that started mid-paragraph keeps\n * starting there. A paragraph that gained a sentence gained it as part of the\n * same statement, which is why a claim grows with it.\n *\n * A table does not work that way. Each row is a statement, so a claim keeps\n * the number of rows `recorded` gives it, and refuses when the table no longer\n * reaches that far. Callers that know the claim's current span pass it.\n */\nexport function unitAt(\n page: PageCitations,\n line: number,\n lines: readonly string[],\n recorded?: PageLines,\n named = false,\n): ClaimUnit | undefined {\n const found = unitOrWhy(page, line, lines, recorded, named);\n return typeof found === \"string\" ? undefined : found;\n}\n\n/** Why `unitAt` found nothing at a file line, or undefined when it found a unit. */\nexport function noUnitAt(\n page: PageCitations,\n line: number,\n lines: readonly string[],\n recorded?: PageLines,\n named = false,\n): NoUnit | undefined {\n const found = unitOrWhy(page, line, lines, recorded, named);\n return typeof found === \"string\" ? found : undefined;\n}\n\n/** The lines a marker anchors now, for `update --accept` on a marker-anchored claim. */\nexport function markerUnit(\n page: PageCitations,\n entry: PageCitation,\n lines: readonly string[],\n): ClaimUnit | undefined {\n const { marker, citation } = entry;\n if (marker === undefined) return undefined;\n const span = anchoredLines(page.content, marker.end, page.format, citation.quote === true);\n if (span === undefined || span.end > lines.length) return undefined;\n return {\n lines: span,\n kind: citation.quote === true ? \"block\" : \"paragraph\",\n text: lines.slice(span.start - 1, span.end),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,SAAS,SAAS,WAA2B;AAClD,QAAM,IAAI,qCAAqC,KAAK,SAAS;AAC7D,QAAM,SAAS,IAAI,CAAC;AACpB,QAAM,SAAS,IAAI,CAAC;AACpB,MAAI,WAAW,UAAa,WAAW,OAAW,QAAO;AACzD,SAAO,GAAG,MAAM,GAAG,MAAM;AAC3B;AAGO,SAAS,YAAY,QAAwB;AAClD,SAAO,OAAO,MAAM,GAAG,CAAC;AAC1B;AAOO,SAAS,SAAS,KAAqB;AAC5C,QAAM,IAAI,2CAA2C,KAAK,GAAG;AAC7D,QAAM,OAAO,IAAI,CAAC;AAClB,QAAM,QAAQ,IAAI,CAAC;AACnB,QAAM,QAAQ,IAAI,CAAC;AACnB,MAAI,SAAS,UAAa,UAAU,UAAa,UAAU,UAAa,MAAM,UAAU,EAAG,QAAO;AAClG,SAAO,GAAG,IAAI,GAAG,MAAM,MAAM,GAAG,CAAC,CAAC,SAAI,KAAK;AAC7C;AAGA,IAAM,aAAa;AAOZ,SAAS,UAAU,MAAsB;AAC9C,QAAM,MAAM,KAAK,QAAQ,QAAQ,GAAG,EAAE,KAAK;AAC3C,SAAO,IA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ACA,QAAM,KAAK,OAAO,SAAS;AAC3B,SAAO,OAAO,SACV,qEACA,gCAAgC,EAAE;AACxC;AAUO,SAAS,UAAU,MAAgB,QAAwD;AAChG,MAAI,SAAS,mBAAoB,QAAO;AACxC,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,KAAK,OAAO,SAAS;AAC3B,QAAM,SAAS,6BAA6B,OAAO,SAAY,KAAK,WAAW,EAAE,EAAE;AACnF,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO,4DAA4D,MAAM;AAAA,IAC3E,KAAK;AAAA,IACL,KAAK;AACH,aAAO,mDAAmD,MAAM;AAAA,IAClE,KAAK;AACH,aAAO,cAAc,MAAM;AAAA,IAC7B,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,UAAI,OAAO,OAAO,cAAc,UAAa,OAAO,eAAe,QAAW;AAC5E,eAAO,OAAO,SAAY,qBAAqB,2CAA2C,EAAE;AAAA,MAC9F;AACA,aAAO,+CAA+C,MAAM;AAAA,IAC9D;AACE,aAAO;AAAA,EACX;AACF;","names":["at","pre43","at","named","span","at","rule"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/strategy/commands/check.ts","../src/strategy/commands/findings.ts"],"sourcesContent":["/**\n * `manni strategy check`: the pages against the records, and the records\n * against each other, with the baseline ratchet term and cite use.\n *\n * `--baseline` records the findings when the file is not there yet, and after\n * that fails only on findings it does not hold. A configured\n * `strategy.baseline` compares without the flag.\n */\nimport { existsSync } from \"node:fs\";\nimport { resolveBaselineRequest, settleBaseline } from \"../../meta/internal.js\";\nimport { checkStrategySet } from \"../core/check.js\";\nimport { DEFAULT_STRATEGY_BASELINE_PATH } from \"../core/config.js\";\nimport { StrategyError } from \"../errors.js\";\nimport { reportedFindings, summarize, toResults, type StrategyReport } from \"./findings.js\";\nimport { displayPath, loadStrategy, type StrategyCommandOptions } from \"./run.js\";\n\nexport interface CheckOptions extends StrategyCommandOptions {\n /** `--baseline`. */\n baseline?: boolean;\n}\n\nexport async function runCheck(opts: CheckOptions): Promise<StrategyReport> {\n const { cwd, run, set, steps } = await loadStrategy(opts);\n const config = run.config;\n const findings = checkStrategySet(set, {\n ...(config?.severity === undefined ? {} : { severity: config.severity }),\n steps,\n pagePath: (page) => displayPath(page, cwd, run.base),\n });\n const { results, origin } = toResults(set, findings);\n\n // Fingerprints must not depend on where the command was run from.\n const frame = { cwd, base: run.configDir ?? cwd, runBase: run.base };\n let request = resolveBaselineRequest(\n opts.baseline === true ? { baseline: true } : {},\n config?.baseline,\n run.configDir,\n cwd,\n { current: DEFAULT_STRATEGY_BASELINE_PATH },\n );\n if (request !== null && !existsSync(request.absPath)) {\n if (opts.baseline !== true) {\n throw new StrategyError(`Baseline \"${request.label}\" not found. Record one with \\`manni strategy check --baseline\\`.`);\n }\n request = { ...request, write: true };\n }\n const { results: reported, baseline } = await settleBaseline(results, request, frame);\n\n const parents = set.records.reduce((n, r) => n + r.parents.length, 0);\n return {\n findings: reportedFindings(reported, origin, findings),\n results: reported,\n origin,\n summary: summarize(reported, baseline),\n frame,\n records: set.records.length,\n // Two kinds, both resolved: every audiences:, personas: and journeys:\n // value (pages and records alike), plus each value of a record's own\n // parent field, which load-set keeps out of the references.\n references: set.references.length + parents,\n steps: [...steps.values()].reduce((n, s) => n + s.length, 0),\n ...(baseline === undefined ? {} : { baseline }),\n found: findings.length,\n cwd,\n base: run.base,\n };\n}\n","/**\n * The report `check` returns, and the bridge from strategy findings to meta's\n * `ValidationResult`, so the SARIF and JUnit renderers and the baseline\n * ratchet work unchanged, as term's adapter does.\n *\n * FieldError: schema `manni:strategy`, keyword = the rule, instancePath\n * `/<field>` when the finding concerns one field and `\"\"` when it concerns a\n * whole record. The subject is the record, the field and what the finding\n * says before its advice, with any `file:line` taken out, so a moved line or\n * a reworded fix moves no baseline.\n */\nimport {\n isErrorSeverity,\n type BaselineSummary,\n type FieldError,\n type FingerprintContext,\n type RunSummary,\n type ValidationResult,\n} from \"../../meta/index.js\";\nimport { RULE_ID_PREFIX } from \"../core/severity.js\";\nimport type { StrategyFinding, StrategySet } from \"../types.js\";\n\nexport const FINDING_FORMATS = [\"pretty\", \"json\", \"github\", \"sarif\", \"junit\"] as const;\nexport type FindingFormat = (typeof FINDING_FORMATS)[number];\n\n/** JUnit `classname` for the strategy tool's findings. */\nexport const JUNIT_CLASSNAME = \"manni.strategy\";\n\nexport interface StrategyReport {\n /** The findings reported: a baselined one is not among them. */\n findings: StrategyFinding[];\n /** The same findings as meta's results, for SARIF and JUnit. One per file. */\n results: ValidationResult[];\n /** Each error in `results` to the finding it came from. */\n origin: ReadonlyMap<FieldError, StrategyFinding>;\n summary: RunSummary;\n frame: FingerprintContext;\n /** Records in the set. */\n records: number;\n /** Values of audiences:, personas:, journeys: and audience: the run read. */\n references: number;\n /** Steps on the set's journeys, each held to the page it names. */\n steps: number;\n baseline?: BaselineSummary;\n /** Findings before the baseline, for the line a recording run prints. */\n found: number;\n /** Where the run stood, for the paths the reporters print. */\n cwd: string;\n /** What finding files are relative to. */\n base: string;\n}\n\nconst LINE_REFERENCE = /:\\d+\\b/g;\n\nfunction toFieldError(finding: StrategyFinding): FieldError {\n const said = finding.key ?? finding.message;\n const subject = [finding.id ?? \"\", finding.field ?? \"\", said.replace(LINE_REFERENCE, \"\")].join(\"\\u0000\");\n const error: FieldError = {\n schema: RULE_ID_PREFIX,\n instancePath: finding.field === undefined ? \"\" : `/${finding.field}`,\n message: finding.message,\n keyword: finding.rule,\n subject,\n severity: finding.severity,\n };\n if (finding.line !== undefined) error.line = finding.line;\n return error;\n}\n\n/** One result per file: every record's file, every file a reference was read from, and every file a finding sits in. */\nexport function toResults(\n set: StrategySet,\n findings: readonly StrategyFinding[],\n): { results: ValidationResult[]; origin: Map<FieldError, StrategyFinding> } {\n const origin = new Map<FieldError, StrategyFinding>();\n const byFile = new Map<string, FieldError[]>();\n for (const { file } of [...set.records, ...set.references]) if (!byFile.has(file)) byFile.set(file, []);\n for (const finding of findings) {\n const error = toFieldError(finding);\n origin.set(error, finding);\n byFile.set(finding.file, [...(byFile.get(finding.file) ?? []), error]);\n }\n const results = [...byFile.keys()].sort().map((file): ValidationResult => {\n const errors = byFile.get(file) ?? [];\n return { file, format: \"strategy\", ok: !errors.some(isErrorSeverity), schemas: [RULE_ID_PREFIX], errors };\n });\n return { results, origin };\n}\n\n/** The run summary meta's renderers read, from results a baseline may have thinned. */\nexport function summarize(results: readonly ValidationResult[], baseline?: BaselineSummary): RunSummary {\n const failed = results.filter((r) => !r.ok).length;\n const count = (keep: (e: FieldError) => boolean): number => results.reduce((n, r) => n + r.errors.filter(keep).length, 0);\n const warnings = count((e) => e.severity === \"warning\");\n const notices = count((e) => e.severity === \"notice\");\n return {\n files: results.length,\n passed: results.length - failed,\n failed,\n errors: count(isErrorSeverity),\n ...(warnings > 0 ? { warnings } : {}),\n ...(notices > 0 ? { notices } : {}),\n ...(baseline ? { baseline } : {}),\n };\n}\n\n/** The findings still reported once a baseline has thinned the results, in report order. */\nexport function reportedFindings(\n results: readonly ValidationResult[],\n origin: ReadonlyMap<FieldError, StrategyFinding>,\n order: readonly StrategyFinding[],\n): StrategyFinding[] {\n const kept = new Set<StrategyFinding>();\n for (const result of results) {\n for (const error of result.errors) {\n const finding = origin.get(error);\n if (finding !== undefined) kept.add(finding);\n }\n }\n return order.filter((finding) => kept.has(finding));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,SAAS,kBAAkB;;;ACcpB,IAAM,kBAAkB,CAAC,UAAU,QAAQ,UAAU,SAAS,OAAO;AAIrE,IAAM,kBAAkB;AA0B/B,IAAM,iBAAiB;AAEvB,SAAS,aAAa,SAAsC;AAC1D,QAAM,OAAO,QAAQ,OAAO,QAAQ;AACpC,QAAM,UAAU,CAAC,QAAQ,MAAM,IAAI,QAAQ,SAAS,IAAI,KAAK,QAAQ,gBAAgB,EAAE,CAAC,E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,IAAI;AAAA,IACJ;AAAA,IACA,EAAE,SAAS,+BAA+B;AAAA,EAC5C;AACA,MAAI,YAAY,QAAQ,CAAC,WAAW,QAAQ,OAAO,GAAG;AACpD,QAAI,KAAK,aAAa,MAAM;AAC1B,YAAM,IAAI,cAAc,aAAa,QAAQ,KAAK,mEAAmE;AAAA,IACvH;AACA,cAAU,EAAE,GAAG,SAAS,OAAO,KAAK;AAAA,EACtC;AACA,QAAM,EAAE,SAAS,UAAU,SAAS,IAAI,MAAM,eAAe,SAAS,SAAS,KAAK;AAEpF,QAAM,UAAU,IAAI,QAAQ,OAAO,CAAC,GAAG,MAAM,IAAI,EAAE,QAAQ,QAAQ,CAAC;AACpE,SAAO;AAAA,IACL,UAAU,iBAAiB,UAAU,QAAQ,QAAQ;AAAA,IACrD,SAAS;AAAA,IACT;AAAA,IACA,SAAS,UAAU,UAAU,QAAQ;AAAA,IACrC;AAAA,IACA,SAAS,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA,IAIrB,YAAY,IAAI,WAAW,SAAS;AAAA,IACpC,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI,EAAE,QAAQ,CAAC;AAAA,IAC3D,GAAI,aAAa,SAAY,CAAC,IAAI,EAAE,SAAS;AAAA,IAC7C,OAAO,SAAS;AAAA,IAChB;AAAA,IACA,MAAM,IAAI;AAAA,EACZ;AACF;","names":[]}
|
package/dist/cli-4R5HIGG4.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cite/cli.ts","../src/cite/reporters/junit.ts"],"sourcesContent":["/**\n * The `cite` domain's commander program. Mounted by `src/cli.ts` under\n * `manni cite`; no entry point of its own. Grammar per proposal 0034: verbs are\n * `check`, `add`, `update`, `remove`, `history`; there is no default subcommand.\n *\n * Follows clig.dev as meta's does: primary output to stdout, diagnostics to\n * stderr, colour only on a TTY and never under `NO_COLOR`/`--no-color`, exit\n * `0` clean, `1` an error-severity finding, `2` operational/usage.\n */\nimport { Command, Option } from \"commander\";\nimport pkg from \"../../package.json\" with { type: \"json\" };\nimport {\n collect,\n configOption,\n explicitFalse,\n readStdin,\n reportConfig,\n splitList,\n} from \"../shared/cli-options.js\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { splitPageArgument as splitSharedPageArgument } from \"../shared/pin.js\";\nimport { terminalConfirm } from \"../shared/prompt.js\";\nimport { fail } from \"../shared/run.js\";\nimport { notice } from \"../shared/warn.js\";\nimport {\n COMMON_FORMAT_LIST,\n OMITTED_WHEN_CLEAN,\n REPORT_FORMAT_LIST,\n STDIN_TOKEN,\n isMachineFormat,\n} from \"../meta/internal.js\";\nimport { REPORT_FORMATS, isReportFormat } from \"../meta/index.js\";\nimport { runAdd } from \"./commands/add.js\";\nimport { runCheck } from \"./commands/check.js\";\nimport { runHistory } from \"./commands/history.js\";\nimport { runRemove } from \"./commands/remove.js\";\nimport { runUpdate } from \"./commands/update.js\";\nimport { parseRepoFlags } from \"./core/config.js\";\nimport { CiteError, asCiteError } from \"./errors.js\";\nimport { spellSource } from \"./core/range.js\";\nimport { shortCommit, shortLine, shortPin, shortSrc } from \"./core/spell.js\";\nimport { renderCheckGithub } from \"./reporters/github.js\";\nimport { renderCheckJson, renderHistoryJson, renderRemoveJson, renderUpdateJson } from \"./reporters/json.js\";\nimport { renderCheckJunit } from \"./reporters/junit.js\";\nimport {\n renderCheckPretty,\n renderHistoryPretty,\n renderRemovePretty,\n renderUpdatePretty,\n} from \"./reporters/pretty.js\";\nimport { renderCheckSarif } from \"./reporters/sarif.js\";\nimport type { AddResult, PageLines } from \"./types.js\";\n\nconst UPDATE_FORMATS = [\"pretty\", \"json\"] as const;\ntype UpdateFormat = (typeof UPDATE_FORMATS)[number];\n/** The same two `update` has: a removal is a write, and writes report alike. */\nconst REMOVE_FORMATS = UPDATE_FORMATS;\ntype RemoveFormat = UpdateFormat;\n/** The same two again: a window is not a finding, so the finding sinks are left out. */\nconst HISTORY_FORMATS = UPDATE_FORMATS;\n\nfunction isHistoryFormat(value: string): value is UpdateFormat {\n return (HISTORY_FORMATS as readonly string[]).includes(value);\n}\n\n/**\n * Whether `command`'s output gets colour: this domain's `--no-color` and\n * `NO_COLOR` turn it off, and otherwise only a TTY turns it on\n * (`shouldColor`). `isTTY` is passed uncoerced: Node leaves it undefined off\n * a terminal, never false, and `shouldColor` reads a missing one as \"not a\n * terminal\".\n */\nexport function colorFor(\n command: Command,\n isTTY: boolean | undefined,\n env?: NodeJS.ProcessEnv,\n): boolean {\n // commander maps --no-color to opts.color === false, on the command that\n // declares it.\n const noColor = colorOwner(command).opts().color === false;\n return shouldColor({ noColor, isTTY, env });\n}\n\n/**\n * The nearest command, this one or an ancestor, that declares `--no-color`:\n * the `cite` program, wherever it is mounted. Not the root: under the\n * umbrella that is `manni`, which has no `--no-color` of its own.\n */\nfunction colorOwner(command: Command): Command {\n for (let c: Command | null = command; c !== null; c = c.parent) {\n if (c.options.some((o) => o.long === \"--no-color\")) return c;\n }\n return command;\n}\n\nfunction isUpdateFormat(value: string): value is UpdateFormat {\n return (UPDATE_FORMATS as readonly string[]).includes(value);\n}\n\nfunction isRemoveFormat(value: string): value is RemoveFormat {\n return (REMOVE_FORMATS as readonly string[]).includes(value);\n}\n\n/**\n * Commander hands an `.action()` callback an untyped bag of option values, so\n * each subcommand declares the shape it actually reads. The `--no-<thing>`\n * flags are `boolean` and never `undefined`: commander supplies `true` when\n * the flag is absent, which is its default and not a choice, so only the\n * explicit `false` travels to the core (`explicitFalse`).\n */\ninterface InputCliOptions {\n /** `--collection <name>`, repeatable; commander's default value is `[]`. */\n collection: string[];\n /** `--ext <list>`; the command splits it. */\n ext?: string;\n /** `--exclude <glob>`, repeatable; commander's default value is `[]`. */\n exclude: string[];\n /** `--as <format>`: force an extractor. */\n as?: string;\n /**\n * `-c, --config <path>` and `--no-config` share one commander attribute:\n * `undefined` with neither flag, the path with `-c`, `false` with\n * `--no-config`. Split by `configOption`.\n */\n config?: string | boolean;\n allowEmpty?: boolean;\n /** `--no-gitignore`. */\n gitignore: boolean;\n /** `--root <dir>`: where `src:` paths resolve from. */\n root?: string;\n}\n\ninterface CheckCliOptions extends InputCliOptions {\n /** `-f, --format <format>`. Always a string: the declaration has a default. */\n format: string;\n quiet?: boolean;\n /**\n * `--baseline [path]` / `--no-baseline`, the same three-state split as\n * `config`: absent leaves the config in charge, a string names a file, `true`\n * is a bare `--baseline` (the default path), `false` is `--no-baseline`.\n */\n baseline?: string | boolean;\n /** `--write-baseline [path]`; `true` for the bare flag. */\n writeBaseline?: string | boolean;\n /** `--no-check-sources`. */\n checkSources: boolean;\n showDiff?: boolean;\n reveal?: boolean;\n /** `--repo <name=dir>`, repeatable; commander's default value is `[]`. */\n repo: string[];\n}\n\ninterface AddCliOptions {\n id?: string;\n marker?: boolean;\n quote?: boolean;\n /** `--encrypt`. */\n encrypt?: boolean;\n /** `--no-commit-sha`. */\n commitSha: boolean;\n dryRun?: boolean;\n as?: string;\n root?: string;\n /** `--repo <name=dir>`, repeatable; commander's default value is `[]`. */\n repo: string[];\n config?: string | boolean;\n}\n\ninterface RemoveCliOptions extends Omit<InputCliOptions, \"root\"> {\n /** `--only <id>`, repeatable; commander's default value is `[]`. */\n only: string[];\n dryRun?: boolean;\n format: string;\n}\n\ninterface HistoryCliOptions extends InputCliOptions {\n /** `--newer-than <duration>`; the core parses it. */\n newerThan?: string;\n format: string;\n}\n\ninterface UpdateCliOptions extends InputCliOptions {\n /** `--no-check-sources`: declared so the refusal names the flag rather than commander rejecting it. */\n checkSources: boolean;\n accept?: boolean;\n recommit?: boolean;\n /** `--only <id>`, repeatable; commander's default value is `[]`. */\n only: string[];\n dryRun?: boolean;\n format: string;\n /** `--repo <name=dir>`, repeatable; commander's default value is `[]`. */\n repo: string[];\n}\n\n/**\n * Split `docs/limits.md:9` or `docs/limits.md:14-18` into the page and the\n * claim's lines, under cite's error contract. The parsing is the shared pin\n * engine's (`splitPageArgument` in `src/shared/pin.ts`).\n */\nexport function splitPageArgument(arg: string): { page: string; lines?: PageLines } {\n return asCiteError(() => splitSharedPageArgument(arg));\n}\n\n/** `line 9`, or `lines 14-18` for a range. */\nfunction spellAt(lines: PageLines, noun = \"line\"): string {\n return lines.start === lines.end\n ? `${noun} ${String(lines.start)}`\n : `${noun}s ${String(lines.start)}-${String(lines.end)}`;\n}\n\n/**\n * What `add` says on success. One sentence composed from the result: what was\n * added, where it went, and what each end is pinned to. Lines are the page's\n * own, after the write. The source is spelled as it was written to the page,\n * abbreviated when it is a ciphertext, and quoted with its first pinned line\n * where the result carries one.\n */\nexport function addMessage(result: AddResult): string {\n const { citation, claimLines } = result;\n const claim = citation.claim;\n const name = citation.id ?? (claim === undefined ? \"a bare pin\" : \"an entry\");\n const src = shortSrc(spellSource(citation.source));\n const commit = citation.source[\"commit-sha\"];\n const quoted = result.sourceLine === undefined ? \"\" : shortLine(result.sourceLine);\n const line = quoted === \"\" ? \"\" : ` \"${quoted}\"`;\n const pin = `${src}${line}, ${shortPin(citation.source.integrity)}, ${commit === undefined ? \"no commit\" : shortCommit(commit)}`;\n // Where it went: the page's own frontmatter, or the manifest that owns the\n // page's citations, at the line the entry now sits on.\n const where =\n result.manifest === undefined\n ? \"frontmatter\"\n : `${result.manifest.file}:${String(result.manifest.line)}`;\n const head = `${result.file}: added ${name} to ${where}`;\n\n if (result.markerLine !== undefined) {\n const at =\n claimLines === undefined ? \"\" : `, claim pinned at ${spellAt(claimLines)}`;\n const wrote = result.markerJoined === true ? \"joined the marker at line\" : \"marker at line\";\n const marked = `${head}; ${wrote} ${String(result.markerLine)}${at}`;\n if (claim === undefined) return marked;\n if (citation.quote === true) return `${marked} (a block that reproduces ${src})`;\n return `${marked} (${shortPin(claim.integrity)}; source ${pin})`;\n }\n if (claim === undefined || claimLines === undefined) {\n return `${head} (source ${pin})`;\n }\n if (citation.quote === true) {\n return `${head} (claim ${spellAt(claimLines, \"line\")}, a block that reproduces ${src})`;\n }\n return `${head} (claim at ${spellAt(claimLines)}, ${shortPin(claim.integrity)}; source ${pin})`;\n}\n\nexport function buildProgram(): Command {\n const program = new Command();\n program\n .name(\"cite\")\n .description(\n \"Track citations from doc claims to source lines and check them for drift.\",\n )\n .version(pkg.version, \"-V, --version\")\n .option(\"--no-color\", \"disable colored output\")\n // A pointer, not the whole help screen: the message that precedes it\n // already names the offending flag.\n .showHelpAfterError(\"(add --help for usage)\")\n // MUST come before the `.command()` calls below. `copyInheritedSettings`\n // copies `_exitCallback` by value at subcommand-creation time, so an\n // `exitOverride()` installed afterwards leaves every subcommand still\n // calling `process.exit(1)`.\n .exitOverride();\n\n program\n .command(\"check\")\n .description(\"Check every citation in the given pages against its source\")\n .argument(\n \"[paths...]\",\n \"files, directories, or globs to check (use - for stdin)\",\n )\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force an input format for every input\")\n .option(\n \"-f, --format <format>\",\n `output: ${REPORT_FORMATS.join(\" | \")}`,\n \"pretty\",\n )\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\")\n .option(\"-q, --quiet\", \"in pretty output, hide current citations and clean files\")\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"check files .gitignore covers\")\n // No `defaultValue` and no `.preset()`, for the reasons meta's validate\n // gives: a bare flag must stay distinguishable from a typed path.\n .addOption(\n new Option(\n \"--baseline [path]\",\n \"compare against a baseline; fail only on findings not in it\",\n ),\n )\n .addOption(\n new Option(\n \"--write-baseline [path]\",\n \"record current findings as the baseline, then exit 0\",\n ),\n )\n .option(\"--no-baseline\", \"ignore a baseline configured by `baseline:`\")\n .option(\"--no-check-sources\", \"page-side rules only; every source status is skipped\")\n .option(\n \"--root <dir>\",\n \"directory src: paths resolve from (default: cite.root from config, else the git root, else the current directory)\",\n )\n .option(\n \"--repo <name=dir>\",\n \"a checkout an entry's source.repo may name, as name=dir relative to the current directory; repeatable; overrides cite.repos for that name\",\n collect,\n [],\n )\n .option(\"--show-diff\", \"in pretty output, print the diff and commit subjects for changed\")\n .option(\"--reveal\", \"in pretty output, print the decrypted path beside an encrypted source\")\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni cite check docs/ # walk a directory\",\n \" manni cite check --collection guides # one configured collection\",\n ' manni cite check \"docs/**/*.md\" -f github # CI annotations',\n \" manni cite check --show-diff docs/limits.md # see what changed\",\n \" manni cite check --baseline # fail only on new findings\",\n \" cat page.md | manni cite check - --as markdown\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: CheckCliOptions, command: Command) => {\n try {\n const format = options.format;\n if (!isReportFormat(format)) {\n throw new CiteError(\n `Unknown --format \"${format}\". Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n const exts = options.ext ? splitList(options.ext) : undefined;\n const stdinContent = paths.includes(STDIN_TOKEN) ? await readStdin() : undefined;\n const cwd = process.cwd();\n\n const run = await runCheck({\n inputs: paths,\n collection: options.collection,\n exts,\n exclude: options.exclude,\n as: options.as,\n ...configOption(options.config),\n onConfigLoaded: reportConfig(!isMachineFormat(format), cwd),\n stdinContent,\n // `undefined` rather than `false` when absent, so config still wins.\n allowEmpty: options.allowEmpty ? true : undefined,\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n baseline: options.baseline,\n writeBaseline: options.writeBaseline,\n checkSources: explicitFalse(options.checkSources),\n // Only so the run can say git is not there to give diffs; the diffs\n // themselves are the pretty reporter's.\n showDiff: options.showDiff ? true : undefined,\n root: options.root,\n repos: parseRepoFlags(options.repo, (message) => new CiteError(message)),\n });\n\n let text: string;\n switch (format) {\n case \"pretty\":\n text = renderCheckPretty(run, {\n color: colorFor(command, process.stdout.isTTY),\n quiet: Boolean(options.quiet),\n showDiff: Boolean(options.showDiff),\n reveal: Boolean(options.reveal),\n });\n break;\n case \"json\":\n text = renderCheckJson(run);\n break;\n case \"github\":\n text = renderCheckGithub(run);\n break;\n case \"sarif\":\n text = renderCheckSarif(run, { onNotice: notice });\n break;\n case \"junit\":\n text = renderCheckJunit(run);\n break;\n }\n // Only `github` may say nothing on a clean run; every other format\n // owes its envelope even when empty.\n if (text.length > 0 || !OMITTED_WHEN_CLEAN.has(format)) {\n process.stdout.write(`${text}\\n`);\n }\n // `failed` counts files with an unbaselined error-severity finding;\n // warnings never move it.\n process.exitCode = run.summary.failed > 0 ? 1 : 0;\n } catch (err) {\n fail(err);\n }\n });\n\n program\n .command(\"add\")\n .description(\"Mint a citation for a source range and write it to a page\")\n .argument(\n \"<page>\",\n \"the page to cite from, with the claim's lines: page:L or page:L1-L2 (use - for stdin, with --as)\",\n )\n .argument(\n \"<src>\",\n \"path, path:L or path:L1-L2 relative to --root, or repo:path with the same line forms for a checkout in cite.repos, or an encrypted ~source\",\n )\n .option(\"--id <id>\", \"kebab-case id, unique on the page; required with --marker\")\n .option(\"--marker\", \"write a cite <id> marker above the paragraph holding the page lines and pin the text it anchors\")\n .option(\"--quote\", \"the page lines are a fenced block that reproduces the source\")\n .option(\n \"--encrypt\",\n \"write source.file encrypted, with an hmac-sha256- pin; with no key, offer to create one (an available key encrypts without the flag)\",\n )\n .option(\"--no-commit-sha\", \"do not record HEAD\")\n .option(\"--dry-run\", \"print the diff; write nothing\")\n .option(\"--as <format>\", \"force the page format\")\n .option(\"--root <dir>\", \"directory source paths resolve from (as check)\")\n .option(\n \"--repo <name=dir>\",\n \"a checkout an entry's source.repo may name, as name=dir relative to the current directory; repeatable; overrides cite.repos for that name\",\n collect,\n [],\n )\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\")\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni cite add docs/limits.md:9 lib/limits.ts:2 --id fetch-timeout\",\n \" manni cite add docs/limits.md:30 lib/limits.ts:8-12 --id timeouts --marker\",\n \" manni cite add docs/limits.md:14-18 lib/limits.ts:1-3 --quote\",\n \" manni cite add docs/limits.md lib/limits.ts --dry-run\",\n \" cat page.md | manni cite add -:9 lib/limits.ts:2 --as markdown > out.md\",\n ].join(\"\\n\"),\n )\n .action(async (pageArgument: string, src: string, options: AddCliOptions) => {\n try {\n const { page, lines } = splitPageArgument(pageArgument);\n const usingStdin = page === STDIN_TOKEN;\n const stdinContent = usingStdin ? await readStdin() : undefined;\n const dryRun = Boolean(options.dryRun);\n const cwd = process.cwd();\n\n const result = await runAdd({\n page,\n pageLines: lines,\n src,\n id: options.id,\n marker: options.marker ? true : undefined,\n quote: options.quote ? true : undefined,\n // `undefined` when absent, so the key decides: an available one\n // encrypts without the flag.\n encrypt: options.encrypt ? true : undefined,\n commitSha: explicitFalse(options.commitSha),\n dryRun,\n as: options.as,\n ...configOption(options.config),\n // With `-` the page owns stdout; so does the diff under --dry-run.\n onConfigLoaded: reportConfig(!usingStdin && !dryRun, cwd),\n stdinContent,\n root: options.root,\n repos: parseRepoFlags(options.repo, (message) => new CiteError(message)),\n onNotice: notice,\n // Only on a terminal: off one, a missing key is a refusal, not a\n // question nobody can answer. With `-` stdin is the page, so no\n // question is put either.\n confirm: terminalConfirm(),\n });\n\n const message = addMessage(result);\n // A dry run prints every diff the write would make: the page's, and\n // the manifest's when the entry goes there.\n const diffs = [result.diff, result.manifest?.diff ?? \"\"].filter((d) => d.length > 0);\n if (usingStdin) {\n // The rewritten page owns stdout; everything else is a diagnostic.\n process.stdout.write(result.content);\n if (dryRun) for (const diff of diffs) process.stderr.write(`${diff}\\n`);\n process.stderr.write(`${message}\\n`);\n } else if (dryRun) {\n for (const diff of diffs) process.stdout.write(`${diff}\\n`);\n process.stderr.write(`${message}\\n`);\n } else {\n process.stdout.write(`${message}\\n`);\n }\n process.exitCode = 0;\n } catch (err) {\n fail(err);\n }\n });\n\n program\n .command(\"update\")\n .description(\"Rewrite moved citations in place; with --accept, re-mint changed ones\")\n .argument(\n \"[paths...]\",\n \"files, directories, or globs to update (use - for stdin)\",\n )\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force an input format for every input\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\")\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"update files .gitignore covers\")\n .option(\"--no-check-sources\", \"refused: update needs the sources\")\n .option(\"--root <dir>\", \"directory src: paths resolve from (as check)\")\n .option(\n \"--repo <name=dir>\",\n \"a checkout an entry's source.repo may name, as name=dir relative to the current directory; repeatable; overrides cite.repos for that name\",\n collect,\n [],\n )\n .option(\"--accept\", \"re-mint changed and never-true entries at HEAD; prints old and new pins\")\n .option(\n \"--recommit\",\n \"re-record commit-sha to the commit where the pinned lines arrived on HEAD's history, where the recorded commit does not contain them or is outside that history\",\n )\n .option(\"--only <id>\", \"limit to entries with this id; repeatable\", collect, [])\n .option(\"--dry-run\", \"print the diffs; write nothing\")\n .option(\n \"-f, --format <format>\",\n `output: ${UPDATE_FORMATS.join(\" | \")}`,\n \"pretty\",\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni cite update docs/ # rewrite moved entries\",\n \" manni cite update --accept --only fetch-timeout docs/limits.md\",\n \" manni cite update --dry-run docs/ # see the diffs first\",\n \" manni cite update --recommit docs/ # repair unsupported commit-sha\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: UpdateCliOptions, command: Command) => {\n try {\n const format = options.format;\n if (!isUpdateFormat(format)) {\n throw new CiteError(\n `Unknown --format \"${format}\". Use ${COMMON_FORMAT_LIST}.`,\n );\n }\n if (!options.checkSources) {\n throw new CiteError(\n \"update needs the sources: drop --no-check-sources (or `checkSources: false`).\",\n );\n }\n const exts = options.ext ? splitList(options.ext) : undefined;\n const usingStdin = paths.includes(STDIN_TOKEN);\n const stdinContent = usingStdin ? await readStdin() : undefined;\n const dryRun = Boolean(options.dryRun);\n // With `-` the rewritten page owns stdout, as it does for `add -`; a\n // dry run prints the diffs instead, so the report keeps stdout.\n const pageToStdout = usingStdin && !dryRun;\n const cwd = process.cwd();\n\n const run = await runUpdate({\n inputs: paths,\n collection: options.collection,\n exts,\n exclude: options.exclude,\n as: options.as,\n ...configOption(options.config),\n onConfigLoaded: reportConfig(format === \"pretty\" && !pageToStdout, cwd),\n stdinContent,\n allowEmpty: options.allowEmpty ? true : undefined,\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n root: options.root,\n repos: parseRepoFlags(options.repo, (message) => new CiteError(message)),\n accept: options.accept ? true : undefined,\n recommit: options.recommit ? true : undefined,\n only: options.only.length > 0 ? options.only : undefined,\n dryRun,\n });\n\n const text =\n format === \"json\"\n ? renderUpdateJson(run)\n : renderUpdatePretty(run, {\n color: colorFor(command, process.stdout.isTTY),\n // The diffs are the point of a dry run; a real run prints\n // what it rewrote and leaves the file to say the rest.\n showDiff: dryRun,\n });\n const stdinPage = pageToStdout ? run.pages.find((page) => page.content !== undefined) : undefined;\n if (stdinPage?.content !== undefined) {\n process.stdout.write(stdinPage.content);\n process.stderr.write(`${text}\\n`);\n } else {\n process.stdout.write(`${text}\\n`);\n }\n // Exit 1 when something was skipped with an error-severity finding:\n // work left undone, `fill`'s precedent.\n process.exitCode = run.exitCode;\n } catch (err) {\n fail(err);\n }\n });\n\n program\n .command(\"remove\")\n .description(\"Remove the named citations from the given pages, markers and all\")\n .argument(\n \"[paths...]\",\n \"files, directories, or globs to remove from (use - for stdin)\",\n )\n .option(\n \"--collection <name>\",\n \"configured collection to run over; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force an input format for every input\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\")\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"remove from files .gitignore covers\")\n .option(\n \"--only <id>\",\n \"the entry to remove, by id or by pointer (/citations/N); required, and repeatable\",\n collect,\n [],\n )\n .option(\"--dry-run\", \"print the diffs and the report; write nothing\")\n .option(\n \"-f, --format <format>\",\n `output: ${REMOVE_FORMATS.join(\" | \")}`,\n \"pretty\",\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni cite remove docs/limits.md --only fetch-timeout\",\n \" manni cite remove docs/ --only fetch-timeout --only retries --dry-run\",\n \" manni cite remove --collection site --only /citations/3 -f json\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: RemoveCliOptions, command: Command) => {\n try {\n const format = options.format;\n if (!isRemoveFormat(format)) {\n throw new CiteError(\n `Unknown --format \"${format}\". Use ${COMMON_FORMAT_LIST}.`,\n );\n }\n const exts = options.ext ? splitList(options.ext) : undefined;\n const usingStdin = paths.includes(STDIN_TOKEN);\n const stdinContent = usingStdin ? await readStdin() : undefined;\n const dryRun = Boolean(options.dryRun);\n // With `-` the rewritten page owns stdout, exactly as on `update -`.\n const pageToStdout = usingStdin && !dryRun;\n const cwd = process.cwd();\n\n const run = await runRemove({\n inputs: paths,\n collection: options.collection,\n exts,\n exclude: options.exclude,\n as: options.as,\n ...configOption(options.config),\n onConfigLoaded: reportConfig(format === \"pretty\" && !pageToStdout, cwd),\n stdinContent,\n allowEmpty: options.allowEmpty ? true : undefined,\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n only: options.only,\n dryRun,\n });\n\n const text =\n format === \"json\"\n ? renderRemoveJson(run)\n : renderRemovePretty(run, {\n color: colorFor(command, process.stdout.isTTY),\n // The diffs are the point of a dry run; a real run prints\n // what it removed and leaves the file to say the rest.\n showDiff: dryRun,\n dryRun,\n });\n const stdinPage = pageToStdout ? run.pages.find((page) => page.content !== undefined) : undefined;\n if (stdinPage?.content !== undefined) {\n process.stdout.write(stdinPage.content);\n process.stderr.write(`${text}\\n`);\n } else {\n process.stdout.write(`${text}\\n`);\n }\n // Everything named was removed, or previewed: there is no exit 1.\n process.exitCode = 0;\n } catch (err) {\n fail(err);\n }\n });\n\n program\n .command(\"history\")\n .description(\"Walk the git history and report how long each pin stood stale, and which releases shipped it\")\n .argument(\"[paths...]\", \"files, directories, or globs whose citations are walked\")\n .option(\n \"--collection <name>\",\n \"configured collection to walk; repeatable\",\n collect,\n [],\n )\n .option(\"--ext <list>\", \"comma-separated extensions for directory walks\")\n .option(\"--exclude <glob>\", \"glob to exclude; repeatable\", collect, [])\n .option(\"--as <format>\", \"force the page format for every input\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .option(\"--no-config\", \"ignore any discovered config file\")\n .option(\"--allow-empty\", \"treat zero matched files as success\")\n .option(\"--no-gitignore\", \"walk pages .gitignore covers\")\n .option(\"--root <dir>\", \"directory src: paths resolve from (as check)\")\n .option(\n \"--newer-than <duration>\",\n \"walk only the commits within this span of HEAD's committer time, e.g. 90d or 12w\",\n )\n .option(\n \"-f, --format <format>\",\n `output: ${HISTORY_FORMATS.join(\" | \")}`,\n \"pretty\",\n )\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni cite history docs/limits.md # one page's stale windows\",\n \" manni cite history # every collection\",\n \" manni cite history -f json | jq .summary.staleSeconds\",\n \" manni cite history --newer-than 90d # the last quarter only\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: HistoryCliOptions, command: Command) => {\n try {\n const format = options.format;\n if (!isHistoryFormat(format)) {\n throw new CiteError(\n `Unknown --format \"${format}\". Use ${COMMON_FORMAT_LIST}.`,\n );\n }\n const cwd = process.cwd();\n const run = await runHistory({\n inputs: paths,\n collection: options.collection,\n exts: options.ext ? splitList(options.ext) : undefined,\n exclude: options.exclude,\n as: options.as,\n ...configOption(options.config),\n onConfigLoaded: reportConfig(format === \"pretty\", cwd),\n allowEmpty: options.allowEmpty ? true : undefined,\n respectGitignore: explicitFalse(options.gitignore),\n onNotice: notice,\n root: options.root,\n newerThan: options.newerThan,\n });\n const text =\n format === \"json\"\n ? renderHistoryJson(run)\n : renderHistoryPretty(run, { color: colorFor(command, process.stdout.isTTY) });\n process.stdout.write(`${text}\\n`);\n // A report, not a gate: whatever the walk found, it exits 0.\n process.exitCode = 0;\n } catch (err) {\n fail(err);\n }\n });\n\n return program;\n}\n","/**\n * JUnit for `check`: meta's renderer over the adapted results, under the\n * `manni.cite` classname, with each failure's message the one the github\n * annotation carries.\n * Meta's renderer opens every message with the entry's JSON Pointer, `(root)`\n * for a finding about no entry, which says nothing about a citation. The\n * failure's `type` is already the rule id.\n */\nimport { renderJunit } from \"../../meta/index.js\";\nimport type { CheckRun } from \"../types.js\";\nimport { ENTRY_LABEL, withFindingMessages } from \"./sarif.js\";\n\n/** JUnit `classname` for the citation tool's findings. */\nexport const JUNIT_CLASSNAME = \"manni.cite\";\n\n/** A `message=\"` attribute's opening label. The value is escaped, so `message=\"` opens nothing else. */\nconst MESSAGE_LABEL = new RegExp(`message=\"${ENTRY_LABEL.source.replace(/^\\^/, \"\")}`, \"g\");\n\nexport function renderCheckJunit(run: CheckRun): string {\n return renderJunit(withFindingMessages(run), { frame: run.frame, classname: JUNIT_CLASSNAME }).replace(\n MESSAGE_LABEL,\n 'message=\"',\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,SAAS,cAAc;;;ACIzB,IAAM,kBAAkB;AAG/B,IAAM,gBAAgB,IAAI,OAAO,YAAY,YAAY,OAAO,QAAQ,OAAO,EAAE,CAAC,IAAI,GAAG;AAElF,SAAS,iBAAiB,KAAuB;AACtD,SAAO,YAAY,oBAAoB,GA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