Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(runners): preserve raw logs and phase deadlines [C7,V4]
Corey Olson8539a8f51a66
diff --git a/src/runner-private-check.js b/src/runner-private-check.jsindex 4f71f60d..e8e3bf63 100644--- a/src/runner-private-check.js+++ b/src/runner-private-check.js@@ -1,7 +1,6 @@/** Controller-side private-check artifact custody; worker framing never comes from command text [C7,V4]. */import { createHash } from 'node:crypto';-import { closeSync, mkdtempSync, openSync, readSync, writeSync } from 'node:fs';-import { tmpdir } from 'node:os';+import { closeSync, mkdirSync, mkdtempSync, openSync, readSync, writeSync } from 'node:fs';import { join } from 'node:path';import { runOnRunner } from './runners.js';import { privateCheckEnvelope } from './runner-private-mode.js';@@ -45,7 +44,10 @@ function phaseCopy(raw, phase, path) {/** Run only under an actual runner lease, preserving raw evidence even when formatting or transport fails. */export function runnerPrivateCheck(root, item, command, policy, lease, guard, waitMs, format) {- const directory = mkdtempSync(join(tmpdir(), 'pullboard-private-runner-'));+ const common = policyGit(root, ['rev-parse', '--path-format=absolute', '--git-common-dir']).trim();+ const artifactRoot = join(common, 'pullboard', 'check-output');+ mkdirSync(artifactRoot, { recursive: true, mode: 0o700 });+ const directory = mkdtempSync(join(artifactRoot, 'private-runner-'));const ref = trunkRef(root);const mode = privateCheckEnvelope({ kind: 'private-check', version: 1, install: policy.config.check.install,check: command, timeoutMs: policy.config.check.timeoutMs, policyCommit: policy.commit,@@ -75,7 +77,7 @@ export function runnerPrivateCheck(root, item, command, policy, lease, guard, wa}} catch { captureProblem = true; }const profile = checkLogPath ? timingFromLog(checkLogPath, timingRunner(command)) : { files: [], tests: [] };- const formatted = format(captureProblem ? 'unverified' : result.privateCheck.state, captureProblem ? 'private-check output could not be authenticated or saved' : result.privateCheck.stage, installCapture, checkCapture,+ const formatted = format(captureProblem ? 'unverified' : result.privateCheck.state, captureProblem ? `private-check output could not be authenticated or saved; raw output retained at ${result.rawOutputPath} sha256 ${result.rawOutputSha256}` : result.privateCheck.stage, installCapture, checkCapture,{ root, item, commandRoot: result.executionRoot, installLogPath, checkLogPath, waitMs,timingProfile: { ...profile, wallMs: Date.now() - started, environment: result.environment,executionRunner: result.executionRunner, executionSource: result.executionSource, executionMain: result.executionMain,diff --git a/src/runner-worker.js b/src/runner-worker.jsindex cecff38e..354fd9fd 100644--- a/src/runner-worker.js+++ b/src/runner-worker.js@@ -90,10 +90,15 @@ function beginPhaseCleanup() {/** A fully verified successful intermediate drain is the only boundary allowed to clear its own timer. */function clearPhaseCleanup() {- if (transportLost || cleanupTimedOut || Number.isFinite(cleanupDeadline) || ownedChildren.size) return;+ if (Date.now() >= Math.min(cleanupDeadline, phaseCleanupDeadline)) {+ reportCleanupTimeout();+ return false;+ }+ if (transportLost || cleanupTimedOut || Number.isFinite(cleanupDeadline) || ownedChildren.size) return false;clearTimeout(phaseCleanupTimer);phaseCleanupTimer = null;phaseCleanupDeadline = Infinity;+ return true;}/** Report an unresolved cleanup once so the controller can fail without retrying the command. */@@ -780,7 +785,7 @@ async function runCommand(spec, root, env, sink, tracker, { continuation = falseconst code = Number.isInteger(result.code) ? result.code : 1;if (continuation && code === 0 && !result.signal && !timedOut && !outputError && !sink.pipeFailed) {await tracker.verifyAfterGroups();- clearPhaseCleanup();+ if (!clearPhaseCleanup()) throw new Error('intermediate install cleanup could not be verified within its deadline');}const denial = code === 0 && !result.signal ? null : denials.end();let pipeStatuses = pipes ? readPipes(split, pipes, 8 * 1024 ** 2) : null;