@feigi/fleet-ctl 3.61.1 → 3.63.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/package.json +1 -1
- package/scripts/closeout.mjs +2 -17
- package/scripts/fleet-event.mjs +583 -0
- package/scripts/fleet-tick.mjs +119 -20
- package/scripts/ledger-grammar.mjs +7 -0
- package/scripts/ledger.mjs +5 -3
- package/scripts/phase0-receipt.mjs +24 -4
- package/skills/run-team/SKILL.md +19 -1
- package/skills/run-team/references/phase-0.md +4 -3
package/package.json
CHANGED
package/scripts/closeout.mjs
CHANGED
|
@@ -78,8 +78,9 @@ import { makeDie, defineFlags } from "./arg.mjs";
|
|
|
78
78
|
import { FleetDirUnresolvable, fleetFile } from "./fleet-dir.mjs";
|
|
79
79
|
import { gitEnv } from "./git-env.mjs";
|
|
80
80
|
import { isCLI } from "./is-cli.mjs";
|
|
81
|
-
import { CLOSEOUT_RECEIPT,
|
|
81
|
+
import { CLOSEOUT_RECEIPT, memberTokens, rowPr } from "./ledger-grammar.mjs";
|
|
82
82
|
import { encodeProjectDir, isOmpSessionDirName } from "./member-record.mjs";
|
|
83
|
+
import { tickCaps } from "./phase0-receipt.mjs";
|
|
83
84
|
|
|
84
85
|
const NAME = "closeout";
|
|
85
86
|
const SCRIPTS = dirname(fileURLToPath(import.meta.url));
|
|
@@ -209,22 +210,6 @@ function stepRelease({ cwd }) {
|
|
|
209
210
|
|
|
210
211
|
// ── finish ───────────────────────────────────────────────────────────────────
|
|
211
212
|
|
|
212
|
-
// The caps `phase0.mjs` recorded, as the tick's own flags; none when there is
|
|
213
|
-
// no receipt or it names none.
|
|
214
|
-
function tickCaps(fleetDir) {
|
|
215
|
-
let phase0;
|
|
216
|
-
try {
|
|
217
|
-
phase0 = JSON.parse(readFileSync(join(fleetDir, RECEIPT), "utf8"));
|
|
218
|
-
} catch (e) {
|
|
219
|
-
if (e.code === "ENOENT") return { args: [] };
|
|
220
|
-
return { error: `cannot read ${join(fleetDir, RECEIPT)}: ${e.message}` };
|
|
221
|
-
}
|
|
222
|
-
const args = [];
|
|
223
|
-
if (phase0?.caps?.impl != null) args.push("--implementer-cap", String(phase0.caps.impl));
|
|
224
|
-
if (phase0?.caps?.review != null) args.push("--reviewer-cap", String(phase0.caps.review));
|
|
225
|
-
return { args };
|
|
226
|
-
}
|
|
227
|
-
|
|
228
213
|
function stepTick({ cwd, fleetDir }) {
|
|
229
214
|
const caps = tickCaps(fleetDir);
|
|
230
215
|
if (caps.error) return failed(caps.error);
|
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// A member's report, recorded as one command: the writes its wake owes, then
|
|
3
|
+
// the tick.
|
|
4
|
+
//
|
|
5
|
+
// fleet-event.mjs <kind> <args> [--implementer-cap <n>] [--reviewer-cap <n>]
|
|
6
|
+
//
|
|
7
|
+
// Reached through the Resolver and run from the main checkout. Every kind
|
|
8
|
+
// performs its writes, then runs `fleet-tick.mjs --apply` with the caps —
|
|
9
|
+
// each flag as given, else the one `.fleet/phase0.json` records, else the
|
|
10
|
+
// tick's own default — and prints one `event: <kind>: <summary>` line with
|
|
11
|
+
// the tick's output verbatim after it. Every kind is idempotent: a second run
|
|
12
|
+
// finds its writes made and only ticks again.
|
|
13
|
+
//
|
|
14
|
+
// `<scratch>` below is the phase-0 receipt's `scratch`, else the root
|
|
15
|
+
// scratch-root.mjs prints; every settle reads its report under
|
|
16
|
+
// `<scratch>/reports` (`--reports`). A member the ledger already holds
|
|
17
|
+
// settled, under any outcome, is not settled again.
|
|
18
|
+
//
|
|
19
|
+
// impl-report <impl-N[-x]>
|
|
20
|
+
// `ledger.mjs settle <member> --from-report`. Settled `bailed`: the
|
|
21
|
+
// report's `bailCause` names the label (undecided `needs-triage`, fork
|
|
22
|
+
// and hands `ready-for-human`), then:
|
|
23
|
+
// `gh issue edit <N> --remove-label ready-for-agent --remove-label
|
|
24
|
+
// in-progress --add-label <label>`, skipped when the issue already
|
|
25
|
+
// carries the label and neither of the others;
|
|
26
|
+
// `gh issue comment <N>` with the comment `dispatch-prompt.mjs render
|
|
27
|
+
// relabel` renders from the report's `bailDetail` — kind
|
|
28
|
+
// `needs-triage` (`--line`), `fork` (`--options`), or `hands`, whose
|
|
29
|
+
// detail opens with the cause the Pull's answer names (`external
|
|
30
|
+
// access`, `manual testing`, `judgment`) and goes on with the line —
|
|
31
|
+
// skipped when the issue already carries that comment;
|
|
32
|
+
// `release-ticket.sh <N> impl-<N> implementer --apply`, only once the
|
|
33
|
+
// label is in place, since the release drops `in-progress` itself.
|
|
34
|
+
// It runs on a second run too: it measures the claim again and
|
|
35
|
+
// writes nothing when nothing is left to release. A refusal prints
|
|
36
|
+
// `NEED hand-release #<N> <blocker>` and is never forced.
|
|
37
|
+
// fix-report <fix-pr-M[-x]>
|
|
38
|
+
// `settle --from-report`, which records the filings and rulings the
|
|
39
|
+
// report carries. Settled `applied:`/`no-op`, on a PR whose rows carry
|
|
40
|
+
// `reviewed=`, by a member whose rendered brief
|
|
41
|
+
// (`.fleet/briefs/<member>.json`) is kind `review` or
|
|
42
|
+
// `dispositions-retry` — a review fix-applier, not one that cleared a
|
|
43
|
+
// conflict hold or a red check — and with no `dispositions-*=<member>:`
|
|
44
|
+
// token on the PR's rows yet: `dispositions-check.mjs --member <member>
|
|
45
|
+
// --scratch <scratch>`, its stdout printed. That script writes its own
|
|
46
|
+
// verdict token; its exit 1 is a verdict, its exit 2 a NEED.
|
|
47
|
+
// finisher-report <finisher-pr-M[-x]>
|
|
48
|
+
// `settle --from-report`. Settled `halted:<cause>`: `gh pr comment <M>`
|
|
49
|
+
// with the report's cause and evidence. A repair finisher (a retry
|
|
50
|
+
// suffix) whose report claims `labelled` and whose `labelsReadBack`
|
|
51
|
+
// lacks `ready-to-merge`: the one-shot escalation, `gh pr comment <M>`
|
|
52
|
+
// with its read-back and the read-back of the finisher before it —
|
|
53
|
+
// whether or not its settle was accepted, since the settle refuses
|
|
54
|
+
// exactly that read-back. Either comment is skipped when the PR already
|
|
55
|
+
// carries it.
|
|
56
|
+
// merge-bot-report <merge-bot-n>
|
|
57
|
+
// `ledger.mjs token <pr> held-behind:#<behind>` for each `held[]` entry
|
|
58
|
+
// of the report the PR's rows do not already carry, then `settle
|
|
59
|
+
// --from-report`. The reap and the reclaim run under the tick's
|
|
60
|
+
// `--apply`.
|
|
61
|
+
// review-result <pr> <path>
|
|
62
|
+
// The review result file at `<path>`, which must be
|
|
63
|
+
// `<scratch>/pr<pr>/<run>/<file>`, `<run>` a review run root
|
|
64
|
+
// (`run-` and eight characters) and no `..` segment: its `head` and
|
|
65
|
+
// `counts` make `ledger.mjs review <pr>
|
|
66
|
+
// reviewed=<head>:<survived>/<refuted>/<unverified>:<run>`, skipped when
|
|
67
|
+
// the PR's rows already carry that token.
|
|
68
|
+
// review-failed <pr> <launch>
|
|
69
|
+
// `ledger.mjs review <pr> review=<launch>=failed`, `<launch>` as the
|
|
70
|
+
// PR's row spells it after `review=` (`member:<runner>` or
|
|
71
|
+
// `wf:<runId>`), skipped when the rows already carry it; the summary
|
|
72
|
+
// names the runner the PR's next launch takes, as `review` reports it.
|
|
73
|
+
//
|
|
74
|
+
// A write this script cannot make, and does not refuse, is printed as a
|
|
75
|
+
// `NEED <what> …` line, at the left margin, for the controller to make by
|
|
76
|
+
// hand.
|
|
77
|
+
//
|
|
78
|
+
// Exit: 0 every write made and the tick exited 0. 2 a usage error, refused
|
|
79
|
+
// before anything is written or ticked: an unknown kind or flag, a member of
|
|
80
|
+
// the wrong family, a review path outside the PR's partition or a file that
|
|
81
|
+
// is no review result, a ledger or phase-0 receipt that cannot be read. A
|
|
82
|
+
// ledger write's own refusal — `settle`'s 3 (the report's claim and the world
|
|
83
|
+
// disagree) or 2, `token`'s or `review`'s 2 — passes its exit and message
|
|
84
|
+
// through, and the tick still runs so the controller sees the rows. Else the
|
|
85
|
+
// tick's own exit when it is not 0. Else 4 when a NEED line was printed.
|
|
86
|
+
//
|
|
87
|
+
// Zero deps: node builtins and sibling scripts only.
|
|
88
|
+
|
|
89
|
+
import { spawnSync } from "node:child_process";
|
|
90
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
91
|
+
import { basename, dirname, join, normalize, resolve } from "node:path";
|
|
92
|
+
import { fileURLToPath } from "node:url";
|
|
93
|
+
import { makeDie, defineFlags, isDigits, writeAll } from "./arg.mjs";
|
|
94
|
+
import { FleetDirUnresolvable, fleetFile } from "./fleet-dir.mjs";
|
|
95
|
+
import { gitEnv } from "./git-env.mjs";
|
|
96
|
+
import { isCLI } from "./is-cli.mjs";
|
|
97
|
+
import { BRIEFS, REVIEW, REVIEWED, memberTokens, nextReviewerName, parseDispatchedEntry, parseMember, parseToken, rowNums } from "./ledger-grammar.mjs";
|
|
98
|
+
import { dispositionsToken } from "./fleet-tick.mjs";
|
|
99
|
+
import { readRunReceipt, tickCaps } from "./phase0-receipt.mjs";
|
|
100
|
+
import { defaultScratch, readReportIn, reportsDir } from "./report-files.mjs";
|
|
101
|
+
|
|
102
|
+
const NAME = "fleet-event";
|
|
103
|
+
const die = makeDie(NAME);
|
|
104
|
+
const SCRIPTS = dirname(fileURLToPath(import.meta.url));
|
|
105
|
+
const MAX_BUFFER = 64 * 1024 * 1024;
|
|
106
|
+
const GH_TIMEOUT_MS = 60_000;
|
|
107
|
+
const CHILD_TIMEOUT_MS = 300_000;
|
|
108
|
+
const READY = "ready-to-merge";
|
|
109
|
+
|
|
110
|
+
const KINDS = {
|
|
111
|
+
"impl-report": { args: ["<member>"], family: "impl" },
|
|
112
|
+
"fix-report": { args: ["<member>"], family: "fix-pr" },
|
|
113
|
+
"finisher-report": { args: ["<member>"], family: "finisher-pr" },
|
|
114
|
+
"merge-bot-report": { args: ["<member>"], family: "merge-bot" },
|
|
115
|
+
"review-result": { args: ["<pr>", "<path>"] },
|
|
116
|
+
"review-failed": { args: ["<pr>", "<launch>"] },
|
|
117
|
+
};
|
|
118
|
+
const FLAGS = { "implementer-cap": "value", "reviewer-cap": "value" };
|
|
119
|
+
const USAGE = `usage: ${NAME}.mjs <kind> <args> [--implementer-cap <n>] [--reviewer-cap <n>] — kinds: `
|
|
120
|
+
+ Object.entries(KINDS).map(([k, { args }]) => `${k} ${args.join(" ")}`).join(", ");
|
|
121
|
+
|
|
122
|
+
// The label each `bailCause` demotes to, and the relabel template's kind.
|
|
123
|
+
const BAILS = {
|
|
124
|
+
undecided: { label: "needs-triage", kind: "needs-triage", flag: "line" },
|
|
125
|
+
fork: { label: "ready-for-human", kind: "fork", flag: "options" },
|
|
126
|
+
hands: { label: "ready-for-human", kind: "hands" },
|
|
127
|
+
};
|
|
128
|
+
// The causes a `hands` detail opens with — the Pull's answer grammar — and the
|
|
129
|
+
// words each puts in the comment.
|
|
130
|
+
const HANDS = { "external access": "external access", "manual testing": "manual testing", judgment: "judgment during the work" };
|
|
131
|
+
// The fix-applier brief kinds that answer a review and so write a disposition
|
|
132
|
+
// record.
|
|
133
|
+
const REVIEW_FIX_KINDS = new Set(["review", "dispositions-retry"]);
|
|
134
|
+
|
|
135
|
+
// ── children ────────────────────────────────────────────────────────────────
|
|
136
|
+
|
|
137
|
+
function how(r) {
|
|
138
|
+
if (r.error) return r.error.code ?? r.error.message;
|
|
139
|
+
if (r.signal) return `killed by ${r.signal}`;
|
|
140
|
+
return `exit ${r.status}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Runs a child to completion from the cwd, every one with GIT_DIR and
|
|
145
|
+
* GIT_WORK_TREE scrubbed and GH_REPO blanked, so no ambient value points a
|
|
146
|
+
* write at another repository. `status` is null when the child never ran or
|
|
147
|
+
* was killed.
|
|
148
|
+
*/
|
|
149
|
+
function run(cmd, args, timeoutMs = CHILD_TIMEOUT_MS) {
|
|
150
|
+
const r = spawnSync(cmd, args, { encoding: "utf8", maxBuffer: MAX_BUFFER, env: gitEnv({ GH_REPO: "" }), timeout: timeoutMs });
|
|
151
|
+
return { status: r.error ? null : r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "", how: how(r) };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const node = (script, args) => run(process.execPath, [join(SCRIPTS, script), ...args]);
|
|
155
|
+
const gh = (args) => run("gh", args, GH_TIMEOUT_MS);
|
|
156
|
+
|
|
157
|
+
// What a failed child said: the last line of its stderr, else of its stdout —
|
|
158
|
+
// its own end says why it stopped — else how it ended.
|
|
159
|
+
const said = (r) => [r.stderr, r.stdout].map((s) => s.trim().split("\n").at(-1)).find(Boolean) || r.how;
|
|
160
|
+
|
|
161
|
+
// ── the run's state ─────────────────────────────────────────────────────────
|
|
162
|
+
|
|
163
|
+
/** The ledger as `ledger.mjs read` prints it. */
|
|
164
|
+
function readLedger() {
|
|
165
|
+
const r = node("ledger.mjs", ["read"]);
|
|
166
|
+
if (r.status !== 0) die(`ledger.mjs read failed (${r.how}): ${said(r)} — nothing written`);
|
|
167
|
+
try {
|
|
168
|
+
return JSON.parse(r.stdout);
|
|
169
|
+
} catch (e) {
|
|
170
|
+
return die(`ledger.mjs read printed no JSON: ${e.message} — nothing written`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Every member token the ledger holds: its rows', then `## Dispatched`'s. */
|
|
175
|
+
const ledgerMembers = (ledger) => [
|
|
176
|
+
...ledger.rows.flatMap(memberTokens),
|
|
177
|
+
...ledger.dispatched.map((e) => parseToken(parseDispatchedEntry(e).token)),
|
|
178
|
+
].filter((t) => t !== null && t.error === null);
|
|
179
|
+
|
|
180
|
+
/** The outcome the ledger records for `member`, or null while it is live or unknown. */
|
|
181
|
+
const settledOutcome = (ledger, member) => ledgerMembers(ledger).find((t) => t.name === member && t.outcome !== null)?.outcome ?? null;
|
|
182
|
+
|
|
183
|
+
/** Every word of the rows PR `pr` maps to. */
|
|
184
|
+
const prWords = (ledger, pr) => ledger.rows.filter((r) => rowNums(r).pr === pr).flatMap((r) => r.split(/\s+/).filter(Boolean));
|
|
185
|
+
|
|
186
|
+
// ── the event's record ──────────────────────────────────────────────────────
|
|
187
|
+
|
|
188
|
+
class Event {
|
|
189
|
+
constructor(ctx) {
|
|
190
|
+
Object.assign(this, ctx);
|
|
191
|
+
this.lines = [];
|
|
192
|
+
this.summary = [];
|
|
193
|
+
this.needs = 0;
|
|
194
|
+
// The exit of the first ledger write that refused, null while none has.
|
|
195
|
+
this.refused = null;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
note(text) {
|
|
199
|
+
this.summary.push(text);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
print(text) {
|
|
203
|
+
for (const line of text.split("\n").filter((l) => l.trim() !== "")) this.lines.push(line);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
need(text) {
|
|
207
|
+
this.needs += 1;
|
|
208
|
+
this.lines.push(`NEED ${text}`);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// A ledger write that refused: its message on stderr, its exit kept.
|
|
212
|
+
refuse(what, r) {
|
|
213
|
+
if (r.stderr) writeAll(2, r.stderr.endsWith("\n") ? r.stderr : `${r.stderr}\n`);
|
|
214
|
+
if (this.refused === null) this.refused = r.status ?? 2;
|
|
215
|
+
this.note(`${what} refused (${r.how})`);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
report(member) {
|
|
219
|
+
return readReportIn(reportsDir(this.scratch), member);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// `settle <member> --from-report` unless the ledger holds it settled.
|
|
223
|
+
// Returns the outcome, or null when the settle refused.
|
|
224
|
+
settle(member) {
|
|
225
|
+
const before = settledOutcome(this.ledger, member);
|
|
226
|
+
if (before !== null) {
|
|
227
|
+
this.note(`${member}=${before} already settled`);
|
|
228
|
+
return before;
|
|
229
|
+
}
|
|
230
|
+
const r = node("ledger.mjs", ["settle", member, "--from-report", "--reports", reportsDir(this.scratch)]);
|
|
231
|
+
if (r.status !== 0) {
|
|
232
|
+
this.refuse(`settle ${member}`, r);
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
if (r.stderr) writeAll(2, r.stderr);
|
|
236
|
+
let outcome;
|
|
237
|
+
try {
|
|
238
|
+
({ outcome } = JSON.parse(r.stdout));
|
|
239
|
+
} catch {
|
|
240
|
+
// The settle wrote; only its receipt is unreadable.
|
|
241
|
+
}
|
|
242
|
+
if (typeof outcome !== "string") {
|
|
243
|
+
this.refuse(`settle ${member} printed no receipt`, { ...r, status: 2, stderr: `${NAME}: settle ${member} exited 0 with no receipt on stdout: ${r.stdout.trim()}\n` });
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
this.note(`settled ${member}=${outcome}`);
|
|
247
|
+
return outcome;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// The bodies of the comments on issue or PR `n`, trimmed, or null when gh
|
|
251
|
+
// could not answer (the NEED is printed here).
|
|
252
|
+
comments(noun, n, what) {
|
|
253
|
+
const r = gh([noun, "view", String(n), "--json", noun === "issue" ? "labels,comments" : "comments"]);
|
|
254
|
+
let v = null;
|
|
255
|
+
if (r.status === 0) {
|
|
256
|
+
try {
|
|
257
|
+
v = JSON.parse(r.stdout);
|
|
258
|
+
} catch {
|
|
259
|
+
// Falls through to the NEED below.
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (v === null || !Array.isArray(v.comments) || (noun === "issue" && !Array.isArray(v.labels))) {
|
|
263
|
+
this.need(`${what} — gh ${noun} view ${n} did not answer (${r.status === 0 ? "no JSON" : said(r)})`);
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
return { labels: (v.labels ?? []).map((l) => l?.name), bodies: v.comments.map((c) => String(c?.body ?? "").trim()) };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// `gh <noun> comment <n> --body <body>` unless `seen` already holds it.
|
|
270
|
+
comment(noun, n, body, seen, what) {
|
|
271
|
+
if (seen.bodies.includes(body.trim())) {
|
|
272
|
+
this.note(`${what} already on #${n}`);
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
const r = gh([noun, "comment", String(n), "--body", body]);
|
|
276
|
+
if (r.status !== 0) {
|
|
277
|
+
this.need(`${what} #${n} — gh ${noun} comment failed: ${said(r)}`);
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
this.note(`${what} posted on #${n}`);
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// ── the kinds ───────────────────────────────────────────────────────────────
|
|
286
|
+
|
|
287
|
+
// The relabel comment's render arguments for a bail, or a reason there are none.
|
|
288
|
+
function relabelArgs(cause, detail) {
|
|
289
|
+
const bail = BAILS[cause];
|
|
290
|
+
const text = String(detail ?? "").trim();
|
|
291
|
+
if (text === "") return { why: "the report's bailDetail is empty" };
|
|
292
|
+
if (bail.kind !== "hands") return { args: ["--kind", bail.kind, `--${bail.flag}`, text] };
|
|
293
|
+
const opener = Object.keys(HANDS).find((c) => text === c || text.startsWith(`${c} `) || text.startsWith(`${c}:`));
|
|
294
|
+
const line = opener === undefined ? "" : text.slice(opener.length).replace(/^[\s:—-]+/, "");
|
|
295
|
+
if (line === "") return { why: `the report's bailDetail opens with none of ${Object.keys(HANDS).join(", ")} and a line` };
|
|
296
|
+
return { args: ["--kind", "hands", "--hands", HANDS[opener], "--line", line] };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function bailed(ev, member) {
|
|
300
|
+
const ticket = parseMember(member).number;
|
|
301
|
+
const read = ev.report(member);
|
|
302
|
+
const cause = read.state === "ok" ? read.report.bailCause : null;
|
|
303
|
+
if (!Object.hasOwn(BAILS, cause ?? "")) {
|
|
304
|
+
ev.need(`relabel #${ticket} — ${member}'s report ${read.path} is ${read.state === "ok" ? `missing a bailCause` : read.state}: relabel by its cause by hand`);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
const { label } = BAILS[cause];
|
|
308
|
+
const seen = ev.comments("issue", ticket, `relabel #${ticket} ${label}`);
|
|
309
|
+
if (seen === null) return;
|
|
310
|
+
if (seen.labels.includes(label) && !seen.labels.includes("ready-for-agent") && !seen.labels.includes("in-progress")) {
|
|
311
|
+
ev.note(`#${ticket} already ${label}`);
|
|
312
|
+
} else {
|
|
313
|
+
const e = gh(["issue", "edit", String(ticket), "--remove-label", "ready-for-agent", "--remove-label", "in-progress", "--add-label", label]);
|
|
314
|
+
if (e.status !== 0) {
|
|
315
|
+
ev.need(`relabel #${ticket} ${label} — gh issue edit failed: ${said(e)}`);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
ev.note(`relabelled #${ticket} ${label} (${cause})`);
|
|
319
|
+
}
|
|
320
|
+
const relabel = relabelArgs(cause, read.report.bailDetail);
|
|
321
|
+
if (relabel.why !== undefined) {
|
|
322
|
+
ev.need(`relabel-comment #${ticket} — ${relabel.why}: comment the cause by hand`);
|
|
323
|
+
} else {
|
|
324
|
+
const r = node("dispatch-prompt.mjs", ["render", "relabel", ...relabel.args]);
|
|
325
|
+
if (r.status !== 0) ev.need(`relabel-comment #${ticket} — dispatch-prompt.mjs render relabel refused: ${said(r)}`);
|
|
326
|
+
else ev.comment("issue", ticket, r.stdout, seen, "relabel comment");
|
|
327
|
+
}
|
|
328
|
+
const release = run("sh", [join(SCRIPTS, "release-ticket.sh"), String(ticket), `impl-${ticket}`, "implementer", "--apply"]);
|
|
329
|
+
if (release.status === 0) ev.note(`released #${ticket}`);
|
|
330
|
+
else ev.need(`hand-release #${ticket} ${blocker(release)}`);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// What release-ticket.sh refused for: the blockers of its JSON receipt, else
|
|
334
|
+
// the last thing it said.
|
|
335
|
+
function blocker(r) {
|
|
336
|
+
try {
|
|
337
|
+
const { blockers } = JSON.parse(r.stdout);
|
|
338
|
+
if (Array.isArray(blockers) && blockers.length > 0) return blockers.join("; ");
|
|
339
|
+
} catch {
|
|
340
|
+
// Not a receipt: a refusal before it could write one, in prose.
|
|
341
|
+
}
|
|
342
|
+
return said(r);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function implReport(ev, member) {
|
|
346
|
+
if (ev.settle(member) === "bailed") bailed(ev, member);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function fixReport(ev, member) {
|
|
350
|
+
const outcome = ev.settle(member);
|
|
351
|
+
if (outcome === null) return;
|
|
352
|
+
const pr = parseMember(member).number;
|
|
353
|
+
if (outcome !== "no-op" && !outcome.startsWith("applied:")) {
|
|
354
|
+
ev.note("no dispositions check: it answered nothing");
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const words = prWords(ev.ledger, pr);
|
|
358
|
+
if (!words.some((w) => REVIEWED.test(w))) {
|
|
359
|
+
ev.note(`no dispositions check: PR #${pr} has no reviewed=`);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (words.some((w) => dispositionsToken(w)?.member.name === member)) {
|
|
363
|
+
ev.note(`dispositions already checked for ${member}`);
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
const by = `dispositions-check.mjs --member ${member} --scratch ${ev.scratch}`;
|
|
367
|
+
const sidecar = join(ev.fleetDir, BRIEFS, `${member}.json`);
|
|
368
|
+
let kind;
|
|
369
|
+
try {
|
|
370
|
+
({ kind } = JSON.parse(readFileSync(sidecar, "utf8")));
|
|
371
|
+
} catch (e) {
|
|
372
|
+
ev.need(`dispositions-check ${member} — its brief ${sidecar} is unreadable (${e.code ?? e.message}), so whether it answered a review is unknown: run ${by} if it did`);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (!REVIEW_FIX_KINDS.has(kind)) {
|
|
376
|
+
ev.note(`no dispositions check: ${member} was a ${kind} fix-applier`);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const r = node("dispositions-check.mjs", ["--member", member, "--scratch", ev.scratch]);
|
|
380
|
+
ev.print(r.stdout);
|
|
381
|
+
if (r.status === 0 || r.status === 1) ev.note(`dispositions checked (exit ${r.status})`);
|
|
382
|
+
else ev.need(`dispositions-check ${member} — nothing judged (${r.how}): ${said(r)}; run ${by} again`);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const listed = (labels) => (labels.length === 0 ? "(none)" : labels.join(", "));
|
|
386
|
+
|
|
387
|
+
function finisherReport(ev, member) {
|
|
388
|
+
const outcome = ev.settle(member);
|
|
389
|
+
const self = parseMember(member);
|
|
390
|
+
const pr = self.number;
|
|
391
|
+
const read = ev.report(member);
|
|
392
|
+
const report = read.state === "ok" ? read.report : null;
|
|
393
|
+
if (outcome?.startsWith("halted:")) {
|
|
394
|
+
if (report === null) {
|
|
395
|
+
ev.need(`halt-comment PR #${pr} — ${member}'s report ${read.path} is ${read.state}: comment its cause and evidence by hand`);
|
|
396
|
+
} else {
|
|
397
|
+
const seen = ev.comments("pr", pr, `halt-comment PR #${pr}`);
|
|
398
|
+
const body = `**${member} halted: \`${report.cause}\`.**\n\n${String(report.evidence ?? "").trim()}`;
|
|
399
|
+
if (seen !== null) ev.comment("pr", pr, body, seen, "halt comment");
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
// The escalation is for a repair finisher that claims the label and reads
|
|
403
|
+
// back none; a halt says why in its own comment above.
|
|
404
|
+
if (self.retry === null || report?.outcome !== "labelled" || report.labelsReadBack.includes(READY)) return;
|
|
405
|
+
const earlier = ledgerMembers(ev.ledger)
|
|
406
|
+
.filter((t) => t.family === "finisher-pr" && t.number === pr && (t.retry ?? "") < self.retry)
|
|
407
|
+
.sort((a, b) => (a.retry ?? "").localeCompare(b.retry ?? "")).at(-1)?.name;
|
|
408
|
+
let before = "no earlier finisher on the ledger";
|
|
409
|
+
if (earlier !== undefined) {
|
|
410
|
+
const prior = ev.report(earlier);
|
|
411
|
+
before = prior.state === "ok" ? `${earlier} read back: ${listed(prior.report.labelsReadBack)}` : `${earlier}'s report ${prior.path} is ${prior.state}`;
|
|
412
|
+
}
|
|
413
|
+
const body = `**${member}, a repair finisher, read back no \`${READY}\` on PR #${pr}.**\n\n`
|
|
414
|
+
+ `- ${member} read back: ${listed(report.labelsReadBack)}\n- ${before}`;
|
|
415
|
+
const seen = ev.comments("pr", pr, `escalation-comment PR #${pr}`);
|
|
416
|
+
if (seen !== null) ev.comment("pr", pr, body, seen, "escalation comment");
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function mergeBotReport(ev, member) {
|
|
420
|
+
const read = ev.report(member);
|
|
421
|
+
for (const { pr, behind } of read.state === "ok" ? read.report.held : []) {
|
|
422
|
+
const tok = `held-behind:#${behind}`;
|
|
423
|
+
if (prWords(ev.ledger, pr).includes(tok)) {
|
|
424
|
+
ev.note(`#${pr} already ${tok}`);
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
const r = node("ledger.mjs", ["token", String(pr), tok]);
|
|
428
|
+
if (r.status === 0) ev.note(`#${pr} ${tok}`);
|
|
429
|
+
else ev.refuse(`token #${pr} ${tok}`, r);
|
|
430
|
+
}
|
|
431
|
+
ev.settle(member);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// `p` with its symlinks resolved, or as written when it does not exist yet.
|
|
435
|
+
function real(p) {
|
|
436
|
+
try {
|
|
437
|
+
return realpathSync(p);
|
|
438
|
+
} catch {
|
|
439
|
+
return p;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// The run name of a review result file at `path` in PR `pr`'s partition of
|
|
444
|
+
// `scratch`, or die naming why it is not one.
|
|
445
|
+
function reviewRun(scratch, pr, path) {
|
|
446
|
+
if (path.split("/").includes("..")) die(`review-result: ${path} has a ".." segment — pass the result file's path without one`);
|
|
447
|
+
const file = resolve(path);
|
|
448
|
+
const runRoot = dirname(file);
|
|
449
|
+
const partition = join(normalize(scratch), `pr${pr}`);
|
|
450
|
+
if (real(dirname(runRoot)) !== real(partition)) die(`review-result: ${file} is not under PR #${pr}'s partition ${partition}/ — nothing written`);
|
|
451
|
+
const run = basename(runRoot);
|
|
452
|
+
if (!/^run-[A-Za-z0-9]{8}$/.test(run)) die(`review-result: ${runRoot} is not a review run root (run- and eight characters) — nothing written`);
|
|
453
|
+
return { file, run };
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function reviewResult(ev, pr, path) {
|
|
457
|
+
const { file, run } = reviewRun(ev.scratch, pr, path);
|
|
458
|
+
let result;
|
|
459
|
+
try {
|
|
460
|
+
result = JSON.parse(readFileSync(file, "utf8"));
|
|
461
|
+
} catch (e) {
|
|
462
|
+
die(`review-result: cannot read ${file}: ${e.code ?? e.message} — nothing written`);
|
|
463
|
+
}
|
|
464
|
+
if (result?.pr !== undefined && Number(result.pr) !== pr) die(`review-result: ${file} is PR #${result.pr}'s review, not #${pr}'s — nothing written`);
|
|
465
|
+
const { survived, refuted, unverified } = result?.counts ?? {};
|
|
466
|
+
const token = `reviewed=${result?.head}:${survived}/${refuted}/${unverified}:${run}`;
|
|
467
|
+
if (!REVIEWED.test(token)) die(`review-result: ${file} carries no head and counts a reviewed= token can name (${token}) — nothing written`);
|
|
468
|
+
if (prWords(ev.ledger, pr).includes(token)) {
|
|
469
|
+
ev.note(`PR #${pr} already ${token}`);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const r = node("ledger.mjs", ["review", String(pr), token]);
|
|
473
|
+
if (r.status === 0) ev.note(`PR #${pr} ${token}`);
|
|
474
|
+
else ev.refuse(`review #${pr} ${token}`, r);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function reviewFailed(ev, pr, launch) {
|
|
478
|
+
const tok = `review=${launch.replace(/^review=/, "")}=failed`;
|
|
479
|
+
if (!REVIEW.test(tok)) {
|
|
480
|
+
die(`review-failed: '${launch}' is not a launch — member:<runner> or wf:<runId>, as the PR's row spells it after review=`);
|
|
481
|
+
}
|
|
482
|
+
let next;
|
|
483
|
+
if (prWords(ev.ledger, pr).includes(tok)) {
|
|
484
|
+
ev.note(`PR #${pr} already ${tok}`);
|
|
485
|
+
next = nextReviewerName(ev.ledger.rows, pr, ev.ledger.retired ?? []);
|
|
486
|
+
} else {
|
|
487
|
+
const r = node("ledger.mjs", ["review", String(pr), tok]);
|
|
488
|
+
if (r.status !== 0) {
|
|
489
|
+
ev.refuse(`review #${pr} ${tok}`, r);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
ev.note(`PR #${pr} ${tok}`);
|
|
493
|
+
try {
|
|
494
|
+
({ next } = JSON.parse(r.stdout));
|
|
495
|
+
} catch {
|
|
496
|
+
// The write landed; only the name is unread, and the summary says so.
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
ev.note(next === undefined ? "next free runner unread: review printed no receipt"
|
|
500
|
+
: next === null ? "no free runner name left" : `next free runner ${next}`);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// ── main ────────────────────────────────────────────────────────────────────
|
|
504
|
+
|
|
505
|
+
function capArg(F, name) {
|
|
506
|
+
const v = F.arg(name);
|
|
507
|
+
if (v === null) return null;
|
|
508
|
+
if (!isDigits(v) || Number(v) < 1) die(`--${name} must be a whole number of at least 1, got '${v}'`);
|
|
509
|
+
return v;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// The words of argv that are no flag or flag value.
|
|
513
|
+
function positionals() {
|
|
514
|
+
const argv = process.argv.slice(2);
|
|
515
|
+
const out = [];
|
|
516
|
+
for (let i = 0; i < argv.length; i++) {
|
|
517
|
+
if (argv[i].startsWith("--")) {
|
|
518
|
+
if (FLAGS[argv[i].slice(2)] === "value") i++;
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
out.push(argv[i]);
|
|
522
|
+
}
|
|
523
|
+
return out;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function main() {
|
|
527
|
+
const F = defineFlags(die, { flags: FLAGS });
|
|
528
|
+
F.sweep();
|
|
529
|
+
const [kind, ...args] = positionals();
|
|
530
|
+
if (!Object.hasOwn(KINDS, kind ?? "")) die(kind === undefined ? USAGE : `unknown kind '${kind}' — ${USAGE}`);
|
|
531
|
+
const spec = KINDS[kind];
|
|
532
|
+
if (args.length !== spec.args.length) die(`${kind} takes ${spec.args.join(" ")} — ${USAGE}`);
|
|
533
|
+
const implCap = capArg(F, "implementer-cap");
|
|
534
|
+
const reviewCap = capArg(F, "reviewer-cap");
|
|
535
|
+
let pr = null;
|
|
536
|
+
if (spec.family !== undefined) {
|
|
537
|
+
const m = parseMember(args[0]);
|
|
538
|
+
if (m === null || m.family !== spec.family) die(`${kind} takes a member of the ${spec.family} family, not '${args[0]}'`);
|
|
539
|
+
} else {
|
|
540
|
+
const digits = args[0].replace(/^#/, "");
|
|
541
|
+
if (!isDigits(digits) || Number(digits) < 1) die(`${kind}: '${args[0]}' is not a PR number`);
|
|
542
|
+
pr = Number(digits);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
let fleetDir;
|
|
546
|
+
let scratch;
|
|
547
|
+
try {
|
|
548
|
+
fleetDir = fleetFile(null);
|
|
549
|
+
const { read } = readRunReceipt();
|
|
550
|
+
const named = read.state === "ok" ? read.receipt.scratch : undefined;
|
|
551
|
+
scratch = typeof named === "string" && named !== "" ? named : defaultScratch();
|
|
552
|
+
} catch (e) {
|
|
553
|
+
if (!(e instanceof FleetDirUnresolvable)) throw e;
|
|
554
|
+
die(e.message);
|
|
555
|
+
}
|
|
556
|
+
const caps = tickCaps(fleetDir);
|
|
557
|
+
if (caps.error) die(`${caps.error} — nothing written`);
|
|
558
|
+
const recorded = (flag) => {
|
|
559
|
+
const i = caps.args.indexOf(flag);
|
|
560
|
+
return i === -1 ? null : caps.args[i + 1];
|
|
561
|
+
};
|
|
562
|
+
const tickArgs = ["--apply"];
|
|
563
|
+
for (const [flag, given] of [["--implementer-cap", implCap], ["--reviewer-cap", reviewCap]]) {
|
|
564
|
+
const value = given ?? recorded(flag);
|
|
565
|
+
if (value !== null) tickArgs.push(flag, value);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
const ev = new Event({ fleetDir, scratch, ledger: readLedger() });
|
|
569
|
+
if (kind === "impl-report") implReport(ev, args[0]);
|
|
570
|
+
else if (kind === "fix-report") fixReport(ev, args[0]);
|
|
571
|
+
else if (kind === "finisher-report") finisherReport(ev, args[0]);
|
|
572
|
+
else if (kind === "merge-bot-report") mergeBotReport(ev, args[0]);
|
|
573
|
+
else if (kind === "review-result") reviewResult(ev, pr, args[1]);
|
|
574
|
+
else reviewFailed(ev, pr, args[1]);
|
|
575
|
+
|
|
576
|
+
writeAll(1, `${[...ev.lines, `event: ${kind}: ${ev.summary.join("; ") || "nothing to record"}`].join("\n")}\n`);
|
|
577
|
+
const tick = spawnSync(process.execPath, [join(SCRIPTS, "fleet-tick.mjs"), ...tickArgs], { stdio: ["ignore", "inherit", "inherit"], env: gitEnv() });
|
|
578
|
+
const tickExit = tick.error || tick.status === null ? 2 : tick.status;
|
|
579
|
+
if (tick.error || tick.signal) writeAll(2, `${NAME}: fleet-tick.mjs did not finish (${how(tick)})\n`);
|
|
580
|
+
process.exitCode = ev.refused ?? (tickExit !== 0 ? tickExit : ev.needs > 0 ? 4 : 0);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if (isCLI(import.meta.url)) main();
|
package/scripts/fleet-tick.mjs
CHANGED
|
@@ -89,6 +89,19 @@
|
|
|
89
89
|
// REPORT-UNREADABLE. Advice, like CHECK-LIVENESS: the tick
|
|
90
90
|
// settles nothing. A review runner has no report schema and files
|
|
91
91
|
// none, so no `review=` token is looked up.
|
|
92
|
+
// session The listing of the session directory omp writes one
|
|
93
|
+
// `<member>.jsonl` transcript into per dispatched member: this
|
|
94
|
+
// run's phase-0 receipt's `session`, else `--session`; with
|
|
95
|
+
// neither the check is skipped with one stderr line. One readdir
|
|
96
|
+
// per tick, and no file in it is read. A `<stem>.jsonl` whose stem
|
|
97
|
+
// is a member name the ledger records nowhere — no row token, no
|
|
98
|
+
// `## Dispatched` entry, no `## Retired` line — prints
|
|
99
|
+
// `UNRECORDED <stem>`; a live member token first seen more than
|
|
100
|
+
// `--no-transcript-after` minutes ago with no file prints
|
|
101
|
+
// `NO-TRANSCRIPT <member>`. The receipt's directory not there yet
|
|
102
|
+
// holds no transcript; a `--session` one that is not there, like
|
|
103
|
+
// one that cannot be listed, skips the check with one stderr line.
|
|
104
|
+
// Advice, like CHECK-LIVENESS.
|
|
92
105
|
//
|
|
93
106
|
// The pure half below is `reconcile()` over the counts `deriveRun()` reads off
|
|
94
107
|
// the ledger; main() does the I/O. Split so the guard table and the reading are
|
|
@@ -826,7 +839,7 @@ export function foldLedger({ rows, dispatched }, open, { lenient = false } = {})
|
|
|
826
839
|
export const pastPinDue = (st, head) => st !== undefined && st.pastPinHalt && !st.inFlight && st.reviewedHead !== null
|
|
827
840
|
&& !String(head).toLowerCase().startsWith(st.reviewedHead);
|
|
828
841
|
|
|
829
|
-
export function deriveRun({ rows, dispatched, drain }, prs, closed = new Set(), finished = new Set()) {
|
|
842
|
+
export function deriveRun({ rows, dispatched, drain, retired = [] }, prs, closed = new Set(), finished = new Set()) {
|
|
830
843
|
const open = new Set(prs.map((p) => p.number));
|
|
831
844
|
const { members, byPr, verdicts, claimed, excluded } = foldLedger({ rows, dispatched }, open);
|
|
832
845
|
|
|
@@ -839,9 +852,9 @@ export function deriveRun({ rows, dispatched, drain }, prs, closed = new Set(),
|
|
|
839
852
|
// replacement's own check passes, the row holds — a replacement that is
|
|
840
853
|
// ALSO mismatched keeps holding, and one not yet checked holds as
|
|
841
854
|
// unchecked. A member with no verdict at all holds whether it is live or
|
|
842
|
-
// settled — the tick
|
|
843
|
-
//
|
|
844
|
-
//
|
|
855
|
+
// settled — the tick reads no transcript, so only tier-check.mjs can judge
|
|
856
|
+
// one; a settled member whose transcript was never written gets
|
|
857
|
+
// `tier-unverifiable=` from it, which clears the hold here.
|
|
845
858
|
const newest = impls.filter((m, i) => !impls.some((o, j) => j > i && o.number === m.number));
|
|
846
859
|
// A mismatch on a ticket whose issue is CLOSED holds nothing: there
|
|
847
860
|
// is nothing left for `impl-<N>-b` to replace, and a retired definition can
|
|
@@ -986,6 +999,10 @@ export function deriveRun({ rows, dispatched, drain }, prs, closed = new Set(),
|
|
|
986
999
|
// unsettled member token. A review runner has no report schema and a
|
|
987
1000
|
// `review=wf:` run no member, so neither files one.
|
|
988
1001
|
reporters: unsettled,
|
|
1002
|
+
// Every member name the ledger records, settled or live: each row's
|
|
1003
|
+
// member tokens, each `## Dispatched` entry and each `## Retired` line —
|
|
1004
|
+
// the names a transcript in the session directory is accounted for by.
|
|
1005
|
+
recorded: new Set([...members.keys(), ...retired]),
|
|
989
1006
|
};
|
|
990
1007
|
}
|
|
991
1008
|
|
|
@@ -1132,6 +1149,45 @@ export function reportLines({ reporters, reports, now, reportsFrom = null }) {
|
|
|
1132
1149
|
return out;
|
|
1133
1150
|
}
|
|
1134
1151
|
|
|
1152
|
+
// The stems of the `<stem>.jsonl` names in a session directory's listing,
|
|
1153
|
+
// sorted: the listing's own order is the filesystem's.
|
|
1154
|
+
export const transcriptStems = (names) => names.filter((n) => n.endsWith(".jsonl")).map((n) => n.slice(0, -".jsonl".length)).sort();
|
|
1155
|
+
|
|
1156
|
+
// The UNRECORDED lines: one per stem in `stems` that is a member name
|
|
1157
|
+
// (parseMember's, any family, retry letters included) and that `recorded`
|
|
1158
|
+
// — deriveRun's every name on the ledger — lacks, as `{kind, name, line, key}`. A
|
|
1159
|
+
// transcript is a dispatch the ledger never recorded, so the next tick would
|
|
1160
|
+
// name that dispatch again. A stem that is no member's name (a reviewer
|
|
1161
|
+
// runner's, `agent-abc123`) is never one. Advice: nothing here writes
|
|
1162
|
+
// the ledger.
|
|
1163
|
+
export function unrecordedLines({ stems, recorded }) {
|
|
1164
|
+
return stems.filter((stem) => parseMember(stem) !== null && !recorded.has(stem)).map((name) => {
|
|
1165
|
+
const line = `UNRECORDED ${name} (transcript exists, no ledger token)`;
|
|
1166
|
+
return { kind: "UNRECORDED", name, line, key: line };
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
// The NO-TRANSCRIPT lines: one per live member token in `live` whose `seen`
|
|
1171
|
+
// stamp is more than `after` minutes old and whose `<member>.jsonl` is not
|
|
1172
|
+
// among `stems`, as `{kind, name, line, key}` — a ledger token whose `task` call
|
|
1173
|
+
// was never made. A `review:PR#<n>` launch is no member and has no
|
|
1174
|
+
// transcript named after it, so it is never one. `key` is the line without
|
|
1175
|
+
// its age, what the digest `--fold-unchanged` compares takes.
|
|
1176
|
+
export function noTranscriptLines({ live, seen, stems, session, after, now }) {
|
|
1177
|
+
const has = new Set(stems);
|
|
1178
|
+
const out = [];
|
|
1179
|
+
for (const name of live) {
|
|
1180
|
+
if (parseMember(name) === null || seen[name] === undefined || has.has(name)) continue;
|
|
1181
|
+
const ms = now - seen[name];
|
|
1182
|
+
if (ms <= after * 60_000) continue;
|
|
1183
|
+
out.push({
|
|
1184
|
+
kind: "NO-TRANSCRIPT", name, key: `NO-TRANSCRIPT ${name}`,
|
|
1185
|
+
line: `NO-TRANSCRIPT ${name} (live ${Math.floor(ms / 60_000)}m, no ${join(session, `${name}.jsonl`)})`,
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
return out;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1135
1191
|
// --apply's pure half. The merge-bot numbers `applied.reapAfter` names for
|
|
1136
1192
|
// THIS run: none when its `run` is not the controller record's `at`, since
|
|
1137
1193
|
// merge-bot numbering restarts with a run and the state file outlives it
|
|
@@ -1194,7 +1250,7 @@ export function reclaimSummary(stdout) {
|
|
|
1194
1250
|
|
|
1195
1251
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
1196
1252
|
import { createHash } from "node:crypto";
|
|
1197
|
-
import { mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
1253
|
+
import { mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
1198
1254
|
import { tmpdir } from "node:os";
|
|
1199
1255
|
import { dirname, join } from "node:path";
|
|
1200
1256
|
import { fileURLToPath } from "node:url";
|
|
@@ -1281,6 +1337,13 @@ const OPTIONS = {
|
|
|
1281
1337
|
// receipt names none; the receipt's `scratch` wins when it does. Empty is
|
|
1282
1338
|
// absent, as with --state.
|
|
1283
1339
|
scratch: { type: "string", default: "" },
|
|
1340
|
+
// The session directory the transcript listing is read off, for a run whose
|
|
1341
|
+
// phase-0 receipt names none; the receipt's `session` wins when it does.
|
|
1342
|
+
// Empty is absent, as with --state.
|
|
1343
|
+
session: { type: "string", default: "" },
|
|
1344
|
+
// Minutes a live member token may go with no transcript in the session
|
|
1345
|
+
// directory before NO-TRANSCRIPT names it.
|
|
1346
|
+
"no-transcript-after": { type: "string", default: "5" },
|
|
1284
1347
|
// Minutes a live token of each family may run before CHECK-LIVENESS names it.
|
|
1285
1348
|
...Object.fromEntries(Object.entries(LIVENESS_FLAGS).map(([family, flag]) => [flag, { type: "string", default: String(LIVENESS_DEFAULTS[family]) }])),
|
|
1286
1349
|
};
|
|
@@ -1313,6 +1376,7 @@ function options() {
|
|
|
1313
1376
|
implCap: positive("implementer-cap"), reviewerCap,
|
|
1314
1377
|
maxReviews: values["max-reviews"] === undefined ? reviewerCap : positive("max-reviews"),
|
|
1315
1378
|
fold: values["fold-unchanged"], apply: values.apply, state: values.state || statePath(NAME), scratch: values.scratch,
|
|
1379
|
+
session: values.session || null, noTranscriptAfter: positive("no-transcript-after"),
|
|
1316
1380
|
liveness: Object.fromEntries(Object.entries(LIVENESS_FLAGS).map(([family, flag]) => [family, positive(flag)])),
|
|
1317
1381
|
};
|
|
1318
1382
|
}
|
|
@@ -1721,8 +1785,23 @@ function readReports(scratch, reporters) {
|
|
|
1721
1785
|
return out;
|
|
1722
1786
|
}
|
|
1723
1787
|
|
|
1788
|
+
// The transcript stems in `session`, off one readdir: no file in it is read.
|
|
1789
|
+
// The receipt's directory not being there yet holds no transcript, so it lists
|
|
1790
|
+
// none; a `--session` one that is not there is a path somebody typed, and is
|
|
1791
|
+
// no such case. One that cannot be listed is null and one stderr line — read
|
|
1792
|
+
// as empty, it would name every live member NO-TRANSCRIPT.
|
|
1793
|
+
function listTranscripts(session, { missingIsEmpty }) {
|
|
1794
|
+
try {
|
|
1795
|
+
return transcriptStems(readdirSync(session));
|
|
1796
|
+
} catch (e) {
|
|
1797
|
+
if (e.code === "ENOENT" && missingIsEmpty) return [];
|
|
1798
|
+
console.error(`${NAME}: transcripts not checked — cannot list ${session} (${e.code ?? e.message})`);
|
|
1799
|
+
return null;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1724
1803
|
function main() {
|
|
1725
|
-
const { fold, apply, state: path, liveness, scratch: scratchFlag, ...caps } = options();
|
|
1804
|
+
const { fold, apply, state: path, liveness, scratch: scratchFlag, session: sessionFlag, noTranscriptAfter, ...caps } = options();
|
|
1726
1805
|
const listPath = shortlistPath();
|
|
1727
1806
|
const current = readShortlist(listPath);
|
|
1728
1807
|
// Beside the shortlist, off the same git probe rather than a second one.
|
|
@@ -1755,6 +1834,24 @@ function main() {
|
|
|
1755
1834
|
: {}));
|
|
1756
1835
|
}
|
|
1757
1836
|
|
|
1837
|
+
// This run's phase 0, off its receipt: unfinished holds the same rows the
|
|
1838
|
+
// main checkout does, and never refuses the tick either. Judged against
|
|
1839
|
+
// the controller record this tick started from, and against whether that
|
|
1840
|
+
// record's process is still there: a finished receipt of the run before
|
|
1841
|
+
// carries the same `at` until this run's rotation writes the next.
|
|
1842
|
+
const receipt = readRunReceipt();
|
|
1843
|
+
const phase0 = phase0Gate(receipt.read, {
|
|
1844
|
+
path: receipt.path, controllerAt: controller?.at, controller: controllerState(controller),
|
|
1845
|
+
});
|
|
1846
|
+
// The session directory's listing, ahead of every ledger read: a dispatch is
|
|
1847
|
+
// written to the ledger before its `task` call makes the transcript, so a
|
|
1848
|
+
// stem listed here is on whatever ledger is read after. Listed later, a
|
|
1849
|
+
// dispatch landing in between would print UNRECORDED for a token the ledger
|
|
1850
|
+
// holds. This run's receipt's `session`, else --session, else no check.
|
|
1851
|
+
const session = phase0.session ?? sessionFlag;
|
|
1852
|
+
if (session === null) console.error(`${NAME}: transcripts not checked — no session in this run's phase-0 receipt and no --session`);
|
|
1853
|
+
const stems = session === null ? null : listTranscripts(session, { missingIsEmpty: phase0.session !== null });
|
|
1854
|
+
|
|
1758
1855
|
// Every read happens before anything prints: a partial tick is worse than no
|
|
1759
1856
|
// tick, because half a reconcile still reads like a reconcile. The APPLIED
|
|
1760
1857
|
// lines are the exception, printed as each duty runs: they say what was
|
|
@@ -1767,15 +1864,6 @@ function main() {
|
|
|
1767
1864
|
// every answer but `clean` is a hold on the dispatching rows plus one line
|
|
1768
1865
|
// saying why, so the rest of the run keeps reporting.
|
|
1769
1866
|
const mainCheckout = checkMainCheckout();
|
|
1770
|
-
// This run's phase 0, off its receipt: unfinished holds the same rows the
|
|
1771
|
-
// main checkout does, and never refuses the tick either. Judged against
|
|
1772
|
-
// the controller record this tick started from, and against whether that
|
|
1773
|
-
// record's process is still there: a finished receipt of the run before
|
|
1774
|
-
// carries the same `at` until this run's rotation writes the next.
|
|
1775
|
-
const receipt = readRunReceipt();
|
|
1776
|
-
const phase0 = phase0Gate(receipt.read, {
|
|
1777
|
-
path: receipt.path, controllerAt: controller?.at, controller: controllerState(controller),
|
|
1778
|
-
});
|
|
1779
1867
|
|
|
1780
1868
|
if (apply) {
|
|
1781
1869
|
// Reap and reclaim after every merge pass settled `done` since the last
|
|
@@ -1855,6 +1943,13 @@ function main() {
|
|
|
1855
1943
|
// Advisory the same way: a report on disk prints the settle it is for, and
|
|
1856
1944
|
// nothing here runs it.
|
|
1857
1945
|
const reported = reportLines({ reporters: run.reporters, reports, now, reportsFrom: scratch?.flagged ? reportsDir(scratch.root) : null });
|
|
1946
|
+
// Advisory the same way: a transcript the ledger records nowhere, and a live
|
|
1947
|
+
// member token with no transcript past `--no-transcript-after`. Neither is a
|
|
1948
|
+
// row, and nothing here dispatches, settles or kills.
|
|
1949
|
+
const transcribed = stems === null ? [] : [
|
|
1950
|
+
...unrecordedLines({ stems, recorded: run.recorded }),
|
|
1951
|
+
...noTranscriptLines({ live: run.live, seen, stems, session, after: noTranscriptAfter, now }),
|
|
1952
|
+
];
|
|
1858
1953
|
const above = [...(phase0.line === null ? [] : [phase0.line]), ...(said === null ? [] : [said]), ...stale.map((s) => s.line)];
|
|
1859
1954
|
const rowLines = formatLines(rows);
|
|
1860
1955
|
// The run is over once it is draining and nothing is left in flight: no
|
|
@@ -1863,13 +1958,14 @@ function main() {
|
|
|
1863
1958
|
// last act, and only the controller can write it.
|
|
1864
1959
|
const over = run.draining !== null && prs.length === 0 && run.implLive === 0;
|
|
1865
1960
|
if (over) rowLines.push(RUN_OVER);
|
|
1866
|
-
const
|
|
1961
|
+
const advice = [...transcribed, ...reported];
|
|
1962
|
+
const lines = [...above, ...advice.map((a) => a.line), ...rowLines];
|
|
1867
1963
|
|
|
1868
1964
|
// The back-off streak and the fold digest, written on EVERY tick: an edge
|
|
1869
1965
|
// tick that dispatched is the clearest possible "there is work here". Digest,
|
|
1870
|
-
// not the lines themselves, so the file stays readable. A report
|
|
1871
|
-
// without its age.
|
|
1872
|
-
const digest = createHash("sha256").update([...above, ...
|
|
1966
|
+
// not the lines themselves, so the file stays readable. A report or
|
|
1967
|
+
// NO-TRANSCRIPT line goes in without its age.
|
|
1968
|
+
const digest = createHash("sha256").update([...above, ...advice.map((a) => a.key), ...rowLines].join("\n")).digest("hex");
|
|
1873
1969
|
const acts = actionable(rows) || over;
|
|
1874
1970
|
// `seen` is pruned to the live set on the same write; an empty one removes
|
|
1875
1971
|
// the key. A file that was degraded at this read is left byte-identical, so
|
|
@@ -1899,11 +1995,14 @@ function main() {
|
|
|
1899
1995
|
// A report waiting on disk persists the same way, for as long as its
|
|
1900
1996
|
// member stays live.
|
|
1901
1997
|
const settle = reported.filter((r) => r.settle).map((r) => `; SETTLE ${r.member} persists`).join("");
|
|
1998
|
+
// A transcript the ledger lacks, or a live token lacking one, the same
|
|
1999
|
+
// way, for as long as it holds.
|
|
2000
|
+
const unmatched = transcribed.map((t) => `; ${t.kind} ${t.name} persists`).join("");
|
|
1902
2001
|
// The to-spec drops the same way: advice, and the one reason an empty
|
|
1903
2002
|
// shortlist is not "no work".
|
|
1904
2003
|
const specs = specsDropped(dropped);
|
|
1905
2004
|
const drops = specs ? `; ${specs} persists` : "";
|
|
1906
|
-
console.log(`fleet-tick: unchanged, nothing to act on (quiet=${prev.quiet + 1})${held}${aged}${settle}${drops} — full rows on the next change`);
|
|
2005
|
+
console.log(`fleet-tick: unchanged, nothing to act on (quiet=${prev.quiet + 1})${held}${aged}${unmatched}${settle}${drops} — full rows on the next change`);
|
|
1907
2006
|
return;
|
|
1908
2007
|
}
|
|
1909
2008
|
for (const line of lines) console.log(line);
|
|
@@ -276,6 +276,13 @@ function nextReviewer(launches, pr, retired) {
|
|
|
276
276
|
return null;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
/** The runner name the next launch on PR `pr` takes, read off a ledger's
|
|
280
|
+
* `rows` and its `## Retired` names: nextReviewer() over the PR's stream.
|
|
281
|
+
* null with every letter taken. */
|
|
282
|
+
export function nextReviewerName(rows, pr, retired = []) {
|
|
283
|
+
return nextReviewer(readReviews(streams(rows).get(pr) ?? []).launches, pr, retired);
|
|
284
|
+
}
|
|
285
|
+
|
|
279
286
|
const OPEN_WAYS_OUT = "wait for its reviewed=, or, once Member-killed confirms its runner dead, settle it =failed in the same `ledger.mjs review` call as the new launch";
|
|
280
287
|
|
|
281
288
|
/** Whether a word of a row is a review token — `review=…` or `reviewed=…`,
|
package/scripts/ledger.mjs
CHANGED
|
@@ -51,7 +51,7 @@ import { fileURLToPath } from "node:url";
|
|
|
51
51
|
import { spawnSync, execFileSync } from "node:child_process";
|
|
52
52
|
import { makeDie, isFlagLike, hasEqualsForm, isDigits, writeAll } from "./arg.mjs";
|
|
53
53
|
import { fleetFile, FleetDirUnresolvable } from "./fleet-dir.mjs";
|
|
54
|
-
import { parseMember, parseToken, memberTokens, nextMergeBot, nextRetry, liveOnLedger, retiredOnLedger, isRetirable, agentDefinition, CELL, tierValues, rowPr, rowWriteRefusal, isReviewToken, addedReviewToken, newSplitRow, splitRowClause, added, premisesOf, MEMBER_FAMILIES, HALT_CAUSES, ROWS, DISPATCHED, FILED, RULED, DRAIN, RETIRED, RECEIPT, archiveStamp, receiptArchiveName, CLOSEOUT_RECEIPT, closeoutArchiveName, BRIEFS, briefsArchiveName, memberRole, parseDispatchedEntry, dispatchedEntry, headerRe, escapeText, unescapeText } from "./ledger-grammar.mjs";
|
|
54
|
+
import { parseMember, parseToken, memberTokens, nextMergeBot, nextRetry, liveOnLedger, retiredOnLedger, isRetirable, agentDefinition, CELL, tierValues, rowPr, rowWriteRefusal, isReviewToken, addedReviewToken, newSplitRow, splitRowClause, added, premisesOf, MEMBER_FAMILIES, HALT_CAUSES, ROWS, DISPATCHED, FILED, RULED, DRAIN, RETIRED, RECEIPT, archiveStamp, receiptArchiveName, CLOSEOUT_RECEIPT, closeoutArchiveName, BRIEFS, briefsArchiveName, memberRole, parseDispatchedEntry, dispatchedEntry, headerRe, escapeText, unescapeText, nextReviewerName } from "./ledger-grammar.mjs";
|
|
55
55
|
import { deriveRun, LedgerError, labelOffMember, HELD, CONFLICT_HOLD } from "./fleet-tick.mjs";
|
|
56
56
|
import { stateFileIn, readState, writeState, assessBeat, stallsAt } from "./fleet-state.mjs";
|
|
57
57
|
import { processSource, ancestry, controllerOf, judgeController, ProcUnreadable } from "./proc.mjs";
|
|
@@ -2447,7 +2447,9 @@ function numberArg(arg, what, usage) {
|
|
|
2447
2447
|
// record in. `review=X=failed` for a launch the row holds open as `review=X`
|
|
2448
2448
|
// rewrites that token in place; every other token is appended as ` · <token>`.
|
|
2449
2449
|
// The whole ledger before and after is judged by rowWriteRefusal() under the
|
|
2450
|
-
// lock, and a refusal writes nothing.
|
|
2450
|
+
// lock, and a refusal writes nothing. The receipt's `next` is the runner name
|
|
2451
|
+
// the PR's next launch takes as the ledger stands after the write, null with
|
|
2452
|
+
// every letter taken.
|
|
2451
2453
|
function runReview() {
|
|
2452
2454
|
const usage = "usage: ledger.mjs review <pr> <review=…|reviewed=…>…";
|
|
2453
2455
|
const [pr, ...parts] = rest;
|
|
@@ -2479,7 +2481,7 @@ function runReview() {
|
|
|
2479
2481
|
save(data);
|
|
2480
2482
|
const key = rowKey(line);
|
|
2481
2483
|
console.error(` review on row ${key}`);
|
|
2482
|
-
console.log(JSON.stringify({ pr: prNum, row: key, line, created }));
|
|
2484
|
+
console.log(JSON.stringify({ pr: prNum, row: key, line, created, next: nextReviewerName(data.rows, prNum, data.retired) }));
|
|
2483
2485
|
}
|
|
2484
2486
|
|
|
2485
2487
|
// A row's tokens: its words after the key, bar the ` · ` separators between
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// The phase-0 receipt, read. `.fleet/phase0.json` is written by phase0.mjs
|
|
2
2
|
// after every step (its header gives the shape); this module is its readers'
|
|
3
|
-
// half: the tick's dispatch gate,
|
|
4
|
-
// and ticket-router.mjs take when their own flag is omitted
|
|
5
|
-
// the file, so the gate and the session
|
|
6
|
-
// receipt is.
|
|
3
|
+
// half: the tick's dispatch gate, the session directory tier-check.mjs
|
|
4
|
+
// and ticket-router.mjs take when their own flag is omitted, and the caps the
|
|
5
|
+
// drivers hand the tick. One reading of the file, so the gate and the session
|
|
6
|
+
// readers cannot disagree about what a receipt is.
|
|
7
7
|
//
|
|
8
8
|
// Zero deps: node builtins and sibling modules only.
|
|
9
9
|
|
|
10
10
|
import { readFileSync } from "node:fs";
|
|
11
|
+
import { join } from "node:path";
|
|
11
12
|
import { fleetFile, FleetDirUnresolvable } from "./fleet-dir.mjs";
|
|
12
13
|
import { RECEIPT } from "./ledger-grammar.mjs";
|
|
13
14
|
|
|
@@ -143,3 +144,22 @@ export function sessionFromReceipt(opts) {
|
|
|
143
144
|
: "it records no session";
|
|
144
145
|
throw new Error(`no session given and none in the phase-0 receipt ${path} (${why}) — give one, or run ${phase0Command(null)} first`);
|
|
145
146
|
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The caps the receipt in `fleetDir` records, as the tick's own flags:
|
|
150
|
+
* `{ args }`, none when there is no receipt or it names none, or `{ error }`
|
|
151
|
+
* for a receipt that is there and cannot be read.
|
|
152
|
+
*/
|
|
153
|
+
export function tickCaps(fleetDir) {
|
|
154
|
+
let phase0;
|
|
155
|
+
try {
|
|
156
|
+
phase0 = JSON.parse(readFileSync(join(fleetDir, RECEIPT), "utf8"));
|
|
157
|
+
} catch (e) {
|
|
158
|
+
if (e.code === "ENOENT") return { args: [] };
|
|
159
|
+
return { error: `cannot read ${join(fleetDir, RECEIPT)}: ${e.message}` };
|
|
160
|
+
}
|
|
161
|
+
const args = [];
|
|
162
|
+
if (phase0?.caps?.impl != null) args.push("--implementer-cap", String(phase0.caps.impl));
|
|
163
|
+
if (phase0?.caps?.review != null) args.push("--reviewer-cap", String(phase0.caps.review));
|
|
164
|
+
return { args };
|
|
165
|
+
}
|
package/skills/run-team/SKILL.md
CHANGED
|
@@ -1652,6 +1652,22 @@ depth** guard table applied in code. Act on each line as it reads:
|
|
|
1652
1652
|
token. It repeats every tick while the token stays live past the threshold.
|
|
1653
1653
|
`--liveness-impl`, `--liveness-fix-pr`, `--liveness-finisher`,
|
|
1654
1654
|
`--liveness-merge-bot` and `--liveness-review` set the thresholds, in minutes.
|
|
1655
|
+
- `UNRECORDED <stem> (transcript exists, no ledger token)`, printed above the
|
|
1656
|
+
rows — the session directory holds a `<stem>.jsonl` whose stem is a member
|
|
1657
|
+
name no row token, `## Dispatched` entry or `## Retired` line names: a
|
|
1658
|
+
dispatch whose ledger write was forgotten. Record it with `ledger.mjs
|
|
1659
|
+
dispatch`, or confirm it is a stranger's member.
|
|
1660
|
+
Advice, like `CHECK-LIVENESS`: it resets no `quiet`, changes no row and
|
|
1661
|
+
frees no slot, it repeats every tick while it holds, and the folded line
|
|
1662
|
+
names it (`…; UNRECORDED <stem> persists — …`).
|
|
1663
|
+
- `NO-TRANSCRIPT <member> (live <age>m, no <session>/<member>.jsonl)`, printed
|
|
1664
|
+
above the rows — a live ledger token first seen more than
|
|
1665
|
+
`--no-transcript-after` minutes ago (default 5) has no transcript in the
|
|
1666
|
+
session directory: a dispatch whose `task` call was never made. Make the
|
|
1667
|
+
`task` call, or settle the token `killed`. Advice the same way, folded as
|
|
1668
|
+
`…; NO-TRANSCRIPT <member> persists — …`. Both lines read the session
|
|
1669
|
+
directory this run's phase-0 receipt names, else `--session <dir>`; with
|
|
1670
|
+
neither the tick skips them with one stderr line.
|
|
1655
1671
|
|
|
1656
1672
|
**Tier guards under Pull.** The per-dispatch `tier-check.mjs --batch` is
|
|
1657
1673
|
phase 2's own step, run by `tick --apply`: a mismatch it finds is the
|
|
@@ -3543,7 +3559,9 @@ live count from it, so nobody states one. Write neither by hand:
|
|
|
3543
3559
|
- **`ledger.mjs review <pr> <token>…`** — the only writer of `review=` and
|
|
3544
3560
|
`reviewed=` (below): appends each to the PR's row — the ticket row once
|
|
3545
3561
|
`settle impl-<N>=PR#M` has run, else `#M`, created when neither exists —
|
|
3546
|
-
and prints `{pr, row, line, created}`, `row` the key written
|
|
3562
|
+
and prints `{pr, row, line, created, next}`, `row` the key written and
|
|
3563
|
+
`next` the runner name the PR's next launch takes, null with every letter
|
|
3564
|
+
taken. A
|
|
3547
3565
|
`review=<launch>=failed` whose `review=<launch>` the row holds settles that
|
|
3548
3566
|
launch in place, alone or with the next launch in the same call. Any other
|
|
3549
3567
|
token is refused.
|
|
@@ -184,9 +184,10 @@ the run. `dispatch` refuses a retired name and names the replacement — one
|
|
|
184
184
|
retry letter past the highest the session has used on that number,
|
|
185
185
|
`impl-42-b` for a ticket this session's earlier run worked as `impl-42` —
|
|
186
186
|
`review` refuses a retired runner name and names the next free reviewer
|
|
187
|
-
name, and `dispatch merge-bot` numbers past retired bots. The tick
|
|
188
|
-
|
|
189
|
-
and can be shortlisted
|
|
187
|
+
name, and `dispatch merge-bot` numbers past retired bots. The tick reads
|
|
188
|
+
`## Retired` only to account for a transcript in the session directory: a
|
|
189
|
+
ticket an earlier run worked is not claimed by it and can be shortlisted
|
|
190
|
+
again.
|
|
190
191
|
A line it cannot parse is skipped with a warning naming it, and the
|
|
191
192
|
rotation still succeeds; a member name on a skipped line that carries an
|
|
192
193
|
outcome is retired all the same, and a bare member token on a skipped row
|