paperlint 20.1.0 → 20.1.2

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 (86) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.github/workflows/ci.yml +7 -0
  3. package/CLAUDE.md +2 -2
  4. package/CONTRIBUTING.md +2 -2
  5. package/{action.harness.mjs → action.test.mjs} +147 -138
  6. package/dist/domain/paper-layout.d.ts +18 -6
  7. package/dist/domain/paper-layout.d.ts.map +1 -1
  8. package/dist/domain/paper-layout.js +44 -38
  9. package/dist/domain/paper-layout.js.map +1 -1
  10. package/dist/eslint-rules/papers.js +1 -1
  11. package/dist/folder-layout-hook.js +1 -1
  12. package/dist/latex-log.d.ts +1 -1
  13. package/dist/latex-log.js +1 -1
  14. package/dist/latex-loop.d.ts +1 -1
  15. package/dist/latex-loop.js +1 -1
  16. package/dist/lib/paper-config.d.ts +3 -3
  17. package/dist/lib/paper-config.js +3 -3
  18. package/docs/e2e.md +9 -9
  19. package/docs/install.md +11 -11
  20. package/docs/rules/paper/allowed-files-only.md +31 -28
  21. package/docs/testing.md +3 -4
  22. package/eslint-rules/{install-path-literals.harness.mjs → install-path-literals.test.mjs} +14 -13
  23. package/eslint-rules/{latex-language.harness.mjs → latex-language-rules.test.mjs} +61 -51
  24. package/eslint-rules/{paper-stages.harness.mjs → paper-stages-rule.test.mjs} +66 -69
  25. package/eslint-rules/{papers.harness.mjs → papers.test.mjs} +41 -30
  26. package/eslint-rules/papers.ts +1 -1
  27. package/eslint-rules/{pdf-last-page-balance.harness.mjs → pdf-last-page-balance.test.mjs} +27 -15
  28. package/eslint-rules/{temp-root-realpath.harness.mjs → temp-root-realpath.test.mjs} +24 -24
  29. package/eslint-rules/{tex-build.harness.mjs → tex-build.test.mjs} +292 -271
  30. package/eslint.config.mjs +15 -2
  31. package/fixtures/pdf-facts/README.md +1 -1
  32. package/fixtures/render-paper/build-clean.sh +1 -1
  33. package/fixtures/toolchain-mirror/install-tl +1 -1
  34. package/lib/{agent-cli-version.harness.mjs → agent-cli-version.test.mjs} +17 -18
  35. package/lib/{paper-config.harness.mjs → paper-config.test.mjs} +21 -20
  36. package/lib/paper-config.ts +3 -3
  37. package/lib/{skill-trigger-cases.harness.mjs → skill-trigger-cases-carrier.test.mjs} +78 -115
  38. package/package.json +3 -3
  39. package/presets/acm-acmsmall.jsonc +1 -1
  40. package/scripts/check-workflow.test.ts +368 -0
  41. package/scripts/check.ts +2 -2
  42. package/scripts/eslint-file-length.mjs +9 -9
  43. package/scripts/eslint-report-guard.mjs +1 -1
  44. package/scripts/eslint-report-guard.test.mjs +1 -1
  45. package/scripts/harness-api.test.ts +7 -46
  46. package/scripts/{rules-see-files.harness.mjs → rules-see-files-rule.test.mjs} +10 -6
  47. package/scripts/rules-see-files.mjs +1 -1
  48. package/skills/paper-pipeline/{paper-pipeline.harness.mjs → paper-pipeline.test.mjs} +45 -46
  49. package/skills/paper-pipeline/scripts/{consumer.harness.mjs → consumer-paths.test.mjs} +66 -59
  50. package/skills/paper-pipeline/scripts/consumer.mjs +3 -3
  51. package/skills/paper-pipeline/scripts/{extract-ref-facts.harness.mjs → extract-ref-facts-cli.test.mjs} +29 -31
  52. package/skills/paper-pipeline/scripts/fixtures/real-bib/refs.bib +1 -1
  53. package/skills/paper-pipeline/scripts/{generated-code.harness.mjs → generated-code-fixtures.test.mjs} +39 -46
  54. package/skills/render-paper/{extract-pdf-facts.harness.ts → extract-pdf-facts.test.ts} +20 -13
  55. package/skills/render-paper/{render-paper.harness.mjs → render-paper.test.mjs} +41 -40
  56. package/src/adapters/pdfjs/fill.test.ts +1 -1
  57. package/src/{build-engine.harness.mjs → build-engine-prepare.test.mjs} +98 -81
  58. package/src/{build.harness.mjs → build-fake-tex.test.mjs} +61 -28
  59. package/src/{cli.harness.mjs → cli-e2e.test.mjs} +109 -103
  60. package/src/cli.test.ts +2 -2
  61. package/src/{doctor.harness.mjs → doctor-install.test.mjs} +28 -29
  62. package/src/domain/paper-layout.test.ts +89 -49
  63. package/src/domain/paper-layout.ts +61 -42
  64. package/src/{engine.harness.mjs → engine.test.mjs} +120 -106
  65. package/src/facts-file.test.ts +1 -1
  66. package/src/folder-layout-hook.test.ts +1 -1
  67. package/src/folder-layout-hook.ts +1 -1
  68. package/src/folder-layout-rule.test.ts +1 -1
  69. package/src/{hooks-settings.harness.ts → hooks-settings.test.ts} +161 -146
  70. package/src/latex-log.test.ts +395 -0
  71. package/src/latex-log.ts +1 -1
  72. package/src/latex-loop.test.ts +553 -0
  73. package/src/latex-loop.ts +1 -1
  74. package/src/layout-docs.test.ts +47 -0
  75. package/src/{link-skills.harness.ts → link-skills-fs.test.ts} +26 -26
  76. package/src/{new-paper.harness.mjs → new-paper-scaffold.test.mjs} +31 -19
  77. package/src/{pdf-facts.harness.ts → pdf-facts-tables.test.ts} +28 -22
  78. package/src/{pdf-geometry.harness.ts → pdf-geometry.test.ts} +93 -75
  79. package/src/{rules-config.harness.ts → rules-config.test.ts} +41 -31
  80. package/src/{structure.harness.ts → structure.test.ts} +12 -10
  81. package/src/{tex-requirements.harness.ts → tex-requirements-tables.test.ts} +106 -85
  82. package/src/{toolchain.harness.mjs → toolchain-mirror.test.mjs} +204 -186
  83. package/scripts/check.harness.ts +0 -343
  84. package/scripts/harness-api.frozen.json +0 -41
  85. package/src/latex-log.harness.ts +0 -382
  86. package/src/latex-loop.harness.ts +0 -515
@@ -31,7 +31,7 @@
31
31
  */
32
32
  import { basename, extname } from "node:path";
33
33
  import { leaf, renderTree } from "./layout-tree.js";
34
- import { REPRO_DIR, REPRO_NODES } from "./repro-layout.js";
34
+ import { DATA_EXTENSIONS, NOTE_EXTENSIONS, REPRO_DIR, REPRO_NODES, SCRIPT_EXTENSIONS, TOOL_FILES, } from "./repro-layout.js";
35
35
  export const NOTHING_DECLARED = { roots: [] };
36
36
  /** The one folder whose content is not judged. */
37
37
  export const ESCAPE_HATCH = "extra";
@@ -146,9 +146,9 @@ export const BUILD_BYPRODUCTS = BYPRODUCT_EXTENSIONS.map((ext) => `paper.${ext}`
146
146
  /** Files the operating system writes into any folder it shows. Never reported. */
147
147
  export const OS_FILES = [".DS_Store", "Thumbs.db"];
148
148
  /** The live state of a paper — its stages, its plan, its scorecard — is one file. */
149
- const STATUS_SECTIONS = 'a section of PIPELINE-STATUS.md — the paper\'s one live-state file holds its stages, its plan ("Plan / now") and its scorecard; move what is still live there and delete the file';
150
- /** The shared corpus of a venue's accepted papers. */
151
- const VENUE_CORPUS = "<papers-root>/venues/<venue>/, outside the paper folder: one corpus per venue, shared by every paper that targets it";
149
+ const STATUS_SECTIONS = "a section of PIPELINE-STATUS.md";
150
+ /** The shared corpus of a venue's accepted papers, outside every paper folder. */
151
+ const VENUE_CORPUS = "<papers-root>/venues/<venue>/";
152
152
  /**
153
153
  * Names met in real paper folders, each with its one destination. Matched ignoring case, a file's
154
154
  * name against files and a folder's against folders.
@@ -156,32 +156,36 @@ const VENUE_CORPUS = "<papers-root>/venues/<venue>/, outside the paper folder: o
156
156
  export const KNOWN_CURES = [
157
157
  { name: "PLAN.md", kind: "file", cure: STATUS_SECTIONS },
158
158
  { name: "plans", kind: "dir", cure: STATUS_SECTIONS },
159
- { name: "DECISION-LOG.md", kind: "file", cure: "research/ (a dated record)" },
160
- {
161
- name: "EMAILS.md",
162
- kind: "file",
163
- cure: "submission/ (mail with the venue is about submitting)",
164
- },
165
- {
166
- name: "data",
167
- kind: "dir",
168
- cure: "repro/data/ (the data behind the numbers)",
169
- },
170
- {
171
- name: "artifact",
172
- kind: "dir",
173
- cure: "repro/ — its scripts in repro/tools/, its data in repro/data/; the anonymized copy uploaded for review is about submitting and goes in submission/",
174
- },
175
- {
176
- name: "archive",
177
- kind: "dir",
178
- cure: "versions/ for frozen PDFs, submission/ for an earlier attempt's forms, mails and checklists, extra/ for the rest",
179
- },
159
+ { name: "DECISION-LOG.md", kind: "file", cure: "research/" },
160
+ { name: "EMAILS.md", kind: "file", cure: "submission/" },
161
+ { name: "data", kind: "dir", cure: "repro/data/" },
162
+ { name: "artifact", kind: "dir", cure: "repro/" },
163
+ { name: "archive", kind: "dir", cure: `${ESCAPE_HATCH}/` },
180
164
  { name: "venue-corpus", kind: "dir", cure: VENUE_CORPUS },
181
165
  { name: "venues", kind: "dir", cure: VENUE_CORPUS },
182
166
  ];
183
- /** For a name nobody listed: the choice by what the material is. */
184
- export const CURE_BY_KIND = "decide by what it is — a record or research → research/; about submitting (forms, mails, checklists, portal records) → submission/; live state of the paper (plan, status) → a section of PIPELINE-STATUS.md; reproduction (scripts, data, the artifact) → repro/; a frozen PDF of a stage → versions/; unclear → extra/, which is never judged";
167
+ /** The extensions of the images a figure is drawn from. */
168
+ export const IMAGE_EXTENSIONS = [
169
+ ".png",
170
+ ".jpg",
171
+ ".jpeg",
172
+ ".gif",
173
+ ".svg",
174
+ ".eps",
175
+ ];
176
+ /**
177
+ * For a file nobody listed: the folder its kind names, by its exact name or its extension (matched
178
+ * ignoring case). The same kinds `repro/allowed-files-only` sorts by. No `.pdf`: a root PDF may be
179
+ * a figure, a draft or a review, and `versions/` holds only cycle folders (`versions/layout`).
180
+ */
181
+ export const CURE_BY_FILE = [
182
+ { names: TOOL_FILES, extensions: SCRIPT_EXTENSIONS, cure: "repro/tools/" },
183
+ { names: [], extensions: DATA_EXTENSIONS, cure: "repro/data/" },
184
+ { names: [], extensions: IMAGE_EXTENSIONS, cure: "figures/" },
185
+ { names: [], extensions: NOTE_EXTENSIONS, cure: "research/" },
186
+ ];
187
+ /** For anything else: the folder that is never judged. */
188
+ export const CURE_BY_DEFAULT = `${ESCAPE_HATCH}/`;
185
189
  const isAllowedFile = (name, declared) => ROOT_FILES.includes(name) ||
186
190
  TEX_INPUT_EXTENSIONS.includes(extname(name)) ||
187
191
  BUILD_BYPRODUCTS.includes(name) ||
@@ -190,10 +194,16 @@ const isAllowedFile = (name, declared) => ROOT_FILES.includes(name) ||
190
194
  const isAllowed = (e, declared) => e.kind === "dir"
191
195
  ? ROOT_DIRS.includes(e.name) || declared.roots.includes(e.name)
192
196
  : isAllowedFile(e.name, declared);
193
- /** Where material like `e` belongs: its listed destination, else the choice by what it is. */
197
+ /** Where `e` belongs: its listed destination, else its kind's folder, else `extra/`. */
194
198
  function cureFor(e) {
195
199
  const known = KNOWN_CURES.find((c) => c.kind === e.kind && c.name.toLowerCase() === e.name.toLowerCase());
196
- return known === undefined ? CURE_BY_KIND : known.cure;
200
+ if (known !== undefined)
201
+ return known.cure;
202
+ const ext = extname(e.name).toLowerCase();
203
+ const byKind = e.kind === "file"
204
+ ? CURE_BY_FILE.find((c) => c.names.includes(e.name) || c.extensions.includes(ext))
205
+ : undefined;
206
+ return byKind?.cure ?? CURE_BY_DEFAULT;
197
207
  }
198
208
  /** The root entries that are not part of the layout, in the order given. Pure. */
199
209
  export function judgeLayout(entries, declared) {
@@ -221,7 +231,7 @@ export const PAPER_NODES = [
221
231
  children: d.name === REPRO_DIR ? REPRO_NODES : [],
222
232
  })),
223
233
  ];
224
- /** The drawing of the paper folder's layout: the rule's message, the hook's refusal, the rule's page. */
234
+ /** The drawing of the paper folder's layout, which the rule's page embeds. */
225
235
  export const PAPER_LAYOUT_TREE = renderTree("<paper>/", PAPER_NODES);
226
236
  /** The folder beside the paper folders that holds one corpus of accepted papers per venue. */
227
237
  export const VENUES_DIR = "venues";
@@ -248,15 +258,11 @@ export const PAPERS_NODES = [
248
258
  export const PAPERS_LAYOUT_TREE = renderTree("<papers-root>/", PAPERS_NODES);
249
259
  /**
250
260
  * The one text a stray entry is reported with, by the rule `paper/allowed-files-only` and by the hook that
251
- * refuses to create such an entry. It stands alone: where the entry goes, and the whole layout drawn,
252
- * for a reader who knows nothing of paperlint.
261
+ * refuses to create such an entry: one line, the entry and its one destination. The layout, and how
262
+ * each destination is picked, are on the rule's page, which the finding's rule id names.
253
263
  */
254
264
  export function strayMessage(s) {
255
- return [
256
- `\`${s.name}\` is at the root of a paper folder (the folder holding PIPELINE-STATUS.md), and that root holds only paperlint's layout. Where it goes: ${s.cure}.`,
257
- `The layout (${ESCAPE_HATCH}/ takes anything and is never judged; the build's paper.* byproducts are never reported):`,
258
- PAPER_LAYOUT_TREE,
259
- `Rule paper/allowed-files-only: https://github.com/zernie/paperlint/blob/main/docs/rules/paper/allowed-files-only.md`,
260
- ].join("\n");
265
+ const fallback = s.cure === CURE_BY_DEFAULT ? "the folder for its kind" : CURE_BY_DEFAULT;
266
+ return `\`${s.name}\` does not belong at a paper folder's root: move it to ${s.cure}, or ${fallback}.`;
261
267
  }
262
268
  //# sourceMappingURL=paper-layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paper-layout.js","sourceRoot":"","sources":["../../src/domain/paper-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAa3D,MAAM,CAAC,MAAM,gBAAgB,GAAa,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAWxD,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AAQpC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C;QACE,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,0DAA0D;KACjE;IACD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,2CAA2C,EAAE;IACxE,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACxD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAAE;IAChD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,yBAAyB,EAAE;IACtD,EAAE,IAAI,EAAE,WAAW,EAAE,IA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CED
69
- * rather than a style preference: `papers.harness.mjs` part IV fails if the first consumer's own
69
+ * rather than a style preference: `papers.test.mjs` part IV fails if the first consumer's own
70
70
  * directory name appears anywhere in this package outside the test itself. It caught this very
71
71
  * docblock on 2026-09-11, where the example used the real value. An exemption list is what turns
72
72
  * such a check into decoration, so there is exactly one exemption: the file asserting it.
@@ -3,7 +3,7 @@
3
3
  * created, not at the next lint. PreToolUse on `Edit|Write|MultiEdit` (`plugin/hooks/hooks.json`):
4
4
  * when the file about to be written does not exist yet and would add an entry the layout does not
5
5
  * allow — at a paper folder's root, or at the top of its `repro/` — the call is denied, and the
6
- * reason is the rule's own message: where the entry goes, and the layout drawn. The agent writes it
6
+ * reason is the rule's own message: where the entry goes (for `repro/`, also its layout drawn). The agent writes it
7
7
  * where it belongs instead, in the same turn.
8
8
  *
9
9
  * ── WHAT IT NEVER BLOCKS ─────────────────────────────────────────────────────────
@@ -37,7 +37,7 @@ export interface FailingWarning {
37
37
  * nearly every paper has some, and the pdf/* rules check the margins), font shape substitution
38
38
  * (usually harmless), "Rerun to get" (the loop already reruns). Those never fail a build.
39
39
  *
40
- * Adding one is one entry here, plus its row of cases in `latex-log.harness.ts` (the harness does
40
+ * Adding one is one entry here, plus its row of cases in `latex-log.test.ts` (the harness does
41
41
  * not type-check without it).
42
42
  *
43
43
  * `lost-character`: TeX prints "Missing character: There is no X in font F!" when
package/dist/latex-log.js CHANGED
@@ -81,7 +81,7 @@ const startsPhysicalLine = (line, prefix) => range(0, Math.floor(line.length / M
81
81
  * nearly every paper has some, and the pdf/* rules check the margins), font shape substitution
82
82
  * (usually harmless), "Rerun to get" (the loop already reruns). Those never fail a build.
83
83
  *
84
- * Adding one is one entry here, plus its row of cases in `latex-log.harness.ts` (the harness does
84
+ * Adding one is one entry here, plus its row of cases in `latex-log.test.ts` (the harness does
85
85
  * not type-check without it).
86
86
  *
87
87
  * `lost-character`: TeX prints "Missing character: There is no X in font F!" when
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * PURE. No disk, no process, no clock. The shell in `build.ts` runs a step, records what it saw
5
5
  * as an `Observation`, appends it to the history and asks `nextStep(summarize(history))` again.
6
- * Both halves are table tests (`latex-loop.harness.ts`), not scenarios that need TeX.
6
+ * Both halves are table tests (`latex-loop.test.ts`), not scenarios that need TeX.
7
7
  *
8
8
  * ── THE LOOP: `summarize` reduces the history to a `State`, and `nextStep` asks four questions ──
9
9
  * 1. did the last program fail — a non-zero exit, or a
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * PURE. No disk, no process, no clock. The shell in `build.ts` runs a step, records what it saw
5
5
  * as an `Observation`, appends it to the history and asks `nextStep(summarize(history))` again.
6
- * Both halves are table tests (`latex-loop.harness.ts`), not scenarios that need TeX.
6
+ * Both halves are table tests (`latex-loop.test.ts`), not scenarios that need TeX.
7
7
  *
8
8
  * ── THE LOOP: `summarize` reduces the history to a `State`, and `nextStep` asks four questions ──
9
9
  * 1. did the last program fail — a non-zero exit, or a
@@ -17,7 +17,7 @@
17
17
  /**
18
18
  * The tool's name. Its settings file is named after it (`CONFIG_FILE`), its messages start with it,
19
19
  * and the hooks resolve their scripts through it. It equals the package name, and
20
- * `lib/paper-config.harness.mjs` checks that.
20
+ * `lib/paper-config.test.mjs` checks that.
21
21
  */
22
22
  export declare const CONFIG_KEY: string;
23
23
  /**
@@ -60,7 +60,7 @@ export declare const DEFAULT_PAPERS_ROOT: string;
60
60
  * This is the one place the name is spelled. Code reads the field as
61
61
  * `settings[PAPERS_DIR_FIELD]`, never by a literal, so renaming it again is a one-line change
62
62
  * here. The three hooks cannot import this module, so they keep their own copy, and
63
- * `lib/paper-config.harness.mjs` checks that every copy matches this one.
63
+ * `lib/paper-config.test.mjs` checks that every copy matches this one.
64
64
  */
65
65
  export declare const PAPERS_DIR_FIELD: string;
66
66
  /**
@@ -68,7 +68,7 @@ export declare const PAPERS_DIR_FIELD: string;
68
68
  * A key not listed here is REFUSED with its name, because a typo in a key otherwise reads as "not
69
69
  * set". The keys in `ROOT_ONLY_KEYS` describe the whole project and are refused in a paper's file.
70
70
  *
71
- * 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.harness.mjs`
71
+ * 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.test.mjs`
72
72
  * walks the package's source, finds every `settingsOf(…)?.<key>` read and every field of
73
73
  * `PaperlintConfig`, and requires each to be here — so a new reader that forgets this list turns
74
74
  * the harness red before a consumer's config does.
@@ -19,7 +19,7 @@ import { dirname, join, resolve } from "node:path";
19
19
  /**
20
20
  * The tool's name. Its settings file is named after it (`CONFIG_FILE`), its messages start with it,
21
21
  * and the hooks resolve their scripts through it. It equals the package name, and
22
- * `lib/paper-config.harness.mjs` checks that.
22
+ * `lib/paper-config.test.mjs` checks that.
23
23
  */
24
24
  export const CONFIG_KEY = "paperlint";
25
25
  /**
@@ -93,7 +93,7 @@ export const DEFAULT_PAPERS_ROOT = "papers";
93
93
  * This is the one place the name is spelled. Code reads the field as
94
94
  * `settings[PAPERS_DIR_FIELD]`, never by a literal, so renaming it again is a one-line change
95
95
  * here. The three hooks cannot import this module, so they keep their own copy, and
96
- * `lib/paper-config.harness.mjs` checks that every copy matches this one.
96
+ * `lib/paper-config.test.mjs` checks that every copy matches this one.
97
97
  */
98
98
  export const PAPERS_DIR_FIELD = "papersDir";
99
99
  /**
@@ -101,7 +101,7 @@ export const PAPERS_DIR_FIELD = "papersDir";
101
101
  * A key not listed here is REFUSED with its name, because a typo in a key otherwise reads as "not
102
102
  * set". The keys in `ROOT_ONLY_KEYS` describe the whole project and are refused in a paper's file.
103
103
  *
104
- * 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.harness.mjs`
104
+ * 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.test.mjs`
105
105
  * walks the package's source, finds every `settingsOf(…)?.<key>` read and every field of
106
106
  * `PaperlintConfig`, and requires each to be here — so a new reader that forgets this list turns
107
107
  * the harness red before a consumer's config does.
package/docs/e2e.md CHANGED
@@ -32,14 +32,14 @@ import the modules directly. Every path resolves, every dependency is already in
32
32
  file they read is the file in `git`. An end-to-end run exists because all three of those are
33
33
  assumptions that stop holding the moment somebody else installs the package.
34
34
 
35
- | question | answered by |
36
- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
37
- | does this rule find this defect, and stay quiet otherwise | unit, beside the rule |
38
- | does the rule run through ESLint, wired, on the file it is for | integration (`src/rule-cases.test.ts`) |
39
- | does the CLI pick the right script, with the right interpreter | integration (`src/build.harness.mjs` substitutes `spawnSync`) |
40
- | does the tarball, installed into a tree that is not this one, contain what it claims | **e2e** |
41
- | do the paths written inside a skill resolve where the package actually lands | **e2e** |
42
- | did a PDF come out, and is it typeset in the fonts the venue requires | **e2e** |
35
+ | question | answered by |
36
+ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
37
+ | does this rule find this defect, and stay quiet otherwise | unit, beside the rule |
38
+ | does the rule run through ESLint, wired, on the file it is for | integration (`src/rule-cases.test.ts`) |
39
+ | does the CLI pick the right script, with the right interpreter | integration (`src/build-fake-tex.test.mjs` substitutes `spawnSync`) |
40
+ | does the tarball, installed into a tree that is not this one, contain what it claims | **e2e** |
41
+ | do the paths written inside a skill resolve where the package actually lands | **e2e** |
42
+ | did a PDF come out, and is it typeset in the fonts the venue requires | **e2e** |
43
43
 
44
44
  The last three rows are the ones no other test can reach even in principle: the defect only exists
45
45
  once the code is somewhere else, or once a real TeX has typeset it.
@@ -153,7 +153,7 @@ within seconds; `--check` must exit 0; then the `acmart` fixture is built with P
153
153
  only, so no other TeX Live and no PDF tool can stand in, and the PDF must carry Libertine and Biolinum
154
154
  and no Computer Modern face. Without `PAPERLINT_TEXLIVE_DIR` its tests are skipped: installing ~270 MB
155
155
  into a home directory as a side effect of `npm run check` is the unasked install the root `CLAUDE.md` forbids.
156
- `src/toolchain.harness.mjs` covers the installer's logic (mirror fallback, archive check, time
156
+ `src/toolchain-mirror.test.mjs` covers the installer's logic (mirror fallback, archive check, time
157
157
  limit, verification, idempotence) against a fake mirror on disk, without the network.
158
158
 
159
159
  ## Skips are reported, never passed
package/docs/install.md CHANGED
@@ -232,14 +232,14 @@ Neither `paperlint lint` nor any of the five hooks loads `@ast-grep` or `typescr
232
232
 
233
233
  ## Troubleshooting
234
234
 
235
- | symptom | cause and fix |
236
- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
237
- | `init`: skills "nothing linked", or hooks that fail to start | the package is not installed in this project (`npx` ran a temporary copy). Run `npm i -D paperlint`, then `npx paperlint init` again |
238
- | `paperlint lint`: `no papers in papers/` | there is no paper where `papersDir` points. Create one with `npx paperlint new <name>`, or set `"papersDir"` in `paperlint.json` |
239
- | hooks fail with `Cannot find module` in a fresh clone | the hook commands run files in `node_modules`: run `npm install` |
240
- | `paperlint: not built` | installed from git with `--ignore-scripts`, or a clone before building: run `npm run build` in the package |
241
- | a skill does not show up in Claude Code | its name was already taken in `.claude/skills/`. `init` names it and leaves it alone; rename or remove yours and run `npx paperlint init` again |
242
- | a Write of a new file is denied: "… is at the root of a paper folder" or "… is loose at the top of the paper's repro/ folder" | `paper-folder-layout` refuses to create an entry the paper layout does not allow; the reason says where it goes. Write it there. Existing files are never refused, and the hook does not see shell moves |
243
- | after an edit, Claude Code shows "paperlint lint-edited: the edit was kept; the errors above are the ones it introduced." | `lint-edited` linted the file the edit wrote and `paper.tex`, and found an error the edit introduced ([layout.md](layout.md#the-lint-edited-hook)). The edit stands; fix the error it names |
244
- | `paperlint: the lint-edited hook did not run: …` on stderr | the hook could not lint (the reason follows); the edit stands. `npx paperlint lint` on the paper shows the same failure |
245
- | anything else | `npx paperlint doctor` — it checks the setup and exits non-zero on anything miswired |
235
+ | symptom | cause and fix |
236
+ | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
237
+ | `init`: skills "nothing linked", or hooks that fail to start | the package is not installed in this project (`npx` ran a temporary copy). Run `npm i -D paperlint`, then `npx paperlint init` again |
238
+ | `paperlint lint`: `no papers in papers/` | there is no paper where `papersDir` points. Create one with `npx paperlint new <name>`, or set `"papersDir"` in `paperlint.json` |
239
+ | hooks fail with `Cannot find module` in a fresh clone | the hook commands run files in `node_modules`: run `npm install` |
240
+ | `paperlint: not built` | installed from git with `--ignore-scripts`, or a clone before building: run `npm run build` in the package |
241
+ | a skill does not show up in Claude Code | its name was already taken in `.claude/skills/`. `init` names it and leaves it alone; rename or remove yours and run `npx paperlint init` again |
242
+ | a Write of a new file is denied: "… does not belong at a paper folder's root" or "… is loose at the top of the paper's repro/ folder" | `paper-folder-layout` refuses to create an entry the paper layout does not allow; the reason says where it goes. Write it there. Existing files are never refused, and the hook does not see shell moves |
243
+ | after an edit, Claude Code shows "paperlint lint-edited: the edit was kept; the errors above are the ones it introduced." | `lint-edited` linted the file the edit wrote and `paper.tex`, and found an error the edit introduced ([layout.md](layout.md#the-lint-edited-hook)). The edit stands; fix the error it names |
244
+ | `paperlint: the lint-edited hook did not run: …` on stderr | the hook could not lint (the reason follows); the edit stands. `npx paperlint lint` on the paper shows the same failure |
245
+ | anything else | `npx paperlint doctor` — it checks the setup and exits non-zero on anything miswired |
@@ -91,38 +91,41 @@ itself.
91
91
 
92
92
  ## Examples
93
93
 
94
- Failing: a plan beside the paper.
94
+ Failing: a results table beside the paper.
95
95
 
96
96
  ```text
97
97
  papers/agent-rule-drift/PIPELINE-STATUS.md
98
- 1:1 error `PLAN.md` is at the root of a paper folder (the folder holding PIPELINE-STATUS.md),
99
- and that root holds only paperlint's layout. Where it goes: a section of
100
- PIPELINE-STATUS.md — the paper's one live-state file holds its stages, its plan
101
- ("Plan / now") and its scorecard; move what is still live there and delete the file.
102
- The layout (extra/ takes anything and is never judged; the build's paper.* byproducts are never reported):
103
- <paper>/
104
- ├── PIPELINE-STATUS.md ← the paper's one live-state file: stages, plan, scorecard
105
- …
106
- └── extra/ ← anything; never judged
107
- Rule paper/allowed-files-only: https://github.com/zernie/paperlint/blob/main/docs/rules/paper/allowed-files-only.md paper/allowed-files-only
98
+ 1:1 error `results-final-v2.csv` does not belong at a paper folder's root: move it to repro/data/, or extra/. paper/allowed-files-only
108
99
  ```
109
100
 
110
- Each message names the entry and where it goes, and draws the whole layout above, so it reads on its own. A
111
- name met in real paper folders has one destination:
112
-
113
- | entry | where it goes |
114
- | -------------------------- | ---------------------------------------------------------------------------------------------------------- |
115
- | `PLAN.md`, `plans/` | a section of `PIPELINE-STATUS.md` ("Plan / now") |
116
- | `DECISION-LOG.md` | `research/` |
117
- | `EMAILS.md` | `submission/` |
118
- | `data/` | `repro/data/` |
119
- | `artifact/` | `repro/` (scripts in `repro/tools/`, data in `repro/data/`); the anonymized upload copy in `submission/` |
120
- | `archive/` | `versions/` for frozen PDFs, `submission/` for an earlier attempt's forms and mails, `extra/` for the rest |
121
- | `venue-corpus/`, `venues/` | `<papers-root>/venues/<venue>/`, outside the paper folder |
122
-
123
- Any other name gets the choice by what it is: a record or research → `research/`; about submitting
124
- → `submission/`; the paper's live state → a section of `PIPELINE-STATUS.md`; reproduction → `repro/`;
125
- a frozen PDF of a stage → `versions/`; unclear → `extra/`.
101
+ Each finding is one line naming one destination. A name met in real paper folders has its own:
102
+
103
+ | entry | where it goes |
104
+ | -------------------------- | ------------------------------- |
105
+ | `PLAN.md`, `plans/` | a section of PIPELINE-STATUS.md |
106
+ | `DECISION-LOG.md` | `research/` |
107
+ | `EMAILS.md` | `submission/` |
108
+ | `data/` | `repro/data/` |
109
+ | `artifact/` | `repro/` |
110
+ | `archive/` | `extra/` |
111
+ | `venue-corpus/`, `venues/` | `<papers-root>/venues/<venue>/` |
112
+
113
+ Any other file goes where its kind says, by its name or its extension (matched ignoring case):
114
+
115
+ | extension | where it goes |
116
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
117
+ | data: `.tsv` `.csv` `.json` `.jsonl` `.ndjson` `.yaml` `.yml` `.xml` `.txt` `.log` `.parquet` `.sqlite` `.db` `.xlsx` `.npy` `.npz` `.pkl` `.gz` `.zip` `.tar` | `repro/data/` |
118
+ | scripts and the files that run them: `Makefile` `Dockerfile` `requirements.txt` `pyproject.toml` `uv.lock` `package.json` `package-lock.json` `.py` `.ipynb` `.sh` `.bash` `.zsh` `.js` `.mjs` `.cjs` `.ts` `.mts` `.cts` `.r` `.jl` `.rb` `.pl` `.awk` `.sql` | `repro/tools/` |
119
+ | images: `.png` `.jpg` `.jpeg` `.gif` `.svg` `.eps` | `figures/` |
120
+ | notes: `.md` `.markdown` | `research/` |
121
+
122
+ Anything else, and any folder not listed, goes to `extra/`; so does a PDF, which may be a figure (`figures/`), a draft or a review. The finding names one folder; pick
123
+ another when you know better: a record or research → `research/`; about submitting (forms, mails,
124
+ checklists, portal records) → `submission/`; the paper's live state → a section of
125
+ `PIPELINE-STATUS.md`; reproduction → `repro/`; a frozen PDF of a stage → `versions/`; unclear →
126
+ `extra/`. An `archive/` usually splits: its frozen PDFs into `versions/`, an earlier attempt's forms
127
+ and mails into `submission/`, the rest into `extra/`. The anonymized copy of an `artifact/` uploaded
128
+ for review goes in `submission/`.
126
129
 
127
130
  Passing: the folder `paperlint new` writes (`PIPELINE-STATUS.md`, `paper.tex`, `paperlint.json`),
128
131
  and any folder holding only the entries above.
@@ -145,7 +148,7 @@ No rule options. The paper's `pdf`, `talk.dir` and own preset files add what the
145
148
  `plugin/hooks/hooks.json`). When an agent is about to create a file that would add an entry the
146
149
  layout does not allow — at a paper folder's root, or at the top of its `repro/`
147
150
  ([`repro/allowed-files-only`](../repro/allowed-files-only.md)) — the hook denies the call, and the reason it gives is the
148
- rule's own message: where the entry goes, and the layout drawn. The agent writes the file where it
151
+ rule's own message: where the entry goes. The agent writes the file where it
149
152
  belongs instead, in the same turn. The text comes from the functions the rules report with
150
153
  (`strayTexts`, `reproTexts`); there is no second list.
151
154
 
package/docs/testing.md CHANGED
@@ -51,13 +51,12 @@ When in doubt between unit and integration: if the function takes a port (`Files
51
51
  - **Answers:** what does an agent see or cause? A hook's allow or deny on a given input, what a
52
52
  skill's contract promises.
53
53
  - **Lives:** `<surface>.harness.mjs` beside what it tests; it imports `runHook`, `runHarnessTest`
54
- or `runEval` from vigiles. Harnesses written before this rule that import none of the three are
55
- frozen in `scripts/harness-api.frozen.json`, which only shrinks (`scripts/harness-api.test.ts`,
56
- #77). A new test of anything else is a unit or integration test.
54
+ or `runEval` from vigiles (`scripts/harness-api.test.ts` fails on a `*.harness.*` file that does
55
+ not). A test of anything else is a unit or integration test.
57
56
  - **Asserts through** `lib/check.mjs`: `const check = createChecker();` then
58
57
  `check(label, cond, detail)`. A failure prints the label and the detail, every call is counted.
59
58
  Do not define a local `check`.
60
- - **Example:** `src/cli.harness.mjs`.
59
+ - **Example:** `skills/label-agent-runs/label-agent-runs.harness.ts` (`runHarnessTest` over a scripted mock model).
61
60
  - **Skills are tested through vigiles**, not a bespoke runner: a home-grown runner here once printed
62
61
  byte-identical "clean" verdicts for three skills that had never loaded.
63
62
 
@@ -16,9 +16,12 @@ import { dirname, join } from "node:path";
16
16
  import { fileURLToPath } from "node:url";
17
17
  import { ESLint } from "eslint";
18
18
  import markdown from "@eslint/markdown";
19
- import { recordCheck } from "vigiles";
19
+ import { it, vi } from "vitest";
20
20
  import port, { PORT } from "./install-path-literals.ts";
21
21
 
22
+ // Several tests here run real ESLint, spawn processes or walk the repository.
23
+ vi.setConfig({ testTimeout: 120_000 });
24
+
22
25
  // Resolved from THIS file, never from the caller's cwd (root CLAUDE.md), and the mistake this very
23
26
  // class of bug is about.
24
27
  const HERE = dirname(fileURLToPath(import.meta.url));
@@ -59,7 +62,7 @@ const cases = [];
59
62
 
60
63
  // ── 1. MARKDOWN FIRES. Three carriers in one fixture: the frontmatter value, the fenced
61
64
  // command, and an inline mention. All three are how a real skill names a script.
62
- {
65
+ it("1. MARKDOWN FIRES: three carriers in one fixture", async () => {
63
66
  const m = await findings(mdLinter, join(FIX, "defect.md"), RULE_MD);
64
67
  assert.ok(m.length >= 3, `expected at least three findings, got ${m.length}`);
65
68
  assert.match(
@@ -81,11 +84,11 @@ const cases = [];
81
84
  );
82
85
  assert.ok(prefixes.has("node_modules/"), "the npm channel must be named");
83
86
  cases.push("md fires on frontmatter, fenced command and inline mention");
84
- }
87
+ });
85
88
 
86
89
  // ── 2. MARKDOWN STAYS QUIET. Same skill written through the substitution, plus a
87
90
  // repository-relative path that is identical in every channel.
88
- {
91
+ it("2. MARKDOWN STAYS QUIET: the same skill written through the substitution", async () => {
89
92
  const m = await findings(mdLinter, join(FIX, "clean.md"), RULE_MD);
90
93
  assert.equal(
91
94
  m.length,
@@ -93,11 +96,11 @@ const cases = [];
93
96
  `clean fixture must be silent, got ${JSON.stringify(m)}`,
94
97
  );
95
98
  cases.push("md quiet on a skill that uses the substitution");
96
- }
99
+ });
97
100
 
98
101
  // ── 3. JAVASCRIPT FIRES, in both literal forms. The template case is not decoration: a path
99
102
  // assembled from a template is still a path, and reading only `Literal` would miss it.
100
- {
103
+ it("3. JAVASCRIPT FIRES, in both literal forms", async () => {
101
104
  const m = await findings(jsLinter, join(FIX, "defect.fixture.mjs"), RULE_JS);
102
105
  assert.equal(
103
106
  m.length,
@@ -105,10 +108,10 @@ const cases = [];
105
108
  `expected one plain and one template finding, got ${m.length}`,
106
109
  );
107
110
  cases.push("js fires on a plain literal AND on a template quasi");
108
- }
111
+ });
109
112
 
110
113
  // ── 4. JAVASCRIPT STAYS QUIET when the module asks the port.
111
- {
114
+ it("4. JAVASCRIPT STAYS QUIET when the module asks the port", async () => {
112
115
  const m = await findings(jsLinter, join(FIX, "clean.fixture.mjs"), RULE_JS);
113
116
  assert.equal(
114
117
  m.length,
@@ -116,11 +119,11 @@ const cases = [];
116
119
  `clean module must be silent, got ${JSON.stringify(m)}`,
117
120
  );
118
121
  cases.push("js quiet on a module that asks the port");
119
- }
122
+ });
120
123
 
121
124
  // ── 5. A TAGGED TEMPLATE WITH AN INVALID ESCAPE has no cooked value, only the raw one — and the
122
125
  // path in it is still a path. (`String.raw` is exactly where such a template is legal.)
123
- {
126
+ it("5. A TAGGED TEMPLATE WITH AN INVALID ESCAPE has no cooked value, only the raw one", async () => {
124
127
  const [res] = await jsLinter.lintText(
125
128
  "export const p = String.raw`node_modules/paperlint/\\unicode`;\n",
126
129
  { filePath: join(ROOT, "tagged.probe.mjs") },
@@ -132,6 +135,4 @@ const cases = [];
132
135
  `a raw-only template quasi must be read, got ${JSON.stringify(res.messages)}`,
133
136
  );
134
137
  cases.push("js fires on a tagged template whose quasi has no cooked value");
135
- }
136
-
137
- recordCheck(cases.length);
138
+ });