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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorded-bibliography.js","sourceRoot":"","sources":["../src/recorded-bibliography.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,YAAY,GAIb,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EACL,OAAO,EACP,SAAS,GAEV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,WAAW,GAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA6CrD;;;GAGG;AACH,MAAM,cAAc,GAAG,CACrB,GAAW,EACX,KAAwB,EACxB,IAAsB,EACH,EAAE,CACrB,KAAK,CAAC,MAAM,CAIV,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACZ,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,MAAM,GAAG,GACP,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACpE,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO;QACpC,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;KACnC,CAAC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AAG,IAAI,GAAG,CACpB,KAAK;SACF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAU,CAAC,CAC1D,CAAC;IACF,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAW,EACX,QAAsE,EACtE,IAAkB;IAElB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAC3B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAC5E,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RecordedDeps } from "./recorded-bibliography.ts";
|
|
2
2
|
interface Loc {
|
|
3
3
|
readonly line: number;
|
|
4
4
|
readonly column: number;
|
|
@@ -7,6 +7,8 @@ interface RuleContext {
|
|
|
7
7
|
readonly filename: string;
|
|
8
8
|
readonly cwd: string;
|
|
9
9
|
readonly sourceCode: {
|
|
10
|
+
/** The file as written (the `tex/latex` language's source code). */
|
|
11
|
+
readonly raw: string;
|
|
10
12
|
getLocFromIndex(i: number): Loc;
|
|
11
13
|
};
|
|
12
14
|
report(d: {
|
|
@@ -32,10 +34,8 @@ export interface ReferenceRuleModule {
|
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
36
|
type Name = "author-list" | "cite-exists" | "refs-checked" | "refs-fresh";
|
|
35
|
-
/** The four rules, reading through `
|
|
36
|
-
export declare function referenceRules(
|
|
37
|
-
files: Files;
|
|
38
|
-
}): Record<Name, ReferenceRuleModule>;
|
|
37
|
+
/** The four rules, reading the paper through `deps`. They act on `paper.tex` only. */
|
|
38
|
+
export declare function referenceRules(deps: RecordedDeps): Record<Name, ReferenceRuleModule>;
|
|
39
39
|
/** The level each is on at for every `paper.tex` in paperlint's own config. */
|
|
40
40
|
export declare const REFERENCE_RULE_LEVELS: {
|
|
41
41
|
readonly "paper/author-list": "error";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-rules.d.ts","sourceRoot":"","sources":["../src/reference-rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reference-rules.d.ts","sourceRoot":"","sources":["../src/reference-rules.ts"],"names":[],"mappings":"AAkCA,OAAO,EAGL,KAAK,YAAY,EAElB,MAAM,4BAA4B,CAAC;AAWpC,UAAU,GAAG;IACX,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AACD,UAAU,WAAW;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE;QACnB,oEAAoE;QACpE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;KACjC,CAAC;IACF,MAAM,CAAC,CAAC,EAAE;QACR,GAAG,EAAE;YAAE,KAAK,EAAE,GAAG,CAAC;YAAC,GAAG,EAAE,GAAG,CAAA;SAAE,CAAC;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,GAAG,IAAI,CAAC;CACV;AACD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAAC;QACxC,QAAQ,CAAC,IAAI,EAAE;YAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;SAAE,CAAC;QAChD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;QACnC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACrD,CAAC;IACF,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CAC5D;AAED,KAAK,IAAI,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,YAAY,CAAC;AA+N1E,sFAAsF;AACtF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,GACjB,MAAM,CAAC,IAAI,EAAE,mBAAmB,CAAC,CA6BnC;AAED,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC"}
|
package/dist/reference-rules.js
CHANGED
|
@@ -5,47 +5,76 @@
|
|
|
5
5
|
*
|
|
6
6
|
* entry whose authors are the preprint's paper/author-list (error), on the entry
|
|
7
7
|
* entry whose identifier provably fails paper/cite-exists (error), on the entry
|
|
8
|
-
* no
|
|
9
|
-
*
|
|
8
|
+
* no verdicts, or recorded "not checked" paper/refs-checked (warn) — like pdf/measured
|
|
9
|
+
* a key bibtex typeset that no entry the paper/refs-checked (warn): that reference was not
|
|
10
|
+
* reader read has (`unseenKeys`) checked
|
|
11
|
+
* a database bibtex found outside the paper/refs-checked (warn): its references were not checked
|
|
12
|
+
* paper directory (BIBINPUTS)
|
|
13
|
+
* databases edited after the build paper/refs-fresh (error) — like pdf/fresh
|
|
10
14
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
15
|
+
* The databases are the ones the last build's bibtex opened (`_build/sources.json`,
|
|
16
|
+
* docs/design/paper-sources.md §1) — `readBibliography` answers only from a record the paper has not
|
|
17
|
+
* changed since. With no record, or a stale one, every rule here is silent: `paper/sources-fresh`
|
|
18
|
+
* speaks once. While the verdicts are stale, the per-entry rules are silent too: they would judge
|
|
19
|
+
* databases that no longer exist, and refs-fresh already says so once. A paper whose build ran no
|
|
20
|
+
* bibtex gets nothing.
|
|
21
|
+
*
|
|
22
|
+
* `paper/author-list` and `paper/cite-exists` lay the verdicts on the entries of those databases. ESLint
|
|
23
|
+
* does not lint a `.bib`, so a finding is a place in `paper.tex`: an entry of a `.bib` TeX wrote from a
|
|
24
|
+
* block of `paper.tex` is reported on its line there (`entryReports`); any other entry at the top of
|
|
25
|
+
* `paper.tex`, with the entry's file, line and column at the front of the message (`refs.bib:12:1:`).
|
|
14
26
|
*
|
|
15
27
|
* `paper/author-list` used to live on PIPELINE-STATUS.md and ask whether the scorecard mentioned
|
|
16
28
|
* a run. It lives here now because its subject is the bibliography, and the record of the run is
|
|
17
29
|
* the run's own output.
|
|
18
30
|
*/
|
|
19
31
|
import { basename, dirname } from "node:path";
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
import { callerPath } from "./caller-path.js";
|
|
33
|
+
import { MAIN_FILE } from "./domain/paper-sources.js";
|
|
34
|
+
import { entryReports, } from "./recorded-bibliography.js";
|
|
35
|
+
import { bibHash, readBibliography, readReferences, REFERENCES_FILE, unseenKeys, } from "./references.js";
|
|
36
|
+
/**
|
|
37
|
+
* Each entry checked with its verdict — when the record holds one verdict per entry, in its order, as
|
|
38
|
+
* the build writes it. One that does not (written by hand) is not about these databases: null.
|
|
39
|
+
*/
|
|
40
|
+
function laid(verdicts, entries) {
|
|
41
|
+
const pairs = entries.flatMap((f, i) => {
|
|
42
|
+
const v = verdicts[i];
|
|
43
|
+
return v?.key === f.entry.key ? [[f, v]] : [];
|
|
44
|
+
});
|
|
45
|
+
return pairs.length === entries.length && verdicts.length === entries.length
|
|
46
|
+
? pairs
|
|
47
|
+
: null;
|
|
48
|
+
}
|
|
49
|
+
/** What the verdicts on disk say about the databases of `bib`. */
|
|
50
|
+
function judgedVerdicts(bib, doc) {
|
|
26
51
|
if (doc === null)
|
|
27
52
|
return { kind: "unrecorded" };
|
|
28
53
|
if (doc.bib.sha256 !== bibHash(bib))
|
|
29
54
|
return { kind: "stale" };
|
|
30
55
|
if (doc.status === "not-checked")
|
|
31
56
|
return { kind: "not-checked", why: doc.why ?? "no reason recorded" };
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
...(e.exists === "false"
|
|
37
|
-
? [{ key: e.key, rule: "cite-exists", why: e.why ?? "" }]
|
|
38
|
-
: []),
|
|
39
|
-
]);
|
|
40
|
-
return { kind: "ready", bib, failing };
|
|
57
|
+
const verdicts = laid(doc.entries, bib.entries);
|
|
58
|
+
return verdicts === null
|
|
59
|
+
? { kind: "stale" }
|
|
60
|
+
: { kind: "ready", judged: { bib, verdicts } };
|
|
41
61
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
62
|
+
function assess(deps, paperDir) {
|
|
63
|
+
const read = readBibliography(paperDir, deps);
|
|
64
|
+
switch (read.kind) {
|
|
65
|
+
case "no-record":
|
|
66
|
+
case "nothing":
|
|
67
|
+
case "not-wired":
|
|
68
|
+
return { kind: "silent" };
|
|
69
|
+
case "unread":
|
|
70
|
+
return { kind: "unread", databases: read.databases };
|
|
71
|
+
case "read":
|
|
72
|
+
return judgedVerdicts(read.bibliography, readReferences(deps.files, paperDir));
|
|
73
|
+
}
|
|
47
74
|
}
|
|
48
75
|
const BUILD = "`npx paperlint build`";
|
|
76
|
+
const MISMATCH = "`{{key}}`: the authors are not those of the version cited — {{why}}. The citation resolves and the id resolves, and the list is the PREPRINT's under a published venue";
|
|
77
|
+
const MISSING = "`{{key}}` does not resolve to the work cited — {{why}}";
|
|
49
78
|
const META = {
|
|
50
79
|
"author-list": {
|
|
51
80
|
type: "problem",
|
|
@@ -53,9 +82,7 @@ const META = {
|
|
|
53
82
|
description: "each entry's authors are those of the version it cites, not the preprint's (recorded by paperlint build)",
|
|
54
83
|
},
|
|
55
84
|
schema: [],
|
|
56
|
-
messages: {
|
|
57
|
-
mismatch: "`{{key}}`: the authors are not those of the version cited — {{why}}. The citation resolves and the id resolves, and the list is the PREPRINT's under a published venue",
|
|
58
|
-
},
|
|
85
|
+
messages: { mismatch: MISMATCH, mismatchIn: `{{where}}: ${MISMATCH}` },
|
|
59
86
|
},
|
|
60
87
|
"cite-exists": {
|
|
61
88
|
type: "problem",
|
|
@@ -63,9 +90,7 @@ const META = {
|
|
|
63
90
|
description: "each entry's identifier resolves to the work cited (recorded by paperlint build)",
|
|
64
91
|
},
|
|
65
92
|
schema: [],
|
|
66
|
-
messages: {
|
|
67
|
-
missing: "`{{key}}` does not resolve to the work cited — {{why}}",
|
|
68
|
-
},
|
|
93
|
+
messages: { missing: MISSING, missingIn: `{{where}}: ${MISSING}` },
|
|
69
94
|
},
|
|
70
95
|
"refs-checked": {
|
|
71
96
|
type: "suggestion",
|
|
@@ -76,12 +101,14 @@ const META = {
|
|
|
76
101
|
messages: {
|
|
77
102
|
unrecorded: `the references have not been checked — ${BUILD} checks them online and records the result in _build/${REFERENCES_FILE}`,
|
|
78
103
|
notChecked: `the last build could not check the references ({{why}}) — run ${BUILD} with network`,
|
|
104
|
+
unseen: "the last build's bibtex typeset {{what}}, which paperlint's reader did not read from the databases bibtex opened, so those references were not checked: an entry behind `%` or inside `@comment{…}` — bibtex has no comment syntax and reads it, the reader skips it. Delete the entry, or remove its `@`",
|
|
105
|
+
unread: `{{what}}, which the last build's bibtex opened, is not in the paper directory (bibtex found it on its search path, BIBINPUTS), so its references were not checked — move it beside paper.tex`,
|
|
79
106
|
},
|
|
80
107
|
},
|
|
81
108
|
"refs-fresh": {
|
|
82
109
|
type: "problem",
|
|
83
110
|
docs: {
|
|
84
|
-
description: "the recorded reference verdicts are about the
|
|
111
|
+
description: "the recorded reference verdicts are about the databases on disk, not an earlier set",
|
|
85
112
|
},
|
|
86
113
|
schema: [],
|
|
87
114
|
messages: {
|
|
@@ -89,61 +116,107 @@ const META = {
|
|
|
89
116
|
},
|
|
90
117
|
},
|
|
91
118
|
};
|
|
119
|
+
const AT_START = { kind: "here", span: { start: 0, end: 0 } };
|
|
92
120
|
const JUDGES = {
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
:
|
|
116
|
-
|
|
121
|
+
"refs-checked": (a) => {
|
|
122
|
+
switch (a.kind) {
|
|
123
|
+
case "unrecorded":
|
|
124
|
+
return [{ messageId: "unrecorded" }];
|
|
125
|
+
case "not-checked":
|
|
126
|
+
return [{ messageId: "notChecked", data: { why: a.why } }];
|
|
127
|
+
case "unread":
|
|
128
|
+
return [
|
|
129
|
+
{ messageId: "unread", data: { what: a.databases.join(", ") } },
|
|
130
|
+
];
|
|
131
|
+
case "ready": {
|
|
132
|
+
const unseen = unseenKeys(a.judged.bib);
|
|
133
|
+
return unseen.length === 0
|
|
134
|
+
? []
|
|
135
|
+
: [
|
|
136
|
+
{
|
|
137
|
+
messageId: "unseen",
|
|
138
|
+
data: { what: unseen.map((k) => `\`${k}\``).join(", ") },
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
case "silent":
|
|
143
|
+
case "stale":
|
|
144
|
+
return [];
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"refs-fresh": (a) => (a.kind === "stale" ? [{ messageId: "stale" }] : []),
|
|
117
148
|
};
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
149
|
+
/**
|
|
150
|
+
* One finding, at its entry in paper.tex — or, for an entry in a `.bib`, at the top, with the `…In`
|
|
151
|
+
* message that names the entry's file, line and column first.
|
|
152
|
+
*/
|
|
153
|
+
function report(context, r) {
|
|
154
|
+
const loc = (i) => context.sourceCode.getLocFromIndex(i);
|
|
155
|
+
const at = r.at ?? AT_START;
|
|
156
|
+
context.report({
|
|
157
|
+
loc: { start: loc(at.span.start), end: loc(at.span.end) },
|
|
158
|
+
...(at.kind === "here"
|
|
159
|
+
? { messageId: r.messageId, ...(r.data ? { data: r.data } : {}) }
|
|
160
|
+
: {
|
|
161
|
+
messageId: `${r.messageId}In`,
|
|
162
|
+
data: { ...r.data, where: at.where },
|
|
163
|
+
}),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/** The verdicts a rule reports, and the message each makes. */
|
|
167
|
+
const VERDICT_RULES = {
|
|
168
|
+
"author-list": {
|
|
169
|
+
failed: (v) => v.authors === "mismatch",
|
|
170
|
+
messageId: "mismatch",
|
|
171
|
+
},
|
|
172
|
+
"cite-exists": {
|
|
173
|
+
failed: (v) => v.exists === "false",
|
|
174
|
+
messageId: "missing",
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* The entries the verdicts judged failing for `rule`, each where it is reported (`entryReports`): the
|
|
179
|
+
* line of its `filecontents` block in the paper's text when TeX wrote its `.bib` from one, else the
|
|
180
|
+
* top of `paper.tex`.
|
|
181
|
+
*/
|
|
182
|
+
function verdictReports(rule, context, deps) {
|
|
183
|
+
const main = callerPath(context.filename);
|
|
184
|
+
const dir = dirname(main);
|
|
185
|
+
const a = assess(deps, dir);
|
|
186
|
+
if (a.kind !== "ready")
|
|
187
|
+
return [];
|
|
188
|
+
const { failed, messageId } = VERDICT_RULES[rule];
|
|
189
|
+
const flagged = a.judged.verdicts.filter(([, v]) => failed(v));
|
|
190
|
+
const at = entryReports({
|
|
191
|
+
dir,
|
|
192
|
+
record: a.judged.bib.record,
|
|
193
|
+
main: { path: main, text: context.sourceCode.raw },
|
|
194
|
+
}, flagged.map(([f]) => f), deps);
|
|
195
|
+
return flagged.map(([, v], i) => ({
|
|
196
|
+
at: at[i],
|
|
197
|
+
messageId,
|
|
198
|
+
data: { key: v.key, why: v.why ?? "" },
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
/** The four rules, reading the paper through `deps`. They act on `paper.tex` only. */
|
|
202
|
+
export function referenceRules(deps) {
|
|
203
|
+
const make = (name, judge) => ({
|
|
121
204
|
meta: META[name],
|
|
122
|
-
create: (context) => basename(context.filename) !==
|
|
205
|
+
create: (context) => basename(context.filename) !== MAIN_FILE
|
|
123
206
|
? {}
|
|
124
207
|
: {
|
|
125
208
|
"root:exit": () => {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
// An external refs.bib: the entry is not in this file, so the finding sits at its
|
|
129
|
-
// start and names the key.
|
|
130
|
-
const external = a.kind === "ready" && a.bib.source !== "paper.tex";
|
|
131
|
-
for (const r of JUDGES[name](a)) {
|
|
132
|
-
const loc = context.sourceCode.getLocFromIndex(external ? 0 : r.at);
|
|
133
|
-
context.report({
|
|
134
|
-
loc: { start: loc, end: loc },
|
|
135
|
-
messageId: r.messageId,
|
|
136
|
-
...(r.data ? { data: r.data } : {}),
|
|
137
|
-
});
|
|
138
|
-
}
|
|
209
|
+
for (const r of judge(context))
|
|
210
|
+
report(context, r);
|
|
139
211
|
},
|
|
140
212
|
},
|
|
141
213
|
});
|
|
214
|
+
const assessed = (name) => (context) => JUDGES[name](assess(deps, dirname(callerPath(context.filename))));
|
|
142
215
|
return {
|
|
143
|
-
"author-list": make("author-list"),
|
|
144
|
-
"cite-exists": make("cite-exists"),
|
|
145
|
-
"refs-checked": make("refs-checked"),
|
|
146
|
-
"refs-fresh": make("refs-fresh"),
|
|
216
|
+
"author-list": make("author-list", (c) => verdictReports("author-list", c, deps)),
|
|
217
|
+
"cite-exists": make("cite-exists", (c) => verdictReports("cite-exists", c, deps)),
|
|
218
|
+
"refs-checked": make("refs-checked", assessed("refs-checked")),
|
|
219
|
+
"refs-fresh": make("refs-fresh", assessed("refs-fresh")),
|
|
147
220
|
};
|
|
148
221
|
}
|
|
149
222
|
/** The level each is on at for every `paper.tex` in paperlint's own config. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-rules.js","sourceRoot":"","sources":["../src/reference-rules.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"reference-rules.js","sourceRoot":"","sources":["../src/reference-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EACL,YAAY,GAIb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,UAAU,GAGX,MAAM,iBAAiB,CAAC;AAgDzB;;;GAGG;AACH,SAAS,IAAI,CACX,QAAiC,EACjC,OAAiC;IAEjC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAA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;KACzD,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB,EAAE,OAAO;IAC5B,mBAAmB,EAAE,OAAO;IAC5B,oBAAoB,EAAE,MAAM;IAC5B,kBAAkB,EAAE,OAAO;CACnB,CAAC"}
|
package/dist/references.d.ts
CHANGED
|
@@ -2,43 +2,98 @@ import type { Files } from "./ports/files.ts";
|
|
|
2
2
|
import { type LookupCache } from "./domain/lookup-cache.ts";
|
|
3
3
|
import { type Result } from "./domain/result.ts";
|
|
4
4
|
import type { CheckReferences, EntryVerdict, ReferencesCheck } from "./ports/check-references.ts";
|
|
5
|
-
|
|
5
|
+
import { type SourcesRecord } from "./domain/sources-record.ts";
|
|
6
|
+
import type { PaperRecord } from "./paper-record.ts";
|
|
7
|
+
import { type ReadDatabase, type RecordedEntry, type RecordedReadDeps } from "./recorded-bibliography.ts";
|
|
8
|
+
/** 3: the record of what bibtex read lives in `_build/sources.json`; an older one reads as none. */
|
|
9
|
+
export declare const REFERENCES_SCHEMA = 3;
|
|
6
10
|
export declare const REFERENCES_FILE = "references.json";
|
|
7
11
|
/** The lookup cache's place in a paper: committed, beside the paper's other reproduction files. */
|
|
8
12
|
export declare const LOOKUP_CACHE_FILE = "repro/references-cache.json";
|
|
9
13
|
export declare const lookupCachePath: (paperDir: string) => string;
|
|
10
14
|
/** Where a paper's reference verdicts live — beside `paper.facts.json`. */
|
|
11
15
|
export declare const referencesPath: (paperDir: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The bibliography the build checks: the databases bibtex opened, in the order it opened them, and
|
|
18
|
+
* their entries as the bibtex reader read them. The verdicts are recorded one per entry, in this
|
|
19
|
+
* order: a verdict is about an entry, not about its key.
|
|
20
|
+
*/
|
|
21
|
+
export interface CheckedBibliography {
|
|
22
|
+
/** The build's record these databases were read from. */
|
|
23
|
+
readonly record: SourcesRecord;
|
|
24
|
+
readonly databases: readonly [ReadDatabase, ...ReadDatabase[]];
|
|
25
|
+
readonly entries: readonly RecordedEntry[];
|
|
26
|
+
/** The keys bibtex typeset, in the order it did: the `.bbl`'s `\bibitem`s. */
|
|
27
|
+
readonly typeset: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
/** What reading the bibliography takes: the record's readers, and the bibtex reader. */
|
|
30
|
+
export type BibliographyDeps = RecordedReadDeps;
|
|
31
|
+
/** What a paper's record comes to for the references. */
|
|
32
|
+
export type BibliographyRead = {
|
|
33
|
+
readonly kind: "read";
|
|
34
|
+
readonly bibliography: CheckedBibliography;
|
|
35
|
+
}
|
|
36
|
+
/** No record of the build, an unreadable one, or one the paper has changed since. */
|
|
37
|
+
| {
|
|
38
|
+
readonly kind: "no-record";
|
|
39
|
+
readonly record: Exclude<PaperRecord, {
|
|
40
|
+
readonly kind: "fresh";
|
|
41
|
+
}>;
|
|
42
|
+
}
|
|
43
|
+
/** bibtex opened no database: the build ran none, or the paper names none. */
|
|
44
|
+
| {
|
|
45
|
+
readonly kind: "nothing";
|
|
18
46
|
}
|
|
19
|
-
|
|
20
|
-
|
|
47
|
+
/** Databases bibtex opened that are not in the paper directory: it found them on its search path. */
|
|
48
|
+
| {
|
|
49
|
+
readonly kind: "unread";
|
|
50
|
+
readonly databases: readonly string[];
|
|
51
|
+
}
|
|
52
|
+
/** The build was not given a reader. */
|
|
53
|
+
| {
|
|
54
|
+
readonly kind: "not-wired";
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The bibliography the build recorded for the paper in `dir`: the databases bibtex opened, read by
|
|
58
|
+
* the bibtex reader. Only a fresh record answers (`paperRecord`).
|
|
59
|
+
*/
|
|
60
|
+
export declare function readBibliography(dir: string, deps: BibliographyDeps): BibliographyRead;
|
|
61
|
+
/** A paper's bibliography by its directory — what the build's steps are handed by the composition root. */
|
|
62
|
+
export type ReadBibliography = (dir: string) => BibliographyRead;
|
|
63
|
+
/** `readBibliography` over `deps`, as a `ReadBibliography`. */
|
|
64
|
+
export declare const bibliographyReader: (deps: BibliographyDeps) => ReadBibliography;
|
|
65
|
+
/** No reader: the build was not given one. Never "no bibliography" — it says so. */
|
|
66
|
+
export declare const notWiredBibliography: ReadBibliography;
|
|
67
|
+
/**
|
|
68
|
+
* The keys bibtex typeset that no entry the reader read has — an entry behind `%` or inside
|
|
69
|
+
* `@comment{…}`, which bibtex reads and the reader does not. In the order bibtex typeset them, each
|
|
70
|
+
* once. bibtex's keys are case-insensitive (`\cite{SMITH}` typesets `\bibitem{SMITH}` from an entry
|
|
71
|
+
* `smith`, measured), so they are compared so.
|
|
72
|
+
*/
|
|
73
|
+
export declare function unseenKeys(b: CheckedBibliography): readonly string[];
|
|
74
|
+
/** The bytes of the databases checked, in order: what a later lint compares to see the verdicts are current. */
|
|
75
|
+
export declare const bibHash: (b: CheckedBibliography) => string;
|
|
21
76
|
/** What `_build/references.json` holds. */
|
|
22
77
|
export interface ReferencesDocument {
|
|
23
78
|
readonly schema: number;
|
|
24
79
|
readonly bib: {
|
|
25
|
-
readonly
|
|
80
|
+
readonly sources: readonly string[];
|
|
26
81
|
readonly sha256: string;
|
|
27
82
|
};
|
|
28
83
|
readonly status: "checked" | "not-checked";
|
|
29
84
|
readonly why?: string;
|
|
30
85
|
readonly entries: readonly EntryVerdict[];
|
|
31
86
|
}
|
|
32
|
-
export declare const documentOf: (bib:
|
|
87
|
+
export declare const documentOf: (bib: CheckedBibliography, check: ReferencesCheck) => ReferencesDocument;
|
|
33
88
|
/** The recorded verdicts, or null when there are none or they do not parse. */
|
|
34
89
|
export declare function readReferences(files: Files, paperDir: string): ReferencesDocument | null;
|
|
35
90
|
/** The paper's lookup cache: empty when there is none, or why the file on disk cannot be read. */
|
|
36
91
|
export declare function readLookupCache(files: Files, paperDir: string): Result<LookupCache, string>;
|
|
37
92
|
/**
|
|
38
|
-
* The build step's work: check the bibliography, serving what it can from the
|
|
39
|
-
* cache, and record the verdicts. Returns the one-line note the build prints. A
|
|
40
|
-
* throws, or a cache that does not parse, is recorded as `not-checked` — the step
|
|
41
|
-
* never refuses. A cache that does not parse is left as it is, and named.
|
|
93
|
+
* The build step's work: check the bibliography the build recorded, serving what it can from the
|
|
94
|
+
* paper's lookup cache, and record the verdicts. Returns the one-line note the build prints. A
|
|
95
|
+
* checker that throws, or a cache that does not parse, is recorded as `not-checked` — the step
|
|
96
|
+
* reports, it never refuses. A cache that does not parse is left as it is, and named.
|
|
42
97
|
*/
|
|
43
|
-
export declare function recordReferences(files: Files, paperDir: string, check: CheckReferences): Promise<string>;
|
|
98
|
+
export declare function recordReferences(files: Files, paperDir: string, read: BibliographyRead, check: CheckReferences): Promise<string>;
|
|
44
99
|
//# sourceMappingURL=references.d.ts.map
|
package/dist/references.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAM,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,eAAe,EAEhB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,oGAAoG;AACpG,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,eAAe,oBAAoB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