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
test: exercise collision-free landing batches [B3,R3,R1,H16]
Corey Olson93fc49f9de3b
diff --git a/test/land-board-fixture.js b/test/land-board-fixture.jsindex 3ad92f7e..162262df 100644--- a/test/land-board-fixture.js+++ b/test/land-board-fixture.js@@ -1,4 +1,5 @@/** Shared read-only board and gate-call observations for real landing fixtures [B3,R3]. */+import assert from 'node:assert/strict';import { existsSync, readFileSync } from 'node:fs';import { join } from 'node:path';import * as store from '../src/board.js';@@ -17,3 +18,16 @@ export function calls(box) {return existsSync(box.calls) ? readFileSync(box.calls, 'utf8').trim().split('\n').filter(Boolean).map((line) => JSON.parse(line)) : [];}++/** Run a successful JSON command, retaining child context if any actual hook or check refuses. */+export function json(box, cwd, ...args) {+ const result = box.run(cwd, ...args, '--json');+ assert.equal(result.code, 0, `${result.err}\n${result.out}`);+ return JSON.parse(result.out);+}++/** Read the actual first-parent merge sequence at the published tip. */+export function mergeSubjects(box, base, tip) {+ return box.git(box.repo, 'log', '--reverse', '--first-parent', '--format=%s', `${base}..${tip}`).split('\n').filter(Boolean);+}+diff --git a/test/land-collision-fixture.js b/test/land-collision-fixture.jsnew file mode 100644index 00000000..ae7ede64--- /dev/null+++ b/test/land-collision-fixture.js@@ -0,0 +1,42 @@+/** Exercise collision-free batches against real private Git, hooks, board settings and remotes [B3,R3,R1]. */+import assert from 'node:assert/strict';+import { join } from 'node:path';+import { writeFileSync } from 'node:fs';+import * as store from '../src/board.js';++/** Same-path independent edits split only when enabled; a disjoint item still rides the first batch. */+export function assertCollisionFreeLanding({ landProject, itemWorktree, submitItem, acceptItem, json, onBoard }) {+ for (const enabled of [false, true]) {+ const box = landProject();+ const shared = 'web/land-1.test.js';+ writeFileSync(join(box.repo, shared), 'BASE first\nunchanged middle\nBASE last\n');+ box.git(box.repo, 'add', shared);+ box.git(box.repo, 'commit', '-q', '-m', 'test: shared landing base [G1]');+ const entries = [itemWorktree(box, 1, shared), itemWorktree(box, 2, shared), itemWorktree(box, 3)];+ submitItem(box, entries[0], 'A first\nunchanged middle\nBASE last\n');+ submitItem(box, entries[1], 'BASE first\nunchanged middle\nB last\n');+ submitItem(box, entries[2]);+ for (const entry of entries) acceptItem(box, entry);+ if (enabled) onBoard(box, board => store.setLineSetting(board, { agentId: 'coordinator', key: 'collisionFreeBatch', value: true,+ reason: 'private same-path accepted items must land separately', window: { accepted: 3 } }));+ else onBoard(box, board => assert.equal(store.lineSettings(board).collisionFreeBatch ?? false, false));+ const first = json(box, box.repo, 'land', '--max', '3');+ assert.deepEqual(first.landed, (enabled ? [entries[0], entries[2]] : entries).map(entry => entry.item));+ assert.deepEqual(first.conflicts, []);+ assert.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 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, []);+ }+ for (const entry of entries) {+ const item = json(box, box.repo, 'show', String(entry.item));+ assert.equal(item.item_status, 'verified');+ assert.ok(item.item_merged_commit, 'every accepted item lands without reopening');+ }+ assert.equal(box.git(box.repo, 'show', 'main:' + shared), 'A first\nunchanged middle\nB last');+ assert.equal(box.git(box.remote, 'rev-parse', 'main'), box.git(box.repo, 'rev-parse', 'main'), 'the actual gated tip was pushed');+ }+}diff --git a/test/land.test.js b/test/land.test.jsindex 56a6c842..b9450f67 100644--- a/test/land.test.js+++ b/test/land.test.js@@ -13,10 +13,17 @@ import { assertNoRemoteLanding } from './land-no-remote-fixture.js';import { MARKER_NOT_YET, readMarker } from './land-marker-fixture.js';import { assertLandingStopIdentity } from './land-stop-fixture.js';import { assertLandingDoctrineCounts } from './land-doctrine-fixture.js';-import { onBoard, events, calls } from './land-board-fixture.js';+import {+ onBoard,+ events,+ calls,+ json,+ mergeSubjects,+} from './land-board-fixture.js';import { landingTimeoutFixture } from './landing-timeout-fixture.js';import { assertParallelLanding, assertParallelCliLease, assertParallelNestedGate } from './land-parallel-fixture.js';import { landEnginesInOrder } from './land-engine-fixture.js';+import { assertCollisionFreeLanding } from './land-collision-fixture.js';const e2e = createE2eHelpers();after(e2e.cleanup);const { sandbox, project, commitFile, waitFor, BIN } = e2e;@@ -445,18 +452,6 @@ function launchHookProbe(box, probe, marker) {return child;}-/** Run a successful JSON command, retaining child context if any actual hook or check refuses. */-function json(box, cwd, ...args) {- const result = box.run(cwd, ...args, '--json');- assert.equal(result.code, 0, `${result.err}\n${result.out}`);- return JSON.parse(result.out);-}--/** Read the actual first-parent merge sequence at the published tip. */-function mergeSubjects(box, base, tip) {- return box.git(box.repo, 'log', '--reverse', '--first-parent', '--format=%s', `${base}..${tip}`).split('\n').filter(Boolean);-}-test('land pushes one exact batch in verdict order and records each first-containing merge once [B3,R3]', () => {const box = landProject();const entries = verifiedFour(box, { order: [3, 1, 0, 2] });@@ -1498,3 +1493,6 @@ test('parallel landing refuses a live inherited gate before scheduling [B3,V4,Q1test('the landing merge assigns engine numbers in landing order, either order, and the board replays [B3,R3,H16]', () => {for (const order of [[0, 1], [1, 0]]) landEnginesInOrder({ landProject, itemWorktree, submitItem, acceptItem, json, onBoard }, order);});++test('a landing batch leaves out an item that touches a file already in the batch [B3,R3,R1,H16]',+() => assertCollisionFreeLanding({ landProject, itemWorktree, submitItem, acceptItem, json, onBoard }));