@feigi/fleet-ctl 3.74.2 → 3.75.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
CHANGED
package/scripts/closeout.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// The end of a run as two commands,
|
|
2
|
+
// The end of a run as two step-running commands, `begin` and `finish`, each a
|
|
3
|
+
// list of named steps with a receipt, plus `reopen`, which undoes `begin`.
|
|
3
4
|
//
|
|
4
5
|
// closeout.mjs begin --reason "<r>"
|
|
5
6
|
// closeout.mjs finish --reason "<r>" [--branch <name>]
|
|
7
|
+
// closeout.mjs reopen --reason "<r>"
|
|
6
8
|
//
|
|
7
9
|
// Reached through the Resolver and run from the MAIN checkout. The middle of
|
|
8
10
|
// the end of a run is the ordinary loop (the tick's review, fix-applier and
|
|
@@ -57,8 +59,14 @@
|
|
|
57
59
|
// heartbeat-stop `fleet-heartbeat.mjs --stop "<reason>"`, last, because
|
|
58
60
|
// every reader takes a recorded stop as the end of the run.
|
|
59
61
|
//
|
|
62
|
+
// `reopen` undoes `begin` for a run that must drain again: refused (exit 2)
|
|
63
|
+
// once any `finish` step is ok, since the tick and what follows it have already
|
|
64
|
+
// acted. Otherwise `begin`'s `drain` and `release` steps go back to pending, so
|
|
65
|
+
// the next `begin` runs them again, and then `ledger.mjs undrain "<reason>"`
|
|
66
|
+
// clears the marker. A claim `begin` released stays released.
|
|
67
|
+
//
|
|
60
68
|
// THE RECEIPT is `.fleet/closeout.json` (resolved through fleet-dir.mjs, so a
|
|
61
|
-
// worktree and the main checkout name one file), shared by
|
|
69
|
+
// worktree and the main checkout name one file), shared by all three commands:
|
|
62
70
|
//
|
|
63
71
|
// { reason, begun, branch, pr, steps: { <name>: { status, at, output } } }
|
|
64
72
|
//
|
|
@@ -72,9 +80,11 @@
|
|
|
72
80
|
//
|
|
73
81
|
// One `closeout: <step>: <status>` line per step on stdout, its output under
|
|
74
82
|
// it, indented, with the `NEED` lines at the left margin. Exit 0 every step
|
|
75
|
-
// ok; 2 a usage error
|
|
76
|
-
//
|
|
77
|
-
//
|
|
83
|
+
// ok; 2 a usage error or a refused `reopen`, `ledger.mjs undrain`'s own exit 2
|
|
84
|
+
// included, which it also gives for a ledger it could not lock or write; 3 a
|
|
85
|
+
// step failed, `reopen`'s `ledger.mjs undrain` failed any other way, or the
|
|
86
|
+
// receipt could not be read or written; 4 a `NEED` is pending: dispatch what
|
|
87
|
+
// the line names, then run the same command again.
|
|
78
88
|
//
|
|
79
89
|
// Zero deps: node builtins and sibling scripts only.
|
|
80
90
|
|
|
@@ -409,17 +419,46 @@ function runSteps(steps, ctx, receipt, receiptPath) {
|
|
|
409
419
|
return 0;
|
|
410
420
|
}
|
|
411
421
|
|
|
422
|
+
// ── reopen ───────────────────────────────────────────────────────────────────
|
|
423
|
+
|
|
424
|
+
// Undoes `begin`'s drain. A finish step already ok means the tick and what
|
|
425
|
+
// follows it have acted, so the reopen is refused; a failed tick is not ok and
|
|
426
|
+
// blocks nothing. Otherwise the receipt goes back first and the marker second,
|
|
427
|
+
// so a run stopped between the two is left with `drain` pending and a marker
|
|
428
|
+
// standing, which the next `begin` re-drains ("already draining") or the next
|
|
429
|
+
// `reopen` clears. A ledger with no marker refuses, the receipt already back.
|
|
430
|
+
function reopen({ cwd, reason }, receipt, receiptPath) {
|
|
431
|
+
const done = Object.keys(FINISH).filter((n) => receipt.steps[n].status === "ok");
|
|
432
|
+
if (done.length > 0) {
|
|
433
|
+
process.stderr.write(`${NAME}: reopen refused: finish step ${done.join(", ")} is already ok\n`);
|
|
434
|
+
return 2;
|
|
435
|
+
}
|
|
436
|
+
if (existsSync(receiptPath)) {
|
|
437
|
+
for (const n of Object.keys(BEGIN)) receipt.steps[n] = blank();
|
|
438
|
+
receipt.begun = null;
|
|
439
|
+
writeReceipt(receiptPath, receipt);
|
|
440
|
+
}
|
|
441
|
+
const undrain = node("ledger.mjs", ["undrain", reason], { cwd });
|
|
442
|
+
if (undrain.status !== 0) {
|
|
443
|
+
process.stderr.write(`${NAME}: ledger.mjs undrain failed: ${detail(undrain)}\n`);
|
|
444
|
+
return undrain.status === 2 ? 2 : 3;
|
|
445
|
+
}
|
|
446
|
+
say(`${NAME}: reopen: ok`);
|
|
447
|
+
for (const line of undrain.stdout.split("\n").filter(Boolean)) say(` ${line}`);
|
|
448
|
+
return 0;
|
|
449
|
+
}
|
|
450
|
+
|
|
412
451
|
function main() {
|
|
413
452
|
const die = makeDie(NAME);
|
|
414
|
-
const F = defineFlags(die, { flags: { reason: "value", branch: "value" }, positionals: ["begin", "finish"] });
|
|
453
|
+
const F = defineFlags(die, { flags: { reason: "value", branch: "value" }, positionals: ["begin", "finish", "reopen"] });
|
|
415
454
|
F.sweep();
|
|
416
455
|
F.stray();
|
|
417
456
|
const cmd = process.argv[2];
|
|
418
|
-
if (cmd !== "begin" && cmd !== "finish") die(`usage: ${NAME}.mjs begin --reason <reason> | finish --reason <reason> [--branch <name>]
|
|
457
|
+
if (cmd !== "begin" && cmd !== "finish" && cmd !== "reopen") die(`usage: ${NAME}.mjs begin --reason <reason> | finish --reason <reason> [--branch <name>] | reopen --reason <reason>`);
|
|
419
458
|
const reason = F.arg("reason");
|
|
420
459
|
if (reason === null) die("--reason is required");
|
|
421
460
|
const branch = F.arg("branch");
|
|
422
|
-
if (branch !== null && cmd
|
|
461
|
+
if (branch !== null && cmd !== "finish") die("--branch belongs to finish");
|
|
423
462
|
|
|
424
463
|
let fleetDir;
|
|
425
464
|
try {
|
|
@@ -432,8 +471,9 @@ function main() {
|
|
|
432
471
|
const receipt = readReceipt(receiptPath, STEP_NAMES);
|
|
433
472
|
receipt.reason = reason;
|
|
434
473
|
const ctx = { cwd: process.cwd(), fleetDir, reason, branch };
|
|
435
|
-
|
|
436
|
-
|
|
474
|
+
if (cmd === "reopen") {
|
|
475
|
+
process.exitCode = reopen(ctx, receipt, receiptPath);
|
|
476
|
+
} else if (cmd === "begin") {
|
|
437
477
|
const code = runSteps(BEGIN, ctx, receipt, receiptPath);
|
|
438
478
|
if (receipt.steps.drain.status === "ok" && receipt.steps.release.status !== "failed") {
|
|
439
479
|
receipt.begun = new Date().toISOString();
|
package/scripts/fleet-event.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// fleet-event.mjs <kind> <args> [--in-flight <n>]
|
|
5
5
|
// fleet-event.mjs drain --reason "<reason>" [--in-flight <n>]
|
|
6
|
+
// fleet-event.mjs undrain --reason "<reason>" [--in-flight <n>]
|
|
6
7
|
//
|
|
7
8
|
// Reached through the Resolver and run from the main checkout. Every kind
|
|
8
9
|
// performs its writes, then runs `fleet-tick.mjs --apply` with the In-flight
|
|
@@ -129,6 +130,10 @@
|
|
|
129
130
|
// `NEED hand-release #<N> <blocker>` line) is this script's exit 4; its
|
|
130
131
|
// exit 2 or 3 is passed through. The rest of the end of a run,
|
|
131
132
|
// `closeout.mjs finish` last, is the controller's.
|
|
133
|
+
// undrain --reason "<reason>"
|
|
134
|
+
// `closeout.mjs reopen --reason "<reason>"`, its output printed as it
|
|
135
|
+
// stands, then the tick. Refused once any `finish` step is ok, and when
|
|
136
|
+
// no drain marker is set; its exit 2 or 3 is passed through.
|
|
132
137
|
//
|
|
133
138
|
// A write this script cannot make, and does not refuse, is printed as a
|
|
134
139
|
// `NEED <what> …` line, at the left margin, for the controller to make by
|
|
@@ -136,13 +141,14 @@
|
|
|
136
141
|
//
|
|
137
142
|
// Exit: 0 every write made and the tick exited 0. 2 a usage error, refused
|
|
138
143
|
// before anything is written or ticked: an unknown kind or flag, a `--reason`
|
|
139
|
-
// that is empty or beside any kind but `drain`, a member of
|
|
144
|
+
// that is empty or beside any kind but `drain` and `undrain`, a member of
|
|
140
145
|
// the wrong family, a review path outside the PR's partition or a file that
|
|
141
146
|
// is no review result, a ledger or phase-0 receipt that cannot be read. A
|
|
142
147
|
// ledger write's own refusal — `settle`'s 3 (the report's claim and the world
|
|
143
148
|
// disagree) or 2, `token`'s or `review`'s 2 — passes its exit and message
|
|
144
|
-
// through, as
|
|
145
|
-
// conflict hold (2), and the tick still runs so the
|
|
149
|
+
// through, as do `closeout.mjs begin`'s and `reopen`'s 2 or 3 and the
|
|
150
|
+
// refusal of a second conflict hold (2), and the tick still runs so the
|
|
151
|
+
// controller sees the rows.
|
|
146
152
|
// Else the tick's own exit when it is not 0. Else 4 when a NEED line was
|
|
147
153
|
// printed, `begin`'s own exit 4 included.
|
|
148
154
|
//
|
|
@@ -181,6 +187,7 @@ const KINDS = {
|
|
|
181
187
|
conflict: { args: ["<pr>"], pr: true },
|
|
182
188
|
heartbeat: { args: [] },
|
|
183
189
|
drain: { args: [], flag: "--reason \"<reason>\"" },
|
|
190
|
+
undrain: { args: [], flag: "--reason \"<reason>\"" },
|
|
184
191
|
};
|
|
185
192
|
const FLAGS = { "in-flight": "value", reason: "value" };
|
|
186
193
|
const USAGE = `usage: ${NAME}.mjs <kind> <args> [--in-flight <n>] — kinds: `
|
|
@@ -710,6 +717,16 @@ function drain(ev, reason) {
|
|
|
710
717
|
}
|
|
711
718
|
}
|
|
712
719
|
|
|
720
|
+
function undrain(ev, reason) {
|
|
721
|
+
const r = node("closeout.mjs", ["reopen", "--reason", reason]);
|
|
722
|
+
ev.print(r.stdout);
|
|
723
|
+
if (r.status === 0) {
|
|
724
|
+
ev.note("undrain reopened");
|
|
725
|
+
} else {
|
|
726
|
+
ev.refuse("closeout reopen", r);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
713
730
|
// ── main ────────────────────────────────────────────────────────────────────
|
|
714
731
|
|
|
715
732
|
function boundArg(F, name) {
|
|
@@ -742,10 +759,10 @@ function main() {
|
|
|
742
759
|
if (args.length !== spec.args.length) die(`${kind} takes ${spec.args.join(" ") || "no arguments"} — ${USAGE}`);
|
|
743
760
|
const inFlight = boundArg(F, "in-flight");
|
|
744
761
|
const reason = F.arg("reason");
|
|
745
|
-
if (kind === "drain") {
|
|
746
|
-
if (reason === null) die(
|
|
762
|
+
if (kind === "drain" || kind === "undrain") {
|
|
763
|
+
if (reason === null) die(`${kind} takes --reason "<reason>"`);
|
|
747
764
|
} else if (reason !== null) {
|
|
748
|
-
die(`--reason belongs to drain, not ${kind}`);
|
|
765
|
+
die(`--reason belongs to drain and undrain, not ${kind}`);
|
|
749
766
|
}
|
|
750
767
|
let pr = null;
|
|
751
768
|
if (spec.family !== undefined) {
|
|
@@ -782,6 +799,7 @@ function main() {
|
|
|
782
799
|
else if (kind === "ci") ci(ev, pr);
|
|
783
800
|
else if (kind === "conflict") conflict(ev, pr);
|
|
784
801
|
else if (kind === "drain") drain(ev, reason);
|
|
802
|
+
else if (kind === "undrain") undrain(ev, reason);
|
|
785
803
|
|
|
786
804
|
writeAll(1, `${[...ev.lines, `event: ${kind}: ${ev.summary.join("; ") || "nothing to record"}`].join("\n")}\n`);
|
|
787
805
|
const tick = spawnSync(process.execPath, [join(SCRIPTS, "fleet-tick.mjs"), ...tickArgs], { stdio: ["ignore", "inherit", "inherit"], env: gitEnv() });
|
package/scripts/ledger.mjs
CHANGED
|
@@ -245,7 +245,7 @@ const requireFile = requireFileIdx !== -1;
|
|
|
245
245
|
if (requireFileIdx !== -1) argv.splice(requireFileIdx, 1);
|
|
246
246
|
|
|
247
247
|
const [cmd, ...rest] = argv;
|
|
248
|
-
if (!cmd) die("usage: ledger.mjs [--file <path>] [--require-file] row|token|filed|ruled|check|read|dispatch|settle|review|drain|rotate [args]");
|
|
248
|
+
if (!cmd) die("usage: ledger.mjs [--file <path>] [--require-file] row|token|filed|ruled|check|read|dispatch|settle|review|drain|undrain|rotate [args]");
|
|
249
249
|
|
|
250
250
|
// A `--`-prefixed token in `check`'s free-text tail used to fold
|
|
251
251
|
// straight into the duplicate-filing subject, so a misspelled flag searched
|
|
@@ -666,7 +666,7 @@ async function acquireLock() {
|
|
|
666
666
|
// so a caller gating on the exit code reads the same failure either way.
|
|
667
667
|
if (requireFile && !existsSync(file)) die(`--require-file given but ledger file does not exist: ${file}`);
|
|
668
668
|
|
|
669
|
-
const WRITE_COMMANDS = new Set(["row", "token", "filed", "ruled", "dispatch", "settle", "review", "drain", "rotate"]);
|
|
669
|
+
const WRITE_COMMANDS = new Set(["row", "token", "filed", "ruled", "dispatch", "settle", "review", "drain", "undrain", "rotate"]);
|
|
670
670
|
// `settle --from-report` takes the lock itself, once its checks have run —
|
|
671
671
|
// see runSettleFromReport().
|
|
672
672
|
const FROM_REPORT = cmd === "settle" && rest.includes("--from-report");
|
|
@@ -836,13 +836,23 @@ if (cmd === "read") {
|
|
|
836
836
|
console.error(` already draining: ${data.drain}`);
|
|
837
837
|
}
|
|
838
838
|
console.log(JSON.stringify({ drain: data.drain, created }));
|
|
839
|
+
} else if (cmd === "undrain") {
|
|
840
|
+
// Clears the standing marker a drain wrote. Refused when none is set: an
|
|
841
|
+
// undrain with nothing to clear is reported, not answered as success.
|
|
842
|
+
const reason = rest.join(" ").trim();
|
|
843
|
+
if (!reason) die('usage: ledger.mjs undrain "<reason>"');
|
|
844
|
+
if (data.drain === null) die("no drain marker is set — nothing to undrain");
|
|
845
|
+
const undrained = data.drain;
|
|
846
|
+
data.drain = null;
|
|
847
|
+
save(data);
|
|
848
|
+
console.log(JSON.stringify({ undrained, reason }));
|
|
839
849
|
} else if (cmd === "rotate") {
|
|
840
850
|
// It moves the file, so a stray word — an imagined `--dry-run` — is
|
|
841
851
|
// refused rather than read as permission to move it.
|
|
842
852
|
if (rest.length) die("usage: ledger.mjs rotate");
|
|
843
853
|
runRotate();
|
|
844
854
|
} else {
|
|
845
|
-
die(`unknown subcommand '${cmd}' — expected row, token, filed, ruled, check, read, dispatch, settle, review, drain or rotate`);
|
|
855
|
+
die(`unknown subcommand '${cmd}' — expected row, token, filed, ruled, check, read, dispatch, settle, review, drain, undrain or rotate`);
|
|
846
856
|
}
|
|
847
857
|
|
|
848
858
|
// Reached only by an arm that did not die, so every write subcommand that did
|
|
@@ -141,11 +141,20 @@ const die = makeDie(NAME);
|
|
|
141
141
|
|
|
142
142
|
// The one git primitive. `gitEnv()` drops an ambient GIT_DIR/GIT_WORK_TREE
|
|
143
143
|
// and LC_ALL=C keeps a failure's last line readable as git wrote it.
|
|
144
|
+
// GIT_NO_LAZY_FETCH=1: this check is a local read-only backstop, so it never
|
|
145
|
+
// reaches the network. In a partial clone a missing baseline commit then
|
|
146
|
+
// answers `missing` instead of being fetched from the promisor remote; with
|
|
147
|
+
// lazy fetch on, the ancestry read fetches it and answers `moved`, and a
|
|
148
|
+
// fetch that fails in the `merge-base` call but succeeds in the `rev-parse`
|
|
149
|
+
// probe turns `missing` into `read`. Git before 2.45 ignores the variable and
|
|
150
|
+
// still lazy-fetches; that is accepted, not fixed — the `--no-lazy-fetch` flag
|
|
151
|
+
// would instead fail every call there, since such a git rejects it as an
|
|
152
|
+
// unknown option.
|
|
144
153
|
// `what` names the call in a failure, since `why` is printed to the operator.
|
|
145
154
|
function git(what, args, cwd, env) {
|
|
146
155
|
const r = spawnSync("git", args, {
|
|
147
156
|
cwd, encoding: "utf8", maxBuffer: MAX_BUFFER, timeout: GIT_TIMEOUT_MS,
|
|
148
|
-
env: gitEnv({ LC_ALL: "C" }, env),
|
|
157
|
+
env: gitEnv({ LC_ALL: "C", GIT_NO_LAZY_FETCH: "1" }, env),
|
|
149
158
|
});
|
|
150
159
|
if (!r.error && r.status === 0) return { ok: true, stdout: r.stdout };
|
|
151
160
|
if (r.error) return { ok: false, why: `${what} did not run: ${r.error.code ?? r.error.message}`, status: null };
|
package/skills/run-team/SKILL.md
CHANGED
|
@@ -202,6 +202,7 @@ Run each as `~/.fleet/bin/fleet-run fleet-event.mjs <kind> <args>`, from the mai
|
|
|
202
202
|
| `CONFLICT` line | `fleet-event.mjs conflict <pr>` |
|
|
203
203
|
| Heartbeat | `fleet-event.mjs heartbeat` |
|
|
204
204
|
| Drain | `fleet-event.mjs drain --reason "<reason>"` |
|
|
205
|
+
| Undrain | `fleet-event.mjs undrain --reason "<reason>"` |
|
|
205
206
|
|
|
206
207
|
### Nothing to do: arm the beat
|
|
207
208
|
|
|
@@ -1345,6 +1346,9 @@ owes beyond its call:
|
|
|
1345
1346
|
the ledger marks reviewed with no verdict row: append it with the verdict
|
|
1346
1347
|
you rule (**Guard: accumulate per PR**) and run `finish` again. A step it
|
|
1347
1348
|
fails is explained in references/close-out.md. Exit 0 is the run closed.
|
|
1349
|
+
Drain only when a documented trigger fired, and name the trigger in `--reason`.
|
|
1350
|
+
**Undrain** only when the maintainer asks, never a drain that budget or
|
|
1351
|
+
context exhaustion caused (references/close-out.md).
|
|
1348
1352
|
- **The finisher-gate wakes** — a CI run reaching a terminal state, a fix-applier reporting `no-op`, a `no-ci` verdict → each is a bullet of **The finisher gate**.
|
|
1349
1353
|
|
|
1350
1354
|
### Tick notes
|
|
@@ -2472,9 +2476,11 @@ live count from it, so nobody states one. Write neither by hand:
|
|
|
2472
2476
|
`review=<launch>=failed` whose `review=<launch>` the row holds settles that
|
|
2473
2477
|
launch in place, alone or with the next launch in the same call. Any other
|
|
2474
2478
|
token is refused.
|
|
2475
|
-
- **`ledger.mjs drain "<reason>"`** —
|
|
2479
|
+
- **`ledger.mjs drain "<reason>"`** — at most one standing drain marker; supply
|
|
2476
2480
|
stops, the review and merge sides keep going. It lives in this run's
|
|
2477
2481
|
ledger, so the next run's rotation retires it with everything else.
|
|
2482
|
+
- **`ledger.mjs undrain "<reason>"`** — clears the drain marker and refuses when
|
|
2483
|
+
no marker is set. `closeout.mjs reopen` runs it.
|
|
2478
2484
|
- **`ledger.mjs rotate`** — phase 0's first ledger write, every run: moves
|
|
2479
2485
|
the file as-is to `ledger.<UTC YYYY-MM-DDTHHMMSSZ>.md` beside it under the
|
|
2480
2486
|
same `<file>.lock`, and the next write starts the empty skeleton — unless
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Close-out: what each metrics step does and why
|
|
2
2
|
|
|
3
|
-
`closeout.mjs finish` runs the scrape, the tier-outcomes check, the metrics refresh, the commit of the metrics files, and the phase-0 receipt move, and SKILL.md's **End of run** says how to drive it. This file is how each of those works, for the controller to read when a step refuses. The verdict rules — what `closed_own_ticket` and `minted_false_claim` mean, and that a value not in hand is left blank — stay in SKILL.md under **Guard: accumulate per PR**, because the controller still rules them.
|
|
3
|
+
`closeout.mjs finish` runs the scrape, the tier-outcomes check, the metrics refresh, the commit of the metrics files, and the phase-0 receipt move, and SKILL.md's **End of run** says how to drive it. This file is how each of those works, for the controller to read when a step refuses, and how `closeout.mjs reopen` undoes a drain. The verdict rules — what `closed_own_ticket` and `minted_false_claim` mean, and that a value not in hand is left blank — stay in SKILL.md under **Guard: accumulate per PR**, because the controller still rules them.
|
|
4
4
|
|
|
5
5
|
## Scrape the member facts and check the tier rows
|
|
6
6
|
|
|
@@ -103,3 +103,7 @@ The step can refuse in each of these ways:
|
|
|
103
103
|
- The receipt could not be linked to the destination: `cannot move <from> to <to>: <error>`. Nothing was moved. **Fix the cause the error names, then run finish again.**
|
|
104
104
|
- `.fleet/phase0.previous.json` already holds a receipt from a different run. **File it by hand as `.fleet/phase0.<UTC stamp>.json`, then run finish again.** That is the name `ledger.mjs rotate` archives a receipt under; a receipt moved to any other name is one nothing files with its ledger. This happens when a previous run's close-out moved its receipt there but the next run never rotated — a controller crash between the move and rotation, or a stalled or deleted run before rotation — or when a run's rotation refused, or found that archive name taken, and put the receipt it restored back there.
|
|
105
105
|
- The receipt was moved to the destination but the original copy could not be removed. **Run finish again:** it finds both names are one file and retries the removal. A rare race: the link succeeded but the unlink failed on a stray filesystem error or permission issue. If the removal keeps failing, delete the `.fleet/phase0.json` file by hand so the next run does not try to move it again, and run finish again — with nothing left to move, the step is `ok` and the heartbeat stop runs.
|
|
106
|
+
|
|
107
|
+
## Undo a drain
|
|
108
|
+
|
|
109
|
+
**Undrain only when the maintainer asks, and never a drain that budget or context exhaustion caused.** `~/.fleet/bin/fleet-run fleet-event.mjs undrain --reason "<reason>"` runs `closeout.mjs reopen --reason "<reason>"`, then the tick, as `drain` does. `reopen` refuses (exit 2) once any `finish` step in `.fleet/closeout.json` is `ok`, because the tick and what follows it have already acted; a `finish` whose `tick` failed blocks nothing. Otherwise it puts `begin`'s `drain` and `release` steps back to pending and clears `begun`, then runs `ledger.mjs undrain "<reason>"`, which clears the marker, so the next `begin` drains and releases again. With no marker set it refuses (exit 2). A ledger drained by a bare `ledger.mjs drain`, with no receipt, is only undrained. A claim `begin` released stays released: its ticket goes back to the queue and is dispatched under the next free name (`impl-<N>-b`), because `ledger.mjs dispatch` refuses a name already dispatched this session.
|