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(relay): preserve reads and explicit key relinking [H15,B26]

Corey Olson0383afbdce8e
diff --git a/src/cli.js b/src/cli.js
index ffd68026..e9c51ddd 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -2806,7 +2806,8 @@ async function runMain(argv, streams) {
if (parsed) {
try {
const [command, verb] = parsed.positionals;
- if (parsed.values.as === 'person' || command === 'relay' && ['on', 'join', 'revoke'].includes(verb)) requirePersonChannel(io.personChannel);
+ if (!parsed.values.help && !parsed.values.version &&
+ (parsed.values.as === 'person' && command !== 'decisions' || command === 'relay' && ['on', 'join', 'revoke'].includes(verb))) requirePersonChannel(io.personChannel);
checkoutSession = await bindCheckoutSession(io, parsed.positionals, parsed.values);
if (checkoutSession?.lease) CHECKOUT_LEASES.set(io, checkoutSession.lease);
} catch (error) {
diff --git a/test/relay-key-file.test.js b/test/relay-key-file.test.js
index 466a1de4..9df72a36 100644
--- a/test/relay-key-file.test.js
+++ b/test/relay-key-file.test.js
@@ -5,6 +5,7 @@ import { chmodSync, existsSync, readFileSync, rmSync, statSync, writeFileSync }
import { join } from 'node:path';
import { test } from 'node:test';
import { relayClientFixture } from './relay-client-fixture.js';
+import { ENGINE_VERSION } from '../src/machine.js';
/** Install an isolated `security` command without consulting the host keychain. */
function securityStandIn(box) {
@@ -106,6 +107,11 @@ test('owner-only key file links and reads with a locked keychain, migrates once,
assert.equal((await box.cli('relay', 'off')).code, 0,
'unlink uses the migrated file even when legacy metadata still says keychain');
assert.equal(existsSync(box.keyFile), false, 'unlink forgets the migrated owner-only file');
+ const phone = await box.phoneSession();
+ const deleted = await fetch(box.origin + '/api/v1/boards/' + legacyLink.board, {
+ method: 'DELETE', headers: { authorization: 'Bearer ' + phone.token, 'x-pullboard-engine': String(ENGINE_VERSION) },
+ });
+ assert.equal(deleted.status, 200, 'the phone explicitly removes the old relay copy before linking with a new key');
assert.equal((await box.cli('relay', 'on', '--url', box.origin)).code, 0,
'the board can link again while the keychain remains locked');