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
refactor(merge-only): keep proof preparation in its module [V1,V4]
Corey Olsonbf7a792887a8
diff --git a/src/board.js b/src/board.jsindex 6b04f5a9..eca3ba12 100644--- a/src/board.js+++ b/src/board.js@@ -123,10 +123,9 @@ import { recordVerdict } from './verdict-assurance.js';import {mergeOnlyBasis,mergeOnlyProblem,- mergeOnlySourceValid,+ prepareMergeOnlySubmit,} from './merge-only-verdict.js';import { MERGE_ONLY_VERDICT_ENGINE } from './merge-only-verdict-engine.js';-import { deriveMergeOnly } from './merge-only-source.js';import {atomic,logEvent,@@ -1138,14 +1137,7 @@ export function release(board, id, agentId, note = '') {});}-/** Derive the origin’s carry before sealing; caller-supplied carry facts are discarded. */-export function prepareMergeOnlySubmit(board, id, options) {- const item = getItem(board, id);- const basis = options?.gateGreen === true ? mergeOnlyBasis(board, item) : null;- return basis && !retainedVerifierIdentityProblem(board, item, basis.by)- && mergeOnlySourceValid(board.gitRoot, board, item)- ? deriveMergeOnly(board.gitRoot, basis, options) : null;-}+export { prepareMergeOnlySubmit };/*** Submit your claimed item at a commit (V4, V6). The caller has already checked the tree is cleandiff --git a/src/merge-only-verdict.js b/src/merge-only-verdict.jsindex 598362af..ea404e8c 100644--- a/src/merge-only-verdict.js+++ b/src/merge-only-verdict.js@@ -1,11 +1,25 @@/** Immutable acceptance provenance for a narrowly proved trunk merge [V1,V4,H16]. */import { createHash } from 'node:crypto';-import { captureMergeOnly } from './merge-only-source.js';+import {+ captureMergeOnly,+ deriveMergeOnly,+} from './merge-only-source.js';import { Refused } from './refused.js';import { acceptedVerdict } from './verdict-reviews.js';+import { retainedVerifierIdentityProblem } from './item-authors.js';+import { getItem } from './board-query.js';const SHA = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;+/** Derive the origin’s carry before sealing; caller-supplied carry facts are discarded. */+export function prepareMergeOnlySubmit(board, id, options) {+ const item = getItem(board, id);+ const basis = options?.gateGreen === true ? mergeOnlyBasis(board, item) : null;+ return basis && !retainedVerifierIdentityProblem(board, item, basis.by)+ && mergeOnlySourceValid(board.gitRoot, board, item)+ ? deriveMergeOnly(board.gitRoot, basis, options) : null;+}+/** Find only the latest conflict return and the exact unwithdrawn verdict it superseded. */export function mergeOnlyBasis(board, item, { before = Number.MAX_SAFE_INTEGER } = {}) {const last = board.db.prepare("SELECT event_id, event_kind, event_detail FROM event WHERE item_id = ? AND event_id < ? AND event_kind IN ('reopen','accept','reject','refreeze','merge-only-accept') ORDER BY event_id DESC LIMIT 1").get(item.item_id, before);