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.

test(handoff): seed historical registration bytes [B3,H16]

Corey Olson8bbd6fca1885
diff --git a/test/handoff.test.js b/test/handoff.test.js
index 9dcfdf04..a4fd6abb 100644
--- a/test/handoff.test.js
+++ b/test/handoff.test.js
@@ -8,6 +8,7 @@ import * as store from '../src/board.js';
import { main } from '../src/cli.js';
import { appliedSequence, applyRelayMove, prepareEngineMove } from '../src/engine.js';
import { ENGINE_VERSION } from '../src/machine.js';
+import { HANDOFF_ENGINE } from '../src/handoff-engine.js';
import { machineSettingsFile } from '../src/settings.js';
import { loadConfig } from '../src/config.js';
import { loadDoctrine } from '../src/doctrine.js';
@@ -15,7 +16,7 @@ import { frozenCriterion, loadSpec } from '../src/spec.js';
import { runFixtureGit } from './fixture-child.js';
/** Keep fixture identity, settings, Git and SQLite separate from the invoking agent. */
-function fixture(t) {
+function fixture(t, { registrationEngine = ENGINE_VERSION } = {}) {
const directory = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-handoff-'))), root = join(directory, 'repo');
mkdirSync(root);
const overrides = { PULLBOARD_HOME: join(directory, 'home'), PULLBOARD_MACHINE_HOME: join(directory, 'machine'), GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_NOSYSTEM: '1' };
@@ -32,12 +33,15 @@ function fixture(t) {
writeFileSync(settings, JSON.stringify({ view: { background: false }, relay: { offerAtInit: false } }));
const clock = { value: Date.parse('2026-10-24T10:00:00Z'), now() { return new Date(this.value); } };
const board = store.openBoard(join(root, '.git/pullboard/board.sqlite'), clock);
+ // Historical replay tests need actual old join bytes, not current grants followed by an old move.
+ board.executionEngineVersion = registrationEngine;
store.register(board, { lane: 'coordinator', path: root });
const paths = ['outgoing', 'incoming', 'other'].map(name => join(directory, name));
const agents = paths.map(path => {
runFixtureGit(['worktree', 'add', '--detach', '--quiet', path, 'main'], { cwd: root, env });
return store.register(board, { lane: 'core', path });
});
+ delete board.executionEngineVersion;
/** Execute real CLI parsing/dispatch, with text available to prove the final printed command. */
async function cli(index, args, json = true) {
let output = '', error = '';
@@ -106,7 +110,7 @@ test('handoff takeover prints real work and retires only the outgoing seat [B3,N
});
test('handoff takeover is first-wins and cannot be forged by facts or an authenticated old engine [B3,H16]', t => {
- const box = fixture(t), [outgoing, incoming, other] = box.agents;
+ const box = fixture(t, { registrationEngine: HANDOFF_ENGINE }), [outgoing, incoming, other] = box.agents;
const opened = box.replay('openHandoff', [{ agentId: outgoing }], outgoing);
assert.equal(opened.error, undefined);
const id = opened.result.item;