@feigi/fleet-ctl 3.154.7 → 3.154.8
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/ledger.mjs
CHANGED
|
@@ -1996,36 +1996,35 @@ function dispositionsRefusal(pr, review) {
|
|
|
1996
1996
|
return null;
|
|
1997
1997
|
}
|
|
1998
1998
|
|
|
1999
|
-
// PR `pr`'s ruling, as `{tickets,
|
|
2000
|
-
//
|
|
2001
|
-
// tier-outcomes.mjs `append` resolves a ticket from
|
|
2002
|
-
// latest row in `tsv`, the main checkout's tier-outcomes.tsv, or null when
|
|
2003
|
-
// `refusal` is set or `tickets` is empty. `refusal` says why the
|
|
1999
|
+
// PR `pr`'s ruling gate, as `{tickets, refusal}`: `tickets` the tickets a
|
|
2000
|
+
// settled `impl-<N>=PR#<pr>` token on a row names — the token
|
|
2001
|
+
// tier-outcomes.mjs `append` resolves a ticket from. `refusal` says why the
|
|
2004
2002
|
// finisher waits, or is null when it does not: the PR is an implementer's and
|
|
2005
|
-
// the
|
|
2006
|
-
// verdicts, so a replacement finisher is never
|
|
2003
|
+
// the main checkout's tier-outcomes.tsv has no row whose `pr` is it. Any row
|
|
2004
|
+
// passes, whatever its date or verdicts, so a replacement finisher is never
|
|
2005
|
+
// held once the first passed: no verdict decides the gate.
|
|
2007
2006
|
// The ledger lives in the main checkout's `.fleet/` (fleet-dir.mjs), so the
|
|
2008
2007
|
// file is found beside that directory — no git, no gh. A missing file is no
|
|
2009
|
-
// row (`append` creates it); one that cannot be read or parsed
|
|
2010
|
-
//
|
|
2008
|
+
// row (`append` creates it); one that cannot be read or parsed — a row with a
|
|
2009
|
+
// malformed verdict cell included, which parseTierOutcomes() throws on —
|
|
2010
|
+
// refuses, naming it, and is never a pass.
|
|
2011
2011
|
// tier-outcomes.mjs is imported here, not at the top: its import graph is
|
|
2012
2012
|
// several modules no other subcommand loads.
|
|
2013
2013
|
async function rulingOf(pr) {
|
|
2014
2014
|
const { parseTierOutcomes, implementerClaims } = await import("./tier-outcomes.mjs");
|
|
2015
2015
|
const tickets = [...new Set(implementerClaims(data, pr).map((c) => c.ticket))];
|
|
2016
|
-
if (tickets.length === 0) return { tickets,
|
|
2016
|
+
if (tickets.length === 0) return { tickets, refusal: null };
|
|
2017
2017
|
const tsv = join(dirname(dirname(resolve(file))), "docs", "metrics", "tier-outcomes.tsv");
|
|
2018
2018
|
if (existsSync(tsv)) {
|
|
2019
2019
|
let rows;
|
|
2020
2020
|
try {
|
|
2021
2021
|
rows = parseTierOutcomes(readFileSync(tsv, "utf8"));
|
|
2022
2022
|
} catch (e) {
|
|
2023
|
-
return { tickets,
|
|
2023
|
+
return { tickets, refusal: `cannot read the PR's ruling off ${tsv}: ${e.code ?? e.message} — fix the file, then dispatch the finisher again` };
|
|
2024
2024
|
}
|
|
2025
|
-
|
|
2026
|
-
if (ruling !== undefined) return { tickets, ruling, tsv, refusal: null };
|
|
2025
|
+
if (rows.some((r) => r.pr === String(pr))) return { tickets, refusal: null };
|
|
2027
2026
|
}
|
|
2028
|
-
return { tickets,
|
|
2027
|
+
return { tickets, refusal: `PR #${pr}, the implementer PR of ${tickets.length === 1 ? "ticket" : "tickets"} ${tickets.map((n) => `#${n}`).join(", ")}, has no ruling — `
|
|
2029
2028
|
+ `${tsv} has no row for it; rule its review with \`~/.omp/plugins/node_modules/@feigi/fleet-ctl/scripts/fleet-run tier-outcomes.mjs append ${pr}\`, `
|
|
2030
2029
|
+ "then dispatch the finisher again" };
|
|
2031
2030
|
}
|
|
@@ -2165,43 +2164,34 @@ function checkReaders(where) {
|
|
|
2165
2164
|
// read off the PR's closingIssuesReferences in its own repository — a
|
|
2166
2165
|
// reference into another repository closes no issue here, whatever its
|
|
2167
2166
|
// number — its head branch, and the titles and labels of the issues they
|
|
2168
|
-
// name;
|
|
2169
|
-
// Check 1,
|
|
2170
|
-
//
|
|
2171
|
-
//
|
|
2172
|
-
// be the suggestion-band record of this PR's review — an
|
|
2173
|
-
// trimmed, is recordTitle(), as dispositions-check.mjs
|
|
2174
|
-
// Check 3, for every PR, Ticketless ones included: no
|
|
2175
|
-
// PR's own tickets may be a ticket another claim holds,
|
|
2176
|
-
// the Label map's in-progress string (claimedElsewhere()).
|
|
2177
|
-
// tickets are the ones its settled tokens name and, when its
|
|
2178
|
-
// branch (stranded.mjs's CLAIM_BRANCH), that claim's ticket —
|
|
2179
|
-
// inherited carries no token, and its own claim holds its ticket
|
|
2180
|
-
// merges. Returns `{refs, failures}`: the issue numbers the PR
|
|
2181
|
-
// own suggestion-band record aside — that one is a failure here,
|
|
2182
|
-
// ticket — and one line per failure. A read the checks need dies,
|
|
2183
|
-
// read, and writes nothing.
|
|
2184
|
-
async function closingRefusals(member,
|
|
2167
|
+
// name; `tickets` are the ones rulingOf() found settled implementer tokens
|
|
2168
|
+
// naming the PR for. Check 1, for every PR: each of its own tickets is among
|
|
2169
|
+
// its closing references, so an implementer PR closes its own ticket whatever
|
|
2170
|
+
// its Ruling, which judges the work as first submitted. Check 2, for every PR:
|
|
2171
|
+
// no reference may be the suggestion-band record of this PR's review — an
|
|
2172
|
+
// issue whose title, trimmed, is recordTitle(), as dispositions-check.mjs
|
|
2173
|
+
// finds the record. Check 3, for every PR, Ticketless ones included: no
|
|
2174
|
+
// reference besides the PR's own tickets may be a ticket another claim holds,
|
|
2175
|
+
// its issue carrying the Label map's in-progress string (claimedElsewhere()).
|
|
2176
|
+
// The PR's own tickets are the ones its settled tokens name and, when its
|
|
2177
|
+
// head is a claim branch (stranded.mjs's CLAIM_BRANCH), that claim's ticket —
|
|
2178
|
+
// a PR a run inherited carries no token, and its own claim holds its ticket
|
|
2179
|
+
// until it merges. Returns `{refs, failures}`: the issue numbers the PR
|
|
2180
|
+
// closes, its own suggestion-band record aside — that one is a failure here,
|
|
2181
|
+
// not a ticket — and one line per failure. A read the checks need dies,
|
|
2182
|
+
// naming the read, and writes nothing.
|
|
2183
|
+
async function closingRefusals(member, tickets) {
|
|
2185
2184
|
const pr = member.number;
|
|
2186
2185
|
const where = `dispatch ${member.name}`;
|
|
2187
2186
|
const { recordTitle } = await import("./dispositions-check.mjs");
|
|
2188
2187
|
const { CLAIM_BRANCH } = await import("./stranded.mjs");
|
|
2189
2188
|
const { prViewClosing, issueRead, claimedElsewhere } = checkReaders(where);
|
|
2190
2189
|
const { view, numbers: refs } = prViewClosing(pr, "closingIssuesReferences,url,headRefName");
|
|
2190
|
+
const claim = CLAIM_BRANCH.exec(view.headRefName);
|
|
2191
|
+
const ownTickets = [...new Set(claim === null ? tickets : [...tickets, Number(claim[1])])];
|
|
2191
2192
|
const failures = [];
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
if (verdict === "") {
|
|
2195
|
-
failures.push(`PR #${pr}'s row in ${tsv} has no closed_own_ticket verdict, so its closing references cannot be checked — set the verdict in that row, then dispatch the finisher again`);
|
|
2196
|
-
} else if (verdict === "yes") {
|
|
2197
|
-
for (const n of tickets) {
|
|
2198
|
-
if (!refs.includes(n)) failures.push(`PR #${pr} does not close #${n}, ruled closed_own_ticket=yes — add "Closes #${n}" to its body (gh pr edit ${pr} --body-file …)`);
|
|
2199
|
-
}
|
|
2200
|
-
} else {
|
|
2201
|
-
for (const n of tickets) {
|
|
2202
|
-
if (refs.includes(n)) failures.push(`PR #${pr} closes #${n}, ruled closed_own_ticket=no — rephrase it as "Refs #${n}"`);
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2193
|
+
for (const n of ownTickets) {
|
|
2194
|
+
if (!refs.includes(n)) failures.push(`PR #${pr} does not close #${n}, its own ticket — add "Closes #${n}" to its body (gh pr edit ${pr} --body-file …)`);
|
|
2205
2195
|
}
|
|
2206
2196
|
const own = recordTitle(pr);
|
|
2207
2197
|
// The label names of each issue the PR closes, its own record aside.
|
|
@@ -2215,8 +2205,6 @@ async function closingRefusals(member, { tickets, ruling, tsv }) {
|
|
|
2215
2205
|
}
|
|
2216
2206
|
}
|
|
2217
2207
|
const closed = [...labels.keys()];
|
|
2218
|
-
const claim = CLAIM_BRANCH.exec(view.headRefName);
|
|
2219
|
-
const ownTickets = claim === null ? tickets : [...tickets, Number(claim[1])];
|
|
2220
2208
|
for (const n of claimedElsewhere(closed, ownTickets, (m) => labels.get(m))) {
|
|
2221
2209
|
failures.push(`PR #${pr} closes #${n}, which another claim holds — rephrase it as "Refs #${n}"`);
|
|
2222
2210
|
}
|
|
@@ -2461,11 +2449,12 @@ async function runDispatch() {
|
|
|
2461
2449
|
// review file: neither is gated on a verdict. Then an implementer's PR
|
|
2462
2450
|
// waits on its ruling, its tier-outcomes row, written while the PR is open
|
|
2463
2451
|
// and its review evidence still in scratch; see rulingOf(). Last, the
|
|
2464
|
-
// PR
|
|
2465
|
-
// suggestion-band record
|
|
2466
|
-
//
|
|
2467
|
-
//
|
|
2468
|
-
//
|
|
2452
|
+
// PR must close its own tickets, whatever its ruling, and no closing
|
|
2453
|
+
// reference may be its own suggestion-band record or a ticket another
|
|
2454
|
+
// claim holds, and the PR must carry no `ready-to-merge` and exactly one
|
|
2455
|
+
// release label, all read off gh from the ledger's repository; see
|
|
2456
|
+
// closingRefusals() and labelRefusal(). Refused here, before anything is
|
|
2457
|
+
// written, so no check can be skipped by forgetting to run it.
|
|
2469
2458
|
if (member.family === "finisher-pr") {
|
|
2470
2459
|
const fold = tickFold("conflict hold and dispositions verdict");
|
|
2471
2460
|
if (fold.conflictHeld.includes(member.number)) {
|
|
@@ -2477,7 +2466,7 @@ async function runDispatch() {
|
|
|
2477
2466
|
if (disposed !== null) die(`${member.name}: ${disposed} — not dispatching ${member.name}`);
|
|
2478
2467
|
const ruled = await rulingOf(member.number);
|
|
2479
2468
|
if (ruled.refusal !== null) die(`${member.name}: ${ruled.refusal} — not dispatching ${member.name}`);
|
|
2480
|
-
const closing = await closingRefusals(member, ruled);
|
|
2469
|
+
const closing = await closingRefusals(member, ruled.tickets);
|
|
2481
2470
|
const labelFailure = labelRefusal(member, ruled.tickets, closing.refs);
|
|
2482
2471
|
const failures = labelFailure === null ? closing.failures : [...closing.failures, labelFailure];
|
|
2483
2472
|
if (failures.length > 0) die(`${member.name}: ${failures.join("; ")} — not dispatching ${member.name}`);
|
package/skills/run-team/SKILL.md
CHANGED
|
@@ -561,7 +561,7 @@ Dispatch a finisher only when every test here passes at once — the review retu
|
|
|
561
561
|
**This bullet and the one above are a pair, and on a clean PR this one carries the
|
|
562
562
|
whole route to a finisher**: a `no-op` report satisfies the gate above by
|
|
563
563
|
itself, so nothing further is owed and no further event is coming.
|
|
564
|
-
- **The PR
|
|
564
|
+
- **The PR closes its own tickets, and no closing reference is its own suggestion-band record or a ticket another claim holds** → `ledger.mjs dispatch` refuses the finisher otherwise, naming the PR and ticket: `gh pr edit <M>` fixes the body; dispatch again.
|
|
565
565
|
- **The PR carries exactly one release label, or its repo defines none** → `ledger.mjs dispatch` refuses the finisher otherwise, except a Ticketless PR with none, which `finisher-label.mjs` labels `patch`. Fix them; dispatch again. In full: references/finisher.md.
|
|
566
566
|
- **`ci-state.mjs --pr <N>` reads `verdict: "no-ci"`** → the CI edge never
|
|
567
567
|
fires: dispatch the finisher off the reviewer's final verdict the moment it
|
|
@@ -119,7 +119,7 @@ and will act on it. Relay everything — reversals too — then dispatch.
|
|
|
119
119
|
append` command to run. Any row for the PR passes, so a replacement finisher
|
|
120
120
|
is never held once the first passed; a PR no such token names is not gated.
|
|
121
121
|
No flag skips it: a PR `append` refuses is fixed on the ledger, as at close-out.
|
|
122
|
-
- **The PR
|
|
122
|
+
- **The PR closes its own tickets, and no closing reference is its own suggestion-band record or a ticket another claim holds** → `ledger.mjs dispatch` reads the PR's `closingIssuesReferences` from `gh pr view <M>` before it dispatches any finisher, counting only those in the PR's own repository: a reference into another repository closes none of this repository's tickets, whatever its number. Each of the PR's own tickets must be closed by the body (`Closes #<N>`): the tickets a settled `impl-<N>=PR#<M>` token names, and, when the PR's head is a claim branch (`implementer/<N>-impl-<N>[-<x>]`), that claim's ticket — so a PR a run inherited, which carries no token, is held to it too. The ruling does not decide this: it judges the work as first submitted, and a finding the fix-applier defers is filed on an issue of its own, so an implementer PR closes its own ticket whatever its ruling. No reference may be the PR's own suggestion-band record. For every PR, a Ticketless one too, no reference besides its own tickets may be one another claim holds — one whose issue carries the in-progress label, as the Label map spells it; the same `gh issue view` read of each reference answers it. A refusal names the PR and the ticket, and for a ticket another claim holds says to write `Refs #<M>`. The controller repairs the body itself with `gh pr edit <M> --body-file <file>`, then dispatches the finisher again. A `gh` read that fails refuses the dispatch and writes nothing.
|
|
123
123
|
- **The PR carries exactly one release label** → `ledger.mjs dispatch` reads the PR's labels from `gh pr view <M>` before it dispatches any finisher, and refuses unless exactly one of `patch`, `minor` and `major` is among them — the count `finisher-label.mjs` makes before it labels. A repository whose label list defines none of the three is not gated. A Ticketless PR with none is not refused: `finisher-label.mjs` adds `patch` to it before its count. Any other PR with none is refused naming the tickets it closes, and any PR with several naming the labels found — the bump, or which label stays, is not picked for the controller. The controller adds or removes the label itself, then dispatches the finisher again. A `gh` read that fails or answers malformed refuses the dispatch, saying the labels could not be read, and writes nothing.
|
|
124
124
|
- **The PR carries no `ready-to-merge`** → the same `gh pr view <M>` read of the PR's labels answers it, and `ledger.mjs dispatch` refuses any finisher while the label is on, writing nothing and naming `fleet-event.mjs label-off <M>`. A finisher runs on an unlabelled PR: the label a merge bot's `head-moved-after-label` refusal left comes off with its report's settle, and the command takes off any other. A repair finisher's PR lacks the label by definition, so it passes.
|
|
125
125
|
|