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(board): merge trunk; read-only open beside the schema guard [C7]
Corey Olson90cf81f9ce2c
diff --cc src/board-read.jsindex 00000000,00000000..0a641abdnew file mode 100644--- /dev/null+++ b/src/board-read.js@@@ -1,0 -1,0 +1,20 @@@++/** The read-only board open for commands that only read, kept beside cli.js's withBoard [C7]. */++import * as store from './board.js';++import { withBoard } from './cli.js';++++/**++ * withBoard for a command that only reads: the board opens read-only, without the write lock or a++ * migration (#1047). A board that needs a migration, or work that writes after all (a first++ * coordinator registration), runs again through withBoard; SQLite refused the write, so nothing ran twice.++ *++ * @template T++ * @param {any} ctx++ * @param {(board: any) => T} work++ * @returns {T}++ */++export function withBoardRead(ctx, work) {++ const board = store.openCurrentBoardReadOnly(ctx.file, ctx.clock);++ if (!board) return withBoard(ctx, work);++ try { return withBoard(ctx, work, board); }++ catch (error) { if (store.writeRefused(error)) return withBoard(ctx, work); throw error; }++}diff --cc src/board.jsindex e476dd44,3763f55a..eef7181a--- a/src/board.js+++ b/src/board.js@@@ -22,15 -22,14 +22,21 @@@ importmkdirSync,} from 'node:fs';import { dirname } from 'node:path';+ import { sharedSchemaOwner } from './board-schema.js';+ import { expectedBoardSchema } from './board-schema.js';+ import { sharedSchemaDiagnostic } from './board-schema.js';+ import { reportSharedSchema } from './board-schema.js';import { DatabaseSync } from 'node:sqlite';import { boardNotWritable } from './board-access.js';+ import { boardBusyError } from './board-access.js';+ export { boardBusyError } from './board-access.js';+import {+ boardIsCurrent,+ migrate,+ recordSchemaStamp,+ schemaDigest,+} from './board-migrate.js';+export { writeRefused } from './board-migrate.js';import {briefFiles,briefSections,@@@ -336,16 -305,18 +329,22 @@@ export function openBoard(file, clocktry {db = new DatabaseSync(file);db.exec(`PRAGMA busy_timeout = ${BOARD_BUSY_TIMEOUT_MS}`);- if (file !== ':memory:') db.exec('PRAGMA journal_mode = WAL');- // A board this code already migrated skips the migration, its write lock and the trigger audit (#1047).- const current = boardIsCurrent(db, SCHEMA_DIGEST, SCHEMA_VERSION);- if (!current) {- migrateEventLogVersion(db);- migrate(db);- db.prepare('INSERT OR IGNORE INTO board_meta (meta_key, meta_value) VALUES (?, ?)').run('board_id', randomBytes(16).toString('hex'));- }+ if (file !== ':memory:' && isMain !== false) db.exec('PRAGMA journal_mode = WAL');const board = { db, clock };- if (!current) { guardStore(board); recordSchemaStamp(db, SCHEMA_DIGEST); }+ if (isMain !== false || file === ':memory:') {- migrateEventLogVersion(db);- migrate(db);- db.prepare('INSERT OR IGNORE INTO board_meta (meta_key, meta_value) VALUES (?, ?)').run('board_id', randomBytes(16).toString('hex'));- guardStore(board);++ // A board this code already migrated skips the migration, its write lock and the trigger audit (#1047).++ if (!boardIsCurrent(db, SCHEMA_DIGEST, SCHEMA_VERSION)) {++ migrateEventLogVersion(db);++ migrate(db);++ db.prepare('INSERT OR IGNORE INTO board_meta (meta_key, meta_value) VALUES (?, ?)').run('board_id', randomBytes(16).toString('hex'));++ guardStore(board);++ recordSchemaStamp(db, SCHEMA_DIGEST);++ }+ } else {+ // Read compatibility before any local effect; persistent schema belongs to trunk alone.+ readEventLogVersion(db);+ reportSharedSchema(file, sharedSchemaDiagnostic(db, expectedBoardSchema(SCHEMA, migrate, storeTriggers)), onDiagnostic);+ }guardMoves(board);return board;} catch (error) {diff --cc src/cli.jsindex 305ddc29,be31446b..35b8d51c--- a/src/cli.js+++ b/src/cli.js@@@ -45,6 -45,6 +45,8 @@@ import * as itemSessions from './item-simport * as seatCheckout from './seat-checkout.js';import { submitPreflight } from './submit-preflight.js';import * as store from './board.js';++import { withBoardRead } from './board-read.js';++export { withBoardRead };import * as nativeFlakes from './native-flake-cli.js';import {COMMANDS,@@@ -834,10 -834,19 +836,20 @@@ function configHere(info)* @template T* @param {any} ctx* @param {(board: any) => T} work- * @param {any} [board] an already-open board, as withBoardRead passes++ * @param {any} [opened] an already-open board, as withBoardRead passes* @returns {T}*/- export function withBoard(ctx, work, board = store.openBoard(ctx.file, ctx.clock, { isMain: ctx.allowSchemaUpgrade })) {-export function withBoard(ctx, work) {- const board = store.openBoard(ctx.file, ctx.clock, { isMain: ctx.allowSchemaUpgrade,++export function withBoard(ctx, work, opened) {++ const board = opened ?? store.openBoard(ctx.file, ctx.clock, { isMain: ctx.allowSchemaUpgrade,+ /** Report each source mismatch once through this invocation's text or JSON diagnostics. */+ onDiagnostic(message) {+ ctx.io.schemaDiagnostics ??= new Set();+ const key = ctx.file + '\n' + message;+ if (ctx.io.schemaDiagnostics.has(key)) return;+ ctx.io.schemaDiagnostics.add(key);+ ctx.io.err(message);+ },+ });// Whether a proven flake stops blocking a landing is the coordinator's setting, read from accepted main on first use.let quarantine;board.quarantineEnabled = () => quarantine ??= mainPolicy(ctx.info.root).config.flakes?.quarantine === true;diff --cc test/branch-worktree-isolation.jsindex 00000000,cb3ab38c..f9226807mode 000000,100644..100644--- a/test/branch-worktree-isolation.js+++ b/test/branch-worktree-isolation.js@@@ -1,0 -1,139 +1,142 @@@+ /** Private-Git regression helper for a branch source whose unversioned DDL must not install [A5,A6,C7]. */+ import assert from 'node:assert/strict';+ import { spawnSync } from 'node:child_process';+ import { cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';+ import { tmpdir } from 'node:os';+ import { join, resolve } from 'node:path';+ import { DatabaseSync } from 'node:sqlite';++ /** Run an isolated fixture command and retain both streams for a precise assertion. */+ function run(command, args, cwd, env) {+ return spawnSync(command, args, { cwd, env, encoding: 'utf8' });+ }++ /** Create a real branch worktree with a same-version DDL/trigger delta and exercise shared-board operations. */+ export async function assertBranchWorktreeBoardIsolation(t, sourceRoot) {+ const directory = mkdtempSync(join(tmpdir(), 'pullboard-branch-board-isolation-'));+ t.after(() => rmSync(directory, { recursive: true, force: true }));+ const repo = join(directory, 'repo');+ const branch = join(directory, 'branch');+ mkdirSync(repo);+ for (const name of ['bin', 'src', 'skills', 'package.json', 'CHANGELOG.md']) cpSync(resolve(sourceRoot, name), join(repo, name), { recursive: true });+ writeFileSync(join(repo, 'pullboard.json'), `${JSON.stringify({+ gate: 'true', spec: 'SPEC.md', practice: 'PRACTICE.md',+ lanes: { web: { owns: ['web/'], specs: [] } }, shared: [],+ }, null, 2)}\n`);+ writeFileSync(join(repo, 'SPEC.md'), '# Worktree schema fixture\n\n## G · Goals\n- G1 [approved, must] Keep the shared board stable. | gate: true\n');+ writeFileSync(join(repo, 'PRACTICE.md'), '');+ const env = { ...process.env,+ HOME: join(directory, 'home'), PULLBOARD_HOME: join(directory, 'pullboard-home'),+ PULLBOARD_MACHINE_HOME: join(directory, 'machine-home'),+ GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_NOSYSTEM: '1',+ GIT_AUTHOR_NAME: 'Board Isolation Fixture', GIT_AUTHOR_EMAIL: '[email protected]',+ GIT_COMMITTER_NAME: 'Board Isolation Fixture', GIT_COMMITTER_EMAIL: '[email protected]',+ };+ for (const name of Object.keys(env)) if (name.startsWith('GIT_') && !name.startsWith('GIT_CONFIG_')+ && !name.startsWith('GIT_AUTHOR_') && !name.startsWith('GIT_COMMITTER_')) delete env[name];++ /** Execute a real private Git operation without bypassing installed hooks. */+ const gitAt = (cwd, ...args) => {+ const result = run('git', args, cwd, env);+ assert.equal(result.status, 0, result.stderr + result.stdout);+ return result.stdout.trim();+ };+ /** Use the primary private repository for setup. */+ const git = (...args) => gitAt(repo, ...args);+ /** Run the chosen checkout's real command in a fresh process. */+ const cli = (cwd, ...args) => run(process.execPath,+ [join(cwd, 'bin/pullboard.js'), ...args, '--json'], cwd, env);+ git('init', '-q', '-b', 'main');+ git('add', '-A');+ git('commit', '-q', '-m', 'chore: initialize board isolation fixture');++ const initialized = cli(repo, 'init');+ assert.equal(initialized.status, 0, initialized.stderr + initialized.stdout);+ const linked = run('git', ['worktree', 'add', '-q', '-b', 'schema/drift', branch, 'main'], repo, env);+ assert.equal(linked.status, 0, linked.stderr + linked.stdout);+ const joined = cli(branch, 'join', 'web', '--model', 'fixture-worker');+ assert.equal(joined.status, 0, joined.stderr + joined.stdout);+ const joinedDocument = JSON.parse(joined.stdout);+ const added = cli(repo, 'add', 'web', 'shared schema fixture item', '--criterion', 'the branch claim uses the shared board');+ assert.equal(added.status, 0, added.stderr + added.stdout);+ const itemId = JSON.parse(added.stdout).item.item_id;++ const boardFile = join(repo, '.git', 'pullboard', 'board.sqlite');+ /** Observe persistent DDL and ordinary effects through a read-only connection. */+ const footprint = () => {+ const db = new DatabaseSync(boardFile, { readOnly: true });+ try {+ return {+ schemaVersion: db.prepare('PRAGMA user_version').get().user_version,+ schemaCookie: db.prepare('PRAGMA schema_version').get().schema_version,+ itemColumns: db.prepare('PRAGMA table_info(item)').all().map(column => column.name),+ schemaObjects: db.prepare("SELECT type, name, tbl_name, sql FROM sqlite_master WHERE name NOT LIKE 'sqlite_%' ORDER BY type, name").all(),+ triggers: db.prepare("SELECT name, sql FROM sqlite_master WHERE type='trigger' AND name LIKE 'machine%' ORDER BY name").all(),+ item: db.prepare('SELECT item_id, item_status, item_owner FROM item WHERE item_id=?').get(itemId),+ eventCount: db.prepare('SELECT count(*) AS n FROM event').get().n,+ };+ } finally { db.close(); }+ };+ const before = footprint();++ const boardFileInBranch = join(branch, 'src', 'board.js');+ const boardSource = readFileSync(boardFileInBranch, 'utf8');- const migration = " ['item', 'item_after', \"TEXT NOT NULL DEFAULT ''\"],";- assert.ok(boardSource.includes(migration), 'the candidate source contains the stable migration insertion point');++ // The added-column list lives in board-migrate.js (#1047); the versions stay in board.js.++ const migrateFileInBranch = join(branch, 'src', 'board-migrate.js');++ const migrateSource = readFileSync(migrateFileInBranch, 'utf8');++ const migration = " ['item', 'item_after', \"TEXT NOT NULL DEFAULT ''\"],";++ assert.ok(migrateSource.includes(migration), 'the candidate source contains the stable migration insertion point');+ assert.match(boardSource, /export const SCHEMA_VERSION = \d+;/u);+ assert.match(boardSource, /export const EVENT_LOG_VERSION = \d+;/u);- const branchBoardSource = boardSource.replace(migration,- `${migration}\n ['item', 'item_branch_probe', \"TEXT NOT NULL DEFAULT ''\"],`);- assert.notEqual(branchBoardSource, boardSource);- writeFileSync(boardFileInBranch, branchBoardSource);++ const branchBoardSource = migrateSource.replace(migration,++ `${migration}\n ['item', 'item_branch_probe', \"TEXT NOT NULL DEFAULT ''\"],`);++ assert.notEqual(branchBoardSource, migrateSource);++ writeFileSync(migrateFileInBranch, branchBoardSource);++ const machineFileInBranch = join(branch, 'src', 'machine.js');+ const machineSource = readFileSync(machineFileInBranch, 'utf8');+ const triggerBody = "refuse('UNDECLARED_MOVE', `the moves are ${moves.join(', ')}`)";+ const branchTriggerBody = "refuse('UNDECLARED_MOVE', `branch fixture moves are ${moves.join(', ')}`)";+ assert.ok(machineSource.includes(triggerBody), 'the candidate machine source contains the named move-trigger clause');+ writeFileSync(machineFileInBranch, machineSource.replace(triggerBody, branchTriggerBody));+ const commonMain = gitAt(repo, 'rev-parse', '--path-format=absolute', '--git-common-dir');+ const commonBranch = gitAt(branch, 'rev-parse', '--path-format=absolute', '--git-common-dir');+ const dirMain = gitAt(repo, 'rev-parse', '--path-format=absolute', '--git-dir');+ const dirBranch = gitAt(branch, 'rev-parse', '--path-format=absolute', '--git-dir');+ assert.equal(commonMain, commonBranch, 'the real linked worktree shares the main Git common directory');+ assert.notEqual(dirMain, dirBranch, 'the source roots have distinct Git directories');++ const afterJoin = footprint();+ assert.deepEqual({ schemaVersion: afterJoin.schemaVersion, schemaCookie: afterJoin.schemaCookie, itemColumns: afterJoin.itemColumns, schemaObjects: afterJoin.schemaObjects, triggers: afterJoin.triggers },+ { schemaVersion: before.schemaVersion, schemaCookie: before.schemaCookie, itemColumns: before.itemColumns, schemaObjects: before.schemaObjects, triggers: before.triggers },+ 'fixture setup and branch source commit did not alter the native board DDL');++ const read = cli(branch, 'status');+ assert.equal(read.status, 0, read.stderr + read.stdout);+ const readDocument = JSON.parse(read.stdout);+ assert.equal(readDocument.version, 1);+ const afterRead = footprint();+ assert.deepEqual({ schemaVersion: afterRead.schemaVersion, schemaCookie: afterRead.schemaCookie, itemColumns: afterRead.itemColumns, schemaObjects: afterRead.schemaObjects, triggers: afterRead.triggers },+ { schemaVersion: before.schemaVersion, schemaCookie: before.schemaCookie, itemColumns: before.itemColumns, schemaObjects: before.schemaObjects, triggers: before.triggers },+ 'branch read did not install its migration column or trigger SQL');+ assert.equal(afterRead.eventCount, before.eventCount, 'a read changes no shared board events');++ const move = cli(branch, 'claim', String(itemId));+ assert.equal(move.status, 0, move.stderr + move.stdout);+ assert.equal(JSON.parse(move.stdout).id, itemId, 'the ordinary branch move returns its shared item');+ const afterMove = footprint();+ assert.deepEqual({ schemaVersion: afterMove.schemaVersion, schemaCookie: afterMove.schemaCookie, itemColumns: afterMove.itemColumns, schemaObjects: afterMove.schemaObjects, triggers: afterMove.triggers },+ { schemaVersion: before.schemaVersion, schemaCookie: before.schemaCookie, itemColumns: before.itemColumns, schemaObjects: before.schemaObjects, triggers: before.triggers },+ 'normal move preserved main schema and machine triggers');+ assert.equal(afterMove.eventCount, before.eventCount + 1, 'the ordinary claim has a normal shared-board event effect');+ assert.equal(afterMove.item.item_status, 'claimed');+ assert.equal(afterMove.item.item_owner, joinedDocument.agent);++ for (const result of [read, move]) {+ const output = [result.stdout, result.stderr].join('\n');+ assert.equal(output.match(/item_branch_probe/gu)?.length ?? 0, 1,+ 'one diagnostic per invocation names the uninstalled column exactly once');+ assert.equal(output.match(/machine_item_move/gu)?.length ?? 0, 1,+ 'the same diagnostic names the changed machine trigger exactly once');+ }+ }diff --cc test/direct-open-board-regression.jsindex 00000000,a14f0ad0..29989411mode 000000,100644..100644--- a/test/direct-open-board-regression.js+++ b/test/direct-open-board-regression.js@@@ -1,0 -1,171 +1,171 @@@+ /** Exercise the public no-options board opener from branch code on shared and private files [A5,A6,C7]. */+ import assert from 'node:assert/strict';+ import { spawnSync } from 'node:child_process';+ import { cpSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';+ import { tmpdir } from 'node:os';+ import { join, resolve } from 'node:path';+ import { DatabaseSync } from 'node:sqlite';++ /** Run an isolated fixture command and retain its output for precise assertions. */+ function run(command, args, cwd, env) {+ return spawnSync(command, args, { cwd, env, encoding: 'utf8' });+ }++ /**+ * Prove direct openBoard calls distinguish the repository-shared file from a private database.+ * The branch source adds same-version DDL and changes one machine trigger before opening either.+ *+ * @param {{ after: (cleanup: () => void) => void }} t+ * @param {string} sourceRoot+ */+ export function assertDirectOpenBoardIsolation(t, sourceRoot) {+ const directory = mkdtempSync(join(tmpdir(), 'pullboard-direct-open-board-'));+ t.after(() => rmSync(directory, { recursive: true, force: true }));+ const main = join(directory, 'repo');+ const branch = join(directory, 'branch');+ mkdirSync(main);+ for (const name of ['bin', 'src', 'skills', 'package.json', 'CHANGELOG.md']) {+ cpSync(resolve(sourceRoot, name), join(main, name), { recursive: true });+ }+ writeFileSync(join(main, 'pullboard.json'), `${JSON.stringify({+ gate: 'true',+ spec: 'SPEC.md',+ lanes: { web: { owns: ['web/'], specs: [] } },+ shared: [],+ }, null, 2)}\n`);+ writeFileSync(join(main, 'SPEC.md'), '# Direct opener fixture\n\n## G · Goals\n- G1 [approved, must] Keep shared DDL stable. | gate: true\n');+ const env = {+ ...process.env,+ HOME: join(directory, 'home'),+ PULLBOARD_HOME: join(directory, 'pullboard-home'),+ PULLBOARD_MACHINE_HOME: join(directory, 'machine-home'),+ GIT_CONFIG_GLOBAL: '/dev/null',+ GIT_CONFIG_NOSYSTEM: '1',+ GIT_AUTHOR_NAME: 'Direct Opener Fixture',+ GIT_AUTHOR_EMAIL: '[email protected]',+ GIT_COMMITTER_NAME: 'Direct Opener Fixture',+ GIT_COMMITTER_EMAIL: '[email protected]',+ };+ for (const name of Object.keys(env)) {+ if (name.startsWith('GIT_') && !name.startsWith('GIT_CONFIG_')+ && !name.startsWith('GIT_AUTHOR_') && !name.startsWith('GIT_COMMITTER_')) delete env[name];+ }+ /** Require each real private Git operation to succeed. */+ const git = (cwd, ...args) => {+ const result = run('git', args, cwd, env);+ assert.equal(result.status, 0, result.stderr + result.stdout);+ return result.stdout.trim();+ };+ /** Run each checkout source independently under the private environment. */+ const cli = (cwd, ...args) => run(process.execPath, [join(cwd, 'bin/pullboard.js'), ...args, '--json'], cwd, env);++ git(main, 'init', '-q', '-b', 'main');+ git(main, 'add', '-A');+ git(main, 'commit', '-q', '-m', 'chore: initialize direct opener fixture');+ const initialized = cli(main, 'status');+ assert.equal(initialized.status, 0, initialized.stderr + initialized.stdout);+ const linked = run('git', ['worktree', 'add', '-q', '-b', 'schema/drift', branch, 'main'], main, env);+ assert.equal(linked.status, 0, linked.stderr + linked.stdout);++ const joined = cli(branch, 'join', 'web', '--model', 'fixture-worker');+ assert.equal(joined.status, 0, joined.stderr + joined.stdout);+ const { agent } = JSON.parse(joined.stdout);+ const added = cli(main, 'add', 'web', 'direct opener shared move', '--criterion', 'the direct branch opener uses the native board');+ assert.equal(added.status, 0, added.stderr + added.stdout);+ const itemId = JSON.parse(added.stdout).item.item_id;+ const sharedFile = join(main, '.git', 'pullboard', 'board.sqlite');+ const privateFile = join(directory, 'private.sqlite');+- const boardSourcePath = join(branch, 'src', 'board.js');++ const boardSourcePath = join(branch, 'src', 'board-migrate.js');+ const originalBoardSource = readFileSync(boardSourcePath, 'utf8');- const migration = " ['item', 'item_after', \"TEXT NOT NULL DEFAULT ''\"],";++ const migration = " ['item', 'item_after', \"TEXT NOT NULL DEFAULT ''\"],";+ assert.ok(originalBoardSource.includes(migration), 'candidate source contains the stable migration insertion point');+ const driftedBoardSource = originalBoardSource.replace(migration,- `${migration}\n ['item', 'item_branch_probe', \"TEXT NOT NULL DEFAULT ''\"],`);++ `${migration}\n ['item', 'item_branch_probe', \"TEXT NOT NULL DEFAULT ''\"],`);+ assert.notEqual(driftedBoardSource, originalBoardSource);+ writeFileSync(boardSourcePath, driftedBoardSource);+ const machineSourcePath = join(branch, 'src', 'machine.js');+ const originalMachineSource = readFileSync(machineSourcePath, 'utf8');+ const triggerBody = "refuse('UNDECLARED_MOVE', `the moves are ${moves.join(', ')}`)";+ const branchTriggerBody = "refuse('UNDECLARED_MOVE', `branch fixture moves are ${moves.join(', ')}`)";+ assert.ok(originalMachineSource.includes(triggerBody), 'candidate trigger source contains the expected clause');+ writeFileSync(machineSourcePath, originalMachineSource.replace(triggerBody, branchTriggerBody));- git(branch, 'add', 'src/board.js', 'src/machine.js');++ git(branch, 'add', 'src/board-migrate.js', 'src/machine.js');+ git(branch, 'commit', '-q', '-m', 'feat: simulate branch-local schema declarations');++ /** Observe shared DDL and effect evidence without invoking an opener. */+ const footprint = (file, id = null) => {+ const db = new DatabaseSync(file, { readOnly: true });+ try {+ return {+ version: db.prepare('PRAGMA user_version').get().user_version,+ schemaCookie: db.prepare('PRAGMA schema_version').get().schema_version,+ columns: db.prepare('PRAGMA table_info(item)').all().map(row => row.name),+ triggers: db.prepare("SELECT name, sql FROM sqlite_master WHERE type='trigger' AND name LIKE 'machine%' ORDER BY name").all(),+ ...(id === null ? {} : { item: db.prepare('SELECT item_id, item_status, item_owner FROM item WHERE item_id=?').get(id) }),+ events: db.prepare('SELECT count(*) AS n FROM event').get().n,+ };+ } finally { db.close(); }+ };+ const sharedBefore = footprint(sharedFile, itemId);++ // Create a separate normal board from main code. The branch's new migration and trigger must+ // still install here; only the repository-shared path is protected from unmerged declarations.+ const createPrivate = run(process.execPath, ['--input-type=module', '-e', `+ import { openBoard, closeBoard } from './src/board.js';+ const board = openBoard(${JSON.stringify(privateFile)});+ closeBoard(board);+ `], main, env);+ assert.equal(createPrivate.status, 0, createPrivate.stderr + createPrivate.stdout);+ const privateBefore = footprint(privateFile);+ assert.ok(!privateBefore.columns.includes('item_branch_probe'));+ assert.ok(!privateBefore.triggers.find(row => row.name === 'machine_item_move').sql.includes('branch fixture moves'));++ // This is deliberately a direct API caller: no options object and no CLI wrapper supplying+ // isMain. It reads and performs an ordinary claim using the existing main-board schema.+ const directProbe = run(process.execPath, ['--input-type=module', '-e', `+ import { openBoard, closeBoard, getItem, claim } from './src/board.js';+ const board = openBoard(${JSON.stringify(sharedFile)});+ try {+ const before = getItem(board, ${itemId});+ const result = claim(board, ${itemId}, {+ agentId: ${JSON.stringify(agent)}, lane: 'web', leaseMs: 3600000,+ freeze: item => ({ text: item.item_title, digest: 'fixture:' + item.item_title }),+ });+ const after = getItem(board, ${itemId});+ console.log(JSON.stringify({ before: before.item_status, result, after: after.item_status, owner: after.item_owner }));+ } finally { closeBoard(board); }+ `], branch, env);+ assert.equal(directProbe.status, 0, directProbe.stderr + directProbe.stdout);+ const directResult = JSON.parse(directProbe.stdout);+ assert.equal(directResult.before, 'open');+ assert.equal(directResult.after, 'claimed');+ assert.equal(directResult.owner, agent);+ assert.match(directProbe.stderr, /item_branch_probe/u);+ assert.match(directProbe.stderr, /machine_item_move/u);+ assert.equal(directProbe.stderr.match(/item_branch_probe/gu)?.length ?? 0, 1,+ 'one direct open emits one diagnostic naming the uninstalled migration column');+ assert.equal(directProbe.stderr.match(/machine_item_move/gu)?.length ?? 0, 1,+ 'one direct open emits one diagnostic naming the changed trigger');++ const sharedAfter = footprint(sharedFile, itemId);+ assert.equal(sharedAfter.version, sharedBefore.version);+ assert.equal(sharedAfter.schemaCookie, sharedBefore.schemaCookie,+ 'the direct branch read-and-move made no shared schema changes');+ assert.deepEqual(sharedAfter.columns, sharedBefore.columns);+ assert.deepEqual(sharedAfter.triggers, sharedBefore.triggers);+ assert.equal(sharedAfter.events, sharedBefore.events + 1, 'the normal claim still has its shared-board effect');++ const privateProbe = run(process.execPath, ['--input-type=module', '-e', `+ import { openBoard, closeBoard } from './src/board.js';+ const board = openBoard(${JSON.stringify(privateFile)});+ closeBoard(board);+ `], branch, env);+ assert.equal(privateProbe.status, 0, privateProbe.stderr + privateProbe.stdout);+ const privateAfter = footprint(privateFile);+ assert.ok(privateAfter.columns.includes('item_branch_probe'),+ 'a private database still receives the branch migration');+ assert.ok(privateAfter.triggers.find(row => row.name === 'machine_item_move').sql.includes('branch fixture moves'),+ 'a private database still receives the branch machine trigger declaration');+ assert.equal(privateAfter.version, privateBefore.version, 'same-version private migration remains supported');+ }