@feigi/fleet-ctl 3.23.37 → 3.23.39
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/cell-readout.mjs
CHANGED
|
@@ -66,7 +66,7 @@ import { readFileSync } from "node:fs";
|
|
|
66
66
|
import { makeDie, defineFlags } from "./arg.mjs";
|
|
67
67
|
import { isCLI } from "./is-cli.mjs";
|
|
68
68
|
import { CELL, POLICY_CELL } from "./ledger-grammar.mjs";
|
|
69
|
-
import { parseTsv as parseMemberTsv } from "./member-outcomes.mjs";
|
|
69
|
+
import { formatTsv as formatMemberTsv, parseTsv as parseMemberTsv } from "./member-outcomes.mjs";
|
|
70
70
|
import { parseFeatures } from "./pr-cost.mjs";
|
|
71
71
|
import { VERDICT, VERDICT_COLUMNS } from "./tier-outcomes.mjs";
|
|
72
72
|
|
|
@@ -103,16 +103,33 @@ function admissibleMember(pull, members) {
|
|
|
103
103
|
return m;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// One member row per session+agent. A key repeated with different fields is
|
|
107
|
+
// refused rather than collapsed to whichever row came last; an identical
|
|
108
|
+
// repeat is one row.
|
|
109
|
+
function indexMembers(members) {
|
|
110
|
+
const byKey = new Map();
|
|
111
|
+
for (const m of members) {
|
|
112
|
+
const k = key(m.session, m.agent);
|
|
113
|
+
const held = byKey.get(k);
|
|
114
|
+
if (held && formatMemberTsv([held]) !== formatMemberTsv([m])) {
|
|
115
|
+
throw new Error(`member-outcomes session ${m.session} agent ${m.agent} has two rows with different fields`);
|
|
116
|
+
}
|
|
117
|
+
if (!held) byKey.set(k, m);
|
|
118
|
+
}
|
|
119
|
+
return byKey;
|
|
120
|
+
}
|
|
121
|
+
|
|
106
122
|
/**
|
|
107
123
|
* `cells`: one entry per cell other than the policy cell that has a
|
|
108
124
|
* ticket-features row, `{ cell, comparisons, runDates, dates, models, gated }`,
|
|
109
125
|
* sorted by cell. `dates` is the comparisons' distinct run_dates, sorted;
|
|
110
126
|
* `models` maps each resolved model of the cell's admissible rows to its row
|
|
111
127
|
* count, largest first. `unjoined` counts Pulls with no member row. Throws on
|
|
112
|
-
* two ticket-features rows of one session+agent naming different cells
|
|
128
|
+
* two ticket-features rows of one session+agent naming different cells, and on
|
|
129
|
+
* a member-outcomes session+agent repeated with different fields.
|
|
113
130
|
*/
|
|
114
131
|
export function readout({ features, members }) {
|
|
115
|
-
const byKey =
|
|
132
|
+
const byKey = indexMembers(members);
|
|
116
133
|
const pulls = pullsOf(features);
|
|
117
134
|
const sessions = new Map();
|
|
118
135
|
const cells = new Map();
|
|
@@ -152,11 +169,12 @@ export function readout({ features, members }) {
|
|
|
152
169
|
* sorted by ticket, `run_date` the ruling's; `stop` is whether the stopping
|
|
153
170
|
* rule withdraws the cell. `verdicts` are parsed tier-outcomes.tsv rows.
|
|
154
171
|
* Throws on a counted ruling whose `closed_own_ticket` or `minted_false_claim`
|
|
155
|
-
* is not `yes` or `no`,
|
|
156
|
-
* `run_date` is not `YYYY-MM-DD
|
|
172
|
+
* is not `yes` or `no`, on a non-blank ruling row of a Pulled ticket whose
|
|
173
|
+
* `run_date` is not `YYYY-MM-DD`, and on a member-outcomes session+agent
|
|
174
|
+
* repeated with different fields.
|
|
157
175
|
*/
|
|
158
176
|
export function stoppingRule({ features, members, verdicts, added }) {
|
|
159
|
-
const byKey =
|
|
177
|
+
const byKey = indexMembers(members);
|
|
160
178
|
const rulings = new Map();
|
|
161
179
|
for (const v of verdicts) {
|
|
162
180
|
if (VERDICT_COLUMNS.every((c) => v[c] === "")) continue;
|
|
@@ -217,12 +235,21 @@ function main() {
|
|
|
217
235
|
try { return parse(text); }
|
|
218
236
|
catch (e) { die(`${path}: ${e.message}`); }
|
|
219
237
|
};
|
|
220
|
-
|
|
221
|
-
|
|
238
|
+
// A repeated session+agent naming different cells, or a member-outcomes one
|
|
239
|
+
// repeated with different fields, is refused while its file is loaded, so the
|
|
240
|
+
// refusal names the path that was read.
|
|
241
|
+
const features = load(featuresPath, (text) => {
|
|
242
|
+
const rows = parseFeatures(text);
|
|
243
|
+
pullsOf(rows);
|
|
244
|
+
return rows;
|
|
245
|
+
});
|
|
246
|
+
const members = load(membersPath, (text) => {
|
|
247
|
+
const rows = parseMemberTsv(text);
|
|
248
|
+
indexMembers(rows);
|
|
249
|
+
return rows;
|
|
250
|
+
});
|
|
222
251
|
|
|
223
|
-
|
|
224
|
-
try { ({ cells, unjoined } = readout({ features, members })); }
|
|
225
|
-
catch (e) { die(`${featuresPath}: ${e.message}`); }
|
|
252
|
+
const { cells, unjoined } = readout({ features, members });
|
|
226
253
|
const lines = [];
|
|
227
254
|
const notes = [];
|
|
228
255
|
if (unjoined > 0) {
|
package/skills/run-team/SKILL.md
CHANGED
|
@@ -804,30 +804,30 @@ install that rewrites the tree in a throwaway worktree corrupts it for everyone.
|
|
|
804
804
|
No cache is phase 0's Recipe derivation step not having run; an invalid one is
|
|
805
805
|
its re-derive-once rule.
|
|
806
806
|
|
|
807
|
-
**Materialize the isolation envelope as a file, not a briefing.** The
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
impossible)
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
807
|
+
**Materialize the isolation envelope as a file, not a briefing.** The claim
|
|
808
|
+
writes the runner, `agent-test`, into the fresh worktree it creates: an exec of
|
|
809
|
+
the Recipe's Test entrypoint that exports one port triple derived from `<N>`
|
|
810
|
+
(so collisions stay impossible), kept out of `git status` through the
|
|
811
|
+
repository's exclude file. A repository that tracks its own `agent-test` keeps
|
|
812
|
+
it byte-identical, with whatever isolation that repository built. Brief members
|
|
813
|
+
with `./agent-test` and nothing else — anyone who finds the worktree finds the
|
|
814
|
+
runner, including grandchildren you never dispatched. Its arguments land after
|
|
815
|
+
the Test entrypoint, so what one may name — a test file, a test name — is that
|
|
816
|
+
entrypoint's to say, and nothing in the runner refuses one that selects no
|
|
817
|
+
test: a run of zero tests is a failed run, not a pass. See
|
|
816
818
|
references/isolation.md.
|
|
817
819
|
|
|
818
|
-
**A reused worktree may lack the runner
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
when it brings up no shared stack to collide on, else that repo's own stack-free
|
|
830
|
-
command.
|
|
820
|
+
**A reused worktree may lack the runner.** `claim-ticket.sh` writes
|
|
821
|
+
`agent-test` only into the fresh worktree it claims, so a tree no claim
|
|
822
|
+
built — an already-open PR's worktree you sent a rebaser/resolver into,
|
|
823
|
+
a `git archive` snapshot, a `cp -R` subset — has no `./agent-test`
|
|
824
|
+
unless the repository tracks its own, and a member told to run one
|
|
825
|
+
stalls on a missing script (observed with a rebase-resolver in a
|
|
826
|
+
prior-run worktree). There, tell the member the runner is absent and to
|
|
827
|
+
run docker-free suites directly — the Recipe's Test entrypoint
|
|
828
|
+
(`~/.fleet/bin/fleet-run derive-testcmd.sh <main checkout> test` prints
|
|
829
|
+
it) only when it brings up no shared stack to collide on, else that
|
|
830
|
+
repo's own stack-free command.
|
|
831
831
|
|
|
832
832
|
**A reused worktree may also be on the wrong COMMIT.** `git worktree add <path>
|
|
833
833
|
<branch>` checks out the existing LOCAL branch and never consults the remote, so
|
|
@@ -2667,9 +2667,9 @@ a minute apart showed *different* mutants, so a member's report and any single
|
|
|
2667
2667
|
because the dirt may be someone's only copy. Here nothing in it is anyone's.
|
|
2668
2668
|
Nothing sweeps a leak for you either: `reap.sh`'s branchless sweep is bounded
|
|
2669
2669
|
to the fleet's worktree home, so a tree under `<scratch>` is a `kept` entry
|
|
2670
|
-
it reports and never collects.
|
|
2671
|
-
|
|
2672
|
-
|
|
2670
|
+
it reports and never collects. No claim built the tree you added, so it has
|
|
2671
|
+
`./agent-test` only if the repository tracks one — run that or `<testCmd>`
|
|
2672
|
+
in it, per **A reused worktree may lack the runner** above.
|
|
2673
2673
|
|
|
2674
2674
|
**None of this licenses a write to the owned worktree.** Duty 1 is a read;
|
|
2675
2675
|
you never restore that tree, because you never wrote to it. A controller
|
|
@@ -3465,10 +3465,10 @@ failures arrive as *wrong findings*, not errors:
|
|
|
3465
3465
|
truncates, and the truncation reads as an absence): an invocation carrying an
|
|
3466
3466
|
**absolute** path puts a member-unique string in argv, while one carrying
|
|
3467
3467
|
repo-relative filenames is byte-identical across members. Which of the two you
|
|
3468
|
-
get is not yours to choose — members are briefed on `./agent-test
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3468
|
+
get is not yours to choose — members are briefed on `./agent-test` with the
|
|
3469
|
+
arguments the Test entrypoint takes, and the runner hands them on exactly as
|
|
3470
|
+
its caller's shell expanded them. Clearing your own leftover process needs its
|
|
3471
|
+
PID, not a pattern.
|
|
3472
3472
|
|
|
3473
3473
|
Members report a stalled run to the controller instead of pattern-killing it,
|
|
3474
3474
|
and the controller re-checks any measurement taken in the window.
|
|
@@ -3497,19 +3497,19 @@ failures arrive as *wrong findings*, not errors:
|
|
|
3497
3497
|
It owns the object-store rule, the two-tree split, snapshot provisioning, and
|
|
3498
3498
|
which suites a snapshot cannot validly run. Your only duty is to *not*
|
|
3499
3499
|
contradict it.
|
|
3500
|
-
- **Filesystem isolation is not stack isolation.** A private copy of the
|
|
3501
|
-
a test command solve different problems; the compose project
|
|
3502
|
-
the environment, not the working directory, so three
|
|
3503
|
-
still collide on one postgres. "I'm on my own
|
|
3504
|
-
that skips the command — say both, every
|
|
3505
|
-
audience: a member in a worktree
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3500
|
+
- **Filesystem isolation is not stack isolation.** A private copy of the
|
|
3501
|
+
tree and a test command solve different problems; the compose project
|
|
3502
|
+
name comes from the environment, not the working directory, so three
|
|
3503
|
+
agents on three snapshots still collide on one postgres. "I'm on my own
|
|
3504
|
+
copy" is exactly the intuition that skips the command — say both, every
|
|
3505
|
+
time. Which command depends on the audience: a member in a worktree
|
|
3506
|
+
uses `./agent-test`; a specialist on a snapshot does not, and takes the
|
|
3507
|
+
one `review-and-fix.md` hands out. Which runner the worktree holds
|
|
3508
|
+
decides why: the runner a claim writes is untracked, so a `git archive`
|
|
3509
|
+
snapshot never carries it; one the repository tracks does ride along,
|
|
3510
|
+
but no claim exported ports into it — its isolation is whatever that
|
|
3511
|
+
repository built, not one triple per snapshot. See
|
|
3512
|
+
references/isolation.md.
|
|
3513
3513
|
- **Scratchpad paths need two levels — the member's own partition, then one
|
|
3514
3514
|
directory per child it dispatches — and nothing outside them.** An
|
|
3515
3515
|
implementer partitions at `<scratch>/impl-<N>/`; the review side's partition
|
|
@@ -4,13 +4,13 @@ Why isolation envelope file not briefing, why private filesystem not private sta
|
|
|
4
4
|
|
|
5
5
|
## Materialize the isolation envelope as a file, not a briefing
|
|
6
6
|
|
|
7
|
-
Env vars in prompt missed five times in one run — including briefed member, and specialist whose parent briefed but did not pass down. So the runner is a file
|
|
7
|
+
Env vars in prompt missed five times in one run — including briefed member, and specialist whose parent briefed but did not pass down. So the runner is a file in the worktree. A claim writes `agent-test` into the fresh worktree it creates: an exec of the Recipe's Test entrypoint that exports one port triple derived from `<N>`, kept out of `git status` through the repository's exclude file. A repository that tracks its own `agent-test` keeps it byte-identical — the claim exports nothing into it, so its isolation is whatever that repository built, and any convenience beyond exec'ing the Test entrypoint is that runner's own to document. Brief members with `./agent-test` and nothing else: anyone who finds worktree finds runner — including grandchildren you never dispatched. Its arguments land after the Test entrypoint, so what one may name — a test file, a test name — is that entrypoint's to say, and nothing in the runner refuses one that selects no test: a run of zero tests is a failed run, not a pass. That triple makes collisions impossible, not discouraged — difference between safeguard and rule.
|
|
8
8
|
|
|
9
|
-
The runner
|
|
9
|
+
The runner a claim writes is written once and never rewritten — a claim refuses a worktree that already exists — so every copy under `.worktrees/` is frozen at whenever that worktree was claimed; reading or measuring one measures that build, not what the current emitter produces. Line 2 is what tells a reader which build they are holding: `# agent-test template: <cksum>`. Reproduce the number from the installed script (`cksum $(~/.fleet/bin/fleet-run --path claim-ticket.sh)`) or from any revision of it (`git show <rev>:plugin/scripts/claim-ticket.sh | cksum`) and compare the first field — `cksum` also prints a byte count, and the path when it is given a file. It checksums the whole emitting script, not the runner template inside it, so it over-reports: a mismatch means only that `claim-ticket.sh`'s bytes differ from the ones you checksummed — a reworded die message or an edited comment moves it while the runner it produces stays byte-identical — not "the template changed", and not "older" either, because `cksum` carries no order: over `claim-ticket.sh`'s own history both the checksum and the byte count fall as well as rise. It under-reports too, so a match is not the freshness proof it looks like. The stamp covers `claim-ticket.sh` and nothing else, while the command the runner `exec`s is the Recipe cache's Test entrypoint, which it does not cover: two claims under one stamp exec different commands once the Recipe is re-derived between them. So read a match as "this runner came from these bytes of `claim-ticket.sh`"; only a fresh claim writes the current runner. Nothing reads the stamp and nothing refuses on a mismatch; it makes staleness legible to a human, it gates nothing.
|
|
10
10
|
|
|
11
11
|
## Filesystem isolation is not stack isolation
|
|
12
12
|
|
|
13
|
-
Private copy and test command solve different problems; conflating them is how second gets skipped: compose project name comes from environment, not working directory, so three agents on three snapshots still collide on one postgres. Symlinking installed dependencies in does not help. "I'm on my own copy" is exactly the intuition that skips command — say both, every time. Which command depends on audience: member in worktree uses `./agent-test`; specialist on snapshot does not
|
|
13
|
+
Private copy and test command solve different problems; conflating them is how second gets skipped: compose project name comes from environment, not working directory, so three agents on three snapshots still collide on one postgres. Symlinking installed dependencies in does not help. "I'm on my own copy" is exactly the intuition that skips command — say both, every time. Which command depends on audience: member in worktree uses `./agent-test`; specialist on snapshot does not, takes one `review-and-fix.md` hands out. Which runner the worktree holds decides why: the runner a claim writes is untracked, so a `git archive` snapshot never carries it; one the repository tracks does ride along, but no claim exported ports into it — its isolation is whatever that repository built, not one triple per snapshot.
|
|
14
14
|
|
|
15
15
|
## Scratchpad paths need two levels — the member's own partition, then one directory per child it dispatches
|
|
16
16
|
|
|
@@ -60,7 +60,7 @@ So nothing in the run cleans it up. Next run, the in-flight probe's local-worktr
|
|
|
60
60
|
|
|
61
61
|
**The delete is `git update-ref -d`'s compare-and-swap (ADR 0018) here too, and for reap's reason** — authorized by the `ahead` and `git cherry` checks above, plus the `ahead` recount re-run against `origin/main` immediately before the delete itself (a commit can land across the `gh issue view` between the checks and the delete; `git cherry` is not re-run, because such a commit is ahead of `origin/main` by construction), plus a fresh check, re-read immediately before the delete, that no worktree holds the branch (`update-ref` consults no worktree, where `-D` refused a held branch; a worktree it cannot resolve, or a listing that will not re-read, stops the delete too), and by nothing else. A claim used to carry `origin/main` as its upstream, so `-d` compared against *that* and forgave a behind local main; since #760 `claim-ticket.sh` passes `--no-track` (so `@{u}` cannot silently answer about main), a claim has no upstream until its first `push -u`, and `-d` falls back to comparing against local `HEAD`. Measured: with local `main` behind `origin/main`, `-d` refuses a pristine claim — half-releasing it, worktree deleted and branch stranded with `in-progress` still on the ticket. The two checks above are strictly stronger than what `-d` would have asked, and both measure against `origin/main` rather than a local ref.
|
|
62
62
|
|
|
63
|
-
**`worktree remove` without `--force`** refuses on modified and untracked files and deletes ignored files silently (verified, git 2.50.1). Ignored-silently is what is wanted:
|
|
63
|
+
**`worktree remove` without `--force`** refuses on modified and untracked files and deletes ignored files silently (verified, git 2.50.1). Ignored-silently is what is wanted: `claim-ticket.sh` writes an `agent-test` into each fresh worktree it claims of a repository that tracks none, and ignores it through the repository's exclude file, so treating ignored files as dirt would strand every such release. The same asymmetry is why a claim never writes over a tracked `agent-test`: that write would leave a modified tracked path, which this refusal does not forgive. Its refusal is the dirty check recomputed by git at the moment of the delete — for the live-directory case ONLY. `worktree remove` gates that clean check on the same `stat` the guard does, so it is not an independent second opinion: where the path cannot be stat'ed git reaches the same "gone" by the same means, accepts the entry at rc 0 and deregisters a worktree whose files are still on disk (measured, git 2.50.1: an untracked file in a worktree under a `chmod 000` parent). There the `gone` guard is sole arbiter — which is why it establishes absence instead of inferring it from a failed `-e`, and why the fail-open fixed in `1e54bac` survived being reasoned about: guard and backstop fail on the same inputs.
|
|
64
64
|
|
|
65
65
|
**A worktree that wandered off the branch blocks too.** The worktree is located by the branch it has checked out, and it does not stay there — an interrupted rebase leaves it detached, a member can switch it. The lookup then finds nothing, which reads as "no worktree of ours": the dirty check is skipped entirely and the release reports success while the worktree stands with the member's work in it, so the next run's probe still reads the ticket as taken. So a linked worktree at `claim-ticket.sh`'s `.worktrees/<issue>-<slug>` that is *not* on the branch is its own blocker — which remedy it names is the next paragraph, and is not always a hand-release. The path is read as the whole rest of the `worktree list --porcelain` line, never the first whitespace field, or every checkout under a directory with a space in its name reads as a different path.
|
|
66
66
|
|