@feigi/fleet-ctl 3.148.0 → 3.148.2
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/claim-ticket.sh +10 -3
- package/scripts/stranded.mjs +5 -4
- package/scripts/ticket-router.mjs +23 -12
package/package.json
CHANGED
package/scripts/claim-ticket.sh
CHANGED
|
@@ -8,9 +8,16 @@
|
|
|
8
8
|
# `.worktrees/<issue>-<slug>`. The fleet always calls it as
|
|
9
9
|
# `claim-ticket.sh <N> impl-<N> implementer` (run-team references/pull.md, **Claiming**),
|
|
10
10
|
# giving `implementer/<N>-impl-<N>` and `.worktrees/<N>-impl-<N>`, and releases
|
|
11
|
-
# with the same pair through release-ticket.sh.
|
|
12
|
-
#
|
|
13
|
-
#
|
|
11
|
+
# with the same pair through release-ticket.sh.
|
|
12
|
+
# The number appears twice because the slug is the member name of the ticket's
|
|
13
|
+
# first implementer. The claim belongs to the ticket, not to that member: a
|
|
14
|
+
# replacement (`impl-<N>-b`, …) works in it and never claims again, so every
|
|
15
|
+
# fleet release and the settle's head check rebuild the name from the number
|
|
16
|
+
# alone. The repeat carries nothing; the name stays because claims on disk
|
|
17
|
+
# carry it, and stranded.mjs and evict.mjs find claims by it.
|
|
18
|
+
# <slug> and <type> are free text — neither derived nor validated here — so a
|
|
19
|
+
# caller outside the fleet can pass its own shape, e.g. next-ticket's
|
|
20
|
+
# human-facing `fix/<N>-<slug>`.
|
|
14
21
|
#
|
|
15
22
|
# The Install step and the Test entrypoint are READ from the repository's
|
|
16
23
|
# proven Recipe cache through derive-testcmd.sh — never inferred, never
|
package/scripts/stranded.mjs
CHANGED
|
@@ -200,10 +200,11 @@ const real = (p) => {
|
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
// A claim's names, off claim-ticket.sh's shapes for an implementer:
|
|
203
|
-
// `.worktrees/<N>-impl-<N
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
//
|
|
203
|
+
// `.worktrees/<N>-impl-<N>` and `implementer/<N>-impl-<N>`. Both also accept a
|
|
204
|
+
// `-x` retry letter that no fleet path writes — a replacement works in the
|
|
205
|
+
// first implementer's claim and never claims again — so a claim made by hand
|
|
206
|
+
// under such a name is still reported. Each captures the number and the slug
|
|
207
|
+
// release-ticket.sh takes. evict.mjs judges its candidates by the same two.
|
|
207
208
|
export const CLAIM_WORKTREE = /^([1-9][0-9]*)-(impl-\1(?:-[a-z])?)$/;
|
|
208
209
|
export const CLAIM_BRANCH = /^implementer\/([1-9][0-9]*)-(impl-\1(?:-[a-z])?)$/;
|
|
209
210
|
const WAYS_OUT = "push the branch and open a PR, or release the claim by hand";
|
|
@@ -69,7 +69,7 @@ import { fileURLToPath } from "node:url";
|
|
|
69
69
|
import { isDeepStrictEqual } from "node:util";
|
|
70
70
|
import { isCLI } from "./is-cli.mjs";
|
|
71
71
|
import { gitEnv } from "./git-env.mjs";
|
|
72
|
-
import { makeDie, defineFlags } from "./arg.mjs";
|
|
72
|
+
import { makeDie, defineFlags, isDigits } from "./arg.mjs";
|
|
73
73
|
import { CELL, OBJECTIVES, POLICY_CELL, STARTING_CELLS, drawCell, formatRouting, isRulePath, parseMember } from "./ledger-grammar.mjs";
|
|
74
74
|
import { objectiveFromReceipt, sessionFromReceipt } from "./phase0-receipt.mjs";
|
|
75
75
|
import { parseTsv as parseMemberTsv } from "./member-outcomes.mjs";
|
|
@@ -246,9 +246,11 @@ export function namedLines(named, root) {
|
|
|
246
246
|
// ticket of the cut's kind goes to `kind=<cut>` and any other to
|
|
247
247
|
// `kind!=<cut>`. A ticket that lacks the input a split reads — its issue was not
|
|
248
248
|
// read, or its column is blank — goes no further than that node, and the
|
|
249
|
-
// node's own row routes it.
|
|
250
|
-
//
|
|
251
|
-
//
|
|
249
|
+
// node's own row routes it. A number input's column that is neither blank nor a
|
|
250
|
+
// plain count (digits alone) is bad input: the walk refuses it. Every node,
|
|
251
|
+
// inner nodes and root included, holds a `cost` row and a `speed` row of its
|
|
252
|
+
// own, and its estimates and reasons. A table with no split is the one-node
|
|
253
|
+
// tree: `*` routes every ticket.
|
|
252
254
|
|
|
253
255
|
const SEP = "&";
|
|
254
256
|
// Each input a split may read, and what it reads as: the columns of a ticket-features row that are known at
|
|
@@ -260,15 +262,24 @@ const INPUTS = Object.freeze({
|
|
|
260
262
|
parent: "number", kind: "kind",
|
|
261
263
|
});
|
|
262
264
|
|
|
263
|
-
/**
|
|
265
|
+
/**
|
|
266
|
+
* What a ticket holds for `input` — a number, or a kind — or null where it lacks it: its issue was not read, or its
|
|
267
|
+
* column is blank. Throws `AttributionError` on a number input's column that is neither blank nor a plain count: digits
|
|
268
|
+
* alone, as `issueMetrics` writes one, with no sign, exponent, radix prefix, fraction or space, and few enough to read
|
|
269
|
+
* as a finite number.
|
|
270
|
+
*/
|
|
264
271
|
function inputOf(input, m) {
|
|
265
272
|
// A row whose issue was not read has blank metrics, `brief_chars` among them: it holds none of the inputs.
|
|
266
273
|
if (m.brief_chars === undefined || m.brief_chars === "") return null;
|
|
267
274
|
const s = m[input] ?? "";
|
|
268
275
|
if (input === "kind") return s === "" ? null : s;
|
|
269
|
-
if (
|
|
270
|
-
const n = s
|
|
271
|
-
|
|
276
|
+
if (s === "") return input === "parent" ? 0 : null;
|
|
277
|
+
const n = isDigits(s) ? Number(s) : NaN;
|
|
278
|
+
if (!Number.isFinite(n)) {
|
|
279
|
+
const row = m.ticket === undefined ? "a ticket-features row" : `ticket #${m.ticket}: a ticket-features row`;
|
|
280
|
+
throw new AttributionError(`${row}'s ${input} is '${s}', which a split reads, expected a plain count or blank`);
|
|
281
|
+
}
|
|
282
|
+
return n;
|
|
272
283
|
}
|
|
273
284
|
|
|
274
285
|
const child = (node, test) => (node === "*" ? test : `${node}${SEP}${test}`);
|
|
@@ -1144,10 +1155,10 @@ function main() {
|
|
|
1144
1155
|
}
|
|
1145
1156
|
return sha;
|
|
1146
1157
|
};
|
|
1147
|
-
// The join throws on a features row it cannot date
|
|
1148
|
-
//
|
|
1149
|
-
// as a live B classifier's, since every windowed Pull is
|
|
1150
|
-
// bug, never bad input, so it surfaces with its stack.
|
|
1158
|
+
// The join throws on a features row it cannot date or whose column a split reads holds no plain count, a booked
|
|
1159
|
+
// member row whose `cost` or `work_s` is not a number, and a ruling of a windowed Pull's ticket it cannot place —
|
|
1160
|
+
// for `fit` and `--check` too on a Pull the fit then skips as a live B classifier's, since every windowed Pull is
|
|
1161
|
+
// booked before that skip. Anything else it throws is a bug, never bad input, so it surfaces with its stack.
|
|
1151
1162
|
const joined = (fit) => {
|
|
1152
1163
|
try { return fit(); } catch (e) {
|
|
1153
1164
|
if (!(e instanceof RulingError || e instanceof AttributionError)) throw e;
|