paperlint 20.6.2 → 20.8.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-plugin/plugin.json +1 -1
- package/dist/adapters/revision-plan/index.d.ts +17 -0
- package/dist/adapters/revision-plan/index.d.ts.map +1 -0
- package/dist/adapters/revision-plan/index.js +168 -0
- package/dist/adapters/revision-plan/index.js.map +1 -0
- package/dist/domain/paper-layout.d.ts.map +1 -1
- package/dist/domain/paper-layout.js +4 -0
- package/dist/domain/paper-layout.js.map +1 -1
- package/dist/domain/preset-submission-fields.d.ts +15 -0
- package/dist/domain/preset-submission-fields.d.ts.map +1 -0
- package/dist/domain/preset-submission-fields.js +25 -0
- package/dist/domain/preset-submission-fields.js.map +1 -0
- package/dist/domain/revision-plan.d.ts +121 -0
- package/dist/domain/revision-plan.d.ts.map +1 -0
- package/dist/domain/revision-plan.js +15 -0
- package/dist/domain/revision-plan.js.map +1 -0
- package/dist/domain/venue-scope.d.ts +29 -0
- package/dist/domain/venue-scope.d.ts.map +1 -0
- package/dist/domain/venue-scope.js +18 -0
- package/dist/domain/venue-scope.js.map +1 -0
- package/dist/ports/revision-plan-codec.d.ts +7 -0
- package/dist/ports/revision-plan-codec.d.ts.map +1 -0
- package/dist/ports/revision-plan-codec.js +2 -0
- package/dist/ports/revision-plan-codec.js.map +1 -0
- package/dist/preset-merge.d.ts +34 -0
- package/dist/preset-merge.d.ts.map +1 -0
- package/dist/preset-merge.js +89 -0
- package/dist/preset-merge.js.map +1 -0
- package/dist/presets.d.ts +3 -2
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +3 -84
- package/dist/presets.js.map +1 -1
- package/dist/tex-requirements.d.ts +4 -1
- package/dist/tex-requirements.d.ts.map +1 -1
- package/dist/tex-requirements.js +3 -20
- package/dist/tex-requirements.js.map +1 -1
- package/docs/configuration.md +56 -0
- package/docs/layout.md +1 -0
- package/docs/rules/paper/allowed-files-only.md +1 -0
- package/docs/venues.md +6 -4
- package/package.json +2 -1
- package/presets/acl-latex.md +1 -1
- package/presets/langcode-2027.jsonc +106 -0
- package/presets/langcode-2027.md +79 -0
- package/presets/naacl-2027.jsonc +19 -0
- package/presets/naacl-2027.md +42 -0
- package/presets/venue-profile.schema.json +22 -1
- package/scripts/eslint-file-length.mjs +4 -4
- package/scripts/revision-plan-schema.test.ts +39 -0
- package/scripts/revision-plan-schema.ts +17 -0
- package/skills/paper-pipeline/revision-plan.schema.json +619 -0
- package/src/adapters/revision-plan/index.test.ts +207 -0
- package/src/adapters/revision-plan/index.ts +236 -0
- package/src/adapters/revision-plan/schema.test.ts +69 -0
- package/src/domain/paper-layout.test.ts +1 -0
- package/src/domain/paper-layout.ts +4 -0
- package/src/domain/preset-submission-fields.ts +49 -0
- package/src/domain/revision-plan.ts +127 -0
- package/src/domain/venue-scope.test.ts +33 -0
- package/src/domain/venue-scope.ts +39 -0
- package/src/paper-settings-commands.test.ts +1 -1
- package/src/ports/revision-plan-codec.ts +7 -0
- package/src/preset-card-rule.test.ts +2 -0
- package/src/preset-merge.ts +141 -0
- package/src/presets-scope.test.ts +177 -0
- package/src/presets.test.ts +17 -56
- package/src/presets.ts +5 -130
- package/src/tex-requirements.ts +14 -45
- package/src/tex-venue-rules.test.ts +3 -25
- package/src/venue-rules.test.ts +2 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A PAPER'S REVISION PLAN — `<paper>/revision-plan.json` (#502): for the current cycle, which accepted
|
|
3
|
+
* papers the paper is held against, whether new evidence is still being gathered, and the closed list
|
|
4
|
+
* of what remains before it is submitted. "Done" is the list, not a reader's or a skill's bar: a
|
|
5
|
+
* review finding outside it is a proposal until the author adds a row.
|
|
6
|
+
*
|
|
7
|
+
* The text is checked once, where it enters: `RevisionPlanCodec` (`src/ports/revision-plan-codec.ts`),
|
|
8
|
+
* whose adapter holds the zod schema of this shape. Only the codec mints a `RevisionPlan`, so a value
|
|
9
|
+
* built by hand can hold what the schema refuses (a `done` row with no evidence, two rows with one id).
|
|
10
|
+
* Every object is strict: a misspelt key is a finding, not a field nobody reads.
|
|
11
|
+
*
|
|
12
|
+
* What the shape cannot hold, by construction:
|
|
13
|
+
* - a `done` row without `evidence`, a `dropped` row without `reason` and `kind`;
|
|
14
|
+
* - a bar that claims to be measured without naming the corpus and at least one edition;
|
|
15
|
+
* - "no bar" without saying why; a `proxy` without what it stands in for;
|
|
16
|
+
* - `enough` measured without a date and the file that decided it;
|
|
17
|
+
* - a row with no origin, or no date it was added.
|
|
18
|
+
* What needs the disk or the settings (the cycle is the current one, the corpus and each named file
|
|
19
|
+
* exist, a finding exists in its review, a rule id is shipped) is a rule's, not this type's.
|
|
20
|
+
*/
|
|
21
|
+
import type { CycleId } from "./cycle.ts";
|
|
22
|
+
|
|
23
|
+
export const REVISION_PLAN = "revision-plan.json";
|
|
24
|
+
|
|
25
|
+
/** A row's id, `R1`, `R2`, …: unique in the file, so a review finding can name it. */
|
|
26
|
+
export const ROW_ID_PATTERN = /^R[1-9][0-9]*$/u;
|
|
27
|
+
|
|
28
|
+
/** A rule's id as `paperlint lint` reports it: `<plugin>/<rule>`. */
|
|
29
|
+
export const RULE_ID_PATTERN = /^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/u;
|
|
30
|
+
|
|
31
|
+
/** Which accepted papers the paper is held against. A measured bar IS a corpus: there is no `measured: true`. */
|
|
32
|
+
export type Bar =
|
|
33
|
+
| {
|
|
34
|
+
readonly kind: "corpus";
|
|
35
|
+
/** The venue corpus's series: its folder under `<papers-root>/venues/`. */
|
|
36
|
+
readonly series: string;
|
|
37
|
+
readonly editions: readonly [number, ...number[]];
|
|
38
|
+
}
|
|
39
|
+
| {
|
|
40
|
+
/** Another venue's corpus, labelled as a stand-in. */
|
|
41
|
+
readonly kind: "proxy";
|
|
42
|
+
readonly series: string;
|
|
43
|
+
readonly stands_in_for: string;
|
|
44
|
+
}
|
|
45
|
+
| { readonly kind: "none"; readonly why: string };
|
|
46
|
+
|
|
47
|
+
/** Whether new evidence is still being gathered. `enough` closes the evidence, not the text (#504). */
|
|
48
|
+
export type Measurement =
|
|
49
|
+
| { readonly kind: "open" }
|
|
50
|
+
| {
|
|
51
|
+
readonly kind: "enough";
|
|
52
|
+
readonly since: string;
|
|
53
|
+
/** The paper's file, relative to the paper folder, whose reading decided it. */
|
|
54
|
+
readonly evidence: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Where a row came from: one closed set, so a row cannot arrive from nowhere. */
|
|
58
|
+
export type RowSource =
|
|
59
|
+
| { readonly kind: "author" }
|
|
60
|
+
/** A fact of the venue's preset: its template, a required section. */
|
|
61
|
+
| { readonly kind: "venue" }
|
|
62
|
+
/** A finding of a review file, relative to the paper folder (`reviews/*.md`), by its id. */
|
|
63
|
+
| {
|
|
64
|
+
readonly kind: "finding";
|
|
65
|
+
readonly file: string;
|
|
66
|
+
readonly finding: string | number;
|
|
67
|
+
}
|
|
68
|
+
/** The points of a reviewed rejection, from that cycle. */
|
|
69
|
+
| { readonly kind: "prior-reviews"; readonly cycle: CycleId };
|
|
70
|
+
|
|
71
|
+
/** Why a dropped row is not done: decided against, or a known cost the paper is submitted with. */
|
|
72
|
+
export const DROP_KINDS = ["not-doing", "accepted-cap"] as const;
|
|
73
|
+
export type DropKind = (typeof DROP_KINDS)[number];
|
|
74
|
+
|
|
75
|
+
/** What every row carries. */
|
|
76
|
+
interface RowBase {
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly what: string;
|
|
79
|
+
readonly from: RowSource;
|
|
80
|
+
/** The day the row was added: a row added after `written` is growth the plan's reader sees. */
|
|
81
|
+
readonly added: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** How a row stands: open, closed with evidence, dropped with a reason, or closed when a rule falls silent. */
|
|
85
|
+
export type Row = RowBase &
|
|
86
|
+
(
|
|
87
|
+
| { readonly state: "todo" | "doing" }
|
|
88
|
+
| { readonly state: "done"; readonly evidence: string }
|
|
89
|
+
| {
|
|
90
|
+
readonly state: "dropped";
|
|
91
|
+
readonly reason: string;
|
|
92
|
+
readonly kind: DropKind;
|
|
93
|
+
}
|
|
94
|
+
| { readonly state: "by-rule"; readonly rule: string }
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export const ROW_STATES = [
|
|
98
|
+
"todo",
|
|
99
|
+
"doing",
|
|
100
|
+
"done",
|
|
101
|
+
"dropped",
|
|
102
|
+
"by-rule",
|
|
103
|
+
] as const satisfies readonly Row["state"][];
|
|
104
|
+
|
|
105
|
+
export interface RevisionPlan {
|
|
106
|
+
/** The cycle the plan is for (`cycles[].id` in the paper's `paperlint.json`). */
|
|
107
|
+
readonly cycle: CycleId;
|
|
108
|
+
/** The day the plan was written. */
|
|
109
|
+
readonly written: string;
|
|
110
|
+
readonly bar: Bar;
|
|
111
|
+
readonly measurement: Measurement;
|
|
112
|
+
/** The closed list: a row is added only by an edit to this file. */
|
|
113
|
+
readonly remaining: readonly Row[];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** A field of the plan, as the path of keys and indexes from its top. */
|
|
117
|
+
export type PlanPath = readonly (string | number)[];
|
|
118
|
+
|
|
119
|
+
/** Why the text is not a plan, at the field the reason is about. */
|
|
120
|
+
export interface PlanProblem {
|
|
121
|
+
readonly path: PlanPath;
|
|
122
|
+
readonly message: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type ParsedPlan =
|
|
126
|
+
| { readonly ok: true; readonly plan: RevisionPlan }
|
|
127
|
+
| { readonly ok: false; readonly problems: readonly PlanProblem[] };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { expect, it } from "vitest";
|
|
2
|
+
import { scopeOf } from "./venue-scope.ts";
|
|
3
|
+
|
|
4
|
+
it("a preset with no scope has none", () => {
|
|
5
|
+
expect(scopeOf(undefined)).toBeNull();
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it("a scope without topics carries an empty topic list, the rest as written", () => {
|
|
9
|
+
// Guards: a reader can print topics without asking whether the call gave any.
|
|
10
|
+
expect(
|
|
11
|
+
scopeOf({
|
|
12
|
+
url: "https://example.org/cfp",
|
|
13
|
+
read: "2026-11-25",
|
|
14
|
+
sentences: ["Papers on X."],
|
|
15
|
+
}),
|
|
16
|
+
).toEqual({
|
|
17
|
+
url: "https://example.org/cfp",
|
|
18
|
+
read: "2026-11-25",
|
|
19
|
+
sentences: ["Papers on X."],
|
|
20
|
+
topics: [],
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("a scope's topics are kept verbatim and in order", () => {
|
|
25
|
+
expect(
|
|
26
|
+
scopeOf({
|
|
27
|
+
url: "https://example.org/cfp",
|
|
28
|
+
read: "2026-11-25",
|
|
29
|
+
sentences: ["Papers on X."],
|
|
30
|
+
topics: ["B topic", "A topic"],
|
|
31
|
+
})?.topics,
|
|
32
|
+
).toEqual(["B topic", "A topic"]);
|
|
33
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A venue's SCOPE: what its call for papers says the venue is for, verbatim, with the page it was
|
|
3
|
+
* read from and the day (`scope` in a venue preset, `presets/venue-profile.schema.json`).
|
|
4
|
+
*
|
|
5
|
+
* It is data for a reader. No rule judges a paper against it: whether a paper fits a call is a
|
|
6
|
+
* judgement, and a judgement made by a rule would be a default finding a careful author could
|
|
7
|
+
* dispute.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** A preset's `scope` after the schema accepted it. */
|
|
11
|
+
export interface VenueScopeJson {
|
|
12
|
+
readonly url: string;
|
|
13
|
+
readonly read: string;
|
|
14
|
+
readonly sentences: readonly string[];
|
|
15
|
+
readonly topics?: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** A venue's scope, as the call states it. */
|
|
19
|
+
export interface VenueScope {
|
|
20
|
+
/** The page the sentences were read from. */
|
|
21
|
+
readonly url: string;
|
|
22
|
+
/** The day they were read, `YYYY-MM-DD`. */
|
|
23
|
+
readonly read: string;
|
|
24
|
+
/** The call's scope sentences, verbatim; at least one. */
|
|
25
|
+
readonly sentences: readonly string[];
|
|
26
|
+
/** The call's topic list, verbatim; empty when the call gives none. */
|
|
27
|
+
readonly topics: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** A preset's `scope`, or null when the file records none. Pure. */
|
|
31
|
+
export const scopeOf = (j: VenueScopeJson | undefined): VenueScope | null =>
|
|
32
|
+
j === undefined
|
|
33
|
+
? null
|
|
34
|
+
: {
|
|
35
|
+
url: j.url,
|
|
36
|
+
read: j.read,
|
|
37
|
+
sentences: j.sentences,
|
|
38
|
+
topics: j.topics ?? [],
|
|
39
|
+
};
|
|
@@ -317,7 +317,7 @@ describe("paperlint lint — the paper over its preset, and the project's own pr
|
|
|
317
317
|
const r = await lint(root);
|
|
318
318
|
expect(r.code).toBe(1);
|
|
319
319
|
expect(r.out).toMatch(
|
|
320
|
-
/aaai-2027, aaai-press, acl-latex, acm-acmsmall, acm-sigconf, acsac-2026, agent-2027, agenticdev-2026, agentverify-2027, aidc-2026, aisec-2026, ase-2026, ccs-2026, emnlp-2026, fse-2027, icml-2027, icml-style, icse-2027, icse-2028, ieee-conference, msr-2027, neurips-2026, neurips-style, nlbse-2027, realm-2026, sp-2027/,
|
|
320
|
+
/aaai-2027, aaai-press, acl-latex, acm-acmsmall, acm-sigconf, acsac-2026, agent-2027, agenticdev-2026, agentverify-2027, aidc-2026, aisec-2026, ase-2026, ccs-2026, emnlp-2026, fse-2027, icml-2027, icml-style, icse-2027, icse-2028, ieee-conference, langcode-2027, msr-2027, naacl-2027, neurips-2026, neurips-style, nlbse-2027, realm-2026, sp-2027/,
|
|
321
321
|
);
|
|
322
322
|
});
|
|
323
323
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** How a revision plan's text becomes a plan: parsed once, at the boundary (src/domain/revision-plan.ts). */
|
|
2
|
+
import type { ParsedPlan } from "../domain/revision-plan.ts";
|
|
3
|
+
|
|
4
|
+
export interface RevisionPlanCodec {
|
|
5
|
+
/** `revision-plan.json`'s text → the plan, or every reason it is not one, each at its field. */
|
|
6
|
+
readonly parse: (text: string) => ParsedPlan;
|
|
7
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE MERGE OF A PRESET CHAIN, one file at a time, root first (`src/presets.ts` resolves the chain).
|
|
3
|
+
* Block by block:
|
|
4
|
+
* tex union — a child never removes a package its parent needs
|
|
5
|
+
* format per key, the child wins; `kinds` by kind name, a child's kind replaces that kind
|
|
6
|
+
* rules per rule id, the child wins; `ruleOrigins` keeps which file set each
|
|
7
|
+
* template the child wins, with its `template_forbids`; so does `name`, and `required_sections`, `register`, `talk`,
|
|
8
|
+
* `portal`, `deadlines`, `submission_fields` and `scope` (each whole)
|
|
9
|
+
* aliases union, with every `name` — what the venue is called along the chain
|
|
10
|
+
* parent the child wins: the conference a workshop is held at, a spec resolved from the
|
|
11
|
+
* file that names it
|
|
12
|
+
*/
|
|
13
|
+
import {
|
|
14
|
+
mergeRequirements,
|
|
15
|
+
NO_FORMAT,
|
|
16
|
+
NO_REQUIREMENTS,
|
|
17
|
+
type PresetFile,
|
|
18
|
+
type PresetIdentity,
|
|
19
|
+
type VenueFormat,
|
|
20
|
+
} from "./tex-requirements.ts";
|
|
21
|
+
import type { Preset } from "./presets.ts";
|
|
22
|
+
|
|
23
|
+
/** A child's format over its parent's: per key the child wins, kinds by name. Pure. */
|
|
24
|
+
export function mergeFormat(
|
|
25
|
+
parent: VenueFormat,
|
|
26
|
+
child: VenueFormat,
|
|
27
|
+
): VenueFormat {
|
|
28
|
+
// Every field listed: a VenueFormat literal missing one is a compile error.
|
|
29
|
+
const pick = <K extends Exclude<keyof VenueFormat, "kinds">>(
|
|
30
|
+
k: K,
|
|
31
|
+
): VenueFormat[K] => child[k] ?? parent[k];
|
|
32
|
+
return {
|
|
33
|
+
pageWidthIn: pick("pageWidthIn"),
|
|
34
|
+
pageHeightIn: pick("pageHeightIn"),
|
|
35
|
+
columns: pick("columns"),
|
|
36
|
+
bodyPt: pick("bodyPt"),
|
|
37
|
+
bodyPtTol: pick("bodyPtTol"),
|
|
38
|
+
refPtMin: pick("refPtMin"),
|
|
39
|
+
refPtMax: pick("refPtMax"),
|
|
40
|
+
fontsText: pick("fontsText"),
|
|
41
|
+
fontsTitle: pick("fontsTitle"),
|
|
42
|
+
bodyEndsAt: pick("bodyEndsAt"),
|
|
43
|
+
appendixInBody: pick("appendixInBody"),
|
|
44
|
+
kinds: new Map([...parent.kinds, ...child.kinds]),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** A venue's name; a family and the base set have none. Pure. */
|
|
49
|
+
const nameOf = (i: PresetIdentity): string | null =>
|
|
50
|
+
i.type === "venue" ? i.name : null;
|
|
51
|
+
|
|
52
|
+
/** A venue's name as a list, empty for a family and the base set. Pure. */
|
|
53
|
+
const namesOf = (i: PresetIdentity): readonly string[] =>
|
|
54
|
+
i.type === "venue" ? [i.name] : [];
|
|
55
|
+
|
|
56
|
+
/** What the merge carries from file to file: the preset without what only the whole chain knows. */
|
|
57
|
+
type Merging = Omit<
|
|
58
|
+
Preset,
|
|
59
|
+
"id" | "label" | "chain" | "identity" | "parentNames" | "year"
|
|
60
|
+
> & {
|
|
61
|
+
readonly name: string | null;
|
|
62
|
+
readonly parent: ParentLink | null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** A `parent` as a file of the chain names it: the spec, and the file it is resolved from. */
|
|
66
|
+
export interface ParentLink {
|
|
67
|
+
readonly spec: string;
|
|
68
|
+
readonly file: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const NOTHING_MERGED: Merging = {
|
|
72
|
+
name: null,
|
|
73
|
+
parent: null,
|
|
74
|
+
template: null,
|
|
75
|
+
templateStyle: null,
|
|
76
|
+
aliases: [],
|
|
77
|
+
declaredAliases: [],
|
|
78
|
+
blind: false,
|
|
79
|
+
requiredSections: [],
|
|
80
|
+
tex: NO_REQUIREMENTS,
|
|
81
|
+
format: NO_FORMAT,
|
|
82
|
+
rules: {},
|
|
83
|
+
ruleOrigins: {},
|
|
84
|
+
registerAnchors: [],
|
|
85
|
+
talk: null,
|
|
86
|
+
portal: null,
|
|
87
|
+
deadlines: [],
|
|
88
|
+
submissionFields: null,
|
|
89
|
+
scope: null,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** The blocks a child replaces whole: the child's when it names one, else its parents'. Pure. */
|
|
93
|
+
const wholeBlocks = (
|
|
94
|
+
acc: Merging,
|
|
95
|
+
p: PresetFile,
|
|
96
|
+
): Pick<
|
|
97
|
+
Merging,
|
|
98
|
+
| "requiredSections"
|
|
99
|
+
| "registerAnchors"
|
|
100
|
+
| "talk"
|
|
101
|
+
| "portal"
|
|
102
|
+
| "deadlines"
|
|
103
|
+
| "submissionFields"
|
|
104
|
+
| "scope"
|
|
105
|
+
> => ({
|
|
106
|
+
requiredSections: p.requiredSections ?? acc.requiredSections,
|
|
107
|
+
registerAnchors: p.registerAnchors ?? acc.registerAnchors,
|
|
108
|
+
talk: p.talk ?? acc.talk,
|
|
109
|
+
portal: p.portal ?? acc.portal,
|
|
110
|
+
deadlines: p.deadlines ?? acc.deadlines,
|
|
111
|
+
submissionFields: p.submissionFields ?? acc.submissionFields,
|
|
112
|
+
scope: p.scope ?? acc.scope,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/** One file of the chain, `file`, merged over what its parents gave. Pure. */
|
|
116
|
+
export const mergeOne = (
|
|
117
|
+
acc: Merging,
|
|
118
|
+
{ preset: p, file }: { readonly preset: PresetFile; readonly file: string },
|
|
119
|
+
): Merging => ({
|
|
120
|
+
name: nameOf(p.identity) ?? acc.name,
|
|
121
|
+
parent: p.parent === null ? acc.parent : { spec: p.parent, file },
|
|
122
|
+
template:
|
|
123
|
+
p.template === null
|
|
124
|
+
? acc.template
|
|
125
|
+
: { text: p.template, file, forbids: p.templateForbids },
|
|
126
|
+
templateStyle:
|
|
127
|
+
p.templateStyle === null
|
|
128
|
+
? acc.templateStyle
|
|
129
|
+
: { text: p.templateStyle, file },
|
|
130
|
+
aliases: [...new Set([...acc.aliases, ...namesOf(p.identity), ...p.aliases])],
|
|
131
|
+
declaredAliases: [...new Set([...acc.declaredAliases, ...p.aliases])],
|
|
132
|
+
blind: p.blind ?? acc.blind,
|
|
133
|
+
tex: p.tex ? mergeRequirements(acc.tex, p.tex) : acc.tex,
|
|
134
|
+
format: mergeFormat(acc.format, p.format),
|
|
135
|
+
rules: { ...acc.rules, ...p.rules },
|
|
136
|
+
ruleOrigins: {
|
|
137
|
+
...acc.ruleOrigins,
|
|
138
|
+
...Object.fromEntries(Object.keys(p.rules).map((id) => [id, file])),
|
|
139
|
+
},
|
|
140
|
+
...wholeBlocks(acc, p),
|
|
141
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A venue's `scope` (`presets/venue-profile.schema.json`): what its call says it is for, verbatim.
|
|
3
|
+
* Parsed by `parsePreset`, merged by `resolvePreset`, and recorded on every shipped venue preset
|
|
4
|
+
* except the editions listed in `WITHOUT_SCOPE`.
|
|
5
|
+
*/
|
|
6
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { describe, expect, it } from "vitest";
|
|
9
|
+
import { memoryFiles } from "./adapters/memory/index.ts";
|
|
10
|
+
import { presetsDir } from "./package-dirs.ts";
|
|
11
|
+
import { parsePreset } from "./tex-requirements.ts";
|
|
12
|
+
import { resolvePreset, shippedPresets } from "./presets.ts";
|
|
13
|
+
|
|
14
|
+
const VENUES = presetsDir();
|
|
15
|
+
const shipped = Object.fromEntries(
|
|
16
|
+
readdirSync(VENUES)
|
|
17
|
+
.filter((f) => f.endsWith(".jsonc"))
|
|
18
|
+
.map((f) => [join(VENUES, f), readFileSync(join(VENUES, f))]),
|
|
19
|
+
);
|
|
20
|
+
const PAPER_FILE = "/work/papers/p/paperlint.json";
|
|
21
|
+
const resolve = (spec: string, extra: Record<string, string> = {}) =>
|
|
22
|
+
resolvePreset(spec, PAPER_FILE, {
|
|
23
|
+
files: memoryFiles({ ...shipped, ...extra }),
|
|
24
|
+
venuesDir: VENUES,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const SCOPE = {
|
|
28
|
+
url: "https://example.org/cfp",
|
|
29
|
+
read: "2026-11-25",
|
|
30
|
+
sentences: ["We invite papers on X."],
|
|
31
|
+
topics: ["X in practice"],
|
|
32
|
+
};
|
|
33
|
+
const venue = (body: Record<string, unknown>, name = "Our Workshop") =>
|
|
34
|
+
JSON.stringify({
|
|
35
|
+
type: "venue",
|
|
36
|
+
name,
|
|
37
|
+
url: "https://example.org/cfp",
|
|
38
|
+
extends: "paperlint:acl-latex",
|
|
39
|
+
...body,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/** What `parsePreset` throws for the preset `text`; "" when it parses. */
|
|
43
|
+
function refusalOf(text: string): string {
|
|
44
|
+
try {
|
|
45
|
+
parsePreset(text, "v.jsonc");
|
|
46
|
+
return "";
|
|
47
|
+
} catch (e) {
|
|
48
|
+
return e instanceof Error ? e.message : String(e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
describe("parsing a scope", () => {
|
|
53
|
+
it("a venue's scope is read whole, topics included", () => {
|
|
54
|
+
expect(parsePreset(venue({ scope: SCOPE }), "v.jsonc").scope).toEqual(
|
|
55
|
+
SCOPE,
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("a venue without a scope still parses, with none", () => {
|
|
60
|
+
// Guards: the field is optional, so no project's own preset breaks when it ships.
|
|
61
|
+
expect(parsePreset(venue({}), "v.jsonc").scope).toBeNull();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it.each([
|
|
65
|
+
["no sentence", { ...SCOPE, sentences: [] }, /scope\.sentences/u],
|
|
66
|
+
[
|
|
67
|
+
"an http page",
|
|
68
|
+
{ ...SCOPE, url: "http://example.org/cfp" },
|
|
69
|
+
/scope\.url/u,
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"a day that is not a date",
|
|
73
|
+
{ ...SCOPE, read: "25.11.2026" },
|
|
74
|
+
/scope\.read/u,
|
|
75
|
+
],
|
|
76
|
+
["an unknown key", { ...SCOPE, why: "x" }, /scope/u],
|
|
77
|
+
])("a scope with %s is refused, naming the field", (_, scope, field) => {
|
|
78
|
+
expect(refusalOf(venue({ scope }))).toMatch(field);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("a template family with a scope is refused: a family names no venue", () => {
|
|
82
|
+
expect(
|
|
83
|
+
refusalOf(
|
|
84
|
+
JSON.stringify({
|
|
85
|
+
type: "family",
|
|
86
|
+
extends: "paperlint:acl-latex",
|
|
87
|
+
scope: SCOPE,
|
|
88
|
+
}),
|
|
89
|
+
),
|
|
90
|
+
).toMatch(/scope/u);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("merging a scope", () => {
|
|
95
|
+
it("a child venue's scope replaces its parent's whole", () => {
|
|
96
|
+
const own = { ...SCOPE, sentences: ["Ours."], topics: undefined };
|
|
97
|
+
const r = resolve("./child.jsonc", {
|
|
98
|
+
"/work/papers/p/base.jsonc": venue({ scope: SCOPE }, "Base"),
|
|
99
|
+
"/work/papers/p/child.jsonc": venue(
|
|
100
|
+
{ extends: "./base.jsonc", scope: own },
|
|
101
|
+
"Child",
|
|
102
|
+
),
|
|
103
|
+
});
|
|
104
|
+
expect(r.ok && r.value.scope).toEqual({ ...own, topics: [] });
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("a child venue without a scope keeps its parent's", () => {
|
|
108
|
+
const r = resolve("./child.jsonc", {
|
|
109
|
+
"/work/papers/p/base.jsonc": venue({ scope: SCOPE }, "Base"),
|
|
110
|
+
"/work/papers/p/child.jsonc": venue({ extends: "./base.jsonc" }, "Child"),
|
|
111
|
+
});
|
|
112
|
+
expect(r.ok && r.value.scope).toEqual(SCOPE);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("a workshop does not take the scope of the conference it is held at", () => {
|
|
116
|
+
// Guards: AGENT is held at ICSE, and ICSE's scope is not AGENT's (the reason scope exists).
|
|
117
|
+
const r = resolve("./w.jsonc", {
|
|
118
|
+
"/work/papers/p/conf-2027.jsonc": venue({ scope: SCOPE }, "Conf"),
|
|
119
|
+
"/work/papers/p/w-2027.jsonc": venue(
|
|
120
|
+
{ workshop: true, parent: "./conf-2027.jsonc" },
|
|
121
|
+
"W",
|
|
122
|
+
),
|
|
123
|
+
"/work/papers/p/w.jsonc": venue({ extends: "./w-2027.jsonc" }, "W2"),
|
|
124
|
+
});
|
|
125
|
+
expect(r.ok).toBe(true);
|
|
126
|
+
expect(r.ok && r.value.scope).toBeNull();
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// The shipped venue editions that do not record their call's scope yet. This list may only shrink:
|
|
131
|
+
// a new edition records its scope (`add-venue`), and filling one in removes it here.
|
|
132
|
+
const WITHOUT_SCOPE = [
|
|
133
|
+
"aaai-2027",
|
|
134
|
+
"acsac-2026",
|
|
135
|
+
"agent-2027",
|
|
136
|
+
"agenticdev-2026",
|
|
137
|
+
"agentverify-2027",
|
|
138
|
+
"aidc-2026",
|
|
139
|
+
"aisec-2026",
|
|
140
|
+
"ase-2026",
|
|
141
|
+
"ccs-2026",
|
|
142
|
+
"emnlp-2026",
|
|
143
|
+
"fse-2027",
|
|
144
|
+
"icml-2027",
|
|
145
|
+
"icse-2027",
|
|
146
|
+
"icse-2028",
|
|
147
|
+
"msr-2027",
|
|
148
|
+
"naacl-2027",
|
|
149
|
+
|
|
150
|
+
"neurips-2026",
|
|
151
|
+
"nlbse-2027",
|
|
152
|
+
"realm-2026",
|
|
153
|
+
"sp-2027",
|
|
154
|
+
];
|
|
155
|
+
|
|
156
|
+
describe("the shipped venue editions", () => {
|
|
157
|
+
const venues = shippedPresets(VENUES).filter((name) => {
|
|
158
|
+
const r = resolve(`paperlint:${name}`);
|
|
159
|
+
return r.ok && r.value.identity.type === "venue";
|
|
160
|
+
});
|
|
161
|
+
const scoped = (name: string) => {
|
|
162
|
+
const r = resolve(`paperlint:${name}`);
|
|
163
|
+
return r.ok && r.value.scope !== null;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
it("every venue edition records its scope, except the listed ones", () => {
|
|
167
|
+
expect(
|
|
168
|
+
venues.filter((n) => !scoped(n) && !WITHOUT_SCOPE.includes(n)),
|
|
169
|
+
).toEqual([]);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("every listed edition still lacks its scope and still ships: the list only shrinks", () => {
|
|
173
|
+
expect(
|
|
174
|
+
WITHOUT_SCOPE.filter((n) => !venues.includes(n) || scoped(n)),
|
|
175
|
+
).toEqual([]);
|
|
176
|
+
});
|
|
177
|
+
});
|
package/src/presets.test.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { join, relative } from "node:path";
|
|
|
11
11
|
import { describe, expect, it } from "vitest";
|
|
12
12
|
import { memoryFiles } from "./adapters/memory/index.ts";
|
|
13
13
|
import { frozenText } from "../test/frozen-presets.ts";
|
|
14
|
+
import { SHIPPED_VENUES, shippedVenuesExcept } from "../test/shipped-venues.ts";
|
|
14
15
|
import { presetsDir } from "./package-dirs.ts";
|
|
15
16
|
import { parsePreset } from "./tex-requirements.ts";
|
|
16
17
|
import {
|
|
@@ -471,11 +472,21 @@ const DECLARED = {
|
|
|
471
472
|
url: "https://conf.researchr.org/track/icse-2028/icse-2028-papers",
|
|
472
473
|
},
|
|
473
474
|
"ieee-conference.jsonc": { type: "family" },
|
|
475
|
+
"langcode-2027.jsonc": {
|
|
476
|
+
type: "venue",
|
|
477
|
+
name: "LangCode",
|
|
478
|
+
url: "https://langcode2027.github.io/",
|
|
479
|
+
},
|
|
474
480
|
"msr-2027.jsonc": {
|
|
475
481
|
type: "venue",
|
|
476
482
|
name: "MSR",
|
|
477
483
|
url: "https://2027.msrconf.org/track/msr-2027-technical-papers",
|
|
478
484
|
},
|
|
485
|
+
"naacl-2027.jsonc": {
|
|
486
|
+
type: "venue",
|
|
487
|
+
name: "NAACL",
|
|
488
|
+
url: "https://2027.naacl.org/calls/main_conference_papers/",
|
|
489
|
+
},
|
|
479
490
|
"neurips-style.jsonc": { type: "family" },
|
|
480
491
|
"neurips-2026.jsonc": {
|
|
481
492
|
type: "venue",
|
|
@@ -767,7 +778,7 @@ describe("what does not resolve, and says why", () => {
|
|
|
767
778
|
"a shipped name with a typo",
|
|
768
779
|
"paperlint:agenticdve",
|
|
769
780
|
"not-found",
|
|
770
|
-
/aaai-2027, aaai-press, acl-latex, acm-acmsmall, acm-sigconf, acsac-2026, agent-2027, agenticdev-2026, agentverify-2027, aidc-2026, aisec-2026, ase-2026, ccs-2026, emnlp-2026, fse-2027, icml-2027, icml-style, icse-2027, icse-2028, ieee-conference, msr-2027, neurips-2026, neurips-style, nlbse-2027, realm-2026, sp-2027/,
|
|
781
|
+
/aaai-2027, aaai-press, acl-latex, acm-acmsmall, acm-sigconf, acsac-2026, agent-2027, agenticdev-2026, agentverify-2027, aidc-2026, aisec-2026, ase-2026, ccs-2026, emnlp-2026, fse-2027, icml-2027, icml-style, icse-2027, icse-2028, ieee-conference, langcode-2027, msr-2027, naacl-2027, neurips-2026, neurips-style, nlbse-2027, realm-2026, sp-2027/,
|
|
771
782
|
],
|
|
772
783
|
["the base TeX set", "paperlint:tex-base", "not-found", /agenticdev/],
|
|
773
784
|
[
|
|
@@ -1062,34 +1073,9 @@ describe("shippedVenueNames — what each shipped venue is called", () => {
|
|
|
1062
1073
|
it("every shipped preset, by its label and the names along its chain", () => {
|
|
1063
1074
|
const names = shippedVenueNames(deps());
|
|
1064
1075
|
// A venue is labelled by its `name`, a family by its file name.
|
|
1065
|
-
expect(names.map((n) => n.label)).toEqual(
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
"acl-latex",
|
|
1069
|
-
"acm-acmsmall",
|
|
1070
|
-
"acm-sigconf",
|
|
1071
|
-
"ACSAC",
|
|
1072
|
-
"AGENT",
|
|
1073
|
-
"AgenticDev",
|
|
1074
|
-
"AGENTVERIFY",
|
|
1075
|
-
"AIDC",
|
|
1076
|
-
"AISec",
|
|
1077
|
-
"ASE",
|
|
1078
|
-
"ACM CCS",
|
|
1079
|
-
"EMNLP",
|
|
1080
|
-
"FSE",
|
|
1081
|
-
"ICML",
|
|
1082
|
-
"icml-style",
|
|
1083
|
-
"ICSE",
|
|
1084
|
-
"ICSE",
|
|
1085
|
-
"ieee-conference",
|
|
1086
|
-
"MSR",
|
|
1087
|
-
"NeurIPS",
|
|
1088
|
-
"neurips-style",
|
|
1089
|
-
"NLBSE",
|
|
1090
|
-
"REALM",
|
|
1091
|
-
"IEEE S&P",
|
|
1092
|
-
]);
|
|
1076
|
+
expect(names.map((n) => n.label)).toEqual(
|
|
1077
|
+
SHIPPED_VENUES.map(([label]) => label),
|
|
1078
|
+
);
|
|
1093
1079
|
// AISec's parent conference is its `parent`, not an alias: ACM CCS is named by ccs alone.
|
|
1094
1080
|
expect(names.find((n) => n.label === "AISec")?.aliases).toEqual(["AISec"]);
|
|
1095
1081
|
// The year is the id's: two editions of one series share a name and differ by year.
|
|
@@ -1113,33 +1099,7 @@ describe("shippedVenueNames — what does not resolve", () => {
|
|
|
1113
1099
|
);
|
|
1114
1100
|
expect(
|
|
1115
1101
|
shippedVenueNames({ files, venuesDir: VENUES }).map((n) => n.label),
|
|
1116
|
-
).toEqual([
|
|
1117
|
-
"AAAI",
|
|
1118
|
-
"aaai-press",
|
|
1119
|
-
"acl-latex",
|
|
1120
|
-
"acm-acmsmall",
|
|
1121
|
-
"acm-sigconf",
|
|
1122
|
-
"ACSAC",
|
|
1123
|
-
"AGENT",
|
|
1124
|
-
"AgenticDev",
|
|
1125
|
-
"AGENTVERIFY",
|
|
1126
|
-
"AIDC",
|
|
1127
|
-
"AISec",
|
|
1128
|
-
"ASE",
|
|
1129
|
-
"ACM CCS",
|
|
1130
|
-
"EMNLP",
|
|
1131
|
-
"FSE",
|
|
1132
|
-
"ICML",
|
|
1133
|
-
"icml-style",
|
|
1134
|
-
"ICSE",
|
|
1135
|
-
"ICSE",
|
|
1136
|
-
"ieee-conference",
|
|
1137
|
-
"MSR",
|
|
1138
|
-
"NeurIPS",
|
|
1139
|
-
"neurips-style",
|
|
1140
|
-
"NLBSE",
|
|
1141
|
-
"IEEE S&P",
|
|
1142
|
-
]);
|
|
1102
|
+
).toEqual(shippedVenuesExcept("REALM").map(([label]) => label));
|
|
1143
1103
|
});
|
|
1144
1104
|
});
|
|
1145
1105
|
|
|
@@ -1222,6 +1182,7 @@ describe("a workshop's parent is the edition of its own year", () => {
|
|
|
1222
1182
|
["agentverify-2027", "paperlint:icse-2027"],
|
|
1223
1183
|
["aidc-2026", "paperlint:acsac-2026"],
|
|
1224
1184
|
["aisec-2026", "paperlint:ccs-2026"],
|
|
1185
|
+
["langcode-2027", "paperlint:naacl-2027"],
|
|
1225
1186
|
["nlbse-2027", "paperlint:icse-2027"],
|
|
1226
1187
|
["realm-2026", "paperlint:emnlp-2026"],
|
|
1227
1188
|
]);
|