paperlint 20.6.2 → 20.7.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.
Files changed (42) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/domain/preset-submission-fields.d.ts +15 -0
  3. package/dist/domain/preset-submission-fields.d.ts.map +1 -0
  4. package/dist/domain/preset-submission-fields.js +25 -0
  5. package/dist/domain/preset-submission-fields.js.map +1 -0
  6. package/dist/domain/venue-scope.d.ts +29 -0
  7. package/dist/domain/venue-scope.d.ts.map +1 -0
  8. package/dist/domain/venue-scope.js +18 -0
  9. package/dist/domain/venue-scope.js.map +1 -0
  10. package/dist/preset-merge.d.ts +34 -0
  11. package/dist/preset-merge.d.ts.map +1 -0
  12. package/dist/preset-merge.js +89 -0
  13. package/dist/preset-merge.js.map +1 -0
  14. package/dist/presets.d.ts +3 -2
  15. package/dist/presets.d.ts.map +1 -1
  16. package/dist/presets.js +3 -84
  17. package/dist/presets.js.map +1 -1
  18. package/dist/tex-requirements.d.ts +4 -1
  19. package/dist/tex-requirements.d.ts.map +1 -1
  20. package/dist/tex-requirements.js +3 -20
  21. package/dist/tex-requirements.js.map +1 -1
  22. package/docs/venues.md +6 -4
  23. package/package.json +1 -1
  24. package/presets/acl-latex.md +1 -1
  25. package/presets/langcode-2027.jsonc +106 -0
  26. package/presets/langcode-2027.md +79 -0
  27. package/presets/naacl-2027.jsonc +19 -0
  28. package/presets/naacl-2027.md +42 -0
  29. package/presets/venue-profile.schema.json +22 -1
  30. package/scripts/eslint-file-length.mjs +4 -4
  31. package/src/domain/preset-submission-fields.ts +49 -0
  32. package/src/domain/venue-scope.test.ts +33 -0
  33. package/src/domain/venue-scope.ts +39 -0
  34. package/src/paper-settings-commands.test.ts +1 -1
  35. package/src/preset-card-rule.test.ts +2 -0
  36. package/src/preset-merge.ts +141 -0
  37. package/src/presets-scope.test.ts +177 -0
  38. package/src/presets.test.ts +17 -56
  39. package/src/presets.ts +5 -130
  40. package/src/tex-requirements.ts +14 -45
  41. package/src/tex-venue-rules.test.ts +3 -25
  42. package/src/venue-rules.test.ts +2 -2
@@ -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
+ });
@@ -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
- "AAAI",
1067
- "aaai-press",
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
  ]);
package/src/presets.ts CHANGED
@@ -20,16 +20,7 @@
20
20
  *
21
21
  * ── THE CHAIN ─────────────────────────────────────────────────────────────────────
22
22
  * At most `MAX_PRESET_DEPTH` files, root to leaf. A cycle (relative paths can form one) is refused
23
- * naming the chain. The chain is merged block by block:
24
- *
25
- * tex union — a child never removes a package its parent needs
26
- * format per key, the child wins; `kinds` by kind name, a child's kind replaces that kind
27
- * rules per rule id, the child wins; `ruleOrigins` keeps which file set each
28
- * template the child wins, with its `template_forbids`; so does `name`, and `required_sections`, `register`, `talk`,
29
- * `portal`, `deadlines` and `submission_fields` (each whole)
30
- * aliases union, with every `name` — what the venue is called along the chain
31
- * parent the child wins: the conference a workshop is held at, a spec resolved from the
32
- * file that names it
23
+ * naming the chain. The chain is merged block by block, by `src/preset-merge.ts`.
33
24
  *
34
25
  * ── ONE PRESET PER EDITION ────────────────────────────────────────────────────────
35
26
  * A venue preset is one edition, `paperlint:<series>-<year>` (`src/domain/edition.ts`); a family's id
@@ -53,9 +44,6 @@
53
44
  */
54
45
  import { basename, dirname, extname, join, resolve } from "node:path";
55
46
  import {
56
- mergeRequirements,
57
- NO_FORMAT,
58
- NO_REQUIREMENTS,
59
47
  parsePreset,
60
48
  profileFileOf,
61
49
  venueNames,
@@ -65,6 +53,7 @@ import {
65
53
  type TexRequirements,
66
54
  type VenueFormat,
67
55
  } from "./tex-requirements.ts";
56
+ import { mergeOne, NOTHING_MERGED, type ParentLink } from "./preset-merge.ts";
68
57
  import { callerPath } from "./caller-path.ts";
69
58
  import { err, isOk, ok, type Result } from "./domain/result.ts";
70
59
  import type { Files } from "./ports/files.ts";
@@ -84,6 +73,7 @@ import type { VenueTalk } from "./domain/talk.ts";
84
73
  import type { VenuePortal } from "./domain/submission.ts";
85
74
  import type { VenueFields } from "./domain/submission-fields.ts";
86
75
  import type { Reading } from "./domain/deadline.ts";
76
+ import type { VenueScope } from "./domain/venue-scope.ts";
87
77
 
88
78
  /** The prefix of a shipped preset's spec. */
89
79
  export const SHIPPED_PREFIX = "paperlint:";
@@ -166,6 +156,8 @@ export interface Preset {
166
156
  readonly deadlines: readonly Reading[];
167
157
  /** The fields the edition's submission form asks (`paperlint submission`); null when no file of the chain records any. */
168
158
  readonly submissionFields: VenueFields | null;
159
+ /** What the call says the venue is for (`scope`), verbatim; null when no file of the chain records it. */
160
+ readonly scope: VenueScope | null;
169
161
  }
170
162
 
171
163
  /** Why a spec does not resolve. */
@@ -294,123 +286,6 @@ function chainUp(
294
286
  return chainUp([...below, r.value], r.value, deps);
295
287
  }
296
288
 
297
- /** A child's format over its parent's: per key the child wins, kinds by name. Pure. */
298
- export function mergeFormat(
299
- parent: VenueFormat,
300
- child: VenueFormat,
301
- ): VenueFormat {
302
- // Every field listed: a VenueFormat literal missing one is a compile error.
303
- const pick = <K extends Exclude<keyof VenueFormat, "kinds">>(
304
- k: K,
305
- ): VenueFormat[K] => child[k] ?? parent[k];
306
- return {
307
- pageWidthIn: pick("pageWidthIn"),
308
- pageHeightIn: pick("pageHeightIn"),
309
- columns: pick("columns"),
310
- bodyPt: pick("bodyPt"),
311
- bodyPtTol: pick("bodyPtTol"),
312
- refPtMin: pick("refPtMin"),
313
- refPtMax: pick("refPtMax"),
314
- fontsText: pick("fontsText"),
315
- fontsTitle: pick("fontsTitle"),
316
- bodyEndsAt: pick("bodyEndsAt"),
317
- appendixInBody: pick("appendixInBody"),
318
- kinds: new Map([...parent.kinds, ...child.kinds]),
319
- };
320
- }
321
-
322
- /** A venue's name; a family and the base set have none. Pure. */
323
- const nameOf = (i: PresetIdentity): string | null =>
324
- i.type === "venue" ? i.name : null;
325
-
326
- /** A venue's name as a list, empty for a family and the base set. Pure. */
327
- const namesOf = (i: PresetIdentity): readonly string[] =>
328
- i.type === "venue" ? [i.name] : [];
329
-
330
- /** What the merge carries from file to file: the preset without what only the whole chain knows. */
331
- type Merging = Omit<
332
- Preset,
333
- "id" | "label" | "chain" | "identity" | "parentNames" | "year"
334
- > & {
335
- readonly name: string | null;
336
- readonly parent: ParentLink | null;
337
- };
338
-
339
- /** A `parent` as a file of the chain names it: the spec, and the file it is resolved from. */
340
- interface ParentLink {
341
- readonly spec: string;
342
- readonly file: string;
343
- }
344
-
345
- const NOTHING_MERGED: Merging = {
346
- name: null,
347
- parent: null,
348
- template: null,
349
- templateStyle: null,
350
- aliases: [],
351
- declaredAliases: [],
352
- blind: false,
353
- requiredSections: [],
354
- tex: NO_REQUIREMENTS,
355
- format: NO_FORMAT,
356
- rules: {},
357
- ruleOrigins: {},
358
- registerAnchors: [],
359
- talk: null,
360
- portal: null,
361
- deadlines: [],
362
- submissionFields: null,
363
- };
364
-
365
- /** The blocks a child replaces whole: the child's when it names one, else its parents'. Pure. */
366
- const wholeBlocks = (
367
- acc: Merging,
368
- p: PresetFile,
369
- ): Pick<
370
- Merging,
371
- | "requiredSections"
372
- | "registerAnchors"
373
- | "talk"
374
- | "portal"
375
- | "deadlines"
376
- | "submissionFields"
377
- > => ({
378
- requiredSections: p.requiredSections ?? acc.requiredSections,
379
- registerAnchors: p.registerAnchors ?? acc.registerAnchors,
380
- talk: p.talk ?? acc.talk,
381
- portal: p.portal ?? acc.portal,
382
- deadlines: p.deadlines ?? acc.deadlines,
383
- submissionFields: p.submissionFields ?? acc.submissionFields,
384
- });
385
-
386
- /** One file of the chain, `file`, merged over what its parents gave. Pure. */
387
- const mergeOne = (
388
- acc: Merging,
389
- { preset: p, file }: { readonly preset: PresetFile; readonly file: string },
390
- ): Merging => ({
391
- name: nameOf(p.identity) ?? acc.name,
392
- parent: p.parent === null ? acc.parent : { spec: p.parent, file },
393
- template:
394
- p.template === null
395
- ? acc.template
396
- : { text: p.template, file, forbids: p.templateForbids },
397
- templateStyle:
398
- p.templateStyle === null
399
- ? acc.templateStyle
400
- : { text: p.templateStyle, file },
401
- aliases: [...new Set([...acc.aliases, ...namesOf(p.identity), ...p.aliases])],
402
- declaredAliases: [...new Set([...acc.declaredAliases, ...p.aliases])],
403
- blind: p.blind ?? acc.blind,
404
- tex: p.tex ? mergeRequirements(acc.tex, p.tex) : acc.tex,
405
- format: mergeFormat(acc.format, p.format),
406
- rules: { ...acc.rules, ...p.rules },
407
- ruleOrigins: {
408
- ...acc.ruleOrigins,
409
- ...Object.fromEntries(Object.keys(p.rules).map((id) => [id, file])),
410
- },
411
- ...wholeBlocks(acc, p),
412
- });
413
-
414
289
  /** The chain, root first, merged into one preset, and the parent it names. Pure. */
415
290
  function merged(
416
291
  spec: string,