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.
Files changed (70) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/adapters/revision-plan/index.d.ts +17 -0
  3. package/dist/adapters/revision-plan/index.d.ts.map +1 -0
  4. package/dist/adapters/revision-plan/index.js +168 -0
  5. package/dist/adapters/revision-plan/index.js.map +1 -0
  6. package/dist/domain/paper-layout.d.ts.map +1 -1
  7. package/dist/domain/paper-layout.js +4 -0
  8. package/dist/domain/paper-layout.js.map +1 -1
  9. package/dist/domain/preset-submission-fields.d.ts +15 -0
  10. package/dist/domain/preset-submission-fields.d.ts.map +1 -0
  11. package/dist/domain/preset-submission-fields.js +25 -0
  12. package/dist/domain/preset-submission-fields.js.map +1 -0
  13. package/dist/domain/revision-plan.d.ts +121 -0
  14. package/dist/domain/revision-plan.d.ts.map +1 -0
  15. package/dist/domain/revision-plan.js +15 -0
  16. package/dist/domain/revision-plan.js.map +1 -0
  17. package/dist/domain/venue-scope.d.ts +29 -0
  18. package/dist/domain/venue-scope.d.ts.map +1 -0
  19. package/dist/domain/venue-scope.js +18 -0
  20. package/dist/domain/venue-scope.js.map +1 -0
  21. package/dist/ports/revision-plan-codec.d.ts +7 -0
  22. package/dist/ports/revision-plan-codec.d.ts.map +1 -0
  23. package/dist/ports/revision-plan-codec.js +2 -0
  24. package/dist/ports/revision-plan-codec.js.map +1 -0
  25. package/dist/preset-merge.d.ts +34 -0
  26. package/dist/preset-merge.d.ts.map +1 -0
  27. package/dist/preset-merge.js +89 -0
  28. package/dist/preset-merge.js.map +1 -0
  29. package/dist/presets.d.ts +3 -2
  30. package/dist/presets.d.ts.map +1 -1
  31. package/dist/presets.js +3 -84
  32. package/dist/presets.js.map +1 -1
  33. package/dist/tex-requirements.d.ts +4 -1
  34. package/dist/tex-requirements.d.ts.map +1 -1
  35. package/dist/tex-requirements.js +3 -20
  36. package/dist/tex-requirements.js.map +1 -1
  37. package/docs/configuration.md +56 -0
  38. package/docs/layout.md +1 -0
  39. package/docs/rules/paper/allowed-files-only.md +1 -0
  40. package/docs/venues.md +6 -4
  41. package/package.json +2 -1
  42. package/presets/acl-latex.md +1 -1
  43. package/presets/langcode-2027.jsonc +106 -0
  44. package/presets/langcode-2027.md +79 -0
  45. package/presets/naacl-2027.jsonc +19 -0
  46. package/presets/naacl-2027.md +42 -0
  47. package/presets/venue-profile.schema.json +22 -1
  48. package/scripts/eslint-file-length.mjs +4 -4
  49. package/scripts/revision-plan-schema.test.ts +39 -0
  50. package/scripts/revision-plan-schema.ts +17 -0
  51. package/skills/paper-pipeline/revision-plan.schema.json +619 -0
  52. package/src/adapters/revision-plan/index.test.ts +207 -0
  53. package/src/adapters/revision-plan/index.ts +236 -0
  54. package/src/adapters/revision-plan/schema.test.ts +69 -0
  55. package/src/domain/paper-layout.test.ts +1 -0
  56. package/src/domain/paper-layout.ts +4 -0
  57. package/src/domain/preset-submission-fields.ts +49 -0
  58. package/src/domain/revision-plan.ts +127 -0
  59. package/src/domain/venue-scope.test.ts +33 -0
  60. package/src/domain/venue-scope.ts +39 -0
  61. package/src/paper-settings-commands.test.ts +1 -1
  62. package/src/ports/revision-plan-codec.ts +7 -0
  63. package/src/preset-card-rule.test.ts +2 -0
  64. package/src/preset-merge.ts +141 -0
  65. package/src/presets-scope.test.ts +177 -0
  66. package/src/presets.test.ts +17 -56
  67. package/src/presets.ts +5 -130
  68. package/src/tex-requirements.ts +14 -45
  69. package/src/tex-venue-rules.test.ts +3 -25
  70. package/src/venue-rules.test.ts +2 -2
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,
@@ -34,16 +34,18 @@ import {
34
34
  type VenueTalk,
35
35
  type VenueTalkJson,
36
36
  } from "./domain/talk.ts";
37
+ import {
38
+ submissionFieldsOf,
39
+ type SubmissionFieldsJson,
40
+ } from "./domain/preset-submission-fields.ts";
41
+ import {
42
+ scopeOf,
43
+ type VenueScope,
44
+ type VenueScopeJson,
45
+ } from "./domain/venue-scope.ts";
37
46
  import type { VenuePortal } from "./domain/submission.ts";
38
47
  import type { Reading } from "./domain/deadline.ts";
39
- import {
40
- RESERVED_FIELD_KEYS,
41
- reservedKey,
42
- declareField,
43
- type FieldDeclaration,
44
- type FieldJson,
45
- type VenueFields,
46
- } from "./domain/submission-fields.ts";
48
+ import type { VenueFields } from "./domain/submission-fields.ts";
47
49
 
48
50
  /** CTAN package name → the names that prove it is installed. */
49
51
  export type PackageProofs = Readonly<Record<string, readonly string[]>>;
@@ -231,6 +233,8 @@ export interface PresetFile {
231
233
  readonly registerAnchors: readonly RegisterAnchor[] | null;
232
234
  /** What the venue asks a presenter to send; null when the file has no `talk` block. */
233
235
  readonly talk: VenueTalk | null;
236
+ /** What the call says the venue is for, verbatim; null when the file records none. */
237
+ readonly scope: VenueScope | null;
234
238
  /** Where the venue takes submissions (`paperlint submission`); null when the file does not say. */
235
239
  readonly portal: VenuePortal | null;
236
240
  /** The edition's deadlines as they were read; null when the file names none (a child's list replaces its parent's). */
@@ -315,43 +319,7 @@ interface PresetBodyJson {
315
319
  readonly portal?: VenuePortal;
316
320
  readonly deadlines?: readonly Reading[];
317
321
  readonly submission_fields?: SubmissionFieldsJson;
318
- }
319
-
320
- /** A preset's `submission_fields` after the schema accepted it. */
321
- interface SubmissionFieldsJson {
322
- readonly source: VenueFields["source"];
323
- readonly url: string;
324
- readonly read: string;
325
- readonly fields: Readonly<Record<string, FieldJson>>;
326
- }
327
-
328
- /** A preset's `submission_fields`, or null when it records none; a reserved field name, or a field that contradicts its kind, is refused. */
329
- function submissionFieldsOf(
330
- j: SubmissionFieldsJson | undefined,
331
- file: string,
332
- ): VenueFields | null {
333
- if (j === undefined) return null;
334
- const reserved = reservedKey(Object.keys(j.fields));
335
- if (reserved !== null)
336
- throw new Error(
337
- `${file}: "submission_fields" names "${reserved}", which paperlint sends itself (${RESERVED_FIELD_KEYS.join(", ")}) — a field of that name would overwrite it`,
338
- );
339
- const declared = Object.entries(j.fields).map(
340
- ([key, f]) => [key, declareField(f)] as const,
341
- );
342
- const fields: readonly (readonly [string, FieldDeclaration])[] =
343
- declared.flatMap(([key, d]) => (d.ok ? [[key, d.value] as const] : []));
344
- const errors = declared.flatMap(([key, d]) =>
345
- d.ok ? [] : [`field "${key}": ${d.error}`],
346
- );
347
- if (errors.length > 0)
348
- throw new Error(`${file}: "submission_fields" ${errors.join("; ")}`);
349
- return {
350
- source: j.source,
351
- url: j.url,
352
- read: j.read,
353
- fields: Object.fromEntries(fields),
354
- };
322
+ readonly scope?: VenueScopeJson;
355
323
  }
356
324
 
357
325
  /** An optional field as the typed preset holds it: absent is null. */
@@ -565,6 +533,7 @@ export function parsePreset(
565
533
  rules: j.rules ?? {},
566
534
  registerAnchors: anchorsOf(j.register),
567
535
  talk: j.talk === undefined ? null : venueTalkOf(j.talk),
536
+ scope: scopeOf(j.scope),
568
537
  ...portalBlocks(j, file),
569
538
  };
570
539
  }
@@ -19,6 +19,7 @@ import { resolvePreset } from "./presets.ts";
19
19
  import { buildConfig, SHIPPED_RULES } from "./cli.ts";
20
20
  import { builtPaper } from "../test/recorded-fixture.ts";
21
21
  import { venuePreset } from "../test/support.ts";
22
+ import { shippedVenuesExcept } from "../test/shipped-venues.ts";
22
23
  import {
23
24
  lint,
24
25
  PAPER,
@@ -1433,32 +1434,9 @@ describe("otherVenues", () => {
1433
1434
  const aidc = resolvePreset("paperlint:aidc-2026", from, deps);
1434
1435
  expect(aidc.ok).toBe(true);
1435
1436
  if (!aidc.ok) return;
1437
+ // aidc's own chain (AIDC over ieee-conference) and REALM, which does not resolve here, are left out.
1436
1438
  expect(otherVenues(aidc.value, deps).map((o) => [o.label, o.year])).toEqual(
1437
- [
1438
- ["AAAI", 2027],
1439
- ["aaai-press", null],
1440
- ["acl-latex", null],
1441
- ["acm-acmsmall", null],
1442
- ["acm-sigconf", null],
1443
- ["ACSAC", 2026],
1444
- ["AGENT", 2027],
1445
- ["AgenticDev", 2026],
1446
- ["AGENTVERIFY", 2027],
1447
- ["AISec", 2026],
1448
- ["ASE", 2026],
1449
- ["ACM CCS", 2026],
1450
- ["EMNLP", 2026],
1451
- ["FSE", 2027],
1452
- ["ICML", 2027],
1453
- ["icml-style", null],
1454
- ["ICSE", 2027],
1455
- ["ICSE", 2028],
1456
- ["MSR", 2027],
1457
- ["NeurIPS", 2026],
1458
- ["neurips-style", null],
1459
- ["NLBSE", 2027],
1460
- ["IEEE S&P", 2027],
1461
- ],
1439
+ shippedVenuesExcept("AIDC", "ieee-conference", "REALM"),
1462
1440
  );
1463
1441
  });
1464
1442
  });
@@ -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
- /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/,
274
+ /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/,
275
275
  ],
276
276
  [
277
277
  "the base TeX set is not a venue",
278
278
  { extends: "paperlint:tex-base" },
279
279
  "preset",
280
- /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/,
280
+ /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/,
281
281
  ],
282
282
  [
283
283
  "paperlint.json that is not JSON",