paperlint 20.1.2 → 20.3.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 (96) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CLAUDE.md +5 -1
  3. package/dist/adapters/venue-corpus/index.d.ts +361 -0
  4. package/dist/adapters/venue-corpus/index.d.ts.map +1 -0
  5. package/dist/adapters/venue-corpus/index.js +221 -0
  6. package/dist/adapters/venue-corpus/index.js.map +1 -0
  7. package/dist/cli.d.ts +4 -3
  8. package/dist/cli.d.ts.map +1 -1
  9. package/dist/cli.js +42 -13
  10. package/dist/cli.js.map +1 -1
  11. package/dist/corpus-record-rule.d.ts +65 -0
  12. package/dist/corpus-record-rule.d.ts.map +1 -0
  13. package/dist/corpus-record-rule.js +85 -0
  14. package/dist/corpus-record-rule.js.map +1 -0
  15. package/dist/domain/corpus-record.d.ts +51 -0
  16. package/dist/domain/corpus-record.d.ts.map +1 -0
  17. package/dist/domain/corpus-record.js +119 -0
  18. package/dist/domain/corpus-record.js.map +1 -0
  19. package/dist/domain/licence.d.ts +51 -0
  20. package/dist/domain/licence.d.ts.map +1 -0
  21. package/dist/domain/licence.js +61 -0
  22. package/dist/domain/licence.js.map +1 -0
  23. package/dist/domain/venue-corpus.d.ts +142 -0
  24. package/dist/domain/venue-corpus.d.ts.map +1 -0
  25. package/dist/domain/venue-corpus.js +17 -0
  26. package/dist/domain/venue-corpus.js.map +1 -0
  27. package/dist/eslint-rules/CLAUDE.md.spec.d.ts.map +1 -1
  28. package/dist/eslint-rules/CLAUDE.md.spec.js +1 -0
  29. package/dist/eslint-rules/CLAUDE.md.spec.js.map +1 -1
  30. package/dist/paper-files.d.ts +10 -3
  31. package/dist/paper-files.d.ts.map +1 -1
  32. package/dist/paper-files.js +17 -2
  33. package/dist/paper-files.js.map +1 -1
  34. package/dist/papers-roots.d.ts +6 -0
  35. package/dist/papers-roots.d.ts.map +1 -1
  36. package/dist/papers-roots.js +14 -0
  37. package/dist/papers-roots.js.map +1 -1
  38. package/dist/ports/venue-corpus-codec.d.ts +11 -0
  39. package/dist/ports/venue-corpus-codec.d.ts.map +1 -0
  40. package/dist/ports/venue-corpus-codec.js +2 -0
  41. package/dist/ports/venue-corpus-codec.js.map +1 -0
  42. package/dist/skill-chunks/chunk-5KCU4WTN.js +108 -0
  43. package/dist/skill-chunks/{chunk-X4VKG4KT.js → chunk-6YEM4VDI.js} +11 -9
  44. package/dist/skill-chunks/{chunk-L3NJUJUP.js → chunk-CXAGKT44.js} +5 -3
  45. package/dist/skill-chunks/{chunk-6NU6CXUS.js → chunk-J5XYPERO.js} +12 -72
  46. package/dist/skill-chunks/{chunk-IREAROCV.js → chunk-Z5YMDZYW.js} +4 -0
  47. package/dist/skills/study-accepted-papers/scripts/corpus-licences-core.d.ts +54 -0
  48. package/dist/skills/study-accepted-papers/scripts/corpus-licences.d.ts +2 -0
  49. package/docs/design/venue-corpus.md +271 -0
  50. package/docs/layout.md +2 -2
  51. package/docs/rules/corpus/record.md +119 -0
  52. package/docs/rules.md +1 -0
  53. package/docs/venues.md +158 -24
  54. package/eslint-rules/CLAUDE.md +5 -1
  55. package/eslint-rules/CLAUDE.md.spec.ts +3 -0
  56. package/eslint.config.mjs +1 -0
  57. package/package.json +3 -1
  58. package/scripts/bundle-skills.ts +1 -0
  59. package/scripts/eslint-file-length.mjs +3 -3
  60. package/scripts/venue-corpus-schema.test.ts +39 -0
  61. package/scripts/venue-corpus-schema.ts +17 -0
  62. package/skills/argument-arc/scripts/headings.js +6 -4
  63. package/skills/cold-read-diff/scripts/cold-read.js +6 -4
  64. package/skills/paper-pipeline/scripts/extract-ref-facts.js +6 -5
  65. package/skills/pc-panel-review/scripts/prior-reviews.js +7 -5
  66. package/skills/study-accepted-papers/SKILL.md +34 -2
  67. package/skills/study-accepted-papers/SKILL.md.spec.ts +33 -1
  68. package/skills/study-accepted-papers/papers.schema.json +474 -0
  69. package/skills/study-accepted-papers/scripts/corpus-licences-core.js +180 -0
  70. package/skills/study-accepted-papers/scripts/corpus-licences-core.ts +303 -0
  71. package/skills/study-accepted-papers/scripts/corpus-licences.js +393 -0
  72. package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +488 -0
  73. package/skills/study-accepted-papers/scripts/corpus-licences.ts +27 -0
  74. package/skills/verify-citations/scripts/bib-authors.js +6 -5
  75. package/skills/verify-citations/scripts/verify-cites.js +6 -5
  76. package/src/adapters/venue-corpus/index.test.ts +337 -0
  77. package/src/adapters/venue-corpus/index.ts +306 -0
  78. package/src/cli-e2e.test.mjs +2 -2
  79. package/src/cli.test.ts +1 -1
  80. package/src/cli.ts +57 -13
  81. package/src/corpus-record-rule.test.ts +228 -0
  82. package/src/corpus-record-rule.ts +175 -0
  83. package/src/domain/corpus-record.test.ts +163 -0
  84. package/src/domain/corpus-record.ts +210 -0
  85. package/src/domain/licence.test.ts +122 -0
  86. package/src/domain/licence.ts +95 -0
  87. package/src/domain/venue-corpus.ts +159 -0
  88. package/src/paper-files.test.ts +13 -4
  89. package/src/paper-files.ts +23 -2
  90. package/src/paper-settings-commands.test.ts +2 -2
  91. package/src/papers-roots.test.ts +34 -1
  92. package/src/papers-roots.ts +15 -0
  93. package/src/ports/venue-corpus-codec.ts +11 -0
  94. package/src/rule-cases.test.ts +15 -0
  95. package/src/settled-paper.test.ts +1 -1
  96. package/src/unowned-file.test.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperlint",
3
- "version": "20.1.2",
3
+ "version": "20.3.0",
4
4
  "description": "Skills and hooks for writing a research paper with paperlint",
5
5
  "skills": "./skills/",
6
6
  "hooks": "./plugin/hooks/hooks.json"
package/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- vigiles:sha256:6d6e96066c9c2e2b compiled from CLAUDE.md.spec.ts -->
1
+ <!-- vigiles:sha256:b9266075626f0285 compiled from CLAUDE.md.spec.ts -->
2
2
 
3
3
  # CLAUDE.md
4
4
 
@@ -121,6 +121,10 @@ Before writing machinery, **run the thing you are about to replace and paste its
121
121
 
122
122
  **Guidance only** — Every check — lint rule, script, hook, harness — fires on a planted defect AND stays quiet on a clean fixture, and the test goes red before the fix lands. A check only ever seen quiet is indistinguishable from a dead one. [Details](docs/testing.md)
123
123
 
124
+ ### Every Prescribed File Is Linted
125
+
126
+ **Guidance only** — Every file or folder paperlint prescribes to a project (a name a command or skill writes, or a doc tells the author to keep) has its names held by its family's `allowed-files-only` rule and its contents by a schema that a `record` rule reads, so a stray file or a misspelt key is a finding, not a silent pass. A file held only by prose or by a command at run time is a gap with an open issue. The audit of 2026-11-24 found most prescribed files only partly held; each gap's issue is linked from #516. The author asked for this on 2026-11-24.
127
+
124
128
  ### Never The Callers Cwd
125
129
 
126
130
  **Guidance only** — No program this package ships (`bin/`, `lib/`, hooks, skill scripts) depends on the directory it is started from: resolve from `git rev-parse --show-toplevel` or from the module's own location.
@@ -0,0 +1,361 @@
1
+ /**
2
+ * The schema of a venue corpus's `papers.json` — the one place its shape is checked
3
+ * (docs/design/venue-corpus.md, decision 1). The text is parsed once, here, into the domain's
4
+ * `VenueCorpus`; whatever reads a record after it never re-validates. The study registry's pattern
5
+ * (`src/adapters/study-registry/`).
6
+ *
7
+ * The top level, an edition, a copy, a licence and a paper's ids are strict, so a misspelt key is an
8
+ * error. A paper row is loose: a consumer's scripts read their own fields from it. A licence id is
9
+ * checked for its shape only: whether the id permits anything is `src/domain/licence.ts`'s table, so
10
+ * one unlisted id does not make the record unreadable.
11
+ */
12
+ import { z } from "zod";
13
+ import { NOASSERTION } from "../../domain/licence.ts";
14
+ import { type Copy, type Edition, type Licence, type ParsedCorpus, type Paper, type PaperIds, type StrongAcceptProxy, type VenueCorpus } from "../../domain/venue-corpus.ts";
15
+ import type { VenueCorpusCodec } from "../../ports/venue-corpus-codec.ts";
16
+ /** A licence: NOASSERTION alone, or any other id with where and when it was read. */
17
+ declare const licence: z.ZodPipe<z.ZodObject<{
18
+ id: z.ZodString;
19
+ read_from: z.ZodOptional<z.ZodURL>;
20
+ read_on: z.ZodOptional<z.ZodISODate>;
21
+ }, z.core.$strict>, z.ZodTransform<{
22
+ readonly id: typeof NOASSERTION;
23
+ } | {
24
+ readonly id: string;
25
+ readonly read_from: string;
26
+ readonly read_on: string;
27
+ }, {
28
+ id: string;
29
+ read_from?: string | undefined;
30
+ read_on?: string | undefined;
31
+ }>>;
32
+ declare const copy: z.ZodDiscriminatedUnion<[z.ZodObject<{
33
+ stored: z.ZodArray<z.ZodEnum<{
34
+ text: "text";
35
+ pdf: "pdf";
36
+ }>>;
37
+ fetched_from: z.ZodOptional<z.ZodURL>;
38
+ version: z.ZodEnum<{
39
+ accepted: "accepted";
40
+ published: "published";
41
+ preprint: "preprint";
42
+ }>;
43
+ url: z.ZodURL;
44
+ licence: z.ZodPipe<z.ZodObject<{
45
+ id: z.ZodString;
46
+ read_from: z.ZodOptional<z.ZodURL>;
47
+ read_on: z.ZodOptional<z.ZodISODate>;
48
+ }, z.core.$strict>, z.ZodTransform<{
49
+ readonly id: typeof NOASSERTION;
50
+ } | {
51
+ readonly id: string;
52
+ readonly read_from: string;
53
+ readonly read_on: string;
54
+ }, {
55
+ id: string;
56
+ read_from?: string | undefined;
57
+ read_on?: string | undefined;
58
+ }>>;
59
+ }, z.core.$strict>, z.ZodObject<{
60
+ stored: z.ZodArray<z.ZodEnum<{
61
+ text: "text";
62
+ pdf: "pdf";
63
+ }>>;
64
+ fetched_from: z.ZodOptional<z.ZodURL>;
65
+ version: z.ZodLiteral<"unknown">;
66
+ licence: z.ZodObject<{
67
+ id: z.ZodLiteral<"NOASSERTION">;
68
+ }, z.core.$strict>;
69
+ }, z.core.$strict>], "version">;
70
+ declare const ids: z.ZodObject<{
71
+ doi: z.ZodOptional<z.ZodString>;
72
+ arxiv: z.ZodOptional<z.ZodString>;
73
+ dblp: z.ZodOptional<z.ZodString>;
74
+ s2: z.ZodOptional<z.ZodString>;
75
+ url: z.ZodOptional<z.ZodURL>;
76
+ }, z.core.$strict>;
77
+ declare const paper: z.ZodDiscriminatedUnion<[z.ZodObject<{
78
+ group: z.ZodEnum<{
79
+ accepted: "accepted";
80
+ award: "award";
81
+ }>;
82
+ edition: z.ZodNumber;
83
+ key: z.ZodString;
84
+ title: z.ZodString;
85
+ authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
+ ids: z.ZodObject<{
88
+ doi: z.ZodOptional<z.ZodString>;
89
+ arxiv: z.ZodOptional<z.ZodString>;
90
+ dblp: z.ZodOptional<z.ZodString>;
91
+ s2: z.ZodOptional<z.ZodString>;
92
+ url: z.ZodOptional<z.ZodURL>;
93
+ }, z.core.$strict>;
94
+ copies: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
95
+ stored: z.ZodArray<z.ZodEnum<{
96
+ text: "text";
97
+ pdf: "pdf";
98
+ }>>;
99
+ fetched_from: z.ZodOptional<z.ZodURL>;
100
+ version: z.ZodEnum<{
101
+ accepted: "accepted";
102
+ published: "published";
103
+ preprint: "preprint";
104
+ }>;
105
+ url: z.ZodURL;
106
+ licence: z.ZodPipe<z.ZodObject<{
107
+ id: z.ZodString;
108
+ read_from: z.ZodOptional<z.ZodURL>;
109
+ read_on: z.ZodOptional<z.ZodISODate>;
110
+ }, z.core.$strict>, z.ZodTransform<{
111
+ readonly id: typeof NOASSERTION;
112
+ } | {
113
+ readonly id: string;
114
+ readonly read_from: string;
115
+ readonly read_on: string;
116
+ }, {
117
+ id: string;
118
+ read_from?: string | undefined;
119
+ read_on?: string | undefined;
120
+ }>>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ stored: z.ZodArray<z.ZodEnum<{
123
+ text: "text";
124
+ pdf: "pdf";
125
+ }>>;
126
+ fetched_from: z.ZodOptional<z.ZodURL>;
127
+ version: z.ZodLiteral<"unknown">;
128
+ licence: z.ZodObject<{
129
+ id: z.ZodLiteral<"NOASSERTION">;
130
+ }, z.core.$strict>;
131
+ }, z.core.$strict>], "version">>;
132
+ }, z.core.$loose>, z.ZodObject<{
133
+ group: z.ZodLiteral<"sister">;
134
+ venue: z.ZodString;
135
+ year: z.ZodNumber;
136
+ listed_from: z.ZodURL;
137
+ key: z.ZodString;
138
+ title: z.ZodString;
139
+ authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
140
+ abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ ids: z.ZodObject<{
142
+ doi: z.ZodOptional<z.ZodString>;
143
+ arxiv: z.ZodOptional<z.ZodString>;
144
+ dblp: z.ZodOptional<z.ZodString>;
145
+ s2: z.ZodOptional<z.ZodString>;
146
+ url: z.ZodOptional<z.ZodURL>;
147
+ }, z.core.$strict>;
148
+ copies: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
149
+ stored: z.ZodArray<z.ZodEnum<{
150
+ text: "text";
151
+ pdf: "pdf";
152
+ }>>;
153
+ fetched_from: z.ZodOptional<z.ZodURL>;
154
+ version: z.ZodEnum<{
155
+ accepted: "accepted";
156
+ published: "published";
157
+ preprint: "preprint";
158
+ }>;
159
+ url: z.ZodURL;
160
+ licence: z.ZodPipe<z.ZodObject<{
161
+ id: z.ZodString;
162
+ read_from: z.ZodOptional<z.ZodURL>;
163
+ read_on: z.ZodOptional<z.ZodISODate>;
164
+ }, z.core.$strict>, z.ZodTransform<{
165
+ readonly id: typeof NOASSERTION;
166
+ } | {
167
+ readonly id: string;
168
+ readonly read_from: string;
169
+ readonly read_on: string;
170
+ }, {
171
+ id: string;
172
+ read_from?: string | undefined;
173
+ read_on?: string | undefined;
174
+ }>>;
175
+ }, z.core.$strict>, z.ZodObject<{
176
+ stored: z.ZodArray<z.ZodEnum<{
177
+ text: "text";
178
+ pdf: "pdf";
179
+ }>>;
180
+ fetched_from: z.ZodOptional<z.ZodURL>;
181
+ version: z.ZodLiteral<"unknown">;
182
+ licence: z.ZodObject<{
183
+ id: z.ZodLiteral<"NOASSERTION">;
184
+ }, z.core.$strict>;
185
+ }, z.core.$strict>], "version">>;
186
+ }, z.core.$loose>], "group">;
187
+ declare const proxy: z.ZodObject<{
188
+ what: z.ZodString;
189
+ papers: z.ZodNumber;
190
+ }, z.core.$strict>;
191
+ declare const edition: z.ZodObject<{
192
+ edition: z.ZodNumber;
193
+ listed_from: z.ZodURL;
194
+ read_on: z.ZodISODate;
195
+ accepted: z.ZodOptional<z.ZodNumber>;
196
+ capped: z.ZodNullable<z.ZodString>;
197
+ proxy: z.ZodNullable<z.ZodObject<{
198
+ what: z.ZodString;
199
+ papers: z.ZodNumber;
200
+ }, z.core.$strict>>;
201
+ }, z.core.$strict>;
202
+ declare const record: z.ZodObject<{
203
+ venue: z.ZodString;
204
+ editions: z.ZodArray<z.ZodObject<{
205
+ edition: z.ZodNumber;
206
+ listed_from: z.ZodURL;
207
+ read_on: z.ZodISODate;
208
+ accepted: z.ZodOptional<z.ZodNumber>;
209
+ capped: z.ZodNullable<z.ZodString>;
210
+ proxy: z.ZodNullable<z.ZodObject<{
211
+ what: z.ZodString;
212
+ papers: z.ZodNumber;
213
+ }, z.core.$strict>>;
214
+ }, z.core.$strict>>;
215
+ papers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
216
+ group: z.ZodEnum<{
217
+ accepted: "accepted";
218
+ award: "award";
219
+ }>;
220
+ edition: z.ZodNumber;
221
+ key: z.ZodString;
222
+ title: z.ZodString;
223
+ authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
224
+ abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ ids: z.ZodObject<{
226
+ doi: z.ZodOptional<z.ZodString>;
227
+ arxiv: z.ZodOptional<z.ZodString>;
228
+ dblp: z.ZodOptional<z.ZodString>;
229
+ s2: z.ZodOptional<z.ZodString>;
230
+ url: z.ZodOptional<z.ZodURL>;
231
+ }, z.core.$strict>;
232
+ copies: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ stored: z.ZodArray<z.ZodEnum<{
234
+ text: "text";
235
+ pdf: "pdf";
236
+ }>>;
237
+ fetched_from: z.ZodOptional<z.ZodURL>;
238
+ version: z.ZodEnum<{
239
+ accepted: "accepted";
240
+ published: "published";
241
+ preprint: "preprint";
242
+ }>;
243
+ url: z.ZodURL;
244
+ licence: z.ZodPipe<z.ZodObject<{
245
+ id: z.ZodString;
246
+ read_from: z.ZodOptional<z.ZodURL>;
247
+ read_on: z.ZodOptional<z.ZodISODate>;
248
+ }, z.core.$strict>, z.ZodTransform<{
249
+ readonly id: typeof NOASSERTION;
250
+ } | {
251
+ readonly id: string;
252
+ readonly read_from: string;
253
+ readonly read_on: string;
254
+ }, {
255
+ id: string;
256
+ read_from?: string | undefined;
257
+ read_on?: string | undefined;
258
+ }>>;
259
+ }, z.core.$strict>, z.ZodObject<{
260
+ stored: z.ZodArray<z.ZodEnum<{
261
+ text: "text";
262
+ pdf: "pdf";
263
+ }>>;
264
+ fetched_from: z.ZodOptional<z.ZodURL>;
265
+ version: z.ZodLiteral<"unknown">;
266
+ licence: z.ZodObject<{
267
+ id: z.ZodLiteral<"NOASSERTION">;
268
+ }, z.core.$strict>;
269
+ }, z.core.$strict>], "version">>;
270
+ }, z.core.$loose>, z.ZodObject<{
271
+ group: z.ZodLiteral<"sister">;
272
+ venue: z.ZodString;
273
+ year: z.ZodNumber;
274
+ listed_from: z.ZodURL;
275
+ key: z.ZodString;
276
+ title: z.ZodString;
277
+ authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
278
+ abstract: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
+ ids: z.ZodObject<{
280
+ doi: z.ZodOptional<z.ZodString>;
281
+ arxiv: z.ZodOptional<z.ZodString>;
282
+ dblp: z.ZodOptional<z.ZodString>;
283
+ s2: z.ZodOptional<z.ZodString>;
284
+ url: z.ZodOptional<z.ZodURL>;
285
+ }, z.core.$strict>;
286
+ copies: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
287
+ stored: z.ZodArray<z.ZodEnum<{
288
+ text: "text";
289
+ pdf: "pdf";
290
+ }>>;
291
+ fetched_from: z.ZodOptional<z.ZodURL>;
292
+ version: z.ZodEnum<{
293
+ accepted: "accepted";
294
+ published: "published";
295
+ preprint: "preprint";
296
+ }>;
297
+ url: z.ZodURL;
298
+ licence: z.ZodPipe<z.ZodObject<{
299
+ id: z.ZodString;
300
+ read_from: z.ZodOptional<z.ZodURL>;
301
+ read_on: z.ZodOptional<z.ZodISODate>;
302
+ }, z.core.$strict>, z.ZodTransform<{
303
+ readonly id: typeof NOASSERTION;
304
+ } | {
305
+ readonly id: string;
306
+ readonly read_from: string;
307
+ readonly read_on: string;
308
+ }, {
309
+ id: string;
310
+ read_from?: string | undefined;
311
+ read_on?: string | undefined;
312
+ }>>;
313
+ }, z.core.$strict>, z.ZodObject<{
314
+ stored: z.ZodArray<z.ZodEnum<{
315
+ text: "text";
316
+ pdf: "pdf";
317
+ }>>;
318
+ fetched_from: z.ZodOptional<z.ZodURL>;
319
+ version: z.ZodLiteral<"unknown">;
320
+ licence: z.ZodObject<{
321
+ id: z.ZodLiteral<"NOASSERTION">;
322
+ }, z.core.$strict>;
323
+ }, z.core.$strict>], "version">>;
324
+ }, z.core.$loose>], "group">>;
325
+ rebuild: z.ZodArray<z.ZodString>;
326
+ }, z.core.$strict>;
327
+ /** `T`, readonly all the way down: zod's outputs are mutable, the domain's are not. */
328
+ type Frozen<T> = T extends readonly (infer U)[] ? readonly Frozen<U>[] : T extends object ? {
329
+ readonly [K in keyof T]: Frozen<T[K]>;
330
+ } : T;
331
+ /** True when `A` and `B`, both made readonly all the way down, are one type. */
332
+ type Same<A, B> = (<T>() => T extends Frozen<A> ? readonly [T] : 2) extends <T>() => T extends Frozen<B> ? readonly [T] : 2 ? true : false;
333
+ /** Compiles only when every schema's output is its domain type. */
334
+ export type SchemasAreTheDomain = [
335
+ Same<z.output<typeof record>, VenueCorpus>,
336
+ Same<z.output<typeof edition>, Edition>,
337
+ Same<z.output<typeof proxy>, StrongAcceptProxy>,
338
+ Same<z.output<typeof paper>, Paper>,
339
+ Same<z.output<typeof copy>, Copy>,
340
+ Same<z.output<typeof licence>, Licence>,
341
+ Same<z.output<typeof ids>, PaperIds>
342
+ ] extends true[] ? true : never;
343
+ /** The proof is used, so the build checks it. */
344
+ export declare const SCHEMAS_ARE_THE_DOMAIN: SchemasAreTheDomain;
345
+ /** A `papers.json`'s text, parsed once at the boundary: the record, or every reason it is not one. */
346
+ export declare function parseVenueCorpus(text: string): ParsedCorpus;
347
+ export declare const venueCorpusCodec: VenueCorpusCodec;
348
+ /** Where the shipped JSON Schema of the record sits, below the package root: in the skill that writes it. */
349
+ export declare const SCHEMA_FILE = "skills/study-accepted-papers/papers.schema.json";
350
+ /**
351
+ * The JSON Schema of a `papers.json`, generated from the parser's own shape: the fields a skill (or
352
+ * an editor) reads instead of a hand-written table. Shipped as `SCHEMA_FILE`; a test holds the file
353
+ * to this. A schema cannot say that a key is unique, that a paper's edition is a listed one, or that
354
+ * a stored copy names where it was fetched from: `corpus-licences.js` checks those and names the
355
+ * field's path.
356
+ */
357
+ export declare const venueCorpusJsonSchema: () => unknown;
358
+ /** The shipped file's text: the schema, indented, with a closing newline. */
359
+ export declare const venueCorpusSchemaText: () => string;
360
+ export {};
361
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/adapters/venue-corpus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIL,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,QAAQ,EAEb,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE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AC,GACzC,IAAI,GACJ,KAAK,CAAC;AAEZ,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,MAAM,CAAC,EAAE,WAAW,CAAC;IAC1C,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,EAAE,OAAO,CAAC;IACvC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC/C,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,KAAK,CAAC;IACnC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,EAAE,IAAI,CAAC;IACjC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,EAAE,OAAO,CAAC;IACvC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,EAAE,QAAQ,CAAC;CACrC,SAAS,IAAI,EAAE,GACZ,IAAI,GACJ,KAAK,CAAC;AAEV,iDAAiD;AACjD,eAAO,MAAM,sBAAsB,EAAE,mBAA0B,CAAC;AAuBhE,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAQ3D;AAED,eAAO,MAAM,gBAAgB,EAAE,gBAA8C,CAAC;AAE9E,6GAA6G;AAC7G,eAAO,MAAM,WAAW,oDAAoD,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,QAAO,OAKvC,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,QAAO,MACgB,CAAC"}
@@ -0,0 +1,221 @@
1
+ /**
2
+ * The schema of a venue corpus's `papers.json` — the one place its shape is checked
3
+ * (docs/design/venue-corpus.md, decision 1). The text is parsed once, here, into the domain's
4
+ * `VenueCorpus`; whatever reads a record after it never re-validates. The study registry's pattern
5
+ * (`src/adapters/study-registry/`).
6
+ *
7
+ * The top level, an edition, a copy, a licence and a paper's ids are strict, so a misspelt key is an
8
+ * error. A paper row is loose: a consumer's scripts read their own fields from it. A licence id is
9
+ * checked for its shape only: whether the id permits anything is `src/domain/licence.ts`'s table, so
10
+ * one unlisted id does not make the record unreadable.
11
+ */
12
+ import { z } from "zod";
13
+ import { isLicenceId, NOASSERTION, STORED_KINDS, } from "../../domain/licence.js";
14
+ import { KEY_PATTERN, KNOWN_VERSIONS, PAPER_ID_KINDS, } from "../../domain/venue-corpus.js";
15
+ const words = z.string().min(1);
16
+ const date = z.iso.date();
17
+ /** Where a page or a file was read: a web address, never a local path or another scheme. */
18
+ const webUrl = z.url({
19
+ protocol: /^https?$/u,
20
+ error: "an http or https address",
21
+ });
22
+ /** The index of each value that occurs earlier in `values`, with the index of its first. */
23
+ const repeats = (values) => values.flatMap((v, i) => {
24
+ const first = values.indexOf(v);
25
+ return first === i ? [] : [[i, first]];
26
+ });
27
+ const licenceId = z
28
+ .string()
29
+ .refine(isLicenceId, "an SPDX license id or a LicenseRef-");
30
+ const notRead = z.strictObject({ id: z.literal(NOASSERTION) });
31
+ /** A licence: NOASSERTION alone, or any other id with where and when it was read. */
32
+ const licence = z
33
+ .strictObject({
34
+ id: licenceId,
35
+ read_from: webUrl.optional(),
36
+ read_on: date.optional(),
37
+ })
38
+ .transform((l, ctx) => {
39
+ const fields = ["read_from", "read_on"];
40
+ const noneRead = l.id === NOASSERTION;
41
+ const wrong = fields.filter((f) => (l[f] === undefined) !== noneRead);
42
+ wrong.forEach((f) => {
43
+ ctx.addIssue({
44
+ code: "custom",
45
+ path: [f],
46
+ message: noneRead
47
+ ? "NOASSERTION means the licence was not read"
48
+ : `a licence other than NOASSERTION names ${f === "read_from" ? "where" : "when"} it was read`,
49
+ });
50
+ });
51
+ return l.read_from === undefined || l.read_on === undefined
52
+ ? { id: NOASSERTION }
53
+ : { id: l.id, read_from: l.read_from, read_on: l.read_on };
54
+ });
55
+ const storage = {
56
+ stored: z.array(z.enum(STORED_KINDS)),
57
+ fetched_from: webUrl.optional(),
58
+ };
59
+ /** Each kind at most once, and a stored copy names where its bytes came from. */
60
+ const stores = (c, ctx) => {
61
+ repeats(c.stored).forEach(([i]) => {
62
+ ctx.addIssue({
63
+ code: "custom",
64
+ path: ["stored"],
65
+ message: `"${String(c.stored[i])}" is listed twice`,
66
+ });
67
+ });
68
+ if (c.stored.length > 0 && c.fetched_from === undefined)
69
+ ctx.addIssue({
70
+ code: "custom",
71
+ path: ["fetched_from"],
72
+ message: "a copy that stores a file names where it was fetched from",
73
+ });
74
+ };
75
+ const copy = z.discriminatedUnion("version", [
76
+ z
77
+ .strictObject({
78
+ version: z.enum(KNOWN_VERSIONS),
79
+ url: webUrl,
80
+ licence,
81
+ ...storage,
82
+ })
83
+ .superRefine(stores),
84
+ z
85
+ .strictObject({
86
+ version: z.literal("unknown"),
87
+ licence: notRead,
88
+ ...storage,
89
+ })
90
+ .superRefine(stores),
91
+ ]);
92
+ const ids = z
93
+ .strictObject({
94
+ doi: words.optional(),
95
+ arxiv: words.optional(),
96
+ dblp: words.optional(),
97
+ s2: words.optional(),
98
+ url: webUrl.optional(),
99
+ })
100
+ .refine((i) => Object.values(i).some((v) => v !== undefined), `at least one of ${PAPER_ID_KINDS.join(", ")}`);
101
+ const paperFields = {
102
+ key: z
103
+ .string()
104
+ .regex(KEY_PATTERN, "a letter or digit, then letters, digits, '_' or '-'"),
105
+ title: words,
106
+ authors: z.array(words).optional(),
107
+ abstract: z.string().nullable().optional(),
108
+ ids,
109
+ copies: z.array(copy),
110
+ };
111
+ const year = z.number().int().positive();
112
+ const paper = z.discriminatedUnion("group", [
113
+ z.looseObject({
114
+ ...paperFields,
115
+ group: z.enum(["accepted", "award"]),
116
+ edition: year,
117
+ }),
118
+ z.looseObject({
119
+ ...paperFields,
120
+ group: z.literal("sister"),
121
+ venue: words,
122
+ year,
123
+ listed_from: webUrl,
124
+ }),
125
+ ]);
126
+ const count = z.number().int().nonnegative();
127
+ const proxy = z.strictObject({ what: words, papers: count });
128
+ // `capped` and `proxy` are required, and "none" is null: a fact left out is not a fact recorded.
129
+ const edition = z.strictObject({
130
+ edition: year,
131
+ listed_from: webUrl,
132
+ read_on: date,
133
+ accepted: count.optional(),
134
+ capped: words.nullable(),
135
+ proxy: proxy.nullable(),
136
+ });
137
+ /** Keys unique, editions unique, and every paper of this venue of a listed edition. */
138
+ const consistent = (r, ctx) => {
139
+ const years = r.editions.map((e) => e.edition);
140
+ repeats(years).forEach(([i]) => {
141
+ ctx.addIssue({
142
+ code: "custom",
143
+ path: ["editions", i, "edition"],
144
+ message: `${String(years[i])} is listed twice`,
145
+ });
146
+ });
147
+ const keys = r.papers.map((p) => p.key);
148
+ repeats(keys).forEach(([i, first]) => {
149
+ ctx.addIssue({
150
+ code: "custom",
151
+ path: ["papers", i, "key"],
152
+ message: `"${String(keys[i])}" is the key of papers.${String(first)} too`,
153
+ });
154
+ });
155
+ r.papers.forEach((p, i) => {
156
+ if (p.group !== "sister" && !years.includes(p.edition))
157
+ ctx.addIssue({
158
+ code: "custom",
159
+ path: ["papers", i, "edition"],
160
+ message: `${String(p.edition)} is not one of editions[].edition (${years.join(", ")})`,
161
+ });
162
+ });
163
+ };
164
+ const record = z
165
+ .strictObject({
166
+ venue: words,
167
+ editions: z.array(edition),
168
+ papers: z.array(paper),
169
+ rebuild: z.array(words),
170
+ })
171
+ .superRefine(consistent);
172
+ /** The proof is used, so the build checks it. */
173
+ export const SCHEMAS_ARE_THE_DOMAIN = true;
174
+ /** The JSON `text` holds, or undefined when it is not JSON. */
175
+ function jsonOf(text) {
176
+ try {
177
+ return JSON.parse(text);
178
+ }
179
+ catch {
180
+ return undefined;
181
+ }
182
+ }
183
+ /**
184
+ * One zod issue as a problem. A misspelt key's path ends at the key (the first, when there are
185
+ * several), so a reader of the file lands on it rather than on the object holding it.
186
+ */
187
+ const problemOf = (i) => ({
188
+ path: [
189
+ ...i.path.filter((s) => typeof s !== "symbol"),
190
+ ...(i.code === "unrecognized_keys" ? i.keys.slice(0, 1) : []),
191
+ ],
192
+ message: i.message,
193
+ });
194
+ /** A `papers.json`'s text, parsed once at the boundary: the record, or every reason it is not one. */
195
+ export function parseVenueCorpus(text) {
196
+ const json = jsonOf(text);
197
+ if (json === undefined)
198
+ return { ok: false, problems: [{ path: [], message: "not JSON" }] };
199
+ const parsed = record.safeParse(json);
200
+ return parsed.success
201
+ ? { ok: true, corpus: parsed.data }
202
+ : { ok: false, problems: parsed.error.issues.map(problemOf) };
203
+ }
204
+ export const venueCorpusCodec = { parse: parseVenueCorpus };
205
+ /** Where the shipped JSON Schema of the record sits, below the package root: in the skill that writes it. */
206
+ export const SCHEMA_FILE = "skills/study-accepted-papers/papers.schema.json";
207
+ /**
208
+ * The JSON Schema of a `papers.json`, generated from the parser's own shape: the fields a skill (or
209
+ * an editor) reads instead of a hand-written table. Shipped as `SCHEMA_FILE`; a test holds the file
210
+ * to this. A schema cannot say that a key is unique, that a paper's edition is a listed one, or that
211
+ * a stored copy names where it was fetched from: `corpus-licences.js` checks those and names the
212
+ * field's path.
213
+ */
214
+ export const venueCorpusJsonSchema = () => ({
215
+ ...z.toJSONSchema(record, { io: "input", unrepresentable: "any" }),
216
+ title: "A venue corpus's papers.json",
217
+ description: "The record of a venue corpus, papers.json: one row per paper, every copy with its licence. This schema lists the fields; it cannot express that a key is unique, that a paper's edition is one of editions[].edition, or that a copy that stores a file names where it was fetched from. `node ${CLAUDE_SKILL_DIR}/scripts/corpus-licences.js <venue>` checks those and refuses a wrong record with the path of the field.",
218
+ });
219
+ /** The shipped file's text: the schema, indented, with a closing newline. */
220
+ export const venueCorpusSchemaText = () => `${JSON.stringify(venueCorpusJsonSchema(), null, 2)}\n`;
221
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/venue-corpus/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,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,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,4ZAA4Z;CAC/Z,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAW,EAAE,CAChD,GAAG,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC"}
package/dist/cli.d.ts CHANGED
@@ -47,7 +47,8 @@ export declare function buildConfig(opts: PaperlintConfig | undefined, texLangua
47
47
  export declare function eslintConfig(blocks: readonly ConfigBlock[]): Linter.Config[];
48
48
  /**
49
49
  * The rule ids a consumer may name in `rules`: every rule paperlint's own config defines, read off that
50
- * config rather than listed again. `@eslint/markdown` is a dependency's plugin, not paperlint's.
50
+ * config rather than listed again. `@eslint/markdown` and `@eslint/json` are a dependency's plugins,
51
+ * not paperlint's.
51
52
  */
52
53
  export declare const SHIPPED_RULES: ReadonlySet<string>;
53
54
  /** A plugin as `rulePlugins` gives it: its rules, and for `tex` the LaTeX language when given. */
@@ -59,7 +60,7 @@ export interface RulePlugin {
59
60
  * Every plugin paperlint's config registers, ONE object per name, read off that config. In it one
60
61
  * name is bound to different objects in different blocks (`paper` beside `PIPELINE-STATUS.md` is
61
62
  * not `paper` beside `paper.tex`); here their rules are merged, so a config that lints any paper
62
- * file knows every rule id. `@eslint/markdown` is a dependency's plugin and is left out. The LaTeX
63
+ * file knows every rule id. `@eslint/markdown` and `@eslint/json` are a dependency's plugins and are left out. The LaTeX
63
64
  * language rides on `tex` when `texLanguage` is given, and that is how a consumer registers it: a
64
65
  * second `tex` plugin of its own is refused by ESLint ("Cannot redefine plugin "tex"", measured
65
66
  * with and without the language here). Without it, `tex` carries rules only.
@@ -89,7 +90,7 @@ export declare function silentOptionalRules(eslint: Pick<ESLint, "calculateConfi
89
90
  * them. A file that does not parse, or names a rule paperlint does not ship, stops the run with one
90
91
  * line naming the file — the same strictness as the root's own `rules`.
91
92
  */
92
- export declare function paperRuleBlocks(paths: readonly string[]): Parsed<PaperBlocks>;
93
+ export declare function paperRuleBlocks(paths: readonly string[], roots: readonly string[]): Parsed<PaperBlocks>;
93
94
  /** One paper's blocks, in the order `lint` applies them around the root's (most general first). */
94
95
  interface PaperBlocks {
95
96
  readonly preset: readonly RuleBlock[];