@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.148.0",
3
+ "version": "3.148.2",
4
4
  "description": "Agent fleet: run-team controller, merge bot, PR reviewer, and the ticket pipeline they share",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -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. <slug> and <type> are
12
- # free text — neither derived nor validated here — so a caller outside the fleet
13
- # can pass its own shape, e.g. next-ticket's human-facing `fix/<N>-<slug>`.
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
@@ -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>[-x]` and `implementer/<N>-impl-<N>[-x]`, `-x` a
204
- // replacement's single retry letter. Each captures the number and the member
205
- // name `impl-<N>[-x]`, the slug release-ticket.sh takes. evict.mjs judges its
206
- // candidates by the same two.
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. Every node, inner nodes and root included, holds a
250
- // `cost` row and a `speed` row of its own, and its estimates and reasons. A
251
- // table with no split is the one-node tree: `*` routes every ticket.
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
- /** What a ticket holds for `input` — a number, or a kind — or null where it lacks it: its issue was not read, or its column is blank. */
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 (input === "parent" && s === "") return 0;
270
- const n = s === "" ? NaN : Number(s);
271
- return Number.isFinite(n) ? n : null;
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, a booked member row whose `cost` or `work_s` is not a number, and a
1148
- // ruling of a windowed Pull's ticket it cannot place — for `fit` and `--check` too on a Pull the fit then skips
1149
- // as a live B classifier's, since every windowed Pull is booked before that skip. Anything else it throws is a
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;