@feigi/fleet-ctl 3.24.8 → 3.24.9

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.
@@ -1,10 +1,9 @@
1
1
  // Scraper for per-member model/effort facts. Pure over omp's own subagent
2
- // transcripts: no clock, no network, no gh. See
3
- // docs/specs/2026-08-27-fleet-member-outcomes-instrumentation-design.md.
2
+ // transcripts: no clock, no network, no gh.
4
3
  //
5
4
  // The transcript parsing (fold, model/effort extraction, ticket/pr naming,
6
- // and the `gh pr create` result an implementer's `pr` comes from, #2209)
7
- // lives in member-record.mjs (#1342), shared with board.mjs. `normalizeModel`
5
+ // and the `gh pr create` result an implementer's `pr` comes from)
6
+ // lives in member-record.mjs, shared with board.mjs. `normalizeModel`
8
7
  // and `parseMemberName` are re-exported here verbatim so nothing importing
9
8
  // them from this file needs to change.
10
9
 
@@ -23,9 +22,9 @@ export { normalizeModel, parseMemberName };
23
22
  // primitive board.mjs's spend reader calls too, so the two can no longer
24
23
  // drift.
25
24
  //
26
- // `effort` reads the record's `thinking` field: #1342 keeps the TSV COLUMN
27
- // named `effort` rather than renaming it, because every awk one-liner in
28
- // this file's header and in docs/specs indexes columns by position, and a
25
+ // `effort` reads the record's `thinking` field: the TSV COLUMN stays
26
+ // named `effort` rather than renamed, because every awk one-liner in
27
+ // this file's header indexes columns by position, and a
29
28
  // rename buys nothing a comment does not already say. `thinking` is never
30
29
  // blank on the record (`-` marks the hole so it stays visible there), but
31
30
  // this TSV's own `effort` column predates that convention and already
@@ -180,7 +179,7 @@ if (isCLI(import.meta.url)) {
180
179
  // instruction all use) always exits 2.
181
180
  const dirs = argv.filter((a, i) => !a.startsWith("--") && (fileIdx < 0 || i !== fileIdx + 1));
182
181
  if (dirs.length !== 1) die("usage: member-outcomes.mjs <session-dir> [--file <tsv>]");
183
- // arg.mjs's rule, consumed rather than copied (#567). This line used to
182
+ // arg.mjs's rule, consumed rather than copied. This line used to
184
183
  // hand-write `!file || file.startsWith("--")`, which was that rule with the
185
184
  // blank spelling missing — so `--file " "` was accepted here and wrote the
186
185
  // metrics TSV to a whitespace-named path, while every script routing through
@@ -197,7 +196,7 @@ if (isCLI(import.meta.url)) {
197
196
  // directory) both walked straight past it back into the silent exit 0.
198
197
  try { readdirSync(sessionDir); }
199
198
  catch (e) { die(`cannot read ${sessionDir}: ${e.code ?? e.message}`); }
200
- // #1302's ruling already covers `readMembers`'s tree search (findOmpSessionDirs);
199
+ // The session-dir-name rule already covers `readMembers`'s tree search (findOmpSessionDirs);
201
200
  // this CLI hands rowsForSession one EXPLICIT directory instead of a tree to
202
201
  // search, which skipped that check entirely — any readable directory (e.g. the
203
202
  // encoded-cwd project dir one level up from a real session) passed the readdirSync
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // The merge bot's pre-merge gate as one read-only conjunction (#1800; spec
3
- // docs/specs/2026-09-24-slot-based-fleet-loop-design.md § 5, ADR 0012
4
- // Decision 3).
2
+ // The merge bot's pre-merge gate as one read-only conjunction.
5
3
  //
6
4
  // merge-gate.mjs --pr <n> --pre <sha> [--post <sha>] [--out <path>]
7
5
  //
@@ -19,7 +17,7 @@
19
17
  // its directory. Omitted, the line goes to stdout only: the path the merge bot
20
18
  // uses, `<scratch>/pr<N>/merge-bot-<n>/ci.json`, names a scratch root and a
21
19
  // member number only the bot knows, so the bot passes it and this script never
22
- // guesses it (controller ruling on #1800).
20
+ // guesses it.
23
21
  //
24
22
  // Stdout: exactly one JSON line, `{pr, verdict, reason, head, pre, post,
25
23
  // behind, instruments, ci}`. Stderr: the children's own diagnostics, passed
@@ -19,7 +19,7 @@ import { makeDie, defineFlags } from "./arg.mjs";
19
19
  const NAME = "pr-overlap";
20
20
 
21
21
  // die()/numArg() shared with the other fleet scripts — see arg.mjs for the
22
- // fail-open (#61/#169/#878) and pipe-safety (#176/#328) rationale. `--a`/`--b`
22
+ // fail-open and pipe-safety rationale. `--a`/`--b`
23
23
  // given trailing already died via the usage guard below — `undefined` is
24
24
  // falsy — so this file was never a silent-widening site on its own. But `--a`
25
25
  // given `--b` as its "value" (`pr-overlap.mjs --a --b 5`) was NOT caught that
@@ -28,7 +28,7 @@ const NAME = "pr-overlap";
28
28
  // here, by name, instead.
29
29
  //
30
30
  // numArg() rather than arg() because the falsy check missed the other half
31
- // too, and this file is why #878 could not be swept by grepping for
31
+ // too, and this file is why the numArg() fix could not be swept by grepping for
32
32
  // `arg("pr")`: the same fail-open arrives here under `--a`/`--b`. Measured on
33
33
  // the pre-fix tree, `--a abc --b def` printed `{"a":null,"b":null,…}` at exit
34
34
  // 0 carrying a real `signal: "files"` verdict — `gh pr diff` resolves a
@@ -45,15 +45,16 @@ const { numArg, sweep, stray } = defineFlags(die, { flags: { a: "value", b: "val
45
45
  const a = numArg("a");
46
46
  const b = numArg("b");
47
47
  if (a === null || b === null) die("usage: pr-overlap.mjs --a <pr> --b <pr>");
48
- // #365, and here it is the WEAKER half of the fix: both flags are required,
49
- // so a misspelling of either (`--aa 5 --b 6`) already fell through to the
50
- // usage die above — refused, just never named. What was NOT refused is a
51
- // stray alongside two good values (`--a 5 --b 6 --quiet`), silently ignored
52
- // at exit 0. The sweep closes that and upgrades the first case's message from
53
- // a usage dump to the offending token. Below the usage guard so the usage
54
- // text still wins where it is the better answer; above the first gh call.
48
+ // The misspelled-flag sweep, and here it is the WEAKER half of the fix: both
49
+ // flags are required, so a misspelling of either (`--aa 5 --b 6`) already
50
+ // fell through to the usage die above — refused, just never named. What was
51
+ // NOT refused is a stray alongside two good values (`--a 5 --b 6 --quiet`),
52
+ // silently ignored at exit 0. The sweep closes that and upgrades the first
53
+ // case's message from a usage dump to the offending token. Below the usage
54
+ // guard so the usage text still wins where it is the better answer; above
55
+ // the first gh call.
55
56
  sweep();
56
- // #463: sweep() above only refuses a `--`-prefixed token; a bare or
57
+ // sweep() above only refuses a `--`-prefixed token; a bare or
57
58
  // single-dash one (`--a 5 --b 6 stray`) rode along in silence the same way.
58
59
  // This file takes no positional, so any leftover token is a stray.
59
60
  stray();
@@ -70,7 +71,7 @@ function changedFiles(pr) {
70
71
  // (no `stdio` above), so interpolating it emits every byte twice, and this
71
72
  // is the biggest payload of the fleet scripts. `e.message` is the same
72
73
  // string, not a fallback: Node builds it as `Command failed:\n<stderr>`.
73
- // Three disjoint shapes — Node-aborted (ENOENT/ENOBUFS), signal, exit (#176).
74
+ // Three disjoint shapes — Node-aborted (ENOENT/ENOBUFS), signal, exit.
74
75
  die(
75
76
  `gh pr diff ${pr} failed: ${
76
77
  e.code ?? (e.signal ? `killed by ${e.signal}` : `exit ${e.status}`)
@@ -115,30 +116,31 @@ const modulesOf = (fs) => fs.map(moduleOf).filter((m) => m !== null);
115
116
  // with nothing whatsoever in common.
116
117
  const dirsOf = (fs) => fs.map(dirname).filter((d) => d !== ".");
117
118
 
118
- // #705: the three signals above compare paths, modules and directories. They
119
+ // The three signals above compare paths, modules and directories. They
119
120
  // are structurally blind to a coupling that lives in PROSE — one file naming
120
121
  // another. The measured case is `docs/metrics/tier-outcomes.tsv`: it is
121
122
  // append-only, so every fleet run produces a PR touching it, and the
122
123
  // paragraph that reads it lives in `run-team/SKILL.md`. A PR appending rows
123
124
  // and a PR rewriting that paragraph edit the same logical section from two
124
125
  // different files — run-merge-bot.md's own soft signal — and this script
125
- // answered `signal=none` on exactly that pair (#703 vs #704). The clearest
126
+ // answered `signal=none` on exactly that pair of PRs. The clearest
126
127
  // output the tool has was the one that missed it, which is the dangerous
127
128
  // direction: `none` licenses a merge.
128
129
  //
129
130
  // Derived from the two diffs rather than declared in a `data file → its prose
130
131
  // consumers` table, because the table was already stale before it could be
131
- // written. #705 recorded ONE consumer of `tier-outcomes` (measured at
132
- // `e540e16`); at `ffa9026` there are eleven — `member-record.mjs`, four
133
- // `*-prose.test.mjs` guards, three specs and run-team's own SKILL.md. A map
134
- // seeded from that ticket would have shipped wrong on day one, which is
135
- // exactly the rot the ticket predicted of it.
132
+ // written. The ticket asking for this signal recorded ONE consumer of
133
+ // `tier-outcomes` (measured at `e540e16`); at `ffa9026` there are eleven,
134
+ // among them `member-record.mjs`, four prose-pin test guards, three specs
135
+ // and run-team's own SKILL.md. A map seeded from that ticket would have
136
+ // shipped wrong on day one, which is exactly the rot the ticket predicted
137
+ // of it.
136
138
 
137
139
  // Which files can be CITED, and which can carry a citation. Two explicit
138
140
  // extension lists, deliberately narrow and deliberately not a file table:
139
- // #705's own objection to deriving this signal is "a broad net and likely
140
- // false positives", so the net is bounded and its bounds are printed with the
141
- // verdict. An extension on neither list does not participate at all.
141
+ // that ticket's own objection to deriving this signal is "a broad net and
142
+ // likely false positives", so the net is bounded and its bounds are printed
143
+ // with the verdict. An extension on neither list does not participate at all.
142
144
  //
143
145
  // Data side — an artifact whose meaning lives in prose somewhere else. A
144
146
  // `.ts` module's consumers are already found by `files`/`modules` above. `.md`
@@ -182,7 +184,7 @@ function trackedBasenameCounts() {
182
184
  // -z: a basename count must not be wrong about a path git would otherwise
183
185
  // quote. maxBuffer explicitly, for the reason diffOf() states below.
184
186
  //
185
- // GIT_DIR/GIT_WORK_TREE scrubbed (#1599, gitEnv()): measured, an ambient
187
+ // GIT_DIR/GIT_WORK_TREE scrubbed (gitEnv()): measured, an ambient
186
188
  // GIT_DIR answers for a DIFFERENT repository regardless of `cwd`,
187
189
  // silently, at exit 0 — the count this guard's verdict is based on then
188
190
  // comes from whichever repository the ambient variable names, and a
@@ -203,7 +205,7 @@ function trackedBasenameCounts() {
203
205
  } catch (e) {
204
206
  // Same three disjoint shapes changedFiles() and diffOf() name: a git
205
207
  // failure with no captured reason is indistinguishable from a clean scan
206
- // in unrunReasons, which is #705's own failure mode one level in.
208
+ // in unrunReasons, which is the missed-pair failure mode above one level in.
207
209
  basenameCounts = null;
208
210
  trackedPaths = null;
209
211
  basenameCountsUnrun = `git ls-files failed: ${
@@ -238,9 +240,9 @@ function tokensFor(dataFile) {
238
240
  // file names the data file SOMEWHERE — run-team/SKILL.md always does, in nine
239
241
  // places, so a whole-file read fires on every PR that touches it at all,
240
242
  // permanently. The question is whether THIS PR is editing the part that names
241
- // it. #703 touched SKILL.md and scored zero against those tokens in its own
242
- // diff, which is how merge-bot-9 cleared the pair by hand; grepping the diff
243
- // is that measurement, kept and automated.
243
+ // it. One PR of the measured pair touched SKILL.md and scored zero against
244
+ // those tokens in its own diff, which is how merge-bot-9 cleared the pair by
245
+ // hand; grepping the diff is that measurement, kept and automated.
244
246
  //
245
247
  // Context lines count along with added and removed ones, deliberately: prose
246
248
  // being rewritten NEXT TO a citation is the hazard, and merge-bot-9's own
@@ -343,8 +345,7 @@ const modules = intersect(modulesOf(filesA), modulesOf(filesB));
343
345
  const dirs = intersect(dirsOf(filesA), dirsOf(filesB));
344
346
 
345
347
  // Both directions. Which PR holds the data and which holds the prose is not
346
- // knowable in advance — #704 appended the rows and #703 held the paragraph,
347
- // and the flags carry no such role.
348
+ // knowable in advance, and the flags carry no such role.
348
349
  const ab = proseHits({ pr: a, files: filesA }, { pr: b, files: filesB });
349
350
  const ba = proseHits({ pr: b, files: filesB }, { pr: a, files: filesA });
350
351
  const prose = [...ab.hits, ...ba.hits].sort((x, y) =>
@@ -353,7 +354,7 @@ const prose = [...ab.hits, ...ba.hits].sort((x, y) =>
353
354
  // Non-null means `prose` is not a complete answer — the scan was reached and
354
355
  // could not cover what an empty array would otherwise claim. Without this
355
356
  // field a failed diff read prints `prose: []`, byte-identical to a clean
356
- // scan: #705's own failure mode — the clearest output being the one that
357
+ // scan: the missed-pair failure mode — the clearest output being the one that
357
358
  // misses it — reintroduced one level in. Same reason run-team/SKILL.md reads
358
359
  // `dimensionsUnrun` beside `dimensionsRun`: an absence of findings is not
359
360
  // coverage.
@@ -397,7 +398,7 @@ if (signal === "modules") {
397
398
  // Keyed on the count, not on `signal`, unlike the two notes above: a prose
398
399
  // hit under a `dirs` verdict is stronger evidence than the verdict, and the
399
400
  // ladder would hide it. The caveat carries the witness because one read
400
- // disproves it — which is how merge-bot-9 settled #703 vs #704 by hand.
401
+ // disproves it — which is how merge-bot-9 settled the measured pair by hand.
401
402
  if (prose.length) {
402
403
  console.error(
403
404
  `${NAME}: prose citation — the other PR's diff names a data file this one\n` +
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
- // The Shortlist (ADR 0013 §1, §3; docs/specs/2026-09-24-slot-based-fleet-loop-design.md
3
- // § 1): the ordered list of tickets the controller may admit, built from cheap
2
+ // The Shortlist: the ordered list of tickets the controller may admit, built from cheap
4
3
  // filters only. No ticket body is read here — a Pull reads one ticket in full
5
- // at the moment it admits it (ADR 0013 §2); this file decides which tickets are
4
+ // at the moment it admits it; this file decides which tickets are
6
5
  // worth that read, and in what order.
7
6
  //
8
7
  // The filters, in the order they run:
@@ -26,7 +25,7 @@
26
25
  // non-zero exit is an in-flight check that could not answer, which is
27
26
  // never "free". Both drop the ticket.
28
27
  //
29
- // ADR 0013 lists step 3 last. Steps 2-4 only intersect, so their order changes
28
+ // Steps 2-4 only intersect, so their order changes
30
29
  // what they cost and nothing else: the ledger is a local read and a premise
31
30
  // one `gh` call, while inflight.sh is three network round-trips (measured at
32
31
  // 2.6 s a ticket against this repository, 23 live candidates), so it runs on
@@ -43,8 +42,7 @@
43
42
  // could not be resolved, a file that could not be written. An empty shortlist
44
43
  // written in any of those cases would read as "no work". Exit 0 is the file
45
44
  // written, an empty shortlist included — the empty queue is an answer. Never
46
- // exit 1: this script has no verdict to report (docs/specs/2026-07-23-fleet-plugin-design.md
47
- // § Script surface), and 1 is also Node's own code for a crash.
45
+ // exit 1: this script has no verdict to report, and 1 is also Node's own code for a crash.
48
46
  //
49
47
  // The file is `<workspace>/.fleet/shortlist.json`, the workspace resolved from
50
48
  // `git rev-parse --git-common-dir` through git-env.mjs, exactly as ledger.mjs's
@@ -58,7 +56,7 @@
58
56
  //
59
57
  // The ledger is read through `ledger.mjs read`, never parsed here, so the
60
58
  // ledger keeps one parser. candidates.mjs's stderr passes straight through —
61
- // the per-candidate lines phase 0 always read, #1032's dependency-heading
59
+ // the per-candidate lines phase 0 always read, the dependency-heading
62
60
  // notice among them. inflight.sh's and gh's are captured and summarised, one
63
61
  // line per dropped ticket.
64
62
 
@@ -345,7 +343,7 @@ async function main() {
345
343
  }
346
344
  log(`${NAME}: ${payload.shortlist.length} of ${payload.scanned} scanned → ${file}`);
347
345
  // Printed and left to drain, never followed by process.exit(): stdout on a
348
- // pipe is async, and an exit would cut the payload mid-JSON (#246).
346
+ // pipe is async, and an exit would cut the payload mid-JSON.
349
347
  console.log(JSON.stringify({ file, ...payload }));
350
348
  }
351
349
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- // Is a shortlisted ticket's defect still there? (#238)
2
+ // Is a shortlisted ticket's defect still there?
3
3
  //
4
4
  // A backlog ticket is a claim about a tree that has since moved. Nothing
5
5
  // reconciles the two, so a ticket fixed as a side effect of an unrelated
6
- // commit stays open and `ready-for-agent` — the worked case is #199, closed
6
+ // commit stays open and `ready-for-agent` — the worked case was fixed
7
7
  // by `b243b4e` while that commit was solving something else, and nobody
8
8
  // noticed. Phase 0 then counts it as supply and an implementer can claim it,
9
9
  // take the label, build a worktree and burn a slot before finding there is
@@ -35,10 +35,10 @@
35
35
  // The one code that must never be reached by accident is 1 — see the catch at
36
36
  // the foot of this file.
37
37
  //
38
- // What it deliberately does NOT do: run a reproduction. #230's check needed a
38
+ // What it deliberately does NOT do: run a reproduction. One such check needed a
39
39
  // purpose-built fixture plus a positive and a negative control, and a
40
40
  // reproduction run without both misattributes causes rather than merely
41
- // missing defects. That is the general backlog oracle #238 rules out; this
41
+ // missing defects. That is the general backlog oracle this probe is not; this
42
42
  // probe informs supply, and a human or a triage pass closes.
43
43
 
44
44
  import { execFileSync } from "node:child_process";
@@ -53,16 +53,16 @@ const { arg, sweep, stray } = defineFlags(die, {
53
53
  flags: { path: "value", gone: "value", present: "value" },
54
54
  });
55
55
 
56
- // #818: a needle QUOTED OUT OF A TICKET can legitimately start with `--`
57
- // (#240's is `--label ready-for-agent`), and arg()'s value guard refuses
58
- // that spelling outright (#61/#169 — see arg.mjs's isFlagLike for why the
56
+ // A needle QUOTED OUT OF A TICKET can legitimately start with `--`
57
+ // (`--label ready-for-agent`, for one), and arg()'s value guard refuses
58
+ // that spelling outright (see arg.mjs's isFlagLike for why the
59
59
  // refusal itself stays). An end-of-options separator opts `--gone`/
60
60
  // `--present` into the literal reading: `--gone -- '--value'` is the POSIX
61
61
  // convention, explicit at the call site, no second input channel.
62
62
  //
63
63
  // Given bare, with no `--` immediately after the flag, a flag defers to arg()
64
64
  // unchanged — a `--`-prefixed value still dies "needs a value" exactly as
65
- // before #818; that refusal is what keeps a flag from swallowing the next
65
+ // before the separator existed; that refusal is what keeps a flag from swallowing the next
66
66
  // flag as its own value, and it is not weakened here. The three tokens
67
67
  // (flag, separator, value) are spliced out of process.argv once read, so
68
68
  // sweep()/stray() below never see the swallowed `--` or a needle shaped like
@@ -71,7 +71,7 @@ const { arg, sweep, stray } = defineFlags(die, {
71
71
  // ONE left-to-right pass over argv, both names in it together and every
72
72
  // separator triple consumed before arg() reads anything. Position decides
73
73
  // which flag owns a token, never the order the reads are written in —
74
- // because the values #818 exists to carry are FLAG-SHAPED, so a
74
+ // because the values the separator exists to carry are FLAG-SHAPED, so a
75
75
  // separator-quoted needle can spell this script's own flag names, and a
76
76
  // scan for one name over the whole argv matches the sibling's already-quoted
77
77
  // data. Measured against a `needleArg("gone")`-then-`needleArg("present")`
@@ -132,7 +132,7 @@ if (!path) die("--path <path> is required");
132
132
  // (separatedNeedles() above) is the opt-in past that, one flag at a time.
133
133
  sweep();
134
134
 
135
- // #463: the sweep above only ever refuses a `--`-prefixed token, so a bare
135
+ // The sweep above only ever refuses a `--`-prefixed token, so a bare
136
136
  // or single-dash stray rode through in silence here too — measured, `--path
137
137
  // README.md --present needle JUNKTOKEN` returned a payload byte-identical to
138
138
  // the same invocation without it. This script takes no positional of its
@@ -161,7 +161,7 @@ const needle = gone ?? present;
161
161
  // rather than a fix for a live case — but the growing one is a metrics TSV
162
162
  // that only ever gets appended to.
163
163
  //
164
- // GIT_DIR/GIT_WORK_TREE scrubbed (#1599, gitEnv()): the ONE spawn primitive
164
+ // GIT_DIR/GIT_WORK_TREE scrubbed (gitEnv()): the ONE spawn primitive
165
165
  // every git call in this file routes through, so scrubbing it here protects
166
166
  // all four call sites at once. Measured: an ambient GIT_WORK_TREE alone makes
167
167
  // the `rev-parse --show-toplevel` call below answer with the AMBIENT path
@@ -195,10 +195,10 @@ function verdict(v, extra) {
195
195
  // a race against the child's own exit — such a pin reports on timing rather
196
196
  // than on whether the downgrade works, and a flaky pin on a safety path is
197
197
  // worse than none. The measurement above is what stands behind it. Closing
198
- // it properly needs a seam that makes fd 1 fail on demand, which is the same
199
- // testability seam #822 turns on.
198
+ // it properly needs a seam that makes fd 1 fail on demand, which this file
199
+ // does not have.
200
200
  //
201
- // The short-write/EAGAIN loop itself is arg.mjs's writeAll() (#1549). A
201
+ // The short-write/EAGAIN loop itself is arg.mjs's writeAll(). A
202
202
  // single writeSync can short-write — return the count it managed and throw
203
203
  // nothing at all — and this function used to hand-roll the resume, one of
204
204
  // three copies of the same loop held in step by a comment saying so.
@@ -264,9 +264,9 @@ function probe() {
264
264
  // reading that failure as "the file is gone, the fix landed" closes a live
265
265
  // ticket. And a GENERATED artifact is untracked by construction:
266
266
  // `.agent-test.sh` was claim-ticket.sh's heredoc output, materialized beside
267
- // the tracked `agent-test` bootstrap on every run of it until ADR 0015, so
267
+ // the tracked `agent-test` bootstrap on every run of it, so
268
268
  // what is on disk is whatever the last run produced. Measured 2026-08-22 on
269
- // `agent-test` itself, which was the generated one before #55 tracked it:
269
+ // `agent-test` itself, which was the generated one before it was tracked:
270
270
  // `git ls-tree origin/main -- <path>` prints nothing at exit 0 and `git show
271
271
  // origin/main:<path>` exits 128, while the file sits right there in the
272
272
  // checkout. A probe that resolved it by name would
@@ -333,7 +333,7 @@ function probe() {
333
333
  // The other two are `live`, and `live` is the safe direction: the ticket
334
334
  // stays offered. It still carries its bound in `why` — a fix that landed as
335
335
  // an EQUIVALENT REWORDING satisfies the ticket while failing a literal
336
- // string test, measured on #206, whose defect `0dc39ef` had already fixed in
336
+ // string test, measured on a ticket whose defect `0dc39ef` had already fixed in
337
337
  // wording that appears nowhere in the ticket. So `live` means "this literal
338
338
  // string still says the defect is here", never "no fix landed".
339
339
  if (mode === "present" && !found) {
@@ -367,7 +367,7 @@ function probe() {
367
367
  // reachable from `origin/main` BY CONSTRUCTION and needs no
368
368
  // `merge-base --is-ancestor` after the fact. That check belongs to the other
369
369
  // shape — a sha quoted in a ticket, which can be a pre-rebase orphan that
370
- // `git show` resolves happily. Measured on #199, against a path this repo
370
+ // `git show` resolves happily. Measured on the header's worked case, against a path this repo
371
371
  // no longer tracks: `git log -S 'decodeArgs' origin/main -- <path>` named
372
372
  // `b243b4e`, and `git merge-base --is-ancestor b243b4e origin/main` is true,
373
373
  // as it is for every commit this walk can reach.
@@ -375,7 +375,7 @@ function probe() {
375
375
  // Newest-first with `-n 1`, never `--reverse`: the oldest count-changing
376
376
  // commit is the file's last rename whenever the string predates one, and a
377
377
  // refactor clears an ancestry gate exactly as well as the real fix.
378
- // (Measured on #206's old wording, `--reverse` names a move commit and
378
+ // (Measured on that reworded ticket's old wording, `--reverse` names a move commit and
379
379
  // newest-first names the commit that actually did it.)
380
380
  let record;
381
381
  try {
@@ -403,9 +403,9 @@ function probe() {
403
403
 
404
404
  // The one code this file must never reach by accident is 1. Node exits 1 on an
405
405
  // uncaught throw, and 1 here means "provably fixed" — so a bug in the probe
406
- // would silently retire a live ticket, the exact harm #238's evidence
406
+ // would silently retire a live ticket, the exact harm this probe's evidence
407
407
  // criterion exists to prevent. `arg.mjs` records the same inversion from the
408
- // other side (#299/#328). Nothing above is allowed to escape: every failure is
408
+ // other side. Nothing above is allowed to escape: every failure is
409
409
  // an `unknown`, this one included.
410
410
  try {
411
411
  probe();
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // The dispatch-time tier check (#1345, ruled on #1298; ADR 0014). Layer 2 of
3
- // two: layer 1 (#1314) is a static audit of the agent files' SHAPE, before
2
+ // The dispatch-time tier check. Layer 2 of
3
+ // two: layer 1 (frontmatter-check.mjs) is a static audit of the agent files' SHAPE, before
4
4
  // any run exists; this layer compares what a run actually DISPATCHED against
5
5
  // what omp's own record says it RESOLVED, for every member dispatched by
6
6
  // named definition. Not a lint — a refusal, run after every Pull's dispatch,
@@ -8,17 +8,17 @@
8
8
  // holds the next Pull until there is one (run-team/SKILL.md's phase 2).
9
9
  //
10
10
  // Declared is the definition's own frontmatter — `model: "@<role>:<level>"`,
11
- // a fleet tier route (ADR 0014), never a vendor id. Resolved is read back
11
+ // a fleet tier route, never a vendor id. Resolved is read back
12
12
  // from omp's own record, three ways, in preference order:
13
- // 1. the job record's OWN `resolvedModel`/`resolvedThinkingLevel` (#1302)
13
+ // 1. the job record's OWN `resolvedModel`/`resolvedThinkingLevel`
14
14
  // — a controller that already holds BOTH never opens the child's file
15
- // at all (this ticket's 4th fixture). Holding only one is the ordinary
15
+ // at all. Holding only one is the ordinary
16
16
  // case, not a corner (the two live on different omp records), so the
17
17
  // missing half is read off the transcript instead of reported as a lie.
18
18
  // 2. `--session <dir>` — the controller's own session root, when it has no
19
19
  // job record (or only half of one) but knows where its dispatched
20
20
  // member's own transcript lives: the flat `<session>/<member>.jsonl`
21
- // file, read directly (#1345's extension to member-record.mjs's
21
+ // file, read directly (this layer's extension to member-record.mjs's
22
22
  // readers — a member with no assistant turn yet still resolves off its
23
23
  // dispatch-time `session_init` record, never treated as absent).
24
24
  // 3. `--transcript <file>` — the member's own transcript, when the caller
@@ -46,10 +46,10 @@
46
46
  // obtains each field.
47
47
  //
48
48
  // An implementer (`impl-<N>`, ledger-grammar.mjs's name) is judged on the
49
- // ledger's terms, not the caller's (#1398): the definition it should have
49
+ // ledger's terms, not the caller's: the definition it should have
50
50
  // run under is derived from its ticket row's `tier=` token
51
51
  // (ledger-grammar.mjs's `expectedDefinition` — the same function
52
- // `ledger.mjs dispatch` prints the definition from, #2208), the agent type
52
+ // `ledger.mjs dispatch` prints the definition from), the agent type
53
53
  // it was actually dispatched as is
54
54
  // read off its own transcript and must BE that definition — a generic `task`
55
55
  // dispatch fails even when its model happens to match — and the verdict
@@ -90,7 +90,7 @@ const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
90
90
  const LEDGER_SCRIPT = join(SCRIPT_DIR, "ledger.mjs");
91
91
 
92
92
  // ---------------------------------------------------------------------------
93
- // pure core — unit-tested directly (tier-check.test.mjs), no filesystem or
93
+ // pure core — unit-tested directly, no filesystem or
94
94
  // process access below this line until main()
95
95
  // ---------------------------------------------------------------------------
96
96
 
@@ -130,7 +130,7 @@ export function resolveActual({ transcriptText, resolvedModel, resolvedThinkingL
130
130
  }
131
131
 
132
132
  // The comparison itself, called only from evaluateMember below. The declared
133
- // alias is a fleet tier name (ADR 0011/0014): `ok` requires the role it
133
+ // alias is a fleet tier name: `ok` requires the role it
134
134
  // names to resolve to a model (`expected.model !== null`), that resolved
135
135
  // model to match what the dispatched member actually ran under, and an
136
136
  // exact level match — an unrecognised or unrouted declared model
@@ -339,7 +339,7 @@ function writeLedgerRow(ledgerFile, ticket, text) {
339
339
  // text as ONE ` · `-joined note, so appendedLedgerText's trailing-segment
340
340
  // idempotency covers a re-run of the whole verdict, and the member is
341
341
  // settled `tier-mismatch` here rather than left to the controller — the
342
- // hand step #1398 measured never taken.
342
+ // hand step that was measured never being taken.
343
343
  function recordImplementer(ledgerFile, r) {
344
344
  const data = readLedger(ledgerFile);
345
345
  const existing = rowText(data, r.ticket);
@@ -391,7 +391,7 @@ function main() {
391
391
  const ledgerFile = arg("ledger");
392
392
  const repoRoot = arg("repo") ?? join(SCRIPT_DIR, "..");
393
393
 
394
- // #1669: this file bound only makeDie/makeArg, so a stray or misspelled
394
+ // This file once bound only makeDie/makeArg, so a stray or misspelled
395
395
  // flag (`--ledgerr`) was silently ignored and the run computed a real
396
396
  // verdict against the DEFAULT ledger — the fail-open harm arg.mjs exists
397
397
  // to prevent. Below the arg() reads and the --batch usage guard above,
@@ -402,8 +402,8 @@ function main() {
402
402
  // along with a well-formed --batch is refused by name instead of being
403
403
  // silently absorbed into a batch-content error.
404
404
  sweep();
405
- // #463: sweep() only refuses a `--`-prefixed token; a bare or single-dash
406
- // one (`-ledger`, the single-dash cousin of the ticket's own `--ledgerr`)
405
+ // sweep() only refuses a `--`-prefixed token; a bare or single-dash
406
+ // one (`-ledger`, the single-dash cousin of `--ledgerr`)
407
407
  // rode along in silence the same way. This file takes no positional, so
408
408
  // any leftover token is a stray.
409
409
  stray();
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
- // omp tier routing (ADR 0011, ADR 0014). `model: "@<role>:<level>"` in an
2
+ // omp tier routing. `model: "@<role>:<level>"` in an
3
3
  // agent definition is a fleet tier route — never a vendor id — resolved
4
4
  // through the operator's `modelRoles.slow|task|smol`, with the explicit
5
5
  // `:<level>` suffix on the REFERRING alias winning over the role's own
6
6
  // baked one (`modelRoles.<role>` values carry their own baked suffix,
7
7
  // measured `smol: anthropic/claude-haiku-4-5:auto` on a real install).
8
8
  //
9
- // This file is CHECK-ONLY (ADR 0014): there is no generator and no
9
+ // This file is CHECK-ONLY: there is no generator and no
10
10
  // operator-side override record to derive any more — `model:` in the
11
11
  // definition IS the route, and omp resolves the `@<role>` alias through
12
12
  // `modelRoles` natively (`omp://task-agent-discovery.md`). What is left to
@@ -16,9 +16,9 @@
16
16
  // (b) every role a definition uses has a `modelRoles.<role>` that
17
17
  // resolves to a model;
18
18
  // (c) no `task.agentModelOverrides` entry shadows a fleet definition —
19
- // that config is model-precedence #1 for task/eval dispatch (ADR
20
- // 0011), so a leftover `fleet-*` key there would silently win over
21
- // the definition's own `model:`, which ADR 0014 retires as a lever;
19
+ // that config is model-precedence #1 for task/eval dispatch,
20
+ // so a leftover `fleet-*` key there would silently win over
21
+ // the definition's own `model:`, and that config is retired as a lever;
22
22
  // (d) every definition's `:<level>` is one its role's current target
23
23
  // runs at — in that model's `thinking` efforts in omp's own model
24
24
  // catalog (`omp models --json`). omp clamps an unsupported level
@@ -47,7 +47,7 @@ const NAME = "tier-roles";
47
47
  const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
48
48
 
49
49
  // ---------------------------------------------------------------------------
50
- // pure core — unit-tested directly (tier-roles.test.mjs), no filesystem or
50
+ // pure core — unit-tested directly, no filesystem or
51
51
  // process access below this line until main()
52
52
  // ---------------------------------------------------------------------------
53
53
 
@@ -127,7 +127,7 @@ export function modelsEqual(a, b) {
127
127
 
128
128
  // `omp config get <key> --json` reads the MERGED effective value (built-in
129
129
  // defaults, global config, project settings, `--config` overlays, runtime
130
- // overrides — measured for the retired pool-preflight.mjs, #1588) —
130
+ // overrides — measured for the retired pool-preflight.mjs) —
131
131
  // `modelRoles.slow` dotted into a record is `Unknown setting` on this box,
132
132
  // so a record-valued key is always read whole. Never writes.
133
133
  export function readOmpConfigValue(key) {
@@ -180,10 +180,10 @@ export function catalogEntry(model, catalog) {
180
180
  }
181
181
 
182
182
  // Every fleet definition's `name:` carries this prefix — enforced in CI by
183
- // frontmatter-allowlist.json's agents `name` pattern (`^fleet-[^:]*$`,
184
- // #1303). It is the only way to tell a fleet-owned `task.agentModelOverrides`
185
- // entry (a pre-cutover install can still carry one — ADR 0014 retires the
186
- // config as a lever, it does not clear it) from the operator's own entry,
183
+ // frontmatter-allowlist.json's agents `name` pattern (`^fleet-[^:]*$`).
184
+ // It is the only way to tell a fleet-owned `task.agentModelOverrides`
185
+ // entry (a pre-cutover install can still carry one — the config is retired
186
+ // as a lever, not cleared) from the operator's own entry,
187
187
  // which this check never touches.
188
188
  const FLEET_NAME_PREFIX = "fleet-";
189
189
 
@@ -202,7 +202,7 @@ function kindOf(v) {
202
202
 
203
203
  // The operator's install (`modelRoles`, omp's model `catalog`, and any
204
204
  // leftover `task.agentModelOverrides`) against what the fleet's own
205
- // definitions need. `violations` stop a run (ADR 0014); `notices` never do —
205
+ // definitions need. `violations` stop a run; `notices` never do —
206
206
  // they flag a hazard (two roles' cells measuring one model) that is legal
207
207
  // configuration, just probably not what the operator meant.
208
208
  export function checkRoutes({ agentsDir, agentsSource = `--agents ${agentsDir}`, modelRoles, overrides, catalog }) {