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(relay): relink skips a retired board the relay lost [E12,H17]
Corey Olsonfa68c5f1e630
diff --git a/src/relay-relink.js b/src/relay-relink.jsindex 2b237d37..1a56a2e5 100644--- a/src/relay-relink.js+++ b/src/relay-relink.js@@ -91,3 +91,15 @@ export function relinkReplacement(state, relink, deletedBoard) {}return previous;}++/**+ * Link, naming the board this relink retires; a board the relay no longer has active (deleted from the+ * phone, or already replaced) has nothing to retire, so link once more without it. The relay still+ * refuses BOARD_REPO_LINKED when the repository has another active board, so it keeps one team board [E12,H17].+ */+export async function linkReplacing(link, replaces) {+ try { return await link(replaces); } catch (error) {+ if (!replaces || error?.code !== 'BOARD_REPLACE') throw error;+ return link(null);+ }+}diff --git a/src/relay.js b/src/relay.jsindex 8ec22a97..8eea1144 100644--- a/src/relay.js+++ b/src/relay.js@@ -1615,7 +1615,7 @@ export async function relayOn(root, address, io, { session, credential, quiet =if (state.linkPending) {if (signed.linkConfirmed && signed.linkedBoard !== state.board) throw new Refused('RELAY_RESPONSE', 'the relay confirmed a different board; sign in again');// Another board is the repository's: forget this never-linked intent so relay on can join it [E12].- if (!reusableCredential && !signed.linkConfirmed) await request({ ...state, token: signed.token }, '/auth/boards/link', { method: 'POST', body: { board: state.board, repository, ...(state.replaces ? { replaces: state.replaces } : {}) } }, io)+ if (!reusableCredential && !signed.linkConfirmed) await (await import('./relay-relink.js')).linkReplacing((replaces) => request({ ...state, token: signed.token }, '/auth/boards/link', { method: 'POST', body: { board: state.board, repository, ...(replaces ? { replaces } : {}) } }, io), state.replaces).catch((error) => { if (error.code === 'BOARD_REPO_LINKED') restoreConfig(() => { rmSync(file, { force: true }); forgetBoardKey(state.board, state.keyStorage); }); throw error; });delete state.linkPending; delete state.replaces;saveLink(file, state);