paperlint 18.9.1 → 19.0.1
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.
- package/.claude-plugin/plugin.json +1 -1
- package/CLAUDE.md +2 -2
- package/dist/adapters/eslint/index.d.ts +13 -0
- package/dist/adapters/eslint/index.d.ts.map +1 -0
- package/dist/adapters/eslint/index.js +44 -0
- package/dist/adapters/eslint/index.js.map +1 -0
- package/dist/adapters/eslint/report.io.d.ts +15 -0
- package/dist/adapters/eslint/report.io.d.ts.map +1 -0
- package/dist/adapters/eslint/report.io.js +48 -0
- package/dist/adapters/eslint/report.io.js.map +1 -0
- package/dist/cli.d.ts +7 -12
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +73 -110
- package/dist/cli.js.map +1 -1
- package/dist/domain/submission-lint.d.ts +29 -0
- package/dist/domain/submission-lint.d.ts.map +1 -0
- package/dist/domain/submission-lint.js +84 -0
- package/dist/domain/submission-lint.js.map +1 -0
- package/dist/ports/submission-lint.d.ts +6 -0
- package/dist/ports/submission-lint.d.ts.map +1 -0
- package/dist/ports/submission-lint.js +2 -0
- package/dist/ports/submission-lint.js.map +1 -0
- package/dist/structure.d.ts +17 -1
- package/dist/structure.d.ts.map +1 -1
- package/dist/structure.js.map +1 -1
- package/dist/submission-confirm-hook.d.ts +8 -1
- package/dist/submission-confirm-hook.d.ts.map +1 -1
- package/dist/submission-confirm-hook.js +75 -20
- package/dist/submission-confirm-hook.js.map +1 -1
- package/dist/submission.d.ts +5 -0
- package/dist/submission.d.ts.map +1 -1
- package/dist/submission.js +46 -7
- package/dist/submission.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/docs/submission.md +19 -8
- package/eslint.config.mjs +2 -0
- package/lib/skill-corpus.mjs +2 -113
- package/lib/skill-corpus.test.mjs +10 -11
- package/package.json +1 -2
- package/scripts/eslint-file-length.mjs +117 -0
- package/scripts/harness-api.frozen.json +0 -18
- package/skills/build-label-page/build-label-page.test.ts +2 -7
- package/skills/harden-paper/check-numbers.test.ts +104 -0
- package/skills/harden-paper/check-release-claims.test.ts +126 -0
- package/skills/label-agent-runs/label-agent-runs.harness.ts +2 -6
- package/skills/render-paper/render-paper.harness.mjs +153 -0
- package/skills/rewrite-unclear/rewrite-unclear.harness.ts +0 -5
- package/skills/run-agent-grid/run-agent-grid.harness.ts +2 -6
- package/skills/submit-paper/check-deanon.test.ts +165 -0
- package/src/adapters/eslint/index.test.ts +152 -0
- package/src/adapters/eslint/index.ts +89 -0
- package/src/adapters/eslint/report.io.ts +82 -0
- package/src/cli.ts +103 -134
- package/src/domain/submission-lint.test.ts +211 -0
- package/src/domain/submission-lint.ts +166 -0
- package/src/ports/submission-lint.ts +10 -0
- package/src/structure.ts +2 -4
- package/src/submission-confirm-hook-lint.test.ts +47 -0
- package/src/submission-confirm-hook.test.ts +73 -6
- package/src/submission-confirm-hook.ts +133 -28
- package/src/submission-fields-run.test.ts +1 -1
- package/src/submission-new.test.ts +4 -2
- package/src/submission-update.test.ts +16 -11
- package/src/submission.ts +62 -8
- package/src/types.ts +2 -0
- package/lib/skill-checks.d.mts +0 -10
- package/lib/skill-checks.mjs +0 -403
- package/lib/skill-checks.test.mjs +0 -288
- package/skills/analyze-sibling-paper/analyze-sibling-paper.harness.mjs +0 -23
- package/skills/argument-arc/argument-arc.harness.mjs +0 -23
- package/skills/build-benchmark/build-benchmark.harness.mjs +0 -23
- package/skills/camera-ready/camera-ready.harness.mjs +0 -23
- package/skills/cold-read-diff/cold-read-diff.harness.mjs +0 -21
- package/skills/draft-paper/draft-paper.harness.mjs +0 -23
- package/skills/extend-paper/extend-paper.harness.mjs +0 -23
- package/skills/find-venue/find-venue.harness.mjs +0 -23
- package/skills/harden-paper/harden-paper.harness.mjs +0 -23
- package/skills/map-prior-work/map-prior-work.harness.mjs +0 -23
- package/skills/paper-status/paper-status.harness.mjs +0 -25
- package/skills/pc-panel-review/pc-panel-review.harness.mjs +0 -24
- package/skills/plan-paper-timeline/plan-paper-timeline.harness.mjs +0 -23
- package/skills/research-ideate/research-ideate.harness.mjs +0 -23
- package/skills/study-accepted-papers/study-accepted-papers.harness.mjs +0 -23
- package/skills/submit-paper/submit-paper.harness.mjs +0 -23
- package/skills/tighten-paper/tighten-paper.harness.mjs +0 -23
- package/skills/verify-citations/verify-citations.harness.mjs +0 -23
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* build-label-page — the free tier of the SKILL itself:
|
|
3
|
-
*
|
|
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"),
|
|
@@ -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
|
-
*
|
|
12
|
-
*
|
|
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 });
|
|
@@ -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
|
-
*
|
|
13
|
-
*
|
|
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 });
|
|
@@ -139,3 +139,168 @@ describe("check-deanon.sh — both halves of the scan", () => {
|
|
|
139
139
|
});
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
|
+
|
|
143
|
+
const python = (code: string, ...args: readonly string[]) =>
|
|
144
|
+
spawnSync("python3", ["-W", "ignore", "-c", code, ...args], {
|
|
145
|
+
encoding: "utf8",
|
|
146
|
+
});
|
|
147
|
+
const havePython = python("").status === 0;
|
|
148
|
+
const havePymupdf = havePython && python("import fitz").status === 0;
|
|
149
|
+
|
|
150
|
+
/** A one-page PDF at `path` whose text is `text`. */
|
|
151
|
+
const writePdf = (path: string, text: string): void => {
|
|
152
|
+
const r = python(
|
|
153
|
+
"import sys,fitz\nd=fitz.open()\np=d.new_page()\np.insert_text((72,72),sys.argv[2])\nd.save(sys.argv[1])",
|
|
154
|
+
path,
|
|
155
|
+
text,
|
|
156
|
+
);
|
|
157
|
+
expect(r.status).toBe(0);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** An `artifact.zip` at `path` holding the given members. */
|
|
161
|
+
const writeZip = (path: string, members: Record<string, string>): void => {
|
|
162
|
+
const r = python(
|
|
163
|
+
"import sys,json,zipfile\nwith zipfile.ZipFile(sys.argv[1],'w') as f:\n [f.writestr(k,v) for k,v in json.loads(sys.argv[2]).items()]",
|
|
164
|
+
path,
|
|
165
|
+
JSON.stringify(members),
|
|
166
|
+
);
|
|
167
|
+
expect(r.status).toBe(0);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
describe("check-deanon.sh — what the deny-list matches", () => {
|
|
171
|
+
const list =
|
|
172
|
+
"# fake identity\nquillfeather\n\\bmoss\\b\ngithub\\.com/quillfeather\n";
|
|
173
|
+
|
|
174
|
+
it("a word-boundary entry does not match ordinary prose that contains the word", () => {
|
|
175
|
+
const { root, paper } = project(
|
|
176
|
+
"The mossy-green plots in Figure 3 come from run.sh.",
|
|
177
|
+
);
|
|
178
|
+
mkdirSync(join(root, ".paperlint"));
|
|
179
|
+
writeFileSync(join(root, ".paperlint", "deanon-denylist.txt"), list);
|
|
180
|
+
expect(run([paper], { env: { CLAUDE_PROJECT_DIR: root } }).status).toBe(0);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it("a file whose extension no list names (.yml) is scanned like any other", () => {
|
|
184
|
+
const { root, paper } = project("Authors omitted for double-blind review.");
|
|
185
|
+
mkdirSync(join(root, ".paperlint"));
|
|
186
|
+
writeFileSync(join(root, ".paperlint", "deanon-denylist.txt"), list);
|
|
187
|
+
writeFileSync(
|
|
188
|
+
join(paper, "artifact", "config.yml"),
|
|
189
|
+
"maintainer: quillfeather\nrepo: github.com/quillfeather/toolkit\n",
|
|
190
|
+
);
|
|
191
|
+
const { status, stdout } = run([paper], {
|
|
192
|
+
env: { CLAUDE_PROJECT_DIR: root },
|
|
193
|
+
});
|
|
194
|
+
expect({
|
|
195
|
+
status,
|
|
196
|
+
leaks: stdout.split("\n").filter((l) => l.includes("LEAK")),
|
|
197
|
+
}).toEqual({
|
|
198
|
+
status: 1,
|
|
199
|
+
leaks: [
|
|
200
|
+
" LEAK artifact/config.yml:1:maintainer: quillfeather",
|
|
201
|
+
" LEAK artifact/config.yml:2:repo: github.com/quillfeather/toolkit",
|
|
202
|
+
],
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
describe("check-deanon.sh — the bundle that gets uploaded", () => {
|
|
208
|
+
it.skipIf(!havePython)(
|
|
209
|
+
"a leak that exists only inside artifact.zip names the zip and the member",
|
|
210
|
+
() => {
|
|
211
|
+
const { root, paper } = project(
|
|
212
|
+
"Authors omitted for double-blind review.",
|
|
213
|
+
);
|
|
214
|
+
const deny = denyList(join(root, "deny.txt"));
|
|
215
|
+
writeZip(join(paper, "artifact.zip"), {
|
|
216
|
+
"artifact/README.md": "Authors omitted for double-blind review.\n",
|
|
217
|
+
"artifact/METADATA.txt": "upstream: by Quillfeather\n",
|
|
218
|
+
});
|
|
219
|
+
expect(run([paper, "paper.pdf", deny]).stdout).toContain(
|
|
220
|
+
" LEAK artifact.zip!artifact/METADATA.txt:1:upstream: by Quillfeather\n",
|
|
221
|
+
);
|
|
222
|
+
expect(run([paper, "paper.pdf", deny]).status).toBe(1);
|
|
223
|
+
},
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
describe("check-deanon.sh — a deny-list that cannot protect anything", () => {
|
|
228
|
+
it("a named deny-list that does not exist is exit 2, never a pass", () => {
|
|
229
|
+
const { root, paper } = project("by Quillfeather");
|
|
230
|
+
const missing = join(root, "does-not-exist.txt");
|
|
231
|
+
expect(run([paper, "paper.pdf", missing])).toEqual({
|
|
232
|
+
status: 2,
|
|
233
|
+
stdout: `FAIL: no deny-list ${missing}\n`,
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
it("a deny-list that is all comments is exit 2, never a pass", () => {
|
|
238
|
+
const { root, paper } = project("by Quillfeather");
|
|
239
|
+
const named = join(root, "deny.txt");
|
|
240
|
+
writeFileSync(
|
|
241
|
+
named,
|
|
242
|
+
"# emptied while chasing a false positive\n#quillfeather\n\n",
|
|
243
|
+
);
|
|
244
|
+
expect(run([paper, "paper.pdf", named])).toEqual({
|
|
245
|
+
status: 2,
|
|
246
|
+
stdout: `FAIL: deny-list ${named} has no patterns\n`,
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
describe("check-deanon.sh — the compiled PDF", () => {
|
|
252
|
+
it("an absent PDF is a warning, not silence", () => {
|
|
253
|
+
const { root, paper } = project("Authors omitted.");
|
|
254
|
+
const deny = denyList(join(root, "deny.txt"));
|
|
255
|
+
expect(run([paper, "nonexistent.pdf", deny]).stdout).toBe(
|
|
256
|
+
[
|
|
257
|
+
`== check-deanon: ${paper} (pdf=nonexistent.pdf, 1 patterns) ==`,
|
|
258
|
+
` WARN: ${paper}/nonexistent.pdf not found — PDF not scanned`,
|
|
259
|
+
"-- summary: 0 identifier hit(s) across PDF + artifact + zip",
|
|
260
|
+
"PASS: no author-identifying strings found. Safe for double-blind.",
|
|
261
|
+
"",
|
|
262
|
+
].join("\n"),
|
|
263
|
+
);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it("a PDF that cannot be read is a warning, not a pass about a document never opened", () => {
|
|
267
|
+
const { root, paper } = project("Authors omitted.");
|
|
268
|
+
const deny = denyList(join(root, "deny.txt"));
|
|
269
|
+
writeFileSync(join(paper, "paper.pdf"), "%PDF-1.4\n% not a real pdf\n");
|
|
270
|
+
expect(run([paper, "paper.pdf", deny]).stdout).toContain(
|
|
271
|
+
" WARN: could not extract PDF text (pymupdf missing?) — PDF not scanned\n",
|
|
272
|
+
);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it.skipIf(!havePymupdf)(
|
|
276
|
+
"an identifier compiled into the PDF text is a leak naming the PDF",
|
|
277
|
+
() => {
|
|
278
|
+
const { root, paper } = project("Authors omitted.");
|
|
279
|
+
const deny = denyList(join(root, "deny.txt"));
|
|
280
|
+
writePdf(
|
|
281
|
+
join(paper, "paper.pdf"),
|
|
282
|
+
"Anonymous submission. Tooling: Quillfeather-kit.",
|
|
283
|
+
);
|
|
284
|
+
const { status, stdout } = run([paper, "paper.pdf", deny]);
|
|
285
|
+
expect({
|
|
286
|
+
status,
|
|
287
|
+
leaks: stdout.split("\n").filter((l) => l.includes("LEAK")),
|
|
288
|
+
}).toEqual({
|
|
289
|
+
status: 1,
|
|
290
|
+
leaks: [
|
|
291
|
+
" LEAK PDF[paper.pdf]:1:Anonymous submission. Tooling: Quillfeather-kit.",
|
|
292
|
+
],
|
|
293
|
+
});
|
|
294
|
+
},
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
it.skipIf(!havePymupdf)("a PDF with no identifier in it passes", () => {
|
|
298
|
+
const { root, paper } = project("Authors omitted.");
|
|
299
|
+
const deny = denyList(join(root, "deny.txt"));
|
|
300
|
+
writePdf(
|
|
301
|
+
join(paper, "paper.pdf"),
|
|
302
|
+
"Anonymous submission. Tooling: REDACTED for review.",
|
|
303
|
+
);
|
|
304
|
+
expect(run([paper, "paper.pdf", deny]).status).toBe(0);
|
|
305
|
+
});
|
|
306
|
+
});
|