paperlint 11.1.1 → 11.1.3

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.
@@ -0,0 +1,437 @@
1
+ /**
2
+ * The `submission-confirm` hook — no send to a venue's portal without the person's own yes to it.
3
+ * PreToolUse on `Bash` (`plugin/hooks/hooks.json`): a command that sends a submission — `paperlint
4
+ * submission new|update` with `--save` or `--submit` — runs only when the person has said yes, in an
5
+ * `AskUserQuestion` asked since the last send, to a question naming the paper folder (its full path)
6
+ * and the sha256 of the PDF it sends.
7
+ * A command that names a portal's host runs only after a yes to a question naming that host and the
8
+ * command's first 60 characters. Without the yes the command is refused (`"permissionDecision":
9
+ * "deny"`), and the reason tells the agent exactly what to ask. Anything else: no output.
10
+ *
11
+ * ── WHY A QUESTION, NOT CLAUDE CODE'S PERMISSION PROMPT ──────────────────────────
12
+ * It used to answer `ask` (paperlint#283). The Claude mobile app's permission card shows only the
13
+ * command line, not the hook's reason, so the person approved a shell line without seeing which
14
+ * paper or PDF it sends (paperlint#291). `AskUserQuestion` shows the whole question on every
15
+ * client, and a yes to a question that names the folder and the sha256 is a yes to those bytes in that
16
+ * folder: a stale build or a wrong PDF has another sha, and identical bytes in another folder (the
17
+ * same manuscript for another venue) have another path, so their yes does not count.
18
+ *
19
+ * ── WHERE THE YES IS READ ─────────────────────────────────────────────────────────
20
+ * The session's transcript (`transcript_path` in the hook's input, one JSON entry per line). A
21
+ * question is the assistant's `tool_use` named `AskUserQuestion`; its answer is the user entry that
22
+ * carries the matching `tool_result`, whose `toolUseResult.answers` maps each question's text to the
23
+ * option chosen. An answer is a yes when its first word is "yes". Every earlier `Bash` call that
24
+ * sends or names a portal — refused or not, but not this one (`tool_use_id`) — uses up the questions
25
+ * before it, so one yes lets one command through. Within one command each send takes an answer of
26
+ * its own: a yes that names two shas, or the same PDF sent twice, covers one send. When several
27
+ * questions name the same thing, the latest decides.
28
+ *
29
+ * ── WHAT IT SEES, AND WHAT IT IS NOT ──────────────────────────────────────────────
30
+ * A send is judged on the command as the shell reads it (`shellLeaves`: each simple command across
31
+ * `&&`, `;`, `|`, words unquoted, the commands inside a `bash -c "…"` string too), never on the raw
32
+ * text: `submission`, `new|update` and `--save|--submit` in one command's words; or a portal's host
33
+ * in any word (a HotCRP-hosted site, or a host a venue preset declares), whatever program it runs —
34
+ * such a command may send around paperlint's venue check, and has no PDF to name, so the question
35
+ * names the host and the command instead. When the presets cannot be read, only HotCRP-hosted sites
36
+ * and paperlint sends are recognised, and a refusal says so: one bad preset does not stop the shell.
37
+ * NOT SEEN: an upload from a script file that names the host only inside the file, or words built
38
+ * at run time (`$(…)`).
39
+ *
40
+ * The agent writes the question, so a deliberately misleading question still passes. The hook
41
+ * catches an agent that sends without asking, or asks about other bytes; it is not a security
42
+ * boundary against an agent that deliberately disguises a send.
43
+ *
44
+ * ── IT FAILS CLOSED ───────────────────────────────────────────────────────────────
45
+ * A send whose PDF cannot be told for certain, a PDF that is not there, no transcript, a payload
46
+ * that is not JSON, a crash: refused, with what went wrong. A transcript line that is not JSON is
47
+ * not a reason to refuse every send for the rest of the session — real transcripts have them (an
48
+ * entry cut short and run into the next, measured in a live one) — so it counts as a send when its
49
+ * text may hold one, and a yes before it no longer counts. Only lines that may hold a question, an
50
+ * answer or a send are parsed, and the shell parser runs only on commands that say `submission` or
51
+ * a portal's host:
52
+ * a transcript of hundreds of megabytes is read in seconds.
53
+ *
54
+ * ── WHY IN-PROCESS, NOT A VIGILES PROGRAM ────────────────────────────────────────
55
+ * It reads the build's facts with this package's own parser and hashes the PDF; a shipped vigiles
56
+ * hook may import nothing but `vigiles/hook` (`src/folder-layout-hook.ts` says the rest). So
57
+ * `paperlint hook submission-confirm` runs it in-process (`runHook`, src/cli.ts).
58
+ */
59
+ import { isAbsolute, join, relative, resolve } from "node:path";
60
+ import { callerPath } from "./caller-path.js";
61
+ import { bodyEnd } from "./domain/body-pages.js";
62
+ import { fieldOf, isRecord } from "./domain/record.js";
63
+ import { sha256Hex } from "./domain/sha256.js";
64
+ import { messageOf } from "./domain/text.js";
65
+ import { factsPath, parseFactsText } from "./facts-file.js";
66
+ import { paperPreset } from "./presets.js";
67
+ import { paperPdf } from "./submission.js";
68
+ const deny = (reason) => ({
69
+ hookSpecificOutput: {
70
+ hookEventName: "PreToolUse",
71
+ permissionDecision: "deny",
72
+ permissionDecisionReason: reason,
73
+ },
74
+ });
75
+ /** The domain of HotCRP's hosted sites; a self-hosted portal is known by the host its preset declares. */
76
+ const HOTCRP_HOSTED = "hotcrp.com";
77
+ /**
78
+ * Every simple command the shell would run: the command line's own, and those inside a string
79
+ * argument (`bash -c "…"`), parsed the same way.
80
+ */
81
+ function allLeaves(command, parse) {
82
+ const top = parse(command);
83
+ return [
84
+ ...top,
85
+ ...top.flatMap((l) => l.args.filter((a) => /\s/u.test(a)).flatMap((a) => allLeaves(a, parse))),
86
+ ];
87
+ }
88
+ /** A `paperlint submission new|update` with `--save` or `--submit`, in the words of one command. */
89
+ function isSend(l) {
90
+ const at = l.args.indexOf("submission");
91
+ return (at >= 0 &&
92
+ l.args.slice(at + 1).some((w) => w === "new" || w === "update") &&
93
+ l.hasFlag("save", "submit"));
94
+ }
95
+ /** Programs that change the directory the rest of the command line runs in. */
96
+ const MOVES = new Set(["cd", "pushd", "popd"]);
97
+ /**
98
+ * Every send among the simple commands of a command line: its paper and PDF as the command's own
99
+ * argument parser reads them, or null where they cannot be told for certain — the words do not
100
+ * parse, or something before it may have changed the directory.
101
+ */
102
+ function sendsIn(leaves, readSend) {
103
+ return leaves.flatMap((l, n) => {
104
+ const at = l.args.findIndex((x, i) => x === "submission" && /^(?:new|update)$/u.test(l.args[i + 1] ?? ""));
105
+ if (at < 0 || !l.hasFlag("save", "submit"))
106
+ return [];
107
+ const moved = leaves
108
+ .slice(0, n + 1)
109
+ .some((x) => MOVES.has(x.head) || x.chdir !== null);
110
+ return [moved ? null : readSend(l.args.slice(at + 1))];
111
+ });
112
+ }
113
+ /** The words of the commands that may name a host: those with a dot, lowercased. */
114
+ const dottedWords = (leaves) => leaves
115
+ .flatMap((l) => [l.head, ...l.args])
116
+ .map((w) => w.toLowerCase())
117
+ .filter((w) => w.includes("."));
118
+ /** The portal hosts known: HotCRP's hosted sites always, then those `hosts` names; lowercased. */
119
+ const knownHosts = (hosts) => [HOTCRP_HOSTED, ...hosts].map((h) => h.toLowerCase()).filter((h) => h !== "");
120
+ /**
121
+ * The portal host a command names — a HotCRP-hosted site, or a host a venue preset declares
122
+ * (`hosts`), whatever program it runs, as a plain case-insensitive substring of a word — or null.
123
+ * Judged on the shell's words only, never on the raw text.
124
+ */
125
+ function portalHost(leaves, hosts) {
126
+ const words = dottedWords(leaves);
127
+ return (knownHosts(hosts).find((h) => words.some((w) => w.includes(h))) ?? null);
128
+ }
129
+ /** The body pages the build counted: up to the references or appendix, or banal's count. */
130
+ function bodyPages(f) {
131
+ const end = bodyEnd(f.text.pages, {
132
+ bib: f.text.bibAnchorPage,
133
+ appendix: f.text.appendixAnchorPage,
134
+ });
135
+ if (end.kind === "found")
136
+ return `body pages: ${String(end.bodyPages)} (up to the ${end.by} on page ${String(end.page)})`;
137
+ return f.geometry === null
138
+ ? "body pages: not counted (the build found no references heading and measured no geometry)"
139
+ : `body pages: ${String(f.geometry.body_pages)} (as banal counts them)`;
140
+ }
141
+ /** What the build's facts say about the PDF to be sent, in lines. */
142
+ function factsLines(paperDir, sha, files) {
143
+ const bytes = files.readBytes(callerPath(factsPath(paperDir)));
144
+ if (bytes === null)
145
+ return [
146
+ "no build facts (_build/paper.facts.json): the paper was not built, so the venue check did not see this PDF",
147
+ ];
148
+ const f = parseFactsText(new TextDecoder().decode(bytes));
149
+ if (!f.ok)
150
+ return [
151
+ `could not read the build facts (_build/paper.facts.json): ${f.error.kind === "schema" ? `schema ${f.error.got}` : f.error.why}`,
152
+ ];
153
+ const stale = sha !== f.value.sha
154
+ ? [
155
+ "!! THE LAST BUILD IS NOT OF THIS PDF — the check did not see it. Rebuild (`paperlint build`) and run the dry run again.",
156
+ ]
157
+ : [];
158
+ return [...stale, bodyPages(f.value)];
159
+ }
160
+ /** One send, described: the paper, the PDF as the command resolves it, what the build saw. */
161
+ function describe(send, cwd, deps) {
162
+ const paperDir = resolve(cwd, send.paper ?? ".");
163
+ const p = paperPreset(paperDir, deps);
164
+ const own = paperPdf(paperDir, p.kind === "settings-problem" ? null : p.settings);
165
+ const pdf = send.pdf === null ? own : resolve(cwd, send.pdf);
166
+ const bytes = deps.files.readBytes(callerPath(pdf));
167
+ const sha = bytes === null ? null : sha256Hex(bytes);
168
+ return {
169
+ named: sha === null ? null : { folder: paperDir, sha: sha.slice(0, SHA_SHOWN) },
170
+ lines: [
171
+ `paper folder: ${paperDir}`,
172
+ `PDF: ${send.pdf ?? join(send.paper ?? ".", relative(paperDir, own))}${sha === null ? " — NOT FOUND" : `, sha256 ${sha.slice(0, SHA_SHOWN)}`}`,
173
+ ...factsLines(paperDir, sha, deps.files),
174
+ ],
175
+ };
176
+ }
177
+ /** How much of the sha256 the reason shows, and the question must contain. */
178
+ const SHA_SHOWN = 12;
179
+ /** A send whose PDF cannot be told for certain. */
180
+ const UNRESOLVED = "could not resolve which PDF this send uploads — check the dry run";
181
+ const NOT_SENT = "Not run: this sends the paper to the venue's portal";
182
+ const NAMES_PORTAL = "Not run: this command names a venue's submission portal";
183
+ /** What to ask, once every send's PDF is known. */
184
+ const HOW_TO_ASK = [
185
+ "Ask the person with AskUserQuestion first, then run this command again. In the question, give:",
186
+ "- the paper folder (the full path, as written above), the PDF and its sha256 as written above (the folder path and the sha256 must both be in the question text),",
187
+ "- what the lines above say about the build (the body pages, or that it is stale or missing),",
188
+ "- the dry run's venue check, quoted word for word (its `venue rules at their default options` line and every error under it).",
189
+ 'Options: "Yes, send it" and "No". One yes lets one send through: ask one question per send, each naming its own folder and sha256.',
190
+ ].join("\n");
191
+ /** How much of a command naming a portal the question must quote. */
192
+ const COMMAND_SHOWN = 60;
193
+ /** What to ask before a command that names a portal. */
194
+ const HOW_TO_ASK_PORTAL = [
195
+ "It may send to the portal around paperlint's venue check. Ask the person with AskUserQuestion first, then run this command again: the question must contain the portal host and the command start above, exactly as written, and say what the command does.",
196
+ 'Options: "Yes, run it" and "No". One yes lets one command through. To send a paper, use `paperlint submission new|update --save` instead.',
197
+ ].join("\n");
198
+ /** Each send's block: alone, or numbered when the command has several. */
199
+ function blocks(described) {
200
+ return described.length === 1
201
+ ? described.flatMap((d) => d.lines)
202
+ : described.flatMap((d, n) => [
203
+ `send ${String(n + 1)} of ${String(described.length)}:`,
204
+ ...d.lines,
205
+ ]);
206
+ }
207
+ /** A transcript line that may hold a question, an answer or a send; no other line is parsed. */
208
+ const MAY_MATTER = /"tool_use"|"toolUseResult"/u;
209
+ /** Nothing asked or answered: the start, and the state right after a send. */
210
+ const CLEARED = { asked: new Set(), answers: [] };
211
+ /** A transcript line that is not JSON. */
212
+ const BROKEN = Symbol("broken");
213
+ /**
214
+ * The person's answers to `AskUserQuestion` since the last send in the transcript, oldest first.
215
+ * A line that may matter and is not JSON (real transcripts have them: an entry cut short, run into
216
+ * the next) counts as a send when it may hold one, so a yes before it is used up — never wrongly
217
+ * kept; otherwise it is skipped, and a yes lost in it only means asking again.
218
+ */
219
+ export function answersSinceLastSend(transcript, earlier) {
220
+ return transcript.split("\n").reduce((since, line) => {
221
+ if (!MAY_MATTER.test(line))
222
+ return since;
223
+ const entry = parsedLine(line);
224
+ if (entry === BROKEN)
225
+ return earlier.mayHold(line) ? CLEARED : since;
226
+ const content = fieldOf(fieldOf(entry, "message"), "content");
227
+ return (Array.isArray(content) ? content : []).reduce((s, block) => fieldOf(block, "type") === "tool_result"
228
+ ? toolResult(s, block, entry)
229
+ : toolUse(s, block, earlier), since);
230
+ }, CLEARED).answers;
231
+ }
232
+ /** One transcript line, parsed; BROKEN when it is not JSON. */
233
+ function parsedLine(line) {
234
+ try {
235
+ return JSON.parse(line);
236
+ }
237
+ catch {
238
+ return BROKEN;
239
+ }
240
+ }
241
+ /** A block the assistant wrote: a question is noted; an earlier send clears what was asked before it. */
242
+ function toolUse(s, block, earlier) {
243
+ const id = fieldOf(block, "id");
244
+ if (fieldOf(block, "type") !== "tool_use" || typeof id !== "string")
245
+ return s;
246
+ const name = fieldOf(block, "name");
247
+ if (name === "AskUserQuestion")
248
+ return { ...s, asked: new Set([...s.asked, id]) };
249
+ const command = fieldOf(fieldOf(block, "input"), "command");
250
+ const send = name === "Bash" &&
251
+ id !== earlier.current &&
252
+ typeof command === "string" &&
253
+ earlier.mayHold(command) &&
254
+ earlier.sends(command);
255
+ return send ? CLEARED : s;
256
+ }
257
+ /** The person's reply to a question asked since the last send: its answers, kept in order. */
258
+ function toolResult(s, block, entry) {
259
+ const id = fieldOf(block, "tool_use_id");
260
+ if (typeof id !== "string" || !s.asked.has(id))
261
+ return s;
262
+ const answers = fieldOf(fieldOf(entry, "toolUseResult"), "answers");
263
+ const given = Object.entries(isRecord(answers) ? answers : {}).flatMap(([question, answer]) => typeof answer === "string" ? [{ question, answer }] : []);
264
+ return { ...s, answers: [...s.answers, ...given] };
265
+ }
266
+ /** Whether an answer is a yes: its first word, in any case. */
267
+ const isYes = (a) => /^yes\b/iu.test(a.answer.trim());
268
+ /** Whether `text` contains every one of `keys`, in any case. */
269
+ const hasAll = (text, keys) => keys.every((k) => text.toLowerCase().includes(k.toLowerCase()));
270
+ /** `text` as a literal inside a regular expression. */
271
+ const literal = (text) => text.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
272
+ /**
273
+ * Whether a question names the folder `folder` and not a longer path that starts with it
274
+ * (`/w/paper` is not `/w/paper2` or `/w/paper.old`), nor one it ends: the whole path, case-sensitive.
275
+ */
276
+ const namesFolder = (question, folder) => new RegExp(`(?<![\\w.-])${literal(folder)}(?![\\w.-])`, "u").test(question);
277
+ /**
278
+ * The answers used up after one more need: it takes the latest answer not yet taken whose question
279
+ * `names` it, and that answer must be a yes; null when there is none, or it is not.
280
+ */
281
+ function takeYes(answers, taken, names) {
282
+ if (taken === null)
283
+ return null;
284
+ const at = answers.findLastIndex((a, n) => !taken.has(n) && names(a.question));
285
+ const found = answers[at];
286
+ return found !== undefined && isYes(found) ? new Set([...taken, at]) : null;
287
+ }
288
+ /** What a yes to one send must name: its sha256 (any case) and its folder (the whole path, as written). */
289
+ const namesSend = (s) => (question) => hasAll(question, [s.sha]) && namesFolder(question, s.folder);
290
+ /** What a yes to a command that names a portal must name: the host (any case) and the command's start, literally. */
291
+ const namesPortal = (host, start) => (question) => hasAll(question, [host]) && question.includes(start);
292
+ /**
293
+ * Whether every send and the portal command (null for none) has a yes of its own. Each takes the
294
+ * latest answer not yet taken, in turn, from one shared set: a yes used up by a send cannot also
295
+ * approve the portal, one that names two shas covers one send, and the same PDF sent twice needs
296
+ * two. (A yes that two needs could share is given to the first; the second is refused and the
297
+ * person is asked again: it fails closed.)
298
+ */
299
+ const everyNeedHasItsYes = (answers, sends, portal) => [...sends.map(namesSend), ...(portal === null ? [] : [portal])].reduce((taken, names) => takeYes(answers, taken, names), new Set()) !== null;
300
+ /** Every send in the command, described; an unresolved one has no sha. */
301
+ function describedSends(command, cwd, deps) {
302
+ const sends = /[`$]/u.test(command)
303
+ ? []
304
+ : sendsIn(deps.shellLeaves(command), deps.readSend);
305
+ return (sends.length === 0 ? [null] : sends).map((x) => x === null ? { named: null, lines: [UNRESOLVED] } : describe(x, cwd, deps));
306
+ }
307
+ /** The refusal of a send whose PDF is not known or not there: there is no sha256 to ask about. */
308
+ const noPdf = (described) => [
309
+ `${NOT_SENT}, and paperlint cannot find the PDF it uploads, so there is no sha256 to ask the person about.`,
310
+ ...blocks(described),
311
+ "Name the paper folder and the PDF plainly (no cd, no $…), build the PDF, run the dry run, and ask then.",
312
+ ];
313
+ /** The presets' hosts; when they cannot be read, none, and why. */
314
+ function readHosts(cwd, deps) {
315
+ try {
316
+ return { hosts: deps.portalHosts(cwd), failed: null };
317
+ }
318
+ catch (e) {
319
+ return { hosts: [], failed: messageOf(e) };
320
+ }
321
+ }
322
+ /** The line a refusal ends with when the presets could not be read; none when they could. */
323
+ const fallbackLines = (h) => h.failed === null
324
+ ? []
325
+ : [
326
+ `The venue presets could not be read (${h.failed}), so only HotCRP-hosted sites and paperlint sends are recognised until they are fixed.`,
327
+ ];
328
+ /**
329
+ * A command that sends: let through (null) when the person said yes to it since the last send —
330
+ * each paperlint send by its paper folder and its PDF's sha256, a yes of its own for each, a portal
331
+ * named by its host and the command's start —
332
+ * else the lines of the refusal, with what to ask.
333
+ */
334
+ function decide(c, payload, deps) {
335
+ const described = c.paperlint ? describedSends(c.text, c.cwd, deps) : [];
336
+ const named = described.flatMap((d) => (d.named === null ? [] : [d.named]));
337
+ if (named.length < described.length)
338
+ return noPdf(described);
339
+ const base = c.paperlint ? NOT_SENT : NAMES_PORTAL;
340
+ const read = transcriptOf(payload, deps.files);
341
+ if (typeof read !== "string")
342
+ return [
343
+ `${base}, and ${read.failed}, so paperlint cannot see the person's yes.`,
344
+ ];
345
+ const start = c.text.trim().slice(0, COMMAND_SHOWN);
346
+ const answers = answersSinceLastSend(read, earlierSend(c, payload, deps));
347
+ const portal = c.host === null ? null : namesPortal(c.host, start);
348
+ if (everyNeedHasItsYes(answers, named, portal))
349
+ return null;
350
+ return [
351
+ `${base}, and the person has not said yes to it since the last send.`,
352
+ ...blocks(described),
353
+ ...(c.paperlint ? [HOW_TO_ASK] : []),
354
+ ...portalLines(c.host, start),
355
+ ];
356
+ }
357
+ /** What a refusal says about a portal the command names: the host, the start, what to ask; none for none. */
358
+ const portalLines = (host, start) => host === null
359
+ ? []
360
+ : [`portal host: ${host}`, `command start: ${start}`, HOW_TO_ASK_PORTAL];
361
+ /** How an earlier send is told in the transcript: by the same matching as this command. */
362
+ function earlierSend(c, payload, deps) {
363
+ const known = knownHosts(c.hosts.hosts);
364
+ return {
365
+ current: stringField(payload, "tool_use_id"),
366
+ mayHold: (text) => {
367
+ const plain = text.replace(/["'\\]/gu, "").toLowerCase();
368
+ return (plain.includes("submission") || known.some((h) => plain.includes(h)));
369
+ },
370
+ sends: (command) => {
371
+ const leaves = allLeaves(command, deps.shellLeaves);
372
+ return leaves.some(isSend) || portalHost(leaves, known) !== null;
373
+ },
374
+ };
375
+ }
376
+ /** A string field of the payload; null for none. */
377
+ function stringField(payload, key) {
378
+ const v = fieldOf(payload, key);
379
+ return typeof v === "string" ? v : null;
380
+ }
381
+ /** The session's transcript as text, or why it could not be read. */
382
+ function transcriptOf(payload, files) {
383
+ const path = stringField(payload, "transcript_path");
384
+ if (path === null || !isAbsolute(path))
385
+ return { failed: "the hook was given no transcript_path" };
386
+ const bytes = files.readBytes(callerPath(path));
387
+ return bytes === null
388
+ ? { failed: `the transcript ${path} could not be read` }
389
+ : new TextDecoder().decode(bytes);
390
+ }
391
+ /** The refusal when the hook's input cannot be read at all: it cannot tell, so it does not let it run. */
392
+ export const UNREADABLE_INPUT = deny("Not run: paperlint could not read this command, so it cannot tell whether it sends a paper to a venue's portal.");
393
+ /** The payload, parsed; null when it is not JSON. */
394
+ function parsed(stdin) {
395
+ try {
396
+ return JSON.parse(stdin);
397
+ }
398
+ catch {
399
+ return null;
400
+ }
401
+ }
402
+ /** One command, judged: null to let it run, or the refusal. */
403
+ function judge(text, cwd, payload, deps) {
404
+ const leaves = allLeaves(text, deps.shellLeaves);
405
+ const paperlint = leaves.some(isSend);
406
+ // The presets are read only for a command that may send: anything else pays nothing.
407
+ if (!paperlint && dottedWords(leaves).length === 0)
408
+ return null;
409
+ const hosts = readHosts(cwd, deps);
410
+ const host = portalHost(leaves, hosts.hosts);
411
+ if (!paperlint && host === null)
412
+ return null;
413
+ const lines = decide({ text, cwd, paperlint, host, hosts }, payload, deps);
414
+ return lines === null
415
+ ? null
416
+ : deny([...lines, ...fallbackLines(hosts)].join("\n"));
417
+ }
418
+ /**
419
+ * The hook on one payload, as Claude Code sends it on stdin: a refusal, or null to let the command
420
+ * run (it sends nothing, or every send in it has the person's yes). Never throws: a crash refuses.
421
+ */
422
+ export function submissionConfirm(stdin, deps) {
423
+ const payload = parsed(stdin);
424
+ if (payload === null)
425
+ return UNREADABLE_INPUT;
426
+ const raw = fieldOf(fieldOf(payload, "tool_input"), "command");
427
+ const text = typeof raw === "string" ? raw : "";
428
+ const given = fieldOf(payload, "cwd");
429
+ const cwd = typeof given === "string" && isAbsolute(given) ? given : resolve(".");
430
+ try {
431
+ return judge(text, cwd, payload, deps);
432
+ }
433
+ catch (e) {
434
+ return deny(`Not run: paperlint could not check whether this command sends a paper: ${messageOf(e)}.`);
435
+ }
436
+ }
437
+ //# sourceMappingURL=submission-confirm-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submission-confirm-hook.js","sourceRoot":"","sources":["../src/submission-confirm-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAoC3C,MAAM,IAAI,GAAG,CAAC,MAAc,EAAc,EAAE,CAAC,CAAC;IAC5C,kBAAkB,EAAE;QAClB,aAAa,EAAE,YAAY;QAC3B,kBAAkB,EAAE,MAAM;QAC1B,wBAAwB,EAAE,MAAM;KACjC;CAC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AAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3E,OAAO,KAAK,KAAK,IAAI;QACnB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,IAAiB;IAEjB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,gBAAgB,CAAC;IAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,MAAM,GAAG,GACP,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxE,IAAI,CAAC;QACH,OAAO,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,IAAI,CACT,0EAA0E,SAAS,CAAC,CAAC,CAAC,GAAG,CAC1F,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -4,11 +4,13 @@ import { type Author, type CreateOutcome, type NewSubmission, type PortalFailure
4
4
  import { type FieldValues, type VenueFields } from "./domain/submission-fields.ts";
5
5
  import type { Files } from "./ports/files.ts";
6
6
  import type { PortalSite } from "./ports/submission-portal.ts";
7
- import { type PresetDeps } from "./presets.ts";
7
+ import { type PaperPreset, type PresetDeps } from "./presets.ts";
8
+ import type { PaperSettings } from "./paper-settings.ts";
8
9
  import { type InForce } from "./domain/deadline.ts";
9
10
  import { type TokenProblem } from "./domain/portal-token.ts";
10
11
  import type { LatexReader } from "./ports/latex.ts";
11
12
  import type { SourcesCodec } from "./ports/sources-codec.ts";
13
+ import { type VenueMessage } from "./venue-rules.ts";
12
14
  /** How to make and set the site's token: the page, the scopes, the variable. Pure. */
13
15
  export declare function tokenSteps(portal: SupportedPortal, site: PortalSite, variable: string): readonly string[];
14
16
  /** Why there is no token, as the complete instruction the author follows. Pure. */
@@ -48,11 +50,19 @@ export interface SubmissionDeps {
48
50
  readonly latex: LatexReader;
49
51
  /** Reads the build's record of the files TeX read, for the includes (`new`). */
50
52
  readonly codec: SourcesCodec;
53
+ /** Findings on one file, printed as `paperlint lint` prints them (the root passes ESLint's `stylish`). */
54
+ readonly lintText: (file: string, messages: readonly VenueMessage[]) => Promise<string>;
51
55
  readonly log: (line: string) => void;
52
56
  readonly err: (line: string) => void;
53
57
  }
54
58
  /** A paper's portal, its submission there, and the PDF the paper builds. */
55
59
  export interface SubmissionTarget {
60
+ /** The paper's folder, absolute. */
61
+ readonly paperDir: string;
62
+ /** The paper's settings and venue preset, resolved: what the venue rules judge the PDF against. */
63
+ readonly resolved: Extract<PaperPreset, {
64
+ readonly kind: "resolved";
65
+ }>;
56
66
  readonly portal: SupportedPortal;
57
67
  /** The paper's submission on the portal; null before `new` created one. */
58
68
  readonly id: number | null;
@@ -81,6 +91,8 @@ export interface SubmissionTarget {
81
91
  */
82
92
  readonly deadlines: readonly InForce[];
83
93
  }
94
+ /** The PDF a paper sends when no `--pdf` is named: its `pdf` setting, else `paper.pdf`. Pure. */
95
+ export declare const paperPdf: (paperDir: string, settings: Pick<PaperSettings, "pdf"> | null) => string;
84
96
  /** The paper directory → its portal and submission, or the line naming the file and key to set. */
85
97
  export declare function submissionTarget(paperDir: string, deps: PresetDeps): Result<SubmissionTarget, string>;
86
98
  /** A failure in words: HTTP status and the portal's own messages. Never the token. */
@@ -1 +1 @@
1
- {"version":3,"file":"submission.d.ts","sourceRoot":"","sources":["../src/submission.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAIL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAElB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EACV,UAAU,EAEX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,sFAAsF;AACtF,wBAAgB,UAAU,CACxB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,MAAM,GACf,SAAS,MAAM,EAAE,CAOnB;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,YAAY,GACd,SAAS,MAAM,EAAE,CAMnB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAA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