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(test): board replays register pre-grant seats compactly [E21,C7]
Corey Olsona5b9a87d8ac1
diff --git a/test/board.test.js b/test/board.test.jsindex 1a669dba..ef6ab08f 100644--- a/test/board.test.js+++ b/test/board.test.js@@ -11,7 +11,7 @@ import { tmpdir } from 'node:os';import { join } from 'node:path';import { beforeEach, test } from 'node:test';import * as store from '../src/board.js';-import { AGENT_GRANT_ENGINE } from '../src/agent-grant-engine.js';+import { registerPreGrant } from './pre-grant-seats.js';import { displayAgentName } from '../src/agent-names.js';import { projectState } from '../src/serve.js';import { applyEngineMove, prepareEngineMove } from '../src/engine.js';@@ -88,13 +88,7 @@ beforeEach(() => {let at = Date.parse('2026-10-04T12:00:00Z');clock = { now: () => new Date(at), advance: (ms) => { at += ms; } };board = store.openBoard(':memory:', clock);- // The seats predate agent grants (#348), so this board's replays at older engines stay legitimate.- board.executionEngineVersion = AGENT_GRANT_ENGINE - 1;- store.register(board, { lane: 'coordinator', path: '/repo' });- store.register(board, { lane: 'web', path: '/repo-web-1' });- store.register(board, { lane: 'web', path: '/repo-web-2' });- store.register(board, { lane: 'api', path: '/repo-api-1' });- delete board.executionEngineVersion;+ registerPreGrant(board, [['coordinator', '/repo'], ['web', '/repo-web-1'], ['web', '/repo-web-2'], ['api', '/repo-api-1']]);});test('[B14] notes in parentheses are not paths, and a foreign path still refuses', async (t) => {@@ -500,16 +494,10 @@ test('a rejected commit resubmits after its bar is corrected [V4,B3]', async (t)];t.after(() => legacy.forEach((replica) => store.closeBoard(replica)));const oldIds = legacy.map((replica) => {- // The legacy seats predate agent grants (#348), as on any board an engine-8 client wrote.- replica.executionEngineVersion = AGENT_GRANT_ENGINE - 1;- store.register(replica, { lane: 'coordinator', path: '/legacy/repo' });- const oldBuilder = store.register(replica, { lane: 'web', path: '/legacy/web-1' });- store.register(replica, { lane: 'web', path: '/legacy/web-2' });- const oldItem = store.addItem(replica, {+ const [, oldBuilder] = registerPreGrant(replica, [['coordinator', '/legacy/repo'], ['web', '/legacy/web-1'], ['web', '/legacy/web-2']]);+ return { oldBuilder, oldItem: store.addItem(replica, {by: 'coordinator', lane: 'web', title: 'Legacy page', criterion: 'the page renders its heading',- });- delete replica.executionEngineVersion;- return { oldBuilder, oldItem };+ }) };});for (const replica of legacy) {replica.db.prepare('UPDATE board_meta SET meta_value = ? WHERE meta_key = ?').run('8'.repeat(32), 'board_id');diff --git a/test/pre-grant-seats.js b/test/pre-grant-seats.jsnew file mode 100644index 00000000..99162950--- /dev/null+++ b/test/pre-grant-seats.js@@ -0,0 +1,16 @@+/** Seats registered as history from before agent grants (#348), for replays of older engines [E21,H16]. */+import * as store from '../src/board.js';+import { AGENT_GRANT_ENGINE } from '../src/agent-grant-engine.js';++/**+ * Register each [lane, path] seat as an engine before AGENT_GRANT_ENGINE wrote it, and return the seat ids.+ * A seat a newer client registered rightly refuses old-engine moves, so a board that replays an older+ * client's moves must hold seats that client could have written.+ */+export function registerPreGrant(board, seats) {+ const recorded = Object.hasOwn(board, 'executionEngineVersion') ? board.executionEngineVersion : undefined;+ board.executionEngineVersion = AGENT_GRANT_ENGINE - 1;+ try { return seats.map(([lane, path]) => store.register(board, { lane, path })); } finally {+ if (recorded === undefined) delete board.executionEngineVersion; else board.executionEngineVersion = recorded;+ }+}