@hawkeyexl/manni 4.17.1 → 4.18.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-SAW4E46C.js → batch-5TPNK5BQ.js} +13 -13
- package/dist/{build-F6S3W77I.js → build-GGKCRWKH.js} +14 -14
- package/dist/{calibrate-3DW2VV7F.js → calibrate-OGOLLGXY.js} +14 -14
- package/dist/{capture-PKEYY2VO.js → capture-CNHRHTA7.js} +13 -13
- package/dist/{check-EZN7YNVF.js → check-BAMOJMOJ.js} +15 -13
- package/dist/{check-LRX2YFDF.js → check-XLIS5A7G.js} +12 -12
- package/dist/check-XYGABPXI.js +47 -0
- package/dist/{check-7PUIHLFM.js → check-ZFI7H7LS.js} +14 -14
- package/dist/{chunk-DU6CXY5R.js → chunk-27FP4KKD.js} +6 -6
- package/dist/{chunk-B5R5BWMY.js → chunk-2QZCPPVE.js} +32 -11
- package/dist/chunk-2QZCPPVE.js.map +1 -0
- package/dist/{chunk-VRMQSP7O.js → chunk-327CWO33.js} +3 -3
- package/dist/{chunk-JK56UPNQ.js → chunk-33FIOHJ4.js} +10 -10
- package/dist/{chunk-QIWSEKA6.js → chunk-3COYAAR7.js} +2 -2
- package/dist/{chunk-3446DW4W.js → chunk-3LZ6AYB4.js} +2 -2
- package/dist/{chunk-ABAFKOQF.js → chunk-4A445ALG.js} +3 -3
- package/dist/{chunk-M6DNOHJO.js → chunk-4KY2RUXQ.js} +3 -3
- package/dist/{chunk-PS4Y7EPP.js → chunk-5VA3ZOB7.js} +3 -3
- package/dist/{chunk-XPGK4ECA.js → chunk-6E6Z6UQL.js} +7 -7
- package/dist/{chunk-TUMR35B3.js → chunk-6ZYXK3JT.js} +3 -3
- package/dist/{chunk-KUXAHHDE.js → chunk-7RZQAMA2.js} +4 -4
- package/dist/{chunk-ZEYNLKOH.js → chunk-CWVL7XZR.js} +4 -4
- package/dist/{chunk-FEURGKJC.js → chunk-E3YXGLEU.js} +2 -2
- package/dist/{chunk-W7XOMNYC.js → chunk-E76WPNYO.js} +2 -2
- package/dist/{chunk-Q7E43SXN.js → chunk-EITEHOSX.js} +5 -5
- package/dist/{chunk-U5NSIZRS.js → chunk-EU5QLSNN.js} +3 -3
- package/dist/{chunk-TNYIXIYV.js → chunk-F7GYY373.js} +5 -5
- package/dist/{chunk-WBXVQW57.js → chunk-FE3US7FR.js} +3 -3
- package/dist/{chunk-YJHHXM5B.js → chunk-FNQE3RAW.js} +2 -2
- package/dist/{chunk-WRSWZEVU.js → chunk-FO6MNXOF.js} +5 -5
- package/dist/{chunk-5D24C6WM.js → chunk-GMOAW2EG.js} +6 -2
- package/dist/chunk-GMOAW2EG.js.map +1 -0
- package/dist/{chunk-OZL5M764.js → chunk-GNZKLUZW.js} +29 -13
- package/dist/chunk-GNZKLUZW.js.map +1 -0
- package/dist/{chunk-2A5OIZHT.js → chunk-ICRYIYMJ.js} +7 -7
- package/dist/{chunk-KCNBM42T.js → chunk-IIBVQCCR.js} +4 -4
- package/dist/{chunk-KB4MNUKC.js → chunk-JFB45L7D.js} +2 -2
- package/dist/{chunk-HEVYEI6O.js → chunk-JFPCDIES.js} +2 -2
- package/dist/{chunk-5VNFO2RT.js → chunk-JHUEACRT.js} +23 -13
- package/dist/chunk-JHUEACRT.js.map +1 -0
- package/dist/{chunk-2TLNAGVJ.js → chunk-JS5NCZYC.js} +5 -5
- package/dist/{chunk-QIKCIREY.js → chunk-KRQTN5KE.js} +4 -4
- package/dist/{chunk-AIZBZYQM.js → chunk-MH5MX4B3.js} +2 -2
- package/dist/{chunk-MBLVLQWI.js → chunk-NUAVQQMC.js} +2 -2
- package/dist/{chunk-WP5EKWTU.js → chunk-O2TE5X25.js} +5 -5
- package/dist/{chunk-LDIUA4ZG.js → chunk-OVQDZOMU.js} +2 -2
- package/dist/{chunk-FAS3SRQB.js → chunk-OZWV27SE.js} +379 -21
- package/dist/chunk-OZWV27SE.js.map +1 -0
- package/dist/{chunk-IGE6CIKZ.js → chunk-PCTJ7P6U.js} +2 -2
- package/dist/{chunk-IGE6CIKZ.js.map → chunk-PCTJ7P6U.js.map} +1 -1
- package/dist/{chunk-DSJTYRI5.js → chunk-PLN2LJDM.js} +3 -3
- package/dist/{chunk-XWUIFSWK.js → chunk-QGJA43DX.js} +3 -3
- package/dist/{chunk-64EDFJ5S.js → chunk-QWYE3S3U.js} +5 -5
- package/dist/{chunk-XCEEJEVA.js → chunk-QXTL5MGT.js} +4 -4
- package/dist/{chunk-XRWQQHBR.js → chunk-RCWP63XT.js} +2 -2
- package/dist/{chunk-W7IEP7IG.js → chunk-RMKMJ43W.js} +2 -2
- package/dist/{chunk-FPPHEHPZ.js → chunk-RVSUMNCR.js} +2 -2
- package/dist/{chunk-4GGADKTU.js → chunk-SVB45M54.js} +5 -5
- package/dist/{chunk-MDXDTO7E.js → chunk-T3VFO2LO.js} +6 -6
- package/dist/{chunk-2LCJNH73.js → chunk-TFTGMYDR.js} +2 -2
- package/dist/{chunk-WZSL7KF2.js → chunk-V2IP2ZMD.js} +2 -2
- package/dist/{chunk-ZIXU7A4C.js → chunk-V5QTIP2M.js} +168 -80
- package/dist/chunk-V5QTIP2M.js.map +1 -0
- package/dist/{chunk-KAWS7H4C.js → chunk-VV4YM6VM.js} +8 -8
- package/dist/{chunk-3UYSONT4.js → chunk-XKZZRG3Z.js} +20 -10
- package/dist/chunk-XKZZRG3Z.js.map +1 -0
- package/dist/{chunk-D3AO2PMV.js → chunk-XTQTA262.js} +142 -23
- package/dist/chunk-XTQTA262.js.map +1 -0
- package/dist/{chunk-6J2ED4ED.js → chunk-YLU4H2H3.js} +6 -6
- package/dist/{chunk-5QOTR53S.js → chunk-ZLOLC6WD.js} +4 -4
- package/dist/{cli-LRKBCQRS.js → cli-6UQ3QV2G.js} +9 -9
- package/dist/{cli-5ZQXVWWC.js → cli-GH42HLFK.js} +41 -22
- package/dist/cli-GH42HLFK.js.map +1 -0
- package/dist/{cli-D5WYQVUF.js → cli-GND6TVRG.js} +14 -14
- package/dist/{cli-FCGGNZ5C.js → cli-JHULEOH2.js} +2 -2
- package/dist/{cli-TJDQ5GUW.js → cli-LVHZCC2O.js} +14 -14
- package/dist/{cli-NJC3H3CW.js → cli-NWU77YRZ.js} +14 -14
- package/dist/{cli-OHKWCJIJ.js → cli-PUO75R3L.js} +20 -20
- package/dist/{cli-VC3BXCVR.js → cli-Q2RJMCVE.js} +27 -19
- package/dist/cli-Q2RJMCVE.js.map +1 -0
- package/dist/{cli-FNX4LXMI.js → cli-RUNYBUIV.js} +35 -35
- package/dist/{cli-RKYIZ6KU.js → cli-T7UJF3BF.js} +26 -26
- package/dist/{cli-LQRHK23G.js → cli-WUFQGIUG.js} +9 -9
- package/dist/cli.js +14 -14
- package/dist/docmeta.js +8 -8
- package/dist/{github-6PV2JTZ7.js → github-BV42LSW2.js} +12 -12
- package/dist/{github-7ZT4KYQU.js → github-XZ7OLATY.js} +14 -14
- package/dist/index.d.ts +172 -87
- package/dist/index.js +41 -41
- package/dist/{json-VWXLDTXR.js → json-LEEXKSGP.js} +12 -12
- package/dist/{json-5EQCGVCV.js → json-YTKUFNO3.js} +2 -2
- package/dist/{labels-ZJK27RL3.js → labels-E256WRAI.js} +11 -11
- package/dist/{lint-5OERIERT.js → lint-W4CM3EIO.js} +12 -12
- package/dist/{list-MANBRF7Z.js → list-TB4R6AP4.js} +12 -12
- package/dist/{list-SEEANTU6.js → list-UDDGL2OI.js} +12 -12
- package/dist/{page-O4M65KMJ.js → page-L64NO57W.js} +11 -11
- package/dist/{prepare-3WULLZER.js → prepare-GFTAYDTP.js} +12 -12
- package/dist/{pretty-D3M366JD.js → pretty-HYCYKYHB.js} +13 -13
- package/dist/{pretty-5FRBLTXU.js → pretty-Q43TCD6D.js} +12 -12
- package/dist/{reporters-4WWZRHKI.js → reporters-4HRBSMUF.js} +4 -4
- package/dist/{reporters-GDCZ5P7C.js → reporters-E3FUVBQ6.js} +11 -11
- package/dist/{run-TZDLG6EN.js → run-UDX2C54M.js} +12 -12
- package/dist/{sarif-SSSPOUCK.js → sarif-WL353VTA.js} +10 -10
- package/dist/{sarif-PUZAMEFQ.js → sarif-XZFJ5VIJ.js} +15 -15
- package/dist/{term-DHWMUL5N.js → term-OZ7ZR5KB.js} +17 -17
- package/dist/{validate-4AW7KIIY.js → validate-CR3TI7GP.js} +5 -5
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/dist/check-NW7GHSX6.js +0 -47
- package/dist/chunk-3UYSONT4.js.map +0 -1
- package/dist/chunk-5D24C6WM.js.map +0 -1
- package/dist/chunk-5VNFO2RT.js.map +0 -1
- package/dist/chunk-B5R5BWMY.js.map +0 -1
- package/dist/chunk-D3AO2PMV.js.map +0 -1
- package/dist/chunk-FAS3SRQB.js.map +0 -1
- package/dist/chunk-OZL5M764.js.map +0 -1
- package/dist/chunk-ZIXU7A4C.js.map +0 -1
- package/dist/cli-5ZQXVWWC.js.map +0 -1
- package/dist/cli-VC3BXCVR.js.map +0 -1
- /package/dist/{batch-SAW4E46C.js.map → batch-5TPNK5BQ.js.map} +0 -0
- /package/dist/{build-F6S3W77I.js.map → build-GGKCRWKH.js.map} +0 -0
- /package/dist/{calibrate-3DW2VV7F.js.map → calibrate-OGOLLGXY.js.map} +0 -0
- /package/dist/{capture-PKEYY2VO.js.map → capture-CNHRHTA7.js.map} +0 -0
- /package/dist/{check-EZN7YNVF.js.map → check-BAMOJMOJ.js.map} +0 -0
- /package/dist/{check-LRX2YFDF.js.map → check-XLIS5A7G.js.map} +0 -0
- /package/dist/{check-NW7GHSX6.js.map → check-XYGABPXI.js.map} +0 -0
- /package/dist/{check-7PUIHLFM.js.map → check-ZFI7H7LS.js.map} +0 -0
- /package/dist/{chunk-DU6CXY5R.js.map → chunk-27FP4KKD.js.map} +0 -0
- /package/dist/{chunk-VRMQSP7O.js.map → chunk-327CWO33.js.map} +0 -0
- /package/dist/{chunk-JK56UPNQ.js.map → chunk-33FIOHJ4.js.map} +0 -0
- /package/dist/{chunk-QIWSEKA6.js.map → chunk-3COYAAR7.js.map} +0 -0
- /package/dist/{chunk-3446DW4W.js.map → chunk-3LZ6AYB4.js.map} +0 -0
- /package/dist/{chunk-ABAFKOQF.js.map → chunk-4A445ALG.js.map} +0 -0
- /package/dist/{chunk-M6DNOHJO.js.map → chunk-4KY2RUXQ.js.map} +0 -0
- /package/dist/{chunk-PS4Y7EPP.js.map → chunk-5VA3ZOB7.js.map} +0 -0
- /package/dist/{chunk-XPGK4ECA.js.map → chunk-6E6Z6UQL.js.map} +0 -0
- /package/dist/{chunk-TUMR35B3.js.map → chunk-6ZYXK3JT.js.map} +0 -0
- /package/dist/{chunk-KUXAHHDE.js.map → chunk-7RZQAMA2.js.map} +0 -0
- /package/dist/{chunk-ZEYNLKOH.js.map → chunk-CWVL7XZR.js.map} +0 -0
- /package/dist/{chunk-FEURGKJC.js.map → chunk-E3YXGLEU.js.map} +0 -0
- /package/dist/{chunk-W7XOMNYC.js.map → chunk-E76WPNYO.js.map} +0 -0
- /package/dist/{chunk-Q7E43SXN.js.map → chunk-EITEHOSX.js.map} +0 -0
- /package/dist/{chunk-U5NSIZRS.js.map → chunk-EU5QLSNN.js.map} +0 -0
- /package/dist/{chunk-TNYIXIYV.js.map → chunk-F7GYY373.js.map} +0 -0
- /package/dist/{chunk-WBXVQW57.js.map → chunk-FE3US7FR.js.map} +0 -0
- /package/dist/{chunk-YJHHXM5B.js.map → chunk-FNQE3RAW.js.map} +0 -0
- /package/dist/{chunk-WRSWZEVU.js.map → chunk-FO6MNXOF.js.map} +0 -0
- /package/dist/{chunk-2A5OIZHT.js.map → chunk-ICRYIYMJ.js.map} +0 -0
- /package/dist/{chunk-KCNBM42T.js.map → chunk-IIBVQCCR.js.map} +0 -0
- /package/dist/{chunk-KB4MNUKC.js.map → chunk-JFB45L7D.js.map} +0 -0
- /package/dist/{chunk-HEVYEI6O.js.map → chunk-JFPCDIES.js.map} +0 -0
- /package/dist/{chunk-2TLNAGVJ.js.map → chunk-JS5NCZYC.js.map} +0 -0
- /package/dist/{chunk-QIKCIREY.js.map → chunk-KRQTN5KE.js.map} +0 -0
- /package/dist/{chunk-AIZBZYQM.js.map → chunk-MH5MX4B3.js.map} +0 -0
- /package/dist/{chunk-MBLVLQWI.js.map → chunk-NUAVQQMC.js.map} +0 -0
- /package/dist/{chunk-WP5EKWTU.js.map → chunk-O2TE5X25.js.map} +0 -0
- /package/dist/{chunk-LDIUA4ZG.js.map → chunk-OVQDZOMU.js.map} +0 -0
- /package/dist/{chunk-DSJTYRI5.js.map → chunk-PLN2LJDM.js.map} +0 -0
- /package/dist/{chunk-XWUIFSWK.js.map → chunk-QGJA43DX.js.map} +0 -0
- /package/dist/{chunk-64EDFJ5S.js.map → chunk-QWYE3S3U.js.map} +0 -0
- /package/dist/{chunk-XCEEJEVA.js.map → chunk-QXTL5MGT.js.map} +0 -0
- /package/dist/{chunk-XRWQQHBR.js.map → chunk-RCWP63XT.js.map} +0 -0
- /package/dist/{chunk-W7IEP7IG.js.map → chunk-RMKMJ43W.js.map} +0 -0
- /package/dist/{chunk-FPPHEHPZ.js.map → chunk-RVSUMNCR.js.map} +0 -0
- /package/dist/{chunk-4GGADKTU.js.map → chunk-SVB45M54.js.map} +0 -0
- /package/dist/{chunk-MDXDTO7E.js.map → chunk-T3VFO2LO.js.map} +0 -0
- /package/dist/{chunk-2LCJNH73.js.map → chunk-TFTGMYDR.js.map} +0 -0
- /package/dist/{chunk-WZSL7KF2.js.map → chunk-V2IP2ZMD.js.map} +0 -0
- /package/dist/{chunk-KAWS7H4C.js.map → chunk-VV4YM6VM.js.map} +0 -0
- /package/dist/{chunk-6J2ED4ED.js.map → chunk-YLU4H2H3.js.map} +0 -0
- /package/dist/{chunk-5QOTR53S.js.map → chunk-ZLOLC6WD.js.map} +0 -0
- /package/dist/{cli-LRKBCQRS.js.map → cli-6UQ3QV2G.js.map} +0 -0
- /package/dist/{cli-D5WYQVUF.js.map → cli-GND6TVRG.js.map} +0 -0
- /package/dist/{cli-FCGGNZ5C.js.map → cli-JHULEOH2.js.map} +0 -0
- /package/dist/{cli-TJDQ5GUW.js.map → cli-LVHZCC2O.js.map} +0 -0
- /package/dist/{cli-NJC3H3CW.js.map → cli-NWU77YRZ.js.map} +0 -0
- /package/dist/{cli-OHKWCJIJ.js.map → cli-PUO75R3L.js.map} +0 -0
- /package/dist/{cli-FNX4LXMI.js.map → cli-RUNYBUIV.js.map} +0 -0
- /package/dist/{cli-RKYIZ6KU.js.map → cli-T7UJF3BF.js.map} +0 -0
- /package/dist/{cli-LQRHK23G.js.map → cli-WUFQGIUG.js.map} +0 -0
- /package/dist/{github-6PV2JTZ7.js.map → github-BV42LSW2.js.map} +0 -0
- /package/dist/{github-7ZT4KYQU.js.map → github-XZ7OLATY.js.map} +0 -0
- /package/dist/{json-5EQCGVCV.js.map → json-LEEXKSGP.js.map} +0 -0
- /package/dist/{json-VWXLDTXR.js.map → json-YTKUFNO3.js.map} +0 -0
- /package/dist/{labels-ZJK27RL3.js.map → labels-E256WRAI.js.map} +0 -0
- /package/dist/{lint-5OERIERT.js.map → lint-W4CM3EIO.js.map} +0 -0
- /package/dist/{list-MANBRF7Z.js.map → list-TB4R6AP4.js.map} +0 -0
- /package/dist/{list-SEEANTU6.js.map → list-UDDGL2OI.js.map} +0 -0
- /package/dist/{page-O4M65KMJ.js.map → page-L64NO57W.js.map} +0 -0
- /package/dist/{prepare-3WULLZER.js.map → prepare-GFTAYDTP.js.map} +0 -0
- /package/dist/{pretty-5FRBLTXU.js.map → pretty-HYCYKYHB.js.map} +0 -0
- /package/dist/{pretty-D3M366JD.js.map → pretty-Q43TCD6D.js.map} +0 -0
- /package/dist/{reporters-4WWZRHKI.js.map → reporters-4HRBSMUF.js.map} +0 -0
- /package/dist/{reporters-GDCZ5P7C.js.map → reporters-E3FUVBQ6.js.map} +0 -0
- /package/dist/{run-TZDLG6EN.js.map → run-UDX2C54M.js.map} +0 -0
- /package/dist/{sarif-PUZAMEFQ.js.map → sarif-WL353VTA.js.map} +0 -0
- /package/dist/{sarif-SSSPOUCK.js.map → sarif-XZFJ5VIJ.js.map} +0 -0
- /package/dist/{term-DHWMUL5N.js.map → term-OZ7ZR5KB.js.map} +0 -0
- /package/dist/{validate-4AW7KIIY.js.map → validate-CR3TI7GP.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cite/reporters/json.ts"],"sourcesContent":["/**\n * JSON output. `{ summary, pages }` for check; the run itself for update,\n * remove and history.\n *\n * A citation prints its two ends and how they are anchored. `resolvedPath`,\n * `diff`, `commitsSince` and a changed claim's current lines are left out of\n * every citation: output never says more than the page did. It is an\n * allowlist rather than a strip, so a field added to the result stays private\n * until someone decides here that it is safe to print.\n */\nimport type {\n CheckRun,\n CitationAnchor,\n CitationResult,\n HistoryRun,\n MarkerEnd,\n OriginKind,\n PageCitationReport,\n RemoveRun,\n UpdateRewrite,\n UpdateRun,\n} from \"../types.js\";\n\nexport interface PublicClaimEnd {\n lines?: string;\n fileLines?: string;\n status: string;\n newLines?: string;\n candidates?: string[];\n /** The baseline the claim was read against: the page's own history says it. */\n commitSha?: string;\n historyAvailable?: boolean;\n}\n\nexport interface PublicSourceEnd {\n src: string;\n /** The checkout the source is in, by its `cite.repos` name; present only for a repo entry. */\n repo?: string;\n status: string;\n newLines?: string;\n newSrc?: string;\n candidates?: string[];\n /** The entry's recorded `commit-sha`, as it is written. */\n commitSha?: string;\n /** The full hash the verdict was read against, when history found one (0097). */\n baselineSha?: string;\n historyAvailable?: boolean;\n truncatedSearch?: boolean;\n}\n\nexport interface PublicCitationResult {\n id?: string;\n origin: { kind: OriginKind; file: string; line?: number };\n anchor: CitationAnchor;\n /** The marker that names the entry: its line, and its misplacement when it has one. */\n marker?: MarkerEnd;\n claim: PublicClaimEnd | null;\n source: PublicSourceEnd;\n}\n\nexport function publicCitation(result: CitationResult): PublicCitationResult {\n const origin: PublicCitationResult[\"origin\"] = {\n kind: result.origin.kind,\n file: result.origin.file,\n };\n if (result.origin.line !== undefined) origin.line = result.origin.line;\n\n const source: PublicSourceEnd = {\n src: result.source.src,\n ...(result.source.repo === undefined ? {} : { repo: result.source.repo }),\n status: result.source.status,\n };\n if (result.source.newLines !== undefined) source.newLines = result.source.newLines;\n if (result.source.newSrc !== undefined) source.newSrc = result.source.newSrc;\n if (result.source.candidates !== undefined) source.candidates = result.source.candidates;\n if (result.source.commitSha !== undefined) source.commitSha = result.source.commitSha;\n if (result.source.baselineSha !== undefined) source.baselineSha = result.source.baselineSha;\n if (result.source.historyAvailable !== undefined) {\n source.historyAvailable = result.source.historyAvailable;\n }\n if (result.source.truncatedSearch !== undefined) {\n source.truncatedSearch = result.source.truncatedSearch;\n }\n\n let claim: PublicClaimEnd | null = null;\n if (result.claim !== null) {\n claim = { status: result.claim.status };\n if (result.claim.lines !== undefined) claim.lines = result.claim.lines;\n if (result.claim.fileLines !== undefined) claim.fileLines = result.claim.fileLines;\n if (result.claim.newLines !== undefined) claim.newLines = result.claim.newLines;\n if (result.claim.candidates !== undefined) claim.candidates = result.claim.candidates;\n if (result.claim.commitSha !== undefined) claim.commitSha = result.claim.commitSha;\n if (result.claim.historyAvailable !== undefined) {\n claim.historyAvailable = result.claim.historyAvailable;\n }\n }\n\n // Key order is the order the plan spells a citation in: what it is called,\n // where it is kept, what anchors it, then its two ends.\n return {\n ...(result.citation.id === undefined ? {} : { id: result.citation.id }),\n origin,\n anchor: result.anchor,\n ...(result.marker === undefined ? {} : { marker: result.marker }),\n claim,\n source,\n };\n}\n\nexport interface PublicPageReport extends Omit<PageCitationReport, \"citations\"> {\n citations: PublicCitationResult[];\n}\n\nexport function publicPage(page: PageCitationReport): PublicPageReport {\n return { ...page, citations: page.citations.map(publicCitation) };\n}\n\nexport function renderCheckJson(run: CheckRun): string {\n return JSON.stringify({ summary: run.summary, pages: run.pages.map(publicPage) }, null, 2);\n}\n\nexport function renderRemoveJson(run: RemoveRun): string {\n // The whole run, with nothing stripped: `RemoveRun` carries no\n // pretty-only field, as `UpdateRewrite.markerLine` is below. A field added\n // to it for the terminal alone is stripped here, as that one is.\n return JSON.stringify(run, null, 2);\n}\n\n/** `{ summary, pages }` for `history`: the run itself, which carries nothing pretty-only. */\nexport function renderHistoryJson(run: HistoryRun): string {\n return JSON.stringify(run, null, 2);\n}\n\nexport function renderUpdateJson(run: UpdateRun): string {\n // `markerLine` is the pretty report's line for a marker-anchored claim.\n // `at` is the claim's own first file line, which is what data says.\n const strip = (rows: readonly UpdateRewrite[]): Omit<UpdateRewrite, \"markerLine\">[] =>\n rows.map(({ markerLine: _pretty, ...rewrite }) => rewrite);\n const pages = run.pages.map((page) => ({\n ...page,\n rewritten: strip(page.rewritten),\n refused: strip(page.refused),\n }));\n return JSON.stringify({ ...run, pages }, null, 2);\n}\n"],"mappings":";;;AA4DO,SAAS,eAAe,QAA8C;AAC3E,QAAM,SAAyC;AAAA,IAC7C,MAAM,OAAO,OAAO;AAAA,IACpB,MAAM,OAAO,OAAO;AAAA,EACtB;AACA,MAAI,OAAO,OAAO,SAAS,OAAW,QAAO,OAAO,OAAO,OAAO;AAElE,QAAM,SAA0B;AAAA,IAC9B,KAAK,OAAO,OAAO;AAAA,IACnB,GAAI,OAAO,OAAO,SAAS,SAAY,CAAC,IAAI,EAAE,MAAM,OAAO,OAAO,KAAK;AAAA,IACvE,QAAQ,OAAO,OAAO;AAAA,EACxB;AACA,MAAI,OAAO,OAAO,aAAa,OAAW,QAAO,WAAW,OAAO,OAAO;AAC1E,MAAI,OAAO,OAAO,WAAW,OAAW,QAAO,SAAS,OAAO,OAAO;AACtE,MAAI,OAAO,OAAO,eAAe,OAAW,QAAO,aAAa,OAAO,OAAO;AAC9E,MAAI,OAAO,OAAO,cAAc,OAAW,QAAO,YAAY,OAAO,OAAO;AAC5E,MAAI,OAAO,OAAO,gBAAgB,OAAW,QAAO,cAAc,OAAO,OAAO;AAChF,MAAI,OAAO,OAAO,qBAAqB,QAAW;AAChD,WAAO,m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AACpC;AAEO,SAAS,iBAAiB,KAAwB;AAGvD,QAAM,QAAQ,CAAC,SACb,KAAK,IAAI,CAAC,EAAE,YAAY,SAAS,GAAG,QAAQ,MAAM,OAAO;AAC3D,QAAM,QAAQ,IAAI,MAAM,IAAI,CAAC,UAAU;AAAA,IACrC,GAAG;AAAA,IACH,WAAW,MAAM,KAAK,SAAS;AAAA,IAC/B,SAAS,MAAM,KAAK,OAAO;AAAA,EAC7B,EAAE;AACF,SAAO,KAAK,UAAU,EAAE,GAAG,KAAK,MAAM,GAAG,MAAM,CAAC;AAClD;","names":[]}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
spliceEntryField,
|
|
18
18
|
unifiedDiff,
|
|
19
19
|
withClaimLines
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-V5QTIP2M.js";
|
|
21
21
|
import {
|
|
22
22
|
CITATIONS_KEY,
|
|
23
23
|
CITE_SECTION,
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
SOURCE_HISTORY_UNAVAILABLE,
|
|
30
30
|
buildSourceIndex,
|
|
31
31
|
checkCitations,
|
|
32
|
+
checkoutResolver,
|
|
32
33
|
claimDiff,
|
|
33
34
|
claimHistory,
|
|
34
35
|
claimWords,
|
|
@@ -44,6 +45,7 @@ import {
|
|
|
44
45
|
noGit,
|
|
45
46
|
orphanRefusal,
|
|
46
47
|
parseCiteConfig,
|
|
48
|
+
parseRepoFlags,
|
|
47
49
|
readCiteConfigFile,
|
|
48
50
|
readSource,
|
|
49
51
|
refineClaim,
|
|
@@ -57,16 +59,16 @@ import {
|
|
|
57
59
|
stripMarkers,
|
|
58
60
|
twoManifestsRefusal,
|
|
59
61
|
urlManifestRefusal
|
|
60
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-XTQTA262.js";
|
|
61
63
|
import {
|
|
62
64
|
renderCheckJson,
|
|
63
65
|
renderHistoryJson,
|
|
64
66
|
renderRemoveJson,
|
|
65
67
|
renderUpdateJson
|
|
66
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-GMOAW2EG.js";
|
|
67
69
|
import {
|
|
68
70
|
renderCheckGithub
|
|
69
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-327CWO33.js";
|
|
70
72
|
import {
|
|
71
73
|
refusalLine,
|
|
72
74
|
removalLine,
|
|
@@ -75,7 +77,7 @@ import {
|
|
|
75
77
|
renderRemovePretty,
|
|
76
78
|
renderUpdatePretty,
|
|
77
79
|
rewriteLine
|
|
78
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-5VA3ZOB7.js";
|
|
79
81
|
import {
|
|
80
82
|
blockMatches,
|
|
81
83
|
claimEnd,
|
|
@@ -101,7 +103,7 @@ import {
|
|
|
101
103
|
toValidationResult,
|
|
102
104
|
unitAt,
|
|
103
105
|
unitText
|
|
104
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-JHUEACRT.js";
|
|
105
107
|
import {
|
|
106
108
|
CITE_RULES,
|
|
107
109
|
CiteError,
|
|
@@ -127,7 +129,7 @@ import {
|
|
|
127
129
|
sourceRange,
|
|
128
130
|
spellSource,
|
|
129
131
|
validateEntry
|
|
130
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-XKZZRG3Z.js";
|
|
131
133
|
import {
|
|
132
134
|
MAX_RANGE_LINES,
|
|
133
135
|
MOVE_BUDGET_BYTES,
|
|
@@ -161,7 +163,7 @@ import {
|
|
|
161
163
|
statementForms,
|
|
162
164
|
toBodyLines,
|
|
163
165
|
toFileLines
|
|
164
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-MH5MX4B3.js";
|
|
165
167
|
import {
|
|
166
168
|
__export
|
|
167
169
|
} from "./chunk-2H7UOFLK.js";
|
|
@@ -195,6 +197,7 @@ __export(cite_exports, {
|
|
|
195
197
|
bodyLineOf: () => bodyLineOf,
|
|
196
198
|
buildSourceIndex: () => buildSourceIndex,
|
|
197
199
|
checkCitations: () => checkCitations,
|
|
200
|
+
checkoutResolver: () => checkoutResolver,
|
|
198
201
|
citationInputs: () => citationInputs,
|
|
199
202
|
claimDiff: () => claimDiff,
|
|
200
203
|
claimEnd: () => claimEnd,
|
|
@@ -251,6 +254,7 @@ __export(cite_exports, {
|
|
|
251
254
|
paragraphAfter: () => paragraphAfter,
|
|
252
255
|
parseCiteConfig: () => parseCiteConfig,
|
|
253
256
|
parseLines: () => parseLines,
|
|
257
|
+
parseRepoFlags: () => parseRepoFlags,
|
|
254
258
|
parseSrc: () => parseSrc,
|
|
255
259
|
parseStatements: () => parseStatements,
|
|
256
260
|
pickExtractor: () => pickExtractor,
|
|
@@ -321,6 +325,7 @@ __export(cite_exports, {
|
|
|
321
325
|
var UNDECRYPTABLE = "does not decrypt under the current key";
|
|
322
326
|
var MISSING = "missing (no tracked file matches)";
|
|
323
327
|
var CHANGED = "changed; run `manni cite update --accept` before rotating";
|
|
328
|
+
var undeclared = (repo) => `missing (no repo named ${repo} is declared)`;
|
|
324
329
|
function whereOf(citation, origin) {
|
|
325
330
|
const where = { index: origin.index };
|
|
326
331
|
if (citation.id !== void 0) where.id = citation.id;
|
|
@@ -369,17 +374,28 @@ async function contextFor(opts) {
|
|
|
369
374
|
const index = opts.sourceIndex ?? await buildSourceIndex(opts.root, { gitClient: git });
|
|
370
375
|
return { root: opts.root, index, git };
|
|
371
376
|
}
|
|
377
|
+
function contextsFor(opts) {
|
|
378
|
+
if (opts.checkouts !== void 0) return opts.checkouts;
|
|
379
|
+
let root;
|
|
380
|
+
return (repo) => repo === void 0 ? root ??= contextFor(opts) : Promise.resolve(void 0);
|
|
381
|
+
}
|
|
382
|
+
async function verdictIn(contexts, citation, opts) {
|
|
383
|
+
const repo = citation.source.repo;
|
|
384
|
+
const ctx = await contexts(repo);
|
|
385
|
+
if (ctx === void 0) return { kind: "skip", message: undeclared(repo ?? "") };
|
|
386
|
+
return verdictFor(ctx, citation, opts);
|
|
387
|
+
}
|
|
372
388
|
async function reencryptCitations(page, opts) {
|
|
373
389
|
const read = readPage(page.file, page.content, page.format === void 0 ? void 0 : { format: page.format });
|
|
374
390
|
const result = { content: page.content, rewritten: [], skipped: [] };
|
|
375
391
|
const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);
|
|
376
392
|
if (encrypted.length === 0) return result;
|
|
377
|
-
const
|
|
393
|
+
const contexts = contextsFor(opts);
|
|
378
394
|
let after = page.content;
|
|
379
395
|
for (const { citation, origin } of encrypted) {
|
|
380
396
|
const range = sourceRange(citation.source);
|
|
381
397
|
const where = whereOf(citation, origin);
|
|
382
|
-
const verdict = await
|
|
398
|
+
const verdict = await verdictIn(contexts, citation, opts);
|
|
383
399
|
if (verdict.kind === "done") continue;
|
|
384
400
|
if (verdict.kind === "skip") {
|
|
385
401
|
result.skipped.push({ ...where, message: verdict.message });
|
|
@@ -411,10 +427,10 @@ async function reencryptCitationEntries(page, opts) {
|
|
|
411
427
|
});
|
|
412
428
|
const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);
|
|
413
429
|
if (encrypted.length === 0) return out;
|
|
414
|
-
const
|
|
430
|
+
const contexts = contextsFor(opts);
|
|
415
431
|
for (const { citation, origin } of encrypted) {
|
|
416
432
|
const where = whereOf(citation, origin);
|
|
417
|
-
const verdict = await
|
|
433
|
+
const verdict = await verdictIn(contexts, citation, opts);
|
|
418
434
|
if (verdict.kind === "done") continue;
|
|
419
435
|
if (verdict.kind === "skip") {
|
|
420
436
|
out.skipped.push({ ...where, message: verdict.message });
|
|
@@ -440,4 +456,4 @@ export {
|
|
|
440
456
|
reencryptCitationEntries,
|
|
441
457
|
cite_exports
|
|
442
458
|
};
|
|
443
|
-
//# sourceMappingURL=chunk-
|
|
459
|
+
//# sourceMappingURL=chunk-GNZKLUZW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cite/index.ts","../src/cite/core/reencrypt.ts"],"sourcesContent":["/**\n * The citation tool's programmatic API, exported from the package as the\n * `cite` namespace: `import { cite } from \"@hawkeyexl/manni\"`.\n */\nexport * from \"./types.js\";\nexport { CiteError } from \"./errors.js\";\nexport { DEFAULT_SEVERITY, RULE_ID_PREFIX, isCiteRule, resolveSeverity, ruleId } from \"./core/severity.js\";\nexport {\n FILE_PATTERN,\n SRC_PATTERN,\n formatSrc,\n lineSpec,\n parseLines,\n parseSrc,\n rangeLines,\n sourceRange,\n spellLines,\n spellSource,\n} from \"./core/range.js\";\nexport { hashLines, hashRange, isKeyedPin, normalizeText, sliceLines, splitLines } from \"./core/hash.js\";\nexport { shortCommit, shortLine, shortPin, shortSrc, spellAt } from \"./core/spell.js\";\nexport { buildSourceIndex, readSource } from \"./core/sources.js\";\nexport type { BuildIndexOptions, ReadSourceResult } from \"./core/sources.js\";\nexport {\n isUnitText,\n markerClaimEnd,\n markerRunAt,\n misplacedMarkerAt,\n misplacedMarkers,\n movedUnit,\n pre43Span,\n splitUnit,\n unitText,\n} from \"./core/reanchor.js\";\nexport type { MisplacedMarker } from \"./core/reanchor.js\";\nexport {\n anchoredLines,\n detectEol,\n fenceSpanAt,\n fencedBlockAfter,\n fencedBlockAt,\n fencedBlocks,\n formatStatement,\n insideFence,\n isBoundLine,\n isTableRow,\n lineAt,\n offsetOfLine,\n paragraphAfter,\n parseStatements,\n statementForms,\n} from \"./core/statements.js\";\nexport type { StatementForm } from \"./core/statements.js\";\nexport {\n blockMatches,\n claimEnd,\n claimLine,\n markerUnit,\n noUnitAt,\n normalizeWhitespace,\n pinOfLines,\n toBodyLines,\n toFileLines,\n unitAt,\n} from \"./core/claims.js\";\nexport type { ClaimUnit, NoUnit } from \"./core/claims.js\";\nexport {\n GIT_UNAVAILABLE_COMMIT,\n GIT_UNAVAILABLE_HISTORY,\n PAGE_HISTORY_UNAVAILABLE,\n SOURCE_HISTORY_UNAVAILABLE,\n gitClient,\n noGit,\n} from \"./core/git.js\";\nexport {\n MAX_PAGE_COMMITS,\n claimDiff,\n claimHistory,\n claimWords,\n holdsWords,\n refineClaim,\n runsHolding,\n sentencesOf,\n sharesSentence,\n stripMarkers,\n} from \"./core/history.js\";\nexport type { ClaimHistory, ClaimHistoryInput, RefineClaimInput } from \"./core/history.js\";\nexport { MAX_RANGE_LINES, MOVE_BUDGET_BYTES, MOVE_WINDOW_LINES, classifyCitation, findWindows, historyOf } from \"./core/classify.js\";\nexport type { ClassifyOptions, FindWindowsOptions, History } from \"./core/classify.js\";\nexport {\n MARKER_JSON,\n MAX_MARKERS_PER_PAGE,\n bodyLineOf,\n citationInputs,\n ownedMessage,\n pickExtractor,\n readPage,\n validateEntry,\n} from \"./core/page.js\";\nexport { shiftedEntries, withClaimLines } from \"./core/shift.js\";\nexport type { ShiftOptions, Shifted } from \"./core/shift.js\";\nexport {\n CITATIONS_KEY,\n duplicateJoinRefusal,\n loadCitationSidecars,\n orphanRefusal,\n sidecarsFor,\n twoManifestsRefusal,\n urlManifestRefusal,\n} from \"./core/sidecar.js\";\nexport type {\n CitationManifest,\n CitationSidecars,\n LoadSidecarOptions,\n PageSidecar,\n} from \"./core/sidecar.js\";\nexport { ManifestSet, itemLine, splice } from \"./core/manifest.js\";\nexport type { HeldManifest } from \"./core/manifest.js\";\nexport type { ReadPageOptions } from \"./core/page.js\";\nexport { checkCitations } from \"./core/check-page.js\";\nexport {\n claimMessageFor,\n errorSite,\n findingsFor,\n messageFor,\n misplacedMessageFor,\n toValidationResult,\n} from \"./core/adapt.js\";\nexport {\n appendFrontmatterCitation,\n entryObject,\n insertStatementBefore,\n removeFrontmatterCitations,\n removeLine,\n spliceEntryField,\n unifiedDiff,\n} from \"./core/write.js\";\nexport type { EntryPath } from \"./core/write.js\";\nexport { mintCitation } from \"./core/mint.js\";\nexport {\n CITE_SECTION,\n DEFAULT_CITE_BASELINE_PATH,\n loadCiteConfig,\n parseCiteConfig,\n parseRepoFlags,\n readCiteConfigFile,\n resolveCiteRun,\n} from \"./core/config.js\";\nexport type { CiteRunOptions } from \"./core/config.js\";\n\nexport { checkoutResolver, runCheck } from \"./commands/check.js\";\nexport { runAdd } from \"./commands/add.js\";\nexport { runRemove } from \"./commands/remove.js\";\nexport { runUpdate } from \"./commands/update.js\";\nexport { runHistory } from \"./commands/history.js\";\nexport { reencryptCitationEntries, reencryptCitations } from \"./core/reencrypt.js\";\nexport type { ReencryptEntriesResult, ReencryptOptions } from \"./core/reencrypt.js\";\nexport {\n refusalLine,\n removalLine,\n renderCheckPretty,\n renderHistoryPretty,\n renderRemovePretty,\n renderUpdatePretty,\n rewriteLine,\n} from \"./reporters/pretty.js\";\nexport type { PrettyOptions } from \"./reporters/pretty.js\";\nexport { renderCheckJson, renderHistoryJson, renderRemoveJson, renderUpdateJson } from \"./reporters/json.js\";\nexport { renderCheckGithub } from \"./reporters/github.js\";\n","/**\n * `reencryptCitations`: re-encrypt one page's encrypted citations under a new\n * key, for `manni key rotate` (proposal 0045). It reads sources and never\n * writes: the caller gets the rewritten page back, and writes it only once\n * every page in the run could be re-encrypted.\n *\n * A citation counts as done only when its `source.file` decrypts under the\n * new key *and* its pin holds under the new key. Either alone is a half\n * rotation, and a rerun has to finish it rather than declare it done. Meta's\n * walker cannot leave one today, because it skips the whole `citations` key\n * and cite encrypts in its own `cite-src` context; an interrupted run, a hand\n * edit, or a second writer of the same manifest can.\n *\n * The path must be tracked, and the pin must hold under the old key, over the\n * lines as they are today or, with git, as they were at the baseline the\n * classifier derives from the source's history (proposal 0097). Then `file` becomes the\n * path's ciphertext under the new key, its lines kept, and `integrity` the\n * keyed pin under it, so a `changed` citation stays exactly as changed. A pin\n * that holds nowhere is skipped, with `update --accept` named as the repair.\n * No message names a path.\n */\nimport type {\n CheckoutResolver,\n Citation,\n CitationInput,\n CitationOrigin,\n GitClient,\n ReencryptCitationsResult,\n ReencryptedCitation,\n SourceIndex,\n SourceRange,\n} from \"../types.js\";\nimport { sourceBaseline } from \"./classify.js\";\nimport { gitClient } from \"./git.js\";\nimport { hashLines, sliceLines, splitLines } from \"./hash.js\";\nimport { readPage } from \"./page.js\";\nimport { formatSrc, sourceRange, spellSource } from \"./range.js\";\nimport { buildSourceIndex, decryptSourcePath, encryptSourcePath, readSource } from \"./sources.js\";\nimport { spliceEntryField } from \"./write.js\";\n\nconst UNDECRYPTABLE = \"does not decrypt under the current key\";\nconst MISSING = \"missing (no tracked file matches)\";\nconst CHANGED = \"changed; run `manni cite update --accept` before rotating\";\nconst undeclared = (repo: string): string => `missing (no repo named ${repo} is declared)`;\n\ntype Where = Pick<ReencryptedCitation, \"id\" | \"index\" | \"line\">;\n\n/** The fields a report row carries to name the entry: its id, or where it sits. */\nfunction whereOf(citation: Citation, origin: CitationOrigin): Where {\n const where: Where = { index: origin.index };\n if (citation.id !== undefined) where.id = citation.id;\n if (origin.line !== undefined) where.line = origin.line;\n return where;\n}\n\ninterface Context {\n root: string;\n index: SourceIndex;\n git: GitClient;\n}\n\n/**\n * The lines the pin was taken over, joined: today's when the pin holds there\n * under `key`, else the lines at the derived baseline when git finds one;\n * else why neither.\n */\nasync function pinnedLines(\n ctx: Context,\n citation: Citation,\n range: SourceRange,\n path: string,\n key: string,\n): Promise<{ joined: string } | { skip: string }> {\n const source = await readSource(ctx.root, ctx.index, { ...range, path, encrypted: false });\n if (source.kind === \"missing\") return { skip: MISSING };\n const pin = citation.source.integrity;\n let joined: string | undefined;\n try {\n joined = sliceLines(splitLines(source.text), range);\n } catch {\n // The range runs past the end of the file as it is now.\n joined = undefined;\n }\n if (joined !== undefined && hashLines(joined, key) === pin) return { joined };\n\n // The baseline the classifier derives (0097): the recorded commit when it\n // holds, else the newest commit in the source's history that does.\n if (await ctx.git.available()) {\n const recorded = citation.source[\"commit-sha\"];\n const { history } = await sourceBaseline(ctx.git, recorded, path, range, pin, key, undefined);\n if (history.kind === \"original\") return { joined: history.lines.join(\"\\n\") };\n }\n return { skip: CHANGED };\n}\n\n/** What one citation needs: nothing, a new pair of values, or a reason it cannot be done. */\ntype Verdict =\n | { kind: \"done\" }\n | { kind: \"skip\"; message: string }\n | { kind: \"write\"; file: string; integrity: string; to: string };\n\n/** Options every re-encryption takes, whichever channel the entry lives in. */\nexport interface ReencryptOptions {\n root: string;\n fromKey: string;\n toKey: string;\n /** History and the source index are read through it; defaults to one over the root. */\n gitClient?: GitClient;\n sourceIndex?: SourceIndex;\n /**\n * The checkouts an entry's `source.repo` may name (proposal 0100). Given,\n * it answers for the root too. Absent, an entry with no repo resolves under\n * `root` and every repo is undeclared.\n */\n checkouts?: CheckoutResolver;\n}\n\n/**\n * One citation's verdict: whether it is already under the new key, what its\n * `source.file` and `source.integrity` become, or why neither. The rule is\n * the same wherever the entry is kept, so the page splicer and the manifest\n * writer both go through here.\n */\nasync function verdictFor(\n ctx: Context,\n citation: Citation,\n opts: Pick<ReencryptOptions, \"fromKey\" | \"toKey\">,\n): Promise<Verdict> {\n const range = sourceRange(citation.source);\n const underNew = decryptSourcePath(range.path, opts.toKey);\n // Done only when both halves are under the new key; a file that is and a\n // pin that is not is the half rotation this finishes.\n if (underNew !== undefined) {\n const held = await pinnedLines(ctx, citation, range, underNew, opts.toKey);\n if (\"joined\" in held) return { kind: \"done\" };\n }\n const path = underNew ?? decryptSourcePath(range.path, opts.fromKey);\n if (path === undefined) return { kind: \"skip\", message: UNDECRYPTABLE };\n const lines = await pinnedLines(ctx, citation, range, path, opts.fromKey);\n if (\"skip\" in lines) return { kind: \"skip\", message: lines.skip };\n const file = underNew === undefined ? encryptSourcePath(path, opts.toKey) : range.path;\n return {\n kind: \"write\",\n file,\n integrity: hashLines(lines.joined, opts.toKey),\n to: formatSrc({ ...range, path: file }),\n };\n}\n\n/** The git client and source index a run shares, built once per page at most. */\nasync function contextFor(opts: ReencryptOptions): Promise<Context> {\n const git = opts.gitClient ?? gitClient(opts.root);\n const index = opts.sourceIndex ?? (await buildSourceIndex(opts.root, { gitClient: git }));\n return { root: opts.root, index, git };\n}\n\n/** The context each citation is judged in, by its `source.repo`; `undefined` for an undeclared repo. */\nfunction contextsFor(opts: ReencryptOptions): CheckoutResolver {\n if (opts.checkouts !== undefined) return opts.checkouts;\n let root: Promise<Context> | undefined;\n return (repo) => (repo === undefined ? (root ??= contextFor(opts)) : Promise.resolve(undefined));\n}\n\n/** One citation's verdict in the checkout it names. */\nasync function verdictIn(\n contexts: CheckoutResolver,\n citation: Citation,\n opts: Pick<ReencryptOptions, \"fromKey\" | \"toKey\">,\n): Promise<Verdict> {\n const repo = citation.source.repo;\n const ctx = await contexts(repo);\n if (ctx === undefined) return { kind: \"skip\", message: undeclared(repo ?? \"\") };\n return verdictFor(ctx, citation, opts);\n}\n\nexport async function reencryptCitations(\n page: { file: string; content: string; format?: string },\n opts: ReencryptOptions,\n): Promise<ReencryptCitationsResult> {\n const read = readPage(page.file, page.content, page.format === undefined ? undefined : { format: page.format });\n const result: ReencryptCitationsResult = { content: page.content, rewritten: [], skipped: [] };\n const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);\n // A page with nothing encrypted costs no index and no git.\n if (encrypted.length === 0) return result;\n\n const contexts = contextsFor(opts);\n let after = page.content;\n for (const { citation, origin } of encrypted) {\n const range = sourceRange(citation.source);\n const where = whereOf(citation, origin);\n const verdict = await verdictIn(contexts, citation, opts);\n if (verdict.kind === \"done\") continue;\n if (verdict.kind === \"skip\") {\n result.skipped.push({ ...where, message: verdict.message });\n continue;\n }\n if (verdict.file !== range.path) {\n after = spliceEntryField(after, read.format, origin.index, [\"source\", \"file\"], verdict.file);\n }\n after = spliceEntryField(\n after,\n read.format,\n origin.index,\n [\"source\", \"integrity\"],\n verdict.integrity,\n );\n result.rewritten.push({ ...where, from: spellSource(citation.source), to: verdict.to });\n }\n result.content = after;\n return result;\n}\n\n/** What `reencryptCitationEntries` did to one page's manifest entries. */\nexport interface ReencryptEntriesResult {\n /** The entries as they should now be written, a copy of what came in. */\n entries: unknown[];\n /** Whether any of them changed. */\n changed: boolean;\n rewritten: ReencryptedCitation[];\n skipped: { id?: string; index?: number; line?: number; message: string }[];\n}\n\n/**\n * The same rotation, for a page whose citations live in a manifest.\n *\n * The entries come from meta's merge, so they are plain values; each one is\n * validated as `readPage` validates a frontmatter entry, and an encrypted\n * source's `file` and `integrity` are rewritten in place. The caller writes\n * the whole list back with one splice, once every page of the run could be\n * re-encrypted.\n */\nexport async function reencryptCitationEntries(\n page: { file: string; content: string; format?: string; citations: readonly CitationInput[] },\n opts: ReencryptOptions,\n): Promise<ReencryptEntriesResult> {\n const entries: unknown[] = JSON.parse(\n JSON.stringify(page.citations.map((input) => input.entry)),\n ) as unknown[];\n const out: ReencryptEntriesResult = { entries, changed: false, rewritten: [], skipped: [] };\n\n const read = readPage(page.file, page.content, {\n ...(page.format === undefined ? {} : { format: page.format }),\n citations: page.citations,\n });\n const encrypted = read.citations.filter(({ citation }) => sourceRange(citation.source).encrypted);\n if (encrypted.length === 0) return out;\n\n const contexts = contextsFor(opts);\n for (const { citation, origin } of encrypted) {\n const where = whereOf(citation, origin);\n const verdict = await verdictIn(contexts, citation, opts);\n if (verdict.kind === \"done\") continue;\n if (verdict.kind === \"skip\") {\n out.skipped.push({ ...where, message: verdict.message });\n continue;\n }\n const entry: unknown = entries[origin.index];\n const source =\n typeof entry === \"object\" && entry !== null && !Array.isArray(entry)\n ? (entry as Record<string, unknown>).source\n : undefined;\n if (typeof source !== \"object\" || source === null || Array.isArray(source)) {\n out.skipped.push({ ...where, message: UNDECRYPTABLE });\n continue;\n }\n const fields = source as Record<string, unknown>;\n fields.file = verdict.file;\n fields.integrity = verdict.integrity;\n out.changed = true;\n out.rewritten.push({ ...where, from: spellSource(citation.source), to: verdict.to });\n }\n return out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AAW;AAC5C,UAAM,QAAQ,QAAQ,UAAU,MAAM;AACtC,UAAM,UAAU,MAAM,UAAU,UAAU,UAAU,IAAI;AACxD,QAAI,QAAQ,SAAS,OAAQ;AAC7B,QAAI,QAAQ,SAAS,QAAQ;AAC3B,UAAI,QAAQ,KAAK,EAAE,GAAG,OAAO,SAAS,QAAQ,QAAQ,CAAC;AACvD;AAAA,IACF;AACA,UAAM,QAAiB,QAAQ,OAAO,KAAK;AAC3C,UAAM,SACJ,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,IAC9D,MAAkC,SACnC;AACN,QAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,MAAM,QAAQ,MAAM,GAAG;AAC1E,UAAI,QAAQ,KAAK,EAAE,GAAG,OAAO,SAAS,cAAc,CAAC;AACrD;AAAA,IACF;AACA,UAAM,SAAS;AACf,WAAO,OAAO,QAAQ;AACtB,WAAO,YAAY,QAAQ;AAC3B,QAAI,UAAU;AACd,QAAI,UAAU,KAAK,EAAE,GAAG,OAAO,MAAM,YAAY,SAAS,MAAM,GAAG,IAAI,QAAQ,GAAG,CAAC;AAAA,EACrF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
runShowSchema,
|
|
24
24
|
runVendorSchema,
|
|
25
25
|
terminalConfirm
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-27FP4KKD.js";
|
|
27
27
|
import {
|
|
28
28
|
COMMON_FORMATS,
|
|
29
29
|
COMMON_FORMAT_LIST,
|
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
isQueryFormat,
|
|
40
40
|
isReportFormat,
|
|
41
41
|
render
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FE3US7FR.js";
|
|
43
43
|
import {
|
|
44
44
|
rowsToFindings,
|
|
45
45
|
runValidate
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-QGJA43DX.js";
|
|
47
47
|
import {
|
|
48
48
|
LOCATION_EXTERNAL_SCHEMA,
|
|
49
49
|
LOCATION_PAGE_SCHEMA,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
relocationContext,
|
|
63
63
|
reportConfig,
|
|
64
64
|
splitList
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-MH5MX4B3.js";
|
|
66
66
|
import {
|
|
67
67
|
DocmetaError,
|
|
68
68
|
STDIN_LABEL,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
schemaLoadOptions,
|
|
73
73
|
supportedExtensions,
|
|
74
74
|
toJsonText
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-OZWV27SE.js";
|
|
76
76
|
import {
|
|
77
77
|
palette,
|
|
78
78
|
shouldColor
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
} from "./chunk-VM7VAFJW.js";
|
|
90
90
|
import {
|
|
91
91
|
package_default
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-PCTJ7P6U.js";
|
|
93
93
|
import {
|
|
94
94
|
programName
|
|
95
95
|
} from "./chunk-OWBRDNRZ.js";
|
|
@@ -1606,4 +1606,4 @@ export {
|
|
|
1606
1606
|
parseQueryParams,
|
|
1607
1607
|
buildProgram
|
|
1608
1608
|
};
|
|
1609
|
-
//# sourceMappingURL=chunk-
|
|
1609
|
+
//# sourceMappingURL=chunk-ICRYIYMJ.js.map
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
loadTemplateFile,
|
|
9
9
|
resolveLintRun,
|
|
10
10
|
resolveStructureTool
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CWVL7XZR.js";
|
|
12
12
|
import {
|
|
13
13
|
parserByName,
|
|
14
14
|
parserForExtension,
|
|
15
15
|
unsupportedFormatMessage
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3LZ6AYB4.js";
|
|
17
17
|
import {
|
|
18
18
|
BLOCK_KINDS,
|
|
19
19
|
BLOCK_KIND_NODE,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./chunk-TKINOTVS.js";
|
|
26
26
|
import {
|
|
27
27
|
writeTextAtomic
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MH5MX4B3.js";
|
|
29
29
|
import {
|
|
30
30
|
palette
|
|
31
31
|
} from "./chunk-RNVYGWIC.js";
|
|
@@ -525,4 +525,4 @@ export {
|
|
|
525
525
|
occurrenceWords,
|
|
526
526
|
renderTemplateShow
|
|
527
527
|
};
|
|
528
|
-
//# sourceMappingURL=chunk-
|
|
528
|
+
//# sourceMappingURL=chunk-IIBVQCCR.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
offerPrompt,
|
|
6
6
|
planRelocation,
|
|
7
7
|
relocationOffers
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MH5MX4B3.js";
|
|
9
9
|
|
|
10
10
|
// src/meta/core/location-writes.ts
|
|
11
11
|
import { LineCounter, isMap, isNode, isScalar, parseDocument } from "yaml";
|
|
@@ -161,4 +161,4 @@ export {
|
|
|
161
161
|
mergeMetaProvenance,
|
|
162
162
|
metaProvenanceEntries
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-JFB45L7D.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
byCodeUnit,
|
|
11
11
|
canonicalLanguageTag,
|
|
12
12
|
parseLocalizations
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SVB45M54.js";
|
|
14
14
|
|
|
15
15
|
// src/graph/core/vector-index.ts
|
|
16
16
|
var MAGIC = new Uint8Array([77, 71, 82, 86]);
|
|
@@ -1335,4 +1335,4 @@ export {
|
|
|
1335
1335
|
artifactContext,
|
|
1336
1336
|
createRetriever
|
|
1337
1337
|
};
|
|
1338
|
-
//# sourceMappingURL=chunk-
|
|
1338
|
+
//# sourceMappingURL=chunk-JFPCDIES.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
RULE_ID_PREFIX,
|
|
5
5
|
parseSrc,
|
|
6
6
|
ruleId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XKZZRG3Z.js";
|
|
8
8
|
import {
|
|
9
9
|
ANY_FENCE,
|
|
10
10
|
anchoredLines,
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
splitUnit,
|
|
26
26
|
toBodyLines,
|
|
27
27
|
toFileLines
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MH5MX4B3.js";
|
|
29
29
|
import {
|
|
30
30
|
isErrorSeverity
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-OZWV27SE.js";
|
|
32
32
|
|
|
33
33
|
// src/cite/core/spell.ts
|
|
34
34
|
function shortPin(integrity) {
|
|
@@ -42,11 +42,12 @@ function shortCommit(commit) {
|
|
|
42
42
|
return commit.slice(0, 7);
|
|
43
43
|
}
|
|
44
44
|
function shortSrc(src) {
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
const token =
|
|
48
|
-
const lines =
|
|
49
|
-
|
|
45
|
+
const m = /^((?:[a-z0-9][a-z0-9-]*:)?)(~[^:]*)(.*)$/.exec(src);
|
|
46
|
+
const repo = m?.[1];
|
|
47
|
+
const token = m?.[2];
|
|
48
|
+
const lines = m?.[3];
|
|
49
|
+
if (repo === void 0 || token === void 0 || lines === void 0 || token.length <= 5) return src;
|
|
50
|
+
return `${repo}${token.slice(0, 5)}\u2026${lines}`;
|
|
50
51
|
}
|
|
51
52
|
var LINE_WIDTH = 60;
|
|
52
53
|
function shortLine(text) {
|
|
@@ -56,9 +57,9 @@ function shortLine(text) {
|
|
|
56
57
|
function spellAt(lines) {
|
|
57
58
|
return lines.start === lines.end ? `line ${String(lines.start)}` : `lines ${String(lines.start)}-${String(lines.end)}`;
|
|
58
59
|
}
|
|
59
|
-
function listOf(values) {
|
|
60
|
+
function listOf(values, conjunction = "and") {
|
|
60
61
|
if (values.length <= 1) return values.join("");
|
|
61
|
-
return `${values.slice(0, -1).join(", ")}
|
|
62
|
+
return `${values.slice(0, -1).join(", ")} ${conjunction} ${values[values.length - 1] ?? ""}`;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
// src/cite/core/adapt.ts
|
|
@@ -375,6 +376,10 @@ function sourceFile(src) {
|
|
|
375
376
|
}
|
|
376
377
|
}
|
|
377
378
|
function missingMessage(source) {
|
|
379
|
+
const { repo } = source;
|
|
380
|
+
if (source.missingReason === "unknown-repo") {
|
|
381
|
+
return `missing (no repo named ${repo ?? "?"} is declared)`;
|
|
382
|
+
}
|
|
378
383
|
if (!citesEncrypted(source.src)) return "missing";
|
|
379
384
|
switch (source.missingReason) {
|
|
380
385
|
case "no-key":
|
|
@@ -382,7 +387,7 @@ function missingMessage(source) {
|
|
|
382
387
|
case "undecryptable":
|
|
383
388
|
return "missing (does not decrypt under the current key)";
|
|
384
389
|
case "untracked":
|
|
385
|
-
return "missing (no tracked file matches; wrong --root?)";
|
|
390
|
+
return repo === void 0 ? "missing (no tracked file matches; wrong --root?)" : `missing (no tracked file matches in ${repo}; wrong cite.repos.${repo}?)`;
|
|
386
391
|
case "unreadable":
|
|
387
392
|
case void 0:
|
|
388
393
|
return "missing";
|
|
@@ -578,6 +583,11 @@ function withRemedy(message, remedy) {
|
|
|
578
583
|
return `${message}${/[.?!]$/.test(message) ? "" : "."} ${remedy}`;
|
|
579
584
|
}
|
|
580
585
|
function missingRemedy(result) {
|
|
586
|
+
const { repo } = result.source;
|
|
587
|
+
if (result.source.missingReason === "unknown-repo") {
|
|
588
|
+
const name = repo ?? "<name>";
|
|
589
|
+
return `Declare ${name} under cite.repos in manni.config.yaml, or pass --repo ${name}=<dir>.`;
|
|
590
|
+
}
|
|
581
591
|
if (citesEncrypted(result.source.src)) {
|
|
582
592
|
switch (result.source.missingReason) {
|
|
583
593
|
case "no-key":
|
|
@@ -585,7 +595,7 @@ function missingRemedy(result) {
|
|
|
585
595
|
case "undecryptable":
|
|
586
596
|
return "Use the key the source was encrypted with. After a key rotation, update the secret too.";
|
|
587
597
|
case "untracked":
|
|
588
|
-
return "Point --root at the code checkout, or re-add the citation against the new path."
|
|
598
|
+
return repo === void 0 ? "Point --root at the code checkout, or re-add the citation against the new path." : `Point cite.repos.${repo} at the ${repo} checkout, or re-add the citation against the new path.`;
|
|
589
599
|
case "unreadable":
|
|
590
600
|
case void 0:
|
|
591
601
|
break;
|
|
@@ -657,4 +667,4 @@ export {
|
|
|
657
667
|
withRemedy,
|
|
658
668
|
remedyFor
|
|
659
669
|
};
|
|
660
|
-
//# sourceMappingURL=chunk-
|
|
670
|
+
//# sourceMappingURL=chunk-JHUEACRT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;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","span","at","rule"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
readSampleQuestions,
|
|
5
5
|
suppressGraphOutput,
|
|
6
6
|
withExternalMetadata
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7RZQAMA2.js";
|
|
8
8
|
import {
|
|
9
9
|
GRAPH_NOT_APPLICABLE_TO_VARIANT,
|
|
10
10
|
GRAPH_NOT_SOFTWARE_SUBJECT,
|
|
@@ -49,17 +49,17 @@ import {
|
|
|
49
49
|
resolveDocumentSet,
|
|
50
50
|
resolveRelative,
|
|
51
51
|
routesFrom
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-SVB45M54.js";
|
|
53
53
|
import {
|
|
54
54
|
spellLines,
|
|
55
55
|
writeTextAtomic
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-MH5MX4B3.js";
|
|
57
57
|
import {
|
|
58
58
|
termLabelSource
|
|
59
59
|
} from "./chunk-DSWKBZWW.js";
|
|
60
60
|
import {
|
|
61
61
|
package_default
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-PCTJ7P6U.js";
|
|
63
63
|
import {
|
|
64
64
|
errorMessage
|
|
65
65
|
} from "./chunk-G3T47CFV.js";
|
|
@@ -1245,4 +1245,4 @@ export {
|
|
|
1245
1245
|
runBuild,
|
|
1246
1246
|
buildGraph
|
|
1247
1247
|
};
|
|
1248
|
-
//# sourceMappingURL=chunk-
|
|
1248
|
+
//# sourceMappingURL=chunk-JS5NCZYC.js.map
|