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(core): join signed members without coordinator elevation [E17,E19]
Corey Olson13ea57059cb4
diff --git a/docs/api.md b/docs/api.mdindex 0a1a63b4..7b6400a2 100644--- a/docs/api.md+++ b/docs/api.md@@ -334,6 +334,10 @@ With `"relay": { "outbox": true }` in the committed `pullboard.json` (off by def`relay on --all [--url <address>]` returns `{version, linked: [{project, root, board}], failed: [{project, root, reason}], paired, autoLink: true}`. Its status is nonzero when a project failed; successful links remain available. With no paired phone, the command prints one tappable pairing link and QR, then waits in the foreground up to ten minutes. Interruption or expiration leaves completed links intact and exits zero when no link failed. Every explicit invocation signs in afresh; no person session is retained on the Mac. Later project registrations publish one sealed phone-link proposal and keep working locally until its single approval tap. `doctor` and `resume` name the waiting project and its expiry; expiration requires an explicit fresh sign-in rather than silently asking again. `relay off` excludes that project from automatic linking; explicit `relay on` clears the exclusion.+`pullboard relay members <login> [<login> ...]` publishes the next signed member-list revision for the linked board; `pullboard relay members clear` publishes an empty list. It is a person-only command and requires this computer to be linked. The signed list must be prepared by a committed approver using an SSH key currently on that approver's GitHub account. The command returns `{version, board, revision, members}`. Committed `pullboard.json` approvers remain trusted independently of the list. For other logins, device-key handover accepts a member only when the signed list names the same board and repository, its signer is a committed approver, and GitHub still verifies that signer's SSH key. A relay login by itself does not grant membership.++The board module exports `readBoardMembers(board)` and `setBoardMembers(board, {agentId, document})`. The reader returns `null` before a list is stored, or its exact `{body: {v, board, repository, revision, members}, by, signature}` document. The setter stores the next revision through the coordinator actor and refuses a mismatched board, unsupported engine, or skipped revision; it accepts an exact repeat idempotently. These are board-store APIs. The relay command prepares and verifies the SSH-signed document before passing it to the ordered setter.+`relay devices` returns `{version, devices: [{deviceId, pairedHere, label, createdAt, seen, revoked, boards}], computers: [{machine, host, created, seen, boards}]}` without a private key or credential. `devices` are the phones that read this computer's linked boards; `computers` are the other computers that joined one of them with `relay join`. Only the computer that paired a phone keeps its `label` and `createdAt`; a phone paired on another computer has `pairedHere: false`, null `label` and `createdAt`, and prints as paired on another computer with the end of its id. `seen` is the last relay contact in epoch milliseconds, or null when unknown, `revoked` is the relay's revocation status, and `boards` names the linked boards each one can read. The text output names each one with its paired date, last seen and boards. `--verbose` adds ids in the text and, for phones paired here, the key `fingerprint` in both text and JSON. `relay revoke <deviceId>` returns `{version, deviceId, revoked: true, notice}` after removing the local recipient and deleting its remote wraps. Native revocation never asks the target device to approve its own removal. Another paired phone can approve it with a short-lived, single-use, RAM-only grant for that exact target. With no other paired approver or no linked publishing board, the person completes a fresh GitHub device-code sign-in on the computer instead. The authenticated account and relay origin must match the saved enrollment; the fresh session stays in memory and is revoked after the action. Agent terminals are refused before any sign-in or network request. A failed or interrupted approval or sign-in needs an explicit retry. Revocation stops future wrapping and refuses the removed browser’s enrolled session with `DEVICE_REVOKED` (HTTP 403), including snapshot/event reads and auth-session, board-list and token-list reads. That same principal boundary refuses its machine or agent credential issuance, so the removed session cannot mint another reader. The public board-free shell still loads to clear local browser data; it grants no person actions. Its next connected page clears the locally held board keys, private device key and board request cache and shows that it was removed; reload retains the refusal. The relay stores only public session ids tied to the enrollment, never an extra bearer credential. A fresh GitHub sign-in remains eligible for recovery; it does not resurrect the revoked device. An offline copy cannot be remotely erased and board key rotation remains separate (#346).Phone enrollment uses a one-use `#device=<locator>.<secret>` fragment, removed before sign-in. The secret remains on the phone and Mac. Person-authenticated `/api/v1/devices/session` returns the current account id. `/api/v1/devices/enrollments/:locator` supports POST `{}` to start a ten-minute locator, PUT of the exact public enrollment and MAC, GET of `{version, enrollment}` and DELETE to consume it. A native Mac checks the MAC locally before retaining any recipient. `/api/v1/devices/:deviceId` supports POST `{}` to record an authenticated recipient and DELETE to revoke it. PUT `/api/v1/devices/:deviceId/boards/:boardId` stores `{engine, wrapped}`; GET `/api/v1/devices/:deviceId/boards` returns `{version, wraps: [{board, engine, wrapped}]}` filtered by current board access. `wrapped` is opaque base64url client ciphertext. Enrollment, device listing and direct revocation require a person session. A board-scoped machine credential can PUT only its own board wrap to an already enrolled device. Cookie writes require the exact configured Origin, and all responses are no-store. Device ids and grants belong to the authenticated GitHub account. Revoked ids cannot be registered or uploaded again.diff --git a/src/relay-join.js b/src/relay-join.jsindex 7610bb18..00d84ac1 100644--- a/src/relay-join.js+++ b/src/relay-join.js@@ -22,6 +22,7 @@ import { relayRelink } from './relay-relink.js';import { updateRelayMachine } from './relay-machine.js';import { listApiProjects } from './projects.js';import { Refused } from './refused.js';+import { mainPolicy } from './trusted-policy.js';import {localRecords,relayPersonCoordinator,@@ -76,7 +77,11 @@ export async function joinNamedBoard(root, file, { board, url, repository, signIif (stored) { try { forgetBoardKey(board, stored); } catch { /* The original refusal is the useful next step. */ } }throw error;}- await relayPersonCoordinator(root, signed.token, io);+ const approvers = mainPolicy(root).config.approvers;+ // Membership admits an ordinary developer; it does not confer the board person’s coordinator authority.+ if (!Array.isArray(approvers) || !approvers.length || approvers.some(approver => approver.toLowerCase() === String(login).toLowerCase())) {+ await relayPersonCoordinator(root, signed.token, io);+ }await syncRelay(root, io);const name = listApiProjects().find(project => project.root === repoInfo(root).root)?.name ?? repository;const result = { ...relayStatus(root), notice: `Joined ${name}: this clone works on board ${board.slice(0, 8)}, the one pullboard.json names.` };diff --git a/test/team.test.js b/test/team.test.jsindex b01a3d62..16f5905e 100644--- a/test/team.test.js+++ b/test/team.test.js@@ -675,6 +675,7 @@ function memberDevice(t, box, name) {runFixtureGit(['remote', 'set-url', 'origin', '[email protected]:fixture/repository.git'], { cwd: root, env: box.env });const env = { ...box.env, HOME: home, PULLBOARD_HOME: join(home, '.pullboard'), PULLBOARD_MACHINE_HOME: join(home, 'machine') };delete env.PULLBOARD_MODEL;+ delete env.PULLBOARD_SSH_KEY; // A separate computer cannot inherit Alice’s private signing-key path.const device = { root, env, home, cli: (...args) => relayFixtureChild(root, env, [CLI, ...args, '--json']) };/** Generate this device's SSH key, as ssh-keygen -t ed25519 does, and return its public line. */device.sshKey = () => {@@ -778,11 +779,18 @@ test('a clone of a linked repo joins its board; a member device hands over the kassert.equal(box.auth.linkedBoards().length, 1, 'joining never links another board');const listed = await fresh.cli('list', '--all');assert.ok(listed.document.items.some((item) => (item.title ?? item.item_title) === 'Health endpoint'), 'the joined clone reads the team board');- assert.equal((await fresh.cli('takeover')).code, 0, 'bob’s main checkout takes the one coordinator [E19]');- const freshAdd = await fresh.cli('add', box.lane, 'From bob’s new computer');+ const bobLink = JSON.parse(readFileSync(join(fresh.root, '.git', 'pullboard', 'relay.json'), 'utf8'));+ assert.equal(bobLink.agentTokens?.coordinator, undefined, 'list membership does not create person coordinator authority');+ const coordinatorPath = withBoard(box.root, board => store.listAgents(board).find(agent => agent.agent_id === 'coordinator').agent_path);+ const bobWork = fresh.root + '-lane';+ runFixtureGit(['worktree', 'add', '--detach', bobWork, 'HEAD'], { cwd: fresh.root, env: fresh.env });+ const bobCli = (...args) => relayFixtureChild(bobWork, fresh.env, [CLI, ...args, '--json']);+ const bobJoined = await bobCli('join', box.lane, '--model', 'Fixture Model');+ assert.equal(bobJoined.code, 0, `the member registers an ordinary lane seat: ${JSON.stringify(bobJoined.document?.error ?? null)}`);+ const freshAdd = await bobCli('add', box.lane, 'From bob’s new computer');assert.equal(freshAdd.code, 0, `the joined clone moves on the team board: ${JSON.stringify(freshAdd.document?.error ?? null)}`);- assert.equal((await box.cli('takeover')).code, 0, 'alice’s main checkout takes the coordinator back');assert.ok((await box.cli('export')).document.tables.item.some((item) => item.item_title === 'From bob’s new computer'), 'one board, one order: alice reads bob’s move');+ assert.equal(withBoard(box.root, board => store.listAgents(board).find(agent => agent.agent_id === 'coordinator').agent_path), coordinatorPath, 'the ordinary member leaves Alice’s coordinator holder unchanged');});test('a relink turns the old link off with its receipt, so a repository keeps one active board [E12]', { timeout: 120_000 }, async (t) => { // budget: hang ceiling for real relay calls; not a speed target.