benignswarm 0.12.166 → 0.12.168
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/dist/antigravity.js +10 -6
- package/dist/args.js +5 -3
- package/dist/client.js +10 -7
- package/dist/command-flags.js +1 -1
- package/dist/commands/admin.js +10 -1
- package/dist/commands/gh.js +18 -1
- package/dist/commands/health.js +44 -0
- package/dist/commands/machine-admin.js +9 -0
- package/dist/commands/machine.js +71 -0
- package/dist/commands/mock.js +115 -2
- package/dist/commands/operator.js +1 -1
- package/dist/commands/ux.js +13 -4
- package/dist/commands/watch.js +44 -10
- package/dist/commands/worktrees.js +9 -3
- package/dist/commands/wu.js +101 -16
- package/dist/gate-quarantines.js +76 -0
- package/dist/gate-test-reports.js +50 -0
- package/dist/git.js +47 -1
- package/dist/harnesses.js +22 -2
- package/dist/heartbeat.js +11 -1
- package/dist/help.js +16 -7
- package/dist/index.js +2 -0
- package/dist/jsonl.js +113 -0
- package/dist/macos-readiness.js +128 -0
- package/dist/merge-train.js +50 -61
- package/dist/scoped-gate.js +393 -0
- package/dist/state.js +9 -0
- package/dist/usage.js +88 -56
- package/dist/ux-jobs.js +47 -20
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/ux-jobs.js
CHANGED
|
@@ -17,6 +17,18 @@ import { writeFileAtomic } from "./shared-file.js";
|
|
|
17
17
|
import { runMergeTrainWorkflow } from "./merge-train.js";
|
|
18
18
|
import { retryGitFetch } from "./git-fetch.js";
|
|
19
19
|
import { recordMachineNetworkRequest } from "./machine-network-health.js";
|
|
20
|
+
function jobSubjectLabel(job) {
|
|
21
|
+
return job.work_unit_number !== null && job.work_unit_number !== undefined
|
|
22
|
+
? `WU #${job.work_unit_number}`
|
|
23
|
+
: `branch ${job.target_branch ?? job.branch}`;
|
|
24
|
+
}
|
|
25
|
+
function jobFileTag(job) {
|
|
26
|
+
if (job.work_unit_number !== null && job.work_unit_number !== undefined) {
|
|
27
|
+
return `wu${job.work_unit_number}`;
|
|
28
|
+
}
|
|
29
|
+
const branchTag = (job.target_branch ?? job.branch).replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "target";
|
|
30
|
+
return branchTag;
|
|
31
|
+
}
|
|
20
32
|
const SLUG_RE = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
21
33
|
const SHA_RE = /^[0-9a-f]{7,64}$/i;
|
|
22
34
|
const MAX_UX_JOB_LOG_TAIL = 2000;
|
|
@@ -1127,13 +1139,13 @@ export async function executeUxJob(machineClient, job, ctx, deps = {}, resume, c
|
|
|
1127
1139
|
? `gate ${status === "succeeded" ? "PASSED" : "FAILED"}`
|
|
1128
1140
|
: [job.task, job.compare_screen ? `compare-${job.compare_screen}` : null].filter(Boolean).join(" ");
|
|
1129
1141
|
const claim = jobKind === "gate"
|
|
1130
|
-
? `Complete-suite gate run (${status === "succeeded" ? "PASSED" : "FAILED"}) on ${ctx.machineName} at ${head} for
|
|
1131
|
-
: `Seeded UX run (${jobTaskLabel}) on ${ctx.machineName} at ${head} for
|
|
1142
|
+
? `Complete-suite gate run (${status === "succeeded" ? "PASSED" : "FAILED"}) on ${ctx.machineName} at ${head} for ${jobSubjectLabel(job)}`
|
|
1143
|
+
: `Seeded UX run (${jobTaskLabel}) on ${ctx.machineName} at ${head} for ${jobSubjectLabel(job)}`;
|
|
1132
1144
|
return {
|
|
1133
1145
|
project: job.project,
|
|
1134
1146
|
project_id: job.project_id,
|
|
1135
1147
|
filename: `remote-job-${job.id}.log`,
|
|
1136
|
-
label:
|
|
1148
|
+
label: `${jobSubjectLabel(job)} ${head} ${taskTag} remote-job-${job.id}.log`,
|
|
1137
1149
|
claim,
|
|
1138
1150
|
idempotency_key: uxEvidenceIdempotencyKey(job.id, "diagnostic-log"),
|
|
1139
1151
|
};
|
|
@@ -1182,8 +1194,8 @@ export async function executeUxJob(machineClient, job, ctx, deps = {}, resume, c
|
|
|
1182
1194
|
? `gate ${status === "succeeded" ? "PASSED" : "FAILED"}`
|
|
1183
1195
|
: [job.task, job.compare_screen ? `compare-${job.compare_screen}` : null].filter(Boolean).join(" ");
|
|
1184
1196
|
const claim = jobKind === "gate"
|
|
1185
|
-
? `Complete-suite gate run (${status === "succeeded" ? "PASSED" : "FAILED"}) on ${ctx.machineName} at ${(resolvedHead ?? job.head ?? "unknown").slice(0, 9)} for
|
|
1186
|
-
: `Seeded UX run (${jobTaskLabel}) on ${ctx.machineName} at ${(resolvedHead ?? job.head ?? "unknown").slice(0, 9)} for
|
|
1197
|
+
? `Complete-suite gate run (${status === "succeeded" ? "PASSED" : "FAILED"}) on ${ctx.machineName} at ${(resolvedHead ?? job.head ?? "unknown").slice(0, 9)} for ${jobSubjectLabel(job)}`
|
|
1198
|
+
: `Seeded UX run (${jobTaskLabel}) on ${ctx.machineName} at ${(resolvedHead ?? job.head ?? "unknown").slice(0, 9)} for ${jobSubjectLabel(job)}`;
|
|
1187
1199
|
for (const artifact of artifacts) {
|
|
1188
1200
|
const alreadyUploaded = uploadedArtifacts.get(artifact.path);
|
|
1189
1201
|
if (alreadyUploaded) {
|
|
@@ -1193,7 +1205,7 @@ export async function executeUxJob(machineClient, job, ctx, deps = {}, resume, c
|
|
|
1193
1205
|
fullLogEvidenceId = alreadyUploaded;
|
|
1194
1206
|
continue;
|
|
1195
1207
|
}
|
|
1196
|
-
const label =
|
|
1208
|
+
const label = `${jobSubjectLabel(job)} ${(resolvedHead ?? job.head ?? "unknown").slice(0, 9)} ${taskTag} ${artifact.filename}`;
|
|
1197
1209
|
const artifactIdentity = artifact.path === diagnosticLogPath ? "diagnostic-log" : relative(jobArtifactDir, artifact.path);
|
|
1198
1210
|
const evidenceId = await uploadEvidence(agentCreds, job.project, {
|
|
1199
1211
|
...artifact,
|
|
@@ -1491,7 +1503,7 @@ export async function executeUxJob(machineClient, job, ctx, deps = {}, resume, c
|
|
|
1491
1503
|
scanner.push("", true);
|
|
1492
1504
|
const logDir = join(jobArtifactDir, "gate");
|
|
1493
1505
|
mkdirSync(logDir, { recursive: true });
|
|
1494
|
-
gateLogFile = join(logDir, `gate
|
|
1506
|
+
gateLogFile = join(logDir, `gate-${jobFileTag(job)}-${shortHead}.log`);
|
|
1495
1507
|
writeFileSync(gateLogFile, fullOutput || `${gateRes.stdout}\n${gateRes.stderr}` || `exit ${gateRes.status ?? 1}\n`);
|
|
1496
1508
|
return { exit_code: gateRes.status ?? 1, ...scanner.result() };
|
|
1497
1509
|
}
|
|
@@ -1531,20 +1543,35 @@ export async function executeUxJob(machineClient, job, ctx, deps = {}, resume, c
|
|
|
1531
1543
|
}
|
|
1532
1544
|
}
|
|
1533
1545
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1546
|
+
try {
|
|
1547
|
+
const { res: seedRes } = await runLockedStep("seed", npmBin, ["run", "ux:seed"], { timeoutMs: 300_000 });
|
|
1548
|
+
if (seedRes.status !== 0)
|
|
1549
|
+
return seedRes.status ?? 1;
|
|
1550
|
+
if (job.task) {
|
|
1551
|
+
const { res: taskRes } = await runLockedStep("task", npmBin, ["run", "ux:task", "--", job.task], { timeoutMs: 600_000 });
|
|
1552
|
+
if (taskRes.status !== 0)
|
|
1553
|
+
return taskRes.status ?? 1;
|
|
1554
|
+
}
|
|
1555
|
+
if (job.compare_screen) {
|
|
1556
|
+
const { res: compareRes } = await runLockedStep("compare", npmBin, ["run", "ux:compare", "--", job.compare_screen, "--unit", String(job.work_unit_number), "--widths", "1440,375"], { timeoutMs: 600_000 });
|
|
1557
|
+
if (compareRes.status !== 0)
|
|
1558
|
+
return compareRes.status ?? 1;
|
|
1559
|
+
}
|
|
1560
|
+
return 0;
|
|
1541
1561
|
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
if (
|
|
1545
|
-
|
|
1562
|
+
finally {
|
|
1563
|
+
// Older historical checkouts used D1 and have no PostgreSQL fixture to drop.
|
|
1564
|
+
if (existsSync(join(jobWorktreeDir, "scripts", "ux-postgres.mjs"))) {
|
|
1565
|
+
// Cleanup is job-scoped and must still run after cancellation or lease loss.
|
|
1566
|
+
const res = await diagnosticRunner("node", ["scripts/ux-console.mjs", "cleanup"], {
|
|
1567
|
+
cwd: jobWorktreeDir, env: lockedEnv, timeoutMs: 60_000, signal: new AbortController().signal,
|
|
1568
|
+
onStdoutChunk: chunk => lockContext?.onOutput?.(chunk),
|
|
1569
|
+
onStderrChunk: chunk => lockContext?.onOutput?.(chunk),
|
|
1570
|
+
});
|
|
1571
|
+
if (res.status !== 0)
|
|
1572
|
+
throw stepFailure("UX PostgreSQL fixture cleanup", res);
|
|
1573
|
+
}
|
|
1546
1574
|
}
|
|
1547
|
-
return 0;
|
|
1548
1575
|
}
|
|
1549
1576
|
finally {
|
|
1550
1577
|
if (heartbeatTimer)
|
|
@@ -1616,7 +1643,7 @@ export async function executeUxJob(machineClient, job, ctx, deps = {}, resume, c
|
|
|
1616
1643
|
}, ctx.sessions);
|
|
1617
1644
|
if (completion === "cancelled")
|
|
1618
1645
|
return { id: job.id, status: "cancelled", evidence_ids: [], resolved_head: resolvedHead };
|
|
1619
|
-
ctx.log(`${jobKind} job ${job.id}: completed (${uploadedIds.length} artifact(s) posted for
|
|
1646
|
+
ctx.log(`${jobKind} job ${job.id}: completed (${uploadedIds.length} artifact(s) posted for ${jobSubjectLabel(job)} at ${shortHead})`);
|
|
1620
1647
|
return { id: job.id, status: "succeeded", evidence_ids: uploadedIds, resolved_head: resolvedHead };
|
|
1621
1648
|
}
|
|
1622
1649
|
catch (error) {
|
package/dist/version.js
CHANGED