@feigi/fleet-ctl 3.148.0 → 3.148.1
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/ticket-router.mjs +23 -12
package/package.json
CHANGED
|
@@ -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;
|