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(merge): reprove inherited carry ancestry [V4,H16]
Corey Olson51ed1904ab2d
diff --git a/src/board.js b/src/board.jsindex 7419afea..128ee7d5 100644--- a/src/board.js+++ b/src/board.js@@ -118,6 +118,7 @@ import { recordVerdict } from './verdict-assurance.js';import {mergeOnlyBasis,mergeOnlyProblem,+ mergeOnlyLandingProblem,} from './merge-only-verdict.js';import { MERGE_ONLY_VERDICT_ENGINE } from './merge-only-verdict-engine.js';import { deriveMergeOnly } from './merge-only-source.js';@@ -1127,6 +1128,7 @@ export function prepareMergeOnlySubmit(board, id, options) {const item = getItem(board, id);const basis = options?.gateGreen === true ? mergeOnlyBasis(board, item) : null;return basis && !itemAuthorProblem(board, item, basis.by)+ && !mergeOnlyLandingProblem(board.gitRoot, board, item)? deriveMergeOnly(board.gitRoot, basis, options) : null;}diff --git a/src/merge-only-source.js b/src/merge-only-source.jsindex f8ccdfc9..1f666349 100644--- a/src/merge-only-source.js+++ b/src/merge-only-source.js@@ -45,9 +45,8 @@ function conflictEditsOnly(source, patch, accepted, trunk) {}/** Return a replayable source receipt, or null so an uncertain/changed build gets normal review. */-export function captureMergeOnly(root, basis, { commit, tree, trunk }) {+export function captureMergeOnly(root, basis, { commit, tree, trunk, deadline = Date.now() + 10000 }) {if (!basis) return null;- const deadline = Date.now() + 10000;/** Share one total deadline across this bounded set of immutable object reads. */const read = (args, statuses = [0]) => readGit(root, args, statuses, deadline);try {diff --git a/src/merge-only-verdict.js b/src/merge-only-verdict.jsindex 2e6f7283..bbee7798 100644--- a/src/merge-only-verdict.js+++ b/src/merge-only-verdict.js@@ -39,15 +39,22 @@ export function mergeOnlyProblem(board, item, proof, { commit, tree, policyCommi}/** Re-prove a canonical carry against immutable Git before physical landing, including adoption. */-export function mergeOnlyLandingProblem(root, board, item) {+export function mergeOnlyLandingProblem(root, board, item, { seen = new Set(), deadline = Date.now() + 10000 } = {}) {const accepted = acceptedVerdict(board, item);if (!accepted?.carried) return null;const proof = accepted.carried;+ if (seen.has(item.item_commit) || seen.size >= 32 || Date.now() >= deadline) {+ return new Refused('STALE_VERDICT', `item #${item.item_id}: the retained acceptance chain cannot be proved within its Git budget; obtain an ordinary outside review`);+ }+ seen.add(item.item_commit);+ const inherited = mergeOnlyLandingProblem(root, board, { ...item, item_commit: proof.acceptedCommit,+ item_tree: proof.acceptedTree, item_merged_commit: null }, { seen, deadline });+ if (inherited) return inherited;const event = board.db.prepare("SELECT event_id FROM event WHERE item_id = ? AND event_kind = 'merge-only-accept' AND json_extract(event_detail,'$.commit') = ? ORDER BY event_id DESC LIMIT 1").get(item.item_id, item.item_commit);const basis = event && mergeOnlyBasis(board, { ...item, item_commit: proof.acceptedCommit }, { before: event.event_id });const actual = basis && basis.by === proof.by && proof.digest === item.item_frozen_digest- ? captureMergeOnly(root, basis, { commit: item.item_commit, tree: item.item_tree, trunk: proof.trunk }) : null;+ ? captureMergeOnly(root, basis, { commit: item.item_commit, tree: item.item_tree, trunk: proof.trunk, deadline }) : null;return actual && Object.entries(actual).every(([key, value]) => JSON.stringify(value) === JSON.stringify(proof[key]))? null : new Refused('STALE_VERDICT', `item #${item.item_id}: the recorded merge-only acceptance does not match real Git heads, trees and resolution diff; obtain an ordinary outside review before landing`);}