fix(code-queue): add active-run liveness diagnostics

This commit is contained in:
Codex
2026-05-19 03:48:17 +00:00
parent f36ea37548
commit 2a45bfe180
13 changed files with 561 additions and 17 deletions
@@ -0,0 +1,24 @@
import { CODE_QUEUE_LIVENESS_CHECK_NAMES, runCodeQueueLivenessFixtureChecks } from "./src/code-queue-liveness-fixtures";
function optionValues(args: string[], name: string): string[] {
const values: string[] = [];
for (let index = 0; index < args.length; index += 1) {
if (args[index] !== name) continue;
const raw = args[index + 1];
if (raw === undefined || raw.startsWith("--")) throw new Error(`${name} requires a check name`);
values.push(...raw.split(",").map((item) => item.trim()).filter(Boolean));
index += 1;
}
return values;
}
function main(): void {
const only = optionValues(Bun.argv.slice(2), "--only");
const unknown = only.filter((name) => !CODE_QUEUE_LIVENESS_CHECK_NAMES.includes(name as never));
if (unknown.length > 0) throw new Error(`unknown Code Queue liveness check(s): ${unknown.join(", ")}`);
const result = runCodeQueueLivenessFixtureChecks(only);
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
if (!result.ok) process.exit(1);
}
if (import.meta.main) main();