@feigi/fleet-ctl 3.48.0 → 3.49.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/fleet-tick.mjs +2 -2
- package/scripts/ledger-grammar.mjs +1 -1
- package/scripts/ledger.mjs +154 -23
- package/skills/run-team/SKILL.md +18 -13
package/package.json
CHANGED
package/scripts/fleet-tick.mjs
CHANGED
|
@@ -392,13 +392,13 @@ export class LedgerError extends Error {}
|
|
|
392
392
|
// nothing can tell which review a dispositions verdict answered. Only a ledger
|
|
393
393
|
// written before the plugin update and read after it can hold one.
|
|
394
394
|
const REVIEWED_RUNLESS = /^reviewed=[0-9a-fA-F]{7,40}:\d+\/\d+\/\d+$/;
|
|
395
|
-
const HELD = /^held-behind[:-]#?(\d+)$/;
|
|
395
|
+
export const HELD = /^held-behind[:-]#?(\d+)$/;
|
|
396
396
|
// The durable record that a PR conflicts — written onto the held PR's own
|
|
397
397
|
// row by the merge bot, when its local-rebase fallback hits a conflict it would
|
|
398
398
|
// not force, or by the controller off this tick's `CONFLICT` line — and
|
|
399
399
|
// spelled like `held-behind` so the two read alike. Distinct from an
|
|
400
400
|
// Exclusion, which gates a ticket's claim; this gates a PR's merge.
|
|
401
|
-
const CONFLICT_HOLD = /^conflict-hold[:-]#?(\d+)$/;
|
|
401
|
+
export const CONFLICT_HOLD = /^conflict-hold[:-]#?(\d+)$/;
|
|
402
402
|
// tier-check.mjs's verdict on an implementer, `tier-ok=<member>:<def>`
|
|
403
403
|
// or `tier-mismatch=<member>:<def>` — or `tier-unverifiable=<member>:no-transcript`
|
|
404
404
|
// for a settled member whose transcript was never written.
|
|
@@ -198,7 +198,7 @@ function readReviews(tokens) {
|
|
|
198
198
|
|
|
199
199
|
// The entries of `after` that `before` does not account for, counting
|
|
200
200
|
// duplicates: what a write added.
|
|
201
|
-
function added(before, after) {
|
|
201
|
+
export function added(before, after) {
|
|
202
202
|
const left = new Map();
|
|
203
203
|
for (const x of before) left.set(x, (left.get(x) ?? 0) + 1);
|
|
204
204
|
return after.filter((x) => {
|
package/scripts/ledger.mjs
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// redoes finished work. Two duplicate tickets shipped in one run from exactly
|
|
5
5
|
// that.
|
|
6
6
|
//
|
|
7
|
-
// Rows are rewritten in place, one per ticket
|
|
7
|
+
// Rows are rewritten in place, one per ticket: `row` replaces a whole line
|
|
8
|
+
// and `token` appends tokens to one. `filed` and `ruled` are
|
|
8
9
|
// append-only, because their whole purpose is to outlive the reasoning that
|
|
9
10
|
// produced them; `filed` appends at most one row per issue.
|
|
10
11
|
//
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
// `## Retired`, where `dispatch` and that numbering still read it.
|
|
26
27
|
//
|
|
27
28
|
// Writer policy: the controller owns run state
|
|
28
|
-
// (`row`/`settle`/`dispatch`/`review`/`drain`/`ruled`/`rotate`); filers append
|
|
29
|
+
// (`row`/`token`/`settle`/`dispatch`/`review`/`drain`/`ruled`/`rotate`); filers append
|
|
29
30
|
// filings with `filed`; all writes are serialized by `<file>.lock`. Every
|
|
30
31
|
// write subcommand except `rotate` — which moves the file whole and never
|
|
31
32
|
// loads it, see runRotate() — rewrites the WHOLE file from what it loaded,
|
|
@@ -46,8 +47,8 @@ import { fileURLToPath } from "node:url";
|
|
|
46
47
|
import { spawnSync, execFileSync } from "node:child_process";
|
|
47
48
|
import { makeDie, isFlagLike, hasEqualsForm, isDigits } from "./arg.mjs";
|
|
48
49
|
import { fleetFile, FleetDirUnresolvable } from "./fleet-dir.mjs";
|
|
49
|
-
import { parseMember, parseToken, memberTokens, nextMergeBot, nextRetry, liveOnLedger, retiredOnLedger, isRetirable, agentDefinition, CELL, tierValues, rowPr, rowWriteRefusal, isReviewToken, addedReviewToken, newSplitRow, splitRowClause, premisesOf, ROWS, DISPATCHED, FILED, RULED, DRAIN, RETIRED, headerRe, escapeText, unescapeText } from "./ledger-grammar.mjs";
|
|
50
|
-
import { deriveRun, LedgerError, labelOffMember } from "./fleet-tick.mjs";
|
|
50
|
+
import { parseMember, parseToken, memberTokens, nextMergeBot, nextRetry, liveOnLedger, retiredOnLedger, isRetirable, agentDefinition, CELL, tierValues, rowPr, rowWriteRefusal, isReviewToken, addedReviewToken, newSplitRow, splitRowClause, added, premisesOf, MEMBER_FAMILIES, ROWS, DISPATCHED, FILED, RULED, DRAIN, RETIRED, headerRe, escapeText, unescapeText } from "./ledger-grammar.mjs";
|
|
51
|
+
import { deriveRun, LedgerError, labelOffMember, HELD, CONFLICT_HOLD } from "./fleet-tick.mjs";
|
|
51
52
|
import { stateFileIn, readState, writeState, assessBeat, stallsAt } from "./fleet-state.mjs";
|
|
52
53
|
import { processSource, ancestry, controllerOf, judgeController, ProcUnreadable } from "./proc.mjs";
|
|
53
54
|
import { attemptLock, releaseLockFile, reapPathOf } from "./pid-lock.mjs";
|
|
@@ -168,6 +169,9 @@ function defaultLedgerPath() {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
|
|
172
|
+
// What `row` and `token` say of a `label-off=` naming no finisher this run has.
|
|
173
|
+
const LABEL_OFF_UNKNOWN = "names no finisher-pr member this run has dispatched or recorded — label-off=<finisher-pr-M[-x]>, the latest finisher attempt, before taking ready-to-merge off PR M";
|
|
174
|
+
|
|
171
175
|
const argv = process.argv.slice(2);
|
|
172
176
|
// Both flags are read by EXACT token below (`indexOf`), so the `--flag=value`
|
|
173
177
|
// spelling matches neither — and an unmatched token is not refused, it lands
|
|
@@ -236,7 +240,7 @@ const requireFile = requireFileIdx !== -1;
|
|
|
236
240
|
if (requireFileIdx !== -1) argv.splice(requireFileIdx, 1);
|
|
237
241
|
|
|
238
242
|
const [cmd, ...rest] = argv;
|
|
239
|
-
if (!cmd) die("usage: ledger.mjs [--file <path>] [--require-file] row|filed|ruled|check|read|dispatch|settle|review|drain|rotate [args]");
|
|
243
|
+
if (!cmd) die("usage: ledger.mjs [--file <path>] [--require-file] row|token|filed|ruled|check|read|dispatch|settle|review|drain|rotate [args]");
|
|
240
244
|
|
|
241
245
|
// A `--`-prefixed token in `check`'s free-text tail used to fold
|
|
242
246
|
// straight into the duplicate-filing subject, so a misspelled flag searched
|
|
@@ -645,7 +649,7 @@ async function acquireLock() {
|
|
|
645
649
|
// so a caller gating on the exit code reads the same failure either way.
|
|
646
650
|
if (requireFile && !existsSync(file)) die(`--require-file given but ledger file does not exist: ${file}`);
|
|
647
651
|
|
|
648
|
-
const WRITE_COMMANDS = new Set(["row", "filed", "ruled", "dispatch", "settle", "review", "drain", "rotate"]);
|
|
652
|
+
const WRITE_COMMANDS = new Set(["row", "token", "filed", "ruled", "dispatch", "settle", "review", "drain", "rotate"]);
|
|
649
653
|
if (WRITE_COMMANDS.has(cmd)) await acquireLock();
|
|
650
654
|
// `rotate` never load()s: a ledger load() would refuse is still the previous
|
|
651
655
|
// run's record, and it is archived as-is — and read line by line when it
|
|
@@ -706,18 +710,10 @@ if (cmd === "read") {
|
|
|
706
710
|
// `label-off=<attempt>` tells the tick a missing `ready-to-merge` is
|
|
707
711
|
// the controller's own removal, not a finisher's miss — so one naming no
|
|
708
712
|
// finisher-pr member this run has would mask a real miss behind a record of
|
|
709
|
-
// nothing
|
|
710
|
-
|
|
711
|
-
// reads: a token `row` wrote never enters `## Dispatched`, and this line's
|
|
712
|
-
// own copy of a name vouches for nothing. Local only — never `gh`.
|
|
713
|
-
const known = new Set([...data.dispatched.map(parseToken), ...data.rows.flatMap(memberTokens)]
|
|
714
|
-
.filter((t) => t && t.family === "finisher-pr").map((t) => t.name));
|
|
715
|
-
const badOff = line.split(/\s+/).find((tok) => {
|
|
716
|
-
const m = labelOffMember(tok);
|
|
717
|
-
return m === null || (m !== undefined && !known.has(m.name));
|
|
718
|
-
});
|
|
713
|
+
// nothing; see badLabelOff().
|
|
714
|
+
const badOff = badLabelOff(line.split(/\s+/));
|
|
719
715
|
if (badOff !== undefined) {
|
|
720
|
-
die(`row ${key}: '${badOff}'
|
|
716
|
+
die(`row ${key}: '${badOff}' ${LABEL_OFF_UNKNOWN}`);
|
|
721
717
|
}
|
|
722
718
|
const i = data.rows.findIndex((r) => r.split(/\s/)[0] === key);
|
|
723
719
|
const created = i === -1;
|
|
@@ -748,7 +744,15 @@ if (cmd === "read") {
|
|
|
748
744
|
// Logged only after save() returns — a failed write must not claim a row
|
|
749
745
|
// was recorded when it never made it to disk.
|
|
750
746
|
save(data);
|
|
751
|
-
|
|
747
|
+
// A rewrite loses every token the new text does not repeat, so the ones it
|
|
748
|
+
// lost are named: the controller learns of a dropped `ports=` or `→ PR#`
|
|
749
|
+
// here and not from a later reader that finds it missing.
|
|
750
|
+
if (created) {
|
|
751
|
+
console.error(` new row ${key}`);
|
|
752
|
+
} else {
|
|
753
|
+
const dropped = droppedTokens(oldRow, line);
|
|
754
|
+
console.error(` rewrote row ${key}${dropped.length === 0 ? "" : `; dropped: ${dropped.join(" ")}`}`);
|
|
755
|
+
}
|
|
752
756
|
console.log(JSON.stringify({ ticket: key, line, created }));
|
|
753
757
|
} else if (cmd === "filed") {
|
|
754
758
|
const [issue, ...subjectParts] = rest;
|
|
@@ -802,6 +806,8 @@ if (cmd === "read") {
|
|
|
802
806
|
runDispatch();
|
|
803
807
|
} else if (cmd === "settle") {
|
|
804
808
|
runSettle();
|
|
809
|
+
} else if (cmd === "token") {
|
|
810
|
+
runToken();
|
|
805
811
|
} else if (cmd === "review") {
|
|
806
812
|
runReview();
|
|
807
813
|
} else if (cmd === "drain") {
|
|
@@ -825,7 +831,7 @@ if (cmd === "read") {
|
|
|
825
831
|
if (rest.length) die("usage: ledger.mjs rotate");
|
|
826
832
|
runRotate();
|
|
827
833
|
} else {
|
|
828
|
-
die(`unknown subcommand '${cmd}' — expected row, filed, ruled, check, read, dispatch, settle, review, drain or rotate`);
|
|
834
|
+
die(`unknown subcommand '${cmd}' — expected row, token, filed, ruled, check, read, dispatch, settle, review, drain or rotate`);
|
|
829
835
|
}
|
|
830
836
|
|
|
831
837
|
// Reached only by an arm that did not die, so every write subcommand that did
|
|
@@ -2015,6 +2021,15 @@ function runSettle() {
|
|
|
2015
2021
|
console.log(JSON.stringify(payload(i, true)));
|
|
2016
2022
|
}
|
|
2017
2023
|
|
|
2024
|
+
// A ticket or PR number argument as a number: a leading `#` is allowed, a
|
|
2025
|
+
// stray flag or anything but digits refused, saying `what` was expected.
|
|
2026
|
+
function numberArg(arg, what, usage) {
|
|
2027
|
+
refuseStrayInId(arg, what);
|
|
2028
|
+
const digits = arg.replace(/^#/, "");
|
|
2029
|
+
if (!isDigits(digits)) die(`'${arg}' is not ${what} — ${usage}`);
|
|
2030
|
+
return Number(digits);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2018
2033
|
// `review <pr> <token>…`: the only writer of a PR's `review=`/`reviewed=`
|
|
2019
2034
|
// tokens. Each lands on the PR's row — the ticket row once `settle
|
|
2020
2035
|
// impl-<N>=PR#M` has run, else `#M`, created when neither exists — so the
|
|
@@ -2027,10 +2042,7 @@ function runReview() {
|
|
|
2027
2042
|
const usage = "usage: ledger.mjs review <pr> <review=…|reviewed=…>…";
|
|
2028
2043
|
const [pr, ...parts] = rest;
|
|
2029
2044
|
if (!pr || parts.length === 0) die(usage);
|
|
2030
|
-
|
|
2031
|
-
const digits = pr.replace(/^#/, "");
|
|
2032
|
-
if (!isDigits(digits)) die(`'${pr}' is not a PR number — ${usage}`);
|
|
2033
|
-
const prNum = Number(digits);
|
|
2045
|
+
const prNum = numberArg(pr, "a PR number", usage);
|
|
2034
2046
|
const tokens = parts.join(" ").split(/\s+/).filter(Boolean);
|
|
2035
2047
|
const other = tokens.find((tok) => !isReviewToken(tok));
|
|
2036
2048
|
if (other !== undefined) {
|
|
@@ -2059,3 +2071,122 @@ function runReview() {
|
|
|
2059
2071
|
console.error(` review on row ${key}`);
|
|
2060
2072
|
console.log(JSON.stringify({ pr: prNum, row: key, line, created }));
|
|
2061
2073
|
}
|
|
2074
|
+
|
|
2075
|
+
// A row's tokens: its words after the key, bar the ` · ` separators between
|
|
2076
|
+
// them.
|
|
2077
|
+
function rowTokens(text) {
|
|
2078
|
+
return text.split(/\s+/).filter((w) => w !== "" && w !== "·").slice(1);
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
// Every token `oldRow` had that `line` lacks, duplicates counted, in the old
|
|
2082
|
+
// row's order: what a `row` rewrite lost.
|
|
2083
|
+
function droppedTokens(oldRow, line) {
|
|
2084
|
+
return added(rowTokens(line), rowTokens(oldRow));
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
// The first of `words` that is a `label-off=` naming no finisher-pr member
|
|
2088
|
+
// this run has, else undefined. Known means in `## Dispatched` or among a
|
|
2089
|
+
// row's member tokens as they stand before this write, the two places
|
|
2090
|
+
// dispatch's live-sibling check reads: a token `row` or `token` wrote never
|
|
2091
|
+
// enters `## Dispatched`, and the line being written vouches for nothing.
|
|
2092
|
+
// Local only — never `gh`.
|
|
2093
|
+
function badLabelOff(words) {
|
|
2094
|
+
const known = new Set([...data.dispatched.map(parseToken), ...data.rows.flatMap(memberTokens)]
|
|
2095
|
+
.filter((t) => t && t.family === "finisher-pr").map((t) => t.name));
|
|
2096
|
+
return words.find((tok) => {
|
|
2097
|
+
const m = labelOffMember(tok);
|
|
2098
|
+
return m === null || (m !== undefined && !known.has(m.name));
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
// Why `token` may not write `tok` onto a row whose text is `rowText` (the row
|
|
2103
|
+
// as it stands plus the call's earlier tokens), or null when it may. A token
|
|
2104
|
+
// is one word: an empty argument, one with a space in it (prose, which would
|
|
2105
|
+
// split into words the row's own words then dedupe against), and the row's
|
|
2106
|
+
// ` · ` separator are no token. A member token is `dispatch`'s or `settle`'s,
|
|
2107
|
+
// a review token `review`'s. A word shaped like a member that the grammar
|
|
2108
|
+
// cannot parse, a `tier=` that is not a cell, a `tier=` naming a second tier
|
|
2109
|
+
// on a row that already has one, a `held-behind` or `conflict-hold` token the
|
|
2110
|
+
// tick cannot read, and a lone `→` — an arrow with no PR beside it points at
|
|
2111
|
+
// nothing — are refused. Every other word is a freeform token.
|
|
2112
|
+
function tokenRefusal(tok, rowText) {
|
|
2113
|
+
if (tok === "" || /\s/.test(tok)) {
|
|
2114
|
+
return "is not one token — pass each token as its own argument, with no space in it";
|
|
2115
|
+
}
|
|
2116
|
+
if (tok === "·") return "is the row's ` · ` separator, which `token` writes between tokens itself";
|
|
2117
|
+
if (parseToken(tok) !== null) {
|
|
2118
|
+
return "is a member token — members are written only with `ledger.mjs dispatch` and `ledger.mjs settle`";
|
|
2119
|
+
}
|
|
2120
|
+
if (isReviewToken(tok)) {
|
|
2121
|
+
return "is a review token — review tokens are written only with `ledger.mjs review <pr> <token>…`, which puts them on the PR's row";
|
|
2122
|
+
}
|
|
2123
|
+
const name = tok.split("=")[0];
|
|
2124
|
+
if (MEMBER_FAMILIES.some((family) => name.startsWith(`${family}-`))) {
|
|
2125
|
+
return "is shaped like a member token this grammar cannot parse — a member is impl-<N>, fix-pr-<M>, finisher-pr-<M> or merge-bot-<n>, a retry suffix allowed";
|
|
2126
|
+
}
|
|
2127
|
+
for (const [prefix, shape] of [["held-behind", HELD], ["conflict-hold", CONFLICT_HOLD]]) {
|
|
2128
|
+
if (tok.startsWith(prefix) && !shape.test(tok)) {
|
|
2129
|
+
return `is not ${prefix}:#<M> — the tick reads only ${prefix}:#<number> and would ignore this one`;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
const [tier] = tierValues(tok);
|
|
2133
|
+
if (tier !== undefined) {
|
|
2134
|
+
if (!CELL.test(tier)) return "is not tier=<cell> — a cell is <slow|task|smol>-<level>";
|
|
2135
|
+
const other = tierValues(rowText).find((v) => v !== tier);
|
|
2136
|
+
if (other !== undefined) {
|
|
2137
|
+
return `names a second tier — the row already carries tier=${other}, and a row names one; replacing it takes ledger.mjs row, which rewrites the whole line`;
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
if (tok === "→") return "is the row's arrow, which is written with the PR it points at — ledger.mjs row writes the whole line";
|
|
2141
|
+
if (badLabelOff([tok]) !== undefined) return LABEL_OFF_UNKNOWN;
|
|
2142
|
+
return null;
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
// `token <ticket|pr> <token>…`: appends each token to the row the key maps to
|
|
2146
|
+
// — the PR's row for a PR key, the ticket row once `settle impl-<N>=PR#M` has
|
|
2147
|
+
// run, else `#M`, created when neither exists: `review`'s lookup — keeping
|
|
2148
|
+
// every token already there, in order, as ` · <token>`. A token the row
|
|
2149
|
+
// already carries is a no-op. Every refusal is judged before anything is
|
|
2150
|
+
// written, whole call alike, under the lock.
|
|
2151
|
+
function runToken() {
|
|
2152
|
+
const usage = "usage: ledger.mjs token <ticket|pr> <token>…";
|
|
2153
|
+
const [keyArg, ...tokens] = rest;
|
|
2154
|
+
if (!keyArg || tokens.length === 0) die(usage);
|
|
2155
|
+
const num = numberArg(keyArg, "a ticket or PR number", usage);
|
|
2156
|
+
const i = prRowIndex(num);
|
|
2157
|
+
const created = i === -1;
|
|
2158
|
+
const oldLine = created ? null : data.rows[i];
|
|
2159
|
+
let carried = oldLine ?? "";
|
|
2160
|
+
for (const tok of tokens) {
|
|
2161
|
+
const why = tokenRefusal(tok, carried);
|
|
2162
|
+
if (why !== null) die(`token #${num}: '${tok}' ${why}`);
|
|
2163
|
+
carried += ` ${tok}`;
|
|
2164
|
+
}
|
|
2165
|
+
const key = created ? `#${num}` : rowKey(oldLine);
|
|
2166
|
+
const have = new Set(created ? [] : rowTokens(oldLine));
|
|
2167
|
+
const appended = [];
|
|
2168
|
+
for (const tok of tokens) {
|
|
2169
|
+
if (have.has(tok)) {
|
|
2170
|
+
console.error(` already present on row ${key}: ${tok}`);
|
|
2171
|
+
} else {
|
|
2172
|
+
have.add(tok);
|
|
2173
|
+
appended.push(tok);
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
if (appended.length === 0) {
|
|
2177
|
+
console.log(JSON.stringify({ key, line: oldLine, added: appended }));
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
const line = created ? `${key} ${appended.join(" · ")}` : `${oldLine} · ${appended.join(" · ")}`;
|
|
2181
|
+
const after = created ? [...data.rows, line] : data.rows.with(i, line);
|
|
2182
|
+
// A freeform token can still move the PR a row maps to (a `PR#<n>` mention
|
|
2183
|
+
// on a row with no implementer), or split one PR across two rows.
|
|
2184
|
+
const split = newSplitRow(data.rows, after);
|
|
2185
|
+
if (split !== null) die(`token ${key}: ${splitRowClause(split)}`);
|
|
2186
|
+
const refusal = rowWriteRefusal(data.rows, after, oldLine, line, data.retired);
|
|
2187
|
+
if (refusal !== null) die(`token ${key}: ${refusal}`);
|
|
2188
|
+
data.rows = after;
|
|
2189
|
+
save(data);
|
|
2190
|
+
console.error(` appended ${appended.join(" ")} to row ${key}`);
|
|
2191
|
+
console.log(JSON.stringify({ key, line, added: appended }));
|
|
2192
|
+
}
|
package/skills/run-team/SKILL.md
CHANGED
|
@@ -1414,9 +1414,12 @@ honest summary is unchanged and is the reason this paragraph exists: the guard
|
|
|
1414
1414
|
fired on the criterion the maintainer chose in advance, not on a demonstration
|
|
1415
1415
|
that the cheaper tier is worse.
|
|
1416
1416
|
|
|
1417
|
-
`row` **replaces the whole line**, it does not append.
|
|
1418
|
-
that
|
|
1419
|
-
|
|
1417
|
+
`row` **replaces the whole line**, it does not append. To add a token to a row
|
|
1418
|
+
that exists — `ci=`, `held-behind:#M`, `conflict-hold:#M`, `label-off=`, `ports=`
|
|
1419
|
+
— run `ledger.mjs token <key> <token>…`, which keeps every token already on the
|
|
1420
|
+
row and takes a PR's number as the key. A `row` over a row that already carries
|
|
1421
|
+
`KILLED`, `ports=` or `→ PR#` must repeat those tokens or they are gone, and its
|
|
1422
|
+
stderr, `rewrote row #N; dropped: <token>…`, names each token it lost.
|
|
1420
1423
|
|
|
1421
1424
|
`ledger.mjs read` is safe on a pipe as well as a redirect: its payload used to
|
|
1422
1425
|
be abandoned at the pipe buffer and still exit 0, which is what left `board.mjs`
|
|
@@ -1804,8 +1807,9 @@ owes beyond its row:
|
|
|
1804
1807
|
because every reader takes a recorded stop as the end of the run.
|
|
1805
1808
|
- **Monitor: CI run completes** → bind it (`ci-state.mjs --pr <N>`) and **record
|
|
1806
1809
|
it as `ci=<run-id>:<attempt>:<conclusion>`, not just "CI green"** — in the
|
|
1807
|
-
ticket's ledger row, which outlives your context
|
|
1808
|
-
|
|
1810
|
+
ticket's ledger row, which outlives your context: `ledger.mjs token <key>
|
|
1811
|
+
ci=<run-id>:<attempt>:<conclusion>` appends it and keeps every token already on
|
|
1812
|
+
the row, where `row` would replace the whole line (above).
|
|
1809
1813
|
That key cannot be reconstructed once the head is superseded, so a
|
|
1810
1814
|
controller holding only the colour cannot later tell an edge it has already
|
|
1811
1815
|
spent from one that never fired, and that is the distinction the sibling
|
|
@@ -1934,11 +1938,11 @@ depth** guard table applied in code. Act on each line as it reads:
|
|
|
1934
1938
|
tracks it, no conflict hold stands on it, no fix-applier, finisher or
|
|
1935
1939
|
implementer on it is live, and, if it carries `ready-to-merge`, no merge bot
|
|
1936
1940
|
is live: a queued PR is the bot's while one runs, and its own fallback records
|
|
1937
|
-
the hold. Record
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1941
|
+
the hold. Record it with `ledger.mjs token <key> conflict-hold:#<M>`, `<key>`
|
|
1942
|
+
the row naming PR M, or M itself: it appends the token and keeps every token
|
|
1943
|
+
the row already carries. The row's detail prints the `row` form of that
|
|
1944
|
+
write for each PR it names; the `token` form is the one that keeps the row's
|
|
1945
|
+
tokens. Then run the tick: the hold reads as `DISPATCH fix-pr
|
|
1942
1946
|
PR#<M>`, a conflict fix-applier (**A `DISPATCH fix-pr PR#<M>` on a conflict
|
|
1943
1947
|
hold**), and that row obeys every hold. A review in flight does not stop the
|
|
1944
1948
|
line: `fix-due` waits for the review to return. It prints under a
|
|
@@ -3472,7 +3476,8 @@ label write are one command and the finisher never runs either alone:
|
|
|
3472
3476
|
verdict on the tree the finisher read, and a GitHub label does not follow the
|
|
3473
3477
|
branch — on one PR it survived a push and came to sit on a commit nobody had
|
|
3474
3478
|
audited. Write `label-off=<latest finisher attempt>` onto the PR's row first
|
|
3475
|
-
(`ledger.mjs
|
|
3479
|
+
(`ledger.mjs token <PR number> label-off=<latest finisher attempt>`, which keeps
|
|
3480
|
+
every token the row already has — **Run ledger**), then
|
|
3476
3481
|
remove `ready-to-merge`, then approve. The token is how the tick tells your
|
|
3477
3482
|
removal from a finisher that never labelled — a tick run between a removal and
|
|
3478
3483
|
its token re-dispatches a finisher into your take-off window. The label goes
|
|
@@ -4420,7 +4425,7 @@ is yours, written before you take `ready-to-merge` off PR M on purpose (taking
|
|
|
4420
4425
|
it off before you approve a push, or clearing one left on a moved head),
|
|
4421
4426
|
naming that PR's latest finisher attempt: the tick reads a missing label as a
|
|
4422
4427
|
finisher's miss only after the last attempt a `label-off=` names, so without
|
|
4423
|
-
it your own removal reads as one. `row`
|
|
4428
|
+
it your own removal reads as one. `row` and `token` refuse a `label-off=` naming no
|
|
4424
4429
|
`finisher-pr` member that `## Dispatched` or some row already carries.
|
|
4425
4430
|
|
|
4426
4431
|
`review` holds a PR's review record to these rules, read across every row that
|
|
@@ -4452,7 +4457,7 @@ Plus two append-only lists:
|
|
|
4452
4457
|
- **ruled** (`ledger.mjs ruled <pr> <decision>`) — PR + decision + one-line reason,
|
|
4453
4458
|
so a replacement controller does not re-litigate a settled call.
|
|
4454
4459
|
|
|
4455
|
-
**Writer policy: the controller owns run state (`row`/`settle`/`dispatch`/`review`/`drain`/`ruled`);
|
|
4460
|
+
**Writer policy: the controller owns run state (`row`/`token`/`settle`/`dispatch`/`review`/`drain`/`ruled`);
|
|
4456
4461
|
filers append filings with `filed`; all writes are serialized by `<file>.lock`.**
|
|
4457
4462
|
Every write rewrites the whole file from what it read, so without the lock two
|
|
4458
4463
|
concurrent writers are last-writer-wins — measured, 8 concurrent `filed` kept
|