paperlint 16.8.0 → 17.1.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 +10 -2
- package/CONTRIBUTING.md +1 -1
- package/README.md +17 -14
- package/dist/adapters/latex/abstract.d.ts +7 -1
- package/dist/adapters/latex/abstract.d.ts.map +1 -1
- package/dist/adapters/latex/abstract.js +19 -4
- package/dist/adapters/latex/abstract.js.map +1 -1
- package/dist/adapters/latex/captions.d.ts +6 -5
- package/dist/adapters/latex/captions.d.ts.map +1 -1
- package/dist/adapters/latex/captions.js +14 -30
- package/dist/adapters/latex/captions.js.map +1 -1
- package/dist/adapters/latex/index.d.ts +1 -1
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +5 -2
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/prose.d.ts +6 -0
- package/dist/adapters/latex/prose.d.ts.map +1 -1
- package/dist/adapters/latex/prose.js +18 -12
- package/dist/adapters/latex/prose.js.map +1 -1
- package/dist/cli.d.ts +6 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -8
- package/dist/cli.js.map +1 -1
- package/dist/domain/register.d.ts +23 -1
- package/dist/domain/register.d.ts.map +1 -1
- package/dist/domain/register.js +37 -14
- package/dist/domain/register.js.map +1 -1
- package/dist/domain/term-definitions.d.ts +48 -0
- package/dist/domain/term-definitions.d.ts.map +1 -0
- package/dist/domain/term-definitions.js +228 -0
- package/dist/domain/term-definitions.js.map +1 -0
- package/dist/domain/tex-document.d.ts +11 -0
- package/dist/domain/tex-document.d.ts.map +1 -1
- package/dist/domain/tex-document.js.map +1 -1
- package/dist/eslint-rules/review-frontmatter.js +5 -5
- package/dist/eslint-rules/review-frontmatter.schema.json +15 -8
- package/dist/eslint-rules/sibling-frontmatter.d.ts.map +1 -1
- package/dist/folder-venue-rule.d.ts +1 -1
- package/dist/folder-venue-rule.d.ts.map +1 -1
- package/dist/folder-venue-rule.js +4 -2
- package/dist/folder-venue-rule.js.map +1 -1
- package/dist/hooks-notice.d.ts +3 -3
- package/dist/hooks-notice.d.ts.map +1 -1
- package/dist/hooks-notice.js +41 -8
- package/dist/hooks-notice.js.map +1 -1
- package/dist/link-skills.d.ts +5 -0
- package/dist/link-skills.d.ts.map +1 -1
- package/dist/link-skills.js +7 -0
- package/dist/link-skills.js.map +1 -1
- package/dist/ports/latex.d.ts +11 -1
- package/dist/ports/latex.d.ts.map +1 -1
- package/dist/presets.d.ts +21 -2
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +66 -17
- package/dist/presets.js.map +1 -1
- package/dist/readability.d.ts +12 -2
- package/dist/readability.d.ts.map +1 -1
- package/dist/readability.js +76 -3
- package/dist/readability.js.map +1 -1
- package/dist/register-bands.d.ts +16 -5
- package/dist/register-bands.d.ts.map +1 -1
- package/dist/register-bands.js +56 -17
- package/dist/register-bands.js.map +1 -1
- package/dist/skills/argument-arc/scripts/headings-core.d.ts +12 -0
- package/dist/skills/argument-arc/scripts/headings.d.ts +2 -0
- package/dist/skills/cold-read-diff/scripts/cold-read-core.d.ts +12 -0
- package/dist/skills/cold-read-diff/scripts/readers.d.ts +2 -1
- package/dist/term-definition-rules.d.ts +26 -0
- package/dist/term-definition-rules.d.ts.map +1 -0
- package/dist/term-definition-rules.js +137 -0
- package/dist/term-definition-rules.js.map +1 -0
- package/dist/tex-paper.d.ts +6 -0
- package/dist/tex-paper.d.ts.map +1 -1
- package/dist/tex-paper.js +10 -0
- package/dist/tex-paper.js.map +1 -1
- package/dist/tex-requirements.d.ts +2 -0
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +9 -0
- package/dist/tex-requirements.js.map +1 -1
- package/dist/tex-venue-rules.d.ts +3 -2
- package/dist/tex-venue-rules.d.ts.map +1 -1
- package/dist/tex-venue-rules.js +3 -2
- package/dist/tex-venue-rules.js.map +1 -1
- package/docs/configuration.md +2 -2
- package/{skills/paper-pipeline/references → docs/design}/acceptance-gate.md +50 -53
- package/docs/design/paper-pipeline-history.md +217 -0
- package/docs/design/skill-provenance.md +132 -0
- package/docs/design/study-modes.md +1 -1
- package/docs/design/verify-citations-history.md +135 -0
- package/docs/design/writing-exemplars.md +19 -0
- package/docs/install.md +7 -4
- package/docs/layout.md +5 -4
- package/docs/optional-rules.md +4 -0
- package/docs/osf-artifact.md +54 -0
- package/docs/pipeline.md +171 -0
- package/docs/render.md +82 -0
- package/docs/rules/paper/folder-venue-leftover.md +10 -7
- package/docs/rules/tex/contrast-frames.md +1 -2
- package/docs/rules/tex/max-caption-words.md +82 -0
- package/docs/rules/tex/max-paragraph-words.md +2 -2
- package/docs/rules/tex/negated-sentences.md +96 -0
- package/docs/rules/tex/term-before-definition.md +103 -0
- package/docs/rules/tex/term-defined-twice.md +62 -0
- package/docs/rules/tex/venue-leftover.md +13 -1
- package/docs/rules.md +23 -18
- package/docs/skills.md +16 -21
- package/docs/submission.md +14 -0
- package/docs/texlive-install-decision.md +1 -1
- package/docs/toolchain.md +11 -11
- package/eslint-rules/review-frontmatter.schema.json +15 -8
- package/eslint-rules/review-frontmatter.test.mjs +8 -5
- package/eslint-rules/review-frontmatter.ts +5 -5
- package/eslint.config.mjs +1 -5
- package/hooks/paper-status-gates.sh +21 -4
- package/hooks/paper-status-gates.test.ts +51 -0
- package/lib/skill-checks.test.mjs +2 -6
- package/lib/skill-trigger-cases.mjs +12 -97
- package/lib/skill-trigger-cases.test.ts +0 -6
- package/package.json +3 -1
- package/presets/acm-sigconf.md +1 -1
- package/presets/agenticdev.jsonc +5 -2
- package/presets/agenticdev.md +4 -2
- package/presets/aidc.jsonc +14 -1
- package/presets/aidc.md +3 -2
- package/presets/aisec.jsonc +9 -3
- package/presets/aisec.md +4 -1
- package/presets/ase.jsonc +145 -0
- package/presets/ase.md +178 -0
- package/presets/ccs.jsonc +87 -0
- package/presets/ccs.md +184 -0
- package/presets/icse.jsonc +100 -0
- package/presets/icse.md +126 -0
- package/presets/ieee-conference.md +1 -1
- package/presets/sp.jsonc +152 -0
- package/presets/sp.md +160 -0
- package/presets/venue-profile.schema.json +22 -3
- package/scripts/harness-api.frozen.json +0 -4
- package/scripts/pipeline.ts +481 -0
- package/skills/CLAUDE.md +2 -2
- package/skills/CLAUDE.md.spec.ts +26 -1
- package/skills/analyze-sibling-paper/SKILL.md +2 -20
- package/skills/analyze-sibling-paper/SKILL.md.spec.ts +9 -19
- package/skills/argument-arc/SKILL.md +32 -18
- package/skills/argument-arc/SKILL.md.spec.ts +43 -17
- package/skills/argument-arc/scripts/headings-core.js +46 -0
- package/skills/argument-arc/scripts/headings-core.ts +65 -0
- package/skills/argument-arc/scripts/headings.js +15 -0
- package/skills/argument-arc/scripts/headings.test.ts +105 -0
- package/skills/argument-arc/scripts/headings.ts +20 -0
- package/skills/build-benchmark/SKILL.md +1 -12
- package/skills/build-benchmark/SKILL.md.spec.ts +15 -11
- package/skills/build-label-page/SKILL.md.spec.ts +11 -0
- package/skills/camera-ready/SKILL.md +1 -8
- package/skills/camera-ready/SKILL.md.spec.ts +8 -7
- package/skills/cold-read-diff/SKILL.md +36 -25
- package/skills/cold-read-diff/SKILL.md.spec.ts +44 -24
- package/skills/cold-read-diff/scripts/cold-read-core.js +63 -6
- package/skills/cold-read-diff/scripts/cold-read-core.ts +81 -6
- package/skills/cold-read-diff/scripts/cold-read.js +1 -1
- package/skills/cold-read-diff/scripts/cold-read.test.ts +66 -0
- package/skills/cold-read-diff/scripts/cold-read.ts +1 -1
- package/skills/cold-read-diff/scripts/readers.js +2 -1
- package/skills/cold-read-diff/scripts/readers.ts +2 -1
- package/skills/draft-paper/SKILL.md +16 -29
- package/skills/draft-paper/SKILL.md.spec.ts +27 -28
- package/skills/extend-paper/SKILL.md +7 -16
- package/skills/extend-paper/SKILL.md.spec.ts +18 -15
- package/skills/find-venue/SKILL.md +11 -24
- package/skills/find-venue/SKILL.md.spec.ts +19 -23
- package/skills/harden-paper/SKILL.md +62 -290
- package/skills/harden-paper/SKILL.md.spec.ts +82 -304
- package/skills/harden-paper/harden-paper.harness.mjs +1 -2
- package/skills/jobs.ts +25 -0
- package/skills/label-agent-runs/SKILL.md.spec.ts +10 -0
- package/skills/map-prior-work/SKILL.md +5 -4
- package/skills/map-prior-work/SKILL.md.spec.ts +13 -3
- package/skills/paper-pipeline/SKILL.md +80 -278
- package/skills/paper-pipeline/SKILL.md.spec.ts +130 -276
- package/skills/paper-pipeline/description-language.eval.mjs +0 -22
- package/skills/paper-pipeline/framing-vs-vocabulary.eval.mjs +0 -29
- package/skills/paper-pipeline/paper-pipeline.harness.mjs +0 -16
- package/skills/paper-pipeline/pipeline-firing.eval.mjs +7 -29
- package/skills/paper-pipeline/pipeline-language.eval.mjs +0 -52
- package/skills/paper-pipeline/references/artifact-checklist.md +6 -1
- package/skills/paper-pipeline/references/body-vs-appendix.md +3 -4
- package/skills/paper-pipeline/references/pipeline-status-template.md +8 -10
- package/skills/paper-pipeline/references/review-ratchet.md +4 -7
- package/skills/paper-pipeline/references/venue-bar.md +1 -2
- package/skills/paper-pipeline/references/writing-craft.md +21 -281
- package/skills/paper-status/SKILL.md +17 -20
- package/skills/paper-status/SKILL.md.spec.ts +23 -19
- package/skills/pc-panel-review/SKILL.md +66 -93
- package/skills/pc-panel-review/SKILL.md.spec.ts +75 -92
- package/skills/plan-paper-timeline/SKILL.md +7 -29
- package/skills/plan-paper-timeline/SKILL.md.spec.ts +16 -28
- package/skills/plan-paper-timeline/plan-paper-timeline.effects.harness.mjs +2 -2
- package/skills/render-paper/check-render.sh +2 -2
- package/skills/render-paper/render-paper.harness.mjs +4 -20
- package/skills/research-ideate/SKILL.md +15 -32
- package/skills/research-ideate/SKILL.md.spec.ts +25 -31
- package/skills/rewrite-unclear/SKILL.md +15 -14
- package/skills/rewrite-unclear/SKILL.md.spec.ts +24 -15
- package/skills/rewrite-unclear/rewrite-unclear.eval.ts +2 -3
- package/skills/run-agent-grid/SKILL.md +3 -3
- package/skills/run-agent-grid/SKILL.md.spec.ts +10 -2
- package/skills/study-accepted-papers/SKILL.md +5 -5
- package/skills/study-accepted-papers/SKILL.md.spec.ts +27 -4
- package/skills/submit-paper/SKILL.md +37 -31
- package/skills/submit-paper/SKILL.md.spec.ts +46 -30
- package/skills/submit-paper/check-deanon.sh +1 -1
- package/skills/tighten-paper/SKILL.md +43 -68
- package/skills/tighten-paper/SKILL.md.spec.ts +51 -67
- package/skills/verify-citations/SKILL.md +18 -112
- package/skills/verify-citations/SKILL.md.spec.ts +27 -114
- package/src/adapters/latex/abstract.test.ts +42 -0
- package/src/adapters/latex/abstract.ts +23 -6
- package/src/adapters/latex/captions.test.ts +36 -38
- package/src/adapters/latex/captions.ts +16 -33
- package/src/adapters/latex/index.test.ts +11 -0
- package/src/adapters/latex/index.ts +5 -2
- package/src/adapters/latex/prose.ts +23 -11
- package/src/cli.ts +26 -5
- package/src/domain/register.test.ts +65 -0
- package/src/domain/register.ts +72 -16
- package/src/domain/term-definitions.test.ts +240 -0
- package/src/domain/term-definitions.ts +329 -0
- package/src/domain/tex-document.ts +12 -0
- package/src/domain/venue-name.test.ts +4 -4
- package/src/folder-venue-rule.test.ts +23 -2
- package/src/folder-venue-rule.ts +8 -8
- package/src/hooks-notice.test.ts +127 -0
- package/src/hooks-notice.ts +50 -10
- package/src/link-skills.ts +9 -0
- package/src/new-paper.test.ts +2 -2
- package/src/paper-settings-commands.test.ts +1 -1
- package/src/ports/latex.ts +11 -0
- package/src/preset-card-rule.test.ts +4 -0
- package/src/presets.test.ts +141 -4
- package/src/presets.ts +113 -22
- package/src/readability.test.ts +92 -0
- package/src/readability.ts +113 -5
- package/src/register-bands.test.ts +81 -1
- package/src/register-bands.ts +88 -23
- package/src/rule-cases.test.ts +122 -2
- package/src/term-definition-rules.test.ts +150 -0
- package/src/term-definition-rules.ts +189 -0
- package/src/tex-paper.test.ts +18 -1
- package/src/tex-paper.ts +11 -0
- package/src/tex-requirements.ts +15 -0
- package/src/tex-venue-rules.test.ts +45 -1
- package/src/tex-venue-rules.ts +8 -3
- package/src/venue-rules.test.ts +2 -2
- package/templates/paper/PIPELINE-STATUS.md +19 -19
- package/dist/paper-prose.d.ts +0 -17
- package/dist/paper-prose.d.ts.map +0 -1
- package/dist/paper-prose.js +0 -46
- package/dist/paper-prose.js.map +0 -1
- package/skills/grade-paper-writing/SKILL.md +0 -494
- package/skills/grade-paper-writing/SKILL.md.spec.ts +0 -501
- package/skills/grade-paper-writing/__snapshots__/prose-lint.test.ts.snap +0 -84
- package/skills/grade-paper-writing/fixtures/control_gopen.txt +0 -1
- package/skills/grade-paper-writing/fixtures/control_human_paper.txt +0 -1
- package/skills/grade-paper-writing/fixtures/rewrite.txt +0 -1
- package/skills/grade-paper-writing/fixtures/specimen.txt +0 -1
- package/skills/grade-paper-writing/fixtures/structure-checks.md +0 -22
- package/skills/grade-paper-writing/grade-paper-writing.eval.mjs +0 -19
- package/skills/grade-paper-writing/grade-paper-writing.harness.mjs +0 -23
- package/skills/grade-paper-writing/prose-lint.mjs +0 -602
- package/skills/grade-paper-writing/prose-lint.test.ts +0 -413
- package/skills/osf-artifact-upload/SKILL.md +0 -58
- package/skills/osf-artifact-upload/SKILL.md.spec.ts +0 -65
- package/skills/osf-artifact-upload/osf-artifact-upload.eval.mjs +0 -22
- package/skills/osf-artifact-upload/osf-artifact-upload.harness.ts +0 -102
- package/skills/paper-adversarial-review/SKILL.md +0 -100
- package/skills/paper-adversarial-review/SKILL.md.spec.ts +0 -107
- package/skills/paper-adversarial-review/paper-adversarial-review.eval.mjs +0 -19
- package/skills/paper-adversarial-review/paper-adversarial-review.harness.mjs +0 -24
- package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +0 -1274
- package/skills/paper-pipeline/references/credit-criteria.md +0 -69
- package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/README.md +0 -35
- package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/run_retext.mjs +0 -24
- package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/sentences.txt +0 -11
- package/skills/paper-pipeline/references/occupancy-2026-08-06-probe/test_sentences.py +0 -25
- package/skills/paper-pipeline/references/occupancy-2026-08-06-prose-checkers.md +0 -538
- package/skills/paper-pipeline/references/occupancy-2026-08-06-reproducible-tooling.md +0 -431
- package/skills/paper-pipeline/references/occupancy-2026-08-06-staleness-and-orchestration.md +0 -592
- package/skills/paper-pipeline/repro/2026-08-08-parent-replication.mjs +0 -92
- package/skills/render-paper/SKILL.md +0 -123
- package/skills/render-paper/SKILL.md.spec.ts +0 -130
- package/skills/render-paper/render-paper.eval.mjs +0 -19
- package/skills/submission-portal/SKILL.md +0 -129
- package/skills/submission-portal/SKILL.md.spec.ts +0 -134
- package/skills/submission-portal/submission-portal.eval.mjs +0 -15
- package/skills/submission-portal/submission-portal.test.ts +0 -12
- package/skills/sweep-design-space/SKILL.md +0 -232
- package/skills/sweep-design-space/SKILL.md.spec.ts +0 -248
- package/skills/sweep-design-space/sweep-design-space.eval.mjs +0 -19
- package/skills/sweep-design-space/sweep-design-space.harness.mjs +0 -23
- package/src/paper-prose.test.ts +0 -78
- package/src/paper-prose.ts +0 -67
package/dist/register-bands.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* is reported where it stands
|
|
9
9
|
* tex/relation-markers warn words naming how a sentence relates to the one before (because,
|
|
10
10
|
* therefore, however, for example …) outside the band
|
|
11
|
+
* tex/negated-sentences off the share of the body's sentences that hold a negator (not, no,
|
|
12
|
+
* never, without …) outside the band — a percent of sentences, not
|
|
13
|
+
* a rate per words; off until a project turns it on
|
|
11
14
|
*
|
|
12
15
|
* ── WHY ──────────────────────────────────────────────────────────────────────────
|
|
13
16
|
* Reviewers called a paper "too informal" and "a blogpost". Its text differed from the accepted
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
* names no template. A body under `MIN_WORDS` is not judged either: one sentence would decide it.
|
|
24
27
|
*/
|
|
25
28
|
import { basename, dirname } from "node:path";
|
|
26
|
-
import { bandOf, bodySentences, claimEmphasis, contrastFrames, rateOf, relationMarkers, wordsOf, } from "./domain/register.js";
|
|
29
|
+
import { bandOf, bodySentences, claimEmphasis, contrastFrames, negatedSentences, negationBandOf, rateOf, relationMarkers, shareOf, wordsOf, } from "./domain/register.js";
|
|
27
30
|
import { paperPreset } from "./presets.js";
|
|
28
31
|
import { MIN_WORDS, startOf } from "./register.js";
|
|
29
32
|
import { readPaper, reportInPaper } from "./tex-paper.js";
|
|
@@ -37,7 +40,8 @@ function dataOf(m, band, venue) {
|
|
|
37
40
|
return {
|
|
38
41
|
count: m.occurrences.length,
|
|
39
42
|
words: m.words,
|
|
40
|
-
|
|
43
|
+
sentences: m.sentences,
|
|
44
|
+
rate: fixed(m.rate),
|
|
41
45
|
venue,
|
|
42
46
|
min: fixed(band.min),
|
|
43
47
|
max: fixed(band.max),
|
|
@@ -58,7 +62,7 @@ function dataOf(m, band, venue) {
|
|
|
58
62
|
export function judgeBand(m, band, venue, each) {
|
|
59
63
|
if (band === null || m.words < MIN_WORDS)
|
|
60
64
|
return [];
|
|
61
|
-
const standing = standingOf(
|
|
65
|
+
const standing = standingOf(m.rate, band);
|
|
62
66
|
if (standing === "within")
|
|
63
67
|
return [];
|
|
64
68
|
const data = dataOf(m, band, venue);
|
|
@@ -74,12 +78,19 @@ export function judgeBand(m, band, venue, each) {
|
|
|
74
78
|
}
|
|
75
79
|
/** The band words every message shares: the rate, and where the venue's anchors put it. */
|
|
76
80
|
const AGAINST = "{{rate}} per 10,000 words; {{venue}}'s {{anchors}} anchor papers measure {{anchorMin}}–{{anchorMax}}, and this rule warns outside {{min}}–{{max}}";
|
|
81
|
+
/** The band words of the share of sentences: a percent, and where the anchors put it. */
|
|
82
|
+
const AGAINST_SHARE = "{{rate}}% of its {{sentences}} sentences; {{venue}}'s {{anchors}} anchor papers measure {{anchorMin}}–{{anchorMax}}%, and this rule warns outside {{min}}–{{max}}%";
|
|
83
|
+
/** A measure per 10,000 words, its band the anchors' counts of `name`. */
|
|
84
|
+
const perWords = (name) => ({
|
|
85
|
+
rate: (count, words) => rateOf(count, words),
|
|
86
|
+
band: (anchors) => bandOf(anchors, name),
|
|
87
|
+
});
|
|
77
88
|
const MEASURES = {
|
|
78
89
|
"contrast-frames": {
|
|
79
|
-
|
|
90
|
+
...perWords("contrast_frames"),
|
|
80
91
|
description: "contrast frames («X, not Y», «rather than», «instead of») stay within the rate the venue's accepted papers show",
|
|
81
92
|
each: true,
|
|
82
|
-
count: (b) => contrastFrames(
|
|
93
|
+
count: (b) => contrastFrames(b.sentences),
|
|
83
94
|
messages: {
|
|
84
95
|
above: `{{count}} contrast frames («X, not Y», «not X but Y», «rather than», «instead of», «as opposed to») — ${AGAINST}. First: {{examples}}. Say what the thing is and why, with the evidence; keep a frame only where a reader would otherwise assume the rejected alternative`,
|
|
85
96
|
below: `{{count}} contrast frames — ${AGAINST}. A rewrite may have dropped relations the argument needs: check that each claim still says what it is set against`,
|
|
@@ -87,7 +98,7 @@ const MEASURES = {
|
|
|
87
98
|
},
|
|
88
99
|
},
|
|
89
100
|
"claim-emphasis": {
|
|
90
|
-
|
|
101
|
+
...perWords("claim_emphasis"),
|
|
91
102
|
description: "claims set in bold inside a sentence stay within the rate the venue's accepted papers show",
|
|
92
103
|
each: true,
|
|
93
104
|
count: (b) => claimEmphasis(b.emphasis()),
|
|
@@ -98,27 +109,47 @@ const MEASURES = {
|
|
|
98
109
|
},
|
|
99
110
|
},
|
|
100
111
|
"relation-markers": {
|
|
101
|
-
|
|
112
|
+
...perWords("relation_markers"),
|
|
102
113
|
description: "words that name how a sentence relates to the one before (because, therefore, however, for example) stay within the rate the venue's accepted papers show",
|
|
103
114
|
each: false,
|
|
104
|
-
count: (b) => relationMarkers(
|
|
115
|
+
count: (b) => relationMarkers(b.sentences),
|
|
105
116
|
messages: {
|
|
106
117
|
below: `{{count}} words name how a sentence relates to the one before (because, therefore, however, in contrast, for example, that is …) — ${AGAINST}. Where two sentences stand side by side, say whether the second is the cause, the consequence, an example or a limit of the first`,
|
|
107
118
|
above: `{{count}} relation markers — ${AGAINST}. First: {{examples}}`,
|
|
108
119
|
},
|
|
109
120
|
},
|
|
121
|
+
"negated-sentences": {
|
|
122
|
+
description: "the share of the body's sentences that hold a negator (not, no, never, without, cannot …) stays within the share the venue's accepted papers show. Off until a project turns it on",
|
|
123
|
+
each: false,
|
|
124
|
+
count: (b) => negatedSentences(b.sentences),
|
|
125
|
+
rate: (count, _words, sentences) => shareOf(count, sentences),
|
|
126
|
+
band: negationBandOf,
|
|
127
|
+
messages: {
|
|
128
|
+
above: `{{count}} sentences hold a negator (not, no, never, without, cannot …) — ${AGAINST_SHARE}. First: {{examples}}. Say what a thing is and does; keep a negation where a reader would otherwise assume the opposite`,
|
|
129
|
+
below: `{{count}} sentences hold a negator — ${AGAINST_SHARE}`,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
110
132
|
};
|
|
111
133
|
/** What a body measures for a rule: its words, its occurrences, and where it starts. */
|
|
112
134
|
export function measureBody(rule, src, latex) {
|
|
113
135
|
const passages = latex.bodyProse(src);
|
|
114
136
|
const [first] = passages;
|
|
115
|
-
const body =
|
|
137
|
+
const body = bodyOf(passages, src, latex);
|
|
138
|
+
const words = wordsOf(body.sentences);
|
|
139
|
+
const occurrences = MEASURES[rule].count(body);
|
|
116
140
|
return {
|
|
117
|
-
words
|
|
118
|
-
|
|
141
|
+
words,
|
|
142
|
+
sentences: body.sentences.length,
|
|
143
|
+
occurrences,
|
|
144
|
+
rate: MEASURES[rule].rate(occurrences.length, words, body.sentences.length),
|
|
119
145
|
at: first === undefined ? null : startOf(first),
|
|
120
146
|
};
|
|
121
147
|
}
|
|
148
|
+
/** The body as the measures read it. */
|
|
149
|
+
const bodyOf = (passages, src, latex) => ({
|
|
150
|
+
sentences: bodySentences(passages),
|
|
151
|
+
emphasis: () => latex.bodyEmphasis(src),
|
|
152
|
+
});
|
|
122
153
|
/** Which rule counts each measure an anchor records. */
|
|
123
154
|
const RULE_OF = {
|
|
124
155
|
contrast_frames: "contrast-frames",
|
|
@@ -130,17 +161,20 @@ const RULE_OF = {
|
|
|
130
161
|
* measure, by the rules' own counters — the one way an anchor is measured.
|
|
131
162
|
*/
|
|
132
163
|
export function anchorOf(paper, src, latex) {
|
|
133
|
-
const
|
|
134
|
-
const body = { passages, emphasis: () => latex.bodyEmphasis(src) };
|
|
164
|
+
const body = bodyOf(latex.bodyProse(src), src, latex);
|
|
135
165
|
const count = (m) => MEASURES[RULE_OF[m]].count(body).length;
|
|
136
166
|
return {
|
|
137
167
|
paper,
|
|
138
|
-
words: wordsOf(
|
|
168
|
+
words: wordsOf(body.sentences),
|
|
139
169
|
counts: {
|
|
140
170
|
contrast_frames: count("contrast_frames"),
|
|
141
171
|
claim_emphasis: count("claim_emphasis"),
|
|
142
172
|
relation_markers: count("relation_markers"),
|
|
143
173
|
},
|
|
174
|
+
negation: {
|
|
175
|
+
sentences: body.sentences.length,
|
|
176
|
+
negated: negatedSentences(body.sentences).length,
|
|
177
|
+
},
|
|
144
178
|
};
|
|
145
179
|
}
|
|
146
180
|
/** The findings for the paper whose `paper.tex` is `filename`; none when its preset has no anchors. */
|
|
@@ -149,7 +183,7 @@ function judgePaper(name, context, deps) {
|
|
|
149
183
|
if (p.kind !== "resolved")
|
|
150
184
|
return;
|
|
151
185
|
const measure = MEASURES[name];
|
|
152
|
-
const band =
|
|
186
|
+
const band = measure.band(p.preset.registerAnchors);
|
|
153
187
|
if (band === null)
|
|
154
188
|
return;
|
|
155
189
|
const sc = context.sourceCode;
|
|
@@ -179,15 +213,20 @@ function rule(name, deps) {
|
|
|
179
213
|
},
|
|
180
214
|
};
|
|
181
215
|
}
|
|
182
|
-
/** The
|
|
216
|
+
/** The four rules, as rules of the `tex` plugin. */
|
|
183
217
|
export function registerBandRules(deps) {
|
|
184
218
|
return {
|
|
185
219
|
"contrast-frames": rule("contrast-frames", deps),
|
|
186
220
|
"claim-emphasis": rule("claim-emphasis", deps),
|
|
187
221
|
"relation-markers": rule("relation-markers", deps),
|
|
222
|
+
"negated-sentences": rule("negated-sentences", deps),
|
|
188
223
|
};
|
|
189
224
|
}
|
|
190
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* The level each rule is on at in paperlint's own config, for every `paper.tex`. `tex/negated-sentences`
|
|
227
|
+
* is not here: a writing measure added after the default set was fixed to what the venue decides,
|
|
228
|
+
* it ships off.
|
|
229
|
+
*/
|
|
191
230
|
export const REGISTER_BAND_RULE_LEVELS = {
|
|
192
231
|
"tex/contrast-frames": "warn",
|
|
193
232
|
"tex/claim-emphasis": "warn",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-bands.js","sourceRoot":"","sources":["../src/register-bands.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"register-bands.js","sourceRoot":"","sources":["../src/register-bands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,eAAe,EACf,OAAO,EACP,OAAO,GAMR,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EACL,WAAW,GAIZ,MAAM,sBAAsB,CAAC;AA2B9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,IAAU,EAAY,EAAE,CAC/D,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,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;AACH,MAAM,CAAC,MAAM,yBAAyB,GAElC;IACF,qBAAqB,EAAE,MAAM;IAC7B,oBAAoB,EAAE,MAAM;IAC5B,sBAAsB,EAAE,MAAM;CAC/B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ProseDeps } from "#src/tex-paper";
|
|
2
|
+
/** The paper's headings, in order, as a reader sees their titles. */
|
|
3
|
+
export declare const headingsOf: (file: string, src: string, deps: ProseDeps) => readonly string[];
|
|
4
|
+
/** What the command prints for the headings of `name`. */
|
|
5
|
+
export declare const listing: (name: string, headings: readonly string[]) => string;
|
|
6
|
+
/** Where the command writes: the list, and what stops it. */
|
|
7
|
+
export interface Output {
|
|
8
|
+
readonly out: (s: string) => void;
|
|
9
|
+
readonly err: (s: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/** Run the command on `argv`; the exit code. */
|
|
12
|
+
export declare function main(argv: readonly string[], deps: ProseDeps, { out, err }: Output): number;
|
|
@@ -7,6 +7,11 @@ export declare const DEFAULT_MAX = 15;
|
|
|
7
7
|
* reader before).
|
|
8
8
|
*/
|
|
9
9
|
export interface Paragraph {
|
|
10
|
+
/**
|
|
11
|
+
* First and last line: of the main file in a diff read; of the spliced paper in a `--whole` read,
|
|
12
|
+
* so not a line of any one file there. They only order the paragraphs and are never printed:
|
|
13
|
+
* the paragraph's quoted text is what the author searches for in the source.
|
|
14
|
+
*/
|
|
10
15
|
readonly start: number;
|
|
11
16
|
readonly end: number;
|
|
12
17
|
readonly text: string;
|
|
@@ -37,6 +42,8 @@ interface Options {
|
|
|
37
42
|
readonly paper: string;
|
|
38
43
|
readonly base: string;
|
|
39
44
|
readonly max: number;
|
|
45
|
+
/** Every paragraph of the paper, in chunks of `max`, instead of the diff since `base`. */
|
|
46
|
+
readonly whole: boolean;
|
|
40
47
|
/** With a venue, the output is both readers' whole prompts, not the bare extract. */
|
|
41
48
|
readonly venue: string | undefined;
|
|
42
49
|
}
|
|
@@ -44,6 +51,11 @@ interface Options {
|
|
|
44
51
|
export declare const optionsOf: (argv: readonly string[]) => Options;
|
|
45
52
|
/** The paragraphs as a reader gets them: numbered, a heading marked, one blank line apart, nothing else. */
|
|
46
53
|
export declare const numbered: (paragraphs: readonly Paragraph[]) => string;
|
|
54
|
+
/**
|
|
55
|
+
* The whole paper in chunks of at most `max` paragraphs, each under its own `=== chunk i of n ===`
|
|
56
|
+
* line, numbered from ¶1 again; with a venue, each chunk's two prompts. One pair of readers per chunk.
|
|
57
|
+
*/
|
|
58
|
+
export declare const chunked: (found: readonly Paragraph[], max: number, venue: string | undefined) => string;
|
|
47
59
|
/** The command. Returns its exit code; a refusal is one line on stderr and exit 2. */
|
|
48
60
|
export declare function main(argv: readonly string[]): number;
|
|
49
61
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* readers.ts — the two cold readers' prompts: the one place their text lives. `cold-read-diff`'s
|
|
3
3
|
* SKILL.md interpolates them, `cold-read.js --venue=NAME` prints them around the extract ready to
|
|
4
|
-
* hand to a subagent
|
|
4
|
+
* hand to a subagent (with `--whole`, around each chunk of the whole paper), and `pc-panel-review`
|
|
5
|
+
* seats the reviewer. Before
|
|
5
6
|
* this file the personas were written out in three places that had drifted apart (#463).
|
|
6
7
|
*/
|
|
7
8
|
/** What both readers are told first: what the text is. */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BodySentence } from "./domain/register.ts";
|
|
2
|
+
import { type Definition, type TermOptions } from "./domain/term-definitions.ts";
|
|
3
|
+
import type { PaperSource } from "./domain/paper-source.ts";
|
|
4
|
+
import type { Span } from "./domain/tex-document.ts";
|
|
5
|
+
import { type ProseDeps } from "./tex-paper.ts";
|
|
6
|
+
import { type Located, type TexRuleModule } from "./tex-venue-rules.ts";
|
|
7
|
+
export type TermRuleName = "term-before-definition" | "term-defined-twice";
|
|
8
|
+
/** The options the config sets, the defaults for the rest: ESLint has validated them against the schema. */
|
|
9
|
+
export declare function termOptionsOf(options: readonly unknown[] | undefined): TermOptions;
|
|
10
|
+
/** The body as both rules read it: its definitions, its sentences, the abstract, where it starts. */
|
|
11
|
+
interface Read {
|
|
12
|
+
readonly paper: PaperSource;
|
|
13
|
+
readonly opts: TermOptions;
|
|
14
|
+
readonly defs: readonly Definition[];
|
|
15
|
+
readonly sentences: readonly BodySentence[];
|
|
16
|
+
readonly abstract: Span | null;
|
|
17
|
+
readonly start: Span | null;
|
|
18
|
+
}
|
|
19
|
+
/** `tex/term-before-definition`'s findings: each term at its first earlier use, or that it checks nothing. */
|
|
20
|
+
export declare function judgeBefore(r: Read): readonly Located[];
|
|
21
|
+
/** `tex/term-defined-twice`'s findings: each later definition, against the first. */
|
|
22
|
+
export declare const judgeAgain: (r: Read) => readonly Located[];
|
|
23
|
+
/** The two rules, as rules of the `tex` plugin. Not on in any default config. */
|
|
24
|
+
export declare const termDefinitionRules: (deps: ProseDeps) => Readonly<Record<TermRuleName, TexRuleModule>>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=term-definition-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term-definition-rules.d.ts","sourceRoot":"","sources":["../src/term-definition-rules.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAML,KAAK,UAAU,EACf,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,YAAY,GAAG,wBAAwB,GAAG,oBAAoB,CAAC;AA0B3E,4GAA4G;AAC5G,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,GACtC,WAAW,CAWb;AAED,qGAAqG;AACrG,UAAU,IAAI;IACZ,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;CAC7B;AAmBD,8GAA8G;AAC9G,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,OAAO,EAAE,CAsBvD;AAED,qFAAqF;AACrF,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,KAAG,SAAS,OAAO,EAKhD,CAAC;AAgCN,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,GAC9B,MAAM,SAAS,KACd,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,CAG7C,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A TERM AGAINST ITS DEFINITION — two rules of the `tex` plugin over the body, off by default:
|
|
3
|
+
*
|
|
4
|
+
* tex/term-before-definition a term the body defines (an `\emph` phrase, by default) is used
|
|
5
|
+
* before that definition: reported once, at the first earlier use
|
|
6
|
+
* tex/term-defined-twice a term is set as a definition again: reported at each later one
|
|
7
|
+
*
|
|
8
|
+
* Two rules, not one: an author may keep an introduction's gloss and a Method paragraph that both
|
|
9
|
+
* define a word, and still want to know where a word comes before its meaning. What a definition
|
|
10
|
+
* and a use are is `src/domain/term-definitions.ts`.
|
|
11
|
+
*
|
|
12
|
+
* ── OFF BY DEFAULT ───────────────────────────────────────────────────────────────
|
|
13
|
+
* The rules are right only for a paper that marks its definitions with the commands they read.
|
|
14
|
+
* On 113 papers by other authors, most italic phrases stress a word or label an item, and the rules
|
|
15
|
+
* report something in 52 of them; the measurement is on the rules' pages. A project that follows
|
|
16
|
+
* the convention turns them on.
|
|
17
|
+
*
|
|
18
|
+
* ── WHAT THEY READ ───────────────────────────────────────────────────────────────
|
|
19
|
+
* `paper.tex` with its includes spliced (`readPaper`), through the `LatexReader` port: the phrases
|
|
20
|
+
* emphasised in the body (`bodyEmphasis`), its sentences (`bodyProse`), and where the abstract is.
|
|
21
|
+
*/
|
|
22
|
+
import { hasAtLeast, isNumber, isString } from "remeda";
|
|
23
|
+
import { bodySentences } from "./domain/register.js";
|
|
24
|
+
import { fieldOf } from "./domain/record.js";
|
|
25
|
+
import { DEFAULT_TERM_OPTIONS, definedAgain, definitionsOf, EMPHASIS_COMMANDS, usedBefore, } from "./domain/term-definitions.js";
|
|
26
|
+
import { startOf } from "./register.js";
|
|
27
|
+
import { readPaper, reportInPaper, whereIn, } from "./tex-paper.js";
|
|
28
|
+
import { ruleDocsUrl, } from "./tex-venue-rules.js";
|
|
29
|
+
const MESSAGES = {
|
|
30
|
+
before: "«{{term}}» is used here before its definition (\\{{command}} at {{where}}; {{count}} earlier use(s) outside the abstract). Move the definition to this first use, or say here in plain words what it means.",
|
|
31
|
+
again: "«{{term}}» is set as a definition again; it was first defined at {{where}}. Keep one definition and set later mentions in roman, or point back to the first one.",
|
|
32
|
+
none: "this rule is on, and no term in the body is set with {{commands}}: it checks nothing in this paper. Mark each definition with \\{{first}}, or turn the rule off.",
|
|
33
|
+
};
|
|
34
|
+
const SCHEMA = [
|
|
35
|
+
{
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
commands: {
|
|
39
|
+
type: "array",
|
|
40
|
+
items: { enum: EMPHASIS_COMMANDS },
|
|
41
|
+
minItems: 1,
|
|
42
|
+
uniqueItems: true,
|
|
43
|
+
},
|
|
44
|
+
maxWords: { type: "integer", minimum: 1 },
|
|
45
|
+
},
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
/** The options the config sets, the defaults for the rest: ESLint has validated them against the schema. */
|
|
50
|
+
export function termOptionsOf(options) {
|
|
51
|
+
const o = options?.[0];
|
|
52
|
+
const listed = fieldOf(o, "commands");
|
|
53
|
+
const commands = Array.isArray(listed) ? listed.filter(isString) : [];
|
|
54
|
+
const maxWords = fieldOf(o, "maxWords");
|
|
55
|
+
return {
|
|
56
|
+
commands: hasAtLeast(commands, 1)
|
|
57
|
+
? commands
|
|
58
|
+
: DEFAULT_TERM_OPTIONS.commands,
|
|
59
|
+
maxWords: isNumber(maxWords) ? maxWords : DEFAULT_TERM_OPTIONS.maxWords,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function readBody(context, deps) {
|
|
63
|
+
const sc = context.sourceCode;
|
|
64
|
+
const paper = readPaper(context.filename, sc.raw ?? sc.text, deps);
|
|
65
|
+
const opts = termOptionsOf(context.options);
|
|
66
|
+
const abstract = deps.latex.abstractSpan(paper.text);
|
|
67
|
+
const passages = deps.latex.bodyProse(paper.text);
|
|
68
|
+
const [first] = passages;
|
|
69
|
+
return {
|
|
70
|
+
paper,
|
|
71
|
+
opts,
|
|
72
|
+
defs: definitionsOf(deps.latex.bodyEmphasis(paper.text), opts, abstract),
|
|
73
|
+
sentences: bodySentences(passages),
|
|
74
|
+
abstract,
|
|
75
|
+
start: first === undefined ? null : startOf(first),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** `tex/term-before-definition`'s findings: each term at its first earlier use, or that it checks nothing. */
|
|
79
|
+
export function judgeBefore(r) {
|
|
80
|
+
if (r.defs.length === 0)
|
|
81
|
+
return [
|
|
82
|
+
{
|
|
83
|
+
messageId: "none",
|
|
84
|
+
data: {
|
|
85
|
+
commands: r.opts.commands.map((c) => `\\${c}`).join(", "),
|
|
86
|
+
first: r.opts.commands[0],
|
|
87
|
+
},
|
|
88
|
+
at: r.start,
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
return usedBefore(r.defs, r.sentences, r.abstract).map((u) => ({
|
|
92
|
+
messageId: "before",
|
|
93
|
+
data: {
|
|
94
|
+
term: u.term,
|
|
95
|
+
command: u.definition.command,
|
|
96
|
+
where: whereIn(r.paper, u.definition.span),
|
|
97
|
+
count: u.count,
|
|
98
|
+
},
|
|
99
|
+
at: u.firstUse,
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
/** `tex/term-defined-twice`'s findings: each later definition, against the first. */
|
|
103
|
+
export const judgeAgain = (r) => definedAgain(r.defs).map((d) => ({
|
|
104
|
+
messageId: "again",
|
|
105
|
+
data: { term: d.again.text, where: whereIn(r.paper, d.first.span) },
|
|
106
|
+
at: d.again.span,
|
|
107
|
+
}));
|
|
108
|
+
const DESCRIPTIONS = {
|
|
109
|
+
"term-before-definition": "a term the body defines (an \\emph phrase, by default) is not used before that definition. Off until a project turns it on",
|
|
110
|
+
"term-defined-twice": "a term the body defines is set as a definition once. Off until a project turns it on",
|
|
111
|
+
};
|
|
112
|
+
const JUDGES = {
|
|
113
|
+
"term-before-definition": judgeBefore,
|
|
114
|
+
"term-defined-twice": judgeAgain,
|
|
115
|
+
};
|
|
116
|
+
const rule = (name, deps) => ({
|
|
117
|
+
meta: {
|
|
118
|
+
type: "suggestion",
|
|
119
|
+
docs: { description: DESCRIPTIONS[name], url: ruleDocsUrl(name) },
|
|
120
|
+
schema: SCHEMA,
|
|
121
|
+
messages: MESSAGES,
|
|
122
|
+
},
|
|
123
|
+
create(context) {
|
|
124
|
+
return {
|
|
125
|
+
root() {
|
|
126
|
+
const r = readBody(context, deps);
|
|
127
|
+
reportInPaper(context, MESSAGES, r.paper, JUDGES[name](r));
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
/** The two rules, as rules of the `tex` plugin. Not on in any default config. */
|
|
133
|
+
export const termDefinitionRules = (deps) => ({
|
|
134
|
+
"term-before-definition": rule("term-before-definition", deps),
|
|
135
|
+
"term-defined-twice": rule("term-defined-twice", deps),
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingURL=term-definition-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term-definition-rules.js","sourceRoot":"","sources":["../src/term-definition-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,UAAU,GAGX,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,aAAa,EACb,OAAO,GAER,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,GAIZ,MAAM,sBAAsB,CAAC;AAI9B,MAAM,QAAQ,GAAG;IACf,MAAM,EACJ,6MAA6M;IAC/M,KAAK,EACH,kKAAkK;IACpK,IAAI,EAAE,kKAAkK;CACzK,CAAC;AAEF,MAAM,MAAM,GAAG;IACb;QACE,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;gBAClC,QAAQ,EAAE,CAAC;gBACX,WAAW,EAAE,IAAI;aAClB;YACD,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;SAC1C;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC;AAEF,4GAA4G;AAC5G,MAAM,UAAU,aAAa,CAC3B,OAAuC;IAEvC,MA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wBAAwB,EAAE,IAAI,CAAC;IAC9D,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC;CACvD,CAAC,CAAC"}
|
package/dist/tex-paper.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type PaperSource } from "./domain/paper-source.ts";
|
|
2
|
+
import type { Span } from "./domain/tex-document.ts";
|
|
2
3
|
import type { LatexReader } from "./ports/latex.ts";
|
|
3
4
|
import type { Files } from "./ports/files.ts";
|
|
4
5
|
import { type RecordReadDeps } from "./paper-record.ts";
|
|
@@ -20,6 +21,11 @@ export declare const decoded: (b: Uint8Array | null) => string | null;
|
|
|
20
21
|
export declare function readPaper(filename: string, src: string, deps: ProseDeps): PaperSource;
|
|
21
22
|
/** Line and column (1-based) of an offset in a text. */
|
|
22
23
|
export declare function lineColumn(text: string, at: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* Where a span of the assembled text stands, as an author looks for it: `paper.tex:151`, or the
|
|
26
|
+
* included file and its line (`sections/intro.tex:12`). A span outside the text names the main file.
|
|
27
|
+
*/
|
|
28
|
+
export declare function whereIn(paper: PaperSource, at: Span): string;
|
|
23
29
|
/** A finding's message as ESLint prints it; an id the rule does not define is printed as itself. */
|
|
24
30
|
export declare const findingText: (messages: Readonly<Record<string, string>>, f: Located) => string;
|
|
25
31
|
/**
|
package/dist/tex-paper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tex-paper.d.ts","sourceRoot":"","sources":["../src/tex-paper.ts"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"tex-paper.d.ts","sourceRoot":"","sources":["../src/tex-paper.ts"],"names":[],"mappings":"AAkBA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrD,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ist/tex-paper.js
CHANGED
|
@@ -48,6 +48,16 @@ export function lineColumn(text, at) {
|
|
|
48
48
|
const column = at - text.lastIndexOf("\n", at - 1);
|
|
49
49
|
return `${String(line)}:${String(column)}`;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Where a span of the assembled text stands, as an author looks for it: `paper.tex:151`, or the
|
|
53
|
+
* included file and its line (`sections/intro.tex:12`). A span outside the text names the main file.
|
|
54
|
+
*/
|
|
55
|
+
export function whereIn(paper, at) {
|
|
56
|
+
const o = originOf(paper, at);
|
|
57
|
+
return o === null
|
|
58
|
+
? paper.main
|
|
59
|
+
: `${o.file}:${String(o.source.slice(0, o.span.start).split("\n").length)}`;
|
|
60
|
+
}
|
|
51
61
|
/** A message template with its data filled in, the way ESLint fills it. */
|
|
52
62
|
const filled = (template, data = {}) => Object.entries(data).reduce((m, [k, v]) => m.replaceAll(`{{${k}}}`, String(v)), template);
|
|
53
63
|
/** A finding's message as ESLint prints it; an id the rule does not define is printed as itself. */
|
package/dist/tex-paper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tex-paper.js","sourceRoot":"","sources":["../src/tex-paper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,aAAa,EACb,QAAQ,GAET,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAuB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAYvD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAoB,EAAiB,EAAE,CAC7D,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW,EA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;QAC9B,MAAM,KAAK,GAAG;YACZ,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC;YAC5B,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;SACzB,CAAC;QACF,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI;YACjB,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;;YAErE,OAAO,CAAC,MAAM,CAAC;gBACb,GAAG,EAAE,KAAK;gBACV,kFAAkF;gBAClF,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE;aAClD,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -97,6 +97,8 @@ export interface PresetFile {
|
|
|
97
97
|
readonly identity: PresetIdentity;
|
|
98
98
|
/** The preset this one builds on: `paperlint:<name>` or a relative path. */
|
|
99
99
|
readonly extends: string | null;
|
|
100
|
+
/** The conference a workshop is held at, spelled as `extends` is; null when the file names none. */
|
|
101
|
+
readonly parent: string | null;
|
|
100
102
|
/** The `\\documentclass` the venue's template uses, as the file spells it; null when it names none. */
|
|
101
103
|
readonly template: string | null;
|
|
102
104
|
/** Class options the venue forbids, read with `template`; empty when the file names none. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tex-requirements.d.ts","sourceRoot":"","sources":["../src/tex-requirements.ts"],"names":[],"mappings":"AA0BA,OAAO,GAAG,MAAM,KAAK,CAAC;AAItB,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,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,
|
|
199
199
|
relation_markers: a.relation_markers,
|
|
200
200
|
},
|
|
201
|
+
...(a.sentences === undefined || a.negated_sentences === undefined
|
|
202
|
+
? {}
|
|
203
|
+
: {
|
|
204
|
+
negation: {
|
|
205
|
+
sentences: a.sentences,
|
|
206
|
+
negated: a.negated_sentences,
|
|
207
|
+
},
|
|
208
|
+
}),
|
|
201
209
|
}));
|
|
202
210
|
/** A preset's `portal`, or null when it names none. */
|
|
203
211
|
const portalOf = (p) => p === undefined ? null : { kind: p.kind, url: p.url };
|
|
@@ -242,6 +250,7 @@ export function parsePreset(text, file, dir = presetsDir()) {
|
|
|
242
250
|
return {
|
|
243
251
|
identity: identityOf(j),
|
|
244
252
|
extends: orNull(j.extends),
|
|
253
|
+
parent: orNull(j.parent),
|
|
245
254
|
template: orNull(j.template),
|
|
246
255
|
templateForbids: j.template_forbids ?? [],
|
|
247
256
|
aliases: j.aliases ?? [],
|