paperlint 18.3.2 → 18.4.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 (56) hide show
  1. package/dist/adapters/memory/index.d.ts +6 -0
  2. package/dist/adapters/memory/index.d.ts.map +1 -1
  3. package/dist/adapters/memory/index.js +11 -0
  4. package/dist/adapters/memory/index.js.map +1 -1
  5. package/dist/adapters/node/index.d.ts +1 -0
  6. package/dist/adapters/node/index.d.ts.map +1 -1
  7. package/dist/adapters/node/index.js +1 -0
  8. package/dist/adapters/node/index.js.map +1 -1
  9. package/dist/adapters/node/list-tree.io.d.ts +3 -0
  10. package/dist/adapters/node/list-tree.io.d.ts.map +1 -0
  11. package/dist/adapters/node/list-tree.io.js +23 -0
  12. package/dist/adapters/node/list-tree.io.js.map +1 -0
  13. package/dist/adapters/study-registry/index.d.ts +2 -2
  14. package/dist/artifact-rules.d.ts +26 -0
  15. package/dist/artifact-rules.d.ts.map +1 -0
  16. package/dist/artifact-rules.js +117 -0
  17. package/dist/artifact-rules.js.map +1 -0
  18. package/dist/cli.d.ts.map +1 -1
  19. package/dist/cli.js +7 -1
  20. package/dist/cli.js.map +1 -1
  21. package/dist/domain/artifact.d.ts +36 -0
  22. package/dist/domain/artifact.d.ts.map +1 -0
  23. package/dist/domain/artifact.js +116 -0
  24. package/dist/domain/artifact.js.map +1 -0
  25. package/dist/lib/paper-config.d.ts.map +1 -1
  26. package/dist/lib/paper-config.js +2 -0
  27. package/dist/lib/paper-config.js.map +1 -1
  28. package/dist/paper-settings.d.ts +3 -0
  29. package/dist/paper-settings.d.ts.map +1 -1
  30. package/dist/paper-settings.js +19 -16
  31. package/dist/paper-settings.js.map +1 -1
  32. package/dist/ports/list-tree.d.ts +11 -0
  33. package/dist/ports/list-tree.d.ts.map +1 -0
  34. package/dist/ports/list-tree.js +2 -0
  35. package/dist/ports/list-tree.js.map +1 -0
  36. package/docs/configuration.md +2 -1
  37. package/docs/rules/artifact/promised.md +64 -0
  38. package/docs/rules/artifact/required-files.md +65 -0
  39. package/docs/rules.md +2 -0
  40. package/lib/paper-config.ts +3 -0
  41. package/package.json +1 -1
  42. package/src/adapters/memory/index.test.ts +9 -0
  43. package/src/adapters/memory/index.ts +15 -0
  44. package/src/adapters/node/index.ts +1 -0
  45. package/src/adapters/node/list-tree.io.ts +27 -0
  46. package/src/adapters/node/list-tree.test.ts +38 -0
  47. package/src/artifact-rules.test.ts +50 -0
  48. package/src/artifact-rules.ts +188 -0
  49. package/src/cli.ts +7 -0
  50. package/src/domain/artifact.test.ts +154 -0
  51. package/src/domain/artifact.ts +171 -0
  52. package/src/new-paper.test.ts +1 -1
  53. package/src/paper-settings.test.ts +19 -0
  54. package/src/paper-settings.ts +21 -16
  55. package/src/ports/list-tree.ts +11 -0
  56. package/src/rule-cases.test.ts +134 -1
@@ -1 +1 @@
1
- {"version":3,"file":"paper-settings.js","sourceRoot":"","sources":["../src/paper-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAGrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,YAAY,GAEb,MAAM,mBAAmB,CAAC;AA2C3B,MAAM,KAA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b,CAAC;AAED,2FAA2F;AAE3F;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,QAAgB,EAChB,QAAuB,EACvB,OAA4B;IAE5B,IAAI,QAAQ,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC1D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,YAAY,CAAC;IACzD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Every file under a folder — what the artifact rules ask of a paper's artifact folder, to judge its
3
+ * top level and its promises' globs over the same list a committed `files` list gives.
4
+ */
5
+ import type { AbsolutePath } from "../domain/paths.ts";
6
+ /**
7
+ * The regular files under `dir`, at any depth, as paths relative to it (`/`-separated), sorted;
8
+ * null when `dir` is not a directory.
9
+ */
10
+ export type ListTree = (dir: AbsolutePath) => readonly string[] | null;
11
+ //# sourceMappingURL=list-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-tree.d.ts","sourceRoot":"","sources":["../../src/ports/list-tree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=list-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-tree.js","sourceRoot":"","sources":["../../src/ports/list-tree.ts"],"names":[],"mappings":""}
@@ -103,7 +103,7 @@ refused by name. `node_modules/`, `.git/` and `<papers>/.template/` are skipped.
103
103
  ```
104
104
 
105
105
  The same keys as the root file, minus the project-only ones (`papersDir`, `structure` and the
106
- skills' keys), which are refused here by name, plus `talk`, `submission`, `authors` and `cycles`, which only a paper has. **It merges over the root file:** its `extends`,
106
+ skills' keys), which are refused here by name, plus `talk`, `submission`, `authors`, `cycles` and `artifact`, which only a paper has. **It merges over the root file:** its `extends`,
107
107
  `kind` and `pdf` win; one it does not set comes from the root.
108
108
 
109
109
  | key | what it is |
@@ -116,6 +116,7 @@ skills' keys), which are refused here by name, plus `talk`, `submission`, `autho
116
116
  | `submission` | which submission on the venue's portal is this paper's, `{ "id": 7 }` — read by [`paperlint submission`](submission.md), with the preset's `portal`. Only here: the root file refuses it |
117
117
  | `authors` | the authors as the venue's portal should record them, in the paper's order: `[{ "name": "…", "email": "…", "affiliation": "…" }]` (`affiliation` optional) — read by [`paperlint submission new`](submission.md), never guessed. Only here: the root file refuses it |
118
118
  | `cycles` | the paper's attempts at venues, one entry per attempt, oldest first — see [The paper's cycles](#the-papers-cycles) below. With it, `extends`, `kind` and `submission` are the current attempt's and may not be written beside it. Only here: the root file refuses it |
119
+ | `artifact` | the reproduction artifact: `dir` (its folder) or `files` (a committed list of its paths), `required` (top-level names, any extension) and `promises` (label → glob) — [`artifact/*`](rules/artifact/required-files.md). Only here: the root file refuses it |
119
120
  | `rules` | rule overrides for this paper alone — `{ "<rule>": "<severity>" }`, or blocks with globs relative to the paper |
120
121
  | `$comment` | a note for humans; ignored |
121
122
 
@@ -0,0 +1,64 @@
1
+ # artifact/promised
2
+
3
+ **Level:** error · **Reads:** the paper's `paperlint.json` (`artifact`), then the artifact's folder
4
+ (`artifact.dir`) or its committed list of paths (`artifact.files`) · **Reported on:** the first line
5
+ of the paper's `PIPELINE-STATUS.md`
6
+
7
+ ## What it catches
8
+
9
+ A promise in the paper's `artifact.promises` whose glob matches no path of the artifact. A promise
10
+ is one thing the paper says the artifact contains — its Data Availability sentence, written once as
11
+ a label and a glob relative to the artifact's root (`"prompts": "**/prompts/*.md"`).
12
+
13
+ It also says when it cannot look: the folder `artifact.dir` does not exist, or the list
14
+ `artifact.files` does not exist or names no file.
15
+
16
+ ## Why
17
+
18
+ "The prompts and the raw runs are in the artifact" is checked by a reviewer who opens it, after the
19
+ paper is submitted. The glob makes the same check on every lint, before.
20
+
21
+ ## Examples
22
+
23
+ Failing — the paper promises raw runs the artifact does not hold:
24
+
25
+ ```json
26
+ {
27
+ "artifact": {
28
+ "dir": "repro",
29
+ "promises": { "prompts": "**/prompts/*.md", "runs": "runs/*.jsonl" }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ```text
35
+ papers/my-paper/PIPELINE-STATUS.md
36
+ 1:1 error the artifact promise "runs" (runs/*.jsonl) matches no path of the artifact (repro):
37
+ the paper says the artifact holds it — add the files, or correct the glob in
38
+ "artifact.promises" artifact/promised
39
+ ```
40
+
41
+ Passing: each glob matches at least one file; or the paper declares no `artifact`, or an
42
+ `artifact` without `promises`.
43
+
44
+ ## Options / preset fields
45
+
46
+ No rule options. It reads the paper's own `artifact` — `dir` or `files`, as
47
+ [`artifact/required-files`](required-files.md) describes them, and `promises`: label → glob. A glob
48
+ is matched with Node's `path.matchesGlob` against every file of the folder (or every line of the
49
+ list), so the folder and its list give the same answer; `*` and `**` do not match a dot-file or a
50
+ dot-folder unless the glob names the dot (`.github/**`). A single wrapper folder around every
51
+ path is looked through, as for `required`.
52
+
53
+ ## What it does not check
54
+
55
+ - The hosted copy a reviewer downloads: only the folder or the list in the repository (#98, #415).
56
+ - Whether the files are current with the paper's text, or hold what their names say.
57
+ - Whether the promise list is complete: a sentence of the paper with no promise is not seen.
58
+ Calibrating against a venue's badged artifacts is #492.
59
+ - The paper's own «(artifact)» markers, and a DOI or archival copy.
60
+
61
+ ## How to fix
62
+
63
+ Add the files to the artifact, or correct the glob. If the paper no longer makes the promise,
64
+ remove it from `artifact.promises` in the same change as the sentence.
@@ -0,0 +1,65 @@
1
+ # artifact/required-files
2
+
3
+ **Level:** error · **Reads:** the paper's `paperlint.json` (`artifact`), then the artifact's folder
4
+ (`artifact.dir`) or its committed list of paths (`artifact.files`) · **Reported on:** the first line
5
+ of the paper's `PIPELINE-STATUS.md`
6
+
7
+ ## What it catches
8
+
9
+ A name the paper's `artifact.required` lists that is not at the top level of the artifact. A name is
10
+ matched without its extension and case: `README` is answered by `README.md`, `readme.txt` or
11
+ `README`; a `README.md` in a subfolder is not at the top level and does not count.
12
+
13
+ It also says when it cannot look: the folder `artifact.dir` does not exist, or the list
14
+ `artifact.files` does not exist or names no file.
15
+
16
+ ## Why
17
+
18
+ An artifact-evaluation committee opens the top of the artifact first, and its instructions ask for
19
+ files there (a README with setup and usage, a LICENSE). The paper names what its artifact must
20
+ hold once; the rule keeps holding it as the artifact changes.
21
+
22
+ ## Examples
23
+
24
+ Failing — the artifact has a README and no LICENSE:
25
+
26
+ ```json
27
+ { "artifact": { "dir": "repro", "required": ["README", "LICENSE"] } }
28
+ ```
29
+
30
+ ```text
31
+ papers/my-paper/PIPELINE-STATUS.md
32
+ 1:1 error the artifact (repro) has no top-level LICENSE — any extension counts (LICENSE.md,
33
+ LICENSE.txt, LICENSE); "artifact.required" in paperlint.json asks for one
34
+ artifact/required-files
35
+ ```
36
+
37
+ Passing: `repro/README.md` and `repro/LICENSE` are there; or the paper declares no `artifact`, or
38
+ an `artifact` without `required` — the rule then has nothing to judge.
39
+
40
+ ## Options / preset fields
41
+
42
+ No rule options. It reads only the paper's own `artifact` ([configuration](../../configuration.md#a-papers-paperlintjson)).
43
+ `dir` is the artifact's folder, relative to the paper (usually `repro`); `files`, instead, is a
44
+ committed text file listing the artifact's paths one per line, as `zipinfo -1` or `find . -type f`
45
+ print them, for a bundle that is not committed; `required` lists the top-level names without an
46
+ extension (`["README", "LICENSE"]`).
47
+
48
+ Exactly one of `dir` and `files`. In a list, blank lines and folder entries (`data/`) are skipped
49
+ and a leading `./` is dropped. A single wrapper folder is looked through: when every path sits in
50
+ one folder and no file stands beside it (`repo-main/…` from GitHub's Download ZIP, Zenodo's and
51
+ OSF's archives), the top level is that folder's.
52
+
53
+ ## What it does not check
54
+
55
+ - The hosted copy a reviewer downloads (an anonymous link, OSF, Zenodo): only the folder or the list
56
+ in the repository. Comparing the two is #98 and #415.
57
+ - Whether the files are current with the paper's text, or what the README says.
58
+ - Whether `required` is complete: it holds what the paper declares, and no venue's list is built in.
59
+ Calibrating such a list on a venue's badged artifacts is #492.
60
+ - The paper's own «(artifact)» markers, and a DOI or archival copy.
61
+
62
+ ## How to fix
63
+
64
+ Add the file to the artifact's top level, or regenerate the list after adding it to the bundle.
65
+ If the paper no longer needs the name, remove it from `artifact.required`.
package/docs/rules.md CHANGED
@@ -20,6 +20,8 @@ reads and when it fails. Errors fail `paperlint lint`; warnings print and do not
20
20
  | [`versions/layout`](rules/versions/layout.md) | error | `versions/`, `versions/lock.json` → `paperlint.json` (`cycles`) | with `cycles` declared: an entry of `versions/` that is not `lock.json` or a folder named by a cycle id, a file in a cycle's folder that is not `<stage>.pdf`/`.tex` (`submitted`, `camera-ready`, `arxiv`; approved has a .tex only) or `changes.yaml`, a PDF without its source (unless the lock records it lost), a PDF sent from a cycle still `porting`, or a frozen file that does not match `versions/lock.json`; reported on `PIPELINE-STATUS.md` — [page](rules/versions/layout.md) |
21
21
  | [`paper/folder-venue-leftover`](rules/paper/folder-venue-leftover.md) | warn | the folder name → `paperlint.json` | the paper's folder is named after another shipped venue than the one it extends (`papers/aisec-2026/` for a paper now set for AIDC); reported on `PIPELINE-STATUS.md` — [page](rules/paper/folder-venue-leftover.md) |
22
22
  | [`paper/edition-over`](rules/paper/edition-over.md) | warn | `paperlint.json` → the venue preset, and the clock | every deadline the paper's edition preset records has passed: the edition is over; names the newer editions of the series paperlint ships — [page](rules/paper/edition-over.md) |
23
+ | [`artifact/required-files`](rules/artifact/required-files.md) | error; silent without `artifact.required` | `paperlint.json` (`artifact`) → the artifact's folder or its committed list of paths | a name the paper requires at the artifact's top level (`README`, `LICENSE`; any extension) is not there, or the folder or list is missing — [page](rules/artifact/required-files.md) |
24
+ | [`artifact/promised`](rules/artifact/promised.md) | error; silent without `artifact.promises` | `paperlint.json` (`artifact`) → the artifact's folder or its committed list of paths | a promise of the paper (a label and a glob) matches no path of the artifact, or the folder or list is missing — [page](rules/artifact/promised.md) |
23
25
  | [`paper/allowed-files-only`](rules/paper/allowed-files-only.md) | error | the paper folder's root listing → `paperlint.json` | a file or folder at the paper's root is not part of the layout (`PLAN.md`, `archive/`, a stray PDF); reported on `PIPELINE-STATUS.md`, once per entry, with where it goes; `extra/` takes anything — [page](rules/paper/allowed-files-only.md) |
24
26
  | [`repro/allowed-files-only`](rules/repro/allowed-files-only.md) | error | the listing of the paper's `repro/` | an entry at the top of `repro/` is not `README.md`, `studies.json`, `.gitignore`, `tools/`, `data/` or a study folder named `<id>-<slug>` (or, in a paper without the registry, `<slug>-YYYY-MM-DD`), or a study folder has no `README.md`; reported on `PIPELINE-STATUS.md`, once per entry, with where it goes by kind (a script → `repro/tools/`, data → `repro/data/`, a note → its study or `research/`) — [page](rules/repro/allowed-files-only.md) |
25
27
  | [`repro/study-registered`](rules/repro/study-registered.md) | error | the listing of the paper's `repro/`, `repro/studies.json`, `repro/README.md`, each study's `plan.json` | a study folder with no row in `repro/studies.json`, a row whose folder is missing or not `<id>-<slug>`, a bad or repeated id, a title over 8 words, `done` without a result and an existing result file, `superseded` without an existing successor, a row naming a measurement the registry does not declare, a measurement with no study or an unknown requirement, a headline measurement not approved by the author, a plan that is missing, malformed or — once the study runs — unfilled, a headline study that has run without the author's check in its plan, or the index in `repro/README.md` out of sync with the registry; `paperlint studies new` and `paperlint studies index` write both — [page](rules/repro/study-registered.md) |
@@ -147,6 +147,8 @@ export const SETTINGS_KEYS: Readonly<Record<string, string>> = Object.freeze({
147
147
  'the paper\'s answers to the venue\'s own form fields, keyed as the preset\'s "submission_fields" names them: { "topics": ["<an option>"], "paper_type": "<one option>", "pc_conflicts": { "<pc email>": "<conflict type>" }, … } — checked against those fields, every required one filled, then sent by paperlint submission new and update. Set only in a paper\'s own paperlint.json; in the root paperlint.json it is an error',
148
148
  cycles:
149
149
  "the paper's attempts at venues, oldest first: [{ id, venue, kind, opened, phase?, deadlines, submission?, outcome }] — extends, kind and submission are then the current attempt's, and the cycle/ rules judge the record. Set only in a paper's own paperlint.json; in the root paperlint.json it is an error",
150
+ artifact:
151
+ 'the paper\'s reproduction artifact and what it must hold: { "dir": "<folder>" or "files": "<committed list of its paths>", "required"?: ["README", "LICENSE"], "promises"?: { "<label>": "<glob>" } } — artifact/required-files, artifact/promised. Set only in a paper\'s own paperlint.json; in the root paperlint.json it is an error',
150
152
  scripts: "how skill prose names the scripts — consumer.mjs",
151
153
  timezone: "the zone deadline anchors are written in — consumer.mjs",
152
154
  contactEmail: "the polite-pool address for citation lookups — consumer.mjs",
@@ -162,6 +164,7 @@ export const PAPER_ONLY_KEYS: readonly string[] = Object.freeze([
162
164
  "authors",
163
165
  "fields",
164
166
  "cycles",
167
+ "artifact",
165
168
  ]);
166
169
 
167
170
  /** The keys that only mean something for the whole project: refused in a paper's `paperlint.json`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperlint",
3
- "version": "18.3.2",
3
+ "version": "18.4.0",
4
4
  "description": "A linter for scientific papers written in LaTeX: catches mistakes before you submit to a conference or journal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -6,6 +6,7 @@ import {
6
6
  fixedDownload,
7
7
  memoryFiles,
8
8
  memoryListEntries,
9
+ memoryListTree,
9
10
  memoryCopyFile,
10
11
  memoryMoveFile,
11
12
  memoryWorkspace,
@@ -59,3 +60,11 @@ test("memoryListEntries: each name directly under a directory, a file or a direc
59
60
  { name: "out", kind: "dir" },
60
61
  ]);
61
62
  });
63
+
64
+ test("memoryListTree: every file under a folder, relative and sorted; none under it is null", () => {
65
+ const files = memoryFiles({ "/a/z.md": "", "/a/p/b.md": "", "/ab/c": "" });
66
+ const tree = memoryListTree(files);
67
+ // Guards: a sibling whose name only starts like the folder (`/ab`) is not under it.
68
+ assert.deepEqual(tree(absolutePath("/a")), ["p/b.md", "z.md"]);
69
+ assert.equal(tree(absolutePath("/none")), null);
70
+ });
@@ -5,6 +5,7 @@
5
5
  import { absolutePath } from "../../domain/paths.ts";
6
6
  import type { Download } from "../../ports/download.ts";
7
7
  import type { Files } from "../../ports/files.ts";
8
+ import type { ListTree } from "../../ports/list-tree.ts";
8
9
  import type { ListDir } from "../../ports/talk-media.ts";
9
10
  import type { ListEntries } from "../../ports/list-entries.ts";
10
11
  import type { CopyFile, MoveFile } from "../../ports/move-file.ts";
@@ -74,6 +75,20 @@ export const memoryListDir =
74
75
  ),
75
76
  ];
76
77
 
78
+ /**
79
+ * `ListTree` over `memoryFiles`: every file under a folder, relative and sorted; null when no file is
80
+ * under it (memory holds no empty folder).
81
+ */
82
+ export const memoryListTree =
83
+ (files: MemoryFiles): ListTree =>
84
+ (dir) => {
85
+ const under = [...files.map.keys()]
86
+ .filter((k) => k.startsWith(`${dir}/`))
87
+ .map((k) => k.slice(dir.length + 1))
88
+ .toSorted();
89
+ return under.length === 0 ? null : under;
90
+ };
91
+
77
92
  /** `MoveFile` over `memoryFiles`: the bytes under the new path, none under the old; nothing there throws. */
78
93
  /** `CopyFile` over `memoryFiles`: the bytes under the new path too; nothing there throws. */
79
94
  export const memoryCopyFile =
@@ -37,3 +37,4 @@ export { hostDirs } from "./host.io.ts";
37
37
  export { nodeListDir } from "./list-dir.io.ts";
38
38
  export { nodeListEntries } from "./list-entries.io.ts";
39
39
  export { nodeCopyFile, nodeMoveFile } from "./move-file.io.ts";
40
+ export { nodeListTree } from "./list-tree.io.ts";
@@ -0,0 +1,27 @@
1
+ /** `ListTree` over `node:fs`: a recursive `readdirSync` under a folder, its regular files only. */
2
+ import { readdirSync, statSync } from "node:fs";
3
+ import { join, relative, sep } from "node:path";
4
+ import type { AbsolutePath } from "../../domain/paths.ts";
5
+ import type { ListTree } from "../../ports/list-tree.ts";
6
+ import { codeOf } from "../../domain/text.ts";
7
+
8
+ /** Whether `dir` is a directory; a path that is absent or runs through a file is not. */
9
+ function isDir(dir: AbsolutePath): boolean {
10
+ try {
11
+ return statSync(dir).isDirectory();
12
+ } catch (e) {
13
+ const code = codeOf(e);
14
+ if (code === "ENOENT" || code === "ENOTDIR") return false;
15
+ throw e;
16
+ }
17
+ }
18
+
19
+ export const nodeListTree: ListTree = (dir) =>
20
+ isDir(dir)
21
+ ? readdirSync(dir, { recursive: true, withFileTypes: true })
22
+ .filter((d) => d.isFile())
23
+ .map((d) =>
24
+ relative(dir, join(d.parentPath, d.name)).split(sep).join("/"),
25
+ )
26
+ .toSorted()
27
+ : null;
@@ -0,0 +1,38 @@
1
+ /** `nodeListTree`: every file under a folder; null for a folder that is not one; other errors thrown. */
2
+ import { mkdirSync, writeFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { describe, expect, it } from "vitest";
5
+ import { absolutePath } from "../../domain/paths.ts";
6
+ import { useTempDir } from "../../../test/support.ts";
7
+ import { nodeListTree } from "./list-tree.io.ts";
8
+
9
+ const root = useTempDir("paperlint-list-tree-");
10
+
11
+ describe("nodeListTree", () => {
12
+ it("lists every file at any depth, relative and sorted; folders are not files; an empty folder is []", () => {
13
+ mkdirSync(join(root, "a", "prompts", "deep"), { recursive: true });
14
+ mkdirSync(join(root, "a", "empty"));
15
+ writeFileSync(join(root, "a", "README.md"), "");
16
+ writeFileSync(join(root, "a", ".env"), "");
17
+ writeFileSync(join(root, "a", "prompts", "b.md"), "");
18
+ writeFileSync(join(root, "a", "prompts", "deep", "c.md"), "");
19
+ expect(nodeListTree(absolutePath(join(root, "a")))).toEqual([
20
+ ".env",
21
+ "README.md",
22
+ "prompts/b.md",
23
+ "prompts/deep/c.md",
24
+ ]);
25
+ expect(nodeListTree(absolutePath(join(root, "a", "empty")))).toEqual([]);
26
+ });
27
+
28
+ it("is null for a folder that does not exist, a file, or a path through one", () => {
29
+ expect(nodeListTree(absolutePath(join(root, "none")))).toBeNull();
30
+ writeFileSync(join(root, "f"), "");
31
+ expect(nodeListTree(absolutePath(join(root, "f")))).toBeNull();
32
+ expect(nodeListTree(absolutePath(join(root, "f", "x")))).toBeNull();
33
+ });
34
+
35
+ it("throws any other error", () => {
36
+ expect(() => nodeListTree(absolutePath(`${root}/a\0b`))).toThrow();
37
+ });
38
+ });
@@ -0,0 +1,50 @@
1
+ /**
2
+ * `artifact/required-files` and `artifact/promised` (`src/artifact-rules.ts`) where real ESLint never
3
+ * takes them: a `paperlint.json` that `paperlint lint` refuses before ESLint runs, and a file other
4
+ * than `PIPELINE-STATUS.md`. Each finding is in `src/rule-cases.test.ts`, through the CLI.
5
+ */
6
+ import { describe, expect, it } from "vitest";
7
+ import { memoryFiles, memoryListTree } from "./adapters/memory/index.ts";
8
+ import { ARTIFACT_RULE_LEVELS, artifactRules } from "./artifact-rules.ts";
9
+
10
+ const DIR = "/work/papers/p";
11
+ const DECLARED = JSON.stringify({
12
+ artifact: { dir: "gone", required: ["README"], promises: { p: "*.md" } },
13
+ });
14
+
15
+ /** How many findings each rule makes on the paper's `file`, its paperlint.json being `settings`. */
16
+ function counts(settings: string, file = "PIPELINE-STATUS.md"): number[] {
17
+ const files = memoryFiles({ [`${DIR}/paperlint.json`]: settings });
18
+ const rules = artifactRules({ files, listTree: memoryListTree(files) });
19
+ return [rules["required-files"], rules.promised].map((rule) => {
20
+ const out: string[] = [];
21
+ rule
22
+ .create({
23
+ filename: `${DIR}/${file}`,
24
+ sourceCode: { getLocFromIndex: () => ({ line: 1, column: 0 }) },
25
+ report: (d) => {
26
+ out.push(d.messageId);
27
+ },
28
+ })
29
+ .root?.();
30
+ return out.length;
31
+ });
32
+ }
33
+
34
+ describe("the artifact rules", () => {
35
+ it("🔴 the declared folder missing: each rule reports it on PIPELINE-STATUS.md", () => {
36
+ expect(counts(DECLARED)).toEqual([1, 1]);
37
+ });
38
+
39
+ it("silent on any file but PIPELINE-STATUS.md, and on a paperlint.json that does not parse", () => {
40
+ expect(counts(DECLARED, "paper.tex")).toEqual([0, 0]);
41
+ expect(counts("{")).toEqual([0, 0]);
42
+ });
43
+
44
+ it("the level: both on, as errors — silent for a paper that declares no artifact", () => {
45
+ expect(ARTIFACT_RULE_LEVELS).toEqual({
46
+ "artifact/required-files": "error",
47
+ "artifact/promised": "error",
48
+ });
49
+ });
50
+ });
@@ -0,0 +1,188 @@
1
+ /**
2
+ * THE ARTIFACT RULES — the artifact holds what the paper's own `paperlint.json` says it must
3
+ * (`src/domain/artifact.ts`): `artifact/required-files` (each `artifact.required` name at its top
4
+ * level) and `artifact/promised` (each `artifact.promises` glob matches a path). The paths are every
5
+ * file under `artifact.dir` (the `ListTree` port) or the lines of the committed list `artifact.files`.
6
+ *
7
+ * On by default and silent for a paper that declares nothing they read, as the talk rules are for a
8
+ * paper without `talk`; silent on a `paperlint.json` that does not parse (`pdf/profile` says why). A
9
+ * missing folder, or a list missing or empty: each rule says so, naming what it could not check.
10
+ */
11
+ import { basename, dirname, resolve } from "node:path";
12
+ import { callerPath } from "./caller-path.ts";
13
+ import {
14
+ brokenPromises,
15
+ listedPaths,
16
+ missingRequired,
17
+ type PaperArtifact,
18
+ } from "./domain/artifact.ts";
19
+ import type { Files } from "./ports/files.ts";
20
+ import type { ListTree } from "./ports/list-tree.ts";
21
+ import type {
22
+ FolderRuleContext,
23
+ FolderRuleModule,
24
+ } from "./folder-venue-rule.ts";
25
+ import { readPaperSettings } from "./paper-settings.ts";
26
+ import { rulePageUrl, type Finding } from "./venue-rules.ts";
27
+
28
+ /** The file the rules report on: one per paper folder, whatever the paper's source format. */
29
+ const STATUS_FILE = "PIPELINE-STATUS.md";
30
+
31
+ export interface ArtifactRuleDeps {
32
+ readonly files: Files;
33
+ readonly listTree: ListTree;
34
+ }
35
+
36
+ type ArtifactRuleName = "required-files" | "promised";
37
+
38
+ /** A rule of this file: a folder rule that reports a problem, not a suggestion. */
39
+ interface ArtifactRuleModule {
40
+ readonly meta: Omit<FolderRuleModule["meta"], "type"> & {
41
+ readonly type: "problem";
42
+ };
43
+ create(context: FolderRuleContext): { root?: () => void };
44
+ }
45
+
46
+ /** The artifact's paths, relative to its root, or why there are none to judge. */
47
+ type Listing =
48
+ | { readonly kind: "paths"; readonly paths: readonly string[] }
49
+ | { readonly kind: "noDir" | "noList" | "emptyList"; readonly path: string };
50
+
51
+ /** The paths of the artifact `a` declares, read through `deps`; `paperDir` is what its paths are relative to. */
52
+ function listing(
53
+ paperDir: string,
54
+ a: PaperArtifact,
55
+ deps: ArtifactRuleDeps,
56
+ ): Listing {
57
+ const at = callerPath(resolve(paperDir, a.source.path));
58
+ const { path } = a.source;
59
+ if (a.source.kind === "dir") {
60
+ const paths = deps.listTree(at);
61
+ return paths === null ? { kind: "noDir", path } : { kind: "paths", paths };
62
+ }
63
+ const bytes = deps.files.readBytes(at);
64
+ if (bytes === null) return { kind: "noList", path };
65
+ const paths = listedPaths(new TextDecoder().decode(bytes));
66
+ return paths.length === 0
67
+ ? { kind: "emptyList", path }
68
+ : { kind: "paths", paths };
69
+ }
70
+
71
+ /** The three messages about where the paths come from, naming what `what` could not be checked. */
72
+ const sourceMessages = (what: string): Readonly<Record<string, string>> => ({
73
+ noDir: `the artifact folder {{path}} ("artifact.dir" in paperlint.json, relative to the paper) does not exist or is not a folder, so ${what} cannot be checked`,
74
+ noList: `the artifact's list of paths {{path}} ("artifact.files" in paperlint.json, relative to the paper) does not exist, so ${what} cannot be checked`,
75
+ emptyList: `the artifact's list of paths {{path}} names no file, so ${what} cannot be checked — write one path per line, relative to the artifact's root, as \`zipinfo -1\` or \`find . -type f\` print them`,
76
+ });
77
+
78
+ /** Each rule: its page's line, its messages, whether the paper declared what it reads, and its judgement over the paths. */
79
+ const RULES: Readonly<
80
+ Record<
81
+ ArtifactRuleName,
82
+ {
83
+ readonly description: string;
84
+ readonly messages: Readonly<Record<string, string>>;
85
+ readonly declared: (a: PaperArtifact) => boolean;
86
+ readonly judge: (
87
+ a: PaperArtifact,
88
+ paths: readonly string[],
89
+ ) => readonly Finding[];
90
+ }
91
+ >
92
+ > = {
93
+ "required-files": {
94
+ description:
95
+ "each name the paper's artifact.required lists is at the top level of the artifact, with any extension",
96
+ messages: {
97
+ ...sourceMessages("its required names"),
98
+ missing:
99
+ 'the artifact ({{where}}) has no top-level {{name}} — any extension counts ({{name}}.md, {{name}}.txt, {{name}}); "artifact.required" in paperlint.json asks for one',
100
+ },
101
+ declared: (a) => a.required.length > 0,
102
+ judge: (a, paths) =>
103
+ missingRequired(a.required, paths).map((name) => ({
104
+ messageId: "missing",
105
+ data: { name, where: a.source.path },
106
+ })),
107
+ },
108
+ promised: {
109
+ description:
110
+ "each glob the paper's artifact.promises lists matches a path of the artifact",
111
+ messages: {
112
+ ...sourceMessages("its promises"),
113
+ broken:
114
+ 'the artifact promise "{{label}}" ({{glob}}) matches no path of the artifact ({{where}}): the paper says the artifact holds it — add the files, or correct the glob in "artifact.promises"',
115
+ },
116
+ declared: (a) => Object.keys(a.promises).length > 0,
117
+ judge: (a, paths) =>
118
+ brokenPromises(a.promises, paths).map(([label, glob]) => ({
119
+ messageId: "broken",
120
+ data: { label, glob, where: a.source.path },
121
+ })),
122
+ },
123
+ };
124
+
125
+ /** The findings of rule `name` for the paper folder `dir`. Reads through `deps`; never throws. */
126
+ export function artifactFindings(
127
+ name: ArtifactRuleName,
128
+ dir: string,
129
+ deps: ArtifactRuleDeps,
130
+ ): readonly Finding[] {
131
+ const settings = readPaperSettings(deps.files, dir);
132
+ const a = settings.ok ? (settings.value?.artifact ?? null) : null;
133
+ const { declared, judge } = RULES[name];
134
+ if (a === null || !declared(a)) return [];
135
+ const l = listing(dir, a, deps);
136
+ return l.kind === "paths"
137
+ ? judge(a, l.paths)
138
+ : [{ messageId: l.kind, data: { path: l.path } }];
139
+ }
140
+
141
+ function rule(
142
+ name: ArtifactRuleName,
143
+ deps: ArtifactRuleDeps,
144
+ ): ArtifactRuleModule {
145
+ const meta = RULES[name];
146
+ return {
147
+ meta: {
148
+ type: "problem",
149
+ docs: {
150
+ description: meta.description,
151
+ url: rulePageUrl(`artifact/${name}`),
152
+ },
153
+ schema: [],
154
+ messages: meta.messages,
155
+ },
156
+ create(context) {
157
+ if (basename(context.filename) !== STATUS_FILE) return {};
158
+ return {
159
+ root() {
160
+ const at = context.sourceCode.getLocFromIndex(0);
161
+ artifactFindings(name, dirname(context.filename), deps).forEach(
162
+ (f) => {
163
+ context.report({ loc: { start: at, end: at }, ...f });
164
+ },
165
+ );
166
+ },
167
+ };
168
+ },
169
+ };
170
+ }
171
+
172
+ /** The artifact rules, as the rules of the `artifact` plugin. */
173
+ export function artifactRules(
174
+ deps: ArtifactRuleDeps,
175
+ ): Readonly<Record<ArtifactRuleName, ArtifactRuleModule>> {
176
+ return {
177
+ "required-files": rule("required-files", deps),
178
+ promised: rule("promised", deps),
179
+ };
180
+ }
181
+
182
+ /** The level each artifact rule is on at, for every paper's `PIPELINE-STATUS.md`. Silent for a paper without `artifact`. */
183
+ export const ARTIFACT_RULE_LEVELS: Readonly<
184
+ Record<`artifact/${ArtifactRuleName}`, "error">
185
+ > = {
186
+ "artifact/required-files": "error",
187
+ "artifact/promised": "error",
188
+ };