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(publish): read canonical carried verdicts [B3,V1,H16]
Corey Olson30b525e5ee29
diff --git a/src/pr-proof-snapshot.js b/src/pr-proof-snapshot.jsindex 1cccc2a7..7b368673 100644--- a/src/pr-proof-snapshot.js+++ b/src/pr-proof-snapshot.js@@ -23,8 +23,8 @@ export function capturePrProof(board) {WHERE meta_key GLOB 'verdict_assurance:*' OR meta_key GLOB 'outside:*'`).all().map(row => [row.meta_key, row]));const batches = store.landingBatches(board);- // This private reader accepts only the canonical interpreter's already captured queries.- // Never fall through to fresh SQL after releasing the snapshot or cache a public mutable result.+ // This private reader accepts only the canonical interpreter's known queries. Carry lookups+ // keep SQLite's JSON/error semantics inside this snapshot; the reader never escapes RELEASE.const captured = { ...board, db: {/** Supply fresh row lists to the existing receipt and withdrawal semantics. */prepare(sql) {@@ -35,6 +35,10 @@ export function capturePrProof(board) {const kinds = /event_kind = 'reopen'/u.test(query) ? ['reopen'] : ['accept', 'reject'];return { all: id => (events.get(id) ?? []).filter(row => kinds.includes(row.event_kind)) };}+ if (/^SELECT event_detail FROM event(?:_history)? WHERE item_id = \? AND event_kind = 'merge-only-accept' AND json_extract\(event_detail,'\$\.commit'\) = \? ORDER BY event_id DESC LIMIT 1$/u.test(query)+ || /^SELECT 1 FROM event(?:_history)? WHERE item_id = \? AND event_kind = 'merge-only-accept' AND event_id > \? AND event_id < \? AND json_extract\(event_detail,'\$\.commit'\) = \? AND json_extract\(event_detail,'\$\.verdict'\) = \?$/u.test(query)) {+ return board.db.prepare(sql);+ }throw new Refused('PUBLISH_STATE', 'the native receipt reader changed; update Pullboard before publishing');},} };diff --git a/test/merge-only-verdict.test.js b/test/merge-only-verdict.test.jsindex e79ce35a..86087896 100644--- a/test/merge-only-verdict.test.js+++ b/test/merge-only-verdict.test.js@@ -15,6 +15,7 @@ import { exportBoard, importBoard } from '../src/exchange.js';import { prepareEngineMove, applyEngineMove, applyRelayMove } from '../src/engine.js';import { MERGE_ONLY_VERDICT_ENGINE } from '../src/merge-only-verdict-engine.js';import { operationIntent } from '../src/relay-sender.js';+import { capturePrProof } from '../src/pr-proof-snapshot.js';const e2e = createE2eHelpers();after(e2e.cleanup);@@ -120,6 +121,8 @@ test('a merge-only resubmission keeps its accept and records the resolution diffassert.equal(store.getItem(origin, id).item_status, 'verified');assert.deepEqual(withoutObjects, withObjects, 'one canonical move must emit identical events and event IDs without Git objects');assert.deepEqual(exportBoard(objectless), exportBoard(origin), 'replicas must retain exactly identical native state');+ assert.deepEqual(capturePrProof(origin).accepted.get(id), store.acceptedVerdict(origin, store.getItem(origin, id)),+ 'publication retains the canonical carried acceptance within its snapshot');const freshReview = prepareEngineMove(origin, 'verify', [id, { agentId: 'coordinator', decision: 'ACCEPT',note: 'a fresh verdict still requires its own reviewer authority', head,digest: pending.item.item_frozen_digest, check: 'green',@@ -137,6 +140,8 @@ test('a merge-only resubmission keeps its accept and records the resolution diffassert.deepEqual(applyEngineMove(objectless, subsequent, { sequence: 3, at }), next,'a later verdict-ID-bound move must retain the same outcome and event IDs');assert.deepEqual(exportBoard(objectless), exportBoard(origin));+ assert.equal(capturePrProof(origin).accepted.get(id), undefined,+ 'publication cannot revive an original verdict withdrawn after its carry');} finally { store.closeBoard(origin); store.closeBoard(objectless); }for (const key of ['commit', 'tree', 'policyCommit']) {