paperlint 10.3.0 → 10.4.1
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/.github/workflows/ci.yml +15 -4
- package/README.md +1 -0
- package/dist/CLAUDE.md.spec.d.ts.map +1 -1
- package/dist/CLAUDE.md.spec.js +6 -3
- package/dist/CLAUDE.md.spec.js.map +1 -1
- package/dist/adapters/git/index.d.ts +10 -0
- package/dist/adapters/git/index.d.ts.map +1 -0
- package/dist/adapters/git/index.js +151 -0
- package/dist/adapters/git/index.js.map +1 -0
- package/dist/adapters/latex/captions.d.ts +9 -0
- package/dist/adapters/latex/captions.d.ts.map +1 -0
- package/dist/adapters/latex/captions.js +40 -0
- package/dist/adapters/latex/captions.js.map +1 -0
- package/dist/adapters/latex/index.d.ts +1 -0
- package/dist/adapters/latex/index.d.ts.map +1 -1
- package/dist/adapters/latex/index.js +1 -0
- package/dist/adapters/latex/index.js.map +1 -1
- package/dist/adapters/latex/parse.d.ts.map +1 -1
- package/dist/adapters/latex/parse.js +6 -0
- package/dist/adapters/latex/parse.js.map +1 -1
- package/dist/adapters/memory/index.d.ts +6 -0
- package/dist/adapters/memory/index.d.ts.map +1 -1
- package/dist/adapters/memory/index.js +8 -0
- package/dist/adapters/memory/index.js.map +1 -1
- package/dist/adapters/node/index.d.ts +1 -0
- package/dist/adapters/node/index.d.ts.map +1 -1
- package/dist/adapters/node/index.js +1 -0
- package/dist/adapters/node/index.js.map +1 -1
- package/dist/adapters/node/list-entries.io.d.ts +3 -0
- package/dist/adapters/node/list-entries.io.d.ts.map +1 -0
- package/dist/adapters/node/list-entries.io.js +26 -0
- package/dist/adapters/node/list-entries.io.js.map +1 -0
- package/dist/adapters/study-registry/index.d.ts +70 -10
- package/dist/adapters/study-registry/index.d.ts.map +1 -1
- package/dist/adapters/study-registry/index.js +84 -10
- package/dist/adapters/study-registry/index.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +33 -3
- package/dist/cli.js.map +1 -1
- package/dist/domain/decide-first.d.ts +110 -0
- package/dist/domain/decide-first.d.ts.map +1 -0
- package/dist/domain/decide-first.js +108 -0
- package/dist/domain/decide-first.js.map +1 -0
- package/dist/domain/index-columns.d.ts +45 -0
- package/dist/domain/index-columns.d.ts.map +1 -0
- package/dist/domain/index-columns.js +64 -0
- package/dist/domain/index-columns.js.map +1 -0
- package/dist/domain/study-mode.d.ts +37 -0
- package/dist/domain/study-mode.d.ts.map +1 -0
- package/dist/domain/study-mode.js +45 -0
- package/dist/domain/study-mode.js.map +1 -0
- package/dist/domain/study-registry.d.ts +116 -12
- package/dist/domain/study-registry.d.ts.map +1 -1
- package/dist/domain/study-registry.js +164 -44
- package/dist/domain/study-registry.js.map +1 -1
- package/dist/outputs-before-decision-rule.d.ts +17 -0
- package/dist/outputs-before-decision-rule.d.ts.map +1 -0
- package/dist/outputs-before-decision-rule.js +94 -0
- package/dist/outputs-before-decision-rule.js.map +1 -0
- package/dist/ports/git-history.d.ts +44 -0
- package/dist/ports/git-history.d.ts.map +1 -0
- package/dist/ports/git-history.js +2 -0
- package/dist/ports/git-history.js.map +1 -0
- package/dist/ports/list-entries.d.ts +20 -0
- package/dist/ports/list-entries.d.ts.map +1 -0
- package/dist/ports/list-entries.js +2 -0
- package/dist/ports/list-entries.js.map +1 -0
- package/dist/ports/study-deps.d.ts +14 -0
- package/dist/ports/study-deps.d.ts.map +1 -0
- package/dist/ports/study-deps.js +2 -0
- package/dist/ports/study-deps.js.map +1 -0
- package/dist/ports/study-folder.d.ts +43 -0
- package/dist/ports/study-folder.d.ts.map +1 -0
- package/dist/ports/study-folder.js +2 -0
- package/dist/ports/study-folder.js.map +1 -0
- package/dist/ports/study-registry-codec.d.ts +6 -3
- package/dist/ports/study-registry-codec.d.ts.map +1 -1
- package/dist/presets.d.ts +1 -2
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +1 -2
- package/dist/presets.js.map +1 -1
- package/dist/studies.d.ts +4 -0
- package/dist/studies.d.ts.map +1 -1
- package/dist/studies.js +52 -21
- package/dist/studies.js.map +1 -1
- package/dist/study-folder.d.ts +14 -0
- package/dist/study-folder.d.ts.map +1 -0
- package/dist/study-folder.js +123 -0
- package/dist/study-folder.js.map +1 -0
- package/dist/study-gate.d.ts +14 -0
- package/dist/study-gate.d.ts.map +1 -0
- package/dist/study-gate.js +132 -0
- package/dist/study-gate.js.map +1 -0
- package/dist/study-index-input.d.ts +5 -0
- package/dist/study-index-input.d.ts.map +1 -0
- package/dist/study-index-input.js +18 -0
- package/dist/study-index-input.js.map +1 -0
- package/dist/study-modes.d.ts +56 -0
- package/dist/study-modes.d.ts.map +1 -0
- package/dist/study-modes.js +59 -0
- package/dist/study-modes.js.map +1 -0
- package/dist/study-registry-rule.d.ts +13 -1
- package/dist/study-registry-rule.d.ts.map +1 -1
- package/dist/study-registry-rule.js +33 -21
- package/dist/study-registry-rule.js.map +1 -1
- package/dist/study-run.d.ts +19 -0
- package/dist/study-run.d.ts.map +1 -0
- package/dist/study-run.js +9 -0
- package/dist/study-run.js.map +1 -0
- package/docs/design/study-modes.md +265 -0
- package/docs/design/study-registry.md +6 -0
- package/docs/e2e.md +8 -4
- package/docs/layout.md +22 -19
- package/docs/rules/repro/outputs-before-decision.md +122 -0
- package/docs/rules/repro/study-registered.md +49 -15
- package/docs/rules/tex/heading-case.md +1 -1
- package/docs/rules.md +54 -53
- package/docs/testing.md +1 -0
- package/eslint.config.mjs +36 -24
- package/package.json +2 -1
- package/scripts/check.ts +6 -0
- package/skills/camera-ready/SKILL.md +6 -1
- package/skills/camera-ready/SKILL.md.spec.ts +5 -0
- package/skills/draft-paper/SKILL.md +11 -3
- package/skills/draft-paper/SKILL.md.spec.ts +10 -2
- package/skills/grade-paper-writing/SKILL.md +4 -2
- package/skills/grade-paper-writing/SKILL.md.spec.ts +3 -1
- package/skills/grade-paper-writing/__snapshots__/prose-lint.test.ts.snap +16 -3
- package/skills/grade-paper-writing/prose-lint.mjs +127 -95
- package/skills/grade-paper-writing/prose-lint.test.ts +119 -10
- package/skills/harden-paper/SKILL.md +12 -2
- package/skills/harden-paper/SKILL.md.spec.ts +11 -1
- package/skills/osf-artifact-upload/SKILL.md +7 -1
- package/skills/osf-artifact-upload/SKILL.md.spec.ts +6 -0
- package/skills/pc-panel-review/SKILL.md +10 -3
- package/skills/pc-panel-review/SKILL.md.spec.ts +9 -2
- package/skills/tighten-paper/SKILL.md +5 -1
- package/skills/tighten-paper/SKILL.md.spec.ts +4 -0
- package/src/CLAUDE.md +7 -4
- package/src/CLAUDE.md.spec.ts +6 -3
- package/src/adapters/git/history.test.ts +121 -0
- package/src/adapters/git/index.test.ts +268 -0
- package/src/adapters/git/index.ts +227 -0
- package/src/adapters/latex/captions.test.ts +57 -0
- package/src/adapters/latex/captions.ts +56 -0
- package/src/adapters/latex/index.ts +1 -0
- package/src/adapters/latex/parse.ts +7 -0
- package/src/adapters/memory/index.test.ts +15 -1
- package/src/adapters/memory/index.ts +13 -0
- package/src/adapters/node/index.ts +1 -0
- package/src/adapters/node/list-entries.io.ts +27 -0
- package/src/adapters/node/list-entries.test.ts +61 -0
- package/src/adapters/study-registry/index.test.ts +12 -9
- package/src/adapters/study-registry/index.ts +130 -24
- package/src/adapters/study-registry/mode.test.ts +162 -0
- package/src/cli.ts +47 -3
- package/src/domain/decide-first.test.ts +291 -0
- package/src/domain/decide-first.ts +258 -0
- package/src/domain/index-columns.test.ts +261 -0
- package/src/domain/index-columns.ts +107 -0
- package/src/domain/study-measurements.test.ts +16 -8
- package/src/domain/study-mode.test.ts +55 -0
- package/src/domain/study-mode.ts +78 -0
- package/src/domain/study-registry.test.ts +72 -37
- package/src/domain/study-registry.ts +281 -50
- package/src/new-paper.test.ts +5 -1
- package/src/outputs-before-decision-rule.test.ts +251 -0
- package/src/outputs-before-decision-rule.ts +133 -0
- package/src/ports/git-history.ts +44 -0
- package/src/ports/list-entries.ts +21 -0
- package/src/ports/study-deps.ts +14 -0
- package/src/ports/study-folder.ts +38 -0
- package/src/ports/study-registry-codec.ts +10 -3
- package/src/presets.ts +1 -2
- package/src/rule-cases.test.ts +78 -3
- package/src/studies-index-modes.test.ts +129 -0
- package/src/studies.test.ts +35 -11
- package/src/studies.ts +96 -26
- package/src/study-folder.test.ts +237 -0
- package/src/study-folder.ts +176 -0
- package/src/study-gate.test.ts +467 -0
- package/src/study-gate.ts +234 -0
- package/src/study-index-input.ts +31 -0
- package/src/study-modes.ts +107 -0
- package/src/study-registry-rule.test.ts +285 -11
- package/src/study-registry-rule.ts +64 -35
- package/src/study-run.ts +21 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one reader of what lies inside a study's folder, `repro/<folder>/<path>`, and of the decision
|
|
3
|
+
* file that lies elsewhere in the paper. It never follows a symbolic link: a path is walked one
|
|
4
|
+
* component at a time by the entries of each directory (`ListEntries`, which does not follow links),
|
|
5
|
+
* and a path that passes through a link — the file itself, or any directory above it — is `linked`,
|
|
6
|
+
* naming the link, before a single byte is read. Every reader of a study takes a `StudyFolder` and
|
|
7
|
+
* not `Files`, so a read that follows a link is not what those readers are handed.
|
|
8
|
+
*
|
|
9
|
+
* What goes through it, and who builds it (once per run, from the paper's folder):
|
|
10
|
+
* - the plan of a row: `repro/study-registered`, `repro/outputs-before-decision`, `studies gate`
|
|
11
|
+
* and the index's mode columns;
|
|
12
|
+
* - the result file of a row: `repro/study-registered`;
|
|
13
|
+
* - whether a row's folder may be entered at all (`refusal`): `studies gate`, `studies index|new`;
|
|
14
|
+
* - the decision file's path (`entryAt`): the gate and the order rule.
|
|
15
|
+
* The outputs of a study are listed through it too (`list`).
|
|
16
|
+
* A study folder that is itself a link, or a folder name that is not one folder inside `repro/`, is
|
|
17
|
+
* never entered: its files read as `absent`.
|
|
18
|
+
*
|
|
19
|
+
* A link made between the walk and the read is not caught: paperlint guards against accidents, not
|
|
20
|
+
* against an author who races their own tooling (docs/design/study-modes.md, the threat model).
|
|
21
|
+
*/
|
|
22
|
+
import { join, posix } from "node:path";
|
|
23
|
+
import { callerPath } from "./caller-path.js";
|
|
24
|
+
import { REPRO_DIR } from "./domain/repro-layout.js";
|
|
25
|
+
import { isFolderName, isInside, } from "./domain/study-registry.js";
|
|
26
|
+
/** What a refusal says of the folder a row names: `which <reason>`, and the fix without its full stop. */
|
|
27
|
+
export const folderRefusalText = (why, shown) => why === "not-a-folder"
|
|
28
|
+
? {
|
|
29
|
+
reason: `is not one folder inside ${shown}/${REPRO_DIR}/`,
|
|
30
|
+
fix: "Give the row its own folder's name",
|
|
31
|
+
}
|
|
32
|
+
: {
|
|
33
|
+
reason: "is a symbolic link",
|
|
34
|
+
fix: `Give the row a real folder inside ${shown}/${REPRO_DIR}/`,
|
|
35
|
+
};
|
|
36
|
+
/** What the entry `name` of the directory `dir` is; undefined when there is none. */
|
|
37
|
+
const kindAt = (entries, dir, name) => entries(callerPath(dir)).find((e) => e.name === name)?.kind;
|
|
38
|
+
const ENTRY = {
|
|
39
|
+
file: { kind: "file" },
|
|
40
|
+
dir: { kind: "dir" },
|
|
41
|
+
other: { kind: "other" },
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* What the entry `name` below `dir`/`above` is: every component on the way is looked up in its
|
|
45
|
+
* directory's entries, and the first that is a symbolic link ends the walk (an entry under a
|
|
46
|
+
* directory that is not there is not listed, so it can be no link).
|
|
47
|
+
*/
|
|
48
|
+
const walk = (dir, above, name, entries) => {
|
|
49
|
+
const path = [...above, name];
|
|
50
|
+
const at = path.findIndex((c, i) => kindAt(entries, join(dir, ...path.slice(0, i)), c) === "symlink");
|
|
51
|
+
if (at >= 0)
|
|
52
|
+
return { kind: "linked", link: path.slice(0, at + 1).join("/") };
|
|
53
|
+
const kind = kindAt(entries, join(dir, ...above), name);
|
|
54
|
+
return kind === undefined || kind === "symlink"
|
|
55
|
+
? { kind: "absent" }
|
|
56
|
+
: ENTRY[kind];
|
|
57
|
+
};
|
|
58
|
+
/** `path` as the directories above its last component, and that component. */
|
|
59
|
+
const split = (path) => {
|
|
60
|
+
const normal = posix.normalize(path);
|
|
61
|
+
return {
|
|
62
|
+
above: posix
|
|
63
|
+
.dirname(normal)
|
|
64
|
+
.split("/")
|
|
65
|
+
.filter((c) => c !== "."),
|
|
66
|
+
name: posix.basename(normal),
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/** What `path` in `folder` is, by the entries of the paper folder `paper`; nothing is read. */
|
|
70
|
+
const locateIn = (paper, entries, folder, path) => {
|
|
71
|
+
// A NUL is no path the disk can hold, and probing one throws; the rest never leaves the folder.
|
|
72
|
+
if (!isFolderName(folder) || !isInside(path) || path.includes("\0"))
|
|
73
|
+
return { kind: "absent" };
|
|
74
|
+
const { above, name } = split(path);
|
|
75
|
+
// The folder is walked too: one that is a link is never entered, and reads as absent.
|
|
76
|
+
const found = walk(join(paper, REPRO_DIR), [folder, ...above], name, entries);
|
|
77
|
+
// A directory or a special file is no file to read: it reads as nothing.
|
|
78
|
+
if (found.kind === "dir" || found.kind === "other")
|
|
79
|
+
return { kind: "absent" };
|
|
80
|
+
if (found.kind !== "linked")
|
|
81
|
+
return found;
|
|
82
|
+
return found.link === folder
|
|
83
|
+
? { kind: "absent" }
|
|
84
|
+
: { kind: "linked", link: found.link.slice(folder.length + 1) };
|
|
85
|
+
};
|
|
86
|
+
/** Why `folder` may not be entered in the paper folder `paper`; null when it may. */
|
|
87
|
+
const refusalOf = (paper, entries, folder) => {
|
|
88
|
+
if (!isFolderName(folder))
|
|
89
|
+
return "not-a-folder";
|
|
90
|
+
return kindAt(entries, join(paper, REPRO_DIR), folder) === "symlink"
|
|
91
|
+
? "symbolic-link"
|
|
92
|
+
: null;
|
|
93
|
+
};
|
|
94
|
+
/** Every file under `dir`, relative to it; a link is a file, and is not entered. */
|
|
95
|
+
const filesUnder = (dir, entries, prefix = "") => entries(callerPath(dir)).flatMap(({ name, kind }) => {
|
|
96
|
+
const rel = prefix === "" ? name : `${prefix}/${name}`;
|
|
97
|
+
return kind === "dir" ? filesUnder(join(dir, name), entries, rel) : [rel];
|
|
98
|
+
});
|
|
99
|
+
/** The reader of the study folders of the paper folder `paper`. */
|
|
100
|
+
export const studyFolder = (paper, deps) => ({
|
|
101
|
+
refusal: (folder) => refusalOf(paper, deps.entries, folder),
|
|
102
|
+
locate: (folder, path) => locateIn(paper, deps.entries, folder, path),
|
|
103
|
+
read: (folder, path) => {
|
|
104
|
+
const at = locateIn(paper, deps.entries, folder, path);
|
|
105
|
+
if (at.kind !== "file")
|
|
106
|
+
return at;
|
|
107
|
+
const p = callerPath(join(paper, REPRO_DIR, folder, path));
|
|
108
|
+
const bytes = deps.files.isFile(p) ? deps.files.readBytes(p) : null;
|
|
109
|
+
return bytes === null
|
|
110
|
+
? { kind: "absent" }
|
|
111
|
+
: { kind: "text", text: new TextDecoder().decode(bytes) };
|
|
112
|
+
},
|
|
113
|
+
list: (folder) => refusalOf(paper, deps.entries, folder) === null
|
|
114
|
+
? filesUnder(join(paper, REPRO_DIR, folder), deps.entries)
|
|
115
|
+
: [],
|
|
116
|
+
entryAt: (path) => {
|
|
117
|
+
if (!isInside(path) || path.includes("\0"))
|
|
118
|
+
return { kind: "absent" };
|
|
119
|
+
const { above, name } = split(path);
|
|
120
|
+
return walk(paper, above, name, deps.entries);
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=study-folder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-folder.js","sourceRoot":"","sources":["../src/study-folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,QAAQ,GAET,MAAM,4BAA4B,CAAC;AASpC,0GAA0G;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E,CACf,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,IAAI;QAC7C,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC;QAC1D,CAAC,CAAC,EAAE;IACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACtE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Committed, GitHistory } from "./ports/git-history.ts";
|
|
2
|
+
import type { StudyDeps } from "./ports/study-deps.ts";
|
|
3
|
+
import { type StudyRun } from "./study-run.ts";
|
|
4
|
+
export interface GateDeps extends StudyDeps {
|
|
5
|
+
readonly git: GitHistory;
|
|
6
|
+
}
|
|
7
|
+
/** What a decision's committed state means for the run. */
|
|
8
|
+
export declare const gateLine: (id: string, file: string, c: Committed) => {
|
|
9
|
+
readonly open: boolean;
|
|
10
|
+
readonly line: string;
|
|
11
|
+
};
|
|
12
|
+
/** `studies gate`: 0 when the run may start, 1 with the reason when not. */
|
|
13
|
+
export declare function runGate(paper: string, shown: string, id: string, deps: GateDeps): StudyRun;
|
|
14
|
+
//# sourceMappingURL=study-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-gate.d.ts","sourceRoot":"","sources":["../src/study-gate.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;CAC1B;AAoBD,2DAA2D;AAC3D,eAAO,MAAM,QAAQ,GACnB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,GAAG,SAAS,KACX;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAMA,CAAC;AAgJnD,4EAA4E;AAC5E,wBAAgB,OAAO,CACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,QAAQ,GACb,QAAQ,CAeV"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `paperlint studies gate <paper-dir> <id>` — may the study's run start? For a study decided before
|
|
3
|
+
* its run (the default mode), only once its decision file exists and is committed as it stands: exit 0
|
|
4
|
+
* with the commit and its date, else exit 1 saying why. A runner calls it first:
|
|
5
|
+
*
|
|
6
|
+
* npx paperlint studies gate papers/my-paper P1-S03 && ./run.sh
|
|
7
|
+
*
|
|
8
|
+
* An exploratory study has no gate: it exits 0 and says so. A study that declares no mode, names no
|
|
9
|
+
* decision file, whose row names a folder that is not one inside `repro/`, or whose id two rows
|
|
10
|
+
* share, is refused.
|
|
11
|
+
*/
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
import { callerPath } from "./caller-path.js";
|
|
14
|
+
import { decisionEntry, readModeStudy } from "./study-modes.js";
|
|
15
|
+
import { REPRO_DIR } from "./domain/repro-layout.js";
|
|
16
|
+
import { decisionAsOutput } from "./domain/study-mode.js";
|
|
17
|
+
import { STUDIES_FILE, studiesOf, studyById, } from "./domain/study-registry.js";
|
|
18
|
+
import { folderRefusalText, studyFolder } from "./study-folder.js";
|
|
19
|
+
import { registryOf } from "./study-registry-rule.js";
|
|
20
|
+
import { refusal, refused, } from "./study-run.js";
|
|
21
|
+
/** The line of a committed state that holds the run back. */
|
|
22
|
+
const shutLine = (id, file, c) => {
|
|
23
|
+
switch (c.kind) {
|
|
24
|
+
case "changed":
|
|
25
|
+
return `${id}: the decision ${file} has changed since its last commit, ${c.commit}; the run waits for the decision as committed. Commit it, then run this again.`;
|
|
26
|
+
case "deleted":
|
|
27
|
+
return `${id}: the decision ${file} is not in HEAD: it was deleted in ${c.commit}; the run waits for a decision that stands. Restore it, commit it, then run this again.`;
|
|
28
|
+
case "not-committed":
|
|
29
|
+
return `${id}: the decision ${file} is not committed; the run waits for it. Write the decision there, commit it, then run this again.`;
|
|
30
|
+
case "unknown":
|
|
31
|
+
return `${id}: git could not say whether the decision ${file} is committed: ${c.why}.`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
/** What a decision's committed state means for the run. */
|
|
35
|
+
export const gateLine = (id, file, c) => c.kind === "committed"
|
|
36
|
+
? {
|
|
37
|
+
open: true,
|
|
38
|
+
line: `${id}: the decision ${file} is committed in ${c.commit} (${c.date}); the run may start.`,
|
|
39
|
+
}
|
|
40
|
+
: { open: false, line: shutLine(id, file, c) };
|
|
41
|
+
/**
|
|
42
|
+
* Why the decision cannot gate the run though it is named: its own outputs match it, or it is a
|
|
43
|
+
* directory (git answers for a directory with the last commit of anything under it); null when usable.
|
|
44
|
+
*/
|
|
45
|
+
const unusable = ({ id, folder: studyDir }, mode, folder) => {
|
|
46
|
+
const file = mode.decision.file;
|
|
47
|
+
const glob = decisionAsOutput(studyDir, mode);
|
|
48
|
+
if (glob !== null)
|
|
49
|
+
return refusal(`${id}: its decision ${file} is matched by its output \`${glob}\`; a decision cannot be what its own run produces.`);
|
|
50
|
+
const on = decisionEntry(folder, file);
|
|
51
|
+
switch (on.kind) {
|
|
52
|
+
case "not-a-file":
|
|
53
|
+
return refusal(`${id}: its decision ${file} is a ${on.what}, not a file; the run cannot be gated on it. Name the decision file in \`mode.decision.file\`.`);
|
|
54
|
+
case "linked":
|
|
55
|
+
return refusal(`${id}: its decision ${file} passes through the symbolic link \`${on.link}\`; git records the link, not the files behind it, so the run cannot be gated on it. Name a decision file that lies in real directories in \`mode.decision.file\`.`);
|
|
56
|
+
case "ok":
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
/** The gate of a decide-first study. */
|
|
61
|
+
const gateDecided = ({ paper, folder, deps }, row, mode) => {
|
|
62
|
+
const { id } = row;
|
|
63
|
+
const file = mode.decision.file;
|
|
64
|
+
const blocked = unusable(row, mode, folder);
|
|
65
|
+
if (blocked !== null)
|
|
66
|
+
return refused(blocked);
|
|
67
|
+
const g = gateLine(id, file, deps.git.committed(callerPath(paper), callerPath(join(paper, file))));
|
|
68
|
+
return g.open ? { ok: true, lines: [g.line] } : refused(refusal(g.line));
|
|
69
|
+
};
|
|
70
|
+
/** The refusal when the row names a folder that may not be entered; null when it may. */
|
|
71
|
+
const escapingRow = (shown, row, folder) => {
|
|
72
|
+
const why = folder.refusal(row.folder);
|
|
73
|
+
if (why === null)
|
|
74
|
+
return null;
|
|
75
|
+
const { reason, fix } = folderRefusalText(why, shown);
|
|
76
|
+
return refusal(`${row.id}: its row names the folder \`${row.folder}\`, which ${reason}; nothing is read through it. ${fix}.`);
|
|
77
|
+
};
|
|
78
|
+
/** The refusal of an id that two or more rows carry: the gate answers for exactly one study. */
|
|
79
|
+
const ambiguousRefusal = (shown, id, rows) => refusal(`${id}: ${String(rows.length)} rows of ${shown}/${REPRO_DIR}/${STUDIES_FILE} carry this id (folders ${rows.map((x) => `\`${x.folder}\``).join(", ")}); the gate answers for exactly one study. Give each other row the next free id and rename its folder to match, then run this again.`);
|
|
80
|
+
/** The refusal of a study whose plan is still a draft: a mode decides nothing until its plan is ready. */
|
|
81
|
+
const draftRefusal = (id, s) => {
|
|
82
|
+
const names = s.empty.map((f) => `\`${f}\``).join(", ");
|
|
83
|
+
const verb = s.empty.length === 1 ? "is" : "are";
|
|
84
|
+
return refusal(`${id}: its ${s.plan} is a draft — ${names} ${verb} empty; the run waits for a ready plan. Fill it in, then run this again.`);
|
|
85
|
+
};
|
|
86
|
+
/** The gate of the one row `row`. */
|
|
87
|
+
const gateRow = (run, row) => {
|
|
88
|
+
const { shown, folder, deps } = run;
|
|
89
|
+
const escaping = escapingRow(shown, row, folder);
|
|
90
|
+
if (escaping !== null)
|
|
91
|
+
return refused(escaping);
|
|
92
|
+
const read = readModeStudy(row, folder, deps.codec);
|
|
93
|
+
if (read.kind === "linked")
|
|
94
|
+
return refused(linkedPlanRefusal(shown, row, read.link));
|
|
95
|
+
if (read.kind === "none")
|
|
96
|
+
return refused(noModeRefusal(shown, row.id));
|
|
97
|
+
const s = read.study;
|
|
98
|
+
if (s.empty.length > 0)
|
|
99
|
+
return refused(draftRefusal(row.id, s));
|
|
100
|
+
return s.mode.kind === "decide_before_run"
|
|
101
|
+
? gateDecided(run, s.row, s.mode)
|
|
102
|
+
: {
|
|
103
|
+
ok: true,
|
|
104
|
+
lines: [
|
|
105
|
+
`${row.id} is exploratory (${s.mode.reason}): it has no gate, and its results are reported as exploratory.`,
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
/** The refusal of a plan whose path passes through a symbolic link. */
|
|
110
|
+
const linkedPlanRefusal = (shown, row, link) => refusal(`${row.id}: the plan its row names, in ${shown}/${REPRO_DIR}/${row.folder}, passes through the symbolic link \`${link}\`; nothing is read through a link. Replace the link with the plan file itself, then run this again.`);
|
|
111
|
+
/** The refusal of an id no row declares a mode for. */
|
|
112
|
+
const noModeRefusal = (shown, id) => refusal(`${id} declares no mode in ${shown}: the plan its row names in ${shown}/${REPRO_DIR}/${STUDIES_FILE} is missing, does not parse, or has no \`mode\`. Lint the paper (\`npx paperlint lint\`) to see why.`);
|
|
113
|
+
/** The refusal of an id that no row of the registry carries. */
|
|
114
|
+
const unknownIdRefusal = (shown, id) => refusal(`${id}: no row of ${shown}/${REPRO_DIR}/${STUDIES_FILE} carries this id. Use an id from the registry, or register the study with \`npx paperlint studies new\`, then run this again.`);
|
|
115
|
+
/** The refusal of a registry that is not there or does not parse: no row can carry the id. */
|
|
116
|
+
const registryRefusal = (shown, id, r) => refusal(`${id}: the registry ${shown}/${REPRO_DIR}/${STUDIES_FILE} ${r.kind === "absent" ? "is missing" : `does not parse (${r.why})`}, so no row can carry this id. Run \`npx paperlint lint\` to see why, then run this again.`);
|
|
117
|
+
/** `studies gate`: 0 when the run may start, 1 with the reason when not. */
|
|
118
|
+
export function runGate(paper, shown, id, deps) {
|
|
119
|
+
const r = registryOf(paper, deps);
|
|
120
|
+
if (r.kind !== "read")
|
|
121
|
+
return refused(registryRefusal(shown, id, r));
|
|
122
|
+
const found = studyById(studiesOf(r), id);
|
|
123
|
+
switch (found.kind) {
|
|
124
|
+
case "none":
|
|
125
|
+
return refused(unknownIdRefusal(shown, id));
|
|
126
|
+
case "ambiguous":
|
|
127
|
+
return refused(ambiguousRefusal(shown, id, found.rows));
|
|
128
|
+
case "one":
|
|
129
|
+
return gateRow({ paper, shown, folder: studyFolder(paper, deps), deps }, found.row);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=study-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-gate.js","sourceRoot":"","sources":["../src/study-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAA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Ed,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9C,KAAK,WAAW;YACd,OAAO,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,KAAK,KAAK;YACR,OAAO,OAAO,CACZ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EACxD,KAAK,CAAC,GAAG,CACV,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IndexInput, type RegistryState } from "./domain/study-registry.ts";
|
|
2
|
+
import { type OrderDeps } from "./outputs-before-decision-rule.ts";
|
|
3
|
+
/** The plans and the histories of the paper folder `paper`, whose registry is `r`. */
|
|
4
|
+
export declare const indexInputOf: (paper: string, r: RegistryState, deps: OrderDeps) => IndexInput;
|
|
5
|
+
//# sourceMappingURL=study-index-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-index-input.d.ts","sourceRoot":"","sources":["../src/study-index-input.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,mCAAmC,CAAC;AAI3C,sFAAsF;AACtF,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,GAAG,aAAa,EAChB,MAAM,SAAS,KACd,UAQD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `paperlint studies index` and `studies new` generate the index from beyond the registry: each
|
|
3
|
+
* row's plan, and each decide-first study's history as git gives it now (src/domain/index-columns.ts).
|
|
4
|
+
*/
|
|
5
|
+
import { indexHistory } from "./domain/index-columns.js";
|
|
6
|
+
import { folderKey, } from "./domain/study-registry.js";
|
|
7
|
+
import { decideFirstStudies, } from "./outputs-before-decision-rule.js";
|
|
8
|
+
import { studyFolder } from "./study-folder.js";
|
|
9
|
+
import { plansOf } from "./study-registry-rule.js";
|
|
10
|
+
/** The plans and the histories of the paper folder `paper`, whose registry is `r`. */
|
|
11
|
+
export const indexInputOf = (paper, r, deps) => ({
|
|
12
|
+
plans: plansOf(r, studyFolder(paper, deps), deps.codec),
|
|
13
|
+
history: new Map(decideFirstStudies(paper, deps).map((s) => [
|
|
14
|
+
folderKey(s.folder, s.plan),
|
|
15
|
+
indexHistory(s),
|
|
16
|
+
])),
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=study-index-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-index-input.js","sourceRoot":"","sources":["../src/study-index-input.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,SAAS,GAGV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,kBAAkB,GAEnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,sFAAsF;AACtF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,KAAa,EACb,CAAgB,EAChB,IAAe,EACH,EAAE,CAAC,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC;IACvD,OAAO,EAAE,IAAI,GAAG,CACd,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACzC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC;QAC3B,YAAY,CAAC,CAAC,CAAC;KAChB,CAAC,CACH;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { NotAFile } from "./domain/decide-first.ts";
|
|
2
|
+
import type { StudyMode } from "./domain/study-mode.ts";
|
|
3
|
+
import { type PlanTextField, type RegistryState, type Study } from "./domain/study-registry.ts";
|
|
4
|
+
import type { StudyRegistryCodec } from "./ports/study-registry-codec.ts";
|
|
5
|
+
import type { StudyFolder } from "./ports/study-folder.ts";
|
|
6
|
+
/** Whether a decision path is one git can vouch for: a file or nothing yet; else why not. */
|
|
7
|
+
export type DecisionEntry = {
|
|
8
|
+
readonly kind: "ok";
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: "not-a-file";
|
|
11
|
+
readonly what: NotAFile;
|
|
12
|
+
} | {
|
|
13
|
+
readonly kind: "linked";
|
|
14
|
+
readonly link: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* What the decision file `file` (relative to the paper) is, read through `folder` without following
|
|
18
|
+
* a link: a decision must be a regular file in real directories — git answers for a directory with
|
|
19
|
+
* the commits of anything under it, for a link with the link and not the file it points to, and for a
|
|
20
|
+
* path through a linked directory with what lies behind the link.
|
|
21
|
+
*/
|
|
22
|
+
export declare const decisionEntry: (folder: StudyFolder, file: string) => DecisionEntry;
|
|
23
|
+
/**
|
|
24
|
+
* A study whose plan parsed with a mode: its row, the plan's path in its folder, the mode, and the
|
|
25
|
+
* plan's empty texts — none when it is ready. Only a ready plan's mode decides anything: a draft may
|
|
26
|
+
* name no outputs, or an empty decision file.
|
|
27
|
+
*/
|
|
28
|
+
export interface ModeStudy {
|
|
29
|
+
readonly row: Study;
|
|
30
|
+
readonly plan: string;
|
|
31
|
+
readonly mode: StudyMode;
|
|
32
|
+
readonly empty: readonly PlanTextField[];
|
|
33
|
+
}
|
|
34
|
+
/** What reading the plan of one row gave: its mode study, nothing, or a link on the way to it. */
|
|
35
|
+
export type ModeRead = {
|
|
36
|
+
readonly kind: "mode";
|
|
37
|
+
readonly study: ModeStudy;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "none";
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: "linked";
|
|
42
|
+
readonly link: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The plan of the row `s`, read through `folder` (`src/study-folder.ts`, which follows no link and
|
|
46
|
+
* enters no folder that is not one inside `repro/`): its mode study when the plan parsed with a
|
|
47
|
+
* mode; a link on the way to it; else nothing.
|
|
48
|
+
*/
|
|
49
|
+
export declare const readModeStudy: (s: Study, folder: StudyFolder, codec: StudyRegistryCodec) => ModeRead;
|
|
50
|
+
/**
|
|
51
|
+
* Every study of the registry `r` whose plan declares a mode, in registry order. A plan that does
|
|
52
|
+
* not parse, or is reached through a link, is `repro/study-registered`'s to report; here it declares
|
|
53
|
+
* nothing.
|
|
54
|
+
*/
|
|
55
|
+
export declare const modeStudies: (r: RegistryState, folder: StudyFolder, codec: StudyRegistryCodec) => readonly ModeStudy[];
|
|
56
|
+
//# sourceMappingURL=study-modes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-modes.d.ts","sourceRoot":"","sources":["../src/study-modes.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,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AcF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,GAAG,aAAa,EAChB,QAAQ,WAAW,EACnB,OAAO,kBAAkB,KACxB,SAAS,SAAS,EAMlB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading a paper's studies with their modes: each registered study whose `plan.json` parses with a
|
|
3
|
+
* `mode`, and how a decision's path stands. What `repro/outputs-before-decision`, `studies gate`
|
|
4
|
+
* and the index's mode columns read with (docs/design/study-modes.md). A row whose folder is not one
|
|
5
|
+
* folder inside `repro/` is never read through.
|
|
6
|
+
*/
|
|
7
|
+
import { posix } from "node:path";
|
|
8
|
+
import { filter, map, pipe } from "remeda";
|
|
9
|
+
import { studiesOf, } from "./domain/study-registry.js";
|
|
10
|
+
/**
|
|
11
|
+
* What the decision file `file` (relative to the paper) is, read through `folder` without following
|
|
12
|
+
* a link: a decision must be a regular file in real directories — git answers for a directory with
|
|
13
|
+
* the commits of anything under it, for a link with the link and not the file it points to, and for a
|
|
14
|
+
* path through a linked directory with what lies behind the link.
|
|
15
|
+
*/
|
|
16
|
+
export const decisionEntry = (folder, file) => {
|
|
17
|
+
const at = folder.entryAt(file);
|
|
18
|
+
if (at.kind === "dir")
|
|
19
|
+
return { kind: "not-a-file", what: "directory" };
|
|
20
|
+
if (at.kind === "other")
|
|
21
|
+
return { kind: "not-a-file", what: "special file" };
|
|
22
|
+
if (at.kind !== "linked")
|
|
23
|
+
return { kind: "ok" };
|
|
24
|
+
return at.link === posix.normalize(file)
|
|
25
|
+
? { kind: "not-a-file", what: "symbolic link" }
|
|
26
|
+
: at;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The plan of the row `s`, read through `folder` (`src/study-folder.ts`, which follows no link and
|
|
30
|
+
* enters no folder that is not one inside `repro/`): its mode study when the plan parsed with a
|
|
31
|
+
* mode; a link on the way to it; else nothing.
|
|
32
|
+
*/
|
|
33
|
+
export const readModeStudy = (s, folder, codec) => {
|
|
34
|
+
const plan = s.plan;
|
|
35
|
+
if (plan === undefined)
|
|
36
|
+
return { kind: "none" };
|
|
37
|
+
const read = folder.read(s.folder, plan);
|
|
38
|
+
if (read.kind === "linked")
|
|
39
|
+
return read;
|
|
40
|
+
if (read.kind === "absent")
|
|
41
|
+
return { kind: "none" };
|
|
42
|
+
const parsed = codec.parsePlan(read.text, s.kind);
|
|
43
|
+
if (parsed.kind === "unreadable" || parsed.plan.mode === undefined)
|
|
44
|
+
return { kind: "none" };
|
|
45
|
+
const empty = parsed.kind === "draft" ? parsed.empty : [];
|
|
46
|
+
return {
|
|
47
|
+
kind: "mode",
|
|
48
|
+
study: { row: s, plan, mode: parsed.plan.mode, empty },
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Every study of the registry `r` whose plan declares a mode, in registry order. A plan that does
|
|
53
|
+
* not parse, or is reached through a link, is `repro/study-registered`'s to report; here it declares
|
|
54
|
+
* nothing.
|
|
55
|
+
*/
|
|
56
|
+
export const modeStudies = (r, folder, codec) => pipe(studiesOf(r), map((s) => readModeStudy(s, folder, codec)), filter(isMode), map((m) => m.study));
|
|
57
|
+
/** A plan read that declared a mode. */
|
|
58
|
+
const isMode = (m) => m.kind === "mode";
|
|
59
|
+
//# sourceMappingURL=study-modes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"study-modes.js","sourceRoot":"","sources":["../src/study-modes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG3C,OAAO,EACL,SAAS,GAIV,MAAM,4BAA4B,CAAC;AAUpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAmB,EACnB,IAAY,EACG,EAAE;IACjB,MAAM,EAAE,GAAG,MAAM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,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;KACvD,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,CAAgB,EAChB,MAAmB,EACnB,KAAyB,EACH,EAAE,CACxB,IAAI,CACF,SAAS,CAAC,CAAC,CAAC,EACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,EAC3C,MAAM,CAAC,MAAM,CAAC,EACd,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACpB,CAAC;AAEJ,wCAAwC;AACxC,MAAM,MAAM,GAAG,CAAC,CAAW,EAA4C,EAAE,CACvE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC"}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { type RegistryState, type StudyFinding } from "./domain/study-registry.ts";
|
|
1
|
+
import { type PlanState, type RegistryState, type StudyFinding } from "./domain/study-registry.ts";
|
|
2
2
|
import type { FolderLayoutDeps } from "./folder-layout-rule.ts";
|
|
3
3
|
import type { FolderRuleModule } from "./folder-venue-rule.ts";
|
|
4
|
+
import type { Files } from "./ports/files.ts";
|
|
5
|
+
import type { ListEntries } from "./ports/list-entries.ts";
|
|
4
6
|
import type { StudyRegistryCodec } from "./ports/study-registry-codec.ts";
|
|
7
|
+
import type { StudyFolder } from "./ports/study-folder.ts";
|
|
5
8
|
/** What the rule reads with: the disk, its listings, and the registry's parser. */
|
|
6
9
|
export interface StudyRegistryDeps extends FolderLayoutDeps {
|
|
7
10
|
readonly codec: StudyRegistryCodec;
|
|
11
|
+
/** `repro/`'s entries, links not followed: a study folder that is a link is never read through. */
|
|
12
|
+
readonly entries: ListEntries;
|
|
8
13
|
}
|
|
14
|
+
/** The text of the file at `p`; null when there is none, or a directory sits there. */
|
|
15
|
+
export declare const textAt: (files: Files, p: string) => string | null;
|
|
9
16
|
/** The registry of the paper folder `dir`: absent, unreadable with why, or read. */
|
|
10
17
|
export declare function registryOf(dir: string, deps: Pick<StudyRegistryDeps, "files" | "codec">): RegistryState;
|
|
18
|
+
/**
|
|
19
|
+
* The plan each row of `r` names, read and parsed, by `<folder>/<plan>`; a plan not there is left out.
|
|
20
|
+
* A plan still named `prereg.json` is parsed by the loose schema of its old name.
|
|
21
|
+
*/
|
|
22
|
+
export declare const plansOf: (r: RegistryState, folder: StudyFolder, codec: StudyRegistryCodec) => ReadonlyMap<string, PlanState>;
|
|
11
23
|
/** Every finding of the paper folder `dir`'s study registry — THE function behind both rules. */
|
|
12
24
|
export declare function studyFindings(dir: string, deps: StudyRegistryDeps): readonly StudyFinding[];
|
|
13
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"study-registry-rule.d.ts","sourceRoot":"","sources":["../src/study-registry-rule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"study-registry-rule.d.ts","sourceRoot":"","sources":["../src/study-registry-rule.ts"],"names":[],"mappings":"AA4BA,OAAO,EASL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,YAAY,EAGlB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KA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, join, posix } from "node:path";
|
|
21
|
+
import { filter, map, pipe } from "remeda";
|
|
21
22
|
import { callerPath } from "./caller-path.js";
|
|
22
23
|
import { README, REPRO_BYPRODUCTS, REPRO_DIR, REPRO_DIRS, } from "./domain/repro-layout.js";
|
|
23
|
-
import { LEGACY_PLAN_FILE, PLAN_NAME_PROBLEMS, STUDIES_FILE, judgeStudies,
|
|
24
|
+
import { LEGACY_PLAN_FILE, PLAN_NAME_PROBLEMS, STUDIES_FILE, judgeStudies, folderKey, planRefs, studiesOf, studyMessage, } from "./domain/study-registry.js";
|
|
24
25
|
import { reproEntriesOf } from "./repro-layout-rule.js";
|
|
26
|
+
import { studyFolder } from "./study-folder.js";
|
|
25
27
|
import { rulePageUrl } from "./venue-rules.js";
|
|
26
28
|
const STATUS_FILE = "PIPELINE-STATUS.md";
|
|
27
29
|
/** The text of the file at `p`; null when there is none, or a directory sits there. */
|
|
28
|
-
const textAt = (files, p) => {
|
|
30
|
+
export const textAt = (files, p) => {
|
|
29
31
|
const b = files.isFile(callerPath(p)) ? files.readBytes(callerPath(p)) : null;
|
|
30
32
|
return b === null ? null : new TextDecoder().decode(b);
|
|
31
33
|
};
|
|
@@ -45,37 +47,47 @@ const studyFolders = (dir, deps) => reproEntriesOf(dir, deps)
|
|
|
45
47
|
!REPRO_DIRS.includes(e.name) &&
|
|
46
48
|
!REPRO_BYPRODUCTS.includes(e.name))
|
|
47
49
|
.map((e) => e.name);
|
|
48
|
-
/**
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
/** What each `<folder>/<result_file>` of `r`'s rows is, as the study folder's reader finds it. */
|
|
51
|
+
const resultsOf = (r, folder) => pipe(studiesOf(r), filter(hasResultFile), map((s) => [
|
|
52
|
+
folderKey(s.folder, s.result_file),
|
|
53
|
+
folder.locate(s.folder, s.result_file),
|
|
54
|
+
]), (entries) => new Map(entries));
|
|
55
|
+
/** A row that names a result file. */
|
|
56
|
+
const hasResultFile = (s) => s.result_file !== undefined;
|
|
54
57
|
/**
|
|
55
58
|
* The plan each row of `r` names, read and parsed, by `<folder>/<plan>`; a plan not there is left out.
|
|
56
59
|
* A plan still named `prereg.json` is parsed by the loose schema of its old name.
|
|
57
60
|
*/
|
|
58
|
-
const plansOf = (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (text === null)
|
|
64
|
-
return [];
|
|
65
|
-
const parse = posix.basename(key) === LEGACY_PLAN_FILE
|
|
66
|
-
? deps.codec.parseLegacyPlan
|
|
67
|
-
: deps.codec.parsePlan;
|
|
68
|
-
return [[key, parse(text)]];
|
|
61
|
+
export const plansOf = (r, folder, codec) => new Map((r.kind === "read" ? planRefs(r.registry) : []).flatMap((ref) => {
|
|
62
|
+
const state = planStateOf(ref, folder, codec);
|
|
63
|
+
return state === null
|
|
64
|
+
? []
|
|
65
|
+
: [[folderKey(ref.folder, ref.plan), state]];
|
|
69
66
|
}));
|
|
67
|
+
/** The state of the plan `ref` names, read through `folder`; null when it is not there. */
|
|
68
|
+
const planStateOf = ({ folder: of, plan, kind }, folder, codec) => {
|
|
69
|
+
const read = folder.read(of, plan);
|
|
70
|
+
switch (read.kind) {
|
|
71
|
+
case "absent":
|
|
72
|
+
return null;
|
|
73
|
+
case "linked":
|
|
74
|
+
return { kind: "linked", link: read.link };
|
|
75
|
+
case "text":
|
|
76
|
+
return posix.basename(plan) === LEGACY_PLAN_FILE
|
|
77
|
+
? codec.parseLegacyPlan(read.text)
|
|
78
|
+
: codec.parsePlan(read.text, kind);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
70
81
|
/** Every finding of the paper folder `dir`'s study registry — THE function behind both rules. */
|
|
71
82
|
export function studyFindings(dir, deps) {
|
|
72
83
|
const registry = registryOf(dir, deps);
|
|
84
|
+
const folder = studyFolder(dir, deps);
|
|
73
85
|
return judgeStudies({
|
|
74
86
|
folders: studyFolders(dir, deps),
|
|
75
87
|
registry,
|
|
76
88
|
readme: textAt(deps.files, join(dir, REPRO_DIR, README)),
|
|
77
|
-
|
|
78
|
-
plans: plansOf(
|
|
89
|
+
results: resultsOf(registry, folder),
|
|
90
|
+
plans: plansOf(registry, folder, deps.codec),
|
|
79
91
|
});
|
|
80
92
|
}
|
|
81
93
|
/** The problems `repro/study-registered` reports, each its own message id; the text is `studyMessage`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"study-registry-rule.js","sourceRoot":"","sources":["../src/study-registry-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,
|
|
1
|
+
{"version":3,"file":"study-registry-rule.js","sourceRoot":"","sources":["../src/study-registry-rule.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GAOb,MAAM,4BAA4B,CAAC;AASpC,O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