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: preserve the supplied relay observation clock [H5,I6,A6]
Corey Olsoneef965f210a9
diff --git a/src/relay-presentation.js b/src/relay-presentation.jsindex a855e17e..24f31db7 100644--- a/src/relay-presentation.js+++ b/src/relay-presentation.js@@ -20,7 +20,7 @@ import { trunkRevisionReader } from './trunk-revision.js';const COMPARISON_CLOCK = Date.UTC(2000, 0, 1);/** Capture spec, doctrine, config and board presentation without sending plaintext to a relay. */-export function relayPresentation(root, { board: providedBoard = null, observedAt = Date.now() } = {}) {+export function relayPresentation(root, { board: providedBoard = null, observedAt = providedBoard ? providedBoard.clock.now().getTime() : Date.now() } = {}) {return withGitReadFacts(() => readRelayPresentation(root, providedBoard, observedAt));}@@ -70,19 +70,19 @@ export function presentationDigest(presentation) {}/** Capture importable native tables beside matching API presentation, retrying a concurrent local move. */-export function relaySnapshot(root, { board: providedBoard = null } = {}) {- return withGitReadFacts(() => readRelaySnapshot(root, providedBoard));+export function relaySnapshot(root, { board: providedBoard = null, observedAt = providedBoard ? providedBoard.clock.now().getTime() : Date.now() } = {}) {+ return withGitReadFacts(() => readRelaySnapshot(root, providedBoard, observedAt));}/** Keep native tables and their device presentation at one observed board revision. */-function readRelaySnapshot(root, providedBoard) {+function readRelaySnapshot(root, providedBoard, observedAt) {const info = repoInfo(root);for (let attempt = 0; attempt < 3; attempt++) {- const before = providedBoard ? null : relayPresentation(info.root);+ const before = providedBoard ? null : relayPresentation(info.root, { observedAt });const board = providedBoard ?? store.openBoard(join(info.commonDir, 'pullboard', 'board.sqlite'), undefined, { isMain: codeIsFromMain() });let native;try { native = exportBoard(board); } finally { if (!providedBoard) store.closeBoard(board); }- const presentation = relayPresentation(info.root, { board: providedBoard });+ const presentation = relayPresentation(info.root, { board: providedBoard, observedAt });const event = native.tables.event.at(-1)?.event_id ?? 0;if (event === (presentation.state.events[0]?.event_id ?? 0) &&(providedBoard || presentationDigest(before) === presentationDigest(presentation))) return { ...native, presentation };diff --git a/test/shared-version.test.js b/test/shared-version.test.jsindex 62e0c103..2940d40f 100644--- a/test/shared-version.test.js+++ b/test/shared-version.test.js@@ -85,7 +85,7 @@ test('relay snapshot guards its native board open even when presentation is alreconst box = fixture(t); const before = box.versions(); box.bump('EVENT_LOG_VERSION', 1, 2);const relay = join(box.lane, 'src/relay-presentation.js');const original = readFileSync(relay, 'utf8');- const supplied = original.replace(/export function relayPresentation\(root, \{ board: providedBoard = null \} = \{\}\) \{[\s\S]*?\n\}/u,+ const supplied = original.replace(/^export function relayPresentation\([^\n]+\) \{[\s\S]*?^\}/mu,'export function relayPresentation() { return {version:1,state:{events:[]}}; }');assert.notEqual(supplied, original, 'supply presentation without replacing the actual snapshot opener');writeFileSync(relay, supplied);