@feigi/fleet-ctl 3.20.0 → 3.21.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/ambient-git-vars-mjs-prose.test.mjs +12 -0
- package/scripts/fleet-tick.mjs +65 -3
- package/scripts/fleet-tick.test.mjs +99 -0
- package/scripts/member-outcomes.mjs +21 -12
- package/scripts/member-outcomes.test.mjs +68 -11
- package/scripts/member-record.mjs +43 -13
- package/scripts/member-record.test.mjs +24 -0
- package/scripts/pr-cost.mjs +493 -0
- package/scripts/pr-cost.test.mjs +521 -0
- package/scripts/review-core-booking.test.mjs +35 -0
- package/scripts/review-core-cwd-isolation.test.mjs +5 -5
- package/scripts/review-core-shared-test-run.test.mjs +1 -1
- package/scripts/review-core-testcmd.test.mjs +1 -1
- package/scripts/review-core.mjs +8 -4
- package/scripts/review-host-fixture.mjs +12 -3
- package/scripts/review-in-run-retry.test.mjs +4 -4
- package/scripts/select-dimensions.test.mjs +2 -2
|
@@ -57,17 +57,26 @@ export const vote = (refuted) => ({ refuted, reason: "measured. CWD-AUDIT: clean
|
|
|
57
57
|
// 2 of their label, and a re-dispatched pair is calls 3 and 4. A script with
|
|
58
58
|
// no `test-run` entry gets `[SHARED]` for it; every other unscripted label
|
|
59
59
|
// throws. `prompts` records each dispatch's prompt under its label.
|
|
60
|
+
//
|
|
61
|
+
// Every label review-core.mjs dispatches ends in `:pr<N>`; scripts, `calls`
|
|
62
|
+
// and `prompts` key on the label WITHOUT it (`review:correctness`), so a case
|
|
63
|
+
// reads the same whatever PR it reviews. `labels` keeps each label as
|
|
64
|
+
// dispatched, in order.
|
|
60
65
|
export function scriptedHost(script) {
|
|
61
66
|
const calls = {};
|
|
62
67
|
const prompts = {};
|
|
68
|
+
const labels = [];
|
|
63
69
|
return {
|
|
64
70
|
calls,
|
|
65
71
|
prompts,
|
|
72
|
+
labels,
|
|
66
73
|
host: {
|
|
67
74
|
agent: async (prompt, opts) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
75
|
+
labels.push(opts.label);
|
|
76
|
+
const label = opts.label.replace(/:pr\d+$/, "");
|
|
77
|
+
const n = (calls[label] = (calls[label] ?? 0) + 1);
|
|
78
|
+
(prompts[label] ??= []).push(prompt);
|
|
79
|
+
const seq = script[label] ?? (label === "test-run" ? [SHARED] : undefined);
|
|
71
80
|
if (!seq) throw new Error(`scriptedHost: unexpected dispatch ${opts.label}`);
|
|
72
81
|
const answer = seq[Math.min(n, seq.length) - 1];
|
|
73
82
|
if (answer instanceof Error) throw answer;
|
|
@@ -128,10 +128,10 @@ for (const [name, run] of COPIES) {
|
|
|
128
128
|
const calls = { crashing: 0, surviving: 0 };
|
|
129
129
|
const host = {
|
|
130
130
|
agent: async (prompt, opts) => {
|
|
131
|
-
if (opts.label === "snapshot") return structuredClone(SNAP);
|
|
132
|
-
if (opts.label === "test-run") return structuredClone(SHARED);
|
|
133
|
-
if (opts.label === "review:correctness") return structuredClone(review([crashing, surviving]));
|
|
134
|
-
if (opts.label === "verify:correctness") {
|
|
131
|
+
if (opts.label === "snapshot:pr7") return structuredClone(SNAP);
|
|
132
|
+
if (opts.label === "test-run:pr7") return structuredClone(SHARED);
|
|
133
|
+
if (opts.label === "review:correctness:pr7") return structuredClone(review([crashing, surviving]));
|
|
134
|
+
if (opts.label === "verify:correctness:pr7") {
|
|
135
135
|
if (prompt.includes(crashing.claim)) {
|
|
136
136
|
calls.crashing++;
|
|
137
137
|
throw new Error(`refuter crash ${calls.crashing}`);
|
|
@@ -567,8 +567,8 @@ test("an unresolvable override is refused before the snapshot agent is dispatche
|
|
|
567
567
|
// dispatch. Comment lines are stripped so a commented-out option cannot satisfy
|
|
568
568
|
// it, and the slice is the review dispatch's options object alone.
|
|
569
569
|
function reviewDispatchOptions() {
|
|
570
|
-
const m = SOURCE.match(/\{ label: `review:\$\{d\.key\}`[^\n]*\},/);
|
|
571
|
-
assert.ok(m, "review-core.mjs no longer passes an options object labelled review:${d.key} — update this test");
|
|
570
|
+
const m = SOURCE.match(/\{ label: `review:\$\{d\.key\}\$\{forPr\}`[^\n]*\},/);
|
|
571
|
+
assert.ok(m, "review-core.mjs no longer passes an options object labelled review:${d.key}${forPr} — update this test");
|
|
572
572
|
return m[0]
|
|
573
573
|
.split("\n")
|
|
574
574
|
.filter((l) => !/^\s*\/\//.test(l))
|