paperlint 17.0.0 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +16 -12
  2. package/dist/folder-venue-rule.d.ts +1 -1
  3. package/dist/folder-venue-rule.d.ts.map +1 -1
  4. package/dist/folder-venue-rule.js +4 -2
  5. package/dist/folder-venue-rule.js.map +1 -1
  6. package/dist/presets.d.ts +21 -2
  7. package/dist/presets.d.ts.map +1 -1
  8. package/dist/presets.js +66 -17
  9. package/dist/presets.js.map +1 -1
  10. package/dist/tex-requirements.d.ts +2 -0
  11. package/dist/tex-requirements.d.ts.map +1 -1
  12. package/dist/tex-requirements.js +1 -0
  13. package/dist/tex-requirements.js.map +1 -1
  14. package/dist/tex-venue-rules.d.ts +2 -1
  15. package/dist/tex-venue-rules.d.ts.map +1 -1
  16. package/dist/tex-venue-rules.js +3 -2
  17. package/dist/tex-venue-rules.js.map +1 -1
  18. package/docs/rules/paper/folder-venue-leftover.md +10 -7
  19. package/docs/rules/tex/venue-leftover.md +13 -1
  20. package/docs/rules.md +3 -2
  21. package/package.json +1 -1
  22. package/presets/acm-sigconf.md +1 -1
  23. package/presets/agenticdev.jsonc +5 -2
  24. package/presets/agenticdev.md +4 -2
  25. package/presets/aisec.jsonc +9 -3
  26. package/presets/aisec.md +4 -1
  27. package/presets/ase.jsonc +145 -0
  28. package/presets/ase.md +178 -0
  29. package/presets/ccs.jsonc +87 -0
  30. package/presets/ccs.md +184 -0
  31. package/presets/icse.jsonc +100 -0
  32. package/presets/icse.md +126 -0
  33. package/presets/ieee-conference.md +1 -1
  34. package/presets/sp.jsonc +152 -0
  35. package/presets/sp.md +160 -0
  36. package/presets/venue-profile.schema.json +7 -2
  37. package/src/domain/venue-name.test.ts +4 -4
  38. package/src/folder-venue-rule.test.ts +23 -2
  39. package/src/folder-venue-rule.ts +8 -8
  40. package/src/new-paper.test.ts +2 -2
  41. package/src/paper-settings-commands.test.ts +1 -1
  42. package/src/preset-card-rule.test.ts +4 -0
  43. package/src/presets.test.ts +141 -4
  44. package/src/presets.ts +113 -22
  45. package/src/tex-requirements.ts +4 -0
  46. package/src/tex-venue-rules.test.ts +45 -1
  47. package/src/tex-venue-rules.ts +3 -2
  48. package/src/venue-rules.test.ts +2 -2
package/src/presets.ts CHANGED
@@ -28,6 +28,14 @@
28
28
  * template the child wins, with its `template_forbids`; so does `name`, and `required_sections`, `register`, `talk`,
29
29
  * `portal`, `deadlines` and `submission_fields` (each whole)
30
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
33
+ *
34
+ * ── THE PARENT CONFERENCE ─────────────────────────────────────────────────────────
35
+ * A workshop names the venue it is held at (`"parent": "paperlint:ccs"` in aisec.jsonc). The parent
36
+ * is resolved like any spec and must be a venue; its names, and its own parent's, are
37
+ * `parentNames`: names a paper of this venue may use as its own. A parent that does not resolve to
38
+ * a venue, or parents that name each other, are refused naming the file that says it.
31
39
  *
32
40
  * ── THE ID AND THE LABEL ──────────────────────────────────────────────────────────
33
41
  * The facts file and the build plan carry the preset's `id`: the spec's file name without its
@@ -106,6 +114,11 @@ export interface Preset {
106
114
  readonly template: PresetTemplate | null;
107
115
  /** Every `name` and `aliases` along the chain: what this venue is called in a paper's text. */
108
116
  readonly aliases: readonly string[];
117
+ /**
118
+ * Every name of the conference this venue is held at (`parent`), and of that one's parent: names a
119
+ * paper of this venue may use as its own. Empty when no file of the chain names a parent.
120
+ */
121
+ readonly parentNames: readonly string[];
109
122
  /** Whether the venue reviews double-blind (`anonymity/identity`); false when no file of the chain says. */
110
123
  readonly blind: boolean;
111
124
  /**
@@ -153,7 +166,11 @@ export type PresetProblem =
153
166
  /** A family extending a venue, or anything extending the base set. */
154
167
  readonly parentType: "venue" | "base";
155
168
  }
156
- | { readonly kind: "broken"; readonly file: string; readonly why: string };
169
+ | { readonly kind: "broken"; readonly file: string; readonly why: string }
170
+ /** `file` names a parent conference that does not resolve to a venue preset: `why`. */
171
+ | { readonly kind: "bad-parent"; readonly file: string; readonly why: string }
172
+ /** Venues that name each other as `parent`, in the order they were followed. */
173
+ | { readonly kind: "parent-cycle"; readonly chain: readonly string[] };
157
174
 
158
175
  /** The display label of a spec: the file name without its extension. Pure. */
159
176
  export function labelOf(spec: string): string {
@@ -284,12 +301,23 @@ const namesOf = (i: PresetIdentity): readonly string[] =>
284
301
  i.type === "venue" ? [i.name] : [];
285
302
 
286
303
  /** What the merge carries from file to file: the preset without what only the whole chain knows. */
287
- type Merging = Omit<Preset, "id" | "label" | "chain" | "identity"> & {
304
+ type Merging = Omit<
305
+ Preset,
306
+ "id" | "label" | "chain" | "identity" | "parentNames"
307
+ > & {
288
308
  readonly name: string | null;
309
+ readonly parent: ParentLink | null;
289
310
  };
290
311
 
312
+ /** A `parent` as a file of the chain names it: the spec, and the file it is resolved from. */
313
+ interface ParentLink {
314
+ readonly spec: string;
315
+ readonly file: string;
316
+ }
317
+
291
318
  const NOTHING_MERGED: Merging = {
292
319
  name: null,
320
+ parent: null,
293
321
  template: null,
294
322
  aliases: [],
295
323
  blind: false,
@@ -333,6 +361,7 @@ const mergeOne = (
333
361
  { preset: p, file }: { readonly preset: PresetFile; readonly file: string },
334
362
  ): Merging => ({
335
363
  name: nameOf(p.identity) ?? acc.name,
364
+ parent: p.parent === null ? acc.parent : { spec: p.parent, file },
336
365
  template:
337
366
  p.template === null
338
367
  ? acc.template
@@ -350,12 +379,12 @@ const mergeOne = (
350
379
  ...wholeBlocks(acc, p),
351
380
  });
352
381
 
353
- /** The chain, root first, merged into one preset. Pure. */
382
+ /** The chain, root first, merged into one preset, and the parent it names. Pure. */
354
383
  function merged(
355
384
  spec: string,
356
385
  rootFirst: readonly { readonly preset: PresetFile; readonly file: string }[],
357
386
  leaf: { readonly preset: PresetFile },
358
- ): Preset {
387
+ ): Omit<Preset, "parentNames"> & { readonly parent: ParentLink | null } {
359
388
  const { name, ...rest } = rootFirst.reduce(mergeOne, NOTHING_MERGED);
360
389
  return {
361
390
  id: labelOf(spec),
@@ -366,6 +395,62 @@ function merged(
366
395
  };
367
396
  }
368
397
 
398
+ /** A problem as a caller reads it: a missing file lists the shipped presets. */
399
+ const refusal = (p: PresetProblem, venuesDir: string): PresetProblem =>
400
+ p.kind === "not-found" ? { ...p, shipped: shippedPresets(venuesDir) } : p;
401
+
402
+ /**
403
+ * The names `parent` brings, resolved from the file that names it: the parent venue's names and its
404
+ * own `parentNames`. `below` is every venue whose parent led here, so a cycle is refused. A problem
405
+ * of a parent further up is passed on as it is: it names the file that says the bad parent.
406
+ */
407
+ function parentNamesOf(
408
+ parent: ParentLink,
409
+ below: readonly string[],
410
+ deps: PresetDeps,
411
+ ): Result<readonly string[], PresetProblem> {
412
+ const up = resolveFrom(parent.spec, parent.file, deps, below);
413
+ const bad = (why: string): Result<readonly string[], PresetProblem> =>
414
+ err({ kind: "bad-parent", file: parent.file, why });
415
+ const named = `"parent": "${parent.spec}"`;
416
+ if (!up.ok) {
417
+ const p = up.error;
418
+ if (p.kind === "bad-parent" || p.kind === "parent-cycle") return up;
419
+ // The parent's own file is missing or misspelt: say it of `parent`, not of an `extends`.
420
+ return "spec" in p && p.spec === parent.spec
421
+ ? bad(presetProblemText(p, "parent"))
422
+ : bad(`${named} does not resolve: ${presetProblemText(p)}`);
423
+ }
424
+ if (up.value.identity.type !== "venue")
425
+ return bad(
426
+ `${named} is a ${up.value.identity.type}, and a workshop's parent is the venue it is held at`,
427
+ );
428
+ return ok([...new Set([...up.value.aliases, ...up.value.parentNames])]);
429
+ }
430
+
431
+ /** `resolvePreset`, inside the venues `below` whose `parent` led here. */
432
+ function resolveFrom(
433
+ spec: string,
434
+ fromFile: string,
435
+ deps: PresetDeps,
436
+ below: readonly string[],
437
+ ): Result<Preset, PresetProblem> {
438
+ const leaf = readPreset(spec, fromFile, deps);
439
+ if (!leaf.ok) return err(refusal(leaf.error, deps.venuesDir));
440
+ const here = [...below, leaf.value.file];
441
+ if (below.includes(leaf.value.file))
442
+ return err({ kind: "parent-cycle", chain: here });
443
+ const chain = chainUp([leaf.value], leaf.value, deps);
444
+ if (!chain.ok) return err(refusal(chain.error, deps.venuesDir));
445
+ const { parent, ...preset } = merged(
446
+ spec,
447
+ [...chain.value].reverse(),
448
+ leaf.value,
449
+ );
450
+ const names = parent === null ? ok([]) : parentNamesOf(parent, here, deps);
451
+ return names.ok ? ok({ ...preset, parentNames: names.value }) : names;
452
+ }
453
+
369
454
  /**
370
455
  * `spec`, as written in `fromFile` (a paper's `paperlint.json`), → the merged preset, or why it
371
456
  * does not resolve. Reads through `deps.files` only; never throws.
@@ -375,17 +460,7 @@ export function resolvePreset(
375
460
  fromFile: string,
376
461
  deps: PresetDeps,
377
462
  ): Result<Preset, PresetProblem> {
378
- const refused = (p: PresetProblem): Result<Preset, PresetProblem> =>
379
- err(
380
- p.kind === "not-found"
381
- ? { ...p, shipped: shippedPresets(deps.venuesDir) }
382
- : p,
383
- );
384
- const leaf = readPreset(spec, fromFile, deps);
385
- if (!leaf.ok) return refused(leaf.error);
386
- const chain = chainUp([leaf.value], leaf.value, deps);
387
- if (!chain.ok) return refused(chain.error);
388
- return ok(merged(spec, [...chain.value].reverse(), leaf.value));
463
+ return resolveFrom(spec, fromFile, deps, []);
389
464
  }
390
465
 
391
466
  /** The shipped presets' names (each is spelled `paperlint:<name>`). */
@@ -433,26 +508,42 @@ export const venueOf = ({
433
508
  export const shippedVenueNames = (deps: PresetDeps): readonly ShippedVenue[] =>
434
509
  resolveShipped(deps).map(venueOf);
435
510
 
436
- /** One line for a problem, naming what to change. Pure. */
437
- export function presetProblemText(p: PresetProblem): string {
511
+ /**
512
+ * One line for a problem, naming what to change. `key` is the setting that named the spec of an
513
+ * `unsupported` or `not-found` problem. Pure.
514
+ */
515
+ export function presetProblemText(
516
+ p: PresetProblem,
517
+ key: "extends" | "parent" = "extends",
518
+ ): string {
438
519
  switch (p.kind) {
439
520
  case "unsupported":
440
- return `"extends": "${p.spec}" — a preset is \`paperlint:<name>\` (shipped) or a path starting with ./ or ../ (your own); npm presets: not yet supported. Did you mean "${shippedSpec(p.spec)}"?`;
521
+ return `"${key}": "${p.spec}" — a preset is \`paperlint:<name>\` (shipped) or a path starting with ./ or ../ (your own); npm presets: not yet supported. Did you mean "${shippedSpec(p.spec)}"?`;
441
522
  case "not-found":
442
- return `"extends": "${p.spec}" names no preset (${p.file}); shipped presets (${SHIPPED_PREFIX}<name>): ${p.shipped.join(", ")}`;
523
+ return `"${key}": "${p.spec}" names no preset (${p.file}); shipped presets (${SHIPPED_PREFIX}<name>): ${p.shipped.join(", ")}`;
443
524
  case "cycle":
444
525
  return `the presets extend each other in a cycle: ${p.chain.join(" → ")}`;
445
526
  case "too-deep":
446
527
  return `the preset chain is longer than ${String(MAX_PRESET_DEPTH)}: ${p.chain.join(" → ")}`;
447
528
  case "broken":
448
529
  return `the preset ${p.file} does not parse: ${p.why}`;
530
+ case "bad-parent":
531
+ return `the preset ${p.file} names a parent conference that does not resolve to a venue: ${p.why}`;
532
+ case "parent-cycle":
533
+ return `the presets name each other as "parent" in a cycle: ${p.chain.join(" → ")}`;
449
534
  case "wrong-parent":
450
- return p.parentType === "base"
451
- ? `the preset ${p.file} extends ${p.parent}, the TeX base set — every paper gets that set already, and no preset extends it`
452
- : `the preset ${p.file} is a template family and extends ${p.parent}, a venue — a family builds only on a family; a venue extends a family or another venue`;
535
+ return wrongParentText(p);
453
536
  }
454
537
  }
455
538
 
539
+ /** The line for a chain whose file extends a preset of a type it may not extend. Pure. */
540
+ const wrongParentText = (
541
+ p: Extract<PresetProblem, { readonly kind: "wrong-parent" }>,
542
+ ): string =>
543
+ p.parentType === "base"
544
+ ? `the preset ${p.file} extends ${p.parent}, the TeX base set — every paper gets that set already, and no preset extends it`
545
+ : `the preset ${p.file} is a template family and extends ${p.parent}, a venue — a family builds only on a family; a venue extends a family or another venue`;
546
+
456
547
  // ── a paper's preset ────────────────────────────────────────────────────────────────────
457
548
 
458
549
  /** What one paper declares and the preset it resolves to — one answer for every reader. */
@@ -205,6 +205,8 @@ export interface PresetFile {
205
205
  readonly identity: PresetIdentity;
206
206
  /** The preset this one builds on: `paperlint:<name>` or a relative path. */
207
207
  readonly extends: string | null;
208
+ /** The conference a workshop is held at, spelled as `extends` is; null when the file names none. */
209
+ readonly parent: string | null;
208
210
  /** The `\\documentclass` the venue's template uses, as the file spells it; null when it names none. */
209
211
  readonly template: string | null;
210
212
  /** Class options the venue forbids, read with `template`; empty when the file names none. */
@@ -283,6 +285,7 @@ type PresetJson = PresetBodyJson &
283
285
  /** Every key of a preset but its identity. */
284
286
  interface PresetBodyJson {
285
287
  readonly extends?: string;
288
+ readonly parent?: string;
286
289
  readonly template?: string;
287
290
  readonly template_forbids?: readonly string[];
288
291
  readonly aliases?: readonly string[];
@@ -550,6 +553,7 @@ export function parsePreset(
550
553
  return {
551
554
  identity: identityOf(j),
552
555
  extends: orNull(j.extends),
556
+ parent: orNull(j.parent),
553
557
  template: orNull(j.template),
554
558
  templateForbids: j.template_forbids ?? [],
555
559
  aliases: j.aliases ?? [],
@@ -758,7 +758,7 @@ describe("tex/venue-leftover — another venue named in the text", () => {
758
758
  const fs = leftovers(lint(tex, AIDC));
759
759
  expect(fs.map((f) => f.message)).toEqual([
760
760
  "«AISec» names AISec, and this paper extends AIDC — a leftover from an earlier submission? A reviewer reads it before the abstract. Comments and citation keys are not reported; a sentence that names the other venue on purpose can keep it with a disable directive",
761
- expect.stringContaining("«ACM CCS» names AISec"),
761
+ expect.stringContaining("«ACM CCS» names ACM CCS"),
762
762
  ]);
763
763
  const line = tex.split("\n").indexOf(INSTITUTION) + 1;
764
764
  expect(fs.map((f) => f.line)).toEqual([line, line]);
@@ -797,6 +797,46 @@ describe("tex/venue-leftover — another venue named in the text", () => {
797
797
  });
798
798
  });
799
799
 
800
+ describe("tex/venue-leftover — a workshop's parent conference (`parent`) is the paper's own", () => {
801
+ const agenticdev = (text: string) =>
802
+ paper("\\documentclass[sigconf]{acmart}", `${text}\nText.`);
803
+ const AGENTICDEV = { extends: "paperlint:agenticdev", kind: "full" };
804
+ const named = (fs: readonly Finding[]) =>
805
+ leftovers(fs).map((f) => /«(.*?)» names (.*?),/u.exec(f.message)?.slice(1));
806
+
807
+ it("an AgenticDev paper may name ASE 2026, the conference it is held at: silent", () => {
808
+ expect(
809
+ leftovers(lint(agenticdev("A workshop of ASE 2026."), AGENTICDEV)),
810
+ ).toEqual([]);
811
+ });
812
+
813
+ it("🔴 an AIDC paper naming ASE 2026 is reported once, as ASE", () => {
814
+ const tex = aidcPaper(`Formerly at ASE 2026.\n${BODY}${STATEMENT}`);
815
+ expect(named(lint(tex, AIDC))).toEqual([["ASE", "ASE"]]);
816
+ });
817
+
818
+ it("🔴 an AIDC paper naming ACM CCS 2026 is reported once, as ACM CCS; an AISec paper is silent", () => {
819
+ const text = "Co-located with ACM CCS 2026.";
820
+ expect(
821
+ named(lint(aidcPaper(`${text}\n${BODY}${STATEMENT}`), AIDC)),
822
+ ).toEqual([["ACM CCS", "ACM CCS"]]);
823
+ expect(
824
+ leftovers(
825
+ lint(agenticdev(text), {
826
+ extends: "paperlint:aisec",
827
+ kind: "research",
828
+ }),
829
+ ),
830
+ ).toEqual([]);
831
+ });
832
+
833
+ it("the parent's names are the paper's own, not the workshop's: AgenticDev still reports AISec", () => {
834
+ expect(
835
+ named(lint(agenticdev("ASE 2026, after AISec."), AGENTICDEV)),
836
+ ).toEqual([["AISec", "AISec"]]);
837
+ });
838
+ });
839
+
800
840
  describe("tex/venue-leftover — MSR, a name that is also an acronym, counts only with a year (`mentions`)", () => {
801
841
  const under = (text: string) =>
802
842
  leftovers(lint(aidcPaper(`${text}\n${BODY}${STATEMENT}`), AIDC));
@@ -1002,8 +1042,12 @@ describe("otherVenues", () => {
1002
1042
  "AgenticDev",
1003
1043
  "AGENTVERIFY",
1004
1044
  "AISec",
1045
+ "ASE",
1046
+ "ACM CCS",
1047
+ "ICSE 2028",
1005
1048
  "MSR",
1006
1049
  "NLBSE",
1050
+ "IEEE S&P",
1007
1051
  ]);
1008
1052
  });
1009
1053
  });
@@ -286,14 +286,15 @@ const literal = (s: string): string =>
286
286
 
287
287
  /**
288
288
  * Each place the rendered text names another venue — one of its aliases as a whole word, case
289
- * and all — unless that alias is also this paper's venue's own (a shared parent conference).
289
+ * and all — unless that alias is also this paper's venue's own, or its parent conference's
290
+ * (`parentNames`: an AgenticDev paper may say «ASE 2026»).
290
291
  */
291
292
  export function judgeLeftover(
292
293
  runs: readonly TextRun[],
293
294
  preset: Preset,
294
295
  others: readonly OtherVenue[],
295
296
  ): readonly Located[] {
296
- const own = new Set(preset.aliases);
297
+ const own = new Set([...preset.aliases, ...preset.parentNames]);
297
298
  const names = others.flatMap((o) =>
298
299
  o.aliases
299
300
  .filter((a) => !own.has(a))
@@ -271,13 +271,13 @@ describe("pdf/profile — the declaration must resolve, or nothing is judged", (
271
271
  "an unknown venue (a typo would silently disable every check)",
272
272
  { extends: "paperlint:agentic-dev", kind: "short" },
273
273
  "preset",
274
- /agent, agenticdev, agentverify, aidc, aisec, ieee-conference, msr, nlbse, realm/,
274
+ /agent, agenticdev, agentverify, aidc, aisec, ase, ccs, icse, ieee-conference, msr, nlbse, realm, sp/,
275
275
  ],
276
276
  [
277
277
  "the base TeX set is not a venue",
278
278
  { extends: "paperlint:tex-base" },
279
279
  "preset",
280
- /agent, agenticdev, agentverify, aidc, aisec, ieee-conference, msr, nlbse, realm/,
280
+ /agent, agenticdev, agentverify, aidc, aisec, ase, ccs, icse, ieee-conference, msr, nlbse, realm, sp/,
281
281
  ],
282
282
  [
283
283
  "paperlint.json that is not JSON",