paperlint 7.2.0 → 9.0.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/CLAUDE.md +9 -25
- package/CONTRIBUTING.md +5 -4
- package/README.md +4 -3
- package/dist/adapters/bibtex/index.d.ts +3 -0
- package/dist/adapters/bibtex/index.d.ts.map +1 -0
- package/dist/adapters/bibtex/index.js +103 -0
- package/dist/adapters/bibtex/index.js.map +1 -0
- package/dist/adapters/latex/filecontents.d.ts +33 -0
- package/dist/adapters/latex/filecontents.d.ts.map +1 -0
- package/dist/adapters/latex/filecontents.js +65 -0
- package/dist/adapters/latex/filecontents.js.map +1 -0
- package/dist/adapters/latex/includes.d.ts +3 -3
- package/dist/adapters/latex/includes.d.ts.map +1 -1
- package/dist/adapters/latex/includes.js +18 -10
- package/dist/adapters/latex/includes.js.map +1 -1
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +2 -0
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/nodes.d.ts +12 -0
- package/dist/adapters/latex/nodes.d.ts.map +1 -1
- package/dist/adapters/latex/nodes.js +39 -0
- package/dist/adapters/latex/nodes.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts +7 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +55 -6
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/adapters/memory/index.d.ts +3 -0
- package/dist/adapters/memory/index.d.ts.map +1 -1
- package/dist/adapters/memory/index.js +9 -0
- package/dist/adapters/memory/index.js.map +1 -1
- package/dist/adapters/references/index.d.ts.map +1 -1
- package/dist/adapters/references/index.js +27 -24
- package/dist/adapters/references/index.js.map +1 -1
- package/dist/adapters/sources-record/index.d.ts +9 -0
- package/dist/adapters/sources-record/index.d.ts.map +1 -0
- package/dist/adapters/sources-record/index.js +68 -0
- package/dist/adapters/sources-record/index.js.map +1 -0
- package/dist/adapters/tex-output/blg.d.ts +9 -0
- package/dist/adapters/tex-output/blg.d.ts.map +1 -0
- package/dist/adapters/tex-output/blg.js +20 -0
- package/dist/adapters/tex-output/blg.js.map +1 -0
- package/dist/adapters/tex-output/fls.d.ts +8 -0
- package/dist/adapters/tex-output/fls.d.ts.map +1 -0
- package/dist/adapters/tex-output/fls.js +16 -0
- package/dist/adapters/tex-output/fls.js.map +1 -0
- package/dist/adapters/tex-output/index.d.ts +7 -0
- package/dist/adapters/tex-output/index.d.ts.map +1 -0
- package/dist/adapters/tex-output/index.js +7 -0
- package/dist/adapters/tex-output/index.js.map +1 -0
- package/dist/bib-rules.d.ts +47 -0
- package/dist/bib-rules.d.ts.map +1 -0
- package/dist/bib-rules.js +127 -0
- package/dist/bib-rules.js.map +1 -0
- package/dist/build.d.ts +29 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +41 -30
- package/dist/build.js.map +1 -1
- package/dist/claim-provenance.d.ts +2 -2
- package/dist/cli.d.ts +9 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +43 -68
- package/dist/cli.js.map +1 -1
- package/dist/domain/paper-source.d.ts +1 -10
- package/dist/domain/paper-source.d.ts.map +1 -1
- package/dist/domain/paper-source.js +34 -24
- package/dist/domain/paper-source.js.map +1 -1
- package/dist/domain/paper-sources.d.ts +72 -0
- package/dist/domain/paper-sources.d.ts.map +1 -0
- package/dist/domain/paper-sources.js +18 -0
- package/dist/domain/paper-sources.js.map +1 -0
- package/dist/domain/sources-record.d.ts +102 -0
- package/dist/domain/sources-record.d.ts.map +1 -0
- package/dist/domain/sources-record.js +38 -0
- package/dist/domain/sources-record.js.map +1 -0
- package/dist/domain/tex-run.d.ts +25 -0
- package/dist/domain/tex-run.d.ts.map +1 -0
- package/dist/domain/tex-run.js +79 -0
- package/dist/domain/tex-run.js.map +1 -0
- package/dist/eslint-rules/latex-language.d.ts.map +1 -1
- package/dist/eslint-rules/latex-language.js +10 -13
- package/dist/eslint-rules/latex-language.js.map +1 -1
- package/dist/eslint-rules/paper-context.d.ts.map +1 -1
- package/dist/eslint-rules/paper-context.js +6 -5
- package/dist/eslint-rules/paper-context.js.map +1 -1
- package/dist/eslint-rules/paper-typography.d.ts +0 -9
- package/dist/eslint-rules/paper-typography.d.ts.map +1 -1
- package/dist/eslint-rules/paper-typography.js +34 -96
- package/dist/eslint-rules/paper-typography.js.map +1 -1
- package/dist/eslint-rules/papers.d.ts +1 -3
- package/dist/eslint-rules/papers.d.ts.map +1 -1
- package/dist/eslint-rules/papers.js +2 -4
- package/dist/eslint-rules/papers.js.map +1 -1
- package/dist/eslint-rules/tex-build.d.ts.map +1 -1
- package/dist/eslint-rules/tex-build.js +8 -25
- package/dist/eslint-rules/tex-build.js.map +1 -1
- package/dist/init.d.ts +1 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +3 -9
- package/dist/init.js.map +1 -1
- package/dist/latex-log.d.ts +10 -0
- package/dist/latex-log.d.ts.map +1 -1
- package/dist/latex-log.js +10 -0
- package/dist/latex-log.js.map +1 -1
- package/dist/latex-loop.d.ts +2 -0
- package/dist/latex-loop.d.ts.map +1 -1
- package/dist/latex-loop.js.map +1 -1
- package/dist/lib/markdown.d.ts +5 -81
- package/dist/lib/markdown.d.ts.map +1 -1
- package/dist/lib/markdown.js +5 -116
- package/dist/lib/markdown.js.map +1 -1
- package/dist/lib/paper-config.d.ts.map +1 -1
- package/dist/lib/paper-config.js +0 -2
- package/dist/lib/paper-config.js.map +1 -1
- package/dist/lib/skill-eval-fixture.d.ts +6 -4
- package/dist/lib/skill-eval-fixture.d.ts.map +1 -1
- package/dist/lib/skill-eval-fixture.js +25 -18
- package/dist/lib/skill-eval-fixture.js.map +1 -1
- package/dist/new-paper.d.ts +5 -11
- package/dist/new-paper.d.ts.map +1 -1
- package/dist/new-paper.js +12 -23
- package/dist/new-paper.js.map +1 -1
- package/dist/package-dirs.d.ts.map +1 -1
- package/dist/package-dirs.js +3 -2
- package/dist/package-dirs.js.map +1 -1
- package/dist/paper-files.d.ts +4 -4
- package/dist/paper-includes.d.ts +4 -7
- package/dist/paper-includes.d.ts.map +1 -1
- package/dist/paper-includes.js +29 -21
- package/dist/paper-includes.js.map +1 -1
- package/dist/paper-prose.d.ts +17 -0
- package/dist/paper-prose.d.ts.map +1 -0
- package/dist/paper-prose.js +46 -0
- package/dist/paper-prose.js.map +1 -0
- package/dist/paper-record.d.ts +25 -0
- package/dist/paper-record.d.ts.map +1 -0
- package/dist/paper-record.js +39 -0
- package/dist/paper-record.js.map +1 -0
- package/dist/paper-sources.d.ts +66 -0
- package/dist/paper-sources.d.ts.map +1 -0
- package/dist/paper-sources.js +92 -0
- package/dist/paper-sources.js.map +1 -0
- package/dist/ports/bib-reader.d.ts +18 -0
- package/dist/ports/bib-reader.d.ts.map +1 -0
- package/dist/ports/bib-reader.js +2 -0
- package/dist/ports/bib-reader.js.map +1 -0
- package/dist/ports/check-references.d.ts +9 -4
- package/dist/ports/check-references.d.ts.map +1 -1
- package/dist/ports/latex.d.ts +15 -0
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/ports/sources-codec.d.ts +11 -0
- package/dist/ports/sources-codec.d.ts.map +1 -0
- package/dist/ports/sources-codec.js +2 -0
- package/dist/ports/sources-codec.js.map +1 -0
- package/dist/ports/tex-output.d.ts +17 -0
- package/dist/ports/tex-output.d.ts.map +1 -0
- package/dist/ports/tex-output.js +2 -0
- package/dist/ports/tex-output.js.map +1 -0
- package/dist/recorded-bibliography.d.ts +89 -0
- package/dist/recorded-bibliography.d.ts.map +1 -0
- package/dist/recorded-bibliography.js +136 -0
- package/dist/recorded-bibliography.js.map +1 -0
- package/dist/reference-rules.d.ts +5 -5
- package/dist/reference-rules.d.ts.map +1 -1
- package/dist/reference-rules.js +150 -77
- package/dist/reference-rules.js.map +1 -1
- package/dist/references.d.ts +71 -16
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +110 -26
- package/dist/references.js.map +1 -1
- package/dist/register-bands.d.ts +3 -3
- package/dist/register-bands.d.ts.map +1 -1
- package/dist/register-bands.js.map +1 -1
- package/dist/register.d.ts +2 -2
- package/dist/sources-record.d.ts +38 -0
- package/dist/sources-record.d.ts.map +1 -0
- package/dist/sources-record.js +123 -0
- package/dist/sources-record.js.map +1 -0
- package/dist/sources-rules.d.ts +44 -0
- package/dist/sources-rules.d.ts.map +1 -0
- package/dist/sources-rules.js +76 -0
- package/dist/sources-rules.js.map +1 -0
- package/dist/structure.d.ts.map +1 -1
- package/dist/structure.js +4 -3
- package/dist/structure.js.map +1 -1
- package/dist/tex-paper.d.ts +10 -15
- package/dist/tex-paper.d.ts.map +1 -1
- package/dist/tex-paper.js +24 -40
- package/dist/tex-paper.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +3 -3
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js.map +1 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +1 -1
- package/docs/configuration.md +18 -12
- package/docs/design/paper-sources.md +197 -0
- package/docs/e2e.md +4 -6
- package/docs/package-shape-options.md +1 -1
- package/docs/prior-art/paper-folder-scaffolding.md +24 -29
- package/docs/references.md +34 -8
- package/docs/rules/bib/reachable-entry.md +64 -0
- package/docs/rules/paper/sources-fresh.md +81 -0
- package/docs/rules/tex/claim-provenance.md +0 -1
- package/docs/rules.md +62 -61
- package/eslint-rules/latex-language.harness.mjs +3 -3
- package/eslint-rules/latex-language.ts +10 -13
- package/eslint-rules/paper-context.ts +6 -5
- package/eslint-rules/paper-typography.test.mjs +29 -157
- package/eslint-rules/paper-typography.ts +35 -104
- package/eslint-rules/papers.harness.mjs +1 -1
- package/eslint-rules/papers.ts +2 -4
- package/eslint-rules/tex-build.harness.mjs +2 -2
- package/eslint-rules/tex-build.ts +8 -25
- package/eslint.config.mjs +22 -1
- package/fixtures/build-e2e/aidc/paper.tex +1 -1
- package/fixtures/build-e2e/anon-ack/paper.tex +1 -1
- package/fixtures/build-e2e/anon-author/paper.tex +1 -1
- package/fixtures/build-e2e/anon-bib/paper.tex +1 -1
- package/fixtures/build-e2e/anon-href/paper.tex +1 -1
- package/fixtures/build-e2e/anon-macro/paper.tex +1 -1
- package/fixtures/build-e2e/anon-pdfauthor/paper.tex +1 -1
- package/fixtures/paper-sources/p1/paper.tex +30 -0
- package/fixtures/paper-sources/p1/refs.bib +6 -0
- package/fixtures/paper-sources/p1/sections/dead.tex +6 -0
- package/fixtures/paper-sources/p1/sections/intro.tex +7 -0
- package/fixtures/paper-sources/p1/sections/parked.tex +6 -0
- package/fixtures/paper-sources/p1/tex-truth.json +37 -0
- package/fixtures/paper-sources/p1/versions/2026-01-01-review.tex +4 -0
- package/fixtures/paper-sources/v1-stale/paper.tex +14 -0
- package/fixtures/paper-sources/v1-stale/refs.bib +6 -0
- package/fixtures/paper-sources/v1-stale/tex-truth.json +32 -0
- package/fixtures/paper-sources/v10-ifthenelse/anon.bib +1 -0
- package/fixtures/paper-sources/v10-ifthenelse/paper.tex +9 -0
- package/fixtures/paper-sources/v10-ifthenelse/real.bib +1 -0
- package/fixtures/paper-sources/v10-ifthenelse/tex-truth.json +28 -0
- package/fixtures/paper-sources/v11-two-blocks/paper.tex +12 -0
- package/fixtures/paper-sources/v11-two-blocks/tex-truth.json +30 -0
- package/fixtures/paper-sources/v13-percent-text/paper.tex +6 -0
- package/fixtures/paper-sources/v13-percent-text/refs.bib +3 -0
- package/fixtures/paper-sources/v13-percent-text/tex-truth.json +30 -0
- package/fixtures/paper-sources/v15-after-end/paper.tex +6 -0
- package/fixtures/paper-sources/v15-after-end/refs.bib +1 -0
- package/fixtures/paper-sources/v15-after-end/tex-truth.json +17 -0
- package/fixtures/paper-sources/v16-included-block/bibblock.tex +3 -0
- package/fixtures/paper-sources/v16-included-block/paper.tex +7 -0
- package/fixtures/paper-sources/v16-included-block/refs.bib +1 -0
- package/fixtures/paper-sources/v16-included-block/tex-truth.json +35 -0
- package/fixtures/paper-sources/v17-include-order/bibsetup.tex +1 -0
- package/fixtures/paper-sources/v17-include-order/first.bib +1 -0
- package/fixtures/paper-sources/v17-include-order/later.bib +1 -0
- package/fixtures/paper-sources/v17-include-order/paper.tex +7 -0
- package/fixtures/paper-sources/v17-include-order/tex-truth.json +40 -0
- package/fixtures/paper-sources/v2-overwrite/paper.tex +14 -0
- package/fixtures/paper-sources/v2-overwrite/refs.bib +6 -0
- package/fixtures/paper-sources/v2-overwrite/tex-truth.json +30 -0
- package/fixtures/paper-sources/v22-parked-thebibliography/paper.tex +7 -0
- package/fixtures/paper-sources/v22-parked-thebibliography/tex-truth.json +17 -0
- package/fixtures/paper-sources/v23-parked-include/old.bib +1 -0
- package/fixtures/paper-sources/v23-parked-include/paper.tex +7 -0
- package/fixtures/paper-sources/v23-parked-include/parked.tex +1 -0
- package/fixtures/paper-sources/v23-parked-include/refs.bib +1 -0
- package/fixtures/paper-sources/v23-parked-include/tex-truth.json +28 -0
- package/fixtures/paper-sources/v24-quoted-fields/paper.tex +6 -0
- package/fixtures/paper-sources/v24-quoted-fields/refs.bib +5 -0
- package/fixtures/paper-sources/v24-quoted-fields/tex-truth.json +32 -0
- package/fixtures/paper-sources/v25-string-differs/paper.tex +10 -0
- package/fixtures/paper-sources/v25-string-differs/refs.bib +2 -0
- package/fixtures/paper-sources/v25-string-differs/tex-truth.json +32 -0
- package/fixtures/paper-sources/v26-comment-in-names/one.bib +1 -0
- package/fixtures/paper-sources/v26-comment-in-names/paper.tex +7 -0
- package/fixtures/paper-sources/v26-comment-in-names/tex-truth.json +32 -0
- package/fixtures/paper-sources/v26-comment-in-names/two.bib +1 -0
- package/fixtures/paper-sources/v27-shared-string/abbreviations.bib +2 -0
- package/fixtures/paper-sources/v27-shared-string/paper.tex +6 -0
- package/fixtures/paper-sources/v27-shared-string/references.bib +6 -0
- package/fixtures/paper-sources/v27-shared-string/tex-truth.json +31 -0
- package/fixtures/paper-sources/v28-shared-string-block/abbreviations.bib +2 -0
- package/fixtures/paper-sources/v28-shared-string-block/paper.tex +14 -0
- package/fixtures/paper-sources/v28-shared-string-block/tex-truth.json +33 -0
- package/fixtures/paper-sources/v29-generated-input/paper.tex +9 -0
- package/fixtures/paper-sources/v29-generated-input/tex-truth.json +24 -0
- package/fixtures/paper-sources/v3-declared/paper.bib +6 -0
- package/fixtures/paper-sources/v3-declared/paper.tex +6 -0
- package/fixtures/paper-sources/v3-declared/tex-truth.json +28 -0
- package/fixtures/paper-sources/v30-name-next-line/paper.tex +14 -0
- package/fixtures/paper-sources/v30-name-next-line/tex-truth.json +30 -0
- package/fixtures/paper-sources/v4-commented/paper.tex +14 -0
- package/fixtures/paper-sources/v4-commented/refs.bib +6 -0
- package/fixtures/paper-sources/v4-commented/tex-truth.json +28 -0
- package/fixtures/paper-sources/v5-percent-entry/paper.tex +20 -0
- package/fixtures/paper-sources/v5-percent-entry/tex-truth.json +37 -0
- package/fixtures/paper-sources/v6-unclosed/paper.tex +6 -0
- package/fixtures/paper-sources/v6-unclosed/refs.bib +5 -0
- package/fixtures/paper-sources/v6-unclosed/tex-truth.json +37 -0
- package/fixtures/paper-sources/v8-jobname/paper.tex +9 -0
- package/fixtures/paper-sources/v8-jobname/tex-truth.json +30 -0
- package/fixtures/paper-sources/v9-two-bibliographies/one.bib +1 -0
- package/fixtures/paper-sources/v9-two-bibliographies/paper.tex +7 -0
- package/fixtures/paper-sources/v9-two-bibliographies/tex-truth.json +35 -0
- package/fixtures/paper-sources/v9-two-bibliographies/two.bib +1 -0
- package/fixtures/paper-typography/clean-paper/paper.tex +1 -1
- package/fixtures/paper-typography/messy-paper/paper.tex +1 -1
- package/hooks/hooks.harness.ts +15 -15
- package/hooks/paper-edit-guard.hook.mjs +5 -8
- package/hooks/paper-edit-guard.test.ts +12 -3
- package/hooks/paper-skills-nudge.hook.mjs +2 -3
- package/hooks/paper-skills-nudge.test.ts +13 -3
- package/hooks/paper-status-gates.hook.mjs +2 -2
- package/hooks/paper-status-gates.test.ts +14 -2
- package/lib/markdown.test.mjs +5 -60
- package/lib/markdown.ts +9 -136
- package/lib/paper-config.ts +0 -2
- package/lib/skill-checks.test.mjs +4 -1
- package/lib/skill-eval-fixture.ts +25 -18
- package/package.json +2 -12
- package/presets/realm.jsonc +1 -1
- package/scripts/check.test.ts +23 -1
- package/scripts/check.ts +7 -3
- package/scripts/coverage-config.test.ts +19 -10
- package/scripts/harness-api.frozen.json +0 -5
- package/scripts/layer-legacy-frozen.test.ts +41 -2
- package/scripts/layer-legacy-frozen.ts +31 -2
- package/skills/cold-read-diff/SKILL.md +3 -3
- package/skills/cold-read-diff/SKILL.md.spec.ts +2 -2
- package/skills/grade-paper-writing/SKILL.md +15 -22
- package/skills/grade-paper-writing/SKILL.md.spec.ts +14 -21
- package/skills/grade-paper-writing/__snapshots__/prose-lint.test.ts.snap +40 -26
- package/skills/grade-paper-writing/prose-lint.mjs +117 -278
- package/skills/grade-paper-writing/prose-lint.test.ts +230 -79
- package/skills/paper-adversarial-review/SKILL.md +2 -2
- package/skills/paper-adversarial-review/SKILL.md.spec.ts +1 -1
- package/skills/paper-pipeline/SKILL.md +9 -12
- package/skills/paper-pipeline/SKILL.md.spec.ts +8 -11
- package/skills/paper-pipeline/description-language.eval.mjs +25 -15
- package/skills/paper-pipeline/framing-vs-vocabulary.eval.mjs +25 -15
- package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +25 -15
- package/skills/paper-pipeline/pipeline-firing.eval.mjs +27 -16
- package/skills/paper-pipeline/pipeline-language.eval.mjs +25 -15
- package/skills/paper-pipeline/references/acceptance-gate.md +16 -20
- package/skills/paper-pipeline/references/artifact-checklist.md +4 -5
- package/skills/paper-pipeline/references/pipeline-status-template.md +1 -1
- package/skills/paper-pipeline/scripts/README.md +0 -4
- package/skills/paper-pipeline/scripts/extract-ref-facts.harness.mjs +91 -105
- package/skills/paper-pipeline/scripts/extract-ref-facts.mjs +85 -241
- package/skills/paper-pipeline/scripts/extract-ref-facts.test.mjs +166 -153
- package/skills/paper-pipeline/scripts/generated-code.harness.mjs +3 -3
- package/skills/paper-status/SKILL.md +2 -2
- package/skills/paper-status/SKILL.md.spec.ts +1 -1
- package/skills/render-paper/SKILL.md +2 -2
- package/skills/render-paper/SKILL.md.spec.ts +1 -1
- package/skills/render-paper/extract-pdf-facts.mjs +2 -2
- package/skills/tighten-paper/SKILL.md +29 -42
- package/skills/tighten-paper/SKILL.md.spec.ts +28 -41
- package/skills/verify-citations/SKILL.md +7 -4
- package/skills/verify-citations/SKILL.md.spec.ts +6 -3
- package/skills/verify-citations/scripts/bib-authors.check.test.mjs +17 -32
- package/skills/verify-citations/scripts/bib-authors.cli.test.ts +138 -43
- package/skills/verify-citations/scripts/bib-authors.d.mts +22 -2
- package/skills/verify-citations/scripts/bib-authors.mjs +54 -193
- package/skills/verify-citations/scripts/bib-authors.test.mjs +1 -44
- package/skills/verify-citations/scripts/verify-cites.cli.test.ts +16 -0
- package/skills/verify-citations/scripts/verify-cites.d.mts +19 -3
- package/skills/verify-citations/scripts/verify-cites.mjs +42 -108
- package/skills/verify-citations/scripts/verify-cites.test.mjs +23 -36
- package/src/adapters/bibtex/index.test.ts +163 -0
- package/src/adapters/bibtex/index.ts +155 -0
- package/src/adapters/latex/filecontents.ts +114 -0
- package/src/adapters/latex/includes.ts +18 -10
- package/src/adapters/latex/index.test.ts +73 -0
- package/src/adapters/latex/index.ts +2 -0
- package/src/adapters/latex/nodes.ts +64 -0
- package/src/adapters/latex/parse.test.ts +38 -0
- package/src/adapters/latex/parse.ts +67 -6
- package/src/adapters/memory/index.ts +17 -0
- package/src/adapters/references/index.test.ts +75 -21
- package/src/adapters/references/index.ts +37 -32
- package/src/adapters/sources-record/index.test.ts +87 -0
- package/src/adapters/sources-record/index.ts +82 -0
- package/src/adapters/tex-output/blg.ts +27 -0
- package/src/adapters/tex-output/fls.ts +24 -0
- package/src/adapters/tex-output/index.test.ts +171 -0
- package/src/adapters/tex-output/index.ts +12 -0
- package/src/bib-rules.test.ts +356 -0
- package/src/bib-rules.ts +228 -0
- package/src/bibliography-at.test.ts +286 -0
- package/src/build.harness.mjs +2 -2
- package/src/build.test.ts +211 -1
- package/src/build.ts +101 -41
- package/src/claim-provenance.test.ts +33 -7
- package/src/claim-provenance.ts +2 -2
- package/src/cli.harness.mjs +46 -56
- package/src/cli.test.ts +44 -48
- package/src/cli.ts +51 -82
- package/src/domain/paper-source.test.ts +58 -20
- package/src/domain/paper-source.ts +38 -42
- package/src/domain/paper-sources.ts +94 -0
- package/src/domain/sources-record.test.ts +71 -0
- package/src/domain/sources-record.ts +136 -0
- package/src/domain/tex-run.test.ts +228 -0
- package/src/domain/tex-run.ts +139 -0
- package/src/folder-venue-rule.test.ts +1 -1
- package/src/heading-case.test.ts +24 -10
- package/src/init.test.ts +6 -7
- package/src/init.ts +3 -22
- package/src/latex-log.ts +20 -0
- package/src/latex-loop.harness.ts +1 -0
- package/src/latex-loop.ts +2 -0
- package/src/lint-fix.test.ts +10 -4
- package/src/linted-set.test.ts +9 -1
- package/src/new-paper.harness.mjs +12 -30
- package/src/new-paper.test.ts +15 -11
- package/src/new-paper.ts +11 -30
- package/src/package-dirs.ts +3 -2
- package/src/paper-files.test.ts +5 -4
- package/src/paper-files.ts +4 -4
- package/src/paper-includes.test.ts +157 -38
- package/src/paper-includes.ts +39 -35
- package/src/paper-prose.test.ts +78 -0
- package/src/paper-prose.ts +67 -0
- package/src/paper-record.test.ts +173 -0
- package/src/paper-record.ts +66 -0
- package/src/paper-settings-commands.test.ts +5 -2
- package/src/paper-sources.ts +151 -0
- package/src/parse-args.test.ts +0 -1
- package/src/ports/bib-reader.ts +27 -0
- package/src/ports/check-references.ts +7 -3
- package/src/ports/latex.ts +19 -0
- package/src/ports/sources-codec.ts +11 -0
- package/src/ports/tex-output.ts +17 -0
- package/src/recorded-bibliography.ts +297 -0
- package/src/reference-rules.ts +217 -104
- package/src/references.test.ts +520 -177
- package/src/references.ts +185 -37
- package/src/register-bands.test.ts +5 -1
- package/src/register-bands.ts +3 -5
- package/src/register.test.ts +6 -1
- package/src/register.ts +2 -2
- package/src/rule-cases.test.ts +68 -12
- package/src/rule-docs.test.ts +0 -1
- package/src/sources-record.test.ts +308 -0
- package/src/sources-record.ts +231 -0
- package/src/sources-rules.test.ts +152 -0
- package/src/sources-rules.ts +117 -0
- package/src/structure.harness.ts +5 -11
- package/src/structure.ts +4 -3
- package/src/tex-paper.test.ts +148 -78
- package/src/tex-paper.ts +31 -61
- package/src/tex-venue-rules.test.ts +36 -8
- package/src/tex-venue-rules.ts +3 -5
- package/src/types.ts +0 -2
- package/dist/eslint-rules/bib-reachable-entry.d.ts +0 -22
- package/dist/eslint-rules/bib-reachable-entry.d.ts.map +0 -1
- package/dist/eslint-rules/bib-reachable-entry.js +0 -75
- package/dist/eslint-rules/bib-reachable-entry.js.map +0 -1
- package/eslint-rules/bib-reachable-entry.ts +0 -76
- package/fixtures/real-markdown-paper/baseline.json +0 -22
- package/fixtures/real-markdown-paper/baseline.ts +0 -70
- package/skills/paper-pipeline/PIPELINE-MAP.md +0 -381
- package/skills/paper-pipeline/pipeline-firing.baseline.json +0 -270
- package/skills/paper-pipeline/references/sweep-2026-08-09-ideal-pipeline.md +0 -585
- package/skills/paper-pipeline/scripts/artifact-coverage.harness.mjs +0 -492
- package/skills/paper-pipeline/scripts/artifact-coverage.mjs +0 -397
- package/skills/paper-pipeline/scripts/artifact-coverage.test.ts +0 -86
- package/skills/paper-pipeline/scripts/check-provenance.mjs +0 -184
- package/skills/paper-pipeline/scripts/population-map.harness.mjs +0 -135
- package/skills/paper-pipeline/scripts/population-map.mjs +0 -188
- package/skills/paper-pipeline/scripts/population-map.test.mjs +0 -154
- package/skills/paper-pipeline/scripts/provenance.harness.mjs +0 -266
- package/skills/paper-pipeline/scripts/round-diff.harness.ts +0 -907
- package/skills/paper-pipeline/scripts/round-diff.mjs +0 -583
- package/skills/paper-pipeline/scripts/round-diff.test.mjs +0 -159
- package/skills/tighten-paper/__snapshots__/structure.test.ts.snap +0 -133
- package/skills/tighten-paper/structure.mjs +0 -364
- package/skills/tighten-paper/structure.test.ts +0 -117
- package/templates/paper/paper.md +0 -4
|
@@ -37,8 +37,11 @@ export const KEY_SIGNATURES = Object.fromEntries([
|
|
|
37
37
|
"subfile",
|
|
38
38
|
"bibliography",
|
|
39
39
|
"bibliographystyle",
|
|
40
|
-
"addbibresource",
|
|
41
40
|
], "m"),
|
|
41
|
+
// biblatex's resources take options (`[location=remote]`) before the name.
|
|
42
|
+
...signed(["addbibresource", "addglobalbib", "addsectionbib"], "o m"),
|
|
43
|
+
// bibentry's: writes `\bibdata` as `\bibliography` does, and typesets nothing.
|
|
44
|
+
...signed(["nobibliography"], "m"),
|
|
42
45
|
...signed(["includegraphics"], "s o o m"),
|
|
43
46
|
...signed(["usepackage", "RequirePackage", "documentclass"], "o m o"),
|
|
44
47
|
]);
|
|
@@ -91,10 +94,56 @@ const parser = once(() => getParser({
|
|
|
91
94
|
...DEF_SIGNATURES,
|
|
92
95
|
},
|
|
93
96
|
}));
|
|
97
|
+
/**
|
|
98
|
+
* The trees parsed last, by their source: a tree is a pure function of its text, and one lint of a
|
|
99
|
+
* paper asks for the same texts many times — every rule that reads the paper (`readPaper`)
|
|
100
|
+
* parses `paper.tex`, its includes and the assembled whole again. Measured 2026-10-06 on the
|
|
101
|
+
* accepted ACM paper of the corpus: 0.9 s per reading of the paper's sources, seven of them per lint,
|
|
102
|
+
* 50–76 ms with the memo.
|
|
103
|
+
*
|
|
104
|
+
* Bounded by the SOURCE TEXT it holds (UTF-16 units, about bytes for TeX), least recently used out.
|
|
105
|
+
* A count bound is wrong both ways: 64 trees held 64 versions of one file in an editor (186 MiB for a
|
|
106
|
+
* 48 KiB paper), and 8 trees thrashed on a paper with ten includes — the rules read them in a cycle,
|
|
107
|
+
* so every read missed and the corpus lint timed out. `MEMO_BYTES` holds the largest paper of the corpus
|
|
108
|
+
* (150 KB of sources, and the assembled whole) and about ten versions of a 48 KiB file.
|
|
109
|
+
*/
|
|
110
|
+
const MEMO_BYTES = 512 * 1024;
|
|
111
|
+
const memo = new Map();
|
|
112
|
+
/** The texts to evict, least recent first, so that `adding` more fits under `MEMO_BYTES`. */
|
|
113
|
+
const evicted = (adding) => {
|
|
114
|
+
const keys = [...memo.keys()];
|
|
115
|
+
const total = keys.reduce((n, k) => n + k.length, adding);
|
|
116
|
+
const { out } = keys.reduce((acc, k) => acc.left > MEMO_BYTES
|
|
117
|
+
? { left: acc.left - k.length, out: [...acc.out, k] }
|
|
118
|
+
: acc, { left: total, out: [] });
|
|
119
|
+
return out;
|
|
120
|
+
};
|
|
94
121
|
/** A LaTeX source → its tree, without the branches `\iffalse … \fi` hides (`conditionals.ts`). */
|
|
95
|
-
export
|
|
96
|
-
src
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
122
|
+
export function parseLatex(src) {
|
|
123
|
+
const hit = memo.get(src);
|
|
124
|
+
const parsed = hit ?? {
|
|
125
|
+
src,
|
|
126
|
+
root: withoutFalseBranches(src, parser().parse(src)),
|
|
127
|
+
[PARSED]: true,
|
|
128
|
+
};
|
|
129
|
+
// Most recent last: a hit moves to the end, and the first keys are the ones used least recently.
|
|
130
|
+
// eslint-disable-next-line functional/immutable-data -- the bounded memo, see above
|
|
131
|
+
memo.delete(src);
|
|
132
|
+
// eslint-disable-next-line functional/immutable-data -- the bounded memo, see above
|
|
133
|
+
evicted(src.length).forEach((k) => memo.delete(k));
|
|
134
|
+
// eslint-disable-next-line functional/immutable-data -- the bounded memo, see above
|
|
135
|
+
memo.set(src, parsed);
|
|
136
|
+
return parsed;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The part of a source's tree TeX reads: everything up to and with the `document` environment.
|
|
140
|
+
* TeX stops at `\end{document}`, so a `\bibliography`, a `thebibliography`, a block or an `\input`
|
|
141
|
+
* parked after it is never read. A source with no `document` environment is read whole.
|
|
142
|
+
*/
|
|
143
|
+
export function liveRoot(t) {
|
|
144
|
+
const end = t.root.content.findIndex((n) => n.type === "environment" && n.env === "document");
|
|
145
|
+
return end < 0
|
|
146
|
+
? t.root
|
|
147
|
+
: { ...t.root, content: t.root.content.slice(0, end + 1) };
|
|
148
|
+
}
|
|
100
149
|
//# sourceMappingURL=parse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,GAAG,CACb,KAAwB,EACxB,SAAiB,EAC+C,EAAE,CAClE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,CAAU,CAAC,CAAC;AAEhD,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC;IAC1D,MAAM;IACN,OAAO;IACP,OAAO;IACP,SAAS;IACT,SAAS;IACT,YAAY;IACZ,UAAU;IACV,aAAa;IACb,OAAO;IACP,OAAO;IACP,QAAQ;IACR,WAAW;IACX,UAAU;IACV,UAAU;IACV,UAAU;CACX,CAAC,CAAC;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAEvB,MAAM,CAAC,WAAW,CAAC;IACrB,GAAG,MAAM,CAAC,CAAC,GAAG,eAAe,CAAC,EAAE,OAAO,CAAC;IACxC,GAAG,MAAM,CACP;QACE,OAAO;QACP,KAAK;QACL,OAAO;QACP,SAAS;QACT,SAAS;QACT,MAAM;QACN,MAAM;QACN,KAAK;QACL,OAAO;QACP,SAAS;QACT,SAAS;QACT,cAAc;QACd,mBAAmB;
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/adapters/latex/parse.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,C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C,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,oFAAoF;IACpF,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAY;IACnC,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,GAAG,KAAK,UAAU,CACxD,CAAC;IACF,OAAO,GAAG,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC,CAAC,IAAI;QACR,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Download } from "../../ports/download.ts";
|
|
2
2
|
import type { Files } from "../../ports/files.ts";
|
|
3
|
+
import type { ListDir } from "../../ports/talk-media.ts";
|
|
3
4
|
import type { Command, ProcessExit, RunProcess } from "../../ports/process.ts";
|
|
4
5
|
import type { Workspace } from "../../ports/workspace.ts";
|
|
5
6
|
export interface ScriptedProcess extends RunProcess {
|
|
@@ -13,6 +14,8 @@ export interface MemoryFiles extends Files {
|
|
|
13
14
|
readonly map: Map<string, Uint8Array>;
|
|
14
15
|
}
|
|
15
16
|
export declare function memoryFiles(initial?: Readonly<Record<string, string | Uint8Array>>): MemoryFiles;
|
|
17
|
+
/** `ListDir` over `memoryFiles`: the names directly under a directory, none when it holds no file. */
|
|
18
|
+
export declare const memoryListDir: (files: MemoryFiles) => ListDir;
|
|
16
19
|
export interface MemoryWorkspace extends Workspace {
|
|
17
20
|
/** Every file written into a scratch directory, in order. */
|
|
18
21
|
readonly written: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/memory/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,KAAK,EAAwB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGhF,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;CAC3B;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,WAAW,GAClC,eAAe,CASjB;AAED,kDAAkD;AAClD,eAAO,MAAM,UAAU,GAAI,QAAQ,MAAM,EAAE,eAAU,KAAG,WAKtD,CAAC;AAEH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACvC;AAED,wBAAgB,WAAW,CACzB,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,CAAM,GAC1D,WAAW,CAYb;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KAChC,EAAE,CAAC;IACJ,+BAA+B;I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ACtB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,IAAI,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAQxE"}
|
|
@@ -32,6 +32,15 @@ export function memoryFiles(initial = {}) {
|
|
|
32
32
|
writeAtomic: (p, b) => void map.set(p, b),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
/** `ListDir` over `memoryFiles`: the names directly under a directory, none when it holds no file. */
|
|
36
|
+
export const memoryListDir = (files) => (dir) => [
|
|
37
|
+
...new Set([...files.map.keys()]
|
|
38
|
+
.filter((k) => k.startsWith(`${dir}/`))
|
|
39
|
+
.map((k) => k
|
|
40
|
+
.slice(dir.length + 1)
|
|
41
|
+
.split("/", 1)
|
|
42
|
+
.join(""))),
|
|
43
|
+
];
|
|
35
44
|
export function memoryWorkspace(dir = "/scratch") {
|
|
36
45
|
const written = [];
|
|
37
46
|
const ended = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/memory/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/memory/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMrD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAMjD,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAC7B,MAAmC;IAEnC,MAAM,KAAK,GAAc,EAAE,CAAC;IAC5B,OAAO;QACL,KAAK;QACL,GAAG,CAAC,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACd,OAAO,MAAM,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IAAI;QACJ,KAAK,CAAC,GAAG;YACP,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACf,IAAI,OAAO,IAAI,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YACxE,OAAO,IAAI,YAAY,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3D,CAAC;KACF,CAAC;AACJ,CAAC;AAUD,qEAAqE;AACrE,MAAM,UAAU,WAAW,CAAC,OAA6B,EAAE;IACzD,OAAO;QACL,GAAG,EAAE,eAAe,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC1C,KAAK,EAAE,WAAW,EAAE;QACpB,SAAS,EAAE,eAAe,EAAE;QAC5B,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;QAC3D,GAAG,IAAI;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/references/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/references/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,iCAAiC,CAAC;AAgHzC;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MACiC,CAAC;AAE/E,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAC;CAC9B;AA0ED,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,GAC3B,WAAW,wBAAwB,KAAG,eAqCtC,CAAC;AAEJ,iDAAiD;AACjD,eAAO,MAAM,gBAAgB,EAAE,eAE7B,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { sleep, todayUtc } from "./clock.io.js";
|
|
|
7
7
|
const LOOKUPS_IN_FLIGHT = 6;
|
|
8
8
|
import * as cites from "../../../skills/verify-citations/scripts/verify-cites.mjs";
|
|
9
9
|
import * as authors from "../../../skills/verify-citations/scripts/bib-authors.mjs";
|
|
10
|
+
import { zip } from "remeda";
|
|
10
11
|
import { messageOf } from "../../domain/text.js";
|
|
11
12
|
import { isRecord } from "../../domain/record.js";
|
|
12
13
|
const describeAuthors = (f) => [
|
|
@@ -16,11 +17,12 @@ const describeAuthors = (f) => [
|
|
|
16
17
|
]
|
|
17
18
|
.filter(Boolean)
|
|
18
19
|
.join("; ") + ` (DBLP: ${f.venue})`;
|
|
19
|
-
|
|
20
|
+
/** bib-authors' answer for one entry, from its buckets for that entry alone. */
|
|
21
|
+
const authorsOf = (a) => a.findings.length > 0
|
|
20
22
|
? "mismatch"
|
|
21
|
-
: a.unchecked.
|
|
23
|
+
: a.unchecked.length > 0
|
|
22
24
|
? "unchecked"
|
|
23
|
-
: a.matched.
|
|
25
|
+
: a.matched.length > 0
|
|
24
26
|
? "match"
|
|
25
27
|
: "skipped";
|
|
26
28
|
/**
|
|
@@ -28,27 +30,34 @@ const authorsOf = (key, a) => a.findings.some((f) => f.key === key)
|
|
|
28
30
|
* one, so "unresolvable" is not read as "every registry looked and found nothing". Nothing for a
|
|
29
31
|
* confirmed work: a refusal after a confirmation changed nothing.
|
|
30
32
|
*/
|
|
31
|
-
const unconfirmed = (c) => c
|
|
33
|
+
const unconfirmed = (c) => c.verdict !== "true"
|
|
32
34
|
? [c.reason, ...(c.refused ?? []).map((r) => `not asked: ${r}`)]
|
|
33
35
|
: [];
|
|
34
|
-
/** One entry's verdict
|
|
35
|
-
function entryVerdict(
|
|
36
|
-
const c = found.find((x) => x.id === key);
|
|
37
|
-
const mismatch = a.findings.find((f) => f.key === key);
|
|
36
|
+
/** One entry's verdict: verify-cites' answer for it, and bib-authors' buckets for it alone. */
|
|
37
|
+
function entryVerdict(c, a) {
|
|
38
38
|
const why = [
|
|
39
39
|
...unconfirmed(c),
|
|
40
|
-
|
|
41
|
-
a.unchecked.
|
|
40
|
+
...a.findings.map(describeAuthors),
|
|
41
|
+
...a.unchecked.map((u) => u.why),
|
|
42
42
|
]
|
|
43
43
|
.filter(Boolean)
|
|
44
44
|
.join("; ");
|
|
45
45
|
return {
|
|
46
|
-
key,
|
|
47
|
-
exists: c
|
|
48
|
-
authors: authorsOf(
|
|
46
|
+
key: c.id,
|
|
47
|
+
exists: c.verdict,
|
|
48
|
+
authors: authorsOf(a),
|
|
49
49
|
...(why ? { why } : {}),
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* bib-authors over each entry on its own, one after another as it would run them: its buckets name
|
|
54
|
+
* an entry by key, and two entries of a bibliography may share a key (two databases bibtex
|
|
55
|
+
* opened may each define it, with other metadata).
|
|
56
|
+
*/
|
|
57
|
+
const authorsOfEach = (parsed, d) => parsed.reduce(async (done, e) => [
|
|
58
|
+
...(await done),
|
|
59
|
+
await authors.checkAuthors([e], { lookup: d.lookup, pause: d.pause }),
|
|
60
|
+
], Promise.resolve([]));
|
|
52
61
|
/** Whether bib-authors will ask DBLP about this entry — the filter its `checkAuthors` applies. */
|
|
53
62
|
const asksDblp = (e) => Boolean(e.title && e.author) &&
|
|
54
63
|
authors.claimsPublished(e) &&
|
|
@@ -131,8 +140,8 @@ function grown(loaded, run, today) {
|
|
|
131
140
|
export const referencesChecker = ({ today }) => async (bib, cache) => {
|
|
132
141
|
// Answers past MAX_AGE_DAYS are left out, so the run asks them again (and `grown` re-dates them).
|
|
133
142
|
const usable = freshPart(cache, today());
|
|
134
|
-
const citations = cites.
|
|
135
|
-
const parsed = authors.
|
|
143
|
+
const citations = cites.citationsOf(bib);
|
|
144
|
+
const parsed = authors.authorEntries(bib);
|
|
136
145
|
const store = Object.fromEntries([...usable.citations].map(([k, v]) => [k, v.response]));
|
|
137
146
|
if (!(await fullyCached(citations, parsed, usable, store))) {
|
|
138
147
|
const why = await unreachable();
|
|
@@ -153,16 +162,10 @@ export const referencesChecker = ({ today }) => async (bib, cache) => {
|
|
|
153
162
|
cache: store,
|
|
154
163
|
breaker,
|
|
155
164
|
})),
|
|
156
|
-
|
|
157
|
-
lookup: d.lookup,
|
|
158
|
-
pause: d.pause,
|
|
159
|
-
}),
|
|
160
|
-
]);
|
|
161
|
-
const keys = new Set([
|
|
162
|
-
...found.map((c) => c.id),
|
|
163
|
-
...a.findings.map((f) => f.key),
|
|
165
|
+
authorsOfEach(parsed, d),
|
|
164
166
|
]);
|
|
165
|
-
|
|
167
|
+
// Both lists are one per entry, in its order: so is the verdict list.
|
|
168
|
+
const entries = zip(found, a).map(([c, b]) => entryVerdict(c, b));
|
|
166
169
|
return {
|
|
167
170
|
check: { kind: "checked", entries },
|
|
168
171
|
cache: grown({ cache, usable }, { store, dblp: d.dblp }, today),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/references/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,SAAS,GAKV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEhD,0CAA0C;AAC1C,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,2DAA2D,CAAC;AAEnF,OAAO,KAAK,OAAO,MAAM,0DAA0D,CAAC;AAMpF,OA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B,CAAC;IACjE,KAAK,EAAE,QAAQ;CAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ParsedRecord } from "../../domain/sources-record.ts";
|
|
2
|
+
import type { SourcesCodec } from "../../ports/sources-codec.ts";
|
|
3
|
+
/**
|
|
4
|
+
* A `sources.json`'s text, parsed once at the boundary: the record, or the one reason it is not one.
|
|
5
|
+
* A record of another schema number is refused by name, not read as this one.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseSourcesRecord(text: string): ParsedRecord;
|
|
8
|
+
export declare const sourcesCodec: SourcesCodec;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/sources-record/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AA6CjE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAmB7D;AAED,eAAO,MAAM,YAAY,EAAE,YAA4C,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schema of `_build/sources.json` — the one place its shape is checked (docs/design/paper-sources.md
|
|
3
|
+
* §1). The text is parsed once, here, into the domain's `SourcesRecord`; whatever reads a record after
|
|
4
|
+
* it never re-validates. A record of another schema number is refused by name, not read as this one.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { SOURCES_FILE, SOURCES_SCHEMA, } from "../../domain/sources-record.js";
|
|
8
|
+
const SHA256 = /^[0-9a-f]{64}$/;
|
|
9
|
+
const bibtexError = z.object({
|
|
10
|
+
message: z.string(),
|
|
11
|
+
file: z.string(),
|
|
12
|
+
line: z.number().int().nullable(),
|
|
13
|
+
});
|
|
14
|
+
const recordSchema = z.object({
|
|
15
|
+
schema: z.literal(SOURCES_SCHEMA),
|
|
16
|
+
inputs: z.array(z.object({ path: z.string(), role: z.enum(["preamble", "body"]) })),
|
|
17
|
+
written: z.array(z.string()),
|
|
18
|
+
bibdata: z.array(z.string()),
|
|
19
|
+
bibtex: z.discriminatedUnion("ran", [
|
|
20
|
+
z.object({ ran: z.literal(false) }),
|
|
21
|
+
z.object({
|
|
22
|
+
ran: z.literal(true),
|
|
23
|
+
databases: z.array(z.string()),
|
|
24
|
+
keys: z.array(z.string()),
|
|
25
|
+
exit: z.number().int(),
|
|
26
|
+
errors: z.array(bibtexError),
|
|
27
|
+
}),
|
|
28
|
+
]),
|
|
29
|
+
sha256: z.record(z.string(), z.string().regex(SHA256).nullable()),
|
|
30
|
+
});
|
|
31
|
+
/** The JSON `text` holds, or undefined when it is not JSON. */
|
|
32
|
+
function jsonOf(text) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(text);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** The `schema` field of a parsed file, whatever it holds, or undefined when there is none. */
|
|
41
|
+
const schemaOf = (json) => typeof json === "object" && json !== null && "schema" in json
|
|
42
|
+
? json.schema
|
|
43
|
+
: undefined;
|
|
44
|
+
/**
|
|
45
|
+
* A `sources.json`'s text, parsed once at the boundary: the record, or the one reason it is not one.
|
|
46
|
+
* A record of another schema number is refused by name, not read as this one.
|
|
47
|
+
*/
|
|
48
|
+
export function parseSourcesRecord(text) {
|
|
49
|
+
const json = jsonOf(text);
|
|
50
|
+
if (json === undefined)
|
|
51
|
+
return { ok: false, why: `${SOURCES_FILE} is not JSON` };
|
|
52
|
+
const schema = schemaOf(json);
|
|
53
|
+
if (schema !== SOURCES_SCHEMA)
|
|
54
|
+
return {
|
|
55
|
+
ok: false,
|
|
56
|
+
why: `${SOURCES_FILE} is schema ${typeof schema === "number" ? String(schema) : "unknown"}, this paperlint reads schema ${String(SOURCES_SCHEMA)}`,
|
|
57
|
+
};
|
|
58
|
+
const parsed = recordSchema.safeParse(json);
|
|
59
|
+
if (parsed.success)
|
|
60
|
+
return { ok: true, record: parsed.data };
|
|
61
|
+
const issues = parsed.error.issues.map((i) => `${i.path.join(".")} ${i.message}`);
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
why: `${SOURCES_FILE} does not match schema ${String(SOURCES_SCHEMA)}: ${issues.join("; ")}`,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export const sourcesCodec = { parse: parseSourcesRecord };
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/sources-record/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,cAAc,GAEf,MAAM,gCAAgC,CAAC;AAGxC,MAAM,MAAM,GAAG,gBAAgB,CAAC;AAEhC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,KAAK,CACb,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CACnE;IACD,OAAO,E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ex ends an error with the place it was reading —
|
|
3
|
+
* `---line 4 of file refs.bib`, or `---while reading file paper.aux` when it names no line — and a
|
|
4
|
+
* warning with a single dash (`--line 1 of file x.bib`), so the three dashes are the whole grammar.
|
|
5
|
+
* The message is what stands before them on the line, or, when they start the line, the line before.
|
|
6
|
+
*/
|
|
7
|
+
import type { BibtexError } from "../../domain/sources-record.ts";
|
|
8
|
+
export declare function parseBlgErrors(blg: string): readonly BibtexError[];
|
|
9
|
+
//# sourceMappingURL=blg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blg.d.ts","sourceRoot":"","sources":["../../../src/adapters/tex-output/blg.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAKlE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,CAelE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const PLACE = /^(.*?)---(?:line (\d+) of file|while reading file) (.+)$/;
|
|
2
|
+
const LINE_NUMBER = /---line (\d+) of file/;
|
|
3
|
+
export function parseBlgErrors(blg) {
|
|
4
|
+
const rows = blg.split(/\r?\n/);
|
|
5
|
+
return rows.flatMap((row, i) => {
|
|
6
|
+
const m = PLACE.exec(row);
|
|
7
|
+
if (m === null)
|
|
8
|
+
return [];
|
|
9
|
+
const [, before = "", , file = ""] = m;
|
|
10
|
+
const line = LINE_NUMBER.exec(row)?.[1];
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
message: (before === "" ? (rows[i - 1] ?? "") : before).trim(),
|
|
14
|
+
file: file.trim(),
|
|
15
|
+
line: line === undefined ? null : Number(line),
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=blg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blg.js","sourceRoot":"","sources":["../../../src/adapters/tex-output/blg.ts"],"names":[],"mappings":"AAQA,MAAM,KAAK,GAAG,0DAA0D,CAAC;AACzE,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAA0B,EAAE;QACrD,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC;QAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,EAAE,AAAD,EAAG,IAAI,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,OAAO;YACL;gBACE,OAAO,EAAE,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE;gBAC9D,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;gBACjB,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;aAC/C;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pdflatex's `-recorder` file (`paper.fls`): one line per file TeX opened — `INPUT <path>` to read
|
|
3
|
+
* it, `OUTPUT <path>` to write it — in the order TeX opened them, and a `PWD <dir>` line first. The
|
|
4
|
+
* format has no quoting: a path is the rest of its line.
|
|
5
|
+
*/
|
|
6
|
+
import type { Fls } from "../../domain/tex-run.ts";
|
|
7
|
+
export declare function parseFls(text: string): Fls;
|
|
8
|
+
//# sourceMappingURL=fls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fls.d.ts","sourceRoot":"","sources":["../../../src/adapters/tex-output/fls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,GAAG,EAAW,MAAM,yBAAyB,CAAC;AAW5D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAO1C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const OPS = ["INPUT", "OUTPUT"];
|
|
2
|
+
/** `INPUT a.tex` → the line; anything else (`PWD …`, a blank, a word with no path) → none. */
|
|
3
|
+
function lineOf(raw) {
|
|
4
|
+
const op = OPS.find((o) => raw.startsWith(`${o} `));
|
|
5
|
+
const path = op === undefined ? "" : raw.slice(op.length + 1).trimEnd();
|
|
6
|
+
return op === undefined || path === "" ? [] : [{ op, path }];
|
|
7
|
+
}
|
|
8
|
+
export function parseFls(text) {
|
|
9
|
+
const rows = text.split(/\r?\n/);
|
|
10
|
+
const pwd = rows.find((r) => r.startsWith("PWD "));
|
|
11
|
+
return {
|
|
12
|
+
pwd: pwd === undefined ? null : pwd.slice("PWD ".length).trimEnd(),
|
|
13
|
+
lines: rows.flatMap(lineOf),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=fls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fls.js","sourceRoot":"","sources":["../../../src/adapters/tex-output/fls.ts"],"names":[],"mappings":"AAOA,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC;AAEzC,8FAA8F;AAC9F,SAAS,MAAM,CAAC,GAAW;IACzB,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,OAAO,EAAE,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,OAAO;QACL,GAAG,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;QAClE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The readers of what TeX writes beside a paper: pdflatex's `-recorder` file and bibtex's errors.
|
|
3
|
+
* One implementation of `TexOutput` (`src/ports/tex-output.ts`).
|
|
4
|
+
*/
|
|
5
|
+
import type { TexOutput } from "../../ports/tex-output.ts";
|
|
6
|
+
export declare const texOutput: TexOutput;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/tex-output/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,eAAO,MAAM,SAAS,EAAE,SAGvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/tex-output/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAc;IAClC,GAAG,EAAE,QAAQ;IACb,SAAS,EAAE,cAAc;CAC1B,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type RecordedDeps } from "./recorded-bibliography.ts";
|
|
2
|
+
export type { EntryReport } from "./recorded-bibliography.ts";
|
|
3
|
+
/** Whether a rule should judge this file: the paper's main file only. */
|
|
4
|
+
export declare const isMain: (filename: string) => boolean;
|
|
5
|
+
interface Loc {
|
|
6
|
+
readonly line: number;
|
|
7
|
+
readonly column: number;
|
|
8
|
+
}
|
|
9
|
+
/** The slice of ESLint's rule API the `bib` rules use. */
|
|
10
|
+
export interface BibRuleContext {
|
|
11
|
+
readonly filename: string;
|
|
12
|
+
/** The `tex/latex` language's source code: `raw` is the file as written. */
|
|
13
|
+
readonly sourceCode: {
|
|
14
|
+
readonly raw: string;
|
|
15
|
+
getLocFromIndex(index: number): Loc;
|
|
16
|
+
};
|
|
17
|
+
report(d: {
|
|
18
|
+
readonly loc: {
|
|
19
|
+
readonly start: Loc;
|
|
20
|
+
readonly end: Loc;
|
|
21
|
+
};
|
|
22
|
+
readonly messageId: string;
|
|
23
|
+
readonly data?: Readonly<Record<string, string>>;
|
|
24
|
+
}): void;
|
|
25
|
+
}
|
|
26
|
+
export interface BibRuleModule {
|
|
27
|
+
readonly meta: {
|
|
28
|
+
readonly type: "problem" | "suggestion";
|
|
29
|
+
readonly docs: {
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly url: string;
|
|
32
|
+
};
|
|
33
|
+
readonly schema: readonly object[];
|
|
34
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
35
|
+
};
|
|
36
|
+
create(context: BibRuleContext): {
|
|
37
|
+
"root:exit"?: () => void;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
type BibRuleName = "reachable-entry";
|
|
41
|
+
/** The `bib` plugin's rules, reading the paper's record through `deps`. They act on `paper.tex` only. */
|
|
42
|
+
export declare const bibRules: (deps: RecordedDeps) => Readonly<Record<BibRuleName, BibRuleModule>>;
|
|
43
|
+
/** The level each is on at for every `paper.tex` in paperlint's own config. */
|
|
44
|
+
export declare const BIB_RULE_LEVELS: {
|
|
45
|
+
readonly "bib/reachable-entry": "warn";
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=bib-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bib-rules.d.ts","sourceRoot":"","sources":["../src/bib-rules.ts"],"names":[],"mappings":"AAuBA,OAAO,EAKL,KAAK,YAAY,EAElB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAkB9D,yEAAyE;AACzE,eAAO,MAAM,MAAM,GAAI,UAAU,MAAM,KAAG,OACR,CAAC;AAInC,UAAU,GAAG;IACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;KACrC,CAAC;IACF,MAAM,CAAC,CAAC,EAAE;QACR,QAAQ,CA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