Files
stack/agents/gander/work/queue-196/r2/driver-fix.diff
T

48 lines
4.2 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
diff --git a/agents/gander/work/queue-196/BUILD.md b/agents/gander/work/queue-196/BUILD.md
index 72e359134..1deba067c 100644
--- a/agents/gander/work/queue-196/BUILD.md
+++ b/agents/gander/work/queue-196/BUILD.md
@@ -98,3 +98,5 @@ the fixture verifies no start/stop calls for unsafe mode. M29 removes the check.
Legacy tester-port-invalid wording is restored to avoid an unrelated contract
change. Review covered all changed trust paths and consumers; no further code
changes are planned before the batch. M1-M29 remain prepared and unexecuted.
+
+2026-10-21 sage-2063: driver uses only node --check for syntax validity; runtime test failures count as kills, and the r2 driver records GNU timeout process-group TERM/KILL exits so blocked descendants cannot survive. No rerun before next clear.
diff --git a/agents/gander/work/queue-196/mutants.mjs b/agents/gander/work/queue-196/mutants.mjs
index 95b216d3a..a3342f63d 100644
--- a/agents/gander/work/queue-196/mutants.mjs
+++ b/agents/gander/work/queue-196/mutants.mjs
@@ -56,7 +56,8 @@ try {
const log=(run.stdout??'')+(run.stderr??'');writeFileSync(join(out,id+'.txt'),log);
writeFileSync(at,original);if(hash(readFileSync(at))!==before)throw Error(id+' restore hash failed');
const failed=/[ℹ#]\s*(?:fail|tests failed)\s+[1-9]/.test(log) || /✖/.test(log);
- const killed=run.status!==0&&failed&&!/SyntaxError|ERR_MODULE_NOT_FOUND/.test(log);
+ // Syntax validity is decided exclusively by the node --check preflight above.
+ const killed=run.status!==0&&failed;
const result={id,description,test,args,status:run.status,signal:run.signal,killed,restoredSha256:before};results.push(result);
writeFileSync(join(out,'results.json'),JSON.stringify(results,null,2)+'\n');
console.log(id+' '+(killed?'KILLED':'SURVIVED/INVALID'));
diff --git a/agents/gander/work/queue-196/r2/driver.mjs b/agents/gander/work/queue-196/r2/driver.mjs
index 6f80b6546..508fa4ad3 100644
--- a/agents/gander/work/queue-196/r2/driver.mjs
+++ b/agents/gander/work/queue-196/r2/driver.mjs
@@ -53,12 +53,15 @@ try {
const syntax=spawnSync(file.endsWith('.sh')?'bash':process.execPath,[file.endsWith('.sh')?'-n':'--check',at],{encoding:'utf8'});
if(syntax.status!==0)throw Error(id+' invalid mutation: '+syntax.stderr);
const args=['--test',...(Array.isArray(test)?test:[test])];
- const run=spawnSync('bash',['-c','set -o pipefail; python3 "$G196_BUSY" && "$G196_NODE" "$@" 2>&1 | tee "$G196_LOG"','--',...args],{cwd:scratch,env:{...process.env,G196_NODE:process.execPath,G196_LOG:join(out,id+'.txt')},encoding:'utf8',timeout:60000,maxBuffer:2*1024*1024});
+ const run=spawnSync('timeout',['--signal=TERM','--kill-after=2s','60s','bash','-c','set -o pipefail; python3 "$G196_BUSY" && "$G196_NODE" "$@" 2>&1 | tee "$G196_LOG"','--',...args],{cwd:scratch,env:{...process.env,G196_NODE:process.execPath,G196_LOG:join(out,id+'.txt')},encoding:'utf8',maxBuffer:2*1024*1024});
const log=(run.stdout??'')+(run.stderr??'');writeFileSync(join(out,id+'.txt'),log);
writeFileSync(at,original);const clean=execFileSync('git',['status','--porcelain'],{cwd:scratch,encoding:'utf8'});if(clean.trim())throw Error(id+' dirty restored tree: '+clean);if(hash(readFileSync(at))!==before)throw Error(id+' restore hash failed');
const failed=/[ℹ#]\s*(?:fail|tests failed)\s+[1-9]/.test(log) || /✖/.test(log);
- const killed=run.status!==0&&failed&&!/SyntaxError|ERR_MODULE_NOT_FOUND/.test(log);
- const result={id,description,test,args,status:run.status,signal:run.signal,killed,restoredSha256:before};results.push(result);
+ // Syntax validity is decided exclusively by the node --check preflight above.
+ // GNU timeout owns a process group and terminates its shell, tee and test descendants.
+ const timedOut=run.status===124||run.status===137;
+ const killed=timedOut||(run.status!==0&&failed);
+ const result={id,description,test,args,status:run.status,signal:run.signal,killed,timedOut,timeoutSeconds:60,timeoutKillAfterSeconds:2,processGroupTimeout:true,syntaxStatus:syntax.status,restoredSha256:before};results.push(result);
writeFileSync(join(out,'results.json'),JSON.stringify(results,null,2)+'\n');
console.log(id+' '+(killed?'KILLED':'SURVIVED/INVALID'));
if(!killed) {process.exitCode=1;break;}