paperlint 18.9.0 → 19.0.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/.claude-plugin/plugin.json +1 -1
  2. package/CLAUDE.md +7 -1
  3. package/dist/skill-chunks/{chunk-NPQVDEE4.js → chunk-4MHEJ6FR.js} +50 -1
  4. package/dist/skill-chunks/{chunk-KWK6RT4T.js → chunk-EOVEVX67.js} +1 -1
  5. package/dist/skill-chunks/{chunk-65X5HVIJ.js → chunk-UL4INX2P.js} +1 -1
  6. package/lib/skill-corpus.mjs +2 -113
  7. package/lib/skill-corpus.test.mjs +10 -11
  8. package/package.json +4 -3
  9. package/presets/agentverify-2027.jsonc +12 -6
  10. package/presets/agentverify-2027.md +11 -7
  11. package/presets/aidc-2026.jsonc +4 -4
  12. package/presets/aidc-2026.md +4 -0
  13. package/presets/nlbse-2027.jsonc +11 -6
  14. package/presets/nlbse-2027.md +7 -7
  15. package/scripts/harness-api.frozen.json +0 -18
  16. package/scripts/sync-skills.test.ts +69 -0
  17. package/scripts/sync-skills.ts +57 -0
  18. package/skills/argument-arc/scripts/headings.js +2 -2
  19. package/skills/build-label-page/build-label-page.test.ts +2 -7
  20. package/skills/build-label-page/scripts/label-page.js +1 -1
  21. package/skills/cold-read-diff/scripts/cold-read.js +2 -2
  22. package/skills/harden-paper/check-numbers.test.ts +104 -0
  23. package/skills/harden-paper/check-release-claims.test.ts +126 -0
  24. package/skills/label-agent-runs/label-agent-runs.harness.ts +2 -6
  25. package/skills/label-agent-runs/scripts/labels.js +1 -1
  26. package/skills/paper-pipeline/scripts/extract-ref-facts.js +3 -3
  27. package/skills/pc-panel-review/scripts/prior-reviews.js +1 -1
  28. package/skills/render-paper/render-paper.harness.mjs +153 -0
  29. package/skills/rewrite-unclear/rewrite-unclear.harness.ts +0 -5
  30. package/skills/run-agent-grid/run-agent-grid.harness.ts +2 -6
  31. package/skills/run-agent-grid/scripts/grid-guard.js +1 -1
  32. package/skills/submit-paper/check-deanon.test.ts +165 -0
  33. package/skills/verify-citations/scripts/bib-authors.js +3 -3
  34. package/skills/verify-citations/scripts/verify-cites.js +3 -3
  35. package/src/edition-rule.test.ts +16 -12
  36. package/lib/skill-checks.d.mts +0 -10
  37. package/lib/skill-checks.mjs +0 -403
  38. package/lib/skill-checks.test.mjs +0 -288
  39. package/skills/analyze-sibling-paper/analyze-sibling-paper.harness.mjs +0 -23
  40. package/skills/argument-arc/argument-arc.harness.mjs +0 -23
  41. package/skills/build-benchmark/build-benchmark.harness.mjs +0 -23
  42. package/skills/camera-ready/camera-ready.harness.mjs +0 -23
  43. package/skills/cold-read-diff/cold-read-diff.harness.mjs +0 -21
  44. package/skills/draft-paper/draft-paper.harness.mjs +0 -23
  45. package/skills/extend-paper/extend-paper.harness.mjs +0 -23
  46. package/skills/find-venue/find-venue.harness.mjs +0 -23
  47. package/skills/harden-paper/harden-paper.harness.mjs +0 -23
  48. package/skills/map-prior-work/map-prior-work.harness.mjs +0 -23
  49. package/skills/paper-status/paper-status.harness.mjs +0 -25
  50. package/skills/pc-panel-review/pc-panel-review.harness.mjs +0 -24
  51. package/skills/plan-paper-timeline/plan-paper-timeline.harness.mjs +0 -23
  52. package/skills/research-ideate/research-ideate.harness.mjs +0 -23
  53. package/skills/study-accepted-papers/study-accepted-papers.harness.mjs +0 -23
  54. package/skills/submit-paper/submit-paper.harness.mjs +0 -23
  55. package/skills/tighten-paper/tighten-paper.harness.mjs +0 -23
  56. package/skills/verify-citations/verify-citations.harness.mjs +0 -23
@@ -0,0 +1,57 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { generate } from "rulesync";
6
+ import { isMain } from "../skills/paper-pipeline/scripts/consumer.mjs";
7
+
8
+ const sourcePath = ".claude/skills/add-venue/SKILL.md";
9
+
10
+ /** Stage the compiled skill alone. Its eval and spec are repository authoring files. */
11
+ async function stageSkill(inputRoot: string, source: string): Promise<void> {
12
+ const skill = join(inputRoot, "skills", "add-venue");
13
+ await mkdir(skill, { recursive: true });
14
+ await writeFile(
15
+ join(skill, "SKILL.md"),
16
+ source.replace(
17
+ /^<!-- vigiles:sha256:.* -->\r?$/m,
18
+ "<!-- Generated by npm run sync:skills from the compiled Claude skill. -->",
19
+ ),
20
+ );
21
+ }
22
+
23
+ export async function syncSkills(root: string, check: boolean): Promise<void> {
24
+ const source = await readFile(join(root, sourcePath), "utf8");
25
+ const inputRoot = await mkdtemp(join(tmpdir(), "paperlint-rulesync-"));
26
+ try {
27
+ await stageSkill(inputRoot, source);
28
+ const result = await generate({
29
+ inputRoots: [inputRoot],
30
+ outputRoots: [root],
31
+ targets: ["codexcli"],
32
+ features: ["skills"],
33
+ check,
34
+ delete: false,
35
+ silent: true,
36
+ global: false,
37
+ });
38
+ assert.equal(
39
+ result.sourceLoadFailed,
40
+ false,
41
+ "Rulesync could not read add-venue",
42
+ );
43
+ assert.ok(
44
+ !check || !result.hasDiff,
45
+ "Run npm run sync:skills to refresh the Codex skill",
46
+ );
47
+ } finally {
48
+ await rm(inputRoot, { recursive: true, force: true });
49
+ }
50
+ }
51
+
52
+ if (isMain(import.meta.url)) {
53
+ await syncSkills(
54
+ join(import.meta.dirname, ".."),
55
+ process.argv.includes("--check"),
56
+ );
57
+ }
@@ -8,7 +8,7 @@ const __dirname = __plDirname(__filename);
8
8
  import {
9
9
  latexReader,
10
10
  sourcesCodec
11
- } from "../../../dist/skill-chunks/chunk-65X5HVIJ.js";
11
+ } from "../../../dist/skill-chunks/chunk-UL4INX2P.js";
12
12
  import {
13
13
  callerPath,
14
14
  decoded,
@@ -17,7 +17,7 @@ import {
17
17
  runText
18
18
  } from "../../../dist/skill-chunks/chunk-6NU6CXUS.js";
19
19
  import "../../../dist/skill-chunks/chunk-GRSXIWYF.js";
20
- import "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
20
+ import "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
21
21
  import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
22
22
 
23
23
  // skills/argument-arc/scripts/headings-core.ts
@@ -1,20 +1,15 @@
1
1
  /**
2
- * build-label-page — the free tier of the SKILL itself: it passes the shared per-skill checks, and its
3
- * checklist has the eight rules the skill names. The generator is tested beside it, in scripts/.
2
+ * build-label-page — the free tier of the SKILL itself: its checklist has the eight rules the skill
3
+ * names. The generator is tested beside it, in scripts/.
4
4
  * No model, no network, no browser.
5
5
  */
6
6
  import assert from "node:assert/strict";
7
7
  import { readFileSync } from "node:fs";
8
8
  import { join } from "node:path";
9
9
  import { test } from "vitest";
10
- import { checkSkill } from "../../lib/skill-checks.mjs";
11
10
 
12
11
  const HERE = import.meta.dirname;
13
12
 
14
- test("the shared per-skill checks pass", async () => {
15
- await checkSkill("build-label-page");
16
- });
17
-
18
13
  test("the checklist has the eight rules, numbered, and the skill names eight", () => {
19
14
  const checklist = readFileSync(
20
15
  join(HERE, "references", "checklist.md"),
@@ -25,7 +25,7 @@ import {
25
25
  } from "../../../dist/skill-chunks/chunk-GRSXIWYF.js";
26
26
  import {
27
27
  external_exports
28
- } from "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
28
+ } from "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
29
29
  import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
30
30
 
31
31
  // skills/build-label-page/scripts/label-page-cli.ts
@@ -10,7 +10,7 @@ import {
10
10
  parseLatex,
11
11
  sourcesCodec,
12
12
  visit
13
- } from "../../../dist/skill-chunks/chunk-65X5HVIJ.js";
13
+ } from "../../../dist/skill-chunks/chunk-UL4INX2P.js";
14
14
  import {
15
15
  messageOf,
16
16
  nodeFiles,
@@ -21,7 +21,7 @@ import {
21
21
  t,
22
22
  t10 as t2
23
23
  } from "../../../dist/skill-chunks/chunk-GRSXIWYF.js";
24
- import "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
24
+ import "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
25
25
  import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
26
26
 
27
27
  // skills/cold-read-diff/scripts/cold-read-core.ts
@@ -0,0 +1,104 @@
1
+ /**
2
+ * `check-numbers.sh`, the number enumerator: it lists every quantitative token in a paper's body
3
+ * so each can be traced to an artifact output or a citation. The gate is advisory (a real run
4
+ * always exits 0), so the verdict lives entirely in its output, and an empty list is its whole
5
+ * failure mode. Exit 2 on a bad path is the only signal that tells "nothing to trace" from "no
6
+ * file was read".
7
+ */
8
+ import { spawnSync } from "node:child_process";
9
+ import { mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
10
+ import { tmpdir } from "node:os";
11
+ import { dirname, join } from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+ import { afterEach, describe, expect, it } from "vitest";
14
+
15
+ const SCRIPT = join(
16
+ dirname(fileURLToPath(import.meta.url)),
17
+ "check-numbers.sh",
18
+ );
19
+ const made: string[] = [];
20
+ afterEach(() => {
21
+ made.splice(0).forEach((d) => {
22
+ rmSync(d, { recursive: true, force: true });
23
+ });
24
+ });
25
+
26
+ /** A paper directory holding `paper.tex` with the given lines. */
27
+ const paperDir = (lines: readonly string[]): string => {
28
+ const dir = realpathSync(mkdtempSync(join(tmpdir(), "numbers-")));
29
+ made.push(dir);
30
+ writeFileSync(join(dir, "paper.tex"), `${lines.join("\n")}\n`);
31
+ return dir;
32
+ };
33
+
34
+ const run = (args: readonly string[]) => {
35
+ const r = spawnSync("bash", [SCRIPT, ...args], {
36
+ encoding: "utf8",
37
+ cwd: tmpdir(),
38
+ });
39
+ return { status: r.status, stdout: r.stdout };
40
+ };
41
+
42
+ const header = (dir: string): string[] => [
43
+ `== number enumeration (body only): ${dir}/paper.tex ==`,
44
+ " Trace each to an artifact output or a \\cite. An untraceable number = treat as fabricated (source it or cut it).",
45
+ ];
46
+
47
+ const footer =
48
+ "-- review the list: every number above must appear in the artifact output or carry a citation --";
49
+
50
+ describe("check-numbers.sh", () => {
51
+ it("lists the body line whose numbers carry no citation, and nothing else", () => {
52
+ const dir = paperDir([
53
+ "\\documentclass{article}",
54
+ "\\begin{document}",
55
+ "% a stray 99\\% inside a comment, which is not body prose",
56
+ "The mean output change ranged from a 37\\% growth to an 18\\% cut across independent runs.",
57
+ "Prior work reports a 2.4x speedup \\cite{smith2020}.",
58
+ "\\begin{filecontents}{refs.bib}",
59
+ "@article{smith2020, year={2020}, pages={100--200}}",
60
+ "\\end{filecontents}",
61
+ "\\end{document}",
62
+ ]);
63
+ // Excluded: the comment (line 3), the cited line (5) and the embedded bibliography (6-8).
64
+ expect(run([dir])).toEqual({
65
+ status: 0,
66
+ stdout: [
67
+ ...header(dir),
68
+ " 4: The mean output change ranged from a 37\\% growth to an 18\\% cut across independent runs.",
69
+ footer,
70
+ "",
71
+ ].join("\n"),
72
+ });
73
+ });
74
+
75
+ it("lists nothing for prose with no quantitative token", () => {
76
+ const dir = paperDir([
77
+ "\\documentclass{article}",
78
+ "\\begin{document}",
79
+ "The gate reads the configuration and fails the build when they disagree.",
80
+ "\\end{document}",
81
+ ]);
82
+ expect(run([dir])).toEqual({
83
+ status: 0,
84
+ stdout: [...header(dir), footer, ""].join("\n"),
85
+ });
86
+ });
87
+
88
+ it("exits 2, naming the file, when the named tex basename does not exist", () => {
89
+ const dir = paperDir(["\\documentclass{article}"]);
90
+ expect(run([dir, "nosuchbase"])).toEqual({
91
+ status: 2,
92
+ stdout: "FAIL: no nosuchbase.tex\n",
93
+ });
94
+ });
95
+
96
+ it("exits 2 when the paper directory does not exist", () => {
97
+ const dir = paperDir([]);
98
+ const gone = join(dir, "missing");
99
+ expect(run([gone])).toEqual({
100
+ status: 2,
101
+ stdout: `FAIL: cannot cd ${gone}\n`,
102
+ });
103
+ });
104
+ });
@@ -0,0 +1,126 @@
1
+ /**
2
+ * `check-release-claims.sh`, the release-claim reconciler: it prints the paper's "we release X"
3
+ * sentences next to what the artifact directory actually holds, so an over-promise is visible.
4
+ * The gate is advisory (a real run always exits 0), so the verdict lives in its output; exit 2 on
5
+ * a bad path is the only way a wrong path differs from a paper that promises nothing.
6
+ */
7
+ import { spawnSync } from "node:child_process";
8
+ import {
9
+ mkdirSync,
10
+ mkdtempSync,
11
+ realpathSync,
12
+ rmSync,
13
+ writeFileSync,
14
+ } from "node:fs";
15
+ import { tmpdir } from "node:os";
16
+ import { dirname, join } from "node:path";
17
+ import { fileURLToPath } from "node:url";
18
+ import { afterEach, describe, expect, it } from "vitest";
19
+
20
+ const SCRIPT = join(
21
+ dirname(fileURLToPath(import.meta.url)),
22
+ "check-release-claims.sh",
23
+ );
24
+ const made: string[] = [];
25
+ afterEach(() => {
26
+ made.splice(0).forEach((d) => {
27
+ rmSync(d, { recursive: true, force: true });
28
+ });
29
+ });
30
+
31
+ /** A paper directory holding `paper.tex` with the given lines and the given artifact files. */
32
+ const paperDir = (
33
+ lines: readonly string[],
34
+ artifact: Readonly<Record<string, string>> = {},
35
+ ): string => {
36
+ const dir = realpathSync(mkdtempSync(join(tmpdir(), "release-")));
37
+ made.push(dir);
38
+ writeFileSync(join(dir, "paper.tex"), `${lines.join("\n")}\n`);
39
+ Object.entries(artifact).forEach(([name, body]) => {
40
+ mkdirSync(join(dir, "artifact"), { recursive: true });
41
+ writeFileSync(join(dir, "artifact", name), body);
42
+ });
43
+ return dir;
44
+ };
45
+
46
+ const run = (args: readonly string[]) => {
47
+ const r = spawnSync("bash", [SCRIPT, ...args], {
48
+ encoding: "utf8",
49
+ cwd: tmpdir(),
50
+ });
51
+ return { status: r.status, stdout: r.stdout };
52
+ };
53
+
54
+ const claimsHeader = (dir: string): string[] => [
55
+ `== release-claim reconciliation: ${dir} ==`,
56
+ "-- (1) PROSE claims (release verbs) — reconcile each against the artifact listing below --",
57
+ ];
58
+
59
+ const footer = [
60
+ "-- CHECK: every 'we release X' in (1) must be satisfied by a file in (2).",
61
+ " Promised-but-absent (e.g. 'raw runs' but only aggregates shipped) -> soften to '(at camera-ready)' or add the file.",
62
+ " Mirror the accurate Availability paragraph; do not let the abstract/conclusion over-promise the artifact.",
63
+ "",
64
+ ];
65
+
66
+ describe("check-release-claims.sh", () => {
67
+ it("prints the release sentence beside what the artifact holds, skipping a commented-out claim", () => {
68
+ const dir = paperDir(
69
+ [
70
+ "\\documentclass{article}",
71
+ "\\begin{document}",
72
+ "We release the harness and raw runs with the submission.",
73
+ "% we release nothing, and this line is a comment",
74
+ "The gate reads the configuration.",
75
+ "\\end{document}",
76
+ ],
77
+ { "aggregates.csv": "arm,mean\na,1\n" },
78
+ );
79
+ expect(run([dir])).toEqual({
80
+ status: 0,
81
+ stdout: [
82
+ ...claimsHeader(dir),
83
+ " 3:We release the harness and raw runs with the submission.",
84
+ `-- (2) what the artifact ACTUALLY contains (${dir}/artifact) --`,
85
+ " artifact/aggregates.csv",
86
+ ...footer,
87
+ ].join("\n"),
88
+ });
89
+ });
90
+
91
+ it("says no release-verb line matched, and that no local artifact exists, for a paper that promises nothing", () => {
92
+ const dir = paperDir([
93
+ "\\documentclass{article}",
94
+ "\\begin{document}",
95
+ "The gate reads the configuration.",
96
+ "\\end{document}",
97
+ ]);
98
+ expect(run([dir])).toEqual({
99
+ status: 0,
100
+ stdout: [
101
+ ...claimsHeader(dir),
102
+ " (no release-verb lines matched)",
103
+ `-- (2) what the artifact ACTUALLY contains (${dir}/artifact) --`,
104
+ " (no local artifact/ dir — hosted externally? then reconcile the claim against the HOSTED contents)",
105
+ ...footer,
106
+ ].join("\n"),
107
+ });
108
+ });
109
+
110
+ it("exits 2, naming the file, when the named tex basename does not exist", () => {
111
+ const dir = paperDir(["\\documentclass{article}"]);
112
+ expect(run([dir, "nosuchbase"])).toEqual({
113
+ status: 2,
114
+ stdout: "FAIL: no nosuchbase.tex\n",
115
+ });
116
+ });
117
+
118
+ it("exits 2 when the paper directory does not exist", () => {
119
+ const dir = paperDir([]);
120
+ const gone = join(dir, "missing");
121
+ expect(run([gone])).toEqual({
122
+ status: 2,
123
+ stdout: `FAIL: cannot cd ${gone}\n`,
124
+ });
125
+ });
126
+ });
@@ -8,9 +8,8 @@
8
8
  * pair that labels different runs refused. The commands call the COMPILED `labels.js` under the
9
9
  * skill's link, which is what runs from `node_modules` (`npm run build` makes it).
10
10
  *
11
- * Also, without the CLI: the shared per-skill checks (`checkSkill`). Whether the skill names only
12
- * subcommands the script has is not tested here: the spec interpolates them from
13
- * `scripts/labels-commands.ts`, so a wrong one fails `tsc`.
11
+ * Whether the skill names only subcommands the script has is not tested here: the spec interpolates
12
+ * them from `scripts/labels-commands.ts`, so a wrong one fails `tsc`.
14
13
  *
15
14
  * What it does NOT prove: that a real model reads the uncertain runs in full. That is for
16
15
  * `label-agent-runs.eval.ts` and a real labelling pass.
@@ -19,15 +18,12 @@ import { spawnSync } from "node:child_process";
19
18
  import { join } from "node:path";
20
19
  import { runHarnessTest, skip, type ToolCall } from "vigiles";
21
20
  import { createChecker } from "../../lib/check.ts";
22
- import { checkSkill } from "../../lib/skill-checks.mjs";
23
21
  import { observeAgentCli } from "#lib/agent-cli-version";
24
22
  import { claudeDir } from "#src/package-dirs";
25
23
  import { COMMANDS } from "./scripts/labels-commands.ts";
26
24
 
27
25
  const check = createChecker();
28
26
 
29
- await checkSkill("label-agent-runs");
30
-
31
27
  // ── Through the real CLI: agreement, as the skill tells an agent to compute it ───────────
32
28
  const LINK = join(claudeDir(), "skills", "label-agent-runs");
33
29
  const cli = observeAgentCli({ spawnSync });
@@ -7,7 +7,7 @@ const __filename = __plFileURLToPath(import.meta.url);
7
7
  const __dirname = __plDirname(__filename);
8
8
  import {
9
9
  external_exports
10
- } from "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
10
+ } from "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
11
11
  import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
12
12
 
13
13
  // skills/label-agent-runs/scripts/labels.ts
@@ -10,18 +10,18 @@ import {
10
10
  bibliographyAt,
11
11
  bibliographyUnreadWhy,
12
12
  isMain
13
- } from "../../../dist/skill-chunks/chunk-KWK6RT4T.js";
13
+ } from "../../../dist/skill-chunks/chunk-EOVEVX67.js";
14
14
  import {
15
15
  latexReader,
16
16
  sourcesCodec
17
- } from "../../../dist/skill-chunks/chunk-65X5HVIJ.js";
17
+ } from "../../../dist/skill-chunks/chunk-UL4INX2P.js";
18
18
  import "../../../dist/skill-chunks/chunk-IREAROCV.js";
19
19
  import {
20
20
  absolutePath,
21
21
  nodeFiles
22
22
  } from "../../../dist/skill-chunks/chunk-6NU6CXUS.js";
23
23
  import "../../../dist/skill-chunks/chunk-GRSXIWYF.js";
24
- import "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
24
+ import "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
25
25
  import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
26
26
 
27
27
  // skills/paper-pipeline/scripts/extract-ref-facts.mjs
@@ -23,7 +23,7 @@ import {
23
23
  import "../../../dist/skill-chunks/chunk-GRSXIWYF.js";
24
24
  import {
25
25
  external_exports
26
- } from "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
26
+ } from "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
27
27
  import {
28
28
  __commonJS,
29
29
  __toESM
@@ -381,3 +381,156 @@ import {
381
381
  withGap.stdout,
382
382
  );
383
383
  }
384
+
385
+ // ── THE LOG VERDICT: check-render.sh FAILS A PAPER WHOSE TEXT BLEEDS PAST THE COLUMN ─────────
386
+ // The script reads the LaTeX log and exits 1 on a visible defect (an overfull box wider than the
387
+ // threshold, an undefined citation or reference), 0 on a clean log, and 2 when there is no log to
388
+ // read. `NO_COMPILE=1` skips pdflatex, so the log parser runs anywhere; the last case compiles
389
+ // for real, and only where a TeX toolchain exists. Both halves, always: a gate that fails a clean
390
+ // log is bypassed on deadline day, and one that passes a defective log is decoration.
391
+ {
392
+ const CHECK = join(
393
+ dirname(fileURLToPath(import.meta.url)),
394
+ "check-render.sh",
395
+ );
396
+ const dirWith = (files) => {
397
+ const dir = realpathSync(mkdtempSync(join(tmpdir(), "render-log-")));
398
+ for (const [name, body] of Object.entries(files))
399
+ writeFileSync(join(dir, name), body);
400
+ return dir;
401
+ };
402
+ const verdict = (dir, { threshold = "5", compile = false } = {}) => {
403
+ const env = { ...process.env };
404
+ if (compile) delete env.NO_COMPILE;
405
+ else env.NO_COMPILE = "1";
406
+ const r = spawnSync("bash", [CHECK, dir, "paper", threshold], {
407
+ encoding: "utf8",
408
+ env,
409
+ });
410
+ return { status: r.status, stdout: r.stdout };
411
+ };
412
+ const overfull = (pt) =>
413
+ `Overfull \\hbox (${pt}pt too wide) in paragraph at lines 4--5\n`;
414
+
415
+ const wide = verdict(dirWith({ "paper.log": overfull("12.34") }));
416
+ assert.equal(
417
+ wide.status,
418
+ 1,
419
+ `a 12.34pt overfull hbox must fail:\n${wide.stdout}`,
420
+ );
421
+ assert.match(
422
+ wide.stdout,
423
+ /OVERFULL hbox\s+12\.34pt/,
424
+ `the overfull box was counted but not located:\n${wide.stdout}`,
425
+ );
426
+
427
+ const narrow = verdict(dirWith({ "paper.log": overfull("1.2") }));
428
+ assert.equal(
429
+ narrow.status,
430
+ 0,
431
+ `a 1.2pt overfull is invisible in print and must not fail:\n${narrow.stdout}`,
432
+ );
433
+ assert.match(
434
+ narrow.stdout,
435
+ /1 sub-threshold/,
436
+ `the sub-threshold box was not counted:\n${narrow.stdout}`,
437
+ );
438
+
439
+ // The threshold argument has to move the line, or it is decoration.
440
+ const twelve = dirWith({ "paper.log": overfull("12.0") });
441
+ assert.equal(
442
+ verdict(twelve, { threshold: "5" }).status,
443
+ 1,
444
+ "12pt is above a 5pt threshold",
445
+ );
446
+ assert.equal(
447
+ verdict(twelve, { threshold: "20" }).status,
448
+ 0,
449
+ "the same 12pt box must pass at a 20pt threshold",
450
+ );
451
+
452
+ const undefinedCite = verdict(
453
+ dirWith({
454
+ "paper.log":
455
+ "LaTeX Warning: Citation `smith2020' on page 1 undefined on input line 9.\n",
456
+ }),
457
+ );
458
+ assert.equal(
459
+ undefinedCite.status,
460
+ 1,
461
+ `an undefined citation prints a literal ? in the PDF and must fail:\n${undefinedCite.stdout}`,
462
+ );
463
+
464
+ const cleanLog = verdict(
465
+ dirWith({
466
+ "paper.log":
467
+ "This is pdfTeX\nOutput written on paper.pdf (8 pages, 100000 bytes).\n",
468
+ }),
469
+ );
470
+ assert.equal(
471
+ cleanLog.status,
472
+ 0,
473
+ `a clean log must pass:\n${cleanLog.stdout}`,
474
+ );
475
+ assert.match(
476
+ cleanLog.stdout,
477
+ /PASS: no visible layout defects/,
478
+ `a clean log did not print its PASS line:\n${cleanLog.stdout}`,
479
+ );
480
+
481
+ // No .log and no compile: exit 2 naming the log. Exit 0 would declare a render clean without a
482
+ // render having happened, and exit 1 would say "defects found", which is a different story.
483
+ const noLog = verdict(dirWith({}), { compile: true });
484
+ assert.equal(
485
+ noLog.status,
486
+ 2,
487
+ `no log to read must be exit 2:\n${noLog.stdout}`,
488
+ );
489
+ assert.match(
490
+ noLog.stdout,
491
+ /FAIL: no .*paper\.log/,
492
+ `the missing log was not named:\n${noLog.stdout}`,
493
+ );
494
+
495
+ const haveLatex =
496
+ spawnSync("bash", ["-c", "command -v pdflatex"], { encoding: "utf8" })
497
+ .status === 0;
498
+ if (haveLatex) {
499
+ const texPaper = (body, preamble = "") =>
500
+ dirWith({
501
+ "paper.tex": `\\documentclass[10pt]{article}\n${preamble}\\begin{document}\n${body}\n\\end{document}\n`,
502
+ });
503
+ const bad = verdict(
504
+ texPaper(
505
+ `\\noindent ${"A".repeat(72)}`,
506
+ "\\usepackage[paperwidth=6cm,paperheight=12cm,margin=1cm]{geometry}\n",
507
+ ),
508
+ { compile: true },
509
+ );
510
+ assert.equal(
511
+ bad.status,
512
+ 1,
513
+ `a word several times the column width must fail:\n${bad.stdout}`,
514
+ );
515
+ assert.match(
516
+ bad.stdout,
517
+ /OVERFULL hbox/,
518
+ `the real compile reported no overfull box:\n${bad.stdout}`,
519
+ );
520
+ const good = verdict(
521
+ texPaper(
522
+ "\\noindent The gate reads the configuration and fails the build when they disagree.",
523
+ ),
524
+ { compile: true },
525
+ );
526
+ assert.equal(
527
+ good.status,
528
+ 0,
529
+ `an ordinary paragraph must pass a real compile:\n${good.stdout}`,
530
+ );
531
+ } else {
532
+ console.log(
533
+ " real compile (overfull word, clean paragraph): NOT VERIFIED — pdflatex is not installed; only the log parser ran.",
534
+ );
535
+ }
536
+ }
@@ -5,8 +5,6 @@
5
5
  * Runs the REAL `claude` CLI against a SCRIPTED MOCK MODEL (`runHarnessTest`): $0, no API key.
6
6
  * The script activates the skill and stops; the check reads what reached the model.
7
7
  *
8
- * Also, without the CLI: the shared per-skill checks (`checkSkill`).
9
- *
10
8
  * What it does NOT prove: that a real model's rewrite is clearer, or that the description fires on
11
9
  * an author's complaint. The first is the cold reader inside the skill (step 3); the second is
12
10
  * `rewrite-unclear.eval.ts`.
@@ -14,14 +12,11 @@
14
12
  import { spawnSync } from "node:child_process";
15
13
  import { runHarnessTest, skip } from "vigiles";
16
14
  import { createChecker } from "../../lib/check.ts";
17
- import { checkSkill } from "../../lib/skill-checks.mjs";
18
15
  import { observeAgentCli } from "#lib/agent-cli-version";
19
16
  import { claudeDir } from "#src/package-dirs";
20
17
 
21
18
  const check = createChecker();
22
19
 
23
- await checkSkill("rewrite-unclear");
24
-
25
20
  const cli = observeAgentCli({ spawnSync });
26
21
  if (!cli.present) skip(`rewrite-unclear effects: ${cli.note}`);
27
22
 
@@ -9,9 +9,8 @@
9
9
  * consumer: the skill's link under `.claude/skills/`, and the COMPILED `grid-guard.js` there,
10
10
  * which is what runs from `node_modules` (`npm run build` makes it; `npm run check` builds first).
11
11
  *
12
- * Also, without the CLI: the shared per-skill checks (`checkSkill`). Whether the skill names only
13
- * subcommands the guard has is not tested here: the spec interpolates them from
14
- * `scripts/grid-guard-commands.ts`, so a wrong one fails `tsc`.
12
+ * Whether the skill names only subcommands the guard has is not tested here: the spec interpolates
13
+ * them from `scripts/grid-guard-commands.ts`, so a wrong one fails `tsc`.
15
14
  *
16
15
  * What it does NOT prove: that a real model follows the order of the gates. That is a
17
16
  * probabilistic question for `run-agent-grid.eval.ts` and a real grid.
@@ -20,15 +19,12 @@ import { spawnSync } from "node:child_process";
20
19
  import { join } from "node:path";
21
20
  import { runHarnessTest, skip, type ToolCall } from "vigiles";
22
21
  import { createChecker } from "../../lib/check.ts";
23
- import { checkSkill } from "../../lib/skill-checks.mjs";
24
22
  import { observeAgentCli } from "#lib/agent-cli-version";
25
23
  import { claudeDir } from "#src/package-dirs";
26
24
  import { COMMANDS } from "./scripts/grid-guard-commands.ts";
27
25
 
28
26
  const check = createChecker();
29
27
 
30
- await checkSkill("run-agent-grid");
31
-
32
28
  // ── Through the real CLI: the lock, as the skill tells an agent to take it ────────────────
33
29
  const SKILL_LINK = join(claudeDir(), "skills", "run-agent-grid");
34
30
  const cli = observeAgentCli({ spawnSync });
@@ -7,7 +7,7 @@ const __filename = __plFileURLToPath(import.meta.url);
7
7
  const __dirname = __plDirname(__filename);
8
8
  import {
9
9
  external_exports
10
- } from "../../../dist/skill-chunks/chunk-NPQVDEE4.js";
10
+ } from "../../../dist/skill-chunks/chunk-4MHEJ6FR.js";
11
11
  import "../../../dist/skill-chunks/chunk-PJ4KNV4J.js";
12
12
 
13
13
  // skills/run-agent-grid/scripts/grid-guard.ts