Skip to content

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.

fix(runner): validate the complete deadline runtime [C7]

Corey Olson414026f4bbda
diff --git a/src/runner-worker.js b/src/runner-worker.js
index 1561ec9b..b00aa87f 100644
--- a/src/runner-worker.js
+++ b/src/runner-worker.js
@@ -233,7 +233,7 @@ async function readSpec() {
tagNames.add(tag.name);
if (tag.chain.length ? tag.chain[0] !== tag.object : tag.object !== tag.peeledCommit) throw new Error('invalid tag manifest');
}
- const runtimeNames = ['runner-custody.js', 'resources.js', 'git.js', 'machine-home.js', 'refused.js', 'process-census.js', 'queue-settings.js', 'queue-order.js', 'sandbox-denial.js', 'gate-stages.js', 'child-journal-preload.js', 'execution-environment.js', 'runner-load.js', 'gui-session.js', 'runner-private-mode.js'];
+ const runtimeNames = ['runner-custody.js', 'resources.js', 'runner-wait.js', 'git.js', 'machine-home.js', 'refused.js', 'process-census.js', 'queue-settings.js', 'queue-order.js', 'sandbox-denial.js', 'gate-stages.js', 'child-journal-preload.js', 'execution-environment.js', 'runner-load.js', 'gui-session.js', 'runner-private-mode.js'];
if (Object.keys(value.runtime.files).length !== runtimeNames.length
|| runtimeNames.some(name => typeof value.runtime.files[name] !== 'string')) throw new Error('invalid work specification');
if (createHash('sha256').update(JSON.stringify(value.runtime.files)).digest('hex') !== value.runtime.sha256) throw new Error('invalid trusted runtime');
diff --git a/test/runner-wait-deadline.test.js b/test/runner-wait-deadline.test.js
index 592268d0..8ba8dde8 100644
--- a/test/runner-wait-deadline.test.js
+++ b/test/runner-wait-deadline.test.js
@@ -163,7 +163,7 @@ test('the public runner deadline setting has a five-minute default and rejects u
});
test('an executing runner command keeps its test budget after the admission deadline [C7]', async () => {
- const box = fixture({ runnerWaitMs: 15_000, dropFirst: false });
+ const box = fixture({ runnerWaitMs: 5_000, dropFirst: false });
const previous = [process.env.PULLBOARD_HOME, process.env.PULLBOARD_MACHINE_HOME];
process.env.PULLBOARD_HOME = box.env.PULLBOARD_HOME;
process.env.PULLBOARD_MACHINE_HOME = box.env.PULLBOARD_MACHINE_HOME;
@@ -173,9 +173,9 @@ test('an executing runner command keeps its test budget after the admission dead
held = await takeResource({ name: 'gate', scope: 'machine', root: box.repo, capacity: 1, agent: 'admitted-run-local-holder' });
const started = Date.now();
pending = runThroughGate(box.repo, box.env,
- 'node -e "setTimeout(()=>console.log(\'ADMITTED_LONG_COMMAND\'),16000)"', { requests: box.requests });
+ 'node -e "setTimeout(()=>console.log(\'ADMITTED_LONG_COMMAND\'),6000)"', { requests: box.requests });
await observe(() => existsSync(box.stderrLog) && readFileSync(box.stderrLog, 'utf8').includes('PULLBOARD_RUNNER_READY '), 'the real worker READY frame');
- console.error('private worker became ready after', Date.now() - started, 'ms; admission deadline is 15000ms');
+ console.error('private worker became ready after', Date.now() - started, 'ms; admission deadline is 5000ms');
const result = await pending; pending = null;
assert.equal(result.status, 0, fixtureResultContext(result));
assert.match(result.stdout, /ADMITTED_LONG_COMMAND/u);