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: retain fresh review for deferred landing items [B3,R3,R1,H16]
Corey Olsona2b74892f58e
diff --git a/docs/formats.md b/docs/formats.mdindex 83fb12e6..550f587a 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -555,7 +555,7 @@ The engine-68 `recordSpecApprovalBaseline` move carries `{agentId, baseline: {ve`order` opts into next ordering: a builder’s own send-back, scarce review eligibility, release, downstream demand, signed-bar readiness, then coordinator rank. The readiness tier stays inert until the signed-readiness predicate is available (#1110); it never guesses a sign-off from prose. The other inputs retain their separate meanings; `reviewsFirst` selects review versus build and does not turn ordering on. Takeover and landing behavior are separate changes. The move carries `{agentId,key,value,reason,window}`; its native `line_setting` event carries `{key,value,reason,window}` with the board's actor and time outside that detail. Latest values live under `board_meta` keys `line_setting:<name>`, and ordered engine replay updates them and appends the same evidence. The unassigned `LINE_SETTINGS_ENGINE` leaf receives its permanent number at landing. Older engine records cannot request this new operation. Range, unknown-key, missing-reason and invalid-window refusals have named codes. The existing settings API reports each input as `scope: "board"`, key `line.<name>`, with off as its default and the board SQLite file as its source; it does not expose reason text or evidence payloads through that inventory.-With `collisionFreeBatch` on, landing selection previews each reviewed commit against the immutable trunk and reads the resulting Git changed paths, including both rename paths. Overlapping later verdicts wait without reopening; disjoint items still join the current batch. Deferred items retain verdict order for the next batch. The default off path keeps existing composition. The control has its own replay-engine boundary; it does not infer paths from briefs.+With `collisionFreeBatch` on, landing selection previews each reviewed commit against the immutable trunk and reads the resulting Git changed paths, including both rename paths. Overlapping later verdicts wait without reopening; disjoint items still join the current batch. Deferred items retain verdict order for the next batch. Once the first batch lands, each deferred item receives one item-addressed reviewer notice in the same atomic landed transition. Existing verdict freshness is unchanged: if main touched the deferred review, its reviewer merges the new trunk and records a merge-only re-accept without a builder cycle or reopening. The default off path keeps existing composition. The control has its own replay-engine boundary; it does not infer paths from briefs.Landing queue grants, first queue entries and releases are shared ordered transitions. New landing-local-heartbeat engine moves leave renewal and repeated-poll events out of history; old engine receipts keep their recorded meaning. `local:landing-lease:<token>` board metadata binds a physical board id, token/generation, process, branch and coordinator lineage to its local deadline. It is excluded from exports, imports and semantic digests and is retained only on the receiving physical board during a same-board relay snapshot restore. A linked foreign holder has no clock-based expiry: release or coordinator takeover fences it; local heartbeat deadlines never authorize another machine to merge.diff --git a/src/board.js b/src/board.jsindex b1272a9f..700f2c42 100644--- a/src/board.js+++ b/src/board.js@@ -1,3 +1,4 @@+import { LAND_COLLISION_ENGINE } from './landing-collision-engine.js';import {lineOrderEnabled,lineBuildOrder,@@ -2464,10 +2465,25 @@ export function finishLandingBatch(board, { agentId, id, tip, landingFence }) {if (!item.item_merged_commit) merged(board, entry.id, { agentId, commit: entry.merge });}logEvent(board, agentId, 'main-moved', null, { sha: tip, batch: id, items: batch.items.map((entry) => entry.id) });+ tellDeferredLandingReviews(board, batch);return recordLandingBatch(board, { agentId, batch: { ...batch, state: 'landed' }, revision: batch.revision, landingFence });});}+/** Notify each deferred item's current audience once, in the landed transition's transaction. */+function tellDeferredLandingReviews(board, batch) {+ if ((board.executionEngineVersion ?? ENGINE_VERSION) < LAND_COLLISION_ENGINE) return;+ for (const deferred of batch.blocked ?? []) {+ if (deferred.code !== 'LAND_FILE_OVERLAP') continue;+ const item = board.db.prepare('SELECT * FROM item WHERE item_id=?').get(deferred.id);+ if (!item || item.item_status !== 'verified' || item.item_merged_commit) continue;+ const reviewer = item.item_review_by ?? item.item_verified_by ?? 'coordinator';+ persistShout(board, { from: 'landing', to: `item:${item.item_id}`,+ text: `#${item.item_id} waited for overlapping files while batch ${batch.id} landed at ${batch.tip}. ${reviewer}: merge current main into the reviewed commit and record a fresh merge-only re-accept before the next batch; no builder cycle or reopening is needed.`,+ detail: { item: item.item_id, batch: batch.id, files: deferred.files, reviewer } });+ }+}+/** File or refresh an outside source through the ordinary ordered engine. */export function intakeOutside(board, options) { return applyOutsideIntake(board, options, { atomic, addItem, moveItem, validateItemAddition }); }diff --git a/src/engine.js b/src/engine.jsindex 4e65ad57..b74040b6 100644--- a/src/engine.js+++ b/src/engine.js@@ -77,7 +77,7 @@ import { carriesLandingEnvironment } from './execution-environment.js';import { LANDING_LEASE_ENGINE } from './landing-lease-engine.js';import { LINE_ORDER_ENGINE } from './line-order-engine.js';import { LINE_SETTINGS_ENGINE } from './line-settings-engine.js';-import { LAND_COLLISION_ENGINE } from './land-collision-engine.js';+import { LAND_COLLISION_ENGINE } from './landing-collision-engine.js';import { PR_BRIDGE_ENGINE } from './pr-bridge-engine.js';import { LANDING_LOCAL_LEASE_ENGINE } from './landing-local-lease-engine.js';diff --git a/src/land.js b/src/land.jsindex 6a9df189..f45279eb 100644--- a/src/land.js+++ b/src/land.js@@ -1312,7 +1312,9 @@ export async function runLandingBatch({ root, board, config, write, say, owner,}const build = await mergeGroup(state, initialItems);await save(state, { ...build, conflicts: [...state.batch.conflicts, ...build.conflicts] });- for (const entry of state.batch.blocked ?? []) say(`${entry.code} #${entry.id}${entry.stacked ? ` carries #${entry.stacked}` : ''}`);+ for (const entry of state.batch.blocked ?? []) say(entry.code === 'LAND_FILE_OVERLAP'+ ? `#${entry.id} waits on overlapping files ${entry.files.join(', ')}; once this batch lands, its reviewer must merge current main and re-accept it without reopening`+ : `${entry.code} #${entry.id}${entry.stacked ? ` carries #${entry.stacked}` : ''}`);if (!build.items.length) await save(state, { state: 'blocked' });else if (landsOnTrunk(state.config)) await landOnTrunk(state);else if (!await inlineDeferredGuards(state)) await save(state, { state: 'blocked' });diff --git a/src/land-collision-engine.js b/src/landing-collision-engine.jssimilarity index 100%rename from src/land-collision-engine.jsrename to src/landing-collision-engine.jsdiff --git a/src/line-settings.js b/src/line-settings.jsindex 966642b2..dda06cb6 100644--- a/src/line-settings.js+++ b/src/line-settings.js@@ -8,7 +8,7 @@ import {} from './queue-settings.js';import { LINE_ORDER_ENGINE } from './line-order-engine.js';import { LINE_SETTINGS_ENGINE } from './line-settings-engine.js';-import { LAND_COLLISION_ENGINE } from './land-collision-engine.js';+import { LAND_COLLISION_ENGINE } from './landing-collision-engine.js';import { Refused } from './refused.js';const PREFIX = 'line_setting:';diff --git a/test/land-collision-fixture.js b/test/land-collision-fixture.jsindex ce34a402..7a60323c 100644--- a/test/land-collision-fixture.js+++ b/test/land-collision-fixture.js@@ -28,10 +28,23 @@ export function assertCollisionFreeLanding({ landProject, itemWorktree, submitItassert.deepEqual(first.culprits, []);if (enabled) {assert.equal(json(box, box.repo, 'show', String(entries[1].item)).item_status, 'verified', 'deferred overlap keeps its verdict');+ const notices = json(box, box.repo, 'inbox').shouts.filter(row => row.shout_from === 'landing' && row.shout_to === `item:${entries[1].item}`);+ assert.equal(notices.length, 1, 'the deferred item and its reviewer receive one landed-batch notice');+ assert.match(notices[0].shout_text, /fresh merge-only re-accept.*no builder cycle or reopening/u);+ // A stale same-path review is never exempted: the independent private coordinator composes+ // and re-accepts the new trunk, without changing the submitted commit or asking its builder.+ const retainedCommit = json(box, box.repo, 'show', String(entries[1].item)).item_commit;+ box.git(box.repo, 'switch', '-q', '--detach', entries[1].commit);+ box.git(box.repo, 'merge', '--no-edit', 'main');+ const reviewed = { ...entries[1], commit: box.git(box.repo, 'rev-parse', 'HEAD') };+ box.git(box.repo, 'switch', '-q', 'main');+ acceptItem(box, reviewed);+ assert.equal(json(box, box.repo, 'show', String(entries[1].item)).item_commit, retainedCommit, 'merge-only review preserves the builder submission');const second = json(box, box.repo, 'land', '--max', '3');assert.deepEqual(second.landed, [entries[1].item], 'the deferred item leads the next batch');assert.deepEqual(second.conflicts, []);assert.deepEqual(second.culprits, []);+ onBoard(box, board => assert.equal(store.allShouts(board).filter(row => row.shout_from === 'landing' && row.shout_to === `item:${entries[1].item}`).length, 1, 'later landing does not repeat the notice'));}for (const entry of entries) {const item = json(box, box.repo, 'show', String(entry.item));diff --git a/test/line-settings.test.js b/test/line-settings.test.jsindex 8af8e28c..5b52454e 100644--- a/test/line-settings.test.js+++ b/test/line-settings.test.js@@ -8,7 +8,7 @@ import * as store from '../src/board.js';import { applyRelayMove, prepareEngineMove } from '../src/engine.js';import { settingsInventory } from '../src/settings-inventory.js';import { createE2eHelpers } from './e2e-helpers.js';-import { LAND_COLLISION_ENGINE } from '../src/land-collision-engine.js';+import { LAND_COLLISION_ENGINE } from '../src/landing-collision-engine.js';/** A private SQLite board with coordinator and builder identities. */function fixture(t) {