paperlint 2.0.0 → 2.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/.github/workflows/ci.yml +4 -4
- package/CLAUDE.md +3 -3
- package/CONTRIBUTING.md +21 -0
- package/LICENSE +1 -1
- package/README.md +81 -24
- package/action.harness.mjs +10 -10
- package/action.mutations.mjs +3 -3
- package/action.yml +11 -11
- package/bin/{rpp.mjs → paperlint.mjs} +2 -2
- package/dist/adapters/banal/invocation.js +3 -3
- package/dist/adapters/banal/invocation.js.map +1 -1
- package/dist/adapters/banal/run.d.ts +1 -1
- package/dist/adapters/banal/run.js +1 -1
- package/dist/adapters/banal/run.js.map +1 -1
- package/dist/adapters/banal/settings.d.ts +4 -4
- package/dist/adapters/banal/settings.d.ts.map +1 -1
- package/dist/adapters/banal/settings.js +4 -4
- package/dist/adapters/banal/settings.js.map +1 -1
- package/dist/adapters/banal/xml.js +1 -1
- package/dist/adapters/banal/xml.js.map +1 -1
- package/dist/adapters/curl/download.io.d.ts.map +1 -1
- package/dist/adapters/curl/download.io.js +2 -2
- package/dist/adapters/curl/download.io.js.map +1 -1
- package/dist/build-engine.d.ts +1 -1
- package/dist/build-engine.d.ts.map +1 -1
- package/dist/build-engine.js +6 -3
- package/dist/build-engine.js.map +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +5 -4
- package/dist/build.js.map +1 -1
- package/dist/cli.d.ts +29 -30
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +174 -98
- package/dist/cli.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +21 -6
- package/dist/doctor.js.map +1 -1
- package/dist/engine.d.ts +2 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +1 -1
- package/dist/facts-file.d.ts +33 -9
- package/dist/facts-file.d.ts.map +1 -1
- package/dist/facts-file.js +117 -17
- package/dist/facts-file.js.map +1 -1
- package/dist/hooks-settings.d.ts +0 -18
- package/dist/hooks-settings.d.ts.map +1 -1
- package/dist/hooks-settings.js +70 -42
- package/dist/hooks-settings.js.map +1 -1
- package/dist/init.d.ts +13 -10
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +74 -42
- package/dist/init.js.map +1 -1
- package/dist/link-skills.js +2 -2
- package/dist/link-skills.js.map +1 -1
- package/dist/new-paper.d.ts +2 -2
- package/dist/new-paper.d.ts.map +1 -1
- package/dist/new-paper.js +17 -2
- package/dist/new-paper.js.map +1 -1
- package/dist/paper-settings.d.ts +68 -0
- package/dist/paper-settings.d.ts.map +1 -0
- package/dist/paper-settings.js +144 -0
- package/dist/paper-settings.js.map +1 -0
- package/dist/presets.d.ts +84 -0
- package/dist/presets.d.ts.map +1 -0
- package/dist/presets.js +186 -0
- package/dist/presets.js.map +1 -0
- package/dist/rules-config.d.ts +8 -1
- package/dist/rules-config.d.ts.map +1 -1
- package/dist/rules-config.js +13 -8
- package/dist/rules-config.js.map +1 -1
- package/dist/structure.d.ts.map +1 -1
- package/dist/structure.js +2 -1
- package/dist/structure.js.map +1 -1
- package/dist/tex-requirements.d.ts +63 -7
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +91 -24
- package/dist/tex-requirements.js.map +1 -1
- package/dist/toolchain.d.ts +2 -2
- package/dist/toolchain.d.ts.map +1 -1
- package/dist/toolchain.js +8 -8
- package/dist/toolchain.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/venue-rules.d.ts +109 -0
- package/dist/venue-rules.d.ts.map +1 -0
- package/dist/venue-rules.js +387 -0
- package/dist/venue-rules.js.map +1 -0
- package/docs/configuration.md +73 -17
- package/docs/e2e.md +3 -4
- package/docs/install.md +11 -3
- package/docs/optional-rules.md +26 -25
- package/docs/rules.md +132 -3
- package/docs/toolchain.md +5 -5
- package/eslint-rules/paper-typography.mjs +1 -1
- package/eslint-rules/paper-typography.mutations.mjs +1 -1
- package/eslint-rules/papers.mjs +6 -2
- package/eslint-rules/pdf-last-page-balance.harness.mjs +5 -3
- package/eslint-rules/pdf-last-page-balance.mjs +23 -2
- package/fixtures/build-e2e/acmart/paperlint.json +1 -0
- package/fixtures/build-e2e/guards/paper.tex +1 -1
- package/fixtures/pdf-facts/README.md +1 -1
- package/fixtures/real-markdown-paper/baseline.json +1 -1
- package/fixtures/real-markdown-paper/baseline.mjs +2 -2
- package/fixtures/toolchain-mirror/install-tl +2 -2
- package/fixtures/toolchain-mirror/stub-pdflatex +1 -1
- package/fixtures/toolchain-mirror/stub-tlmgr +1 -1
- package/hooks/hooks.harness.mjs +1 -1
- package/lib/paper-config.d.mts +7 -0
- package/lib/paper-config.harness.mjs +3 -3
- package/lib/paper-config.mjs +34 -3
- package/lib/skill-trigger-cases.harness.mjs +1 -1
- package/package.json +4 -4
- package/plugin/hooks/hooks.json +3 -3
- package/scripts/check.mjs +1 -1
- package/scripts/harness-api.frozen.json +1 -1
- package/scripts/harness-api.test.ts +2 -2
- package/scripts/layer-legacy.frozen.json +1 -1
- package/scripts/mutation-batteries-frozen.harness.mjs +1 -1
- package/scripts/mutation-batteries.frozen.json +2 -2
- package/scripts/release-config.test.ts +1 -1
- package/skills/find-venue/SKILL.md +5 -1
- package/skills/find-venue/SKILL.md.spec.ts +4 -0
- package/skills/paper-pipeline/PIPELINE-MAP.md +14 -4
- package/skills/paper-pipeline/SKILL.md +4 -3
- package/skills/paper-pipeline/SKILL.md.spec.ts +3 -2
- package/skills/paper-pipeline/description-language.eval.mjs +1 -1
- package/skills/paper-pipeline/framing-vs-vocabulary.eval.mjs +1 -1
- package/skills/paper-pipeline/grade-paper-writing-ablation.eval.mjs +2 -2
- package/skills/paper-pipeline/pipeline-firing.eval.mjs +1 -1
- package/skills/paper-pipeline/pipeline-language.eval.mjs +1 -1
- package/skills/paper-pipeline/scripts/consumer.d.mts +1 -0
- package/skills/paper-pipeline/scripts/consumer.harness.mjs +10 -4
- package/skills/paper-pipeline/scripts/consumer.mjs +8 -1
- package/skills/paper-pipeline/scripts/consumer.mutations.mjs +1 -1
- package/skills/render-paper/SKILL.md +3 -3
- package/skills/render-paper/SKILL.md.spec.ts +2 -2
- package/skills/render-paper/extract-pdf-facts.harness.mjs +6 -6
- package/skills/render-paper/extract-pdf-facts.mjs +4 -4
- package/skills/study-accepted-papers/SKILL.md +2 -1
- package/skills/study-accepted-papers/SKILL.md.spec.ts +1 -0
- package/skills/submit-paper/SKILL.md +9 -1
- package/skills/submit-paper/SKILL.md.spec.ts +8 -0
- package/skills/submit-paper/references/venues/acm-sigconf.jsonc +86 -0
- package/skills/submit-paper/references/venues/agenticdev.jsonc +34 -102
- package/skills/submit-paper/references/venues/aisec.jsonc +21 -82
- package/skills/submit-paper/references/venues/realm.jsonc +45 -43
- package/skills/submit-paper/references/venues/tex-base.jsonc +1 -1
- package/skills/submit-paper/references/venues/venue-profile.schema.json +120 -30
- package/src/adapters/banal/index.test.ts +1 -1
- package/src/adapters/banal/invocation.test.ts +3 -3
- package/src/adapters/banal/invocation.ts +3 -3
- package/src/adapters/banal/locate.test.ts +4 -4
- package/src/adapters/banal/run.ts +2 -2
- package/src/adapters/banal/settings.test.ts +12 -6
- package/src/adapters/banal/settings.ts +9 -5
- package/src/adapters/banal/xml.test.ts +1 -1
- package/src/adapters/banal/xml.ts +1 -1
- package/src/adapters/curl/download.io.ts +4 -2
- package/src/adapters/curl/download.test.ts +3 -1
- package/src/adapters/node/files.test.ts +1 -1
- package/src/adapters/node/process.test.ts +2 -2
- package/src/adapters/node/workspace.test.ts +4 -4
- package/src/build-engine.harness.mjs +2 -2
- package/src/build-engine.ts +11 -3
- package/src/build.harness.mjs +27 -22
- package/src/build.mutations.mjs +3 -2
- package/src/build.ts +6 -5
- package/src/cli.harness.mjs +72 -131
- package/src/cli.mutations.mjs +7 -32
- package/src/cli.ts +204 -121
- package/src/doctor.harness.mjs +9 -25
- package/src/doctor.ts +28 -5
- package/src/engine.harness.mjs +4 -2
- package/src/engine.ts +2 -2
- package/src/facts-file.test.ts +54 -7
- package/src/facts-file.ts +145 -24
- package/src/hooks-settings.harness.mjs +24 -15
- package/src/hooks-settings.mutations.mjs +2 -4
- package/src/hooks-settings.ts +92 -49
- package/src/init.ts +88 -52
- package/src/latex-log.harness.mjs +1 -1
- package/src/link-skills.harness.mjs +3 -1
- package/src/link-skills.mutations.mjs +1 -1
- package/src/link-skills.ts +2 -2
- package/src/new-paper.harness.mjs +10 -7
- package/src/new-paper.test.ts +145 -0
- package/src/new-paper.ts +22 -2
- package/src/paper-settings-commands.test.ts +311 -0
- package/src/paper-settings.test.ts +220 -0
- package/src/paper-settings.ts +206 -0
- package/src/pdf-facts.harness.mjs +1 -1
- package/src/presets.test.ts +236 -0
- package/src/presets.ts +307 -0
- package/src/rules-config.ts +14 -9
- package/src/structure.harness.mjs +4 -4
- package/src/structure.ts +2 -1
- package/src/tex-requirements.harness.mjs +12 -18
- package/src/tex-requirements.ts +179 -29
- package/src/toolchain.harness.mjs +34 -25
- package/src/toolchain.ts +14 -8
- package/src/types.ts +4 -4
- package/src/venue-rules.test.ts +545 -0
- package/src/venue-rules.ts +573 -0
- package/templates/paper/paperlint.json +4 -0
- package/fixtures/build-e2e/acmart/venue.json +0 -1
- package/plugin/.claude-plugin/plugin.json +0 -8
package/dist/types.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { RuleBlock } from "./rules-config.ts";
|
|
|
3
3
|
* The shapes the CLI commands exchange. Before the move to TypeScript this was all `{}` and lived
|
|
4
4
|
* in someone's head: a typo in a config key read as "field not set", not as an error.
|
|
5
5
|
*/
|
|
6
|
-
/** The
|
|
7
|
-
export interface
|
|
6
|
+
/** The consumer's settings — the `paperlint` key of its `package.json`. */
|
|
7
|
+
export interface PaperlintConfig {
|
|
8
8
|
/** 🔴 REQUIRED. The paper director(ies), relative to the config file ITSELF. The field name is
|
|
9
9
|
* `PAPERS_DIR_FIELD` in lib/paper-config.mjs; code reads it through `papersDirOf()` in cli.ts. */
|
|
10
10
|
papersDir?: string | string[];
|
|
@@ -26,7 +26,7 @@ export interface RppConfig {
|
|
|
26
26
|
structure?: StructureConfig | false;
|
|
27
27
|
/** REMOVED — `paperlint build` compiles the paper itself. Still typed so a leftover key can be named. */
|
|
28
28
|
buildScripts?: unknown;
|
|
29
|
-
/** ESLint config blocks appended after
|
|
29
|
+
/** ESLint config blocks appended after paperlint's own — PARSED by `parseSettings` in cli.ts. */
|
|
30
30
|
rules?: readonly RuleBlock[];
|
|
31
31
|
}
|
|
32
32
|
export interface StructureConfig {
|
|
@@ -99,7 +99,7 @@ export interface BuildResult {
|
|
|
99
99
|
}
|
|
100
100
|
/** The result of reading the config: either data, or the exit code the caller exits with. */
|
|
101
101
|
export type ConfigRead = {
|
|
102
|
-
opts:
|
|
102
|
+
opts: PaperlintConfig;
|
|
103
103
|
configPath: string | null;
|
|
104
104
|
code?: undefined;
|
|
105
105
|
} | {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AAEH,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC9B;sGACkG;IAClG,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,mFAAmF;IACnF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+FAA+F;IAC/F,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,sFAAsF;IACtF,SAAS,CAAC,EAAE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} from "./tex-requirements.ts";
|
|
3
|
+
import type { FlatGeometry } from "./domain/geometry.ts";
|
|
4
|
+
import type { Files } from "./ports/files.ts";
|
|
5
|
+
/** One finding: the message it prints and the values it fills in. */
|
|
6
|
+
export interface Finding {
|
|
7
|
+
readonly messageId: string;
|
|
8
|
+
readonly data: Readonly<Record<string, string | number>>;
|
|
9
|
+
}
|
|
10
|
+
/** A venue that resolved to a profile: its name, its format, and the kind's limits or why not. */
|
|
11
|
+
export interface Resolved {
|
|
12
|
+
readonly venue: string;
|
|
13
|
+
readonly format: VenueFormat;
|
|
14
|
+
readonly kind: {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly limits: KindLimits;
|
|
17
|
+
} | null;
|
|
18
|
+
/** Why the kind did not resolve — `pdf/profile` reports it — or null. */
|
|
19
|
+
readonly kindProblem: Finding | null;
|
|
20
|
+
}
|
|
21
|
+
/** Everything the rules need to know about one paper, decided once. */
|
|
22
|
+
export type Assessment = {
|
|
23
|
+
readonly kind: "no-venue";
|
|
24
|
+
}
|
|
25
|
+
/** A `paperlint.json` that extends no preset yet — `pdf/measured` names the file to set. */
|
|
26
|
+
| {
|
|
27
|
+
readonly kind: "no-preset";
|
|
28
|
+
readonly file: string;
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: "unresolved";
|
|
31
|
+
readonly finding: Finding;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: "unbuilt";
|
|
34
|
+
readonly venue: Resolved;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: "stale";
|
|
37
|
+
readonly finding: Finding;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "ready";
|
|
40
|
+
readonly venue: Resolved;
|
|
41
|
+
readonly facts: ReadFacts;
|
|
42
|
+
};
|
|
43
|
+
export interface VenueRuleDeps {
|
|
44
|
+
readonly files: Files;
|
|
45
|
+
/** The package's venues directory (`packageVenuesDir()`): the shipped presets and their schema. */
|
|
46
|
+
readonly venuesDir: string;
|
|
47
|
+
}
|
|
48
|
+
/** One paper, assessed. Reads through `deps.files` only; never throws on a paper's files. */
|
|
49
|
+
export declare function assessPaper(paperDir: string, deps: VenueRuleDeps): Assessment;
|
|
50
|
+
/** Type 3, not embedded, and each family the venue names missing from every font. */
|
|
51
|
+
export declare function judgeFonts(fonts: readonly FontEntry[], format: VenueFormat, venue: string): Finding[];
|
|
52
|
+
/** Page width and height within `dimTol` inches, and the column count, against the preset. */
|
|
53
|
+
export declare function judgeGeometry(g: FlatGeometry, format: VenueFormat, venue: string, dimTol: number): Finding[];
|
|
54
|
+
/**
|
|
55
|
+
* Body and reference pages against the kind's limits, and the reference font size against the
|
|
56
|
+
* profile's range. The range is about the DECLARED size and banal measures the rendered mode, so
|
|
57
|
+
* it is widened by `body_pt_tol` — the drift the preset itself names — or a correct paper fails.
|
|
58
|
+
*/
|
|
59
|
+
export declare function judgeLimits(g: FlatGeometry, resolved: Resolved): Finding[];
|
|
60
|
+
/** The body font size against `body_pt ± body_pt_tol`. */
|
|
61
|
+
export declare function judgeBodySize(g: FlatGeometry, format: VenueFormat, venue: string): Finding[];
|
|
62
|
+
/** The slice of ESLint's rule context these rules use. */
|
|
63
|
+
export interface VenueRuleContext {
|
|
64
|
+
readonly filename: string;
|
|
65
|
+
/** ESLint's working directory; file names in messages are shown relative to it. */
|
|
66
|
+
readonly cwd?: string;
|
|
67
|
+
readonly sourceCode: {
|
|
68
|
+
readonly text: string;
|
|
69
|
+
};
|
|
70
|
+
readonly options: readonly unknown[];
|
|
71
|
+
report(d: {
|
|
72
|
+
readonly loc: {
|
|
73
|
+
readonly start: {
|
|
74
|
+
line: number;
|
|
75
|
+
column: number;
|
|
76
|
+
};
|
|
77
|
+
readonly end: {
|
|
78
|
+
line: number;
|
|
79
|
+
column: number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly messageId: string;
|
|
83
|
+
readonly data?: Readonly<Record<string, string | number>>;
|
|
84
|
+
}): void;
|
|
85
|
+
}
|
|
86
|
+
export interface VenueRuleModule {
|
|
87
|
+
readonly meta: {
|
|
88
|
+
readonly type: "problem" | "suggestion";
|
|
89
|
+
readonly docs: {
|
|
90
|
+
readonly description: string;
|
|
91
|
+
};
|
|
92
|
+
readonly schema: readonly object[];
|
|
93
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
94
|
+
};
|
|
95
|
+
create(context: VenueRuleContext): {
|
|
96
|
+
root?: () => void;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** How far, in inches, a measured page dimension may be from the preset's. */
|
|
100
|
+
export declare const DEFAULT_DIM_TOL_IN = 0.05;
|
|
101
|
+
export type VenueRuleName = "fresh" | "profile" | "measured" | "fonts" | "geometry" | "limits" | "body-size";
|
|
102
|
+
/**
|
|
103
|
+
* The level each venue rule is on at in paperlint's own config, for every `paper.tex`. One owner:
|
|
104
|
+
* the config reads it, the docs describe it, a consumer overrides it in `rules`.
|
|
105
|
+
*/
|
|
106
|
+
export declare const VENUE_RULE_LEVELS: Readonly<Record<`pdf/${VenueRuleName}`, "error" | "warn">>;
|
|
107
|
+
/** The venue rules, as the rules of the `pdf` plugin (beside `last-page-balance`). */
|
|
108
|
+
export declare function venueRules(deps: VenueRuleDeps): Record<VenueRuleName, VenueRuleModule>;
|
|
109
|
+
//# sourceMappingURL=venue-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"venue-rules.d.ts","sourceRoot":"","sources":["../src/venue-rules.ts"],"names":[],"mappings":"AAoCA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,qEAAqE;AACrE,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC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PDF on disk (not an earlier build)
|
|
5
|
+
* pdf/profile error the preset the paper extends resolves, and the kind it names exists
|
|
6
|
+
* pdf/fonts error every font is embedded, none is Type 3, the venue's families are present
|
|
7
|
+
* pdf/geometry error page size and column count match the preset
|
|
8
|
+
* pdf/limits error body and reference pages within the kind's limit; reference font size
|
|
9
|
+
* pdf/body-size warn body font size within the preset's tolerance
|
|
10
|
+
* pdf/measured warn the venue checks ran at all (a preset is named, facts exist, geometry measured)
|
|
11
|
+
*
|
|
12
|
+
* ── WHAT THEY READ ───────────────────────────────────────────────────────────────
|
|
13
|
+
* Like `pdf/last-page-balance`, they run on a paper's `paper.tex` and judge the files beside it:
|
|
14
|
+
* `paperlint.json` (which preset, which kind), `_build/paper.facts.json` (what `paperlint build`
|
|
15
|
+
* measured) and the PDF the facts name (hashed, never measured). The preset is resolved by
|
|
16
|
+
* `paperPreset` in `src/presets.ts` — the same resolution the build, the toolchain and the lint
|
|
17
|
+
* config use — so there is one answer to "which venue is this paper judged against".
|
|
18
|
+
*
|
|
19
|
+
* The venue is taken from `paperlint.json`, not from the facts: the facts are venue-independent
|
|
20
|
+
* measurements, and a paper whose `paperlint.json` changed after the build is judged against the venue
|
|
21
|
+
* it names now.
|
|
22
|
+
*
|
|
23
|
+
* ── WHO SPEAKS WHEN THE INPUT CANNOT BE JUDGED ───────────────────────────────────
|
|
24
|
+
* One rule per reason, and the others are silent — so a paper gets one finding that says what to
|
|
25
|
+
* do, not six that say the same thing:
|
|
26
|
+
*
|
|
27
|
+
* no paperlint.json every rule silent — a paper from before 2.1.0 (`paperlint new` writes one)
|
|
28
|
+
* extends null / absent pdf/measured (warn) — no venue chosen yet; it names the file to set
|
|
29
|
+
* preset does not resolve pdf/profile (error) — a typo would otherwise switch every check off
|
|
30
|
+
* not built / no facts pdf/measured (warn) — lint often runs before or without a build (the
|
|
31
|
+
* CI action only lints); a warning is printed and does not fail
|
|
32
|
+
* facts about another PDF pdf/fresh (error) — judging them would judge an earlier build
|
|
33
|
+
* no geometry (no banal) pdf/measured (warn); geometry, limits, body-size silent; fonts still judge
|
|
34
|
+
* kind does not resolve pdf/profile (error); limits silent; everything else still judges
|
|
35
|
+
*/
|
|
36
|
+
import { dirname, isAbsolute, join, basename, relative } from "node:path";
|
|
37
|
+
import { FACTS_DIR, FACTS_FILE, factsPath, parseFactsText, } from "./facts-file.js";
|
|
38
|
+
import { paperPreset, presetProblemText } from "./presets.js";
|
|
39
|
+
import { sha256Hex } from "./domain/sha256.js";
|
|
40
|
+
import { LEGACY_PAPER_SETTINGS_MESSAGE, PAPER_SETTINGS_FILE, } from "../lib/paper-config.mjs";
|
|
41
|
+
const finding = (messageId, data = {}) => ({ messageId, data });
|
|
42
|
+
const at = (p) => p;
|
|
43
|
+
const text = (files, p) => {
|
|
44
|
+
const b = files.readBytes(at(p));
|
|
45
|
+
return b === null ? null : new TextDecoder().decode(b);
|
|
46
|
+
};
|
|
47
|
+
// ── resolving the declaration ────────────────────────────────────────────────────────
|
|
48
|
+
function kindOf(venue, format, kind) {
|
|
49
|
+
const known = [...format.kinds.keys()].join(", ") || "(none)";
|
|
50
|
+
if (kind === null)
|
|
51
|
+
return {
|
|
52
|
+
kind: null,
|
|
53
|
+
kindProblem: finding("kindMissing", { venue, known }),
|
|
54
|
+
};
|
|
55
|
+
const limits = format.kinds.get(kind);
|
|
56
|
+
return limits
|
|
57
|
+
? { kind: { name: kind, limits }, kindProblem: null }
|
|
58
|
+
: {
|
|
59
|
+
kind: null,
|
|
60
|
+
kindProblem: finding("kindUnknown", { venue, kind, known }),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The facts about the PDF on disk, or the `pdf/fresh` finding that says why they are not. */
|
|
64
|
+
function freshFacts(files, paperDir, body) {
|
|
65
|
+
const parsed = parseFactsText(body);
|
|
66
|
+
if (!parsed.ok)
|
|
67
|
+
return parsed.error.kind === "schema"
|
|
68
|
+
? finding("schema", { got: parsed.error.got })
|
|
69
|
+
: finding("factsBroken", { why: parsed.error.why });
|
|
70
|
+
const f = parsed.value;
|
|
71
|
+
const pdf = files.readBytes(at(isAbsolute(f.pdf) ? f.pdf : join(paperDir, f.pdf)));
|
|
72
|
+
if (pdf === null)
|
|
73
|
+
return finding("pdfMissing", { pdf: f.pdf });
|
|
74
|
+
return sha256Hex(pdf) === f.sha ? f : finding("stale", { pdf: f.pdf });
|
|
75
|
+
}
|
|
76
|
+
const isFinding = (v) => "messageId" in v;
|
|
77
|
+
/** One paper, assessed. Reads through `deps.files` only; never throws on a paper's files. */
|
|
78
|
+
export function assessPaper(paperDir, deps) {
|
|
79
|
+
const p = paperPreset(paperDir, deps);
|
|
80
|
+
if (p.kind === "none")
|
|
81
|
+
return p.settings === null
|
|
82
|
+
? { kind: "no-venue" }
|
|
83
|
+
: { kind: "no-preset", file: join(paperDir, PAPER_SETTINGS_FILE) };
|
|
84
|
+
if (p.kind === "settings-problem")
|
|
85
|
+
return {
|
|
86
|
+
kind: "unresolved",
|
|
87
|
+
finding: p.problem.kind === "legacy"
|
|
88
|
+
? finding("legacySettings")
|
|
89
|
+
: finding("settingsBroken", { why: p.problem.why }),
|
|
90
|
+
};
|
|
91
|
+
if (p.kind === "preset-problem")
|
|
92
|
+
return {
|
|
93
|
+
kind: "unresolved",
|
|
94
|
+
finding: finding("preset", { why: presetProblemText(p.problem) }),
|
|
95
|
+
};
|
|
96
|
+
const label = p.preset.label;
|
|
97
|
+
const venue = {
|
|
98
|
+
venue: label,
|
|
99
|
+
format: p.preset.format,
|
|
100
|
+
...kindOf(label, p.preset.format, p.settings.kind),
|
|
101
|
+
};
|
|
102
|
+
const factsText = text(deps.files, factsPath(paperDir));
|
|
103
|
+
if (factsText === null)
|
|
104
|
+
return { kind: "unbuilt", venue };
|
|
105
|
+
const facts = freshFacts(deps.files, paperDir, factsText);
|
|
106
|
+
return isFinding(facts)
|
|
107
|
+
? { kind: "stale", finding: facts }
|
|
108
|
+
: { kind: "ready", venue, facts };
|
|
109
|
+
}
|
|
110
|
+
// ── the judges: typed facts + typed format → findings. Pure. ─────────────────────────
|
|
111
|
+
/** Type 3, not embedded, and each family the venue names missing from every font. */
|
|
112
|
+
export function judgeFonts(fonts, format, venue) {
|
|
113
|
+
const out = [];
|
|
114
|
+
for (const f of fonts) {
|
|
115
|
+
if (f.program === "Type3")
|
|
116
|
+
out.push(finding("type3", { name: f.name }));
|
|
117
|
+
if (!f.embedded)
|
|
118
|
+
out.push(finding("notEmbedded", { name: f.name }));
|
|
119
|
+
}
|
|
120
|
+
const names = [...new Set(fonts.map((f) => f.name))];
|
|
121
|
+
const families = [
|
|
122
|
+
[format.fontsText, "body text"],
|
|
123
|
+
[format.fontsTitle, "headings"],
|
|
124
|
+
];
|
|
125
|
+
for (const [prefix, what] of families)
|
|
126
|
+
if (prefix !== null && !names.some((n) => n.startsWith(prefix)))
|
|
127
|
+
out.push(finding("noFamily", {
|
|
128
|
+
prefix,
|
|
129
|
+
what,
|
|
130
|
+
venue,
|
|
131
|
+
have: names.slice(0, 8).join(", ") || "(no fonts)",
|
|
132
|
+
}));
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
/** Page width and height within `dimTol` inches, and the column count, against the preset. */
|
|
136
|
+
export function judgeGeometry(g, format, venue, dimTol) {
|
|
137
|
+
const out = [];
|
|
138
|
+
const dims = [
|
|
139
|
+
[format.pageWidthIn, g.page_w_in, "page width", "page_w_in"],
|
|
140
|
+
[format.pageHeightIn, g.page_h_in, "page height", "page_h_in"],
|
|
141
|
+
];
|
|
142
|
+
for (const [want, got, what, key] of dims) {
|
|
143
|
+
if (want === null)
|
|
144
|
+
continue;
|
|
145
|
+
if (got === null)
|
|
146
|
+
out.push(finding("dimMissing", { key, venue, want }));
|
|
147
|
+
else if (Math.abs(got - want) > dimTol)
|
|
148
|
+
out.push(finding("dim", { what, got, want, tol: dimTol, venue }));
|
|
149
|
+
}
|
|
150
|
+
if (format.columns !== null &&
|
|
151
|
+
g.columns !== null &&
|
|
152
|
+
g.columns !== format.columns)
|
|
153
|
+
out.push(finding("columns", { got: g.columns, want: format.columns, venue }));
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Body and reference pages against the kind's limits, and the reference font size against the
|
|
158
|
+
* profile's range. The range is about the DECLARED size and banal measures the rendered mode, so
|
|
159
|
+
* it is widened by `body_pt_tol` — the drift the preset itself names — or a correct paper fails.
|
|
160
|
+
*/
|
|
161
|
+
export function judgeLimits(g, resolved) {
|
|
162
|
+
return [...judgePages(g, resolved), ...judgeRefPt(g, resolved)];
|
|
163
|
+
}
|
|
164
|
+
function judgePages(g, resolved) {
|
|
165
|
+
const kind = resolved.kind;
|
|
166
|
+
if (kind === null)
|
|
167
|
+
return [];
|
|
168
|
+
const pages = [
|
|
169
|
+
[kind.limits.bodyPagesMax, g.body_pages, "body pages"],
|
|
170
|
+
[kind.limits.refPagesMax, g.ref_pages, "reference pages"],
|
|
171
|
+
];
|
|
172
|
+
return pages
|
|
173
|
+
.filter(([max, got]) => max !== null && got > max)
|
|
174
|
+
.map(([max, got, what]) => finding("pages", {
|
|
175
|
+
what,
|
|
176
|
+
got,
|
|
177
|
+
max: max ?? 0,
|
|
178
|
+
venue: resolved.venue,
|
|
179
|
+
kind: kind.name,
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
function judgeRefPt(g, resolved) {
|
|
183
|
+
const f = resolved.format;
|
|
184
|
+
const slop = f.bodyPtTol ?? 0;
|
|
185
|
+
if (f.refPtMin === null || f.refPtMax === null || g.ref_pt === null)
|
|
186
|
+
return [];
|
|
187
|
+
return g.ref_pt < f.refPtMin - slop || g.ref_pt > f.refPtMax + slop
|
|
188
|
+
? [
|
|
189
|
+
finding("refPt", {
|
|
190
|
+
got: g.ref_pt,
|
|
191
|
+
min: f.refPtMin,
|
|
192
|
+
max: f.refPtMax,
|
|
193
|
+
slop,
|
|
194
|
+
venue: resolved.venue,
|
|
195
|
+
}),
|
|
196
|
+
]
|
|
197
|
+
: [];
|
|
198
|
+
}
|
|
199
|
+
/** The body font size against `body_pt ± body_pt_tol`. */
|
|
200
|
+
export function judgeBodySize(g, format, venue) {
|
|
201
|
+
const want = format.bodyPt;
|
|
202
|
+
const tol = format.bodyPtTol;
|
|
203
|
+
if (want === null || tol === null)
|
|
204
|
+
return [];
|
|
205
|
+
if (g.body_pt === null)
|
|
206
|
+
return [finding("bodyMissing")];
|
|
207
|
+
return Math.abs(g.body_pt - want) > tol
|
|
208
|
+
? [finding("body", { got: g.body_pt, want, tol, venue })]
|
|
209
|
+
: [];
|
|
210
|
+
}
|
|
211
|
+
const REBUILD = "rebuild the paper (`paperlint build`) to rewrite it";
|
|
212
|
+
/** Which rule reports what: each takes the assessment and returns its own findings. */
|
|
213
|
+
const JUDGES = {
|
|
214
|
+
profile: (a) => a.kind === "unresolved"
|
|
215
|
+
? [a.finding]
|
|
216
|
+
: a.kind === "ready" && a.venue.kindProblem
|
|
217
|
+
? [a.venue.kindProblem]
|
|
218
|
+
: a.kind === "unbuilt" && a.venue.kindProblem
|
|
219
|
+
? [a.venue.kindProblem]
|
|
220
|
+
: [],
|
|
221
|
+
fresh: (a) => (a.kind === "stale" ? [a.finding] : []),
|
|
222
|
+
measured: (a, { shown }) => a.kind === "no-preset"
|
|
223
|
+
? [finding("noPreset", { file: shown(a.file) })]
|
|
224
|
+
: a.kind === "unbuilt"
|
|
225
|
+
? [
|
|
226
|
+
finding("unbuilt", {
|
|
227
|
+
file: `${FACTS_DIR}/${FACTS_FILE}`,
|
|
228
|
+
venue: a.venue.venue,
|
|
229
|
+
}),
|
|
230
|
+
]
|
|
231
|
+
: a.kind === "ready" && a.facts.geometry === null
|
|
232
|
+
? [finding("noGeometry")]
|
|
233
|
+
: [],
|
|
234
|
+
fonts: (a) => a.kind === "ready"
|
|
235
|
+
? judgeFonts(a.facts.fonts, a.venue.format, a.venue.venue)
|
|
236
|
+
: [],
|
|
237
|
+
geometry: (a, { options }) => a.kind === "ready" && a.facts.geometry
|
|
238
|
+
? judgeGeometry(a.facts.geometry, a.venue.format, a.venue.venue, options[0]?.dimTol ??
|
|
239
|
+
DEFAULT_DIM_TOL_IN)
|
|
240
|
+
: [],
|
|
241
|
+
limits: (a) => a.kind === "ready" && a.facts.geometry
|
|
242
|
+
? judgeLimits(a.facts.geometry, a.venue)
|
|
243
|
+
: [],
|
|
244
|
+
"body-size": (a) => a.kind === "ready" && a.facts.geometry
|
|
245
|
+
? judgeBodySize(a.facts.geometry, a.venue.format, a.venue.venue)
|
|
246
|
+
: [],
|
|
247
|
+
};
|
|
248
|
+
/** How far, in inches, a measured page dimension may be from the preset's. */
|
|
249
|
+
export const DEFAULT_DIM_TOL_IN = 0.05;
|
|
250
|
+
const META = {
|
|
251
|
+
fresh: {
|
|
252
|
+
docs: {
|
|
253
|
+
description: "the build facts describe the PDF on disk, not an earlier build",
|
|
254
|
+
},
|
|
255
|
+
messages: {
|
|
256
|
+
factsBroken: `_build/paper.facts.json cannot be read: {{why}} — ${REBUILD}`,
|
|
257
|
+
schema: `_build/paper.facts.json has schema {{got}}; the venue rules read schema 2 — ${REBUILD}`,
|
|
258
|
+
pdfMissing: "_build/paper.facts.json describes {{pdf}}, which is not on disk (a failed build removes it) — rebuild the paper",
|
|
259
|
+
stale: "_build/paper.facts.json describes a DIFFERENT {{pdf}} than the one on disk (its SHA-256 differs), so the venue checks would judge an earlier build — rebuild the paper",
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
profile: {
|
|
263
|
+
docs: {
|
|
264
|
+
description: "the venue preset a paper's paperlint.json extends resolves, and the kind it names exists",
|
|
265
|
+
},
|
|
266
|
+
messages: {
|
|
267
|
+
settingsBroken: `${PAPER_SETTINGS_FILE} cannot be read: {{why}}`,
|
|
268
|
+
legacySettings: `this paper's venue checks do not run — ${LEGACY_PAPER_SETTINGS_MESSAGE}`,
|
|
269
|
+
preset: "{{why}} — so this paper's page limit, fonts and format are not checked. Fix `extends` in its paperlint.json, or turn pdf/profile off for this paper",
|
|
270
|
+
kindMissing: `${PAPER_SETTINGS_FILE} names no \`kind\`, so the page limit of \`{{venue}}\` is not checked; its kinds: {{known}}`,
|
|
271
|
+
kindUnknown: "`{{venue}}` has no kind `{{kind}}`, so the page limit is not checked; its kinds: {{known}}",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
measured: {
|
|
275
|
+
type: "suggestion",
|
|
276
|
+
docs: {
|
|
277
|
+
description: "the venue checks ran: the paper names a venue preset, and it was built and measured",
|
|
278
|
+
},
|
|
279
|
+
messages: {
|
|
280
|
+
unbuilt: "this paper names the venue `{{venue}}`, but {{file}} does not exist, so its page limit, fonts and format were NOT checked — run `paperlint build` before `paperlint lint`",
|
|
281
|
+
noPreset: 'this paper names no venue preset yet, so its page limit, fonts and format are not checked — set "extends" in {{file}} (e.g. "paperlint:agenticdev"; see docs/rules.md)',
|
|
282
|
+
noGeometry: "the build measured no page geometry (banal was not found or failed), so page size, columns, page limits and font sizes were NOT checked — run `paperlint toolchain`, then `paperlint build`",
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
fonts: {
|
|
286
|
+
docs: {
|
|
287
|
+
description: "every font is embedded and none is Type 3, and the venue's font families are present",
|
|
288
|
+
},
|
|
289
|
+
messages: {
|
|
290
|
+
type3: "the font {{name}} is Type 3 (a bitmap or procedure font); ACM and ACL reject such a PDF",
|
|
291
|
+
notEmbedded: "the font {{name}} is not embedded, so the reader's viewer substitutes another",
|
|
292
|
+
noFamily: "no font starts with `{{prefix}}` ({{what}} of {{venue}}); the PDF has: {{have}}. Usually a font package is missing and the class silently fell back to Computer Modern — run `paperlint toolchain`",
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
geometry: {
|
|
296
|
+
schema: [
|
|
297
|
+
{
|
|
298
|
+
type: "object",
|
|
299
|
+
properties: { dimTol: { type: "number", minimum: 0 } },
|
|
300
|
+
additionalProperties: false,
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
docs: {
|
|
304
|
+
description: "page size and column count match the venue's profile",
|
|
305
|
+
},
|
|
306
|
+
messages: {
|
|
307
|
+
dim: "{{what}} is {{got}} in, {{venue}} requires {{want}} in (tolerance {{tol}}) — the template sets the wrong paper size",
|
|
308
|
+
dimMissing: "{{venue}} sets `{{key}}` = {{want}}, and the build did not measure it — rebuild the paper",
|
|
309
|
+
columns: "{{got}} column(s), {{venue}} requires {{want}} — the wrong document class or class option",
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
limits: {
|
|
313
|
+
docs: {
|
|
314
|
+
description: "body and reference pages within the limit of the paper's kind; reference font size in range",
|
|
315
|
+
},
|
|
316
|
+
messages: {
|
|
317
|
+
pages: "{{what}}: {{got}}, over the limit {{max}} for {{venue}}/{{kind}} — a desk reject; cut the text",
|
|
318
|
+
refPt: "the reference font size is {{got}} pt, outside {{min}}–{{max}} pt for {{venue}} (allowing ±{{slop}} pt for the measuring drift) — fix the bibliography's font size",
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
"body-size": {
|
|
322
|
+
type: "suggestion",
|
|
323
|
+
docs: {
|
|
324
|
+
description: "body font size within the venue preset's tolerance (a measured mode, so a warning)",
|
|
325
|
+
},
|
|
326
|
+
messages: {
|
|
327
|
+
body: "the body font size measures {{got}} pt against {{want}} ± {{tol}} pt for {{venue}}. The measurement is the mode of the rendered text, not the declared size — check \\documentclass and its options",
|
|
328
|
+
bodyMissing: "the build did not measure a body font size — rebuild the paper",
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* The level each venue rule is on at in paperlint's own config, for every `paper.tex`. One owner:
|
|
334
|
+
* the config reads it, the docs describe it, a consumer overrides it in `rules`.
|
|
335
|
+
*/
|
|
336
|
+
export const VENUE_RULE_LEVELS = {
|
|
337
|
+
"pdf/fresh": "error",
|
|
338
|
+
"pdf/profile": "error",
|
|
339
|
+
"pdf/fonts": "error",
|
|
340
|
+
"pdf/geometry": "error",
|
|
341
|
+
"pdf/limits": "error",
|
|
342
|
+
"pdf/body-size": "warn",
|
|
343
|
+
"pdf/measured": "warn",
|
|
344
|
+
};
|
|
345
|
+
/** The line of `\documentclass`, where the class and its options — most of the fixes — live. */
|
|
346
|
+
function reportLine(source) {
|
|
347
|
+
const i = source
|
|
348
|
+
.split("\n")
|
|
349
|
+
.findIndex((l) => l.trimStart().startsWith("\\documentclass"));
|
|
350
|
+
return i >= 0 ? i + 1 : 1;
|
|
351
|
+
}
|
|
352
|
+
function rule(name, deps) {
|
|
353
|
+
const meta = META[name];
|
|
354
|
+
return {
|
|
355
|
+
meta: {
|
|
356
|
+
type: meta.type ?? "problem",
|
|
357
|
+
docs: meta.docs,
|
|
358
|
+
schema: meta.schema ?? [],
|
|
359
|
+
messages: meta.messages,
|
|
360
|
+
},
|
|
361
|
+
create(context) {
|
|
362
|
+
// Judged once per paper, on its paper.tex: the paper directory is the file's directory.
|
|
363
|
+
if (basename(context.filename) !== "paper.tex")
|
|
364
|
+
return {};
|
|
365
|
+
return {
|
|
366
|
+
root() {
|
|
367
|
+
const a = assessPaper(dirname(context.filename), deps);
|
|
368
|
+
const line = reportLine(context.sourceCode.text);
|
|
369
|
+
const loc = {
|
|
370
|
+
start: { line, column: 1 },
|
|
371
|
+
end: { line, column: 2 },
|
|
372
|
+
};
|
|
373
|
+
const cwd = context.cwd;
|
|
374
|
+
const shown = (p) => (cwd ? relative(cwd, p) || p : p);
|
|
375
|
+
for (const f of JUDGES[name](a, { options: context.options, shown }))
|
|
376
|
+
context.report({ loc, messageId: f.messageId, data: f.data });
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/** The venue rules, as the rules of the `pdf` plugin (beside `last-page-balance`). */
|
|
383
|
+
export function venueRules(deps) {
|
|
384
|
+
const names = Object.keys(META);
|
|
385
|
+
return Object.fromEntries(names.map((n) => [n, rule(n, deps)]));
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=venue-rules.js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