paperlint 20.1.1 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +7 -0
- package/CLAUDE.md +6 -2
- package/CONTRIBUTING.md +2 -2
- package/{action.harness.mjs → action.test.mjs} +147 -138
- package/dist/adapters/venue-corpus/index.d.ts +345 -0
- package/dist/adapters/venue-corpus/index.d.ts.map +1 -0
- package/dist/adapters/venue-corpus/index.js +205 -0
- package/dist/adapters/venue-corpus/index.js.map +1 -0
- package/dist/domain/licence.d.ts +51 -0
- package/dist/domain/licence.d.ts.map +1 -0
- package/dist/domain/licence.js +61 -0
- package/dist/domain/licence.js.map +1 -0
- package/dist/domain/venue-corpus.d.ts +120 -0
- package/dist/domain/venue-corpus.d.ts.map +1 -0
- package/dist/domain/venue-corpus.js +13 -0
- package/dist/domain/venue-corpus.js.map +1 -0
- package/dist/eslint-rules/CLAUDE.md.spec.d.ts.map +1 -1
- package/dist/eslint-rules/CLAUDE.md.spec.js +1 -0
- package/dist/eslint-rules/CLAUDE.md.spec.js.map +1 -1
- package/dist/eslint-rules/papers.js +1 -1
- package/dist/latex-log.d.ts +1 -1
- package/dist/latex-log.js +1 -1
- package/dist/latex-loop.d.ts +1 -1
- package/dist/latex-loop.js +1 -1
- package/dist/lib/paper-config.d.ts +3 -3
- package/dist/lib/paper-config.js +3 -3
- package/dist/ports/venue-corpus-codec.d.ts +11 -0
- package/dist/ports/venue-corpus-codec.d.ts.map +1 -0
- package/dist/ports/venue-corpus-codec.js +2 -0
- package/dist/ports/venue-corpus-codec.js.map +1 -0
- package/dist/skill-chunks/chunk-5KCU4WTN.js +108 -0
- package/dist/skill-chunks/{chunk-X4VKG4KT.js → chunk-6YEM4VDI.js} +11 -9
- package/dist/skill-chunks/{chunk-L3NJUJUP.js → chunk-CXAGKT44.js} +5 -3
- package/dist/skill-chunks/{chunk-6NU6CXUS.js → chunk-J5XYPERO.js} +12 -72
- package/dist/skill-chunks/{chunk-IREAROCV.js → chunk-Z5YMDZYW.js} +4 -0
- package/dist/skills/study-accepted-papers/scripts/corpus-licences-core.d.ts +54 -0
- package/dist/skills/study-accepted-papers/scripts/corpus-licences.d.ts +2 -0
- package/docs/design/venue-corpus.md +250 -0
- package/docs/e2e.md +9 -9
- package/docs/testing.md +3 -4
- package/docs/venues.md +144 -21
- package/eslint-rules/CLAUDE.md +5 -1
- package/eslint-rules/CLAUDE.md.spec.ts +3 -0
- package/eslint-rules/{install-path-literals.harness.mjs → install-path-literals.test.mjs} +14 -13
- package/eslint-rules/{latex-language.harness.mjs → latex-language-rules.test.mjs} +61 -51
- package/eslint-rules/{paper-stages.harness.mjs → paper-stages-rule.test.mjs} +66 -69
- package/eslint-rules/{papers.harness.mjs → papers.test.mjs} +41 -30
- package/eslint-rules/papers.ts +1 -1
- package/eslint-rules/{pdf-last-page-balance.harness.mjs → pdf-last-page-balance.test.mjs} +27 -15
- package/eslint-rules/{temp-root-realpath.harness.mjs → temp-root-realpath.test.mjs} +24 -24
- package/eslint-rules/{tex-build.harness.mjs → tex-build.test.mjs} +292 -271
- package/eslint.config.mjs +15 -2
- package/fixtures/pdf-facts/README.md +1 -1
- package/fixtures/render-paper/build-clean.sh +1 -1
- package/fixtures/toolchain-mirror/install-tl +1 -1
- package/lib/{agent-cli-version.harness.mjs → agent-cli-version.test.mjs} +17 -18
- package/lib/{paper-config.harness.mjs → paper-config.test.mjs} +21 -20
- package/lib/paper-config.ts +3 -3
- package/lib/{skill-trigger-cases.harness.mjs → skill-trigger-cases-carrier.test.mjs} +78 -115
- package/package.json +4 -3
- package/presets/acm-acmsmall.jsonc +1 -1
- package/scripts/bundle-skills.ts +1 -0
- package/scripts/check-workflow.test.ts +368 -0
- package/scripts/check.ts +2 -2
- package/scripts/eslint-file-length.mjs +9 -9
- package/scripts/eslint-report-guard.mjs +1 -1
- package/scripts/eslint-report-guard.test.mjs +1 -1
- package/scripts/harness-api.test.ts +7 -46
- package/scripts/{rules-see-files.harness.mjs → rules-see-files-rule.test.mjs} +10 -6
- package/scripts/rules-see-files.mjs +1 -1
- package/scripts/venue-corpus-schema.test.ts +39 -0
- package/scripts/venue-corpus-schema.ts +17 -0
- package/skills/argument-arc/scripts/headings.js +6 -4
- package/skills/cold-read-diff/scripts/cold-read.js +6 -4
- package/skills/paper-pipeline/{paper-pipeline.harness.mjs → paper-pipeline.test.mjs} +45 -46
- package/skills/paper-pipeline/scripts/{consumer.harness.mjs → consumer-paths.test.mjs} +66 -59
- package/skills/paper-pipeline/scripts/consumer.mjs +3 -3
- package/skills/paper-pipeline/scripts/{extract-ref-facts.harness.mjs → extract-ref-facts-cli.test.mjs} +29 -31
- package/skills/paper-pipeline/scripts/extract-ref-facts.js +6 -5
- package/skills/paper-pipeline/scripts/fixtures/real-bib/refs.bib +1 -1
- package/skills/paper-pipeline/scripts/{generated-code.harness.mjs → generated-code-fixtures.test.mjs} +39 -46
- package/skills/pc-panel-review/scripts/prior-reviews.js +7 -5
- package/skills/render-paper/{extract-pdf-facts.harness.ts → extract-pdf-facts.test.ts} +20 -13
- package/skills/render-paper/{render-paper.harness.mjs → render-paper.test.mjs} +41 -40
- package/skills/study-accepted-papers/SKILL.md +28 -2
- package/skills/study-accepted-papers/SKILL.md.spec.ts +27 -1
- package/skills/study-accepted-papers/papers.schema.json +427 -0
- package/skills/study-accepted-papers/scripts/corpus-licences-core.js +180 -0
- package/skills/study-accepted-papers/scripts/corpus-licences-core.ts +302 -0
- package/skills/study-accepted-papers/scripts/corpus-licences.js +383 -0
- package/skills/study-accepted-papers/scripts/corpus-licences.test.ts +485 -0
- package/skills/study-accepted-papers/scripts/corpus-licences.ts +27 -0
- package/skills/verify-citations/scripts/bib-authors.js +6 -5
- package/skills/verify-citations/scripts/verify-cites.js +6 -5
- package/src/adapters/pdfjs/fill.test.ts +1 -1
- package/src/adapters/venue-corpus/index.test.ts +279 -0
- package/src/adapters/venue-corpus/index.ts +286 -0
- package/src/{build-engine.harness.mjs → build-engine-prepare.test.mjs} +98 -81
- package/src/{build.harness.mjs → build-fake-tex.test.mjs} +61 -28
- package/src/{cli.harness.mjs → cli-e2e.test.mjs} +108 -102
- package/src/cli.test.ts +1 -1
- package/src/{doctor.harness.mjs → doctor-install.test.mjs} +28 -29
- package/src/domain/licence.test.ts +122 -0
- package/src/domain/licence.ts +95 -0
- package/src/domain/venue-corpus.ts +130 -0
- package/src/{engine.harness.mjs → engine.test.mjs} +120 -106
- package/src/facts-file.test.ts +1 -1
- package/src/{hooks-settings.harness.ts → hooks-settings.test.ts} +161 -146
- package/src/latex-log.test.ts +395 -0
- package/src/latex-log.ts +1 -1
- package/src/latex-loop.test.ts +553 -0
- package/src/latex-loop.ts +1 -1
- package/src/{link-skills.harness.ts → link-skills-fs.test.ts} +26 -26
- package/src/{new-paper.harness.mjs → new-paper-scaffold.test.mjs} +31 -19
- package/src/{pdf-facts.harness.ts → pdf-facts-tables.test.ts} +28 -22
- package/src/{pdf-geometry.harness.ts → pdf-geometry.test.ts} +93 -75
- package/src/ports/venue-corpus-codec.ts +11 -0
- package/src/{rules-config.harness.ts → rules-config.test.ts} +41 -31
- package/src/{structure.harness.ts → structure.test.ts} +12 -10
- package/src/{tex-requirements.harness.ts → tex-requirements-tables.test.ts} +106 -85
- package/src/{toolchain.harness.mjs → toolchain-mirror.test.mjs} +204 -186
- package/scripts/check.harness.ts +0 -343
- package/scripts/harness-api.frozen.json +0 -41
- package/src/latex-log.harness.ts +0 -382
- package/src/latex-loop.harness.ts +0 -515
|
@@ -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,GAA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AAU,EAAE,CAAC;IACpD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;IACvD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAClD,IAAI,KAAK,KAAK,gBAAgB;QAC5B,OAAO,QAAQ,CAAC,aAAa;YAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE;YACvB,CAAC,CAAC,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;AA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CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,QAAQ,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,
|
|
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,CAA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A6B;QAEhG,0BAA0B,EAAE,KAAK,CAAA;;;;;;;;;;;;iEAY4B;KAC9D;IACD,KAAK,EAAE;QACL,6BAA6B,EAAE,QAAQ,CACrC,grBAAgrB,CACjrB;QACD,uBAAuB,EAAE,QAAQ,CAC/B,0ZAA0Z,CAC3Z;QACD,sCAAsC,EAAE,QAAQ,CAC9C,01BAA01B,CAC31B;QACD,qCAAqC,EAAE,QAAQ,CAC7C,4oCAA4oC,CAC7oC;KACF;CACF,CAAC,CAAC"}
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
* running that script has one net, not two.
|
|
67
67
|
*
|
|
68
68
|
* ⚠️ THE EXAMPLES IN THIS FILE ARE DELIBERATELY GENERIC (`docs/papers`), and that is ENFORCED
|
|
69
|
-
* rather than a style preference: `papers.
|
|
69
|
+
* rather than a style preference: `papers.test.mjs` part IV fails if the first consumer's own
|
|
70
70
|
* directory name appears anywhere in this package outside the test itself. It caught this very
|
|
71
71
|
* docblock on 2026-09-11, where the example used the real value. An exemption list is what turns
|
|
72
72
|
* such a check into decoration, so there is exactly one exemption: the file asserting it.
|
package/dist/latex-log.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export interface FailingWarning {
|
|
|
37
37
|
* nearly every paper has some, and the pdf/* rules check the margins), font shape substitution
|
|
38
38
|
* (usually harmless), "Rerun to get" (the loop already reruns). Those never fail a build.
|
|
39
39
|
*
|
|
40
|
-
* Adding one is one entry here, plus its row of cases in `latex-log.
|
|
40
|
+
* Adding one is one entry here, plus its row of cases in `latex-log.test.ts` (the harness does
|
|
41
41
|
* not type-check without it).
|
|
42
42
|
*
|
|
43
43
|
* `lost-character`: TeX prints "Missing character: There is no X in font F!" when
|
package/dist/latex-log.js
CHANGED
|
@@ -81,7 +81,7 @@ const startsPhysicalLine = (line, prefix) => range(0, Math.floor(line.length / M
|
|
|
81
81
|
* nearly every paper has some, and the pdf/* rules check the margins), font shape substitution
|
|
82
82
|
* (usually harmless), "Rerun to get" (the loop already reruns). Those never fail a build.
|
|
83
83
|
*
|
|
84
|
-
* Adding one is one entry here, plus its row of cases in `latex-log.
|
|
84
|
+
* Adding one is one entry here, plus its row of cases in `latex-log.test.ts` (the harness does
|
|
85
85
|
* not type-check without it).
|
|
86
86
|
*
|
|
87
87
|
* `lost-character`: TeX prints "Missing character: There is no X in font F!" when
|
package/dist/latex-loop.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* PURE. No disk, no process, no clock. The shell in `build.ts` runs a step, records what it saw
|
|
5
5
|
* as an `Observation`, appends it to the history and asks `nextStep(summarize(history))` again.
|
|
6
|
-
* Both halves are table tests (`latex-loop.
|
|
6
|
+
* Both halves are table tests (`latex-loop.test.ts`), not scenarios that need TeX.
|
|
7
7
|
*
|
|
8
8
|
* ── THE LOOP: `summarize` reduces the history to a `State`, and `nextStep` asks four questions ──
|
|
9
9
|
* 1. did the last program fail — a non-zero exit, or a
|
package/dist/latex-loop.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* PURE. No disk, no process, no clock. The shell in `build.ts` runs a step, records what it saw
|
|
5
5
|
* as an `Observation`, appends it to the history and asks `nextStep(summarize(history))` again.
|
|
6
|
-
* Both halves are table tests (`latex-loop.
|
|
6
|
+
* Both halves are table tests (`latex-loop.test.ts`), not scenarios that need TeX.
|
|
7
7
|
*
|
|
8
8
|
* ── THE LOOP: `summarize` reduces the history to a `State`, and `nextStep` asks four questions ──
|
|
9
9
|
* 1. did the last program fail — a non-zero exit, or a
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
/**
|
|
18
18
|
* The tool's name. Its settings file is named after it (`CONFIG_FILE`), its messages start with it,
|
|
19
19
|
* and the hooks resolve their scripts through it. It equals the package name, and
|
|
20
|
-
* `lib/paper-config.
|
|
20
|
+
* `lib/paper-config.test.mjs` checks that.
|
|
21
21
|
*/
|
|
22
22
|
export declare const CONFIG_KEY: string;
|
|
23
23
|
/**
|
|
@@ -60,7 +60,7 @@ export declare const DEFAULT_PAPERS_ROOT: string;
|
|
|
60
60
|
* This is the one place the name is spelled. Code reads the field as
|
|
61
61
|
* `settings[PAPERS_DIR_FIELD]`, never by a literal, so renaming it again is a one-line change
|
|
62
62
|
* here. The three hooks cannot import this module, so they keep their own copy, and
|
|
63
|
-
* `lib/paper-config.
|
|
63
|
+
* `lib/paper-config.test.mjs` checks that every copy matches this one.
|
|
64
64
|
*/
|
|
65
65
|
export declare const PAPERS_DIR_FIELD: string;
|
|
66
66
|
/**
|
|
@@ -68,7 +68,7 @@ export declare const PAPERS_DIR_FIELD: string;
|
|
|
68
68
|
* A key not listed here is REFUSED with its name, because a typo in a key otherwise reads as "not
|
|
69
69
|
* set". The keys in `ROOT_ONLY_KEYS` describe the whole project and are refused in a paper's file.
|
|
70
70
|
*
|
|
71
|
-
* 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.
|
|
71
|
+
* 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.test.mjs`
|
|
72
72
|
* walks the package's source, finds every `settingsOf(…)?.<key>` read and every field of
|
|
73
73
|
* `PaperlintConfig`, and requires each to be here — so a new reader that forgets this list turns
|
|
74
74
|
* the harness red before a consumer's config does.
|
package/dist/lib/paper-config.js
CHANGED
|
@@ -19,7 +19,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
19
19
|
/**
|
|
20
20
|
* The tool's name. Its settings file is named after it (`CONFIG_FILE`), its messages start with it,
|
|
21
21
|
* and the hooks resolve their scripts through it. It equals the package name, and
|
|
22
|
-
* `lib/paper-config.
|
|
22
|
+
* `lib/paper-config.test.mjs` checks that.
|
|
23
23
|
*/
|
|
24
24
|
export const CONFIG_KEY = "paperlint";
|
|
25
25
|
/**
|
|
@@ -93,7 +93,7 @@ export const DEFAULT_PAPERS_ROOT = "papers";
|
|
|
93
93
|
* This is the one place the name is spelled. Code reads the field as
|
|
94
94
|
* `settings[PAPERS_DIR_FIELD]`, never by a literal, so renaming it again is a one-line change
|
|
95
95
|
* here. The three hooks cannot import this module, so they keep their own copy, and
|
|
96
|
-
* `lib/paper-config.
|
|
96
|
+
* `lib/paper-config.test.mjs` checks that every copy matches this one.
|
|
97
97
|
*/
|
|
98
98
|
export const PAPERS_DIR_FIELD = "papersDir";
|
|
99
99
|
/**
|
|
@@ -101,7 +101,7 @@ export const PAPERS_DIR_FIELD = "papersDir";
|
|
|
101
101
|
* A key not listed here is REFUSED with its name, because a typo in a key otherwise reads as "not
|
|
102
102
|
* set". The keys in `ROOT_ONLY_KEYS` describe the whole project and are refused in a paper's file.
|
|
103
103
|
*
|
|
104
|
-
* 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.
|
|
104
|
+
* 🔴 ONE LIST, AND IT IS CHECKED AGAINST THE READERS, NOT TRUSTED. `lib/paper-config.test.mjs`
|
|
105
105
|
* walks the package's source, finds every `settingsOf(…)?.<key>` read and every field of
|
|
106
106
|
* `PaperlintConfig`, and requires each to be here — so a new reader that forgets this list turns
|
|
107
107
|
* the harness red before a consumer's config does.
|
|
@@ -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 @@
|
|
|
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-
|
|
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-
|
|
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-
|
|
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";
|