paperlint 20.2.0 → 20.4.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.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/adapters/venue-corpus/index.d.ts +19 -3
- package/dist/adapters/venue-corpus/index.d.ts.map +1 -1
- package/dist/adapters/venue-corpus/index.js +36 -8
- package/dist/adapters/venue-corpus/index.js.map +1 -1
- package/dist/cli.d.ts +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +42 -13
- package/dist/cli.js.map +1 -1
- package/dist/corpus-record-rule.d.ts +65 -0
- package/dist/corpus-record-rule.d.ts.map +1 -0
- package/dist/corpus-record-rule.js +85 -0
- package/dist/corpus-record-rule.js.map +1 -0
- package/dist/domain/corpus-record.d.ts +51 -0
- package/dist/domain/corpus-record.d.ts.map +1 -0
- package/dist/domain/corpus-record.js +119 -0
- package/dist/domain/corpus-record.js.map +1 -0
- package/dist/domain/venue-corpus.d.ts +36 -5
- package/dist/domain/venue-corpus.d.ts.map +1 -1
- package/dist/domain/venue-corpus.js +20 -0
- package/dist/domain/venue-corpus.js.map +1 -1
- package/dist/paper-files.d.ts +10 -3
- package/dist/paper-files.d.ts.map +1 -1
- package/dist/paper-files.js +17 -2
- package/dist/paper-files.js.map +1 -1
- package/dist/papers-roots.d.ts +6 -0
- package/dist/papers-roots.d.ts.map +1 -1
- package/dist/papers-roots.js +14 -0
- package/dist/papers-roots.js.map +1 -1
- package/docs/design/venue-corpus.md +62 -40
- package/docs/layout.md +2 -2
- package/docs/rules/corpus/record.md +122 -0
- package/docs/rules.md +1 -0
- package/docs/venues.md +35 -20
- package/eslint.config.mjs +1 -0
- package/package.json +2 -1
- package/scripts/eslint-file-length.mjs +3 -3
- package/skills/study-accepted-papers/SKILL.md +14 -8
- package/skills/study-accepted-papers/SKILL.md.spec.ts +13 -7
- package/skills/study-accepted-papers/papers.schema.json +50 -2
- package/skills/study-accepted-papers/scripts/corpus-licences-core.js +2 -2
- package/skills/study-accepted-papers/scripts/corpus-licences-core.ts +2 -1
- package/skills/study-accepted-papers/scripts/corpus-licences.js +39 -10
- package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +5 -1
- package/src/adapters/venue-corpus/index.test.ts +81 -55
- package/src/adapters/venue-corpus/index.ts +42 -9
- package/src/adapters/venue-corpus/schema.test.ts +47 -0
- package/src/cli-e2e.test.mjs +2 -2
- package/src/cli.test.ts +1 -1
- package/src/cli.ts +57 -13
- package/src/corpus-record-rule.test.ts +229 -0
- package/src/corpus-record-rule.ts +175 -0
- package/src/domain/corpus-record.test.ts +163 -0
- package/src/domain/corpus-record.ts +210 -0
- package/src/domain/venue-corpus.test.ts +85 -0
- package/src/domain/venue-corpus.ts +59 -5
- package/src/paper-files.test.ts +13 -4
- package/src/paper-files.ts +23 -2
- package/src/paper-settings-commands.test.ts +2 -2
- package/src/papers-roots.test.ts +34 -1
- package/src/papers-roots.ts +15 -0
- package/src/rule-cases.test.ts +15 -0
- package/src/settled-paper.test.ts +1 -1
- package/src/unowned-file.test.ts +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `corpus/record`'s judgement of one venue corpus (docs/design/venue-corpus.md, decisions 4–6;
|
|
3
|
+
* docs/rules/corpus/record.md): whether every copy stored in `pdf/` and `text/` is accounted for by
|
|
4
|
+
* `papers.json`. Pure: the folder's listing and the record, already parsed by the codec, in; the
|
|
5
|
+
* findings out. What the record's fields mean is `venue-corpus.ts`; this file never re-checks them.
|
|
6
|
+
*
|
|
7
|
+
* A stored file's path follows from its paper's `key` (decision 5): `pdf/<key>.pdf`,
|
|
8
|
+
* `text/<key>.txt` and `text/<key>.<variant>.txt`. The folder is named after the kind it holds.
|
|
9
|
+
*/
|
|
10
|
+
import { STORED_KINDS } from "./licence.js";
|
|
11
|
+
import { CORPUS_RECORD, KEY_PATTERN, pathText, } from "./venue-corpus.js";
|
|
12
|
+
/** The folder in a papers root that holds one corpus per venue. */
|
|
13
|
+
export const CORPORA_DIR = "venues";
|
|
14
|
+
const keyOrNull = (key) => KEY_PATTERN.test(key) ? key : null;
|
|
15
|
+
/** The key a stored file's name belongs to, or null when the name is not one a copy can store. */
|
|
16
|
+
export function storedKey(kind, name) {
|
|
17
|
+
switch (kind) {
|
|
18
|
+
case "pdf":
|
|
19
|
+
return name.endsWith(".pdf") ? keyOrNull(name.slice(0, -4)) : null;
|
|
20
|
+
case "text": {
|
|
21
|
+
if (!name.endsWith(".txt"))
|
|
22
|
+
return null;
|
|
23
|
+
const [key = "", ...variant] = name.slice(0, -4).split(".");
|
|
24
|
+
return variant.length > 0 && variant.join(".") === ""
|
|
25
|
+
? null
|
|
26
|
+
: keyOrNull(key);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** The extension of a stored kind's file. */
|
|
31
|
+
const EXTENSION = {
|
|
32
|
+
pdf: "pdf",
|
|
33
|
+
text: "txt",
|
|
34
|
+
};
|
|
35
|
+
/** The name the record expects a paper's stored kind under, for a message. */
|
|
36
|
+
const expectedFile = (kind, key) => `${kind}/${key}.${EXTENSION[kind]}`;
|
|
37
|
+
/** The indexes of `p`'s copies that store `kind`. */
|
|
38
|
+
const storing = (p, kind) => p.copies.flatMap((c, i) => (c.stored.includes(kind) ? [i] : []));
|
|
39
|
+
/** The `stored` of a paper's copy (`copy` holds its index), as a path. */
|
|
40
|
+
const storedAt = (paper, copy) => [
|
|
41
|
+
"papers",
|
|
42
|
+
paper,
|
|
43
|
+
"copies",
|
|
44
|
+
...copy,
|
|
45
|
+
"stored",
|
|
46
|
+
];
|
|
47
|
+
/** A paper's kind stored by more than one of its copies, reported at the second one. */
|
|
48
|
+
const twice = (claims) => claims
|
|
49
|
+
.filter((c) => c.copies.length > 1)
|
|
50
|
+
.map((c) => ({
|
|
51
|
+
kind: "twice",
|
|
52
|
+
at: storedAt(c.paper, c.copies.slice(1, 2)),
|
|
53
|
+
key: c.key,
|
|
54
|
+
stored: c.kind,
|
|
55
|
+
copies: c.copies,
|
|
56
|
+
}));
|
|
57
|
+
/** A stored file no copy claims: at its paper's copies when the record lists the paper, else on the file. */
|
|
58
|
+
const unclaimed = (claims, stored) => STORED_KINDS.flatMap((kind) => stored[kind]
|
|
59
|
+
.map((name) => ({ name, key: storedKey(kind, name) }))
|
|
60
|
+
.filter((f) => !claims.some((c) => c.kind === kind && c.key === f.key && c.copies.length > 0))
|
|
61
|
+
.map((f) => ({
|
|
62
|
+
kind: "unclaimed",
|
|
63
|
+
at: atPaper(claims, f.key),
|
|
64
|
+
file: `${kind}/${f.name}`,
|
|
65
|
+
key: f.key,
|
|
66
|
+
})));
|
|
67
|
+
/** The copies of the paper `key` names, as a path; the whole file when no paper has that key. */
|
|
68
|
+
const atPaper = (claims, key) => {
|
|
69
|
+
const claim = claims.find((c) => c.key === key);
|
|
70
|
+
return claim === undefined ? [] : ["papers", claim.paper, "copies"];
|
|
71
|
+
};
|
|
72
|
+
/** A claimed kind with no file of its paper's key. */
|
|
73
|
+
const missing = (claims, stored) => claims
|
|
74
|
+
.filter((c) => c.copies.length > 0 &&
|
|
75
|
+
!stored[c.kind].some((name) => storedKey(c.kind, name) === c.key))
|
|
76
|
+
.map((c) => ({
|
|
77
|
+
kind: "missing",
|
|
78
|
+
at: storedAt(c.paper, c.copies.slice(0, 1)),
|
|
79
|
+
key: c.key,
|
|
80
|
+
stored: c.kind,
|
|
81
|
+
file: expectedFile(c.kind, c.key),
|
|
82
|
+
}));
|
|
83
|
+
/** What a read record says about the folder. */
|
|
84
|
+
function judgeRecord(corpus, stored) {
|
|
85
|
+
const claims = STORED_KINDS.flatMap((kind) => corpus.papers.map((p, paper) => ({
|
|
86
|
+
kind,
|
|
87
|
+
key: p.key,
|
|
88
|
+
paper,
|
|
89
|
+
copies: storing(p, kind),
|
|
90
|
+
})));
|
|
91
|
+
return [
|
|
92
|
+
...twice(claims),
|
|
93
|
+
...unclaimed(claims, stored),
|
|
94
|
+
...missing(claims, stored),
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
/** Every finding about one corpus folder; none for a corpus whose record accounts for each copy. */
|
|
98
|
+
export const judgeCorpus = (folder) => folder.record.ok
|
|
99
|
+
? judgeRecord(folder.record.corpus, folder.stored)
|
|
100
|
+
: folder.record.problems.map((p) => ({
|
|
101
|
+
kind: "unparsed",
|
|
102
|
+
at: p.path,
|
|
103
|
+
message: p.message,
|
|
104
|
+
}));
|
|
105
|
+
const KEEP_IDS = "or remove the file and keep the paper's ids in `papers.json`, which is all a corpus needs to measure against it";
|
|
106
|
+
/** The text of a finding: what is wrong, then what to do. */
|
|
107
|
+
export function corpusMessage(f) {
|
|
108
|
+
switch (f.kind) {
|
|
109
|
+
case "unparsed":
|
|
110
|
+
return `\`${pathText(f.at)}\`: ${f.message}. What to do: correct the field; the fields are in the JSON Schema \`papers.schema.json\` that \`study-accepted-papers\` ships`;
|
|
111
|
+
case "unclaimed":
|
|
112
|
+
return `\`${f.file}\` is stored, and no copy in \`${CORPUS_RECORD}\` claims it${f.key === null ? `: its name is not \`pdf/<key>.pdf\`, \`text/<key>.txt\` or \`text/<key>.<variant>.txt\`` : ` (no copy of the paper \`${f.key}\` lists it in \`stored\`)`}. What to do: record it under the copy it was fetched from, with \`fetched_from\`, its licence and where the licence was read; ${KEEP_IDS}`;
|
|
113
|
+
case "missing":
|
|
114
|
+
return `a copy of \`${f.key}\` stores \`${f.stored}\` in \`${CORPUS_RECORD}\`, and \`${f.file}\` is not there. What to do: put the file back, or remove \`"${f.stored}"\` from that copy's \`stored\``;
|
|
115
|
+
case "twice":
|
|
116
|
+
return `copies ${f.copies.join(" and ")} of \`${f.key}\` both store \`${f.stored}\`, and one stored file is a copy of one version. What to do: keep \`"${f.stored}"\` in the \`stored\` of the copy the file was fetched from, and remove it from the other`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=corpus-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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venue-corpus.md,
|
|
3
3
|
* decision 1; docs/venues.md): the papers a venue accepted and, for each, every copy we know of with
|
|
4
|
-
* its licence
|
|
5
|
-
*
|
|
4
|
+
* its licence, and the facts of how the corpus was collected. Codes and measurements stay in
|
|
5
|
+
* `measurements.json`, keyed by a paper's `key`; only caveats stay prose, in an optional `MANIFEST.md`.
|
|
6
6
|
*
|
|
7
7
|
* The text of the file is checked once, where it enters: `VenueCorpusCodec`
|
|
8
8
|
* (`src/ports/venue-corpus-codec.ts`), whose adapter holds the zod schema of this shape. The domain
|
|
@@ -35,8 +35,20 @@ export interface Edition {
|
|
|
35
35
|
/** The page that lists what the edition accepted. */
|
|
36
36
|
readonly listed_from: string;
|
|
37
37
|
readonly read_on: string;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* How many it accepted: the rows of the page that lists them. Without `capped` the corpus lists
|
|
40
|
+
* exactly this many of the edition's papers; with it, at most this many.
|
|
41
|
+
*/
|
|
42
|
+
readonly accepted: number;
|
|
43
|
+
/** What was left out of the edition and why; null when nothing was (never left out). */
|
|
44
|
+
readonly capped: string | null;
|
|
45
|
+
/** The stand-in for "strong accept" in this edition; null when it has none. */
|
|
46
|
+
readonly proxy: StrongAcceptProxy | null;
|
|
47
|
+
}
|
|
48
|
+
/** What stands in for "strong accept" (an award, an oral slot), and how many papers it marks. */
|
|
49
|
+
export interface StrongAcceptProxy {
|
|
50
|
+
readonly what: string;
|
|
51
|
+
readonly papers: number;
|
|
40
52
|
}
|
|
41
53
|
/** A licence read from a source, or `NOASSERTION`: none was read. */
|
|
42
54
|
export type Licence = {
|
|
@@ -107,6 +119,15 @@ export interface VenueCorpus {
|
|
|
107
119
|
readonly venue: string;
|
|
108
120
|
readonly editions: readonly Edition[];
|
|
109
121
|
readonly papers: readonly Paper[];
|
|
122
|
+
/** The commands that regenerate the corpus, in order; empty when none was kept. */
|
|
123
|
+
readonly rebuild: readonly string[];
|
|
124
|
+
}
|
|
125
|
+
/** Where in a `papers.json` a problem is: keys and indexes from the top; empty for the whole file. */
|
|
126
|
+
export type RecordPath = readonly (string | number)[];
|
|
127
|
+
/** One reason a `papers.json` is not a record. */
|
|
128
|
+
export interface CorpusProblem {
|
|
129
|
+
readonly path: RecordPath;
|
|
130
|
+
readonly message: string;
|
|
110
131
|
}
|
|
111
132
|
/** A `papers.json`'s text, parsed: the record, or every reason it is not one. */
|
|
112
133
|
export type ParsedCorpus = {
|
|
@@ -114,7 +135,17 @@ export type ParsedCorpus = {
|
|
|
114
135
|
readonly corpus: VenueCorpus;
|
|
115
136
|
} | {
|
|
116
137
|
readonly ok: false;
|
|
117
|
-
readonly
|
|
138
|
+
readonly problems: readonly CorpusProblem[];
|
|
118
139
|
};
|
|
140
|
+
/** A path as a message names it: `papers.0.copies`, or `(top)` for the whole file. */
|
|
141
|
+
export declare const pathText: (path: RecordPath) => string;
|
|
142
|
+
/** Every problem on one line, each with its path. */
|
|
143
|
+
export declare const problemsText: (problems: readonly CorpusProblem[]) => string;
|
|
144
|
+
/**
|
|
145
|
+
* What an edition lists against what it accepted, or null when they agree: without `capped` its
|
|
146
|
+
* papers (`accepted` and `award` rows; a `sister` is another venue's) number exactly `accepted`,
|
|
147
|
+
* with `capped` at most that many.
|
|
148
|
+
*/
|
|
149
|
+
export declare const editionCountIssue: (edition: Readonly<Edition>, papers: readonly Paper[]) => string | null;
|
|
119
150
|
export {};
|
|
120
151
|
//# sourceMappingURL=venue-corpus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"venue-corpus.d.ts","sourceRoot":"","sources":["../../src/domain/venue-corpus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE5D,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAE3C,8FAA8F;AAC9F,eAAO,MAAM,YAAY,0CAA2C,CAAC;AACrE,MAAM,MAAM,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AC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IAClC,mFAAmF;IACnF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,sGAAsG;AACtG,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAEtD,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,iFAAiF;AACjF,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAA;CAAE,CAAC;AAExE,sFAAsF;AACtF,eAAO,MAAM,QAAQ,GAAI,MAAM,UAAU,KAAG,MACE,CAAC;AAE/C,qDAAqD;AACrD,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,aAAa,EAAE,KAAG,MAC0B,CAAC;AAE7F;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,QAAQ,CAAC,OAAO,CAAC,EAC1B,QAAQ,SAAS,KAAK,EAAE,KACvB,MAAM,GAAG,IAYX,CAAC"}
|
|
@@ -10,4 +10,24 @@ export const PAPER_ID_KINDS = ["doi", "arxiv", "dblp", "s2", "url"];
|
|
|
10
10
|
* no dot, because `text/<key>.<variant>.txt` is read up to the first dot. An arXiv id goes in `ids`.
|
|
11
11
|
*/
|
|
12
12
|
export const KEY_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/u;
|
|
13
|
+
/** A path as a message names it: `papers.0.copies`, or `(top)` for the whole file. */
|
|
14
|
+
export const pathText = (path) => path.length === 0 ? "(top)" : path.join(".");
|
|
15
|
+
/** Every problem on one line, each with its path. */
|
|
16
|
+
export const problemsText = (problems) => `${CORPUS_RECORD}: ${problems.map((p) => `${pathText(p.path)}: ${p.message}`).join("; ")}`;
|
|
17
|
+
/**
|
|
18
|
+
* What an edition lists against what it accepted, or null when they agree: without `capped` its
|
|
19
|
+
* papers (`accepted` and `award` rows; a `sister` is another venue's) number exactly `accepted`,
|
|
20
|
+
* with `capped` at most that many.
|
|
21
|
+
*/
|
|
22
|
+
export const editionCountIssue = (edition, papers) => {
|
|
23
|
+
const listed = papers.filter((p) => p.group !== "sister" && p.edition === edition.edition).length;
|
|
24
|
+
const tally = `${String(listed)} papers of ${String(edition.edition)} are listed`;
|
|
25
|
+
if (edition.capped === null)
|
|
26
|
+
return listed === edition.accepted
|
|
27
|
+
? null
|
|
28
|
+
: `${tally} and ${String(edition.accepted)} were accepted: list them all, or say in capped what was left out`;
|
|
29
|
+
return listed > edition.accepted
|
|
30
|
+
? `${tally}, more than the ${String(edition.accepted)} it accepted`
|
|
31
|
+
: null;
|
|
32
|
+
};
|
|
13
33
|
//# sourceMappingURL=venue-corpus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"venue-corpus.js","sourceRoot":"","sources":["../../src/domain/venue-corpus.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;AAE3C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAGrE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAG7E,oGAAoG;AACpG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,E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AAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAC7D,CAAC,MAAM,CAAC;IACT,MAAM,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;IAClF,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI;QACzB,OAAO,MAAM,KAAK,OAAO,CAAC,QAAQ;YAChC,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,GAAG,KAAK,QAAQ,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,mEAAmE,CAAC;IAClH,OAAO,MAAM,GAAG,OAAO,CAAC,QAAQ;QAC9B,CAAC,CAAC,GAAG,KAAK,mBAAmB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc;QACnE,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC"}
|
package/dist/paper-files.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import type { ConfigBlock, RuleBlock, RuleEntry, StageLinterOptions } from "./ru
|
|
|
3
3
|
* Which papers' own files paperlint's blocks claim. `any` is the config's SHAPE, for the rule list and
|
|
4
4
|
* the docs: a file in any folder. `papers` is what `paperlint lint` runs on: the real papers, as glob
|
|
5
5
|
* prefixes relative to ESLint's `cwd` ("" for `cwd` itself), so a copy of a paper kept inside one (a
|
|
6
|
-
* review snapshot, a build copy) is claimed by no block (#582)
|
|
6
|
+
* review snapshot, a build copy) is claimed by no block (#582); and the papers roots (absolute),
|
|
7
|
+
* whose `venues/` hold the venue corpora.
|
|
7
8
|
*/
|
|
8
9
|
export type PaperScope = {
|
|
9
10
|
readonly kind: "any";
|
|
@@ -11,12 +12,18 @@ export type PaperScope = {
|
|
|
11
12
|
readonly kind: "papers";
|
|
12
13
|
readonly cwd: string;
|
|
13
14
|
readonly prefixes: readonly string[];
|
|
15
|
+
readonly roots: readonly string[];
|
|
14
16
|
};
|
|
15
17
|
export declare const ANY_PAPER: PaperScope;
|
|
16
|
-
/** The papers `dirs` under ESLint's `cwd`: the scope `paperlint lint` lints. Pure. */
|
|
17
|
-
export declare const papersScope: (dirs: readonly string[], cwd: string) => PaperScope;
|
|
18
|
+
/** The papers `dirs` and the papers `roots` under ESLint's `cwd`: the scope `paperlint lint` lints. Pure. */
|
|
19
|
+
export declare const papersScope: (dirs: readonly string[], cwd: string, roots: readonly string[]) => PaperScope;
|
|
18
20
|
/** A glob of a paper's own file (`paper.tex`, `reviews/*.md`) in each paper of `scope`. Pure. */
|
|
19
21
|
export declare const paperFiles: (scope: PaperScope, glob: string) => readonly string[];
|
|
22
|
+
/**
|
|
23
|
+
* A glob of a file in each venue corpus, `<papers-root>/venues/<venue>/<glob>`; none for a root
|
|
24
|
+
* outside ESLint's `cwd`, whose files ESLint never lints. Pure.
|
|
25
|
+
*/
|
|
26
|
+
export declare const corpusFiles: (scope: PaperScope, glob: string) => readonly string[];
|
|
20
27
|
/**
|
|
21
28
|
* A glob relative to `cwd`, as the block whose `basePath` is `base` must write it — ESLint reads a
|
|
22
29
|
* block's patterns from its `basePath`, and a paper's own settings carry the paper's folder. None
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paper-files.d.ts","sourceRoot":"","sources":["../src/paper-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paper-files.d.ts","sourceRoot":"","sources":["../src/paper-files.ts"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,GACxB;IACE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,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AAC,CAAC,CAAC;CACrD;AA0BD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,WAAW,EAAE,GAAG,UAAU,EAAE,CAQrE;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,GAAG,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CAEnE;AAKD,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;CAC5B,CASA;AAQD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,SAAS,WAAW,EAAE,GAC1B,GAAG,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,CAYpC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,EAClD,MAAM,GAAE,UAAsB,GAC7B,WAAW,EAAE,CAkBf"}
|
package/dist/paper-files.js
CHANGED
|
@@ -41,21 +41,36 @@
|
|
|
41
41
|
* - `files: [["a", "b"]]` matches a file only when BOTH patterns match.
|
|
42
42
|
*/
|
|
43
43
|
import { relative, sep } from "node:path";
|
|
44
|
+
import { CORPORA_DIR } from "./domain/corpus-record.js";
|
|
44
45
|
export const ANY_PAPER = { kind: "any" };
|
|
45
46
|
/** The characters a glob reads as syntax, escaped so a folder's name matches only itself. Pure. */
|
|
46
47
|
const literalGlob = (path) => path.replace(/[\\*?[\]{}()!+@]/gu, "\\$&");
|
|
47
48
|
/** `to` relative to `from`, `/`-separated. Pure. */
|
|
48
49
|
const posixRelative = (from, to) => relative(from, to).split(sep).join("/");
|
|
49
|
-
/** The papers `dirs` under ESLint's `cwd`: the scope `paperlint lint` lints. Pure. */
|
|
50
|
-
export const papersScope = (dirs, cwd) => ({
|
|
50
|
+
/** The papers `dirs` and the papers `roots` under ESLint's `cwd`: the scope `paperlint lint` lints. Pure. */
|
|
51
|
+
export const papersScope = (dirs, cwd, roots) => ({
|
|
51
52
|
kind: "papers",
|
|
52
53
|
cwd,
|
|
53
54
|
prefixes: dirs.map((d) => literalGlob(posixRelative(cwd, d))),
|
|
55
|
+
roots,
|
|
54
56
|
});
|
|
55
57
|
/** A glob of a paper's own file (`paper.tex`, `reviews/*.md`) in each paper of `scope`. Pure. */
|
|
56
58
|
export const paperFiles = (scope, glob) => scope.kind === "any"
|
|
57
59
|
? [`**/${glob}`]
|
|
58
60
|
: scope.prefixes.map((p) => (p === "" ? glob : `${p}/${glob}`));
|
|
61
|
+
/**
|
|
62
|
+
* A glob of a file in each venue corpus, `<papers-root>/venues/<venue>/<glob>`; none for a root
|
|
63
|
+
* outside ESLint's `cwd`, whose files ESLint never lints. Pure.
|
|
64
|
+
*/
|
|
65
|
+
export const corpusFiles = (scope, glob) => {
|
|
66
|
+
const inCorpus = `${CORPORA_DIR}/*/${glob}`;
|
|
67
|
+
if (scope.kind === "any")
|
|
68
|
+
return [`**/${inCorpus}`];
|
|
69
|
+
return scope.roots
|
|
70
|
+
.map((r) => posixRelative(scope.cwd, r))
|
|
71
|
+
.filter((r) => r !== ".." && !r.startsWith("../"))
|
|
72
|
+
.map((r) => (r === "" ? inCorpus : `${literalGlob(r)}/${inCorpus}`));
|
|
73
|
+
};
|
|
59
74
|
/**
|
|
60
75
|
* A glob relative to `cwd`, as the block whose `basePath` is `base` must write it — ESLint reads a
|
|
61
76
|
* block's patterns from its `basePath`, and a paper's own settings carry the paper's folder. None
|
package/dist/paper-files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paper-files.js","sourceRoot":"","sources":["../src/paper-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;
|
|
1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IAE1C,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,MAAM,KAAK,GAA0B,KAAK,CAAC,KAAK;QAC9C,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;IAChB,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7D,OAAO;QACL;YACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK;YACL,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,KAAK;SACN;KACF,CAAC;AACJ,CAAC"}
|
package/dist/papers-roots.d.ts
CHANGED
|
@@ -16,4 +16,10 @@ export declare const papersRoots: (cfg: {
|
|
|
16
16
|
* when it is under none of them. `file` must be absolute; so must the roots (`papersRoots`).
|
|
17
17
|
*/
|
|
18
18
|
export declare function segmentsUnder(file: string, roots: readonly string[]): readonly string[] | null;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the absolute folder `dir` is a venue corpus of one of `roots`, or inside one:
|
|
21
|
+
* `<root>/venues/<venue>/` and below. A paper found there is an accepted paper's source kept in the
|
|
22
|
+
* corpus, not one of the project's papers (#215), so no paper rule judges it.
|
|
23
|
+
*/
|
|
24
|
+
export declare function inCorpus(dir: string, roots: readonly string[]): boolean;
|
|
19
25
|
//# sourceMappingURL=papers-roots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"papers-roots.d.ts","sourceRoot":"","sources":["../src/papers-roots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"papers-roots.d.ts","sourceRoot":"","sources":["../src/papers-roots.ts"],"names":[],"mappings":"AAeA,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAG3E;AAED,gGAAgG;AAChG,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAO1D;AAED,4FAA4F;AAC5F,eAAO,MAAM,WAAW,GAAI,KAAK;IAC/B,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,KAAG,SAAS,MAAM,EACkD,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,SAAS,MAAM,EAAE,GAAG,IAAI,CAW1B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAOvE"}
|
package/dist/papers-roots.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
13
13
|
import { DEFAULT_PAPERS_ROOT } from "#lib/paper-config";
|
|
14
|
+
import { CORPORA_DIR } from "./domain/corpus-record.js";
|
|
14
15
|
/** The papers directory field of the settings, read by its one declared name; the default when absent. */
|
|
15
16
|
export function papersDirOf(opts) {
|
|
16
17
|
const declared = opts.papersDir;
|
|
@@ -39,4 +40,17 @@ export function segmentsUnder(file, roots) {
|
|
|
39
40
|
!isAbsolute(rel));
|
|
40
41
|
return below === undefined ? null : below.split(sep);
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Whether the absolute folder `dir` is a venue corpus of one of `roots`, or inside one:
|
|
45
|
+
* `<root>/venues/<venue>/` and below. A paper found there is an accepted paper's source kept in the
|
|
46
|
+
* corpus, not one of the project's papers (#215), so no paper rule judges it.
|
|
47
|
+
*/
|
|
48
|
+
export function inCorpus(dir, roots) {
|
|
49
|
+
// Each root on its own: roots may overlap (`.` and `papers`), and the first that holds `dir` need
|
|
50
|
+
// not be the one whose `venues/` it is in.
|
|
51
|
+
return roots.some((root) => {
|
|
52
|
+
const [first, venue] = segmentsUnder(dir, [root]) ?? [];
|
|
53
|
+
return first === CORPORA_DIR && venue !== undefined;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
42
56
|
//# sourceMappingURL=papers-roots.js.map
|
package/dist/papers-roots.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"papers-roots.js","sourceRoot":"","sources":["../src/papers-roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,0GAA0G;AAC1G,MAAM,UAAU,WAAW,CAAC,IAAsC;IAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;IAChC,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjE,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,OAAO,CAAC,MAAe;IACrC,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,IAAI,EAA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AAG,EAAE,EAAE,CACN,GAAG,KAAK,EAAE;QACV,GAAG,KAAK,IAAI;QACZ,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;QAC3B,CAAC,UAAU,CAAC,GAAG,CAAC,CACnB,CAAC;IACJ,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,KAAwB;IAC5D,kGAAkG;IAClG,2CAA2C;IAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QACxD,OAAO,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,SAAS,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -14,11 +14,23 @@ pull requests that follow. It is the base for #302, #568, #356, #500, #215, #608
|
|
|
14
14
|
|
|
15
15
|
## What is decided
|
|
16
16
|
|
|
17
|
-
1. **One record, `papers.json`, JSON with a schema
|
|
18
|
-
|
|
19
|
-
is checked where the file is read; nothing after it
|
|
20
|
-
[`study-registry.md`](study-registry.md)). Codes and
|
|
21
|
-
|
|
17
|
+
1. **One record, `papers.json`, JSON with a schema.** It is the list of papers and, for each, every copy
|
|
18
|
+
we know of with its licence, and it holds every fact about how the corpus was collected. The schema
|
|
19
|
+
(zod, in `src/adapters/venue-corpus/`) is checked where the file is read; nothing after it
|
|
20
|
+
re-validates (the study registry's pattern, [`study-registry.md`](study-registry.md)). Codes and
|
|
21
|
+
measurements stay in `measurements.json`, keyed by the paper's `key`.
|
|
22
|
+
|
|
23
|
+
**Why the collection facts are in the record, not in a prose `MANIFEST.md`.** Read against the four real manifests of the consumer (52 to 86
|
|
24
|
+
lines each), three of their four parts were records: a hand-kept table of the folder's files (it
|
|
25
|
+
drifts from the disk), coverage counts (computable from `papers.json`), and the sources, years,
|
|
26
|
+
proxy and rebuild commands (fields). Only the caveats were prose. So the facts move into the record:
|
|
27
|
+
an edition already carries `listed_from`, `read_on` and `accepted`; it gains `capped` (what was left
|
|
28
|
+
out and why, or null) and `proxy` (the stand-in for "strong accept" and how many papers it marks, or
|
|
29
|
+
null), and the record gains `rebuild` (the commands that regenerate it). All three are required:
|
|
30
|
+
"none" is written as `null` or `[]`, never left out, so a fact not recorded cannot pass for "nothing
|
|
31
|
+
capped" (decided by the author 2026-11-24; no `papers.json` existed yet to keep valid). Coverage is
|
|
32
|
+
never stored: it is counted from the rows. `MANIFEST.md` becomes optional and holds caveats only;
|
|
33
|
+
no rule reads it.
|
|
22
34
|
|
|
23
35
|
```json
|
|
24
36
|
{
|
|
@@ -28,7 +40,9 @@ pull requests that follow. It is the base for #302, #568, #356, #500, #215, #608
|
|
|
28
40
|
"edition": 2026,
|
|
29
41
|
"listed_from": "https://conf.researchr.org/home/icse-2026/agent-2026",
|
|
30
42
|
"read_on": "2026-11-03",
|
|
31
|
-
"accepted": 27
|
|
43
|
+
"accepted": 27,
|
|
44
|
+
"capped": null,
|
|
45
|
+
"proxy": null
|
|
32
46
|
}
|
|
33
47
|
],
|
|
34
48
|
"papers": [
|
|
@@ -58,23 +72,28 @@ pull requests that follow. It is the base for #302, #568, #356, #500, #215, #608
|
|
|
58
72
|
}
|
|
59
73
|
]
|
|
60
74
|
}
|
|
61
|
-
]
|
|
75
|
+
],
|
|
76
|
+
"rebuild": []
|
|
62
77
|
}
|
|
63
78
|
```
|
|
64
79
|
|
|
65
|
-
| field | values
|
|
66
|
-
| ------------------------- |
|
|
67
|
-
| `venue` | the corpus folder's name, which is the venue preset's series: the preset id without its year (`agent` for `paperlint:agent-2027`)
|
|
68
|
-
| `editions[]` | each edition of THIS venue the corpus covers: the year, the page that lists what it accepted, the date read; `accepted
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `papers[].
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
80
|
+
| field | values |
|
|
81
|
+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `venue` | the corpus folder's name, which is the venue preset's series: the preset id without its year (`agent` for `paperlint:agent-2027`) |
|
|
83
|
+
| `editions[]` | each edition of THIS venue the corpus covers: the year, the page that lists what it accepted, the date read; `accepted`, the count of that page's rows (required) |
|
|
84
|
+
| `editions[].capped` | what was left out of the edition and why (`"the research track only, 100 of 312"`), or `null` |
|
|
85
|
+
| `editions[].accepted` | without `capped`, exactly this many of the edition's papers are listed (`accepted` and `award` rows, not `sister`); with `capped`, at most this many |
|
|
86
|
+
| `editions[].proxy` | `{ "what", "papers" }`: the stand-in for "strong accept" and how many papers it marks, or `null` |
|
|
87
|
+
| `rebuild` | the commands that regenerate the corpus, in order; `[]` when none was kept |
|
|
88
|
+
| `papers[].key` | unique in the file; names the stored files and the measurement rows |
|
|
89
|
+
| `papers[].group` | `accepted`, `award`, or `sister` (corpus 2: papers of another venue) |
|
|
90
|
+
| `papers[].edition` | for `accepted` and `award`: one of `editions[].edition` |
|
|
91
|
+
| `papers[].venue`, `.year` | for `sister`: the other venue and its year; `listed_from` on the row says where it was found |
|
|
92
|
+
| `papers[].ids` | any of `doi`, `arxiv`, `dblp`, `s2`, `url` (the paper's page on the listing, when nothing else identifies it); at least one |
|
|
93
|
+
| `copies[].version` | `published`, `accepted`, `preprint` (OpenAlex's `publishedVersion` / `acceptedVersion` / `submittedVersion`), or `unknown` |
|
|
94
|
+
| `copies[].licence` | `id`, `read_from` (the page or API response it was read from, never inferred), `read_on` |
|
|
95
|
+
| `copies[].fetched_from` | required when `stored` is not empty: the URL the stored bytes were downloaded from |
|
|
96
|
+
| `copies[].stored` | what of this copy is in the corpus: `[]`, `["text"]`, `["pdf"]` or both; `"text"` covers every text variant of the paper |
|
|
78
97
|
|
|
79
98
|
The top level, the edition, the copy and the licence objects are strict, so a misspelt key is an error.
|
|
80
99
|
A paper row keeps any further fields as they are: the consumer's scripts read about forty of them
|
|
@@ -118,11 +137,11 @@ pull requests that follow. It is the base for #302, #568, #356, #500, #215, #608
|
|
|
118
137
|
projects: every corpus needs its structure held, and only a corpus that others can read needs its
|
|
119
138
|
licences judged.
|
|
120
139
|
|
|
121
|
-
| rule | reports
|
|
122
|
-
| --------------------------- |
|
|
123
|
-
| `corpus/allowed-files-only` | a name in the corpus folder outside the fixed names (decision 5), any extension, plus names the settings add (#500's second rule, renamed from `venue/allowed-files-only`)
|
|
124
|
-
| `corpus/record` | a
|
|
125
|
-
| `corpus/licence` | a stored file whose copy has no licence recorded (`NOASSERTION`, decided by the author 2026-11-24), or whose licence does not permit that kind (decision 3), including an id outside the table and an NC licence in a project not declared non-commercial
|
|
140
|
+
| rule | reports | default |
|
|
141
|
+
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |
|
|
142
|
+
| `corpus/allowed-files-only` | a name in the corpus folder outside the fixed names (decision 5), any extension, plus names the settings add (#500's second rule, renamed from `venue/allowed-files-only`); a corpus with `pdf/` or `text/` and no `papers.json` | on |
|
|
143
|
+
| `corpus/record` | a field of `papers.json` that breaks the schema, at that field; a file in `pdf/` or `text/` that no copy's `stored` claims; a copy whose `stored` names a missing file; two copies of one paper storing one kind (a file that is not JSON is ESLint's parse error) | on |
|
|
144
|
+
| `corpus/licence` | a stored file whose copy has no licence recorded (`NOASSERTION`, decided by the author 2026-11-24), or whose licence does not permit that kind (decision 3), including an id outside the table and an NC licence in a project not declared non-commercial | off, in no set |
|
|
126
145
|
|
|
127
146
|
Each finding names its cure: record the licence and where it was read, or remove the file and keep
|
|
128
147
|
the ids.
|
|
@@ -140,14 +159,16 @@ pull requests that follow. It is the base for #302, #568, #356, #500, #215, #608
|
|
|
140
159
|
|
|
141
160
|
**Where they report, and how paperlint reaches a corpus.** Today nothing under `venues/` is linted
|
|
142
161
|
([`docs/venues.md`](../venues.md#what-checks-it)): rule blocks are scoped to paper files, and a rule
|
|
143
|
-
runs only for a file that exists.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
the
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
runs only for a file that exists. `papers.json` is that file: paperlint lints it with ESLint's own
|
|
163
|
+
JSON language (`@eslint/json`), so `corpus/record` reports at the field that is wrong, by line and
|
|
164
|
+
column, and a file that is not JSON fails as ESLint's parse error (spike 2026-11-24, `@eslint/json`
|
|
165
|
+
2.1.1 on ESLint 10.10.0: a planted `"licence": 7` reported at `4:45`; a clean record silent; a cut-off
|
|
166
|
+
file `1:1 Parsing error`). A corpus folder with `pdf/` or `text/` and no `papers.json` has no file to
|
|
167
|
+
anchor on; `corpus/allowed-files-only` reports it on the project's root `paperlint.json`, which
|
|
168
|
+
`@eslint/json` also reads. The corpus is kept out of the paper rules (#215, part 1): a `paper.tex`
|
|
169
|
+
saved in a corpus is an accepted paper's source, not one of the user's papers.
|
|
170
|
+
|
|
171
|
+
5. **The fixed file names**: `papers.json`, `MANIFEST.md` (optional, caveats only), `measurements.json`, `pdf/<key>.pdf`,
|
|
151
172
|
`text/<key>.txt` and `text/<key>.<variant>.txt` (one paper extracted twice, by `pdftotext` and by
|
|
152
173
|
`pdfminer`, or its first page alone), `deep-reads/<key>.md`, `sources/` (saved listing and call
|
|
153
174
|
pages, not judged). The author's own paper is never in a corpus: its text belongs in its paper folder.
|
|
@@ -188,13 +209,14 @@ to its paper folder. Licences that were never read stay `NOASSERTION` until PR 2
|
|
|
188
209
|
|
|
189
210
|
## The order of the pull requests
|
|
190
211
|
|
|
191
|
-
| PR
|
|
192
|
-
|
|
|
193
|
-
| 1a
|
|
194
|
-
| 1b
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
212
|
+
| PR | what | part of |
|
|
213
|
+
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
|
214
|
+
| 1a | the schema and its parser, the licence table, this note, `docs/venues.md` and `study-accepted-papers` rewritten to the record (decision 7) | #302 |
|
|
215
|
+
| 1b-i | `corpus/record` on `papers.json`, linted with `@eslint/json` and reporting at the field; the record gains `capped`, `proxy` and `rebuild`; `MANIFEST.md` optional; the corpus kept out of the paper rules; the rule's page under `docs/rules/corpus/`, linked from `docs/venues.md` | #302, #215 (1) |
|
|
216
|
+
| 1b-ii | `corpus/allowed-files-only` (#500's second rule, moved up from PR 4): the corpus's fixed names, and a corpus with `pdf/` or `text/` and no `papers.json`, reported on the root `paperlint.json`; merged right after 1b-i, so a consumer meets both in one evening | #500 (1 of 2) |
|
|
217
|
+
| 1b-iii | `corpus/licence` (off, in no set) with its page, linked from `docs/optional-rules.md`; a test that every rule id has the one-slash shape of "A Rule Id Names Its Subject" | #302 |
|
|
218
|
+
| 2 | the venue lister #568 asks for, as a shared tested script that `study-accepted-papers` calls (not a new CLI command), writing `papers.json` rows with ids and licences | #568 |
|
|
219
|
+
| 3 | the current cycle's venue has a corpus (matched by series, decision 1), the first of #356's three parts | #356 (1 of 3) |
|
|
198
220
|
|
|
199
221
|
PR 1a stands alone: a corpus written by hand, or by the skill, validates. Readers that compare a paper with
|
|
200
222
|
the corpus (#608 abstract rewrites, #465 the panel's demands, a title and scope comparison) come after PR 2.
|