paperlint 20.1.1 → 20.2.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 (126) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.github/workflows/ci.yml +7 -0
  3. package/CLAUDE.md +6 -2
  4. package/CONTRIBUTING.md +2 -2
  5. package/{action.harness.mjs → action.test.mjs} +147 -138
  6. package/dist/adapters/venue-corpus/index.d.ts +345 -0
  7. package/dist/adapters/venue-corpus/index.d.ts.map +1 -0
  8. package/dist/adapters/venue-corpus/index.js +205 -0
  9. package/dist/adapters/venue-corpus/index.js.map +1 -0
  10. package/dist/domain/licence.d.ts +51 -0
  11. package/dist/domain/licence.d.ts.map +1 -0
  12. package/dist/domain/licence.js +61 -0
  13. package/dist/domain/licence.js.map +1 -0
  14. package/dist/domain/venue-corpus.d.ts +120 -0
  15. package/dist/domain/venue-corpus.d.ts.map +1 -0
  16. package/dist/domain/venue-corpus.js +13 -0
  17. package/dist/domain/venue-corpus.js.map +1 -0
  18. package/dist/eslint-rules/CLAUDE.md.spec.d.ts.map +1 -1
  19. package/dist/eslint-rules/CLAUDE.md.spec.js +1 -0
  20. package/dist/eslint-rules/CLAUDE.md.spec.js.map +1 -1
  21. package/dist/eslint-rules/papers.js +1 -1
  22. package/dist/latex-log.d.ts +1 -1
  23. package/dist/latex-log.js +1 -1
  24. package/dist/latex-loop.d.ts +1 -1
  25. package/dist/latex-loop.js +1 -1
  26. package/dist/lib/paper-config.d.ts +3 -3
  27. package/dist/lib/paper-config.js +3 -3
  28. package/dist/ports/venue-corpus-codec.d.ts +11 -0
  29. package/dist/ports/venue-corpus-codec.d.ts.map +1 -0
  30. package/dist/ports/venue-corpus-codec.js +2 -0
  31. package/dist/ports/venue-corpus-codec.js.map +1 -0
  32. package/dist/skill-chunks/chunk-5KCU4WTN.js +108 -0
  33. package/dist/skill-chunks/{chunk-X4VKG4KT.js → chunk-6YEM4VDI.js} +11 -9
  34. package/dist/skill-chunks/{chunk-L3NJUJUP.js → chunk-CXAGKT44.js} +5 -3
  35. package/dist/skill-chunks/{chunk-6NU6CXUS.js → chunk-J5XYPERO.js} +12 -72
  36. package/dist/skill-chunks/{chunk-IREAROCV.js → chunk-Z5YMDZYW.js} +4 -0
  37. package/dist/skills/study-accepted-papers/scripts/corpus-licences-core.d.ts +54 -0
  38. package/dist/skills/study-accepted-papers/scripts/corpus-licences.d.ts +2 -0
  39. package/docs/design/venue-corpus.md +250 -0
  40. package/docs/e2e.md +9 -9
  41. package/docs/testing.md +3 -4
  42. package/docs/venues.md +144 -21
  43. package/eslint-rules/CLAUDE.md +5 -1
  44. package/eslint-rules/CLAUDE.md.spec.ts +3 -0
  45. package/eslint-rules/{install-path-literals.harness.mjs → install-path-literals.test.mjs} +14 -13
  46. package/eslint-rules/{latex-language.harness.mjs → latex-language-rules.test.mjs} +61 -51
  47. package/eslint-rules/{paper-stages.harness.mjs → paper-stages-rule.test.mjs} +66 -69
  48. package/eslint-rules/{papers.harness.mjs → papers.test.mjs} +41 -30
  49. package/eslint-rules/papers.ts +1 -1
  50. package/eslint-rules/{pdf-last-page-balance.harness.mjs → pdf-last-page-balance.test.mjs} +27 -15
  51. package/eslint-rules/{temp-root-realpath.harness.mjs → temp-root-realpath.test.mjs} +24 -24
  52. package/eslint-rules/{tex-build.harness.mjs → tex-build.test.mjs} +292 -271
  53. package/eslint.config.mjs +15 -2
  54. package/fixtures/pdf-facts/README.md +1 -1
  55. package/fixtures/render-paper/build-clean.sh +1 -1
  56. package/fixtures/toolchain-mirror/install-tl +1 -1
  57. package/lib/{agent-cli-version.harness.mjs → agent-cli-version.test.mjs} +17 -18
  58. package/lib/{paper-config.harness.mjs → paper-config.test.mjs} +21 -20
  59. package/lib/paper-config.ts +3 -3
  60. package/lib/{skill-trigger-cases.harness.mjs → skill-trigger-cases-carrier.test.mjs} +78 -115
  61. package/package.json +4 -3
  62. package/presets/acm-acmsmall.jsonc +1 -1
  63. package/scripts/bundle-skills.ts +1 -0
  64. package/scripts/check-workflow.test.ts +368 -0
  65. package/scripts/check.ts +2 -2
  66. package/scripts/eslint-file-length.mjs +9 -9
  67. package/scripts/eslint-report-guard.mjs +1 -1
  68. package/scripts/eslint-report-guard.test.mjs +1 -1
  69. package/scripts/harness-api.test.ts +7 -46
  70. package/scripts/{rules-see-files.harness.mjs → rules-see-files-rule.test.mjs} +10 -6
  71. package/scripts/rules-see-files.mjs +1 -1
  72. package/scripts/venue-corpus-schema.test.ts +39 -0
  73. package/scripts/venue-corpus-schema.ts +17 -0
  74. package/skills/argument-arc/scripts/headings.js +6 -4
  75. package/skills/cold-read-diff/scripts/cold-read.js +6 -4
  76. package/skills/paper-pipeline/{paper-pipeline.harness.mjs → paper-pipeline.test.mjs} +45 -46
  77. package/skills/paper-pipeline/scripts/{consumer.harness.mjs → consumer-paths.test.mjs} +66 -59
  78. package/skills/paper-pipeline/scripts/consumer.mjs +3 -3
  79. package/skills/paper-pipeline/scripts/{extract-ref-facts.harness.mjs → extract-ref-facts-cli.test.mjs} +29 -31
  80. package/skills/paper-pipeline/scripts/extract-ref-facts.js +6 -5
  81. package/skills/paper-pipeline/scripts/fixtures/real-bib/refs.bib +1 -1
  82. package/skills/paper-pipeline/scripts/{generated-code.harness.mjs → generated-code-fixtures.test.mjs} +39 -46
  83. package/skills/pc-panel-review/scripts/prior-reviews.js +7 -5
  84. package/skills/render-paper/{extract-pdf-facts.harness.ts → extract-pdf-facts.test.ts} +20 -13
  85. package/skills/render-paper/{render-paper.harness.mjs → render-paper.test.mjs} +41 -40
  86. package/skills/study-accepted-papers/SKILL.md +28 -2
  87. package/skills/study-accepted-papers/SKILL.md.spec.ts +27 -1
  88. package/skills/study-accepted-papers/papers.schema.json +427 -0
  89. package/skills/study-accepted-papers/scripts/corpus-licences-core.js +180 -0
  90. package/skills/study-accepted-papers/scripts/corpus-licences-core.ts +302 -0
  91. package/skills/study-accepted-papers/scripts/corpus-licences.js +383 -0
  92. package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +485 -0
  93. package/skills/study-accepted-papers/scripts/corpus-licences.ts +27 -0
  94. package/skills/verify-citations/scripts/bib-authors.js +6 -5
  95. package/skills/verify-citations/scripts/verify-cites.js +6 -5
  96. package/src/adapters/pdfjs/fill.test.ts +1 -1
  97. package/src/adapters/venue-corpus/index.test.ts +279 -0
  98. package/src/adapters/venue-corpus/index.ts +286 -0
  99. package/src/{build-engine.harness.mjs → build-engine-prepare.test.mjs} +98 -81
  100. package/src/{build.harness.mjs → build-fake-tex.test.mjs} +61 -28
  101. package/src/{cli.harness.mjs → cli-e2e.test.mjs} +108 -102
  102. package/src/cli.test.ts +1 -1
  103. package/src/{doctor.harness.mjs → doctor-install.test.mjs} +28 -29
  104. package/src/domain/licence.test.ts +122 -0
  105. package/src/domain/licence.ts +95 -0
  106. package/src/domain/venue-corpus.ts +130 -0
  107. package/src/{engine.harness.mjs → engine.test.mjs} +120 -106
  108. package/src/facts-file.test.ts +1 -1
  109. package/src/{hooks-settings.harness.ts → hooks-settings.test.ts} +161 -146
  110. package/src/latex-log.test.ts +395 -0
  111. package/src/latex-log.ts +1 -1
  112. package/src/latex-loop.test.ts +553 -0
  113. package/src/latex-loop.ts +1 -1
  114. package/src/{link-skills.harness.ts → link-skills-fs.test.ts} +26 -26
  115. package/src/{new-paper.harness.mjs → new-paper-scaffold.test.mjs} +31 -19
  116. package/src/{pdf-facts.harness.ts → pdf-facts-tables.test.ts} +28 -22
  117. package/src/{pdf-geometry.harness.ts → pdf-geometry.test.ts} +93 -75
  118. package/src/ports/venue-corpus-codec.ts +11 -0
  119. package/src/{rules-config.harness.ts → rules-config.test.ts} +41 -31
  120. package/src/{structure.harness.ts → structure.test.ts} +12 -10
  121. package/src/{tex-requirements.harness.ts → tex-requirements-tables.test.ts} +106 -85
  122. package/src/{toolchain.harness.mjs → toolchain-mirror.test.mjs} +204 -186
  123. package/scripts/check.harness.ts +0 -343
  124. package/scripts/harness-api.frozen.json +0 -41
  125. package/src/latex-log.harness.ts +0 -382
  126. package/src/latex-loop.harness.ts +0 -515
package/docs/venues.md CHANGED
@@ -137,7 +137,8 @@ merged 2026-10-27 09:35 UTC, the wait for review included), AIDC with the IEEE f
137
137
 
138
138
  `<papers-root>` is the papers directory: `papersDir` in the project's `paperlint.json`, default
139
139
  `papers/`. The corpus lives there, beside the paper folders and not inside any of them, because it
140
- belongs to the venue: every paper aimed at that venue reads the same one.
140
+ belongs to the venue: every paper aimed at that venue reads the same one. The corpus folder is named
141
+ after the venue preset's series, the preset id without its year: `agent` for `paperlint:agent-2027`.
141
142
 
142
143
  ```text
143
144
  <papers-root>/
@@ -151,12 +152,12 @@ belongs to the venue: every paper aimed at that venue reads the same one.
151
152
  The skill `study-accepted-papers` makes it, the first time it runs for that venue. It always asks
152
153
  which mode to run, and suggests one from what exists:
153
154
 
154
- | mode | when | stage | what it adds to the corpus |
155
- | -------- | ---------------------------------------------- | -------- | ----------------------------------------------------------- |
156
- | A idea | a target venue and an idea; no `paper.tex` yet | 2 venue | the winner and ordinary lists, their measurements (L0, L1) |
157
- | B design | a planned claim and measurements; no text yet | 2 venue | the same, if not there yet |
158
- | C draft | the paper's text exists | 5 review | the deep reads (L2), one file per paper |
159
- | D final | near-final text, the deadline close | 5 review | nothing new; it compares wording against the closest papers |
155
+ | mode | when | stage | what it adds to the corpus |
156
+ | -------- | ---------------------------------------------- | -------- | --------------------------------------------------------------------------- |
157
+ | A idea | a target venue and an idea; no `paper.tex` yet | 2 venue | the rows of the award winners and the ordinary papers, their codes (L0, L1) |
158
+ | B design | a planned claim and measurements; no text yet | 2 venue | the same, if not there yet |
159
+ | C draft | the paper's text exists | 5 review | the deep reads (L2), one file per paper |
160
+ | D final | near-final text, the deadline close | 5 review | nothing new; it compares wording against the closest papers |
160
161
 
161
162
  So the corpus usually appears at stage 2, right after `find-venue` and before the study is
162
163
  designed, when what the venue rewards can still shape the study. A paper that first runs the skill
@@ -167,21 +168,134 @@ what is missing.
167
168
 
168
169
  ```text
169
170
  <papers-root>/venues/<venue>/
170
- ├── MANIFEST.md ← the sources, the years, what was capped, the stand-in for "strong accept" and how often it occurs
171
- ├── the winner and ordinary lists
172
- ├── measurements.json ← the codes of L0 and L1, one row per paper
173
- ├── text/ ← the text extracted from each paper
174
- ├── deep-reads/ ← one file per paper read in full (L2), usable by any paper
175
- ├── the scripts that fetched and measured
176
- └── a labelled subfolder for corpus 2: award papers on the topic at other venues
171
+ ├── papers.json ← the record: every paper, and every copy of it with its licence
172
+ ├── MANIFEST.md ← the sources, the years, what was capped, the stand-in for "strong accept" and how often it occurs
173
+ ├── measurements.json ← the codes of L0 and L1, one row per paper, keyed by its key
174
+ ├── pdf/<key>.pdf ← a paper's PDF, only when a copy's licence permits keeping it
175
+ ├── text/<key>.txt ← its extracted text, on the same condition
176
+ ├── text/<key>.<variant>.txt ← a second extraction of the same paper (another extractor, the first page alone)
177
+ ├── deep-reads/<key>.md ← one file per paper read in full (L2), usable by any paper
178
+ └── sources/ ← the listing and call pages as they were read
177
179
  ```
178
180
 
179
- Only `MANIFEST.md`, `measurements.json`, `text/` and `deep-reads/` have fixed names; the lists, the
180
- scripts and the corpus-2 folder are named by whoever runs the skill. The PDFs are not committed: the
181
- manifest records each paper's identifier and the command that fetches it.
181
+ These are all the names a corpus holds. The award winners and the ordinary accepted papers are rows
182
+ of `papers.json` (`group` `award` and `accepted`), and so are the papers of other venues, corpus 2
183
+ (`group` `sister`): one record, the corpora told apart by a field. The commands that fetched and
184
+ measured are named in `MANIFEST.md`; the scripts are not kept in the corpus. The author's own paper
185
+ is never in a corpus: its text belongs in its paper folder. A mechanism the venue adds to the generic
186
+ ten (M1–M10, kept beside the skill), or one that does not hold there, is written in `MANIFEST.md`.
187
+
188
+ ### The record, `papers.json`
189
+
190
+ One row per paper, and in it every copy of the paper we know of with that copy's licence. A real
191
+ row, from a workshop's 2026 list:
192
+
193
+ ```json
194
+ {
195
+ "venue": "agent",
196
+ "editions": [
197
+ {
198
+ "edition": 2026,
199
+ "listed_from": "https://conf.researchr.org/home/icse-2026/agent-2026",
200
+ "read_on": "2026-11-03",
201
+ "accepted": 27
202
+ }
203
+ ],
204
+ "papers": [
205
+ {
206
+ "key": "2026-01",
207
+ "edition": 2026,
208
+ "group": "accepted",
209
+ "title": "A Catalogue of Evaluation Metrics for LLM-Based Multi-Agent Frameworks in Software Engineering",
210
+ "authors": [
211
+ "Ingrid Lima",
212
+ "Vitor Linhares",
213
+ "Anderson Martins Gomes",
214
+ "Paulo Maia"
215
+ ],
216
+ "abstract": "LLM-based Multi-Agent (LMA) frameworks have recently gained traction …",
217
+ "ids": { "doi": "10.1145/3786167.3788430" },
218
+ "copies": [
219
+ {
220
+ "version": "published",
221
+ "url": "https://doi.org/10.1145/3786167.3788430",
222
+ "licence": {
223
+ "id": "CC-BY-4.0",
224
+ "read_from": "https://api.crossref.org/works/10.1145/3786167.3788430",
225
+ "read_on": "2026-11-03"
226
+ },
227
+ "stored": []
228
+ }
229
+ ]
230
+ }
231
+ ]
232
+ }
233
+ ```
234
+
235
+ The fields, their values and which are required are the JSON Schema
236
+ [`skills/study-accepted-papers/papers.schema.json`](../skills/study-accepted-papers/papers.schema.json),
237
+ generated from the parser (`src/adapters/venue-corpus/index.ts`; `npm run schema:venue-corpus`
238
+ rewrites it, and a test fails when it is stale). A schema cannot say that a key is unique, that a
239
+ paper's edition is one of `editions[].edition`, or that a copy that stores a file names where it was
240
+ fetched from; the parser checks those and the skill's script reports each with its path.
241
+
242
+ Every web address is `http` or `https`. The top level, an edition, a copy, a licence and `ids` are
243
+ strict, so a misspelt key is an error; a paper row keeps any further field as it is, for a project's
244
+ own scripts. A copy whose origin nobody recorded is `unknown`, and its licence can only be
245
+ `NOASSERTION`. The paths of stored files are not written in the record: they follow from `key`.
246
+
247
+ ### Licences: what a corpus may keep
248
+
249
+ A licence belongs to a **copy**, not to a paper. The same paper is often CC BY in the proceedings and
250
+ under arXiv's non-exclusive licence as a preprint, and a stored file is a copy of one version, so it
251
+ is judged by that version's licence.
252
+
253
+ Before it downloads a PDF or extracts a text, `study-accepted-papers` reads each copy's licence,
254
+ writes it in `papers.json`, and keeps a PDF or a text only when a copy's licence permits that kind;
255
+ for the other papers it keeps the ids. What each licence permits is one table, in paperlint's
256
+ `src/domain/licence.ts`, with its reasons in [the design note](design/venue-corpus.md#what-is-decided)
257
+ (decision 3). In short: CC0 1.0, CC BY 4.0 and CC BY-SA 4.0 permit both; an ND licence permits the
258
+ PDF and not an extracted text; an NC licence permits only in a project declared non-commercial; arXiv's
259
+ non-exclusive licence, a publisher's own and a licence not read (`NOASSERTION`) permit neither; and an
260
+ id the table does not list, another CC version included, permits nothing. The
261
+ setting by which a project declares itself non-commercial is not shipped yet: until it is, an NC
262
+ copy is treated as not permitted.
263
+
264
+ The skill's script prints, for each paper and each kind, the copy to keep or each copy's reason:
265
+
266
+ ```text
267
+ node <skills>/study-accepted-papers/scripts/corpus-licences.js agent
268
+ 2026-01 text: keep the published copy (CC-BY-4.0), https://doi.org/10.1145/3786167.3788430
269
+ 2026-01 pdf: keep the published copy (CC-BY-4.0), https://doi.org/10.1145/3786167.3788430
270
+ ```
271
+
272
+ It takes the venue, and finds `<papers-root>/venues/<venue>/papers.json` itself: the project is the git
273
+ top level of the folder it runs in, and the papers roots are `papersDir` in the project's
274
+ `paperlint.json`. Exactly one root may hold the venue; none or several is exit 1, naming the folders.
275
+ It parses `papers.json` first, and a record that does not parse is reported with the path of each
276
+ problem, exit 1.
182
277
 
183
- A mechanism the venue adds to the generic ten (M1–M10, kept beside the skill), or one that does not
184
- hold there, is written in `MANIFEST.md`.
278
+ **Titles and abstracts are kept as metadata whatever the licence.** Every scholarly API (Crossref,
279
+ Semantic Scholar, arXiv) serves them openly; they are not copies. Neither are the short quotes inside
280
+ the codes or a deep read.
281
+
282
+ ### Where a copy's licence is read from
283
+
284
+ Measured on 2026-11-24, without API keys, on three venues whose accepted lists were known (27, 16 and
285
+ 34 papers). `read_from` names the page or the API response the licence was read from:
286
+
287
+ | what | read it from | then | never |
288
+ | ----------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
289
+ | the list | Crossref, filtered by the proceedings' full container title (ACM); the Anthology volume `.bib`/`.xml` (ACL) | OpenAlex by source id, as a cross-check; the programme page for papers without a DOI | |
290
+ | abstract | the programme's paper page | Semantic Scholar by DOI, OpenAlex, arXiv OAI-PMH | Crossref (none deposited) |
291
+ | arXiv id | Semantic Scholar and OpenAlex, their union | | Crossref `relation` (always empty) |
292
+ | licence of the published copy | Crossref `license[]`, every URL kept | | |
293
+ | licence of the arXiv copy | arXiv OAI-PMH `<license>` | | OpenAlex (null for the arXiv default, once wrong), Semantic Scholar (its licence is of whichever copy it picked) |
294
+
295
+ **The licence line printed inside a PDF is not a source**: it can belong to another copy (an arXiv
296
+ PDF printing its published version's footer). Two gaps stay open: IEEE deposits no Creative Commons
297
+ licence (only text-and-data-mining policy URLs), and the ACL Anthology states one licence for the
298
+ whole site and none per paper. Where no source gives a copy's licence, it stays `NOASSERTION`.
185
299
 
186
300
  ### Who reads it
187
301
 
@@ -197,9 +311,18 @@ hold there, is written in `MANIFEST.md`.
197
311
  **No rule reads the corpus yet.** `paperlint lint` treats a folder in the papers directory as a paper
198
312
  only when it holds `PIPELINE-STATUS.md`, `paper.tex` or `paperlint.json`, and `venues/` holds none of
199
313
  them, so nothing in it is linted. The hook that refuses misplaced files does not act there either:
200
- it acts only inside a paper folder.
314
+ it acts only inside a paper folder. Today `papers.json` is parsed against its schema only when the
315
+ skill's script reads it.
316
+
317
+ Three rules of a family `corpus/` are planned for later releases, **not shipped yet**:
318
+
319
+ | rule | will report |
320
+ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
321
+ | `corpus/record` | a corpus with `pdf/` or `text/` and no `papers.json`; a `papers.json` that does not parse; a stored file no copy claims; a copy that claims a missing file; two copies of one paper storing one kind |
322
+ | `corpus/licence` | a stored file whose copy's licence was not read, or does not permit that kind; planned off by default, for a project whose corpus others read |
323
+ | `corpus/allowed-files-only` | a name in the corpus folder outside the names above |
201
324
 
202
- What is checked is the other side: a corpus started **inside** a paper folder. A `venues/` or
325
+ What is checked today is the other side: a corpus started **inside** a paper folder. A `venues/` or
203
326
  `venue-corpus/` folder at a paper's root is reported, with this place as where it goes
204
327
  ([the paper folder's layout](rules/paper/allowed-files-only.md)), and the hook refuses to create one.
205
328
 
@@ -1,4 +1,4 @@
1
- <!-- vigiles:sha256:f83563bacd9214c9 compiled from eslint-rules/CLAUDE.md.spec.ts -->
1
+ <!-- vigiles:sha256:35cb814eec608ef3 compiled from eslint-rules/CLAUDE.md.spec.ts -->
2
2
 
3
3
  # CLAUDE.md
4
4
 
@@ -40,6 +40,10 @@ the checks push every paper toward a blog post.
40
40
 
41
41
  ## Rules
42
42
 
43
+ ### A Rule Id Names Its Subject
44
+
45
+ **Guidance only** — A rule id is `<family>/<rule>`: one slash, kebab-case, as ESLint's `plugin/rule`. The family is the folder or record the rule judges (`paper/`, `repro/`, `cycle/`, `corpus/`), never the kind of check and never a venue; a new family only when no existing one judges that subject. The same check keeps the same name in every family: `allowed-files-only` for a folder's whitelist of names, `record` for a record file read against its schema, `layout` for a folder's shape. So related rules sort together and a reader who knows one family can guess another's rule. The rule's page is `docs/rules/<family>/<rule>.md`, held by `src/rule-docs.test.ts`. The author asked for this on 2026-11-24.
46
+
43
47
  ### Lint Rule Over Script
44
48
 
45
49
  **Guidance only** — A check over a syntax tree is a lint rule, not a script. It fires in the editor on save, gets the AST for free, and has a suppression syntax people already know. A script is for corpus-wide questions — index connectivity, ratios across many files. When the work has to run a program, a script may do the work and write facts to a JSON file, and a rule judges that file: the verdict still lands in the engine.
@@ -37,6 +37,9 @@ the checks push every paper toward a blog post.
37
37
  tic, plus a check that no claim was softened or strengthened.`,
38
38
  },
39
39
  rules: {
40
+ "a-rule-id-names-its-subject": guidance(
41
+ "A rule id is `<family>/<rule>`: one slash, kebab-case, as ESLint's `plugin/rule`. The family is the folder or record the rule judges (`paper/`, `repro/`, `cycle/`, `corpus/`), never the kind of check and never a venue; a new family only when no existing one judges that subject. The same check keeps the same name in every family: `allowed-files-only` for a folder's whitelist of names, `record` for a record file read against its schema, `layout` for a folder's shape. So related rules sort together and a reader who knows one family can guess another's rule. The rule's page is `docs/rules/<family>/<rule>.md`, held by `src/rule-docs.test.ts`. The author asked for this on 2026-11-24.",
42
+ ),
40
43
  "lint-rule-over-script": guidance(
41
44
  "A check over a syntax tree is a lint rule, not a script. It fires in the editor on save, gets the AST for free, and has a suppression syntax people already know. A script is for corpus-wide questions — index connectivity, ratios across many files. When the work has to run a program, a script may do the work and write facts to a JSON file, and a rule judges that file: the verdict still lands in the engine.",
42
45
  ),
@@ -16,9 +16,12 @@ import { dirname, join } from "node:path";
16
16
  import { fileURLToPath } from "node:url";
17
17
  import { ESLint } from "eslint";
18
18
  import markdown from "@eslint/markdown";
19
- import { recordCheck } from "vigiles";
19
+ import { it, vi } from "vitest";
20
20
  import port, { PORT } from "./install-path-literals.ts";
21
21
 
22
+ // Several tests here run real ESLint, spawn processes or walk the repository.
23
+ vi.setConfig({ testTimeout: 120_000 });
24
+
22
25
  // Resolved from THIS file, never from the caller's cwd (root CLAUDE.md), and the mistake this very
23
26
  // class of bug is about.
24
27
  const HERE = dirname(fileURLToPath(import.meta.url));
@@ -59,7 +62,7 @@ const cases = [];
59
62
 
60
63
  // ── 1. MARKDOWN FIRES. Three carriers in one fixture: the frontmatter value, the fenced
61
64
  // command, and an inline mention. All three are how a real skill names a script.
62
- {
65
+ it("1. MARKDOWN FIRES: three carriers in one fixture", async () => {
63
66
  const m = await findings(mdLinter, join(FIX, "defect.md"), RULE_MD);
64
67
  assert.ok(m.length >= 3, `expected at least three findings, got ${m.length}`);
65
68
  assert.match(
@@ -81,11 +84,11 @@ const cases = [];
81
84
  );
82
85
  assert.ok(prefixes.has("node_modules/"), "the npm channel must be named");
83
86
  cases.push("md fires on frontmatter, fenced command and inline mention");
84
- }
87
+ });
85
88
 
86
89
  // ── 2. MARKDOWN STAYS QUIET. Same skill written through the substitution, plus a
87
90
  // repository-relative path that is identical in every channel.
88
- {
91
+ it("2. MARKDOWN STAYS QUIET: the same skill written through the substitution", async () => {
89
92
  const m = await findings(mdLinter, join(FIX, "clean.md"), RULE_MD);
90
93
  assert.equal(
91
94
  m.length,
@@ -93,11 +96,11 @@ const cases = [];
93
96
  `clean fixture must be silent, got ${JSON.stringify(m)}`,
94
97
  );
95
98
  cases.push("md quiet on a skill that uses the substitution");
96
- }
99
+ });
97
100
 
98
101
  // ── 3. JAVASCRIPT FIRES, in both literal forms. The template case is not decoration: a path
99
102
  // assembled from a template is still a path, and reading only `Literal` would miss it.
100
- {
103
+ it("3. JAVASCRIPT FIRES, in both literal forms", async () => {
101
104
  const m = await findings(jsLinter, join(FIX, "defect.fixture.mjs"), RULE_JS);
102
105
  assert.equal(
103
106
  m.length,
@@ -105,10 +108,10 @@ const cases = [];
105
108
  `expected one plain and one template finding, got ${m.length}`,
106
109
  );
107
110
  cases.push("js fires on a plain literal AND on a template quasi");
108
- }
111
+ });
109
112
 
110
113
  // ── 4. JAVASCRIPT STAYS QUIET when the module asks the port.
111
- {
114
+ it("4. JAVASCRIPT STAYS QUIET when the module asks the port", async () => {
112
115
  const m = await findings(jsLinter, join(FIX, "clean.fixture.mjs"), RULE_JS);
113
116
  assert.equal(
114
117
  m.length,
@@ -116,11 +119,11 @@ const cases = [];
116
119
  `clean module must be silent, got ${JSON.stringify(m)}`,
117
120
  );
118
121
  cases.push("js quiet on a module that asks the port");
119
- }
122
+ });
120
123
 
121
124
  // ── 5. A TAGGED TEMPLATE WITH AN INVALID ESCAPE has no cooked value, only the raw one — and the
122
125
  // path in it is still a path. (`String.raw` is exactly where such a template is legal.)
123
- {
126
+ it("5. A TAGGED TEMPLATE WITH AN INVALID ESCAPE has no cooked value, only the raw one", async () => {
124
127
  const [res] = await jsLinter.lintText(
125
128
  "export const p = String.raw`node_modules/paperlint/\\unicode`;\n",
126
129
  { filePath: join(ROOT, "tagged.probe.mjs") },
@@ -132,6 +135,4 @@ const cases = [];
132
135
  `a raw-only template quasi must be read, got ${JSON.stringify(res.messages)}`,
133
136
  );
134
137
  cases.push("js fires on a tagged template whose quasi has no cooked value");
135
- }
136
-
137
- recordCheck(cases.length);
138
+ });
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Colocated test for the LaTeX language `eslint-rules/latex-language.mjs`.
3
- * Run: `npx vigiles test eslint-rules/latex-language.harness.mjs`
4
3
  *
5
4
  * FIVE PARTS, AND THE ORDER IS LOAD-BEARING:
6
5
  * 0. THE PROJECTION INVARIANT — length, line count and newline offsets equal the source.
@@ -23,7 +22,7 @@
23
22
  * V. CONFIG — the language is wired to `.tex`, and the glob it is wired on is NOT EMPTY.
24
23
  *
25
24
  * ⚠️ WHAT WAS LOST WHEN THIS TEST LEFT THE PRIVATE CORPUS BEHIND, stated rather than glossed.
26
- * The original harness drove SIX rule modules (walls, prose, claims, structure, craft,
25
+ * The original test drove SIX rule modules (walls, prose, claims, structure, craft,
27
26
  * registry) through this language and froze their finding counts on three real papers
28
27
  * (35 · 52 · 15 at the 2026-08-27 measurement, later 32 · 53 · 20 after captions became
29
28
  * visible on 2026-09-06). None of those modules was extracted, and the papers are private, so:
@@ -37,11 +36,11 @@
37
36
  * That last gap is why part II asserts the projection DIRECTLY on `texToMdast`, rather than
38
37
  * inferring it from someone's finding count.
39
38
  *
40
- * 🔴 Assertions live at MODULE TOP LEVEL: `vigiles test` imports the file and treats "it did
41
- * not throw" as success; an exported `tests` object is run by nothing.
39
+ * The parts are `it` blocks in file order: each one runs, and fails, on its own.
42
40
  */
43
41
  import { ESLint } from "eslint";
44
42
  import assert from "node:assert/strict";
43
+ import { afterAll, it, vi } from "vitest";
45
44
  import {
46
45
  existsSync,
47
46
  mkdirSync,
@@ -58,19 +57,24 @@ import { fileURLToPath } from "node:url";
58
57
  const HERE = dirname(fileURLToPath(import.meta.url));
59
58
  const ROOT = join(HERE, ".."); // eslint-rules → repository root
60
59
  const LANG = join(HERE, "latex-language.ts");
61
- assert.ok(existsSync(LANG), `no entry point for the test: ${LANG}`);
60
+ // A test here lints the whole repository: ~72 s alone, up to 224 s beside the rest of the suite
61
+ // under coverage on 4 cores (measured 2026-11-24), so the limit only catches a hang.
62
+ vi.setConfig({ testTimeout: 600_000 });
62
63
 
63
64
  const { texLanguage, texToMdast } = await import(LANG);
64
65
 
65
66
  const TMP = realpathSync(mkdtempSync(join(tmpdir(), "latex-language-")));
66
- // Cleanup is registered IMMEDIATELY, not at the end of the file: assertions throw, and an
67
- // `rmSync` at the bottom never runs in exactly the runs that are red.
68
- process.on("exit", () => rmSync(TMP, { recursive: true, force: true }));
67
+ afterAll(() => {
68
+ rmSync(TMP, { recursive: true, force: true });
69
+ });
69
70
 
70
71
  const CLEAN_FIXTURE = join(ROOT, "fixtures/latex-language/clean.tex");
71
72
  const DEFECT_FIXTURE = join(ROOT, "fixtures/latex-language/defect.tex");
72
- for (const f of [CLEAN_FIXTURE, DEFECT_FIXTURE])
73
- assert.ok(existsSync(f), `missing fixture: ${f}`);
73
+ it("the entry point and both fixtures exist", () => {
74
+ assert.ok(existsSync(LANG), `no entry point for the test: ${LANG}`);
75
+ for (const f of [CLEAN_FIXTURE, DEFECT_FIXTURE])
76
+ assert.ok(existsSync(f), `missing fixture: ${f}`);
77
+ });
74
78
 
75
79
  // ═════════════════════════════════════════════════════════════════════════════
76
80
  // 0. THE PROJECTION INVARIANT
@@ -105,8 +109,12 @@ function project(label, src) {
105
109
 
106
110
  const CLEAN_SRC = readFileSync(CLEAN_FIXTURE, "utf8");
107
111
  const DEFECT_SRC = readFileSync(DEFECT_FIXTURE, "utf8");
108
- const clean = project("fixtures/latex-language/clean.tex", CLEAN_SRC);
109
- const defect = project("fixtures/latex-language/defect.tex", DEFECT_SRC);
112
+ let clean;
113
+ let defect;
114
+ it("0. THE PROJECTION INVARIANT holds on both fixtures", () => {
115
+ clean = project("fixtures/latex-language/clean.tex", CLEAN_SRC);
116
+ defect = project("fixtures/latex-language/defect.tex", DEFECT_SRC);
117
+ });
110
118
 
111
119
  // ═════════════════════════════════════════════════════════════════════════════
112
120
  // I. QUIET ON A CORRECT INPUT — through the repository's real config
@@ -130,12 +138,14 @@ async function lintTex(file) {
130
138
  }));
131
139
  }
132
140
 
133
- assert.deepEqual(
134
- await lintTex(CLEAN_FIXTURE),
135
- [],
136
- "a CORRECT LaTeX paper produced findings — a check that fails a correct input gets switched " +
137
- "off the same day",
138
- );
141
+ it("I. QUIET ON A CORRECT INPUT, through the repository's real config", async () => {
142
+ assert.deepEqual(
143
+ await lintTex(CLEAN_FIXTURE),
144
+ [],
145
+ "a CORRECT LaTeX paper produced findings — a check that fails a correct input gets switched " +
146
+ "off the same day",
147
+ );
148
+ });
139
149
 
140
150
  // ═════════════════════════════════════════════════════════════════════════════
141
151
  // II. THE PROJECTION ACTUALLY DID ITS WORK
@@ -145,7 +155,7 @@ assert.deepEqual(
145
155
  // thing a mutation of that property kills.
146
156
  const headings = (root) => root.children.filter((c) => c.type === "heading");
147
157
 
148
- {
158
+ it("II. headings: synthesised Abstract and References, real sections, ATX projection", () => {
149
159
  const titles = headings(clean.root).map((h) => h.title);
150
160
  // 🔴 SYNTHESIS. Neither `Abstract` nor `References` is written as a heading anywhere in the
151
161
  // fixture: the abstract is an environment, the bibliography is a macro. Measured on the
@@ -180,9 +190,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
180
190
  /^##\s+Introduction\s*$/m,
181
191
  "`\\section{Introduction}` did not project to an ATX heading",
182
192
  );
183
- }
193
+ });
184
194
 
185
- {
195
+ it("II. the preamble cut-off", () => {
186
196
  // 🔴 THE PREAMBLE CUT-OFF. Nothing before `\begin{document}` is a node of the document.
187
197
  // Without the cut-off, one real paper of the source corpus got a FALSE `## References` on
188
198
  // line 178 — its bibliography "began" before the introduction, so the whole paper fell into
@@ -227,9 +237,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
227
237
  8,
228
238
  "References was synthesised in the preamble rather than at the document's bibliography",
229
239
  );
230
- }
240
+ });
231
241
 
232
- {
242
+ it("II. the preamble is blanked", () => {
233
243
  // THE PREAMBLE IS BLANKED. Everything before `\begin{document}` is markup, and if it stays
234
244
  // visible the package list and the author macros become prose.
235
245
  const preEnd =
@@ -243,9 +253,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
243
253
  CLEAN_SRC.includes("\\usepackage{natbib}"),
244
254
  "the fixture lost its preamble content — the assertion above no longer has a subject",
245
255
  );
246
- }
256
+ });
247
257
 
248
- {
258
+ it("II. captions and footnotes are prose", () => {
249
259
  // 🔴 CAPTIONS AND FOOTNOTES ARE PROSE, AND THIS WAS A DOUBLE LOCK. Until 2026-09-06 the text
250
260
  // inside `\caption{}` / `\footnote{}` was invisible to every prose rule reading `.tex`: it
251
261
  // was blanked once as an opaque macro argument, and again as part of the surrounding
@@ -276,9 +286,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
276
286
  !projectedFloat.includes(markup),
277
287
  `float markup «${markup}» survived into the prose projection`,
278
288
  );
279
- }
289
+ });
280
290
 
281
- {
291
+ it("II. opaque macros: name and argument are blanked", () => {
282
292
  // OPAQUE MACROS: name AND argument are blanked. A `\cite` key or a `\label` is not English.
283
293
  for (const token of ["someone2020", "sec:intro", "acmart", "sigconf"])
284
294
  assert.ok(
@@ -290,9 +300,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
290
300
  CLEAN_SRC.includes("\\label{sec:intro}"),
291
301
  "the fixture lost its opaque macros — the assertion above no longer has a subject",
292
302
  );
293
- }
303
+ });
294
304
 
295
- {
305
+ it("II. math is blanked", () => {
296
306
  // MATH IS BLANKED — inline and display alike. A formula is not a sentence, and a word counter
297
307
  // that eats `E = m c^2` reports prose that was never written.
298
308
  assert.ok(
@@ -307,9 +317,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
307
317
  CLEAN_SRC.includes("E = m c^2") && CLEAN_SRC.includes("$n = 10$"),
308
318
  "the fixture lost its math — the assertion above no longer has a subject",
309
319
  );
310
- }
320
+ });
311
321
 
312
- {
322
+ it("II. texttt becomes inline code, with the same character count", () => {
313
323
  // `\texttt{X}` → `` `X` ``: the same character count, so offsets do not move. It is the only
314
324
  // markdown markup the projection can reproduce without shifting — `**` needs TWO characters
315
325
  // after the content, and LaTeX leaves only `}`.
@@ -317,9 +327,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
317
327
  clean.text.includes("`shadow-budget`"),
318
328
  "`\\texttt{X}` no longer projects to a backticked span",
319
329
  );
320
- }
330
+ });
321
331
 
322
- {
332
+ it("II. a bold lead-in at column 1 becomes a strong node", () => {
323
333
  // 🔴 A BOLD LEAD-IN AT COLUMN 1 becomes a `strong` node, and its `**` are written IN PLACE OF
324
334
  // `\te` rather than before the content. A downstream block-note rule locates a lead-in by the
325
335
  // OFFSET of the line's first non-space character; leave spaces at the start of the line and
@@ -344,9 +354,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
344
354
  text.split("\n").some((l) => l.startsWith("**")),
345
355
  "the `**` were not written at the start of the line — a note above the block cannot bind",
346
356
  );
347
- }
357
+ });
348
358
 
349
- {
359
+ it("II. comments, and both of their edges", () => {
350
360
  // 🔴 COMMENTS, AND BOTH OF THEIR EDGES. unified-latex includes the TRAILING newline in a
351
361
  // comment while mdast does not; and a comment that follows a line of text directly comes back
352
362
  // with a position starting at the PREVIOUS newline rather than at `%`. Consumers recognise a
@@ -380,7 +390,7 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
380
390
  "the comment node ends on a newline — its RIGHT edge swallowed the line break, so the gap " +
381
391
  "between the note and what it annotates is empty and the note never binds",
382
392
  );
383
- }
393
+ });
384
394
 
385
395
  // ═════════════════════════════════════════════════════════════════════════════
386
396
  // III. FIRES ON A PLANTED DEFECT
@@ -389,7 +399,7 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
389
399
  // repository is `tex/future-promise`, and it reads the file from disk rather than the
390
400
  // projection. So this run proves the language parses the document and ESLint dispatches through
391
401
  // it — the projection's own both-halves are part II, asserted directly.
392
- {
402
+ it("III. FIRES ON A PLANTED DEFECT: defect.tex through the real config", async () => {
393
403
  const ms = await lintTex(DEFECT_FIXTURE);
394
404
  assert.ok(
395
405
  ms.length >= 1,
@@ -411,7 +421,7 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
411
421
  defect.text.includes("The full table will be released later."),
412
422
  "the caption carrying the defect is invisible in the projection",
413
423
  );
414
- }
424
+ });
415
425
 
416
426
  // ═════════════════════════════════════════════════════════════════════════════
417
427
  // IV. THE LANGUAGE'S BOUNDARIES — pinned by assertions, not only by prose
@@ -420,7 +430,7 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
420
430
  // "fixed" unnoticed, or gets quoted as current a year after it went away. The assertions below
421
431
  // describe CURRENT behaviour. Each is an invitation to rewrite the language's header, not a ban
422
432
  // on changing the code.
423
- {
433
+ it("IV. boundary 2: escaped characters are lost together with the macro name", () => {
424
434
  // BOUNDARY 2: escaped characters are lost together with the macro name.
425
435
  const { text } = texToMdast(
426
436
  "\\documentclass{article}\n\\begin{document}\n" +
@@ -432,8 +442,8 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
432
442
  "the projection of escaped characters changed — rewrite boundary 2 in the language header:\n" +
433
443
  text,
434
444
  );
435
- }
436
- {
445
+ });
446
+ it("IV. boundary 4: the contents of an input file are invisible", () => {
437
447
  // BOUNDARY 4: `\input{}` — the contents of the included file are invisible.
438
448
  const dir = join(TMP, "input-boundary");
439
449
  mkdirSync(join(dir, "sections"), { recursive: true });
@@ -454,8 +464,8 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
454
464
  !text.includes("solver"),
455
465
  "the contents of `\\input{}` became visible — boundary 4 in the language header is stale",
456
466
  );
457
- }
458
- {
467
+ });
468
+ it("IV. boundary 5: appendix is inexpressible in a length-preserving projection", () => {
459
469
  // BOUNDARY 5: `\appendix` is inexpressible in a length-preserving projection (9 characters
460
470
  // against the 11 of `## Appendix`).
461
471
  const src = [
@@ -474,9 +484,9 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
474
484
  !titles.some((t) => /^Appendix/.test(t)),
475
485
  "`\\appendix` started producing a heading — boundary 5 in the language header is stale",
476
486
  );
477
- }
478
- {
479
- // 🔴 BOUNDARY 13, found 2026-09-11 BY THIS HARNESS, by an assertion that expected the
487
+ });
488
+ it("IV. boundary 13: citep and citet leak their key", () => {
489
+ // 🔴 BOUNDARY 13, found 2026-09-11 BY THIS TEST, by an assertion that expected the
480
490
  // opposite: `\citep{}` / `\citet{}` leak their key into the prose, while `\cite{}` does not.
481
491
  // All three are listed in OPAQUE, but OPAQUE blanks a macro name plus the arguments
482
492
  // unified-latex ATTACHED to it, and unified-latex has no signature for the natbib pair — so
@@ -499,8 +509,8 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
499
509
  keyed("citet").includes("keyABC"),
500
510
  "`\\citet{}` stopped leaking its key — boundary 13 was fixed; rewrite it in the language header",
501
511
  );
502
- }
503
- {
512
+ });
513
+ it("IV. boundary 8: an inline eslint config does not work inside .tex", async () => {
504
514
  // BOUNDARY 8: an inline `% eslint {...}` config does NOT work inside `.tex`
505
515
  // (`applyInlineConfig` returns empty), while `% eslint-disable-next-line` DOES.
506
516
  // ⚠️ This one runs on an in-process config rather than the repository's, and deliberately:
@@ -563,12 +573,12 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
563
573
  [],
564
574
  "`% eslint-disable-next-line` stopped working inside `.tex` — boundary 8 is stale",
565
575
  );
566
- }
576
+ });
567
577
 
568
578
  // ═════════════════════════════════════════════════════════════════════════════
569
579
  // V. CONFIG — the language is wired, over a NON-EMPTY glob
570
580
  // ═════════════════════════════════════════════════════════════════════════════
571
- {
581
+ it("V. CONFIG: the language is wired, over a non-empty glob", async () => {
572
582
  const config = (await import(join(ROOT, "eslint.config.mjs"))).default;
573
583
  const tex = config.find((b) => b.language === "tex/latex");
574
584
  assert.ok(
@@ -596,4 +606,4 @@ const headings = (root) => root.children.filter((c) => c.type === "heading");
596
606
  "are four, so the language was invoked on less than its own test data: " +
597
607
  seen.join(", "),
598
608
  );
599
- }
609
+ });