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
feat: split overlapping landing items [B3,R3,R1,H16]
Corey Olson9df48d23f06b
diff --git a/docs/formats.md b/docs/formats.mdindex 5d3d4970..83fb12e6 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -540,7 +540,7 @@ The engine-68 `recordSpecApprovalBaseline` move carries `{agentId, baseline: {ve## Recorded board line settings-`pullboard settings line --json` reads seven board-owned controller inputs. All default to `false` (off), independently of machine `gate.queue` or `pullboard.json`. `pullboard settings line <name> <on|off|number> --reason "why" --window '{"windowMinutes":60,"activeReviewers":2}'` records a coordinator-owned `setLineSetting` move. The window is a nonempty object of named finite nonnegative numbers, with `null` retaining an unknown measurement. A nonempty reason is required.+`pullboard settings line --json` reads eight board-owned controller inputs. All default to `false` (off), independently of machine `gate.queue` or `pullboard.json`. `pullboard settings line <name> <on|off|number> --reason "why" --window '{"windowMinutes":60,"activeReviewers":2}'` records a coordinator-owned `setLineSetting` move. The window is a nonempty object of named finite nonnegative numbers, with `null` retaining an unknown measurement. A nonempty reason is required.| Setting | Enabled values | Off || --- | --- | --- |@@ -549,11 +549,14 @@ The engine-68 `recordSpecApprovalBaseline` move carries `{agentId, baseline: {ve| `wipPerReviewer` | 1.5 through 3 | `false` || `barReady` | `true` (`on`) | `false` || `takeoverMinutes` | whole minutes 15 through 60 | `false` |+| `collisionFreeBatch` | `true` (`on`) | `false` || `landingBatchSize` | whole numbers 1 through 8 | `false` || `landingCadenceMinutes` | whole minutes 5 through 30 | `false` |`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.+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/engine.js b/src/engine.jsindex c332cfcd..4e65ad57 100644--- a/src/engine.js+++ b/src/engine.js@@ -77,6 +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 { PR_BRIDGE_ENGINE } from './pr-bridge-engine.js';import { LANDING_LOCAL_LEASE_ENGINE } from './landing-local-lease-engine.js';@@ -110,6 +111,7 @@ function minimumOperationEngine(operation, args, board, at) {function minimumExistingOperationEngine(operation, args, board, at) {if (['setBarReady', 'signBar'].includes(operation) || board && ['claim', 'submit', 'editItem', 'addItem', 'refreeze'].includes(operation) && barReadySetting(board).enabled) return BAR_READY_ENGINE;if (operation === 'recordPublishFinding') return PR_BRIDGE_ENGINE;+ if (operation === 'setLineSetting' && args[0]?.key === 'collisionFreeBatch') return LAND_COLLISION_ENGINE;if (operation === 'setLineSetting' && args[0]?.key === 'order') return LINE_ORDER_ENGINE;if (operation === 'recordLandingTestDefect' || operation === 'verify' && args[1]?.environment !== undefined|| operation === 'recordGateRun' && Object.hasOwn(args[0]?.receipt ?? {}, 'environment')diff --git a/src/help.js b/src/help.jsindex c661619d..c829940f 100644--- a/src/help.js+++ b/src/help.js@@ -32,7 +32,7 @@ Set uppullboard resources local resource holders and their FIFO queuespullboard settings line [<name> <value> --reason "why" --window <json>] read or record board controller inputs; all off by defaultvalue is on, off, or a number within the setting range- names: order, reviewsFirst, wipPerReviewer (1.5-3), barReady, takeoverMinutes (15-60), landingBatchSize (1-8), landingCadenceMinutes (5-30)+ names: order, reviewsFirst, wipPerReviewer (1.5-3), barReady, takeoverMinutes (15-60), collisionFreeBatch, landingBatchSize (1-8), landingCadenceMinutes (5-30)pullboard settings [gateSlots <n> | browserSlots <n>] view or set machine capacity (gate default 2; browser default 1)browser-free check slots are opt-in: gate.browserFreeChecks in ~/.pullboard/settings.json (default false)a test file takes a browser slot only if it launches Chrome: gate.browserByLaunch (default false)diff --git a/src/land-collision-engine.js b/src/land-collision-engine.jsnew file mode 100644index 00000000..cd7ae635--- /dev/null+++ b/src/land-collision-engine.js@@ -0,0 +1,3 @@+/** Opt-in collision-free batch selection keeps its replay boundary at landing [R1,H16]. */+import { unassignedEngine } from './engine-next.js';+export const LAND_COLLISION_ENGINE = unassignedEngine();diff --git a/src/land-collisions.js b/src/land-collisions.jsnew file mode 100644index 00000000..8c87cc71--- /dev/null+++ b/src/land-collisions.js@@ -0,0 +1,22 @@+/** Match accepted candidates by their reviewed Git merge changes, never declared brief paths [B3,R3]. */+import { tryGit } from './git.js';+import { Refused } from './refused.js';++/** Preview one reviewed commit against the immutable trunk, including both sides of a rename. */+export function landingChangedFiles(root, base, commit) {+ const merged = tryGit(root, ['merge-tree', '--write-tree', '-z', base, commit]);+ const tree = merged.stdout.split('\0')[0];+ if (![0, 1].includes(merged.status) || !/^[a-f0-9]{40,64}$/u.test(tree)) {+ throw new Refused('LAND_MERGE', 'Git could not read the reviewed landing paths; restore its objects before composing the batch');+ }+ // Name-status starts with an ASCII status, so tryGit's trim cannot alter a leading-space path.+ // The final NUL also preserves trailing path whitespace; no-renames makes old and new paths explicit.+ const diff = tryGit(root, ['diff', '--name-status', '--no-renames', '-z', base, tree]);+ const fields = diff.stdout.split('\0');+ if (fields.at(-1) === '') fields.pop();+ if (diff.status !== 0 || fields.length % 2 || fields.some((value, index) => index % 2 === 0+ ? !/^[ADMTUXB]$/u.test(value) : !value)) {+ throw new Refused('LAND_MERGE', 'Git could not read the reviewed landing paths; restore its objects before composing the batch');+ }+ return fields.filter((_, index) => index % 2 === 1);+}diff --git a/src/land.js b/src/land.jsindex 2332c347..6a9df189 100644--- a/src/land.js+++ b/src/land.js@@ -1,4 +1,5 @@import { requireOutsideOwner } from './outside-source.js';+import { landingChangedFiles } from './land-collisions.js';/** Coordinator landing batches retain exact Git and gate receipts across interruptions [B3,R3]. */import { assignEngineNumbers } from './engine-numbers.js';import {@@ -184,6 +185,8 @@ function candidates(board, root, base, maximum, { firstReady = false } = {}) {pending.sort((left, right) => (order.get(left.item_id) ?? Infinity) - (order.get(right.item_id) ?? Infinity) || left.item_id - right.item_id);const ready = [];const blocked = [];+ const collisionFree = store.lineSettings(board).collisionFreeBatch === true;+ const touched = new Map();const knownReds = store.landingBatches(board).flatMap((batch) => batch.culprits ?? []);for (const original of pending) {const item = { ...original, item_landing_commit: store.checkedLandingCommit(board, original) };@@ -205,6 +208,14 @@ function candidates(board, root, base, maximum, { firstReady = false } = {}) {continue;}if (ready.length < maximum) {+ const files = collisionFree ? landingChangedFiles(root, base, item.item_landing_commit) : [];+ const shared = files.filter(file => touched.has(file));+ if (shared.length) {+ blocked.push({ id: item.item_id, code: 'LAND_FILE_OVERLAP', files: shared,+ with: [...new Set(shared.map(file => touched.get(file)))] });+ continue; // Verdict order is unchanged; this item leads the next eligible batch.+ }+ for (const file of files) touched.set(file, item.item_id);ready.push(item);if (firstReady) break;}diff --git a/src/line-settings.js b/src/line-settings.jsindex b922f79e..966642b2 100644--- a/src/line-settings.js+++ b/src/line-settings.js@@ -8,6 +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 { Refused } from './refused.js';const PREFIX = 'line_setting:';@@ -40,7 +41,7 @@ function windowNumbers(value) {/** Change one board input atomically with its reason and measured window, so ordered replay makes the same event. */export function setLineSetting(board, { agentId, key, value, reason, window } = {}) {if (agentId !== 'coordinator') throw new Refused('COORDINATOR_ONLY', 'ask the coordinator to record a line setting with its reason and window numbers');- const required = key === 'order' ? LINE_ORDER_ENGINE : LINE_SETTINGS_ENGINE;+ const required = key === 'collisionFreeBatch' ? LAND_COLLISION_ENGINE : key === 'order' ? LINE_ORDER_ENGINE : LINE_SETTINGS_ENGINE;if ((board.executionEngineVersion ?? required) < required) throw new Refused('ENGINE_VERSION', 'upgrade Pullboard before recording or replaying board line settings');validateLineSetting(key, value);if (typeof reason !== 'string' || !reason.trim()) throw new Refused('LINE_SETTING_REASON', 'give the reason for this change with --reason "what the measured window shows"');diff --git a/src/queue-settings.js b/src/queue-settings.jsindex 2e2f8e6b..535a8370 100644--- a/src/queue-settings.js+++ b/src/queue-settings.js@@ -93,6 +93,7 @@ export const LINE_SETTING_DEFINITIONS = Object.freeze({wipPerReviewer: Object.freeze({ type: 'number', min: 1.5, max: 3, integer: false }),barReady: Object.freeze({ type: 'boolean' }),takeoverMinutes: Object.freeze({ type: 'number', min: 15, max: 60, integer: true }),+ collisionFreeBatch: Object.freeze({ type: 'boolean' }),landingBatchSize: Object.freeze({ type: 'number', min: 1, max: 8, integer: true }),landingCadenceMinutes: Object.freeze({ type: 'number', min: 5, max: 30, integer: true }),});diff --git a/test/line-settings.test.js b/test/line-settings.test.jsindex 0fb3ca53..8af8e28c 100644--- a/test/line-settings.test.js+++ b/test/line-settings.test.js@@ -8,6 +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';/** A private SQLite board with coordinator and builder identities. */function fixture(t) {@@ -66,7 +67,7 @@ test('the settings inventory exposes board line values and defaults without audi} finally {for (const [key, value] of Object.entries(previous)) { if (value === undefined) delete process.env[key]; else process.env[key] = value; }}- assert.equal(rows.length, 7);+ assert.equal(rows.length, 8);assert.deepEqual(rows.find(row => row.key === 'line.wipPerReviewer'), { key: 'line.wipPerReviewer', scope: 'board',board: store.boardId(board), root: box.repo, value: 2, default: false,source: join(box.repo, '.git', 'pullboard', 'board.sqlite'), origin: 'configured' });@@ -75,3 +76,19 @@ test('the settings inventory exposes board line values and defaults without audiassert.doesNotMatch(JSON.stringify(rows), /PRIVATE_REASON_CANARY|activeReviewers|reviewMedianMinutes/u);assert.equal(store.events(board).length, before, 'inventory is a read, not a line-setting change');});++test('collision-free batch policy stays off until a current authenticated coordinator records it [R1,R2,H16]', t => {+ const board = fixture(t);+ assert.equal(store.lineSettings(board).collisionFreeBatch, false);+ const options = change({ key: 'collisionFreeBatch' });+ const move = prepareEngineMove(board, 'setLineSetting', [options], { id: 'collision-policy', actor: 'coordinator' });+ const envelope = { sequence: 1, at: '2026-10-24T00:00:00Z', kind: 'move',+ sender: { kind: 'agent', agent: 'coordinator', userId: 'fixture' } };+ assert.throws(() => applyRelayMove(board, { ...move, engine: LAND_COLLISION_ENGINE - 1 }, envelope), /RELAY_MOVE/u);+ assert.equal(store.lineSettings(board).collisionFreeBatch, false);+ assert.equal(applyRelayMove(board, move, envelope).error, undefined);+ assert.equal(store.lineSettings(board).collisionFreeBatch, true);+ assert.throws(() => store.setLineSetting(board, change({ key: 'collisionFreeBatch', value: 1 })), /LINE_SETTING_RANGE/u);+ store.setLineSetting(board, change({ key: 'collisionFreeBatch', value: false }));+ assert.equal(store.lineSettings(board).collisionFreeBatch, false);+});