paperlint 20.0.1 → 20.1.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.
Files changed (59) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +5 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/domain/paper-folder.d.ts.map +1 -1
  6. package/dist/domain/paper-folder.js +4 -0
  7. package/dist/domain/paper-folder.js.map +1 -1
  8. package/dist/domain/paper-layout.d.ts +18 -6
  9. package/dist/domain/paper-layout.d.ts.map +1 -1
  10. package/dist/domain/paper-layout.js +44 -38
  11. package/dist/domain/paper-layout.js.map +1 -1
  12. package/dist/folder-layout-hook.js +1 -1
  13. package/dist/hook-counts.d.ts +30 -0
  14. package/dist/hook-counts.d.ts.map +1 -0
  15. package/dist/hook-counts.js +35 -0
  16. package/dist/hook-counts.js.map +1 -0
  17. package/dist/hooks-settings.d.ts +8 -10
  18. package/dist/hooks-settings.d.ts.map +1 -1
  19. package/dist/hooks-settings.js +31 -35
  20. package/dist/hooks-settings.js.map +1 -1
  21. package/dist/lint-edited-block.d.ts +8 -0
  22. package/dist/lint-edited-block.d.ts.map +1 -0
  23. package/dist/lint-edited-block.js +30 -0
  24. package/dist/lint-edited-block.js.map +1 -0
  25. package/dist/lint-edited-hook.d.ts +5 -6
  26. package/dist/lint-edited-hook.d.ts.map +1 -1
  27. package/dist/lint-edited-hook.js +47 -25
  28. package/dist/lint-edited-hook.js.map +1 -1
  29. package/dist/lint-edited-shell.d.ts +15 -0
  30. package/dist/lint-edited-shell.d.ts.map +1 -0
  31. package/dist/lint-edited-shell.js +49 -0
  32. package/dist/lint-edited-shell.js.map +1 -0
  33. package/docs/e2e.md +1 -1
  34. package/docs/install.md +11 -11
  35. package/docs/layout.md +19 -4
  36. package/docs/rules/paper/allowed-files-only.md +31 -28
  37. package/package.json +1 -1
  38. package/plugin/hooks/hooks.json +11 -0
  39. package/src/cli.harness.mjs +1 -1
  40. package/src/cli.test.ts +1 -1
  41. package/src/cli.ts +5 -1
  42. package/src/doctor.test.ts +23 -6
  43. package/src/domain/paper-folder.ts +3 -0
  44. package/src/domain/paper-layout.test.ts +89 -49
  45. package/src/domain/paper-layout.ts +61 -42
  46. package/src/folder-layout-hook.test.ts +1 -1
  47. package/src/folder-layout-hook.ts +1 -1
  48. package/src/folder-layout-rule.test.ts +1 -1
  49. package/src/hook-counts.test.ts +67 -0
  50. package/src/hook-counts.ts +64 -0
  51. package/src/hooks-settings.harness.ts +15 -18
  52. package/src/hooks-settings.ts +43 -49
  53. package/src/init-plugin.test.ts +8 -2
  54. package/src/layout-docs.test.ts +47 -0
  55. package/src/lint-edited-bash.test.ts +324 -0
  56. package/src/lint-edited-block.ts +44 -0
  57. package/src/lint-edited-hook.test.ts +10 -11
  58. package/src/lint-edited-hook.ts +72 -35
  59. package/src/lint-edited-shell.ts +72 -0
@@ -1 +1 @@
1
- {"version":3,"file":"lint-edited-hook.js","sourceRoot":"","sources":["../src/lint-edited-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,kDAAkD;AAClD,MAAM,CAAC,MAAM,aAAa,GAAG,GA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 /** One simple command as the shell reads it: what this module reads of vigiles' `NormalizedLeaf`. */
3
+ export interface ShellLeaf {
4
+ readonly args: readonly string[];
5
+ readonly redirects: readonly {
6
+ readonly target: string | null;
7
+ readonly writes: boolean;
8
+ }[];
9
+ }
10
+ /** The papers a Bash command wrote in, each with the existing `.tex` files it names there. */
11
+ export declare function shellPapers(payload: unknown, files: Files, leaves: (command: string) => readonly ShellLeaf[]): readonly {
12
+ readonly dir: string;
13
+ readonly files: readonly string[];
14
+ }[];
15
+ //# sourceMappingURL=lint-edited-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lint-edited-shell.d.ts","sourceRoot":"","sources":["../src/lint-edited-shell.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qGAAqG;AACrG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS;QAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;KAC1B,EAAE,CAAC;CACL;AA8BD,8FAA8F;AAC9F,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,SAAS,EAAE,GAChD,SAAS;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAAE,CAWxE"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Which paper files a Bash command wrote, as far as its words say: the half of the `lint-edited`
3
+ * hook (`src/lint-edited-hook.ts`) that reads a shell command instead of an Edit's `file_path`.
4
+ *
5
+ * The wiring starts the hook only for a command that names a `.tex` (`"if": "Bash(*.tex*)"` in
6
+ * `plugin/hooks/hooks.json`, written by hand until zernie/vigiles#496 lets a compiled hook declare
7
+ * it). The command is read by vigiles' shell parser, handed in as `leaves` (vigiles is a tool
8
+ * package: only `src/cli.ts` imports it), never by a pattern over its text: every `.tex` that is a word
9
+ * of a simple command, or the target of a redirection that writes, resolved against the payload's
10
+ * `cwd`. A file that does not exist, or is in no paper, is dropped. A command says no line it wrote.
11
+ */
12
+ import { isAbsolute, resolve } from "node:path";
13
+ import { groupBy, unique } from "remeda";
14
+ import { callerPath } from "./caller-path.js";
15
+ import { paperFolderOf } from "./domain/paper-folder.js";
16
+ import { fieldOf } from "./domain/record.js";
17
+ /** The extension of the files a command is read for; the wiring's `if` names the same. */
18
+ const TEX = ".tex";
19
+ /** Every word of `leaves` and every target they write by redirection. */
20
+ const wordsOf = (leaves) => leaves.flatMap((l) => [
21
+ ...l.args,
22
+ ...l.redirects.flatMap((r) => r.writes && r.target !== null ? [r.target] : []),
23
+ ]);
24
+ /** The `.tex` files the command in `payload` names, absolute; none without a command or an absolute cwd. */
25
+ function namedTex(payload, leaves) {
26
+ const command = fieldOf(fieldOf(payload, "tool_input"), "command");
27
+ const cwd = fieldOf(payload, "cwd");
28
+ if (typeof command !== "string" || typeof cwd !== "string")
29
+ return [];
30
+ if (!isAbsolute(cwd))
31
+ return [];
32
+ return unique(wordsOf(leaves(command))
33
+ .filter((w) => w.endsWith(TEX))
34
+ .map((w) => resolve(cwd, w)));
35
+ }
36
+ /** The papers a Bash command wrote in, each with the existing `.tex` files it names there. */
37
+ export function shellPapers(payload, files, leaves) {
38
+ const placed = namedTex(payload, leaves).flatMap((file) => {
39
+ const dir = files.isFile(callerPath(file))
40
+ ? paperFolderOf(file, files)
41
+ : null;
42
+ return dir === null ? [] : [{ dir, file }];
43
+ });
44
+ return Object.entries(groupBy(placed, (p) => p.dir)).map(([dir, ps]) => ({
45
+ dir,
46
+ files: ps.map((p) => p.file),
47
+ }));
48
+ }
49
+ //# sourceMappingURL=lint-edited-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AAM,CACX,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAC/B,CAAC;AACJ,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,KAAY,EACZ,MAAiD;IAEjD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACxD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACxC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC;YAC5B,CAAC,CAAC,IAAI,CAAC;QACT,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACvE,GAAG;QACH,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KAC7B,CAAC,CAAC,CAAC;AACN,CAAC"}
package/docs/e2e.md CHANGED
@@ -55,7 +55,7 @@ depend on each other — and drives the installed binary:
55
55
  - `paperlint init` takes the default papers directory and writes no `paperlint.json` for it
56
56
  - `paperlint init` finishes with zero — its doctor found no discrepancy
57
57
  - `paperlint init` wires the hooks into `.claude/settings.json` — the same commands `hooks.json`
58
- publishes, once each — and says they need `npm install` in a fresh clone; a second `init`
58
+ publishes, each as often as it publishes it — and says they need `npm install` in a fresh clone; a second `init`
59
59
  leaves that file byte-identical
60
60
  - `paperlint lint` passes the staged corpus
61
61
  - `paperlint new demo` scaffolds a paper from the templates that shipped in the tarball (and the
package/docs/install.md CHANGED
@@ -232,14 +232,14 @@ Neither `paperlint lint` nor any of the five hooks loads `@ast-grep` or `typescr
232
232
 
233
233
  ## Troubleshooting
234
234
 
235
- | symptom | cause and fix |
236
- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
237
- | `init`: skills "nothing linked", or hooks that fail to start | the package is not installed in this project (`npx` ran a temporary copy). Run `npm i -D paperlint`, then `npx paperlint init` again |
238
- | `paperlint lint`: `no papers in papers/` | there is no paper where `papersDir` points. Create one with `npx paperlint new <name>`, or set `"papersDir"` in `paperlint.json` |
239
- | hooks fail with `Cannot find module` in a fresh clone | the hook commands run files in `node_modules`: run `npm install` |
240
- | `paperlint: not built` | installed from git with `--ignore-scripts`, or a clone before building: run `npm run build` in the package |
241
- | a skill does not show up in Claude Code | its name was already taken in `.claude/skills/`. `init` names it and leaves it alone; rename or remove yours and run `npx paperlint init` again |
242
- | a Write of a new file is denied: "… is at the root of a paper folder" or "… is loose at the top of the paper's repro/ folder" | `paper-folder-layout` refuses to create an entry the paper layout does not allow; the reason says where it goes. Write it there. Existing files are never refused, and the hook does not see shell moves |
243
- | after an edit, Claude Code shows "paperlint lint-edited: the edit was kept; the errors above are the ones it introduced." | `lint-edited` linted the file the edit wrote and `paper.tex`, and found an error the edit introduced ([layout.md](layout.md#the-lint-edited-hook)). The edit stands; fix the error it names |
244
- | `paperlint: the lint-edited hook did not run: …` on stderr | the hook could not lint (the reason follows); the edit stands. `npx paperlint lint` on the paper shows the same failure |
245
- | anything else | `npx paperlint doctor` — it checks the setup and exits non-zero on anything miswired |
235
+ | symptom | cause and fix |
236
+ | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
237
+ | `init`: skills "nothing linked", or hooks that fail to start | the package is not installed in this project (`npx` ran a temporary copy). Run `npm i -D paperlint`, then `npx paperlint init` again |
238
+ | `paperlint lint`: `no papers in papers/` | there is no paper where `papersDir` points. Create one with `npx paperlint new <name>`, or set `"papersDir"` in `paperlint.json` |
239
+ | hooks fail with `Cannot find module` in a fresh clone | the hook commands run files in `node_modules`: run `npm install` |
240
+ | `paperlint: not built` | installed from git with `--ignore-scripts`, or a clone before building: run `npm run build` in the package |
241
+ | a skill does not show up in Claude Code | its name was already taken in `.claude/skills/`. `init` names it and leaves it alone; rename or remove yours and run `npx paperlint init` again |
242
+ | a Write of a new file is denied: "… does not belong at a paper folder's root" or "… is loose at the top of the paper's repro/ folder" | `paper-folder-layout` refuses to create an entry the paper layout does not allow; the reason says where it goes. Write it there. Existing files are never refused, and the hook does not see shell moves |
243
+ | after an edit, Claude Code shows "paperlint lint-edited: the edit was kept; the errors above are the ones it introduced." | `lint-edited` linted the file the edit wrote and `paper.tex`, and found an error the edit introduced ([layout.md](layout.md#the-lint-edited-hook)). The edit stands; fix the error it names |
244
+ | `paperlint: the lint-edited hook did not run: …` on stderr | the hook could not lint (the reason follows); the edit stands. `npx paperlint lint` on the paper shows the same failure |
245
+ | anything else | `npx paperlint doctor` — it checks the setup and exits non-zero on anything miswired |
package/docs/layout.md CHANGED
@@ -145,7 +145,7 @@ A check runs at one of five moments:
145
145
  | what | kind | when it runs | what it stops |
146
146
  | ------------------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
147
147
  | `paper-folder-layout` | hook | before an agent creates a file (Edit, Write) | a new entry the layout does not allow, at a paper's root or the top of its `repro/`; never an existing file |
148
- | `lint-edited` | hook | after an agent edits a file of a paper (Edit, Write) | nothing is undone: an error the edit introduced is put next to the edit's result, so the agent fixes it in the same turn |
148
+ | `lint-edited` | hook | after an Edit or Write in a paper, or Bash on a `.tex` | nothing is undone: an error the edit introduced is put next to the edit's result, so the agent fixes it in the same turn |
149
149
  | `submission-confirm` | hook | before an agent's shell command | a submission send (`--save`, `--submit`), or a command naming a portal's host, that the person has not said yes to in a question naming its PDF's sha256 (or the host and the command) |
150
150
  | [`paper/allowed-files-only`](rules/paper/allowed-files-only.md) | rule | every `paperlint lint`, and CI | a stray file or folder at a paper's root (error) |
151
151
  | [`repro/allowed-files-only`](rules/repro/allowed-files-only.md) | rule | every `paperlint lint`, and CI | a loose entry at the top of `repro/`, a folder that is not a study's, a study folder without `README.md` (error) |
@@ -175,6 +175,14 @@ so a file the lint skips (`research/notes.txt`) gets nothing. An edit of any oth
175
175
  before the CLI loads: 36–39 ms per edit against 28 ms for `node -e 0` (medians of 15, measured
176
176
  2026-11-09), where it was 662 ms while the CLI loaded on every edit.
177
177
 
178
+ **After a shell command, too.** The same hook hangs off Bash with `"if": "Bash(*.tex*)"` in its
179
+ wiring, so Claude Code does not even start it for a command that names no `.tex` (measured on Claude
180
+ Code 2.1.330: `ls` and `cat Makefile` started nothing; `sed -i … paper.tex`, `/usr/bin/sed -i …` and
181
+ `python3 -c "…paper.tex…"` started it). Started, it reads the command with vigiles' shell parser and
182
+ lints every `.tex` the command names that is a file in a paper, as a word or as the target of a
183
+ redirection that writes, resolved against the session's working directory; papers are linted one by
184
+ one, each against its own snapshot.
185
+
178
186
  **What it lints.** The edited file and the paper's `paper.tex`, with the same ESLint, config and
179
187
  rules as `paperlint lint` on that paper: one setup serves both. Inside a paper it takes about as long
180
188
  as `paperlint lint` on that paper: 701 ms for an edit of a one-page paper, against 781 ms for
@@ -199,12 +207,19 @@ Each error is keyed by its file, rule, message and the trimmed text of the line
199
207
  the line number, so a line inserted above an old error does not make it new. The next edit reports
200
208
  an error only when its key occurs more often than in the snapshot. A file the snapshot has not seen
201
209
  yet (the first edit in a paper) has no "before": only the errors on the lines that edit wrote are
202
- reported — an Edit's new text, each MultiEdit's, every line of a Write. Delete the file to start over.
210
+ reported — an Edit's new text, each MultiEdit's, every line of a Write. A shell command has no such
211
+ lines, so in a file the snapshot has not seen it reports nothing and only records the snapshot; the
212
+ next change is judged against it. Delete the file to start over.
203
213
 
204
214
  **What it cannot see.**
205
215
 
206
- - A file written by a shell command (`sed -i`, a script, `mv`, `cp`): no Edit, no Write, no hook.
207
- `paperlint lint` and CI still see it.
216
+ - A shell command whose `.tex` is not one of its words: a path inside an interpreter's code
217
+ (`python3 -c "open('paper.tex')…"` starts the hook but names no `.tex` word), a relative path after
218
+ a `cd` in the same command, a name built at run time, a `mv` or `cp` of a file. And a write by
219
+ redirection alone (`cat > paper.tex <<EOF`): Claude Code leaves a redirection's target out of the
220
+ text the `if` matches, so the hook never starts (measured on 2.1.330,
221
+ [zernie/vigiles#214](https://github.com/zernie/vigiles/issues/214)). `paperlint lint` and CI still
222
+ see all of these.
208
223
  - The body files of a paper whose build record is stale. `_build/sources.json` hashes every file TeX
209
224
  read, so the first edit to any of them makes the record stale, and until the next
210
225
  `paperlint build` the paper is `paper.tex` alone — to this hook exactly as to `paperlint lint`
@@ -91,38 +91,41 @@ itself.
91
91
 
92
92
  ## Examples
93
93
 
94
- Failing: a plan beside the paper.
94
+ Failing: a results table beside the paper.
95
95
 
96
96
  ```text
97
97
  papers/agent-rule-drift/PIPELINE-STATUS.md
98
- 1:1 error `PLAN.md` is at the root of a paper folder (the folder holding PIPELINE-STATUS.md),
99
- and that root holds only paperlint's layout. Where it goes: a section of
100
- PIPELINE-STATUS.md — the paper's one live-state file holds its stages, its plan
101
- ("Plan / now") and its scorecard; move what is still live there and delete the file.
102
- The layout (extra/ takes anything and is never judged; the build's paper.* byproducts are never reported):
103
- <paper>/
104
- ├── PIPELINE-STATUS.md ← the paper's one live-state file: stages, plan, scorecard
105
- …
106
- └── extra/ ← anything; never judged
107
- Rule paper/allowed-files-only: https://github.com/zernie/paperlint/blob/main/docs/rules/paper/allowed-files-only.md paper/allowed-files-only
98
+ 1:1 error `results-final-v2.csv` does not belong at a paper folder's root: move it to repro/data/, or extra/. paper/allowed-files-only
108
99
  ```
109
100
 
110
- Each message names the entry and where it goes, and draws the whole layout above, so it reads on its own. A
111
- name met in real paper folders has one destination:
112
-
113
- | entry | where it goes |
114
- | -------------------------- | ---------------------------------------------------------------------------------------------------------- |
115
- | `PLAN.md`, `plans/` | a section of `PIPELINE-STATUS.md` ("Plan / now") |
116
- | `DECISION-LOG.md` | `research/` |
117
- | `EMAILS.md` | `submission/` |
118
- | `data/` | `repro/data/` |
119
- | `artifact/` | `repro/` (scripts in `repro/tools/`, data in `repro/data/`); the anonymized upload copy in `submission/` |
120
- | `archive/` | `versions/` for frozen PDFs, `submission/` for an earlier attempt's forms and mails, `extra/` for the rest |
121
- | `venue-corpus/`, `venues/` | `<papers-root>/venues/<venue>/`, outside the paper folder |
122
-
123
- Any other name gets the choice by what it is: a record or research → `research/`; about submitting
124
- → `submission/`; the paper's live state → a section of `PIPELINE-STATUS.md`; reproduction → `repro/`;
125
- a frozen PDF of a stage → `versions/`; unclear → `extra/`.
101
+ Each finding is one line naming one destination. A name met in real paper folders has its own:
102
+
103
+ | entry | where it goes |
104
+ | -------------------------- | ------------------------------- |
105
+ | `PLAN.md`, `plans/` | a section of PIPELINE-STATUS.md |
106
+ | `DECISION-LOG.md` | `research/` |
107
+ | `EMAILS.md` | `submission/` |
108
+ | `data/` | `repro/data/` |
109
+ | `artifact/` | `repro/` |
110
+ | `archive/` | `extra/` |
111
+ | `venue-corpus/`, `venues/` | `<papers-root>/venues/<venue>/` |
112
+
113
+ Any other file goes where its kind says, by its name or its extension (matched ignoring case):
114
+
115
+ | extension | where it goes |
116
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
117
+ | data: `.tsv` `.csv` `.json` `.jsonl` `.ndjson` `.yaml` `.yml` `.xml` `.txt` `.log` `.parquet` `.sqlite` `.db` `.xlsx` `.npy` `.npz` `.pkl` `.gz` `.zip` `.tar` | `repro/data/` |
118
+ | scripts and the files that run them: `Makefile` `Dockerfile` `requirements.txt` `pyproject.toml` `uv.lock` `package.json` `package-lock.json` `.py` `.ipynb` `.sh` `.bash` `.zsh` `.js` `.mjs` `.cjs` `.ts` `.mts` `.cts` `.r` `.jl` `.rb` `.pl` `.awk` `.sql` | `repro/tools/` |
119
+ | images: `.png` `.jpg` `.jpeg` `.gif` `.svg` `.eps` | `figures/` |
120
+ | notes: `.md` `.markdown` | `research/` |
121
+
122
+ Anything else, and any folder not listed, goes to `extra/`; so does a PDF, which may be a figure (`figures/`), a draft or a review. The finding names one folder; pick
123
+ another when you know better: a record or research → `research/`; about submitting (forms, mails,
124
+ checklists, portal records) → `submission/`; the paper's live state → a section of
125
+ `PIPELINE-STATUS.md`; reproduction → `repro/`; a frozen PDF of a stage → `versions/`; unclear →
126
+ `extra/`. An `archive/` usually splits: its frozen PDFs into `versions/`, an earlier attempt's forms
127
+ and mails into `submission/`, the rest into `extra/`. The anonymized copy of an `artifact/` uploaded
128
+ for review goes in `submission/`.
126
129
 
127
130
  Passing: the folder `paperlint new` writes (`PIPELINE-STATUS.md`, `paper.tex`, `paperlint.json`),
128
131
  and any folder holding only the entries above.
@@ -145,7 +148,7 @@ No rule options. The paper's `pdf`, `talk.dir` and own preset files add what the
145
148
  `plugin/hooks/hooks.json`). When an agent is about to create a file that would add an entry the
146
149
  layout does not allow — at a paper folder's root, or at the top of its `repro/`
147
150
  ([`repro/allowed-files-only`](../repro/allowed-files-only.md)) — the hook denies the call, and the reason it gives is the
148
- rule's own message: where the entry goes, and the layout drawn. The agent writes the file where it
151
+ rule's own message: where the entry goes. The agent writes the file where it
149
152
  belongs instead, in the same turn. The text comes from the functions the rules report with
150
153
  (`strayTexts`, `reproTexts`); there is no second list.
151
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperlint",
3
- "version": "20.0.1",
3
+ "version": "20.1.1",
4
4
  "description": "A linter for scientific papers written in LaTeX: catches mistakes before you submit to a conference or journal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,6 +30,17 @@
30
30
  "timeout": 20
31
31
  }
32
32
  ]
33
+ },
34
+ {
35
+ "matcher": "Bash",
36
+ "hooks": [
37
+ {
38
+ "type": "command",
39
+ "if": "Bash(*.tex*)",
40
+ "command": "node \"${CLAUDE_PROJECT_DIR}/node_modules/paperlint/bin/paperlint.mjs\" hook lint-edited",
41
+ "timeout": 20
42
+ }
43
+ ]
33
44
  }
34
45
  ]
35
46
  }
@@ -1239,7 +1239,7 @@ check(
1239
1239
  check(
1240
1240
  "the layout hook refuses a new stray PLAN.md on stdout as a PreToolUse deny, exit 0",
1241
1241
  stray.status === 0 &&
1242
- /^\{"hookSpecificOutput":\{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"`PLAN\.md` is at the root/.test(
1242
+ /^\{"hookSpecificOutput":\{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"`PLAN\.md` does not belong at a paper folder's root/.test(
1243
1243
  stray.stdout,
1244
1244
  ),
1245
1245
  );
package/src/cli.test.ts CHANGED
@@ -234,7 +234,7 @@ test("runHook paper-folder-layout: in-process, on the real disk — a refusal on
234
234
  assert.equal(stray.code, 0);
235
235
  assert.match(
236
236
  stray.out.join(""),
237
- /^\{"hookSpecificOutput":\{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"`PLAN\.md` is at the root of a paper folder/,
237
+ /^\{"hookSpecificOutput":\{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"`PLAN\.md` does not belong at a paper folder's root/,
238
238
  );
239
239
  assert.deepEqual(hook(write("papers/p/NOTES.md")), {
240
240
  code: 0,
package/src/cli.ts CHANGED
@@ -1473,7 +1473,11 @@ const IN_PROCESS_HOOKS: Readonly<
1473
1473
  "lint-edited": ({ err, stdin, out }) =>
1474
1474
  lintEditedHook(
1475
1475
  stdin,
1476
- { files: nodeFiles, linter: editLinter(loadLatexLanguage) },
1476
+ {
1477
+ files: nodeFiles,
1478
+ linter: editLinter(loadLatexLanguage),
1479
+ shellLeaves: leafCommandsNormalized,
1480
+ },
1477
1481
  { out, err },
1478
1482
  ),
1479
1483
  "paper-folder-layout": ({ err, stdin, out }) => {
@@ -64,13 +64,20 @@ test("doctor: a settings file silent on papersDir, an occupied entry, an unreada
64
64
  assert.equal(typeof code, "number");
65
65
  });
66
66
 
67
- /** Doctor's exit code for a project whose `.claude/settings.json` carries the given commands. */
68
- const exitWithHooks = (commands: readonly string[]): number => {
67
+ /**
68
+ * Doctor's exit code for a project whose `.claude/settings.json` carries the given commands, each
69
+ * under the matcher `matcherOf` gives it (by default a matcher of its own).
70
+ */
71
+ const exitWithHooks = (
72
+ commands: readonly string[],
73
+ matcherOf: (command: string, i: number) => string = (_, i) =>
74
+ `Tool${String(i)}`,
75
+ ): number => {
69
76
  const root = project();
70
77
  writeFileSync(join(root, "paperlint.json"), "{}\n");
71
78
  mkdirSync(join(root, ".claude"), { recursive: true });
72
- const entries = commands.map((command) => ({
73
- matcher: "Bash",
79
+ const entries = commands.map((command, i) => ({
80
+ matcher: matcherOf(command, i),
74
81
  hooks: [{ type: "command", command }],
75
82
  }));
76
83
  writeFileSync(
@@ -92,9 +99,13 @@ const exitWithHooks = (commands: readonly string[]): number => {
92
99
  };
93
100
 
94
101
  const hookCommand = (name: string): string => `npx paperlint hook ${name}`;
95
- const allHooks = shippedWiring().names;
102
+ const shipped = shippedWiring();
103
+ /** Each shipped hook as many times as the wiring runs it: `lint-edited` after an Edit and a Bash. */
104
+ const allHooks = shipped.names.flatMap((n) =>
105
+ Array.from({ length: shipped.times[n] ?? 1 }, () => n),
106
+ );
96
107
 
97
- test("doctor exits 0 when every hook is wired once, or none is (--no-hooks is a choice)", () => {
108
+ test("doctor exits 0 when every hook is wired as shipped, or none is (--no-hooks is a choice)", () => {
98
109
  assert.equal(exitWithHooks(allHooks.map(hookCommand)), 0);
99
110
  assert.equal(exitWithHooks([]), 0);
100
111
  });
@@ -102,6 +113,12 @@ test("doctor exits 0 when every hook is wired once, or none is (--no-hooks is a
102
113
  test("doctor exits non-zero when the hooks are only partly wired", () => {
103
114
  assert.equal(exitWithHooks(allHooks.slice(1).map(hookCommand)), 2);
104
115
  assert.equal(exitWithHooks([hookCommand("submission-confirm")]), 2);
116
+ // Wired by an older init: every hook once, so lint-edited has one of its two commands.
117
+ assert.equal(exitWithHooks(shipped.names.map(hookCommand)), 2);
118
+ // lint-edited twice after an Edit and never after a Bash: two commands in one place are not two places.
119
+ const editOnly = (c: string, i: number) =>
120
+ c.endsWith("lint-edited") ? "Edit" : `Tool${String(i)}`;
121
+ assert.equal(exitWithHooks(allHooks.map(hookCommand), editOnly), 2);
105
122
  });
106
123
 
107
124
  /** Doctor's output for a project with one of init's hook commands and one present skill link. */
@@ -105,6 +105,9 @@ const concernsAPaper = (stdin: () => string, files: IsFile): boolean => {
105
105
  try {
106
106
  const payload = parsed(stdin());
107
107
  if (payload === undefined) return true;
108
+ // A Bash payload names no file the gate could look up without a shell parser; the wiring's
109
+ // `"if": "Bash(*.tex*)"` already kept every command that names no `.tex` from starting the hook.
110
+ if (fieldOf(payload, "tool_name") === "Bash") return true;
108
111
  const file = writtenPath(payload);
109
112
  return file !== null && paperFolderOf(file, files) !== null;
110
113
  } catch {
@@ -5,7 +5,8 @@
5
5
  */
6
6
  import { describe, expect, it } from "vitest";
7
7
  import {
8
- CURE_BY_KIND,
8
+ CURE_BY_DEFAULT,
9
+ CURE_BY_FILE,
9
10
  KNOWN_CURES,
10
11
  NOTHING_DECLARED,
11
12
  PAPER_LAYOUT_TREE,
@@ -86,50 +87,61 @@ describe("judgeLayout — silent on the whole allowed set", () => {
86
87
  });
87
88
 
88
89
  describe("judgeLayout — reports", () => {
89
- it("a known name with its one destination: the plan is a section of the status file", () => {
90
- const [plan] = judgeLayout(
91
- [file("paper.tex"), file("PLAN.md")],
92
- NOTHING_DECLARED,
93
- );
94
- expect(plan?.name).toBe("PLAN.md");
95
- expect(plan?.cure).toMatch(
96
- /^a section of PIPELINE-STATUS\.md .*"Plan \/ now"/,
97
- );
98
- });
90
+ it.each([
91
+ ["PLAN.md", "file", "a section of PIPELINE-STATUS.md"],
92
+ ["Plan.md", "file", "a section of PIPELINE-STATUS.md"],
93
+ ["plans", "dir", "a section of PIPELINE-STATUS.md"],
94
+ ["DECISION-LOG.md", "file", "research/"],
95
+ ["EMAILS.md", "file", "submission/"],
96
+ ["data", "dir", "repro/data/"],
97
+ ["artifact", "dir", "repro/"],
98
+ ["archive", "dir", "extra/"],
99
+ ["venue-corpus", "dir", "<papers-root>/venues/<venue>/"],
100
+ ] as const)(
101
+ "a known name, %s (%s), goes to its one destination",
102
+ (name, kind, cure) => {
103
+ expect(judgeLayout([{ name, kind }], NOTHING_DECLARED)[0]?.cure).toBe(
104
+ cure,
105
+ );
106
+ },
107
+ );
99
108
 
100
109
  it.each([
101
- ["DECISION-LOG.md", "file", /^research\//],
102
- ["EMAILS.md", "file", /^submission\//],
103
- ["data", "dir", /^repro\//],
104
- ["artifact", "dir", /^repro\//],
105
- [
106
- "archive",
107
- "dir",
108
- /^versions\/ for frozen PDFs, submission\/ .*, extra\/ for the rest$/,
109
- ],
110
- [
111
- "venue-corpus",
112
- "dir",
113
- /^<papers-root>\/venues\/<venue>\/, outside the paper folder/,
114
- ],
115
- ["plans", "dir", /^a section of PIPELINE-STATUS\.md/],
116
- ["Plan.md", "file", /^a section of PIPELINE-STATUS\.md/],
117
- ] as const)("%s (%s) goes to its destination", (name, kind, cure) => {
118
- expect(judgeLayout([{ name, kind }], NOTHING_DECLARED)[0]?.cure).toMatch(
119
- cure,
120
- );
121
- });
110
+ ["results-final-v2.csv", "repro/data/"],
111
+ ["plot.py", "repro/tools/"],
112
+ ["fig1.PNG", "figures/"],
113
+ ["requirements.txt", "repro/tools/"],
114
+ ["Makefile", "repro/tools/"],
115
+ ["notes.md", "research/"],
116
+ ])(
117
+ "an unlisted file, %s, goes to the folder its kind names",
118
+ (name, cure) => {
119
+ expect(judgeLayout([file(name)], NOTHING_DECLARED)[0]?.cure).toBe(cure);
120
+ },
121
+ );
122
122
 
123
- it("an unknown name gets the choice by what it is", () => {
124
- expect(judgeLayout([dir("corpus")], NOTHING_DECLARED)).toEqual([
125
- { name: "corpus/", kind: "dir", cure: CURE_BY_KIND },
123
+ it("anything else goes to extra/: an unlisted folder, a file without a known extension", () => {
124
+ expect(
125
+ judgeLayout(
126
+ [dir("corpus"), file("LICENSE"), file("fig1.pdf")],
127
+ NOTHING_DECLARED,
128
+ ),
129
+ ).toEqual([
130
+ { name: "corpus/", kind: "dir", cure: CURE_BY_DEFAULT },
131
+ { name: "LICENSE", kind: "file", cure: CURE_BY_DEFAULT },
132
+ // A root PDF may be a figure, a draft or a review: no one folder is right, and versions/ holds
133
+ // only cycle folders and lock.json (versions/layout).
134
+ { name: "fig1.pdf", kind: "file", cure: CURE_BY_DEFAULT },
126
135
  ]);
136
+ expect(CURE_BY_DEFAULT).toBe("extra/");
127
137
  });
128
138
 
129
- it("a known file name used by a folder is not that file: the choice by kind", () => {
130
- expect(judgeLayout([dir("PLAN.md")], NOTHING_DECLARED)[0]?.cure).toBe(
131
- CURE_BY_KIND,
132
- );
139
+ it("a known file name, or a file extension, used by a folder is neither: extra/", () => {
140
+ expect(
141
+ judgeLayout([dir("PLAN.md"), dir("runs.csv")], NOTHING_DECLARED).map(
142
+ (s) => s.cure,
143
+ ),
144
+ ).toEqual([CURE_BY_DEFAULT, CURE_BY_DEFAULT]);
133
145
  });
134
146
  });
135
147
 
@@ -227,19 +239,47 @@ describe("judgeLayout — reports by name, exactly", () => {
227
239
  });
228
240
  });
229
241
 
230
- describe("strayMessage — stands alone for a reader with no context", () => {
231
- const [plan] = judgeLayout([file("PLAN.md")], NOTHING_DECLARED);
232
- const text = plan === undefined ? "" : strayMessage(plan);
242
+ describe("strayMessage — one short line naming one destination", () => {
243
+ const CURES = [
244
+ ...new Set([
245
+ ...KNOWN_CURES.map((c) => c.cure),
246
+ ...CURE_BY_FILE.map((c) => c.cure),
247
+ CURE_BY_DEFAULT,
248
+ ]),
249
+ ];
233
250
 
234
- it("names the entry, where it goes, draws the whole layout, and links the rule's page", () => {
235
- expect(text.split("\n")).toEqual([
236
- `\`PLAN.md\` is at the root of a paper folder (the folder holding PIPELINE-STATUS.md), and that root holds only paperlint's layout. Where it goes: ${KNOWN_CURES[0]?.cure ?? ""}.`,
237
- "The layout (extra/ takes anything and is never judged; the build's paper.* byproducts are never reported):",
238
- ...PAPER_LAYOUT_TREE.split("\n"),
239
- "Rule paper/allowed-files-only: https://github.com/zernie/paperlint/blob/main/docs/rules/paper/allowed-files-only.md",
240
- ]);
251
+ it.each(CURES)(
252
+ "for the destination %s: one line, the entry, the destination, extra/ as the fallback, no tree",
253
+ (cure) => {
254
+ const text = strayMessage({
255
+ name: "results-final-v2.csv",
256
+ kind: "file",
257
+ cure,
258
+ });
259
+ expect(text).not.toContain("\n");
260
+ expect(text.length).toBeLessThanOrEqual(120);
261
+ expect(text.startsWith("`results-final-v2.csv` ")).toBe(true);
262
+ expect(text).toContain(cure);
263
+ expect(text).toContain("extra/");
264
+ expect(text).not.toContain("<paper>/");
265
+ },
266
+ );
267
+
268
+ it("names no destination but its own: no other folder of the layout", () => {
269
+ const text = strayMessage({
270
+ name: "x.csv",
271
+ kind: "file",
272
+ cure: "repro/data/",
273
+ });
274
+ expect(
275
+ CURES.filter(
276
+ (c) => c !== "repro/data/" && c !== "extra/" && c !== "repro/",
277
+ ).filter((c) => text.includes(c)),
278
+ ).toEqual([]);
241
279
  });
280
+ });
242
281
 
282
+ describe("PAPER_LAYOUT_TREE — the drawing the rule's page embeds", () => {
243
283
  it("the layout it draws holds every allowed root entry, repro/'s own layout inside", () => {
244
284
  const lines = PAPER_LAYOUT_TREE.split("\n");
245
285
  expect(lines[0]).toBe("<paper>/");