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): retain local-first device key diagnostics [H17,H21]
Corey Olson3ca1a02d9be8
diff --git a/src/cli-sync.js b/src/cli-sync.jsindex 8a055dbd..c80c742f 100644--- a/src/cli-sync.js+++ b/src/cli-sync.js@@ -1,4 +1,6 @@import { recordedMoveRefusal } from './recorded-move.js';+import { readFileSync } from 'node:fs';+import { readBoardKey } from './relay-key.js';/*** The relay and baseline work around a command: link a new project, sync the relay, deliver finished baselines and* run the person's waiting requests. The command line loads it only when one of them could act [C7].@@ -28,6 +30,7 @@ import {/** Codes a checkout with no board refuses with, which the sync around a command keeps quiet. */const QUIET = ['NOT_A_REPO', 'NO_REPO', 'NO_CONFIG', 'CORE_BARE'];+const KEY_WARNED_COMMANDS = new WeakSet();/** Report a refusal from the work around a command without stopping the command. */async function reportQuietly(io, error) {@@ -48,10 +51,21 @@ function localFirstLink(io) {try {const info = repoInfo(io.cwd);const file = relayLinkFile(info.commonDir);- return localFirstBoard(file, () => relayOutboxSetting(info.root)) ? { root: info.root, file } : null;+ return localFirstBoard(file, () => relayOutboxSetting(info.root)) ? { root: info.root, file, board: JSON.parse(readFileSync(file, 'utf8')).board } : null;} catch { return null; }}+/** Keep the existing device-key repair warning on local reads without acquiring a relay lock or making a request. */+function tellLocalKeyDiagnostic(io, link) {+ if (KEY_WARNED_COMMANDS.has(io)) return;+ try { readBoardKey(link.board); }+ catch (error) {+ if (!(error instanceof Refused) || error.code !== 'RELAY_KEY_MISSING') throw error;+ KEY_WARNED_COMMANDS.add(io);+ io.err(`pullboard: ${error.message}; moves are off until the key is reachable`);+ }+}+/** Say once, loudly, each queued move of this checkout's agent that lost to another machine's move (#1013). */function tellConflicts(io, link) {if (!link) return;@@ -62,6 +76,7 @@ function tellConflicts(io, link) {export async function retrySync(io) {const local = senderInBackground() ? localFirstLink(io) : null;if (local) {+ try { tellLocalKeyDiagnostic(io, local); } catch (error) { await reportQuietly(io, error); }// No sync and no lock: hand the relay's work to the machine's sender, and deliver finished baselines here.nudgeRelaySender(local.root, local.file);try { await retryCheckBaselines(io.cwd, io); } catch (error) { await reportQuietly(io, error); }