fix(web-probe): add mdtodo visual sentinel coverage

This commit is contained in:
Codex
2026-06-27 02:03:27 +00:00
parent 4b6f0c745f
commit ac5864a05d
12 changed files with 296 additions and 10 deletions
@@ -2217,6 +2217,8 @@ function runSentinelQuickVerify(state: SentinelCicdState, reason: string, timeou
"--screenshot-interval-ms", String(numberAt(scenario, "screenshotIntervalMs")),
"--command-timeout-seconds", "55",
];
const viewport = stringAtNullable(scenario, "viewport");
if (viewport !== null) startArgs.push("--viewport", viewport);
const started = runChildCli(startArgs, remainingSeconds(deadline, 55), undefined, accountEnv.env);
steps.push({ phase: "observe-start", ok: started.ok, result: started.result });
const observerId = observerIdFromText(String(record(started.result).stdoutPreview ?? ""));
@@ -2291,6 +2293,7 @@ function runSentinelQuickVerify(state: SentinelCicdState, reason: string, timeou
args.push("--text", prompts.prompts[promptIndex % prompts.prompts.length] ?? "");
promptIndex += 1;
}
appendScenarioObserveCommandArgs(args, item, { skipText: type === "sendPrompt" });
const commandResult = runChildCli(args, remainingSeconds(deadline, 60));
steps.push({ phase: `observe-command-${type}`, ok: commandResult.ok, promptIndex: type === "sendPrompt" ? promptIndex : null, result: commandResult.result });
if (!commandResult.ok) {
@@ -2452,6 +2455,42 @@ function runQuickVerifySessionInvarianceChecks(
return { ok: true, promptIndex, checkCount: checks.length, warnings, valuesRedacted: true };
}
function appendScenarioObserveCommandArgs(args: string[], item: Record<string, unknown>, options: { readonly skipText?: boolean } = {}): void {
const mappings: readonly (readonly [string, string])[] = [
["path", "--path"],
["label", "--label"],
["sessionId", "--session-id"],
["provider", "--provider"],
["accountId", "--account-id"],
["fromAccountId", "--from-account-id"],
["toAccountId", "--to-account-id"],
["sourceId", "--source-id"],
["fileRef", "--file-ref"],
["filename", "--filename"],
["taskRef", "--task-ref"],
["taskId", "--task-id"],
["task", "--task"],
["field", "--field"],
["link", "--link"],
["title", "--title"],
["body", "--body"],
["status", "--status"],
["hwpodId", "--hwpod-id"],
["nodeId", "--node-id"],
["workspaceRoot", "--workspace-root"],
["root", "--root"],
];
for (const [key, flag] of mappings) {
if (args.includes(flag)) continue;
const value = stringAtNullable(item, key);
if (value !== null) args.push(flag, value);
}
if (options.skipText !== true && !args.includes("--text")) {
const text = stringAtNullable(item, "text") ?? stringAtNullable(item, "value");
if (text !== null) args.push("--text", text);
}
}
function finalizeQuickVerifyFailure(state: SentinelCicdState, input: {
readonly runId: string;
readonly scenarioId: string;