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(core): retain causal controls for parallel landing [B3,V4]
Corey Olson87ca253da21c
diff --git a/src/land.js b/src/land.jsindex 5d9df3e1..797c3249 100644--- a/src/land.js+++ b/src/land.js@@ -558,6 +558,15 @@ function withoutParallelBlocker(state, entries, removed) {});}+/** Trust a recorded positive main comparison only for every exact failing target of this gate. */+function parallelGreenBase(state, gate) {+ const ids = new Set((gate.flakeDiagnostics?.observations ?? []).filter(row => row.recorded).map(row => row.id));+ const observations = store.flakeLedger(state.board).flatMap(row => row.observations).filter(row => ids.has(row.id));+ return gate.failures.length > 0 && gate.failures.every(failure => observations.some(observation => observation.file === failure.file+ && observation.name === failure.name && observation.main === state.batch.base+ && observation.classification === 'possible-regression' && observation.mainReceipt?.green === true));+}+/** Test prefixes together, remove only diagnosed blockers, and publish one exact green composition. */async function parallelLanding(state, initialItems) {let remaining = initialItems;@@ -606,6 +615,21 @@ async function parallelLanding(state, initialItems) {const flakyFiles = await diagnose(state, gate.failures, gate);if (flakyFiles.length) { await fileFlakes(state, gate, flakyFiles); state.flaky = true; return; }const culprit = remaining[green + 1];+ const greenBase = green >= 0 ? completeGate(results[green].gate) : parallelGreenBase(state, gate);+ if (!greenBase) { await fileTestDefects(state, gate); state.flaky = true; return; }+ // A red A+B with green A can still be an interaction: B alone must reproduce those failures.+ // This is a distinct composition, not a retry of A+B or any other already tested tree.+ const [alone] = await parallelPrefixes(state, [culprit]);+ const signatures = new Set((alone.gate?.failures ?? []).map(failure => JSON.stringify([failure.file, failure.name])));+ if (!alone.gate || alone.gate.isGreen || !gate.failures.every(failure => signatures.has(JSON.stringify([failure.file, failure.name])))) {+ await promoteCandidate(state, boundary);+ await fileTestDefects(state, gate);+ state.flaky = true;+ return;+ }+ await promoteCandidate(state, alone);+ const aloneFlakes = await diagnose(state, alone.gate.failures, alone.gate);+ if (aloneFlakes.length) { await fileFlakes(state, alone.gate, aloneFlakes); state.flaky = true; return; }await bisect(state, [culprit], gate.failures);remaining = withoutParallelBlocker(state, remaining, culprit);await save(state, { parallelRemaining: remaining });diff --git a/test/land-parallel-fixture.js b/test/land-parallel-fixture.jsindex fd4459b2..3c7b243a 100644--- a/test/land-parallel-fixture.js+++ b/test/land-parallel-fixture.js@@ -97,7 +97,9 @@ export function assertParallelLanding({ landProject, itemWorktree, submitItem, aassert.ok(maximum >= 2, 'candidate gates execute concurrently in distinct worktrees');const starts = rows.filter(row => row.phase === 'start');const sets = starts.map(row => row.files.join(','));- for (const wanted of ['land-1.test.js', 'land-1.test.js,land-2.test.js', 'land-1.test.js,land-2.test.js,land-3.test.js']) assert.ok(sets.includes(wanted), `the exact prefix executes: ${wanted}`);+ for (const wanted of ['land-1.test.js', 'land-1.test.js,land-2.test.js', 'land-1.test.js,land-2.test.js,land-3.test.js']) assert.equal(sets.filter(value => value === wanted).length, 1, `each exact prefix executes once: ${wanted}`);+ assert.equal(sets.filter(value => value === 'land-1.test.js,land-3.test.js').length, 1, 'C is checked once on A, with no serial retry or pre-push rerun');+ assert.equal(sets.filter(value => value === 'land-2.test.js').length, 1, 'the distinct B-alone control confirms culpability rather than blaming an interaction');} else assert.equal(maximum, 1, 'the default serial behavior remains serial');}}