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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperlint",
3
- "version": "20.1.0",
3
+ "version": "20.1.2",
4
4
  "description": "Skills and hooks for writing a research paper with paperlint",
5
5
  "skills": "./skills/",
6
6
  "hooks": "./plugin/hooks/hooks.json"
@@ -465,6 +465,13 @@ jobs:
465
465
  : "DIVERGE — this is the platform this job exists for");
466
466
  '
467
467
 
468
+ # Shard 1 runs the harnesses (scripts/test.ts), and since vigiles 49 `--min=1` counts only
469
+ # files that RAN: without the agent binary all four skip and the shard fails (run 45346444793).
470
+ - name: the agent binary the harnesses drive
471
+ if: matrix.shard == 1
472
+ run: npm i -g @anthropic-ai/claude-code
473
+ timeout-minutes: 3
474
+
468
475
  # Issue #9: `npm test` was red ONLY on macOS.
469
476
  - name: npm test (macOS), shard ${{ matrix.shard }} of 2
470
477
  run: npm test -- --shard=${{ matrix.shard }}/2
package/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- vigiles:sha256:5f17988324cc5bd4 compiled from CLAUDE.md.spec.ts -->
1
+ <!-- vigiles:sha256:6d6e96066c9c2e2b compiled from CLAUDE.md.spec.ts -->
2
2
 
3
3
  # CLAUDE.md
4
4
 
@@ -46,7 +46,7 @@ Claude Code loads `add-venue` from `.claude/skills/` and Codex loads it from `.a
46
46
 
47
47
  ## Before leaving draft and before merge
48
48
 
49
- While drafting, run `npm run test:changed` and `npm run lint`, and push `wip:` commits to the draft. `npm run test:changed` runs only the tests that import what the branch changed (109 s, measured; a change to `package.json` or the vitest config runs them all, 159 s with the report), then prints the changed files that are not at 100% coverage, with their uncovered lines: read it before leaving draft. It is a report, not a gate, because some lines are reached only by the harnesses or e2e suites it does not run (`scripts/test.ts`). Leave draft once both pass and any review asked for on the draft (a Codex review, for one) has nothing left to fix: leaving draft starts CI, every later push to the ready PR runs it again, and every gate of `npm run check` has a CI job (`scripts/check.harness.ts`), so CI is the gate. On red CI, fix it on the branch and push; merge on green CI at the current head. Run `npm run check` locally to debug one gate, or when `scripts/check.ts` itself changes (2026-11-08: 11 full local runs, ~127 min, each followed by a CI run that repeated it). `npm run lint` caches (`node_modules/.cache/eslint/`, 45 s → 3 s warm): a cached file is not re-judged when only a file it reads or imports changed (a preset, the build facts, an imported type), so a result that looks stale is checked with `rm -rf node_modules/.cache/eslint`; CI starts without the cache. Red first · assert the whole value · no test touches the real network · 100% coverage, no `c8 ignore`. In a container without TeX Live, only the TeX e2e gate fails, and it says so; `npx paperlint toolchain` installs it.
49
+ While drafting, run `npm run test:changed` and `npm run lint`, and push `wip:` commits to the draft. `npm run test:changed` runs only the tests that import what the branch changed (109 s, measured; a change to `package.json` or the vitest config runs them all, 159 s with the report), then prints the changed files that are not at 100% coverage, with their uncovered lines: read it before leaving draft. It is a report, not a gate, because some lines are reached only by the harnesses or e2e suites it does not run (`scripts/test.ts`). Leave draft once both pass and any review asked for on the draft (a Codex review, for one) has nothing left to fix: leaving draft starts CI, every later push to the ready PR runs it again, and every gate of `npm run check` has a CI job (`scripts/check-workflow.test.ts`), so CI is the gate. On red CI, fix it on the branch and push; merge on green CI at the current head. Run `npm run check` locally to debug one gate, or when `scripts/check.ts` itself changes (2026-11-08: 11 full local runs, ~127 min, each followed by a CI run that repeated it). `npm run lint` caches (`node_modules/.cache/eslint/`, 45 s → 3 s warm): a cached file is not re-judged when only a file it reads or imports changed (a preset, the build facts, an imported type), so a result that looks stale is checked with `rm -rf node_modules/.cache/eslint`; CI starts without the cache. Red first · assert the whole value · no test touches the real network · 100% coverage, no `c8 ignore`. In a container without TeX Live, only the TeX e2e gate fails, and it says so; `npx paperlint toolchain` installs it.
50
50
 
51
51
  ## Commits
52
52
 
package/CONTRIBUTING.md CHANGED
@@ -50,7 +50,7 @@ report and listed as skipped, never counted as passed. The e2e areas also run al
50
50
  Each gate's command is listed in `scripts/check.ts`; run one of them directly while iterating on
51
51
  one rule. They are not what you run before pushing.
52
52
 
53
- **The list of gates cannot quietly fall behind CI.** `scripts/check.harness.ts` pulls the job
53
+ **The list of gates cannot quietly fall behind CI.** `scripts/check-workflow.test.ts` pulls the job
54
54
  names out of `.github/workflows/ci.yml` and requires each to be either reproduced by a gate or
55
55
  named with a reason for why it cannot be. Add a job and it goes red the same day, naming the job
56
56
  nobody covered — verified by adding a `windows` job and watching it fail.
@@ -199,7 +199,7 @@ A venue is a **preset**, a JSONC file in `presets/`, validated by
199
199
  markers is written by `npm run build && npx eslint --fix presets/` (the config loads the rule from
200
200
  `dist/`).
201
201
  3. **A test.** A case in `src/presets.test.ts` that `paperlint:<series>-<year>` resolves over its family with
202
- the kinds you declared; `src/tex-requirements.harness.ts` already checks every shipped preset
202
+ the kinds you declared; `src/tex-requirements-tables.test.ts` already checks every shipped preset
203
203
  against the schema.
204
204
 
205
205
  `paperlint toolchain` picks the new preset's packages up by itself, and the README and
@@ -1,8 +1,7 @@
1
1
  /**
2
- * Harness over `action.yml` and the guard it calls.
3
- * Run: `npx vigiles test action.harness.mjs`
2
+ * Test over `action.yml` and the guard it calls.
4
3
  *
5
- * 🔴 WHAT IT REFUSES TO BE. A harness that greps `action.yml` for `--no-config-lookup` would pass
4
+ * 🔴 WHAT IT REFUSES TO BE. A test that greps `action.yml` for `--no-config-lookup` would pass
6
5
  * on a file where the flag sits inside a comment, and would say nothing about whether the action
7
6
  * BEHAVES. So: the YAML is read with a PARSER (`js-yaml`) and addressed as nodes, and the
8
7
  * green-zero guard is exercised by CALLING it on fixtures — the same entry point the action calls.
@@ -11,6 +10,7 @@
11
10
  * A guard only ever observed silent is indistinguishable from a dead one.
12
11
  */
13
12
  import assert from "node:assert/strict";
13
+ import { it } from "vitest";
14
14
  import {
15
15
  readFileSync,
16
16
  writeFileSync,
@@ -28,85 +28,92 @@ const HERE = dirname(fileURLToPath(import.meta.url));
28
28
  const TMP = realpathSync(mkdtempSync(join(tmpdir(), "paperlint-action-")));
29
29
  const action = yaml.load(readFileSync(join(HERE, "action.yml"), "utf8"));
30
30
 
31
- // ── I. SHAPE, read as nodes ───────────────────────────────────────────────────────────────────
32
- assert.equal(action.runs.using, "composite", "the action must be composite");
33
31
  const names = action.runs.steps.map((s) => s.name);
34
- assert.equal(
35
- action.runs.steps.length,
36
- 4,
37
- `expected 4 steps, got ${action.runs.steps.length}: ${names}`,
38
- );
32
+ const eslintStep = action.runs.steps.find((s) => s.name === "paperlint lint");
39
33
 
40
- // `check-hooks` is OFF unless asked for, and when on it runs `paperlint doctor` — the command whose
41
- // exit code (2 for partly wired or doubled hooks, src/doctor.ts) is the verdict — and nothing else.
42
- const hooksInput = action.inputs["check-hooks"];
43
- assert.ok(hooksInput, "the action must take a `check-hooks` input");
44
- assert.equal(hooksInput.default, "false", "`check-hooks` must default to off");
45
- assert.equal(hooksInput.required, false);
46
- const hooksStep = action.runs.steps.find(
47
- (s) => s.name === "paperlint doctor (hooks fully wired)",
48
- );
49
- assert.ok(hooksStep, `no hooks step among: ${names}`);
50
- assert.equal(
51
- hooksStep.if,
52
- "inputs.check-hooks == 'true'",
53
- "the hooks step runs only when asked",
54
- );
55
- assert.match(
56
- hooksStep.run,
57
- /npx paperlint doctor/,
58
- "the hooks step runs `paperlint doctor`",
59
- );
60
- assert.equal(
61
- action.runs.steps.at(-1),
62
- hooksStep,
63
- "the hooks step comes after the lint step, so a failing doctor never hides the lint report",
64
- );
34
+ // ── I. SHAPE, read as nodes ───────────────────────────────────────────────────────────────────
35
+ it("I. SHAPE, read as nodes", () => {
36
+ assert.equal(action.runs.using, "composite", "the action must be composite");
37
+ assert.equal(
38
+ action.runs.steps.length,
39
+ 4,
40
+ `expected 4 steps, got ${action.runs.steps.length}: ${names}`,
41
+ );
65
42
 
66
- const eslintStep = action.runs.steps.find((s) => s.name === "paperlint lint");
67
- assert.ok(eslintStep, `no step named "paperlint lint" among: ${names}`);
43
+ // `check-hooks` is OFF unless asked for, and when on it runs `paperlint doctor` — the command whose
44
+ // exit code (2 for partly wired or doubled hooks, src/doctor.ts) is the verdict — and nothing else.
45
+ const hooksInput = action.inputs["check-hooks"];
46
+ assert.ok(hooksInput, "the action must take a `check-hooks` input");
47
+ assert.equal(
48
+ hooksInput.default,
49
+ "false",
50
+ "`check-hooks` must default to off",
51
+ );
52
+ assert.equal(hooksInput.required, false);
53
+ const hooksStep = action.runs.steps.find(
54
+ (s) => s.name === "paperlint doctor (hooks fully wired)",
55
+ );
56
+ assert.ok(hooksStep, `no hooks step among: ${names}`);
57
+ assert.equal(
58
+ hooksStep.if,
59
+ "inputs.check-hooks == 'true'",
60
+ "the hooks step runs only when asked",
61
+ );
62
+ assert.match(
63
+ hooksStep.run,
64
+ /npx paperlint doctor/,
65
+ "the hooks step runs `paperlint doctor`",
66
+ );
67
+ assert.equal(
68
+ action.runs.steps.at(-1),
69
+ hooksStep,
70
+ "the hooks step comes after the lint step, so a failing doctor never hides the lint report",
71
+ );
68
72
 
69
- // 🔴 THE ACTION MUST CALL THE PACKAGE'S OWN CLI, NOT ESLINT. This is not tidiness: while the step
70
- // invoked `npx eslint` directly it was a SECOND implementation of the same job, and it had already
71
- // drifted — the directory-structure check (a paper directory with no PIPELINE-STATUS.md gets zero
72
- // rules and reports clean) lives in `bin/paperlint.mjs`, so in CI it did not run at all. Any future edit
73
- // that reaches past the CLI reintroduces exactly that gap, silently and greenly.
74
- assert.match(
75
- eslintStep.run,
76
- /npx paperlint lint/,
77
- "the lint step must call this package's own CLI — invoking eslint directly bypasses the settings and the structure check",
78
- );
79
- assert.doesNotMatch(
80
- eslintStep.run,
81
- /npx eslint/,
82
- "the lint step must not invoke eslint directly — that is the bypass this step was fixed to remove",
83
- );
84
- // `--no-config-lookup` is deliberately absent and is NOT missing: the CLI builds its config with
85
- // `overrideConfigFile: true`, so a consumer's nested config cannot reach the run. The guarantee
86
- // moved from a flag into the code — assert the code, not the flag.
87
- //
88
- // 🔴 AND ASSERT IT IN THE FILE THAT HOLDS IT. This read said `bin/paperlint.mjs` until the CLI moved to
89
- // TypeScript; `bin/paperlint.mjs` is now a loader shim and contains no such call, so the assertion went
90
- // red on a move that changed no behaviour. That redness is the point — the same assertion written
91
- // as a grep over "the CLI" would have kept passing against whichever file still matched, which is
92
- // how a check quietly stops watching its subject.
93
- assert.match(
94
- readFileSync(new URL("./src/cli.ts", import.meta.url), "utf8"),
95
- /overrideConfigFile:\s*true/,
96
- "the CLI must pin its own config, or a consumer's nested config silently changes the rule set",
97
- );
98
- // The redirect into a report file is only sound while `--json` keeps stdout clean.
99
- assert.match(
100
- eslintStep.run,
101
- /--json > "\$RUNNER_TEMP\/paperlint-report\.json"/,
102
- "the machine-readable report must be redirected whole — it is what the guard reads",
103
- );
104
- // The guard must be CALLED, and by file — an inline blob would be untestable.
105
- assert.match(
106
- eslintStep.run,
107
- /eslint-report-guard\.mjs/,
108
- "the lint step must hand its report to scripts/eslint-report-guard.mjs",
109
- );
73
+ assert.ok(eslintStep, `no step named "paperlint lint" among: ${names}`);
74
+
75
+ // 🔴 THE ACTION MUST CALL THE PACKAGE'S OWN CLI, NOT ESLINT. This is not tidiness: while the step
76
+ // invoked `npx eslint` directly it was a SECOND implementation of the same job, and it had already
77
+ // drifted — the directory-structure check (a paper directory with no PIPELINE-STATUS.md gets zero
78
+ // rules and reports clean) lives in `bin/paperlint.mjs`, so in CI it did not run at all. Any future edit
79
+ // that reaches past the CLI reintroduces exactly that gap, silently and greenly.
80
+ assert.match(
81
+ eslintStep.run,
82
+ /npx paperlint lint/,
83
+ "the lint step must call this package's own CLI — invoking eslint directly bypasses the settings and the structure check",
84
+ );
85
+ assert.doesNotMatch(
86
+ eslintStep.run,
87
+ /npx eslint/,
88
+ "the lint step must not invoke eslint directly — that is the bypass this step was fixed to remove",
89
+ );
90
+ // `--no-config-lookup` is deliberately absent and is NOT missing: the CLI builds its config with
91
+ // `overrideConfigFile: true`, so a consumer's nested config cannot reach the run. The guarantee
92
+ // moved from a flag into the code — assert the code, not the flag.
93
+ //
94
+ // 🔴 AND ASSERT IT IN THE FILE THAT HOLDS IT. This read said `bin/paperlint.mjs` until the CLI moved to
95
+ // TypeScript; `bin/paperlint.mjs` is now a loader shim and contains no such call, so the assertion went
96
+ // red on a move that changed no behaviour. That redness is the point — the same assertion written
97
+ // as a grep over "the CLI" would have kept passing against whichever file still matched, which is
98
+ // how a check quietly stops watching its subject.
99
+ assert.match(
100
+ readFileSync(new URL("./src/cli.ts", import.meta.url), "utf8"),
101
+ /overrideConfigFile:\s*true/,
102
+ "the CLI must pin its own config, or a consumer's nested config silently changes the rule set",
103
+ );
104
+ // The redirect into a report file is only sound while `--json` keeps stdout clean.
105
+ assert.match(
106
+ eslintStep.run,
107
+ /--json > "\$RUNNER_TEMP\/paperlint-report\.json"/,
108
+ "the machine-readable report must be redirected whole — it is what the guard reads",
109
+ );
110
+ // The guard must be CALLED, and by file — an inline blob would be untestable.
111
+ assert.match(
112
+ eslintStep.run,
113
+ /eslint-report-guard\.mjs/,
114
+ "the lint step must hand its report to scripts/eslint-report-guard.mjs",
115
+ );
116
+ });
110
117
  // ── I-b. THE STEP'S SHELL SEMANTICS, EXECUTED — not grepped ───────────────────────────────────
111
118
  //
112
119
  // 🔴 THE ASSERTION THAT STOOD HERE READ THE TEXT (`/RC=\$\?/`) AND WAS GREEN OVER A DEAD ERROR
@@ -153,7 +160,7 @@ const stubbedStepRun = (stubRc, paths = ".") => {
153
160
  };
154
161
 
155
162
  // FIRES-THROUGH: ESLint failed. This is the case the old text assertion could not see.
156
- {
163
+ it("FIRES-THROUGH: ESLint failed, the guard still runs and the code comes through", () => {
157
164
  const r = stubbedStepRun(2);
158
165
  assert.match(
159
166
  r.stdout,
@@ -165,9 +172,9 @@ const stubbedStepRun = (stubRc, paths = ".") => {
165
172
  2,
166
173
  "ESLint's failure code must come through the guard, not be masked to 1",
167
174
  );
168
- }
175
+ });
169
176
  // QUIET HALF: ESLint succeeded — the guard runs and passes 0 through.
170
- {
177
+ it("QUIET HALF: ESLint succeeded, the guard runs and passes 0 through", () => {
171
178
  const r = stubbedStepRun(0);
172
179
  assert.match(
173
180
  r.stdout,
@@ -175,43 +182,47 @@ const stubbedStepRun = (stubRc, paths = ".") => {
175
182
  "the guard must run on success too",
176
183
  );
177
184
  assert.equal(r.status, 0, "a clean run must stay green");
178
- }
185
+ });
179
186
 
180
187
  // texcount is checked for EXISTENCE, not by the installer's exit code: an installer can put nothing
181
188
  // in place and report success (measured in this corpus, 2026-09-01).
182
- const pathStep = action.runs.steps.find((s) => /on PATH/i.test(s.name ?? ""));
183
- assert.ok(pathStep, `no step verifying texcount is on PATH among: ${names}`);
184
- assert.match(
185
- pathStep.run,
186
- /command -v texcount/,
187
- "the PATH step must probe the binary itself",
188
- );
189
+ it("texcount is checked for existence, and the action takes its inputs", () => {
190
+ const pathStep = action.runs.steps.find((s) => /on PATH/i.test(s.name ?? ""));
191
+ assert.ok(pathStep, `no step verifying texcount is on PATH among: ${names}`);
192
+ assert.match(
193
+ pathStep.run,
194
+ /command -v texcount/,
195
+ "the PATH step must probe the binary itself",
196
+ );
189
197
 
190
- for (const key of [
191
- "config",
192
- "paths",
193
- "max-warnings",
194
- "texcount",
195
- "working-directory",
196
- ])
197
- assert.ok(action.inputs[key], `input \`${key}\` is missing`);
198
+ for (const key of [
199
+ "config",
200
+ "paths",
201
+ "max-warnings",
202
+ "texcount",
203
+ "working-directory",
204
+ ])
205
+ assert.ok(action.inputs[key], `input \`${key}\` is missing`);
206
+ });
198
207
 
199
208
  // ── `paths` is OPTIONAL: with none, the CLI lints the papersDir its paperlint.json declares ──────
200
209
  // `paperlint lint` with no path finds the root paperlint.json and lints its `papersDir`, so that is
201
210
  // the normal call and the action must not refuse it. What is asserted is the behaviour: the real
202
211
  // `run:` block, handed an empty `paths`, calls the CLI with no path argument at all, and the guard
203
212
  // still runs over what the CLI reported.
204
- assert.equal(
205
- action.inputs.paths.required,
206
- false,
207
- "`paths` must be optional — the CLI finds papersDir itself",
208
- );
209
- assert.equal(
210
- action.inputs.paths.default,
211
- "",
212
- "`paths` must default to empty, which means: the papersDir of paperlint.json",
213
- );
214
- {
213
+ it("`paths` is OPTIONAL: declared, not required", () => {
214
+ assert.equal(
215
+ action.inputs.paths.required,
216
+ false,
217
+ "`paths` must be optional — the CLI finds papersDir itself",
218
+ );
219
+ assert.equal(
220
+ action.inputs.paths.default,
221
+ "",
222
+ "`paths` must default to empty, which means: the papersDir of paperlint.json",
223
+ );
224
+ });
225
+ it("an empty `paths` runs clean and the CLI gets no path argument", () => {
215
226
  const r = stubbedStepRun(0, "");
216
227
  assert.equal(r.status, 0, `an empty \`paths\` must run clean: ${r.stderr}`);
217
228
  assert.deepEqual(
@@ -220,8 +231,8 @@ assert.equal(
220
231
  "with no `paths` the CLI must get no path argument — not an empty string, not `.`",
221
232
  );
222
233
  assert.match(r.stdout, /linted 1 file\(s\)/, "the guard must still run");
223
- }
224
- {
234
+ });
235
+ it("named paths are handed to the CLI one argument each", () => {
225
236
  stubbedStepRun(0, "papers/a papers/b");
226
237
  assert.deepEqual(
227
238
  readFileSync(join(TMP, "npx-args"), "utf8").trim().split("\n"),
@@ -235,7 +246,7 @@ assert.equal(
235
246
  ],
236
247
  "named paths are handed to the CLI one argument each",
237
248
  );
238
- }
249
+ });
239
250
 
240
251
  // ── II. BEHAVIOUR of the guard — both halves, on fixtures ─────────────────────────────────────
241
252
  const fixture = (name, body) => {
@@ -245,7 +256,7 @@ const fixture = (name, body) => {
245
256
  };
246
257
 
247
258
  // FIRES: zero files linted. The whole reason the guard exists.
248
- {
259
+ it("FIRES: zero files linted", () => {
249
260
  const { code, lines } = guard(fixture("empty.json", "[]"), 0, {
250
261
  paths: ".",
251
262
  config: "c.mjs",
@@ -256,9 +267,9 @@ const fixture = (name, body) => {
256
267
  "a report of zero linted files must FAIL, not pass as clean",
257
268
  );
258
269
  assert.match(lines.join("\n"), /linted ZERO files/);
259
- }
270
+ });
260
271
  // With no paths given, the guard names where the scope came from instead of printing `paths=`.
261
- {
272
+ it("with no paths given, the guard names where the scope came from", () => {
262
273
  const { lines } = guard(fixture("empty2.json", "[]"), 0, {
263
274
  paths: "",
264
275
  config: "paperlint.json",
@@ -268,26 +279,28 @@ const fixture = (name, body) => {
268
279
  /paths=\(none: the papersDir of paperlint\.json\)/,
269
280
  "an empty paths value must be named as the papersDir, not printed blank",
270
281
  );
271
- }
282
+ });
272
283
  // FIRES: the report is absent or unparsable — nothing was measured either way.
273
- assert.equal(
274
- guard(join(TMP, "absent.json"), 0).code,
275
- 1,
276
- "an unreadable report must FAIL",
277
- );
278
- assert.equal(
279
- guard(fixture("garbage.json", "{oops"), 0).code,
280
- 1,
281
- "an unparsable report must FAIL",
282
- );
283
- assert.equal(
284
- guard(fixture("object.json", '{"not":"an array"}'), 0).code,
285
- 1,
286
- "a report that is not a result array must FAIL",
287
- );
284
+ it("FIRES: the report is absent or unparsable", () => {
285
+ assert.equal(
286
+ guard(join(TMP, "absent.json"), 0).code,
287
+ 1,
288
+ "an unreadable report must FAIL",
289
+ );
290
+ assert.equal(
291
+ guard(fixture("garbage.json", "{oops"), 0).code,
292
+ 1,
293
+ "an unparsable report must FAIL",
294
+ );
295
+ assert.equal(
296
+ guard(fixture("object.json", '{"not":"an array"}'), 0).code,
297
+ 1,
298
+ "a report that is not a result array must FAIL",
299
+ );
300
+ });
288
301
 
289
302
  // QUIET: files were linted and ESLint was happy → ESLint's code passes through untouched.
290
- {
303
+ it("QUIET: files were linted and ESLint was happy", () => {
291
304
  const one = fixture(
292
305
  "one.json",
293
306
  JSON.stringify([
@@ -309,9 +322,9 @@ assert.equal(
309
322
  2,
310
323
  "a real run must pass ESLint's failure code through, not mask it",
311
324
  );
312
- }
325
+ });
313
326
  // QUIET: a file linted with NO findings is a legitimate clean run — the guard must not fire on it.
314
- {
327
+ it("QUIET: a file linted with no findings is a clean run", () => {
315
328
  const clean = fixture(
316
329
  "clean.json",
317
330
  JSON.stringify([{ filePath: "/x/a.md", messages: [] }]),
@@ -324,8 +337,4 @@ assert.equal(
324
337
  );
325
338
  assert.doesNotMatch(lines.join("\n"), /linted ZERO files/);
326
339
  assert.match(lines.join("\n"), /linted 1 file\(s\) · 0 finding\(s\)/);
327
- }
328
-
329
- console.log(
330
- "✓ action.yml shape (parsed, not grepped) + guard behaviour, both halves",
331
- );
340
+ });
@@ -14,7 +14,7 @@ export interface Stray {
14
14
  /** The entry's name; a folder's ends in a slash. */
15
15
  readonly name: string;
16
16
  readonly kind: "file" | "dir";
17
- /** Where it goes: one destination for a known name, else the choice by what it is. */
17
+ /** Where it goes: one destination, by its name, else by its kind, else `extra/`. */
18
18
  readonly cure: string;
19
19
  }
20
20
  /** The one folder whose content is not judged. */
@@ -54,13 +54,25 @@ export declare const KNOWN_CURES: readonly {
54
54
  readonly kind: "file" | "dir";
55
55
  readonly cure: string;
56
56
  }[];
57
- /** For a name nobody listed: the choice by what the material is. */
58
- export declare const CURE_BY_KIND = "decide by what it is \u2014 a record or research \u2192 research/; about submitting (forms, mails, checklists, portal records) \u2192 submission/; live state of the paper (plan, status) \u2192 a section of PIPELINE-STATUS.md; reproduction (scripts, data, the artifact) \u2192 repro/; a frozen PDF of a stage \u2192 versions/; unclear \u2192 extra/, which is never judged";
57
+ /** The extensions of the images a figure is drawn from. */
58
+ export declare const IMAGE_EXTENSIONS: readonly string[];
59
+ /**
60
+ * For a file nobody listed: the folder its kind names, by its exact name or its extension (matched
61
+ * ignoring case). The same kinds `repro/allowed-files-only` sorts by. No `.pdf`: a root PDF may be
62
+ * a figure, a draft or a review, and `versions/` holds only cycle folders (`versions/layout`).
63
+ */
64
+ export declare const CURE_BY_FILE: readonly {
65
+ readonly names: readonly string[];
66
+ readonly extensions: readonly string[];
67
+ readonly cure: string;
68
+ }[];
69
+ /** For anything else: the folder that is never judged. */
70
+ export declare const CURE_BY_DEFAULT = "extra/";
59
71
  /** The root entries that are not part of the layout, in the order given. Pure. */
60
72
  export declare function judgeLayout(entries: readonly LayoutEntry[], declared: Declared): readonly Stray[];
61
73
  /** The paper folder's layout, entry by entry, `repro/` drawn with its own layout inside. */
62
74
  export declare const PAPER_NODES: readonly TreeNode[];
63
- /** The drawing of the paper folder's layout: the rule's message, the hook's refusal, the rule's page. */
75
+ /** The drawing of the paper folder's layout, which the rule's page embeds. */
64
76
  export declare const PAPER_LAYOUT_TREE: string;
65
77
  /** The folder beside the paper folders that holds one corpus of accepted papers per venue. */
66
78
  export declare const VENUES_DIR = "venues";
@@ -74,8 +86,8 @@ export declare const PAPERS_NODES: readonly TreeNode[];
74
86
  export declare const PAPERS_LAYOUT_TREE: string;
75
87
  /**
76
88
  * The one text a stray entry is reported with, by the rule `paper/allowed-files-only` and by the hook that
77
- * refuses to create such an entry. It stands alone: where the entry goes, and the whole layout drawn,
78
- * for a reader who knows nothing of paperlint.
89
+ * refuses to create such an entry: one line, the entry and its one destination. The layout, and how
90
+ * each destination is picked, are on the rule's page, which the finding's rule id names.
79
91
  */
80
92
  export declare function strayMessage(s: Stray): string;
81
93
  //# sourceMappingURL=paper-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paper-layout.d.ts","sourceRoot":"","sources":["../../src/domain/paper-layout.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGnE,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CAC/B;AAED,+FAA+F;AAC/F,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,eAAO,MAAM,gBAAgB,EAAE,QAAwB,CAAC;AAExD,iFAAiF;AACjF,MAAM,WAAW,KAAK;IACpB,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAC9B,sFAAsF;IACtF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,kDAAkD;AAClD,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,oGAAoG;AACpG,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,4EAA4E;AAC5E,eAAO,MAAM,eAAe,EAAE,SAAS,KAAK,EAoB3C,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAuC,CAAC;AAEhF,6EAA6E;AAC7E,eAAO,MAAM,cAAc,EAAE,SAAS,KAAK,EAkB1C,CA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