Skip to content

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.

fix(board): allow same head after refreeze [V2,V6,H16]

Corey Olson84497e101deb
diff --git a/docs/lifecycle.md b/docs/lifecycle.md
index 33d1a5ce..b2af58f0 100644
--- a/docs/lifecycle.md
+++ b/docs/lifecycle.md
@@ -126,7 +126,7 @@ Each move checks its guards in this order and refuses with the first one that do
| PIPEFAIL_UNAVAILABLE | the gate, which submit runs itself every time, is green at HEAD | rewrite the gate without a pipe |
| MOVED_DURING_GATE | when the gate ends, HEAD and every tracked file are as they were when it started | leave the worktree alone until the gate finishes, then submit again |
| CHILDREN_OPEN | every child item is verified or withdrawn | finish the child items, or the coordinator withdraws them |
-| HEAD_NOT_NEW | a verifier has not already rejected this commit | commit the rework, then submit |
+| HEAD_NOT_NEW | a verifier has not rejected this commit at this bar; after a no-verdict reopen, the bar was refrozen | commit the rework, or refreeze the bar after a no-verdict reopen before resubmitting the same commit |
| NOT_AT_COMMIT | the caller's checkout contains the submitted commit | git switch --detach <commit> |
| OUTSIDE_LANE | the caller's checkout contains the submitted commit | restore foreign paths before accepting |
| NO_POLICY | the caller's checkout contains the submitted commit | restore the frozen policy objects |
diff --git a/src/board.js b/src/board.js
index 6935bc4a..defa39b6 100644
--- a/src/board.js
+++ b/src/board.js
@@ -1212,7 +1212,8 @@ export function submit(board, id, { agentId, commit, tree, files = [], policyCom
const rejectedHead = board.db.prepare(
"SELECT 1 FROM verdict WHERE item_id = ? AND verdict_decision = 'REJECT' AND verdict_commit = ? AND (? < 9 OR verdict_digest = ?) LIMIT 1",
).get(id, commit, engineVersion, found.item_frozen_digest);
- const sameReopenedHead = found.item_verdict === null && found.item_commit === commit;
+ const sameReopenedHead = found.item_verdict === null && found.item_commit === commit
+ && !(engineVersion >= 11 && correctedNoVerdictReopen(board, id, commit));
return rejectedHead || sameReopenedHead
? new Refused('HEAD_NOT_NEW', `#${id} already has a submission at ${commit.slice(0, 12)}; commit the rework first`)
: null;
@@ -1240,6 +1241,39 @@ export function submit(board, id, { agentId, commit, tree, files = [], policyCom
});
}
+/**
+ * True only after a no-verdict reopen followed by an explicit refreeze, or an edit that clears the
+ * old frozen bar followed by a new claim. Reopening a verified landing failure is excluded.
+ *
+ * @param {any} board
+ * @param {number} id
+ * @param {string} commit
+ * @returns {boolean}
+ */
+function correctedNoVerdictReopen(board, id, commit) {
+ const history = board.db.prepare(
+ "SELECT event_id, event_kind, event_detail FROM event WHERE item_id = ? AND event_kind IN ('submit', 'reopen', 'edit', 'refreeze', 'claim') ORDER BY event_id DESC",
+ ).all(id);
+ const boundary = history.findIndex((entry) => entry.event_kind === 'submit' || entry.event_kind === 'reopen');
+ if (boundary < 0 || history[boundary].event_kind !== 'reopen') return false;
+ const reopened = JSON.parse(history[boundary].event_detail);
+ if (reopened.judgment !== null || reopened.supersedes !== undefined) return false;
+
+ const previousSubmission = history.slice(boundary + 1).find((entry) => {
+ if (entry.event_kind !== 'submit') return false;
+ const detail = JSON.parse(entry.event_detail);
+ return detail.commit === commit;
+ });
+ if (!previousSubmission) return false;
+ const afterReopen = history.slice(0, boundary);
+ const latestBarChange = afterReopen.find((entry) => entry.event_kind === 'refreeze'
+ || (entry.event_kind === 'edit' && Object.hasOwn(JSON.parse(entry.event_detail), 'unfrozen')));
+ if (!latestBarChange) return false;
+ if (latestBarChange.event_kind === 'refreeze') return true;
+ return afterReopen.some((entry) => entry.event_kind === 'claim' && entry.event_id > latestBarChange.event_id
+ && Boolean(JSON.parse(entry.event_detail).digest));
+}
+
/**
* Who holds an item's review under a live lease (V15), or null. A reservation counts only while the
* item is submitted and its lease has not run out, and a new submission starts with none.
diff --git a/src/machine.js b/src/machine.js
index 8515c14e..d8548350 100644
--- a/src/machine.js
+++ b/src/machine.js
@@ -10,7 +10,7 @@
*/
/** Executable move semantics, carried by every sealed move and retained during replay [H16]. */
-export const ENGINE_VERSION = 10;
+export const ENGINE_VERSION = 11;
/** @typedef {'agent' | 'coordinator' | 'clock'} Role */
@@ -125,7 +125,7 @@ export const GUARDS = [
{ id: 'gateGreen', refuse: 'GATE_RED', alsoRefuses: [{ code: 'PIPEFAIL_UNAVAILABLE', next: 'rewrite the gate without a pipe' }], rule: 'the gate, which submit runs itself every time, is green at HEAD', next: 'fix what the digest names, commit, submit again', source: 'cli' },
{ id: 'treeStillDuringGate', refuse: 'MOVED_DURING_GATE', rule: 'when the gate ends, HEAD and every tracked file are as they were when it started', next: 'leave the worktree alone until the gate finishes, then submit again', source: 'cli' },
{ id: 'childrenDone', refuse: 'CHILDREN_OPEN', rule: 'every child item is verified or withdrawn', next: 'finish the child items, or the coordinator withdraws them', source: 'board' },
- { id: 'headIsNew', refuse: 'HEAD_NOT_NEW', rule: 'a verifier has not already rejected this commit', next: 'commit the rework, then submit', source: 'board' },
+ { id: 'headIsNew', refuse: 'HEAD_NOT_NEW', rule: 'a verifier has not rejected this commit at this bar; after a no-verdict reopen, the bar was refrozen', next: 'commit the rework, or refreeze the bar after a no-verdict reopen before resubmitting the same commit', source: 'board' },
{ id: 'atSubmittedCommit', refuse: 'NOT_AT_COMMIT', alsoRefuses: [{ code: 'OUTSIDE_LANE', next: 'restore foreign paths before accepting' }, { code: 'NO_POLICY', next: 'restore the frozen policy objects' }, { code: 'BAD_CONFIG', next: 'repair the committed coordinator configuration' }, { code: 'GIT_GRAFTS', next: 'ask the coordinator to remove the Git graft file before retrying' }], rule: "the caller's checkout contains the submitted commit", next: 'git switch --detach <commit>', source: 'cli' },
{ id: 'notBuilder', refuse: 'SELF_VERIFY', rule: 'the caller did not build it', next: 'another agent verifies it: pullboard next --verify', source: 'board' },
{ id: 'policyAllows', refuse: 'COORDINATOR_VERIFIES', rule: "the repo's verify policy lets the caller verify this lane's work", next: 'the coordinator verifies it', source: 'board' },
diff --git a/test/agent-model-engine.test.js b/test/agent-model-engine.test.js
index f52b8050..811622fc 100644
--- a/test/agent-model-engine.test.js
+++ b/test/agent-model-engine.test.js
@@ -10,9 +10,9 @@ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
-test('model declarations and event snapshots retain engines 1 through 9 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 10, 'engine 10 preserves the released engine-8 and engine-9 model behavior');
- for (const version of [1, 2, 3, 4, 5, 6, 7, 8, 9, ENGINE_VERSION]) {
+test('model declarations and event snapshots retain engines 1 through 10 semantics [O8,O3,H16]', (t) => {
+ assert.equal(ENGINE_VERSION, 11, 'engine 11 preserves the released engine-8 through engine-10 model behavior');
+ for (const version of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ENGINE_VERSION]) {
const board = store.openBoard(':memory:');
t.after(() => store.closeBoard(board));
const registration = prepareEngineMove(board, 'register', [{ lane: 'web', path: '/web', model: 'First Model' }]);
diff --git a/test/pending-refreeze.test.js b/test/pending-refreeze.test.js
index 7fed54dd..82762011 100644
--- a/test/pending-refreeze.test.js
+++ b/test/pending-refreeze.test.js
@@ -6,7 +6,7 @@ import { join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { test } from 'node:test';
import * as store from '../src/board.js';
-import { appliedSequence, applyRelayMove, prepareEngineMove } from '../src/engine.js';
+import { appliedSequence, applyRelayMove, engineReceipt, prepareEngineMove } from '../src/engine.js';
import { exportBoard, importBoard } from '../src/exchange.js';
import { ENGINE_VERSION } from '../src/machine.js';
import { createE2eHelpers } from './e2e-helpers.js';
@@ -14,6 +14,17 @@ import { unpackRelease } from './release-archive.js';
const e2e = createE2eHelpers();
+/** Remove only the writer's engine marker before comparing otherwise identical replay exports. */
+function withoutEngineMarker(snapshot) {
+ return {
+ ...snapshot,
+ tables: {
+ ...snapshot.tables,
+ board_meta: snapshot.tables.board_meta.filter((row) => row.meta_key !== 'relay_engine_version'),
+ },
+ };
+}
+
/** Parse one private CLI refusal and require its exact next-step suffix. */
function refusal(result, code, itemId, pendingFields) {
assert.equal(result.code, 1, `${result.out}${result.err}`);
@@ -193,7 +204,7 @@ test("edit adds and clears an item's dependencies [B3,V2]", (t) => {
/** Exercise real older executables, rather than treating a retagged current move as an old client. */
async function checkDependencyLegacyClients(cleanup, directory, snapshot, target, add, clear) {
- for (const [version, reference] of [[7, 'v0.8.4'], [8, 'v0.8.6'], [9, '314ef28751c44c96186b337cc4ace0fd8bf33d42']]) {
+ for (const [version, reference] of [[7, 'v0.8.4'], [8, 'v0.8.6'], [9, '314ef28751c44c96186b337cc4ace0fd8bf33d42'], [10, 'v0.8.23']]) {
const source = join(directory, `client-${version}`);
mkdirSync(source);
unpackRelease(reference, source);
@@ -225,11 +236,32 @@ async function checkDependencyLegacyClients(cleanup, directory, snapshot, target
assert.deepEqual(legacyExchange.exportBoard(old), before, 'future refusal changes no board rows or replay metadata');
assert.equal(legacyEngine.appliedSequence(old), 1, 'future refusal leaves the committed prefix unchanged');
}
+ if (version === 10) {
+ for (const [index, move] of [add, clear].entries()) {
+ const engine10Move = { ...move, id: `${move.id}-engine-10`, engine: 10 };
+ const engine10Receipt = { ...receipt, sequence: index + 2 };
+ const oldFeature = legacyEngine.applyRelayMove(old, engine10Move, engine10Receipt);
+ const currentFeature = applyRelayMove(current, engine10Move, engine10Receipt);
+ assert.equal(oldFeature.error, undefined, JSON.stringify(oldFeature));
+ assert.deepEqual(currentFeature, oldFeature, 'engine 11 reproduces engine 10 dependency additions and clears');
+ assert.deepEqual(store.getItem(current, target), legacyStore.getItem(old, target));
+ assert.deepEqual(store.events(current), legacyStore.events(old), 'engine 10 and engine 11 replay identical events');
+ assert.equal(appliedSequence(current), legacyEngine.appliedSequence(old));
+ assert.deepEqual(engineReceipt(current, engine10Move.id), legacyEngine.engineReceipt(old, engine10Move.id),
+ 'engine 10 and engine 11 retain the same dependency-move receipts');
+ const oldSnapshot = legacyExchange.exportBoard(old);
+ const currentSnapshot = exportBoard(current);
+ assert.equal(oldSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, '10');
+ assert.equal(currentSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, '11');
+ assert.deepEqual(withoutEngineMarker(currentSnapshot), withoutEngineMarker(oldSnapshot),
+ 'the sole snapshot difference is the intentionally newer writer-version marker');
+ }
+ }
}
}
test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) => {
- assert.equal(ENGINE_VERSION, 10);
+ assert.equal(ENGINE_VERSION, 11);
const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));
const cleanup = [];
t.after(() => {
@@ -258,8 +290,8 @@ test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) =
{ id: 'dependency-add', actor: 'coordinator' });
const clear = prepareEngineMove(seed, 'editItem', [target, { agentId: 'coordinator', after: [] }],
{ id: 'dependency-clear', actor: 'coordinator' });
- assert.equal(add.engine, 10);
- assert.equal(clear.engine, 10);
+ assert.equal(add.engine, ENGINE_VERSION);
+ assert.equal(clear.engine, ENGINE_VERSION);
const copies = [open('one', snapshot), open('two', snapshot)];
for (const [index, move] of [add, clear].entries()) {
const receipt = { sequence: index + 1, at: `2026-10-13T12:00:0${index + 1}.000Z`, sender, kind: 'move' };
diff --git a/test/reopen.test.js b/test/reopen.test.js
index 70fe731b..9c7fa89b 100644
--- a/test/reopen.test.js
+++ b/test/reopen.test.js
@@ -142,9 +142,9 @@ function readItem(box, id) {
/** Accepted engine-9 source before verified-item reopening; the 0.8.8 tag is not yet published. */
const engine9Source = '314ef28751c44c96186b337cc4ace0fd8bf33d42';
-/** Assert both older sealed engines preserve their submitted-only verified-item refusal. */
+/** Compare verified-item reopen behavior across engines 8 through 10 and the current receiver. */
async function assertLegacyVerifiedReopen(t, box, item, note) {
- for (const [version, reference] of [[8, 'v0.8.6'], [9, engine9Source]]) {
+ for (const [version, reference] of [[8, 'v0.8.6'], [9, engine9Source], [10, 'v0.8.23']]) {
const directory = mkdtempSync(join(tmpdir(), `pullboard-engine-${version}-verified-reopen-`));
t.after(() => rmSync(directory, { recursive: true, force: true }));
const source = store.openBoard(join(box.repo, '.git', 'pullboard', 'board.sqlite'));
@@ -160,9 +160,14 @@ async function assertLegacyVerifiedReopen(t, box, item, note) {
importBoard(currentReceiver, snapshot);
const before = store.getItem(currentReceiver, item.id);
const currentResult = applyRelayMove(currentReceiver, move, receipt);
- assert.equal(currentResult.error?.code, 'NOT_SUBMITTED');
- assert.deepEqual(store.getItem(currentReceiver, item.id), before, `engine-${version} replay leaves the verified item row unchanged`);
- assert.equal(currentResult.error?.message, `item #${item.id} is verified, not submitted`, `the current engine preserves engine-${version} refusal ordering and message`);
+ if (version < 10) {
+ assert.equal(currentResult.error?.code, 'NOT_SUBMITTED');
+ assert.deepEqual(store.getItem(currentReceiver, item.id), before, `engine-${version} replay leaves the verified item row unchanged`);
+ assert.equal(currentResult.error?.message, `item #${item.id} is verified, not submitted`, `the current engine preserves engine-${version} refusal ordering and message`);
+ } else {
+ assert.equal(currentResult.error, undefined, JSON.stringify(currentResult));
+ assert.equal(store.getItem(currentReceiver, item.id).item_status, 'open', 'engine 10 introduces verified-item landing reopens');
+ }
const oldDirectory = join(directory, 'old-client');
mkdirSync(oldDirectory);
@@ -176,21 +181,33 @@ async function assertLegacyVerifiedReopen(t, box, item, note) {
assert.equal((await import(pathToFileURL(join(oldDirectory, 'src/machine.js')).href)).ENGINE_VERSION, version);
const legacyBefore = legacyStore.getItem(legacyReceiver, item.id);
const legacyResult = legacyEngine.applyRelayMove(legacyReceiver, move, receipt);
- assert.equal(legacyResult.error?.code, 'NOT_SUBMITTED');
- assert.deepEqual(currentResult.error, legacyResult.error, `engine-${version} preserves the older refusal envelope`);
- assert.deepEqual(store.events(currentReceiver), legacyStore.events(legacyReceiver), `engine-${version} preserves the older refusal event history`);
- assert.deepEqual(legacyStore.getItem(legacyReceiver, item.id), legacyBefore, `the engine-${version} client keeps its submitted-only rule`);
+ if (version < 10) {
+ assert.equal(legacyResult.error?.code, 'NOT_SUBMITTED');
+ assert.deepEqual(currentResult.error, legacyResult.error, `engine-${version} preserves the older refusal envelope`);
+ assert.deepEqual(store.events(currentReceiver), legacyStore.events(legacyReceiver), `engine-${version} preserves the older refusal event history`);
+ assert.deepEqual(legacyStore.getItem(legacyReceiver, item.id), legacyBefore, `the engine-${version} client keeps its submitted-only rule`);
+ } else {
+ assert.equal(legacyResult.error, undefined, JSON.stringify(legacyResult));
+ assert.deepEqual(legacyStore.getItem(legacyReceiver, item.id), store.getItem(currentReceiver, item.id));
+ assert.deepEqual(legacyStore.events(legacyReceiver), store.events(currentReceiver), 'the actual engine-10 client and engine-11 source replay identical landing reopens');
+ }
const nextMove = prepareEngineMove(currentReceiver, 'reopen', [item.id, { agentId: 'coordinator', note }],
{ id: `engine10-verified-reopen-after-${version}`, actor: 'coordinator' });
- assert.equal(nextMove.engine, 10);
+ assert.equal(nextMove.engine, ENGINE_VERSION);
const beforeFuture = legacyExchange.exportBoard(legacyReceiver);
assert.throws(() => legacyEngine.applyRelayMove(legacyReceiver, nextMove, { ...receipt, sequence: 2 }),
(error) => error.code === 'ENGINE_VERSION');
assert.deepEqual(legacyExchange.exportBoard(legacyReceiver), beforeFuture, `engine ${version} refuses before applying the engine-10 return`);
- const nextResult = applyRelayMove(currentReceiver, nextMove, { ...receipt, sequence: 2 });
+ let nextTarget = currentReceiver;
+ if (version === 10) {
+ nextTarget = store.openBoard(join(directory, 'current-after-engine-10.sqlite'));
+ t.after(() => store.closeBoard(nextTarget));
+ importBoard(nextTarget, snapshot);
+ }
+ const nextResult = applyRelayMove(nextTarget, nextMove, { ...receipt, sequence: version === 10 ? 1 : 2 });
assert.equal(nextResult.error, undefined, JSON.stringify(nextResult));
- assert.equal(store.getItem(currentReceiver, item.id).item_status, 'open');
+ assert.equal(store.getItem(nextTarget, item.id).item_status, 'open');
assert.equal(nextResult.result.landingFailure.mergeCommit, note.match(/merge commit ([a-f0-9]{40})/u)[1]);
}
}
@@ -276,6 +293,9 @@ test('a red landing gate returns a verified item to its builder [B3,V4]', async
const firstClaim = box.run(item.cwd, 'claim', String(item.id));
assert.equal(firstClaim.code, 0, firstClaim.err);
+ const unchangedLandingHead = box.run(item.cwd, 'submit', String(item.id), '--json');
+ assert.equal(unchangedLandingHead.code, 1);
+ assert.equal(JSON.parse(unchangedLandingHead.out).error.code, 'HEAD_NOT_NEW', 'a verified-item red-landing reopen still requires new work');
assert.equal(box.tryGit(item.cwd, 'merge-base', '--is-ancestor', item.commit, 'HEAD').status, 0,
'the builder reclaims on top of the accepted commit');
const firstFix = commitFile(box, item.cwd, 'web/feature.js', 'export const status = "PASS";\n', 'fix(web): restore landing behavior [G1]');
@@ -492,7 +512,7 @@ test('manual reopen records a timestamp-prefixed failing test after an unrecorde
'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) => {
+test('a reopened bar takes the same commit again [V2,V6,H16]', async (t) => {
const box = project();
const submitted = submitFixture(box);
const reviewPath = reserveFixtureReview(box);
@@ -525,7 +545,7 @@ test('a reopened item resubmits at a new head after a criterion edit [V2,V6,H16]
}), (error) => error.code === 'RELAY_MOVE');
assert.deepEqual(exportBoard(oldReceiver), beforeOldReceiver, 'the current receiver rejects an impossible pre-introduction tag without mutation');
- for (const [version, reference] of [[8, 'v0.8.6'], [9, engine9Source]]) {
+ for (const [version, reference] of [[8, 'v0.8.6'], [9, engine9Source], [10, 'v0.8.23']]) {
const legacyDirectory = mkdtempSync(join(tmpdir(), `pullboard-engine-${version}-reopen-`));
t.after(() => rmSync(legacyDirectory, { recursive: true, force: true }));
unpackRelease(reference, legacyDirectory);
@@ -585,24 +605,63 @@ test('a reopened item resubmits at a new head after a criterion edit [V2,V6,H16]
const reopened = box.run(box.repo, 'reopen', '1', '--note', 'correct the frozen criterion');
assert.equal(reopened.code, 0, reopened.err);
+ const claimedBeforeCorrection = box.run(box.web, 'claim', '1');
+ assert.equal(claimedBeforeCorrection.code, 0, claimedBeforeCorrection.err);
+ const unchangedBar = box.run(box.web, 'submit', '1', '--json');
+ assert.equal(unchangedBar.code, 1);
+ assert.equal(JSON.parse(unchangedBar.out).error.code, 'HEAD_NOT_NEW', 'a no-verdict reopen alone does not make the old bar a new submission');
+ const released = box.run(box.web, 'release', '1');
+ assert.equal(released.code, 0, released.err);
+ const explicitRefreeze = box.run(box.repo, 'refreeze', '1');
+ assert.equal(explicitRefreeze.code, 0, explicitRefreeze.err);
+ const claimedAfterRefreeze = box.run(box.web, 'claim', '1');
+ assert.equal(claimedAfterRefreeze.code, 0, claimedAfterRefreeze.err);
+ const sameContentResubmission = box.run(box.web, 'submit', '1', '--json');
+ assert.equal(sameContentResubmission.code, 0, sameContentResubmission.err);
+ assert.equal(JSON.parse(sameContentResubmission.out).commit, submitted.commit,
+ 'an explicit coordinator refreeze is a new frozen bar even when its text is unchanged');
+
+ const secondReopen = box.run(box.repo, 'reopen', '1', '--note', 'correct the frozen criterion to match the implemented heading');
+ assert.equal(secondReopen.code, 0, secondReopen.err);
const edited = box.run(box.repo, 'edit', '1', '--criterion', 'The page renders a heading.');
assert.equal(edited.code, 0, edited.err);
const claimed = box.run(box.web, 'claim', '1');
assert.equal(claimed.code, 0, claimed.err);
- const sameHead = box.run(box.web, 'submit', '1', '--json');
- assert.equal(sameHead.code, 1);
- assert.equal(JSON.parse(sameHead.out).error.code, 'HEAD_NOT_NEW');
- const treeBefore = box.git(box.web, 'rev-parse', 'HEAD^{tree}');
- box.git(box.web, 'commit', '--allow-empty', '-m', 'chore(web): resend corrected criterion at a new head [G1]');
- const newHead = box.git(box.web, 'rev-parse', 'HEAD');
- assert.notEqual(newHead, submitted.commit);
- assert.equal(box.git(box.web, 'rev-parse', 'HEAD^{tree}'), treeBefore, 'an empty commit keeps the measured tree unchanged');
+ const claimedBoard = store.openBoard(join(box.repo, '.git', 'pullboard', 'board.sqlite'));
+ let claimedBoardOpen = true;
+ t.after(() => { if (claimedBoardOpen) store.closeBoard(claimedBoard); });
+ const engine11Move = prepareEngineMove(claimedBoard, 'submit', [1, {
+ agentId: 'web-1', commit: submitted.commit, tree: submitted.tree,
+ policyCommit: box.git(box.repo, 'rev-parse', 'HEAD'),
+ }], { id: 'same-commit-engine-11', actor: 'web-1' });
+ const builderSender = { kind: 'agent', userId: 'fixture-user', agent: 'web-1' };
+ const engine10Replica = store.openBoard(join(box.dir, 'engine-10-same-commit.sqlite'));
+ t.after(() => store.closeBoard(engine10Replica));
+ importBoard(engine10Replica, exportBoard(claimedBoard));
+ const engine10Move = { ...engine11Move, id: 'same-commit-engine-10', engine: 10 };
+ const oldBehavior = applyRelayMove(engine10Replica, engine10Move, {
+ sequence: 1, at: '2026-10-10T12:00:02.000Z', kind: 'move', sender: builderSender,
+ });
+ assert.equal(oldBehavior.error?.code, 'HEAD_NOT_NEW', 'engine 10 replay keeps the previous no-verdict reopen refusal');
+ store.closeBoard(claimedBoard);
+ claimedBoardOpen = false;
+
const resubmission = box.run(box.web, 'submit', '1', '--json');
assert.equal(resubmission.code, 0, resubmission.err);
- assert.equal(JSON.parse(resubmission.out).commit, newHead);
+ assert.equal(JSON.parse(resubmission.out).commit, submitted.commit, 'the corrected bar accepts the original commit without inventing an empty commit');
const board = openFixtureBoard(t, box);
- assert.equal(store.getItem(board, 1).item_commit, newHead);
- const freshReview = box.run(reviewPath, 'next', '--verify', '1');
- assert.equal(freshReview.code, 0, `reopen starts no reviewer cooldown: ${freshReview.err}`);
+ assert.equal(store.getItem(board, 1).item_commit, submitted.commit);
+ const review = box.run(reviewPath, 'next', '--verify', '1');
+ assert.equal(review.code, 0, review.err);
+ box.git(reviewPath, 'merge', '--ff-only', submitted.commit);
+ const rejected = box.run(reviewPath, 'verify', '1', 'reject', '--reason', 'BEHAVIOR_MISMATCH', '--note', 'the corrected criterion still fails');
+ assert.equal(rejected.code, 0, rejected.err);
+ const reclaimed = box.run(box.web, 'claim', '1');
+ assert.equal(reclaimed.code, 0, reclaimed.err);
+ const sameRejectedHead = box.run(box.web, 'submit', '1', '--json');
+ assert.equal(sameRejectedHead.code, 1);
+ assert.equal(JSON.parse(sameRejectedHead.out).error.code, 'HEAD_NOT_NEW', 'a rejection at the current corrected digest still blocks the same commit');
+ assert.equal(store.getItem(board, 1).item_status, 'claimed');
+ assert.equal(store.getItem(board, 1).item_verdict, 'REJECT');
});