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(board): accept root-level landing failure evidence [B3,V4]
Corey Olsoned3718d2e2a5
diff --git a/src/board.js b/src/board.jsindex 5687ebf5..3d8b2595 100644--- a/src/board.js+++ b/src/board.js@@ -1522,7 +1522,7 @@ export function reopen(board, id, { agentId, note }) {/** Read test and merge-commit evidence from a Studio/manual landing note without checking Git. */function manualLandingFailure(note) {- const test = note.match(/(?<file>(?:[\w.-]+\/)+[\w.-]+):\s*(?<name>[^;\n]+?)(?=\s*;\s*merge commit\b|$)/iu);+ const test = note.match(/(?<file>(?:[\w.-]+\/)*[\w.-]+):\s*(?<name>[^;\n]+?)(?=\s*;\s*merge commit\b|$)/iu);const mergeCommit = note.match(/\bmerge commit\s+([a-f0-9]{40}|[a-f0-9]{64})\b/iu)?.[1];if (!test || !test.groups.name.trim() || !mergeCommit) return null;return { test: { file: test.groups.file, name: test.groups.name.trim() }, mergeCommit };diff --git a/test/reopen.test.js b/test/reopen.test.jsindex b5f6df93..15ddbbc7 100644--- a/test/reopen.test.js+++ b/test/reopen.test.js@@ -1,5 +1,6 @@/** Real Git, SQLite and ordered-engine coverage for coordinator criterion reopen [V2,V6,H16]. */import assert from 'node:assert/strict';+import { spawnSync } from 'node:child_process';import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';@@ -357,6 +358,57 @@ test('a red landing gate returns a verified item to its builder [B3,V4]', asyncassert.equal(JSON.parse(mergedReopen.out).error.code, 'ALREADY_MERGED');});+test('manual reopen accepts a failing root-level test after an unrecorded two-parent merge [B3,V4]', (t) => {+ const box = landingProject();+ const item = submitLandingFixture(box, 1, 'export const status = "RED";\n');+ acceptLandingFixture(box, item);++ writeFileSync(join(box.repo, 'root.test.js'), [+ "import assert from 'node:assert/strict';",+ "import { readFileSync } from 'node:fs';",+ "import { test } from 'node:test';",+ "test('root-level landing behavior remains green', () => assert.match(readFileSync(new URL('./web/feature.js', import.meta.url), 'utf8'), /export const status = [\"']PASS[\"']/u));",+ '',+ ].join('\n'));+ box.git(box.repo, 'add', 'root.test.js');+ box.git(box.repo, 'commit', '-q', '-m', 'test: guard root-level landing behavior [G1]');++ const merged = box.tryGit(box.repo, 'merge', '--no-ff', '--no-edit', item.commit);+ assert.equal(merged.status, 0, merged.failure ?? merged.stderr);+ const mergeCommit = box.git(box.repo, 'rev-parse', 'HEAD');+ const mergeParents = box.git(box.repo, 'rev-list', '--parents', '-n', '1', mergeCommit).split(' ');+ assert.equal(mergeParents.length, 3, 'the manual landing evidence names a real two-parent merge commit');+ assert.equal(mergeParents[2], item.commit, 'the second parent is the accepted item commit');++ const failingRootTest = spawnSync(process.execPath, ['--test', '--test-reporter=tap', 'root.test.js'], {+ cwd: box.repo, env: box.env, encoding: 'utf8',+ });+ assert.equal(failingRootTest.status, 1, failingRootTest.stderr || failingRootTest.stdout);+ assert.match(failingRootTest.stdout, /not ok 1 - root-level landing behavior remains green/u);++ const board = openFixtureBoard(t, box);+ assert.deepEqual(store.landingBatches(board), [], 'a hand-run merge has no recorded landing batch');+ const accepted = readItem(box, item.id).thread.findLast((event) => event.type === 'move' && event.kind === 'accept');+ assert.ok(accepted, 'the item has the original accept that the landing failure supersedes');+ const note = `root.test.js: root-level landing behavior remains green; merge commit ${mergeCommit}`;+ const reopened = box.run(box.repo, 'reopen', String(item.id), '--note', note, '--json');+ assert.equal(reopened.code, 0, [reopened.err, reopened.out].filter(Boolean).join('\n'));+ assert.deepEqual(JSON.parse(reopened.out).landingFailure, {+ batch: null,+ tests: [{ file: 'root.test.js', name: 'root-level landing behavior remains green' }],+ mergeCommit,+ });++ const returned = readItem(box, item.id);+ assert.equal(returned.item_status, 'open');+ assert.equal(returned.item_commit, item.commit, 'the accepted commit remains recorded');+ const reopenEvent = returned.thread.findLast((event) => event.type === 'move' && event.kind === 'reopen');+ assert.equal(reopenEvent.detail.supersedes, accepted.eventId);+ assert.deepEqual(reopenEvent.detail.landingFailure, JSON.parse(reopened.out).landingFailure);+ assert.ok(returned.thread.some((event) => event.eventId === accepted.eventId && event.kind === 'accept'),+ 'the append-only accept remains in history');+});+test('a reopened item resubmits at a new head after a criterion edit [V2,V6,H16]', async (t) => {const box = project();const submitted = submitFixture(box);