@feigi/fleet-ctl 3.156.1 → 3.156.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 +1 -1
- package/scripts/review-core.mjs +13 -3
- package/scripts/review-eval.mjs +8 -2
package/package.json
CHANGED
package/scripts/review-core.mjs
CHANGED
|
@@ -937,6 +937,17 @@ export function runnerScratchRefusal(scratch) {
|
|
|
937
937
|
return `args.scratch ${JSON.stringify(scratch)} already ends in a pr<N> directory — pass the scratch root; the review creates <root>/pr<N>/ itself`;
|
|
938
938
|
}
|
|
939
939
|
|
|
940
|
+
// The Test entrypoint refusal `runReview` and review-eval.mjs's
|
|
941
|
+
// `runReviewToFile` share, for the reason the two rules above are: the review
|
|
942
|
+
// refuses a `testCmd` that is not a non-empty string — blank or whitespace-only
|
|
943
|
+
// counts as empty — and only the runner's refusal, before its first attempt,
|
|
944
|
+
// keeps that dispatch mistake from being retried. Null when `testCmd` is a
|
|
945
|
+
// command.
|
|
946
|
+
export function runnerTestCmdRefusal(testCmd) {
|
|
947
|
+
if (typeof testCmd === "string" && testCmd.trim() !== "") return null;
|
|
948
|
+
return `args.testCmd is required — the Test entrypoint the shared run executes, got ${JSON.stringify(testCmd)}`;
|
|
949
|
+
}
|
|
950
|
+
|
|
940
951
|
// --- Orchestration ----------------------------------------------------
|
|
941
952
|
// `host` supplies `agent(prompt, opts)` (must resolve to PARSED DATA — a
|
|
942
953
|
// rejection or an unresolvable dispatch must resolve to `null`, the
|
|
@@ -1092,9 +1103,8 @@ async function reviewRun(host, args, run) {
|
|
|
1092
1103
|
// other argument refusals, so a review that could never run its suite costs
|
|
1093
1104
|
// no snapshot.
|
|
1094
1105
|
const testCmd = A.testCmd;
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
}
|
|
1106
|
+
const testCmdRefusal = runnerTestCmdRefusal(testCmd);
|
|
1107
|
+
if (testCmdRefusal) throw new Error(`review-pr: ${testCmdRefusal}`);
|
|
1098
1108
|
|
|
1099
1109
|
// Resolved only now: the default spawns git, so a missing or malformed `pr`
|
|
1100
1110
|
// is refused on its own terms before anything is resolved or spawned.
|
package/scripts/review-eval.mjs
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
// strings are.
|
|
33
33
|
import { mkdir, unlink, writeFile } from "node:fs/promises";
|
|
34
34
|
import { basename, dirname, isAbsolute, join, normalize } from "node:path";
|
|
35
|
-
import { digestOf, runReview, runnerPrRefusal, runnerScratchRefusal } from "./review-core.mjs";
|
|
35
|
+
import { digestOf, runReview, runnerPrRefusal, runnerScratchRefusal, runnerTestCmdRefusal } from "./review-core.mjs";
|
|
36
36
|
|
|
37
37
|
// eval's `agent()` returns a HANDLE, not data: `agent(prompt,
|
|
38
38
|
// opts)` resolves near-instantly to an `AgentHandle` with `.wait()`, and only
|
|
@@ -156,7 +156,8 @@ export async function runReviewOnOmp(args) {
|
|
|
156
156
|
// file, so nothing reads a half-review as a review. A dispatch mistake — a pr
|
|
157
157
|
// that is not a PR number, a scratch that is not absolute (eval's cwd is the
|
|
158
158
|
// MAIN CHECKOUT, so a relative one would put the file there), a scratch that
|
|
159
|
-
// already ends in `pr<N
|
|
159
|
+
// already ends in `pr<N>`, a testCmd that is not a non-blank string, a
|
|
160
|
+
// worktree that is absent or empty
|
|
160
161
|
// — throws before any run: it is not a review failure, and retrying or falling
|
|
161
162
|
// back would only repeat it. So does a write fault other than a file already
|
|
162
163
|
// at the path: the review ran, the environment could not keep it. `run` is the
|
|
@@ -171,6 +172,11 @@ export async function runReviewToFile(args, run = runReviewOnOmp) {
|
|
|
171
172
|
}
|
|
172
173
|
const scratchRefusal = runnerScratchRefusal(scratch);
|
|
173
174
|
if (scratchRefusal) throw new Error(`review-runner: ${scratchRefusal}`);
|
|
175
|
+
const testCmdRefusal = runnerTestCmdRefusal(args.testCmd);
|
|
176
|
+
if (testCmdRefusal) throw new Error(`review-runner: ${testCmdRefusal}`);
|
|
177
|
+
if (!args.worktree) {
|
|
178
|
+
throw new Error(`review-runner: args.worktree is required — the checkout the review snapshots, got ${JSON.stringify(args.worktree)}`);
|
|
179
|
+
}
|
|
174
180
|
const errors = [];
|
|
175
181
|
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
176
182
|
let result;
|