paperlint 20.1.2 → 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 (56) 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 +345 -0
  4. package/dist/adapters/venue-corpus/index.d.ts.map +1 -0
  5. package/dist/adapters/venue-corpus/index.js +205 -0
  6. package/dist/adapters/venue-corpus/index.js.map +1 -0
  7. package/dist/domain/licence.d.ts +51 -0
  8. package/dist/domain/licence.d.ts.map +1 -0
  9. package/dist/domain/licence.js +61 -0
  10. package/dist/domain/licence.js.map +1 -0
  11. package/dist/domain/venue-corpus.d.ts +120 -0
  12. package/dist/domain/venue-corpus.d.ts.map +1 -0
  13. package/dist/domain/venue-corpus.js +13 -0
  14. package/dist/domain/venue-corpus.js.map +1 -0
  15. package/dist/eslint-rules/CLAUDE.md.spec.d.ts.map +1 -1
  16. package/dist/eslint-rules/CLAUDE.md.spec.js +1 -0
  17. package/dist/eslint-rules/CLAUDE.md.spec.js.map +1 -1
  18. package/dist/ports/venue-corpus-codec.d.ts +11 -0
  19. package/dist/ports/venue-corpus-codec.d.ts.map +1 -0
  20. package/dist/ports/venue-corpus-codec.js +2 -0
  21. package/dist/ports/venue-corpus-codec.js.map +1 -0
  22. package/dist/skill-chunks/chunk-5KCU4WTN.js +108 -0
  23. package/dist/skill-chunks/{chunk-X4VKG4KT.js → chunk-6YEM4VDI.js} +11 -9
  24. package/dist/skill-chunks/{chunk-L3NJUJUP.js → chunk-CXAGKT44.js} +5 -3
  25. package/dist/skill-chunks/{chunk-6NU6CXUS.js → chunk-J5XYPERO.js} +12 -72
  26. package/dist/skill-chunks/{chunk-IREAROCV.js → chunk-Z5YMDZYW.js} +4 -0
  27. package/dist/skills/study-accepted-papers/scripts/corpus-licences-core.d.ts +54 -0
  28. package/dist/skills/study-accepted-papers/scripts/corpus-licences.d.ts +2 -0
  29. package/docs/design/venue-corpus.md +250 -0
  30. package/docs/venues.md +144 -21
  31. package/eslint-rules/CLAUDE.md +5 -1
  32. package/eslint-rules/CLAUDE.md.spec.ts +3 -0
  33. package/package.json +2 -1
  34. package/scripts/bundle-skills.ts +1 -0
  35. package/scripts/venue-corpus-schema.test.ts +39 -0
  36. package/scripts/venue-corpus-schema.ts +17 -0
  37. package/skills/argument-arc/scripts/headings.js +6 -4
  38. package/skills/cold-read-diff/scripts/cold-read.js +6 -4
  39. package/skills/paper-pipeline/scripts/extract-ref-facts.js +6 -5
  40. package/skills/pc-panel-review/scripts/prior-reviews.js +7 -5
  41. package/skills/study-accepted-papers/SKILL.md +28 -2
  42. package/skills/study-accepted-papers/SKILL.md.spec.ts +27 -1
  43. package/skills/study-accepted-papers/papers.schema.json +427 -0
  44. package/skills/study-accepted-papers/scripts/corpus-licences-core.js +180 -0
  45. package/skills/study-accepted-papers/scripts/corpus-licences-core.ts +302 -0
  46. package/skills/study-accepted-papers/scripts/corpus-licences.js +383 -0
  47. package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +485 -0
  48. package/skills/study-accepted-papers/scripts/corpus-licences.ts +27 -0
  49. package/skills/verify-citations/scripts/bib-authors.js +6 -5
  50. package/skills/verify-citations/scripts/verify-cites.js +6 -5
  51. package/src/adapters/venue-corpus/index.test.ts +279 -0
  52. package/src/adapters/venue-corpus/index.ts +286 -0
  53. package/src/domain/licence.test.ts +122 -0
  54. package/src/domain/licence.ts +95 -0
  55. package/src/domain/venue-corpus.ts +130 -0
  56. package/src/ports/venue-corpus-codec.ts +11 -0
@@ -0,0 +1,61 @@
1
+ /**
2
+ * THE LICENCE TABLE — what a copy's licence permits a venue corpus to store (docs/design/venue-corpus.md,
3
+ * decision 3). A corpus keeps third-party papers; each stored file is a copy of one version, judged by
4
+ * that copy's licence (`papers.json`, `src/domain/venue-corpus.ts`).
5
+ *
6
+ * Any SPDX id or `LicenseRef-…` is a licence id where the record is parsed; this table decides what
7
+ * one permits. An id it does not list permits nothing and is its own result, naming the id, so one
8
+ * `CC-BY-3.0` does not hide the rest of a record and a typo is still loud. `NOASSERTION` (the licence
9
+ * was not read) permits nothing, as its own result. A non-commercial licence permits storing only in a
10
+ * project that declares itself non-commercial: paperlint does not assume it.
11
+ *
12
+ * A version of a CC licence other than 4.0 gets its row when a corpus meets it.
13
+ */
14
+ /** What a corpus stores of a copy: its extracted text (every variant), or the PDF. */
15
+ export const STORED_KINDS = ["text", "pdf"];
16
+ /** SPDX's own id for "no licence information was given": here, the licence was not read. */
17
+ export const NOASSERTION = "NOASSERTION";
18
+ const ND = {
19
+ no: "ND permits reproduction in unmodified form; whether an extracted text is an adaptation is unsettled",
20
+ };
21
+ const ARXIV = {
22
+ no: 'it grants arXiv alone the right to distribute: "We are thus unable to grant others the right to distribute arXiv articles"',
23
+ };
24
+ const PUBLISHER = {
25
+ no: "the publisher grants no right to third parties",
26
+ };
27
+ /** The table: an id → what it grants for text and for the PDF. */
28
+ const TABLE = new Map([
29
+ ["CC0-1.0", { text: "yes", pdf: "yes" }],
30
+ ["CC-BY-4.0", { text: "yes", pdf: "yes" }],
31
+ ["CC-BY-SA-4.0", { text: "yes", pdf: "yes" }],
32
+ ["CC-BY-NC-4.0", { text: "non-commercial", pdf: "non-commercial" }],
33
+ ["CC-BY-NC-SA-4.0", { text: "non-commercial", pdf: "non-commercial" }],
34
+ ["CC-BY-ND-4.0", { text: ND, pdf: "yes" }],
35
+ ["CC-BY-NC-ND-4.0", { text: ND, pdf: "non-commercial" }],
36
+ ["LicenseRef-arxiv-nonexclusive-1.0", { text: ARXIV, pdf: ARXIV }],
37
+ ["LicenseRef-publisher", { text: PUBLISHER, pdf: PUBLISHER }],
38
+ ]);
39
+ /**
40
+ * True for an SPDX license id's shape (letters, digits, `-` and `.`, and the deprecated `+` suffix)
41
+ * or a `LicenseRef-` of SPDX and REUSE; listed or not. An expression (`MIT OR Apache-2.0`), a phrase
42
+ * or a URL is not an id.
43
+ */
44
+ export const isLicenceId = (id) => /^(?:LicenseRef-[A-Za-z0-9.-]+|[A-Za-z0-9][A-Za-z0-9.-]*\+?)$/u.test(id);
45
+ /** Whether a copy under licence `id` may be stored as `kind`, in a project of `settings`. */
46
+ export function permits(id, kind, settings) {
47
+ if (id === NOASSERTION)
48
+ return { kind: "not-read" };
49
+ const row = TABLE.get(id);
50
+ if (row === undefined)
51
+ return { kind: "unlisted", id };
52
+ const grant = row[kind];
53
+ if (grant === "yes")
54
+ return { kind: "permitted" };
55
+ if (grant === "non-commercial")
56
+ return settings.nonCommercial
57
+ ? { kind: "permitted" }
58
+ : { kind: "non-commercial-only" };
59
+ return { kind: "forbidden", why: grant.no };
60
+ }
61
+ //# sourceMappingURL=licence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"licence.js","sourceRoot":"","sources":["../../src/domain/licence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,CAAU,CAAC;AAGrD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AA0BzC,MAAM,EAAE,GAAG;IACT,EAAE,EAAE,qGAAqG;CACjG,CAAC;AAEX,MAAM,KAAK,GAAG;IACZ,EAAE,EAAE,4HAA4H;CACxH,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,EAAE,EAAE,gDAAgD;CAC5C,CAAC;AAEX,kEAAkE;AAClE,MAAM,KAAK,GAA6B,IAAI,GAAG,CAAc;IAC3D,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC1C,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC7C,CAAC,cAA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AAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;IACtC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * A VENUE CORPUS'S RECORD — `<papers-root>/venues/<venue>/papers.json` (docs/design/venue-corpus.md,
3
+ * decision 1; docs/venues.md): the papers a venue accepted and, for each, every copy we know of with
4
+ * its licence. Codes and measurements stay in `measurements.json`, keyed by a paper's `key`; prose
5
+ * stays in `MANIFEST.md`.
6
+ *
7
+ * The text of the file is checked once, where it enters: `VenueCorpusCodec`
8
+ * (`src/ports/venue-corpus-codec.ts`), whose adapter holds the zod schema of this shape. The domain
9
+ * holds the value: only the codec mints one, so a value built by hand can hold what the schema
10
+ * refuses (a stored copy without `fetched_from`, a key with a slash). The top level, an edition, a copy, its licence and a paper's ids are strict; a paper
11
+ * row keeps any further field as it is, because a consumer's own scripts read them.
12
+ *
13
+ * 🔴 A licence belongs to a copy, not to a paper (decision 2): the same paper is often CC BY in the
14
+ * proceedings and under arXiv's licence as a preprint, and a stored file is a copy of one version. What
15
+ * a licence permits is `src/domain/licence.ts`'s table.
16
+ */
17
+ import type { NOASSERTION, StoredKind } from "./licence.ts";
18
+ export declare const CORPUS_RECORD = "papers.json";
19
+ /** `accepted` and `award` are this venue's; `sister`, a paper of another venue (corpus 2). */
20
+ export declare const PAPER_GROUPS: readonly ["accepted", "award", "sister"];
21
+ export type PaperGroup = (typeof PAPER_GROUPS)[number];
22
+ /** OpenAlex's `publishedVersion` / `acceptedVersion` / `submittedVersion`. */
23
+ export declare const KNOWN_VERSIONS: readonly ["published", "accepted", "preprint"];
24
+ export type KnownVersion = (typeof KNOWN_VERSIONS)[number];
25
+ /** The ids a paper may carry; `url` is its page on the listing, when nothing else identifies it. */
26
+ export declare const PAPER_ID_KINDS: readonly ["doi", "arxiv", "dblp", "s2", "url"];
27
+ /**
28
+ * A key names the stored files (`pdf/<key>.pdf`) and the measurement rows: one path segment, with
29
+ * no dot, because `text/<key>.<variant>.txt` is read up to the first dot. An arXiv id goes in `ids`.
30
+ */
31
+ export declare const KEY_PATTERN: RegExp;
32
+ /** One edition of this venue the corpus covers. */
33
+ export interface Edition {
34
+ readonly edition: number;
35
+ /** The page that lists what the edition accepted. */
36
+ readonly listed_from: string;
37
+ readonly read_on: string;
38
+ /** How many it accepted, when the page says. */
39
+ readonly accepted?: number | undefined;
40
+ }
41
+ /** A licence read from a source, or `NOASSERTION`: none was read. */
42
+ export type Licence = {
43
+ readonly id: typeof NOASSERTION;
44
+ } | {
45
+ /** An SPDX id or a `LicenseRef-`. */
46
+ readonly id: string;
47
+ /** The page or API response it was read from, never inferred. */
48
+ readonly read_from: string;
49
+ readonly read_on: string;
50
+ };
51
+ /** What of a copy is in the corpus, and where its bytes came from. */
52
+ interface Storage {
53
+ /**
54
+ * Each kind at most once per copy (two copies of one paper storing one kind is `corpus/record`'s
55
+ * finding); `text` covers every text variant of the paper.
56
+ */
57
+ readonly stored: readonly StoredKind[];
58
+ /** Present whenever `stored` is not empty. */
59
+ readonly fetched_from?: string | undefined;
60
+ }
61
+ /**
62
+ * One copy of a paper. A copy whose origin nobody recorded is `unknown`, and its licence is
63
+ * `NOASSERTION`, so it permits nothing.
64
+ */
65
+ export type Copy = (Storage & {
66
+ readonly version: KnownVersion;
67
+ readonly url: string;
68
+ readonly licence: Licence;
69
+ }) | (Storage & {
70
+ readonly version: "unknown";
71
+ readonly licence: {
72
+ readonly id: typeof NOASSERTION;
73
+ };
74
+ });
75
+ export interface PaperIds {
76
+ readonly doi?: string | undefined;
77
+ readonly arxiv?: string | undefined;
78
+ readonly dblp?: string | undefined;
79
+ readonly s2?: string | undefined;
80
+ readonly url?: string | undefined;
81
+ }
82
+ interface PaperFields {
83
+ /** Unique in the file. */
84
+ readonly key: string;
85
+ readonly title: string;
86
+ readonly authors?: readonly string[] | undefined;
87
+ /** Kept as metadata whatever the copies' licences. */
88
+ /** `null` where the listing gave none. */
89
+ readonly abstract?: string | null | undefined;
90
+ /** At least one. */
91
+ readonly ids: PaperIds;
92
+ readonly copies: readonly Copy[];
93
+ readonly [extra: string]: unknown;
94
+ }
95
+ export type Paper = (PaperFields & {
96
+ readonly group: "accepted" | "award";
97
+ /** One of the record's `editions[].edition`. */
98
+ readonly edition: number;
99
+ }) | (PaperFields & {
100
+ readonly group: "sister";
101
+ readonly venue: string;
102
+ readonly year: number;
103
+ readonly listed_from: string;
104
+ });
105
+ export interface VenueCorpus {
106
+ /** The corpus folder's name: the venue preset's series. */
107
+ readonly venue: string;
108
+ readonly editions: readonly Edition[];
109
+ readonly papers: readonly Paper[];
110
+ }
111
+ /** A `papers.json`'s text, parsed: the record, or every reason it is not one. */
112
+ export type ParsedCorpus = {
113
+ readonly ok: true;
114
+ readonly corpus: VenueCorpus;
115
+ } | {
116
+ readonly ok: false;
117
+ readonly why: string;
118
+ };
119
+ export {};
120
+ //# sourceMappingURL=venue-corpus.d.ts.map
@@ -0,0 +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,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,8EAA8E;AAC9E,eAAO,MAAM,cAAc,gDAAiD,CAAC;AAC7E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,oGAAoG;AACpG,eAAO,MAAM,cAAc,gDAAiD,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAi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AQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;CACnC;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,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ export const CORPUS_RECORD = "papers.json";
2
+ /** `accepted` and `award` are this venue's; `sister`, a paper of another venue (corpus 2). */
3
+ export const PAPER_GROUPS = ["accepted", "award", "sister"];
4
+ /** OpenAlex's `publishedVersion` / `acceptedVersion` / `submittedVersion`. */
5
+ export const KNOWN_VERSIONS = ["published", "accepted", "preprint"];
6
+ /** The ids a paper may carry; `url` is its page on the listing, when nothing else identifies it. */
7
+ export const PAPER_ID_KINDS = ["doi", "arxiv", "dblp", "s2", "url"];
8
+ /**
9
+ * A key names the stored files (`pdf/<key>.pdf`) and the measurement rows: one path segment, with
10
+ * no dot, because `text/<key>.<variant>.txt` is read up to the first dot. An arXiv id goes in `ids`.
11
+ */
12
+ export const KEY_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/u;
13
+ //# sourceMappingURL=venue-corpus.js.map
@@ -0,0 +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,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAE7E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CLAUDE.md.spec.d.ts","sourceRoot":"","sources":["../../eslint-rules/CLAUDE.md.spec.ts"],"names":[],"mappings":";AAMA,wBA2CG"}
1
+ {"version":3,"file":"CLAUDE.md.spec.d.ts","sourceRoot":"","sources":["../../eslint-rules/CLAUDE.md.spec.ts"],"names":[],"mappings":";AAMA,wBA8CG"}
@@ -34,6 +34,7 @@ the checks push every paper toward a blog post.
34
34
  tic, plus a check that no claim was softened or strengthened.`,
35
35
  },
36
36
  rules: {
37
+ "a-rule-id-names-its-subject": guidance("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."),
37
38
  "lint-rule-over-script": guidance("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."),
38
39
  "the-config-decides-where-a-rule-runs": guidance("A NEW decision about which files a rule runs on goes into the config, not into the rule. A rule judges its own subject wherever it is turned on; whether it applies to a paper at a given stage is a rule block the lint config builds (`paperRuleBlocks` in `src/cli.ts`): `files`, `ignores`, or a rule set to `off`, where a later block wins, as in ESLint. Example: a finished paper (accepted, camera-ready frozen) has its text and build rules turned off by `src/settled-paper.ts`, and no rule reads its cycles for that (#583, #553). Two older decisions still live inside rules and are not a precedent: `phase` set to `porting` silences the venue rules from inside them (`src/venue-rules.ts`), and the anonymity rules go quiet on an accepted cycle (`effectiveBlind`, `src/domain/cycle.ts`); #599 decides whether they move. The author decided this on 2026-11-23."),
39
40
  "a-rule-is-configured-the-eslint-way": guidance('Provisional, pending #599 (the author is not sure it is right). A rule\'s own switches (what to require, a threshold, a file to compare) come from its options where it is turned on: `["warn", { … }]`. A new rule is not on by default and silent until some key of `paperlint.json` is declared: that hides a check behind a setting nobody sees in the rule list. A fact several rules share about a paper (its venue, cycles, artifact, talk) reaches them through ESLint\'s `settings`, filled once by `buildConfig` from `paperlint.json`; a rule does not open `paperlint.json` itself. A rule whose subject IS `paperlint.json` (it validates the config) is exempt. Where an outside service varies (an artifact host, a portal), the rule reads a file of facts a command wrote and never the service; the services are adapters behind a port, as `src/ports/submission-portal.ts` and `src/adapters/hotcrp/` are, and eslint-plugin-import\'s `settings["import/resolver"]` is the ESLint precedent. About 25 existing rules predate this; #599 decides whether to move them, narrow this rule, or drop it and allow a rule to read `paperlint.json`. The author proposed this on 2026-11-21.'),
@@ -1 +1 @@
1
- {"version":3,"file":"CLAUDE.md.spec.js","sourceRoot":"","sources":["../../eslint-rules/CLAUDE.md.spec.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,EAAE;AACF,gGAAgG;AAChG,uFAAuF;AACvF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAEtE,eAAe,eAAe,CAAC;IAC7B,QAAQ,EAAE;QACR,iBAAiB,EAAE,KAAK,CAAA;;oBAER;QAEhB,+CAA+C,EAAE,KAAK,CAAA;;sEAEY,IAAI,CAAC,wBAAwB,CAAC;;0KAEsE,IAAI,CAAC,yCAAyC,CAAC;gHACzG,IAAI,CAAC,0CAA0C,CAAC,6NAA6N,IAAI,CAAC,8BAA8B,CAAC;2FACtU,IAAI,CAAC,uBAAuB,CAA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CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * How a venue corpus's `papers.json` becomes a value: its text parsed once, where it enters, against
3
+ * the schema of `VenueCorpus` (`src/domain/venue-corpus.ts`). The one implementation is
4
+ * `src/adapters/venue-corpus/` (zod).
5
+ */
6
+ import type { ParsedCorpus } from "../domain/venue-corpus.ts";
7
+ export interface VenueCorpusCodec {
8
+ /** A `papers.json`'s text: the record, or every reason it is not one, each with its path. */
9
+ readonly parse: (text: string) => ParsedCorpus;
10
+ }
11
+ //# sourceMappingURL=venue-corpus-codec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"venue-corpus-codec.d.ts","sourceRoot":"","sources":["../../src/ports/venue-corpus-codec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,YAAY,CAAC;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=venue-corpus-codec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"venue-corpus-codec.js","sourceRoot":"","sources":["../../src/ports/venue-corpus-codec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,108 @@
1
+ import { createRequire as __plCreateRequire } from "node:module";
2
+ import { fileURLToPath as __plFileURLToPath } from "node:url";
3
+ import { dirname as __plDirname } from "node:path";
4
+ const require = __plCreateRequire(import.meta.url);
5
+ const __filename = __plFileURLToPath(import.meta.url);
6
+ const __dirname = __plDirname(__filename);
7
+
8
+ // src/domain/text.ts
9
+ var printed = (stream) => stream ?? "";
10
+ var messageOf = (e) => e instanceof Error ? e.message : String(e);
11
+ var codeOf = (e) => typeof e === "object" && e !== null && "code" in e && typeof e.code === "string" ? e.code : void 0;
12
+
13
+ // src/adapters/node/files.io.ts
14
+ import {
15
+ mkdirSync,
16
+ readFileSync,
17
+ renameSync,
18
+ rmSync,
19
+ statSync,
20
+ writeFileSync
21
+ } from "node:fs";
22
+ import { dirname } from "node:path";
23
+ var errorCode = (e) => codeOf(e);
24
+ var nodeFiles = {
25
+ isFile(p) {
26
+ return statSync(p, { throwIfNoEntry: false })?.isFile() ?? false;
27
+ },
28
+ readBytes(p) {
29
+ try {
30
+ return readFileSync(p);
31
+ } catch (e) {
32
+ if (errorCode(e) === "ENOENT") return null;
33
+ throw e;
34
+ }
35
+ },
36
+ writeAtomic(p, bytes) {
37
+ const part = `${p}.part`;
38
+ mkdirSync(dirname(p), { recursive: true });
39
+ try {
40
+ writeFileSync(part, bytes);
41
+ renameSync(part, p);
42
+ } finally {
43
+ rmSync(part, { force: true });
44
+ }
45
+ }
46
+ };
47
+
48
+ // src/adapters/node/process.io.ts
49
+ import {
50
+ spawnSync
51
+ } from "node:child_process";
52
+ var errno = (r) => codeOf(r.error);
53
+ function exitOf(r, c) {
54
+ const out = {
55
+ stdout: printed(r.stdout),
56
+ stderr: printed(r.stderr)
57
+ };
58
+ const code = errno(r);
59
+ if (code === "ENOENT") return { kind: "not-found", file: c.file };
60
+ if (code === "ETIMEDOUT")
61
+ return { kind: "timed-out", afterMs: c.timeoutMs, ...out };
62
+ if (r.error) return { kind: "spawn-failed", message: r.error.message };
63
+ if (r.signal) return { kind: "signalled", signal: r.signal, ...out };
64
+ return { kind: "exited", status: r.status ?? 1, ...out };
65
+ }
66
+ function spawnProcess(spawn = spawnSync) {
67
+ return {
68
+ run(c) {
69
+ const opts = {
70
+ encoding: "utf8",
71
+ env: { ...c.env },
72
+ stdio: ["ignore", "pipe", "pipe"],
73
+ timeout: c.timeoutMs,
74
+ ...c.maxOutputBytes ? { maxBuffer: c.maxOutputBytes } : {},
75
+ ...c.cwd ? { cwd: c.cwd } : {}
76
+ };
77
+ return exitOf(spawn(c.file, [...c.args], opts), c);
78
+ }
79
+ };
80
+ }
81
+
82
+ // src/domain/paths.ts
83
+ import { isAbsolute, join, posix } from "node:path";
84
+
85
+ // src/domain/result.ts
86
+ var ok = (value) => ({ ok: true, value });
87
+ var err = (error) => ({ ok: false, error });
88
+
89
+ // src/domain/paths.ts
90
+ var isAbsolutePath = (p) => isAbsolute(p);
91
+ function absolutePath(p) {
92
+ if (!isAbsolutePath(p)) throw new Error(`not an absolute path: ${p}`);
93
+ return p;
94
+ }
95
+
96
+ // src/caller-path.ts
97
+ import { resolve } from "node:path";
98
+ var callerPath = (p) => absolutePath(resolve(p));
99
+
100
+ export {
101
+ ok,
102
+ err,
103
+ messageOf,
104
+ nodeFiles,
105
+ spawnProcess,
106
+ absolutePath,
107
+ callerPath
108
+ };
@@ -9,21 +9,23 @@ import {
9
9
  printRaw,
10
10
  replaceNode,
11
11
  visit
12
- } from "./chunk-L3NJUJUP.js";
13
- import {
14
- CONFIG_KEY,
15
- settingsOf
16
- } from "./chunk-IREAROCV.js";
12
+ } from "./chunk-CXAGKT44.js";
17
13
  import {
18
14
  JOBNAME,
19
- callerPath,
20
15
  decoded,
21
16
  describeChanges,
22
- err,
23
- ok,
24
17
  paperRecord,
25
18
  spelledIn
26
- } from "./chunk-6NU6CXUS.js";
19
+ } from "./chunk-J5XYPERO.js";
20
+ import {
21
+ CONFIG_KEY,
22
+ settingsOf
23
+ } from "./chunk-Z5YMDZYW.js";
24
+ import {
25
+ callerPath,
26
+ err,
27
+ ok
28
+ } from "./chunk-5KCU4WTN.js";
27
29
  import {
28
30
  __commonJS,
29
31
  __toESM
@@ -11,13 +11,11 @@ import {
11
11
  SOURCES_SCHEMA,
12
12
  collapse,
13
13
  documentClassLine,
14
- err,
15
14
  fieldOf,
16
- ok,
17
15
  optionsInEffect,
18
16
  readWhole,
19
17
  venueClass
20
- } from "./chunk-6NU6CXUS.js";
18
+ } from "./chunk-J5XYPERO.js";
21
19
  import {
22
20
  countBy,
23
21
  hasAtLeast,
@@ -28,6 +26,10 @@ import {
28
26
  sortBy,
29
27
  zip
30
28
  } from "./chunk-C2G5EK7S.js";
29
+ import {
30
+ err,
31
+ ok
32
+ } from "./chunk-5KCU4WTN.js";
31
33
  import {
32
34
  external_exports
33
35
  } from "./chunk-4MHEJ6FR.js";
@@ -4,59 +4,9 @@ import { dirname as __plDirname } from "node:path";
4
4
  const require = __plCreateRequire(import.meta.url);
5
5
  const __filename = __plFileURLToPath(import.meta.url);
6
6
  const __dirname = __plDirname(__filename);
7
-
8
- // src/domain/text.ts
9
- var messageOf = (e) => e instanceof Error ? e.message : String(e);
10
- var codeOf = (e) => typeof e === "object" && e !== null && "code" in e && typeof e.code === "string" ? e.code : void 0;
11
-
12
- // src/adapters/node/files.io.ts
13
7
  import {
14
- mkdirSync,
15
- readFileSync,
16
- renameSync,
17
- rmSync,
18
- statSync,
19
- writeFileSync
20
- } from "node:fs";
21
- import { dirname } from "node:path";
22
- var errorCode = (e) => codeOf(e);
23
- var nodeFiles = {
24
- isFile(p) {
25
- return statSync(p, { throwIfNoEntry: false })?.isFile() ?? false;
26
- },
27
- readBytes(p) {
28
- try {
29
- return readFileSync(p);
30
- } catch (e) {
31
- if (errorCode(e) === "ENOENT") return null;
32
- throw e;
33
- }
34
- },
35
- writeAtomic(p, bytes) {
36
- const part = `${p}.part`;
37
- mkdirSync(dirname(p), { recursive: true });
38
- try {
39
- writeFileSync(part, bytes);
40
- renameSync(part, p);
41
- } finally {
42
- rmSync(part, { force: true });
43
- }
44
- }
45
- };
46
-
47
- // src/domain/paths.ts
48
- import { isAbsolute, join, posix } from "node:path";
49
-
50
- // src/domain/result.ts
51
- var ok = (value) => ({ ok: true, value });
52
- var err = (error) => ({ ok: false, error });
53
-
54
- // src/domain/paths.ts
55
- var isAbsolutePath = (p) => isAbsolute(p);
56
- function absolutePath(p) {
57
- if (!isAbsolutePath(p)) throw new Error(`not an absolute path: ${p}`);
58
- return p;
59
- }
8
+ callerPath
9
+ } from "./chunk-5KCU4WTN.js";
60
10
 
61
11
  // src/domain/tex-document.ts
62
12
  var collapse = (s) => s.split(/\s+/u).filter(Boolean).join(" ");
@@ -100,12 +50,8 @@ function spelledIn(names, name) {
100
50
  return only !== void 0 && more.length === 0 ? only : null;
101
51
  }
102
52
 
103
- // src/caller-path.ts
104
- import { resolve } from "node:path";
105
- var callerPath = (p) => absolutePath(resolve(p));
106
-
107
53
  // src/paper-record.ts
108
- import { resolve as resolve3 } from "node:path";
54
+ import { resolve as resolve2 } from "node:path";
109
55
 
110
56
  // src/domain/sha256.ts
111
57
  import { createHash } from "node:crypto";
@@ -119,12 +65,12 @@ function parseSha256(s) {
119
65
  var sha256Hex = (bytes) => parseSha256(createHash("sha256").update(bytes).digest("hex"));
120
66
 
121
67
  // src/sources-record.ts
122
- import { join as join2, posix as posix2, resolve as resolve2 } from "node:path";
123
- var sourcesPath = (paperDir) => join2(paperDir, SOURCES_DIR, SOURCES_FILE);
68
+ import { join, posix, resolve } from "node:path";
69
+ var sourcesPath = (paperDir) => join(paperDir, SOURCES_DIR, SOURCES_FILE);
124
70
 
125
71
  // src/paper-record.ts
126
72
  var digestOf = (dir, files) => (path) => {
127
- const b = files.readBytes(callerPath(resolve3(dir, path)));
73
+ const b = files.readBytes(callerPath(resolve2(dir, path)));
128
74
  return b === null ? null : sha256Hex(b);
129
75
  };
130
76
  function paperRecord(dir, deps) {
@@ -137,13 +83,13 @@ function paperRecord(dir, deps) {
137
83
  }
138
84
 
139
85
  // src/tex-paper.ts
140
- import { basename, dirname as dirname2, join as join3 } from "node:path";
86
+ import { basename, dirname, join as join2 } from "node:path";
141
87
 
142
88
  // src/domain/paper-source.ts
143
- import { posix as posix3 } from "node:path";
89
+ import { posix as posix2 } from "node:path";
144
90
  var candidates = (target) => {
145
- const t = posix3.normalize(target.trim());
146
- return posix3.extname(t) === "" ? [`${t}.tex`, t] : [t];
91
+ const t = posix2.normalize(target.trim());
92
+ return posix2.extname(t) === "" ? [`${t}.tex`, t] : [t];
147
93
  };
148
94
  function found(target, read) {
149
95
  const hits = candidates(target).flatMap((path) => {
@@ -212,7 +158,7 @@ function assemblePaper(main, text, deps) {
212
158
  // src/tex-paper.ts
213
159
  var decoded = (b) => b === null ? null : new TextDecoder().decode(b);
214
160
  function readPaper(filename, src, deps) {
215
- const dir = dirname2(filename);
161
+ const dir = dirname(filename);
216
162
  const record = paperRecord(dir, deps);
217
163
  const listed = record.kind === "fresh" ? record.record.inputs.map((i) => i.path) : [];
218
164
  return assemblePaper(basename(filename), src, {
@@ -221,7 +167,7 @@ function readPaper(filename, src, deps) {
221
167
  documentBody: deps.latex.documentBody,
222
168
  read: (rel) => {
223
169
  const recorded = spelledIn(listed, rel);
224
- return recorded === null ? null : decoded(deps.files.readBytes(callerPath(join3(dir, recorded))));
170
+ return recorded === null ? null : decoded(deps.files.readBytes(callerPath(join2(dir, recorded))));
225
171
  }
226
172
  });
227
173
  }
@@ -233,8 +179,6 @@ var fieldOf = (v, key) => isRecord(v) ? v[key] : void 0;
233
179
  export {
234
180
  isRecord,
235
181
  fieldOf,
236
- ok,
237
- err,
238
182
  collapse,
239
183
  optionsInEffect,
240
184
  readWhole,
@@ -243,15 +187,11 @@ export {
243
187
  runText,
244
188
  OPAQUE,
245
189
  LINE_BREAK,
246
- messageOf,
247
- nodeFiles,
248
- absolutePath,
249
190
  SOURCES_SCHEMA,
250
191
  SOURCES_FILE,
251
192
  JOBNAME,
252
193
  describeChanges,
253
194
  spelledIn,
254
- callerPath,
255
195
  paperRecord,
256
196
  decoded,
257
197
  readPaper
@@ -37,6 +37,8 @@ function settingsOf(root) {
37
37
  }
38
38
  return isObject(v) ? v : void 0;
39
39
  }
40
+ var DEFAULT_PAPERS_ROOT = "papers";
41
+ var PAPERS_DIR_FIELD = "papersDir";
40
42
  var SETTINGS_KEYS = Object.freeze({
41
43
  papersDir: `the papers directory, default "papers" \u2014 every command, the hooks`,
42
44
  structure: "which files a paper directory must hold \u2014 paperlint lint",
@@ -79,6 +81,8 @@ export {
79
81
  CONFIG_FILE,
80
82
  findProjectRoot,
81
83
  settingsOf,
84
+ DEFAULT_PAPERS_ROOT,
85
+ PAPERS_DIR_FIELD,
82
86
  SETTINGS_KEYS,
83
87
  ROOT_ONLY_KEYS
84
88
  };
@@ -0,0 +1,54 @@
1
+ import { type LicenceSettings, type Permission, type StoredKind } from "#src/domain/licence";
2
+ import { type Copy, type KnownVersion, type VenueCorpus } from "#src/domain/venue-corpus";
3
+ import type { Files } from "#src/ports/files";
4
+ import type { RunProcess } from "#src/ports/process";
5
+ import type { VenueCorpusCodec } from "#src/ports/venue-corpus-codec";
6
+ /** Why one copy may not be kept as one kind. */
7
+ export type Refused = Exclude<Permission, {
8
+ readonly kind: "permitted";
9
+ }>;
10
+ /** One copy's refusal: its version, its licence id, and why. */
11
+ export interface Refusal {
12
+ readonly version: Copy["version"];
13
+ readonly licence: string;
14
+ readonly permission: Refused;
15
+ }
16
+ /** For one paper and one kind: the copy to keep, or every copy's refusal (none when it has no copy). */
17
+ export type Verdict = {
18
+ readonly key: string;
19
+ readonly stored: StoredKind;
20
+ readonly outcome: "keep";
21
+ readonly version: KnownVersion;
22
+ readonly licence: string;
23
+ readonly url: string;
24
+ } | {
25
+ readonly key: string;
26
+ readonly stored: StoredKind;
27
+ readonly outcome: "none";
28
+ readonly refusals: readonly Refusal[];
29
+ };
30
+ /** Every paper's verdict for each kind, in the record's order. */
31
+ export declare const verdicts: (corpus: VenueCorpus, settings: Readonly<LicenceSettings>) => readonly Verdict[];
32
+ /** What the command prints for `all`. */
33
+ export declare const listing: (all: readonly Verdict[]) => string;
34
+ /** What the command reads with: the disk, the record's codec, and where the project is. */
35
+ export interface Deps {
36
+ readonly files: Files;
37
+ readonly codec: VenueCorpusCodec;
38
+ /** The top of the git working tree holding `cwd`, or null when `cwd` is in none. */
39
+ readonly projectRoot: (cwd: string) => string | null;
40
+ /** The folder the command was started in. */
41
+ readonly cwd: string;
42
+ }
43
+ /**
44
+ * `git rev-parse --show-toplevel` in `cwd`: the project's root, or null outside a repository (or
45
+ * when git did not run). `path` is the caller's PATH, the only variable git is given.
46
+ */
47
+ export declare function gitTopLevel(git: RunProcess, path: string | undefined, cwd: string): string | null;
48
+ /** Where the command writes: the listing, and what stops it. */
49
+ export interface Output {
50
+ readonly out: (s: string) => void;
51
+ readonly err: (s: string) => void;
52
+ }
53
+ /** Run the command on `argv`; the exit code. */
54
+ export declare function main(argv: readonly string[], deps: Deps, { out, err }: Output): number;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};