Compare commits

..

3 Commits

Author SHA1 Message Date
Vincent Koc
0515b3ca4b perf(codex): index rollout transcript ids 2026-06-23 23:26:33 +08:00
Vincent Koc
07bdb46d27 perf(codex): index rollout transcript ids 2026-06-23 23:12:11 +08:00
Vincent Koc
e314154269 perf(codex): index rollout transcript ids 2026-06-23 22:31:34 +08:00
7 changed files with 28 additions and 111 deletions

View File

@@ -44,11 +44,6 @@ on:
required: false
default: false
type: boolean
run_maturity_scorecard:
description: Render advisory maturity scorecard release docs; default release checks rely on dedicated package, QA, live, and E2E gates
required: false
default: false
type: boolean
rerun_group:
description: Release check group to run
required: false
@@ -111,7 +106,6 @@ jobs:
mode: ${{ steps.inputs.outputs.mode }}
release_profile: ${{ steps.inputs.outputs.release_profile }}
run_release_soak: ${{ steps.inputs.outputs.run_release_soak }}
run_maturity_scorecard: ${{ steps.inputs.outputs.run_maturity_scorecard }}
rerun_group: ${{ steps.inputs.outputs.rerun_group }}
live_suite_filter: ${{ steps.inputs.outputs.live_suite_filter }}
cross_os_suite_filter: ${{ steps.inputs.outputs.cross_os_suite_filter }}
@@ -285,7 +279,6 @@ jobs:
RELEASE_MODE_INPUT: ${{ inputs.mode }}
RELEASE_PROFILE_INPUT: ${{ inputs.release_profile }}
RELEASE_RUN_RELEASE_SOAK_INPUT: ${{ inputs.run_release_soak }}
RELEASE_RUN_MATURITY_SCORECARD_INPUT: ${{ inputs.run_maturity_scorecard }}
RELEASE_RERUN_GROUP_INPUT: ${{ inputs.rerun_group }}
RELEASE_LIVE_SUITE_FILTER_INPUT: ${{ inputs.live_suite_filter }}
RELEASE_CROSS_OS_SUITE_FILTER_INPUT: ${{ inputs.cross_os_suite_filter }}
@@ -326,12 +319,6 @@ jobs:
else
run_release_soak=true
fi
run_maturity_scorecard="$(printf '%s' "$RELEASE_RUN_MATURITY_SCORECARD_INPUT" | tr '[:upper:]' '[:lower:]')"
if [[ "$run_maturity_scorecard" != "true" && "$run_maturity_scorecard" != "1" && "$run_maturity_scorecard" != "yes" ]]; then
run_maturity_scorecard=false
else
run_maturity_scorecard=true
fi
release_profile="$RELEASE_PROFILE_INPUT"
if [[ "$release_profile" == "minimum" ]]; then
release_profile=beta
@@ -435,7 +422,6 @@ jobs:
printf 'mode=%s\n' "$RELEASE_MODE_INPUT"
printf 'release_profile=%s\n' "$release_profile"
printf 'run_release_soak=%s\n' "$run_release_soak"
printf 'run_maturity_scorecard=%s\n' "$run_maturity_scorecard"
printf 'rerun_group=%s\n' "$RELEASE_RERUN_GROUP_INPUT"
printf 'live_suite_filter=%s\n' "$RELEASE_LIVE_SUITE_FILTER_INPUT"
printf 'cross_os_suite_filter=%s\n' "$RELEASE_CROSS_OS_SUITE_FILTER_INPUT"
@@ -458,7 +444,6 @@ jobs:
RELEASE_MODE: ${{ inputs.mode }}
RELEASE_PROFILE: ${{ steps.inputs.outputs.release_profile }}
RUN_RELEASE_SOAK: ${{ steps.inputs.outputs.run_release_soak }}
RUN_MATURITY_SCORECARD: ${{ steps.inputs.outputs.run_maturity_scorecard }}
RELEASE_RERUN_GROUP: ${{ inputs.rerun_group }}
RELEASE_LIVE_SUITE_FILTER: ${{ inputs.live_suite_filter }}
RELEASE_CROSS_OS_SUITE_FILTER: ${{ inputs.cross_os_suite_filter }}
@@ -476,7 +461,6 @@ jobs:
echo "- Cross-OS mode: \`${RELEASE_MODE}\`"
echo "- Release profile: \`${RELEASE_PROFILE}\`"
echo "- Release soak lanes: \`${RUN_RELEASE_SOAK}\`"
echo "- Maturity scorecard docs: \`${RUN_MATURITY_SCORECARD}\`"
echo "- Rerun group: \`${RELEASE_RERUN_GROUP}\`"
if [[ -n "${RELEASE_LIVE_SUITE_FILTER// }" ]]; then
echo "- Live suite filter: \`${RELEASE_LIVE_SUITE_FILTER}\`"
@@ -786,7 +770,7 @@ jobs:
maturity_scorecard_release_checks:
name: Render maturity scorecard release docs
needs: [resolve_target]
if: contains(fromJSON('["all","qa"]'), needs.resolve_target.outputs.rerun_group) && needs.resolve_target.outputs.run_maturity_scorecard == 'true'
if: contains(fromJSON('["all","qa"]'), needs.resolve_target.outputs.rerun_group)
permissions:
actions: read
contents: read

View File

@@ -91,6 +91,9 @@ const DEFAULT_COMPLETION_DELIVERY_RETRY_DELAYS_MS = [
];
const DEFAULT_TASK_ROW_RECONCILE_INTERVAL_MS = 10_000;
const RECENT_TERMINAL_TASK_RECONCILE_GRACE_MS = 60_000;
// Codex's recorder uses this filename contract; non-canonical names keep the
// legacy substring fallback for older or test-created transcript files.
const CODEX_ROLLOUT_FILENAME_RE = /^rollout-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-(.+)\.jsonl$/u;
const defaultRuntime: NativeSubagentMonitorRuntime = {
createAgentHarnessTaskRuntime,
@@ -1188,8 +1191,9 @@ async function findTranscriptPaths(params: {
}): Promise<Map<string, string>> {
const sessionsDir = path.join(params.codexHome, "sessions");
const found = new Map<string, string>();
const remaining = new Set(params.childThreadIds);
const stack = [sessionsDir];
while (stack.length > 0 && found.size < params.childThreadIds.size) {
while (stack.length > 0 && remaining.size > 0) {
const dir = stack.pop()!;
let entries: Array<{ name: string; isDirectory(): boolean; isFile(): boolean }>;
try {
@@ -1206,10 +1210,20 @@ async function findTranscriptPaths(params: {
if (!entry.isFile() || !entry.name.endsWith(".jsonl")) {
continue;
}
for (const childThreadId of params.childThreadIds) {
if (!found.has(childThreadId) && entry.name.includes(childThreadId)) {
const rolloutMatch = entry.name.match(CODEX_ROLLOUT_FILENAME_RE);
if (rolloutMatch) {
const childThreadId = rolloutMatch[1];
if (remaining.delete(childThreadId)) {
found.set(childThreadId, entryPath);
}
continue;
}
for (const childThreadId of remaining) {
if (entry.name.includes(childThreadId)) {
found.set(childThreadId, entryPath);
remaining.delete(childThreadId);
break;
}
}
}
}
@@ -1236,10 +1250,13 @@ async function findTranscriptPath(params: {
stack.push(entryPath);
continue;
}
const rolloutMatch = entry.name.match(CODEX_ROLLOUT_FILENAME_RE);
if (
entry.isFile() &&
entry.name.endsWith(".jsonl") &&
entry.name.includes(params.childThreadId)
(rolloutMatch
? rolloutMatch[1] === params.childThreadId
: entry.name.includes(params.childThreadId))
) {
return entryPath;
}

View File

@@ -24,13 +24,6 @@ const DEFAULT_QA_SCENARIOS = [
"memory-failure-fallback",
"gateway-restart-inflight-run",
];
const SINGLE_VALUE_FLAGS = new Set([
"--cpu-core-warn",
"--hot-wall-warn-ms",
"--output-dir",
"--runs",
"--warmup",
]);
const DEFAULT_CPU_CORE_WARN = 0.9;
const DEFAULT_HOT_WALL_WARN_MS = 30_000;
const PRIVATE_QA_REQUIRED_DIST_ENTRIES = [
@@ -56,15 +49,8 @@ function parseArgs(argv) {
cpuCoreWarn: DEFAULT_CPU_CORE_WARN,
hotWallWarnMs: DEFAULT_HOT_WALL_WARN_MS,
};
const seenSingleValueFlags = new Set();
for (let index = 0; index < args.length; index += 1) {
const arg = args[index];
if (SINGLE_VALUE_FLAGS.has(arg)) {
if (seenSingleValueFlags.has(arg)) {
throw new Error(`${arg} was provided more than once`);
}
seenSingleValueFlags.add(arg);
}
const readValue = () => {
const value = args[index + 1];
if (!value || value.startsWith("-")) {

View File

@@ -35,24 +35,6 @@ const DEFAULT_CPU_CORE_WARN = 0.9;
const DEFAULT_HOT_WALL_WARN_MS = 30_000;
const DEFAULT_MAX_RSS_WARN_MB = 1536;
const DEFAULT_QA_PLUGIN_CHUNK_SIZE = 12;
const SINGLE_VALUE_FLAGS = new Set([
"--build-timeout-ms",
"--command-timeout-ms",
"--cpu-core-warn",
"--hot-wall-warn-ms",
"--limit",
"--max-rss-warn-mb",
"--output-dir",
"--qa-cpu-regression-multiplier",
"--qa-plugin-chunk-size",
"--qa-timeout-ms",
"--qa-wall-regression-multiplier",
"--repo-root",
"--rss-anomaly-multiplier",
"--shard-index",
"--shard-total",
"--wall-anomaly-multiplier",
]);
const COMMAND_OUTPUT_MAX_BUFFER_BYTES = 16 * 1024 * 1024;
const MAX_TIMER_TIMEOUT_MS = 2_147_000_000;
const ANSI_PATTERN = new RegExp(String.raw`\u001B\[[0-9;]*m`, "gu");
@@ -97,15 +79,8 @@ export function parseArgs(argv) {
};
const envIds = normalizeCsv(process.env.OPENCLAW_PLUGIN_GATEWAY_GAUNTLET_IDS);
options.pluginIds.push(...envIds);
const seenSingleValueFlags = new Set();
parseArgv: for (let index = 0; index < args.length; index += 1) {
const arg = args[index];
if (SINGLE_VALUE_FLAGS.has(arg)) {
if (seenSingleValueFlags.has(arg)) {
throw new Error(`${arg} was provided more than once`);
}
seenSingleValueFlags.add(arg);
}
const readValue = () => {
const value = args[index + 1];
if (!value || value.startsWith("-")) {

View File

@@ -111,19 +111,6 @@ describe("gateway CPU scenario guard", () => {
}
});
it("rejects duplicate single-value controls before running scenarios", () => {
expect(() =>
testing.parseArgs(["--output-dir", makeTempRoot(), "--output-dir", makeTempRoot()]),
).toThrow("--output-dir was provided more than once");
const result = runCli("--runs", "1", "--runs", "2");
expect(result.status).toBe(1);
expect(result.stdout).toBe("");
expect(result.stderr.trim()).toBe("--runs was provided more than once");
expectNoNodeStack(result.stderr);
});
it("reports CLI argument errors without a Node stack trace", () => {
const result = runCli("--wat");

View File

@@ -1,6 +1,5 @@
// Ci Workflow Guards tests cover ci workflow guards script behavior.
import { execFileSync } from "node:child_process";
import { existsSync, readdirSync, readFileSync } from "node:fs";
import { readdirSync, readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { parse } from "yaml";
@@ -38,17 +37,10 @@ function readCriticalQualityWorkflow() {
return readFileSync(".github/workflows/codeql-critical-quality.yml", "utf8");
}
function readTrackedText(relativePath: string): string {
if (existsSync(relativePath)) {
return readFileSync(relativePath, "utf8");
}
return execFileSync("git", ["show", `:${relativePath}`], { encoding: "utf8" });
}
function readAndroidCompileSdk(relativePath: string): number {
const match = readTrackedText(relativePath).match(/^\s*compileSdk\s*=\s*(\d+)\s*$/mu);
function readAndroidCompileSdk(path: string): number {
const match = readFileSync(path, "utf8").match(/^\s*compileSdk\s*=\s*(\d+)\s*$/mu);
if (!match) {
throw new Error(`Missing compileSdk in ${relativePath}`);
throw new Error(`Missing compileSdk in ${path}`);
}
return Number(match[1]);
}
@@ -735,33 +727,18 @@ describe("ci workflow guards", () => {
expect(openDocsPrStep.if).toBe("${{ github.event_name == 'workflow_dispatch' }}");
});
it("keeps maturity scorecard release docs opt-in from release checks", () => {
it("runs maturity scorecard from release checks", () => {
const releaseWorkflow = readReleaseChecksWorkflow();
const job = releaseWorkflow.jobs.maturity_scorecard_release_checks;
const summaryJob = releaseWorkflow.jobs.summary;
const verifyStep = summaryJob.steps.find(
(step) => step.name === "Verify release check results",
);
const inputs = releaseWorkflow.on.workflow_dispatch.inputs;
const resolveJob = releaseWorkflow.jobs.resolve_target;
const summarizeStep = resolveJob.steps.find((step) => step.name === "Summarize validated ref");
expect(releaseWorkflow.jobs).not.toHaveProperty("qa_profile_release_evidence_release_checks");
expect(inputs.run_maturity_scorecard).toMatchObject({
required: false,
default: false,
type: "boolean",
});
expect(resolveJob.outputs.run_maturity_scorecard).toBe(
"${{ steps.inputs.outputs.run_maturity_scorecard }}",
);
expect(summarizeStep.env.RUN_MATURITY_SCORECARD).toBe(
"${{ steps.inputs.outputs.run_maturity_scorecard }}",
);
expect(summarizeStep.run).toContain("- Maturity scorecard docs:");
expect(job.name).toBe("Render maturity scorecard release docs");
expect(job.if).toBe(
"contains(fromJSON('[\"all\",\"qa\"]'), needs.resolve_target.outputs.rerun_group) && needs.resolve_target.outputs.run_maturity_scorecard == 'true'",
'contains(fromJSON(\'["all","qa"]\'), needs.resolve_target.outputs.rerun_group)',
);
expect(job.permissions).toMatchObject({
actions: "read",

View File

@@ -150,15 +150,6 @@ describe("plugin gateway gauntlet helpers", () => {
);
});
it("rejects duplicate single-value controls", () => {
expect(() =>
parseArgs(["--output-dir", ".artifacts/one", "--output-dir", ".artifacts/two"]),
).toThrow("--output-dir was provided more than once");
expect(() => parseArgs(["--shard-total", "2", "--shard-total", "3"])).toThrow(
"--shard-total was provided more than once",
);
});
it("rejects valued flags followed by another option", () => {
for (const flag of [
"--repo-root",