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
test(relay): pin each private holder and share the ungranted home [H15]
Corey Olsonbf6707773004
diff --git a/test/person-enrollment-delivery.test.js b/test/person-enrollment-delivery.test.jsindex 5d1e9430..0161f2bf 100644--- a/test/person-enrollment-delivery.test.js+++ b/test/person-enrollment-delivery.test.js@@ -22,7 +22,7 @@ test('a native key holder verifies a pinned person root before delivering each gconst box = await relayClientFixture(t);await box.link();const second = await box.additionalBoard('second granted board');- const third = await box.additionalBoard('linked but ungranted board');+ const third = await box.additionalBoard('linked but ungranted board', { sharedHome: true });const link = JSON.parse(readFileSync(box.linkFile, 'utf8'));const session = await box.phoneSession();const root = await createPersonRoot();@@ -45,8 +45,8 @@ test('a native key holder verifies a pinned person root before delivering each gexpires: Date.now() + 600_000, grants: [link.board, second.id], ...overrides });}/** The fixture supplies only the public pin; initial person/passkey bootstrap belongs to #408. */- async function pin(publicKey) {- const result = await box.script(`+ async function pin(publicKey, holder = box) {+ const result = await holder.script(`const { updateRelayMachine } = await import(${JSON.stringify(new URL('../src/relay-machine.js', import.meta.url).href)});updateRelayMachine(state => { state.personRoots = ${JSON.stringify(publicKey? [{ account: '7', url: box.origin, origin: box.origin, publicKey }] : [])}; });@@ -71,6 +71,7 @@ test('a native key holder verifies a pinned person root before delivering each gconst crossBoard = await call(base + '/' + signed.nonce, { method: 'PUT', machine: true,body: { ...first.wraps[0], board: second.id } });assert.equal(crossBoard.error?.code, 'TOKEN_BOARD', 'machine A cannot consume board B completion');+ await pin(root.publicKey, second);assert.equal((await second.cli('relay', 'status')).code, 0);const complete = await call(base + '/' + signed.nonce);assert.deepEqual(complete.wraps.map(row => row.board).sort(), [link.board, second.id].sort());diff --git a/test/relay-client-fixture.js b/test/relay-client-fixture.jsindex bac7af33..b8212899 100644--- a/test/relay-client-fixture.js+++ b/test/relay-client-fixture.js@@ -765,9 +765,9 @@ globalThis.fetch = function tracedFetch(input, init) {keyFileExists() { return existsSync(otherKeyFile); } };}/** Link another independently initialized synthetic board through the same real person account. */- async function additionalBoard(title) {+ async function additionalBoard(title, { sharedHome = false } = {}) {const nextRoot = mkdtempSync(join(scratch, 'additional-board-'));- const nextHome = mkdtempSync(join(scratch, 'additional-home-'));+ const nextHome = sharedHome ? home : mkdtempSync(join(scratch, 'additional-home-'));const nextEnv = { ...env, HOME: nextHome, PULLBOARD_HOME: join(nextHome, '.pullboard') };/** Run this separate board without retaining credentials in diagnostic output. */const run = (...args) => childResult(nextRoot, nextEnv, [CLI, ...args, '--json']);@@ -779,7 +779,9 @@ globalThis.fetch = function tracedFetch(input, init) {const state = JSON.parse(readFileSync(join(nextRoot, '.git', 'pullboard', 'relay.json'), 'utf8'));const encoded = readFileSync(join(nextEnv.PULLBOARD_HOME, 'relay-keys', state.board + '.key'), 'utf8').trim();privateKeys.add(encoded);- return { id: state.board, encoded, cli: run };+ /** Run native fixture actions in this board's own home; no caller changes the parent process environment. */+ async function script(source) { return childResult(nextRoot, nextEnv, ['--input-type=module', '-e', source]); }+ return { id: state.board, encoded, cli: run, script };}/** Run multiple production commands in one process, emitting only safe counters. */async function script(source) {