perf(web): add idempotent batch verification fast paths
This commit is contained in:
@@ -58,20 +58,6 @@ function taskCommand(task) {
|
||||
return match[1];
|
||||
}
|
||||
|
||||
function typecheckProven(task) {
|
||||
try {
|
||||
const manifest = JSON.parse(read(`tests/golden/${task}/manifest.json`));
|
||||
const receiptPath = manifest.artifacts?.moduleReceipt?.path;
|
||||
if (!receiptPath) return false;
|
||||
const receipt = JSON.parse(read(receiptPath));
|
||||
return receipt.status === "PASS" && receipt.source?.unchanged === true
|
||||
&& receipt.commands?.some((entry) => entry.exitCode === 0 && entry.command.trim() === "npm --prefix web run typecheck");
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
let iterations = 0;
|
||||
const summary = [];
|
||||
while (maxIterations === 0 || iterations < maxIterations) {
|
||||
@@ -91,10 +77,10 @@ while (maxIterations === 0 || iterations < maxIterations) {
|
||||
const after = currentTask();
|
||||
const terminal = after.task === before.task && terminalTask(before.task);
|
||||
if (after.task === before.task && !terminal) throw new Error(`${before.task} focused command exited 0 without advancing queue; log=${logPath}`);
|
||||
const typecheckCommand = typecheckProven(before.task)
|
||||
? "printf 'typecheck reused from hash-bound module receipt\\n'"
|
||||
: "npm --prefix web run typecheck";
|
||||
const gates = command(`node tools/web/check-context-governance.mjs && node tools/web/check-execution-control-plane.mjs --allow-unrunnable && node tools/web/check-v2-task-index.mjs && node tools/web/check-v2-handoff.mjs && ${typecheckCommand} && npm --prefix web run lint && git diff --check`, `tests/golden/${before.task}/continuous-gates.log`);
|
||||
// Implementation cycles keep the post-handoff gate incremental. Full API,
|
||||
// format, Chromium, performance and release gates belong to the explicit
|
||||
// final audit and must not be repeated for every batch.
|
||||
const gates = command(`python3 my-tools/validate_incremental_context.py --task ${before.task}`, `tests/golden/${before.task}/continuous-gates.log`);
|
||||
if (gates.code !== 0) throw new Error(`${before.task} post-handoff gate failed (exit ${gates.code}); log=tests/golden/${before.task}/continuous-gates.log`);
|
||||
iterations += 1;
|
||||
summary.push({ task: before.task, command: focused, nextTask: terminal ? null : after.task, terminal, log: logPath });
|
||||
|
||||
Reference in New Issue
Block a user