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.

test: supply modern receipts in core board fixtures [C7,V4]

Corey Olson12cecd9a5ef1
diff --git a/test/board-submit-fixture.js b/test/board-submit-fixture.js
new file mode 100644
index 00000000..7f58b337
--- /dev/null
+++ b/test/board-submit-fixture.js
@@ -0,0 +1,11 @@
+/** Board-state fixtures supply the receipt required by modern submits [C7,V4]. */
+import { submit } from '../src/board.js';
+
+/** Record a synthetic board move without claiming that this fixture ran a gate. */
+export function submitFixture(board, id, options) {
+ return submit(board, id, {
+ submissionProof: { version: 1, files: [], full: false, deferred: true,
+ reason: 'synthetic board-state fixture; no gate execution' },
+ ...options,
+ });
+}
diff --git a/test/board.test.js b/test/board.test.js
index c2774495..af2f1892 100644
--- a/test/board.test.js
+++ b/test/board.test.js
@@ -2,6 +2,7 @@
* The board's rules on an in-memory board with a hand-turned clock (B4–B7, V1, V2, V5, V6, V8, R1,
* R2). The git-facing rules (V3, V4, V7) run against real repos in e2e.test.js.
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { runFixtureExecFile as execFileSync, runFixtureGit } from './fixture-child.js';
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
@@ -191,7 +192,7 @@ test('[N26,A2] milestones stay ordered and only the coordinator can edit them',
{ name: 'Release', done: 0, total: 1 },
]);
assert.equal(current[0].items[0].status, 'claimed', "roadmap reads the item's current state");
- store.submit(board, second, { agentId: 'api-1', commit: SHA_A, tree: 'tree-a' });
+ submitFixture(board, second, { agentId: 'api-1', commit: SHA_A, tree: 'tree-a' });
store.verify(board, second, {
agentId: 'web-2', decision: 'ACCEPT', reason: 'CRITERION_MET', note: 'checked the expected result',
head: SHA_A, digest: 'digest:Publish', policy: 'any',
@@ -286,11 +287,11 @@ test('the first claim freezes the criterion; later claims keep it [V2]', () => {
test('submit needs your claim and finished children', () => {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Page' });
const child = store.addItem(board, { by: 'web-1', lane: 'web', title: 'Part', parentId: id });
- assert.throws(() => store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' }), /NOT_YOURS/);
+ assert.throws(() => submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' }), /NOT_YOURS/);
claimAs(id, 'web-1', 'web');
- assert.throws(() => store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' }), /CHILDREN_OPEN/);
+ assert.throws(() => submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' }), /CHILDREN_OPEN/);
store.withdraw(board, child, { agentId: 'coordinator', reason: 'folded into the parent' });
- store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
assert.equal(store.getItem(board, id).item_status, 'submitted');
});
@@ -300,7 +301,7 @@ test('submit needs your claim and finished children', () => {
function submitted() {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Page' });
claimAs(id, 'web-1', 'web');
- store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a' });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a' });
return id;
}
@@ -328,7 +329,7 @@ test('a verifier releases its reserved review; another verifier can take it, and
const third = store.register(durable, { lane: 'web', path: '/repo-web-4' });
const id = store.addItem(durable, { by: 'coordinator', lane: 'web', title: 'Page' });
store.claim(durable, id, { agentId: builder, lane: 'web', leaseMs: HOUR, freeze });
- store.submit(durable, id, { agentId: builder, commit: SHA_A, tree: 'tree-a' });
+ submitFixture(durable, id, { agentId: builder, commit: SHA_A, tree: 'tree-a' });
store.reserveReview(durable, id, { agentId: reviewer, leaseMs: HOUR, policy: 'any' });
assert.equal(store.release(durable, id, reviewer, 'wrong tree'), true);
@@ -384,8 +385,8 @@ test('REJECT reopens the item; resubmitting a rejected head is refused [V6]', ()
assert.equal(item.item_status, 'open');
assert.equal(item.item_verdict, 'REJECT');
claimAs(id, 'web-1', 'web');
- assert.throws(() => store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a' }), /HEAD_NOT_NEW/);
- store.submit(board, id, { agentId: 'web-1', commit: SHA_B, tree: 'tree-b' });
+ assert.throws(() => submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a' }), /HEAD_NOT_NEW/);
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_B, tree: 'tree-b' });
verdict(id, { agentId: 'web-2', decision: 'ACCEPT' });
assert.equal(store.getItem(board, id).item_status, 'verified');
});
@@ -420,7 +421,7 @@ test('a rejected commit resubmits after its bar is corrected [V4,B3]', async (t)
by: 'coordinator', lane: 'web', title: 'Page', criterion: 'the page renders its heading',
});
const originalClaim = store.claim(durable, id, { agentId: builder, lane: 'web', leaseMs: HOUR, freeze: criterionFreeze });
- store.submit(durable, id, { agentId: builder, commit, tree });
+ submitFixture(durable, id, { agentId: builder, commit, tree });
store.verify(durable, id, {
agentId: reviewer, decision: 'REJECT', reason: 'BEHAVIOR_MISMATCH',
note: 'the heading is missing', head: commit, digest: originalClaim.digest, policy: 'any',
@@ -428,7 +429,7 @@ test('a rejected commit resubmits after its bar is corrected [V4,B3]', async (t)
store.claim(durable, id, { agentId: builder, lane: 'web', leaseMs: HOUR, freeze: criterionFreeze });
assert.throws(
- () => store.submit(durable, id, { agentId: builder, commit, tree }),
+ () => submitFixture(durable, id, { agentId: builder, commit, tree }),
(error) => error.code === 'HEAD_NOT_NEW',
'the same rejected head is still refused while its criterion is unchanged',
);
@@ -438,7 +439,7 @@ test('a rejected commit resubmits after its bar is corrected [V4,B3]', async (t)
assert.equal(store.getItem(durable, id).item_owner, builder, 'refreeze keeps the builder claim for the corrected bar');
assert.doesNotThrow(
- () => store.submit(durable, id, { agentId: builder, commit, tree }),
+ () => submitFixture(durable, id, { agentId: builder, commit, tree }),
'the rejected commit is resubmitted unchanged after the coordinator corrects the criterion',
);
const item = store.getItem(durable, id);
@@ -459,7 +460,7 @@ test('a rejected commit resubmits after its bar is corrected [V4,B3]', async (t)
});
store.claim(durable, id, { agentId: builder, lane: 'web', leaseMs: HOUR, freeze: criterionFreeze });
assert.throws(
- () => store.submit(durable, id, { agentId: builder, commit, tree }),
+ () => submitFixture(durable, id, { agentId: builder, commit, tree }),
(error) => error.code === 'HEAD_NOT_NEW',
'engine 9 refuses the same commit after a rejection at the unchanged corrected digest',
);
@@ -666,7 +667,7 @@ test('an item can wait on others: claiming it is refused until they are verified
const user = store.addItem(board, { by: 'coordinator', lane: 'api', title: 'Uses the store', after: [contract] });
assert.throws(() => claimAs(user, 'api-1', 'api'), /BLOCKED.*#2 waits on #1 \(open, web lane\)/);
claimAs(contract, 'web-1', 'web');
- store.submit(board, contract, { agentId: 'web-1', commit: SHA_A, tree: 't' });
+ submitFixture(board, contract, { agentId: 'web-1', commit: SHA_A, tree: 't' });
assert.throws(() => claimAs(user, 'api-1', 'api'), /BLOCKED.*\(submitted/);
store.verify(board, contract, { agentId: 'web-2', decision: 'ACCEPT', head: SHA_A, digest: 'digest:Store module', policy: 'any', note: 'reverted the module; its test failed' });
assert.equal(claimAs(user, 'api-1', 'api').renewed, false);
@@ -708,7 +709,7 @@ test('next finds the oldest free item in your lane, or says what everything wait
assert.equal(store.nextFor(board, { agentId: 'web-1', lane: 'web' }).item.item_id, contract);
claimAs(contract, 'web-1', 'web');
assert.equal(store.nextFor(board, { agentId: 'web-1', lane: 'web' }).item.item_status, 'claimed');
- store.submit(board, contract, { agentId: 'web-1', commit: SHA_A, tree: 't' });
+ submitFixture(board, contract, { agentId: 'web-1', commit: SHA_A, tree: 't' });
assert.equal(store.nextFor(board, { agentId: 'web-1', lane: 'web', verify: true }).item, null);
assert.equal(store.nextFor(board, { agentId: 'web-2', lane: 'web', verify: true }).item.item_id, contract);
assert.deepEqual(store.nextFor(board, { agentId: 'web-1', lane: 'web' }).reasons, [
@@ -731,7 +732,7 @@ test('an item carries a brief; editing it changes how to build, never what [B10]
assert.throws(() => store.editItem(board, id, { agentId: 'coordinator' }), /USAGE/);
assert.throws(() => store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Huge', brief: 'x'.repeat(8001) }), /BRIEF_TOO_LONG/);
assert.deepEqual(JSON.parse(store.events(board, { itemId: id }).find((event) => event.event_kind === 'edit').event_detail), { brief: '38 characters', model: 'unknown' });
- store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
store.verify(board, id, { agentId: 'web-2', decision: 'ACCEPT', head: SHA_A, digest, policy: 'any', note: 'removed the help case; its test failed' });
assert.throws(() => store.editItem(board, id, { agentId: 'coordinator', brief: 'late' }), /CLOSED/);
});
@@ -761,7 +762,7 @@ test('routes are tiers: an agent claims and verifies its tier and below, its own
assert.equal(store.nextFor(board, { agentId: 'web-4', lane: 'web', routes: ['light'] }).item.item_id, light);
claimAs(strong, 'web-1', 'web');
assert.throws(() => store.editItem(board, strong, { agentId: 'coordinator', route: 'mid' }), /HELD.*only while it is open/);
- store.submit(board, strong, { agentId: 'web-1', commit: SHA_A, tree: 't' });
+ submitFixture(board, strong, { agentId: 'web-1', commit: SHA_A, tree: 't' });
assert.equal(store.nextFor(board, { agentId: 'web-4', lane: 'web', verify: true }).item, null);
const verdict = { agentId: 'web-4', decision: 'ACCEPT', head: SHA_A, digest: 'digest:Design the cache', policy: 'any', note: 'tried it' };
assert.throws(() => store.verify(board, strong, verdict), /ROUTE.*needs a strong verifier; you joined on the mid route/);
@@ -854,11 +855,11 @@ test('a fresh claim records where the work started; submit records what it chang
claimAt(SHA_A);
claimAt(SHA_B);
assert.equal(store.getItem(board, id).item_claim_head, SHA_A, 'a renewal keeps the first head');
- store.submit(board, id, { agentId: 'web-1', commit: SHA_B, tree: 't', files: ['web/page.js', 'web/page.test.js'] });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_B, tree: 't', files: ['web/page.js', 'web/page.test.js'] });
verdict(id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'an empty page throws' });
claimAt(SHA_B);
assert.equal(store.getItem(board, id).item_claim_head, SHA_B, 'the rework starts from the rejected head');
- store.submit(board, id, { agentId: 'web-1', commit: 'c'.repeat(40), tree: 't2', files: ['web/page.js', 'web/empty.js'] });
+ submitFixture(board, id, { agentId: 'web-1', commit: 'c'.repeat(40), tree: 't2', files: ['web/page.js', 'web/empty.js'] });
assert.deepEqual(store.itemFiles(store.getItem(board, id)), ['web/page.js', 'web/page.test.js', 'web/empty.js']);
});
@@ -866,7 +867,7 @@ test('related items: verified work that touched the same files, the most shared
const build = (title, files) => {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title });
claimAs(id, 'web-1', 'web');
- store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't', files });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't', files });
return id;
};
const header = build('Header', ['web/layout.js', 'web/header.js']);
@@ -943,7 +944,7 @@ test('a builder reworks its own rejected item beside its one claim; nothing else
const rejected = (title) => {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title });
claimAs(id, 'web-1', 'web');
- store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
verdict(id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'fails', digest: `digest:${title}` });
return id;
};
@@ -956,7 +957,7 @@ test('a builder reworks its own rejected item beside its one claim; nothing else
assert.equal(claimAs(header, 'web-1', 'web').renewed, false, 'holding only a rework, one new claim is still free');
assert.equal(claimAs(footer, 'web-1', 'web').renewed, false, 'a second rework of its own, beside its claim');
assert.throws(() => claimAs(nav, 'web-1', 'web'), new RegExp(`ONE_CLAIM.*you already hold #${header}`));
- store.submit(board, page, { agentId: 'web-1', commit: SHA_B, tree: 't2' });
+ submitFixture(board, page, { agentId: 'web-1', commit: SHA_B, tree: 't2' });
assert.equal(store.getItem(board, page).item_status, 'submitted');
claimAs(nav, 'web-2', 'web');
assert.throws(() => claimAs(aside, 'web-2', 'web'), /ONE_CLAIM/, "another agent's rejected item is no rework of web-2's");
@@ -1056,7 +1057,7 @@ test('[O3] declared families travel from join through submit and verdict, and ab
const id = store.addItem(persistent, { by: 'coordinator', lane: 'web', title: 'Family feature' });
store.claim(persistent, id, { agentId: 'web-1', lane: 'web', leaseMs: 2 * HOUR, freeze: familyFreeze });
- store.submit(persistent, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a' });
+ submitFixture(persistent, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a' });
assert.equal(store.getItem(persistent, id).item_builder_family, 'Family Alpha');
store.verify(persistent, id, {
agentId: 'review-1', decision: 'ACCEPT', note: 'checked the saved family fields',
@@ -1096,7 +1097,7 @@ test('[O3] declared families travel from join through submit and verdict, and ab
const unverified = store.addItem(persistent, { by: 'coordinator', lane: 'review', title: 'No-family verdict' });
store.claim(persistent, unverified, { agentId: 'review-1', lane: 'review', leaseMs: 2 * HOUR, freeze: familyFreeze });
- store.submit(persistent, unverified, { agentId: 'review-1', commit: SHA_B, tree: 'tree-b' });
+ submitFixture(persistent, unverified, { agentId: 'review-1', commit: SHA_B, tree: 'tree-b' });
store.verify(persistent, unverified, {
agentId: 'web-2', decision: 'ACCEPT', note: 'checked without a family declaration',
head: SHA_B, digest: 'digest:family', policy: 'any',
@@ -1106,12 +1107,12 @@ test('[O3] declared families travel from join through submit and verdict, and ab
const unclaimed = store.addItem(persistent, { by: 'coordinator', lane: 'web', title: 'No-family submission' });
store.claim(persistent, unclaimed, { agentId: 'web-2', lane: 'web', leaseMs: 2 * HOUR, freeze: familyFreeze });
- store.submit(persistent, unclaimed, { agentId: 'web-2', commit: SHA_A, tree: 'tree-c' });
+ submitFixture(persistent, unclaimed, { agentId: 'web-2', commit: SHA_A, tree: 'tree-c' });
assert.equal(store.getItem(persistent, unclaimed).item_builder_family, null);
const differentFamily = store.addItem(persistent, { by: 'coordinator', lane: 'web', title: 'CLI family review' });
store.claim(persistent, differentFamily, { agentId: 'web-1', lane: 'web', leaseMs: 2 * HOUR, freeze: familyFreeze });
- store.submit(persistent, differentFamily, { agentId: 'web-1', commit: SHA_A, tree: 'tree-d' });
+ submitFixture(persistent, differentFamily, { agentId: 'web-1', commit: SHA_A, tree: 'tree-d' });
assert.equal(store.agentAt(persistent, reviewerRoot).agent_family, 'Family Gamma');
assert.equal(store.getItem(persistent, unclaimed).item_builder_family, null);
assert.equal(store.nextFor(persistent, { agentId: 'review-1', lane: 'review', verify: true, familyPolicy: 'require' }).item.item_id, differentFamily);
@@ -1149,7 +1150,7 @@ test('[O2,O3] family policy controls review order and refuses unknown or matchin
const submitAs = (agentId, title) => {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title });
store.claim(board, id, { agentId, lane: 'web', leaseMs: HOUR, freeze: () => ({ text: title, digest: 'digest:Page' }) });
- store.submit(board, id, { agentId, commit: SHA_A, tree: `tree-${title}` });
+ submitFixture(board, id, { agentId, commit: SHA_A, tree: `tree-${title}` });
return id;
};
const beta = submitAs('web-2', 'Beta build');
diff --git a/test/digest.test.js b/test/digest.test.js
index 7e56f378..37e43187 100644
--- a/test/digest.test.js
+++ b/test/digest.test.js
@@ -1,4 +1,5 @@
/** pullboard digest: a readable, bounded, read-only briefing of one real board [A2,N26]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { once } from 'node:events';
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from 'node:fs';
@@ -107,7 +108,7 @@ test('the digest is a readable briefing of one board [A2,N26]', (t) => {
/** The frozen criterion a claim records. */
const freeze = (item) => ({ text: item.item_title, digest: 'digest:briefing' });
store.claim(box.board, first, { agentId: 'web-1', lane: 'web', leaseMs: 3_600_000, freeze });
- store.submit(box.board, first, { agentId: 'web-1', commit: 'a'.repeat(40), tree: 'fixture-tree' });
+ submitFixture(box.board, first, { agentId: 'web-1', commit: 'a'.repeat(40), tree: 'fixture-tree' });
store.verify(box.board, first, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE',
note: 'The upload test fails on an empty file', head: 'a'.repeat(40), digest: 'digest:briefing', policy: 'any' });
store.addMilestone(box.board, { agentId: 'coordinator', name: 'First release', note: 'Uploads that work', items: [first, prerequisite] });
diff --git a/test/e2e-helpers.js b/test/e2e-helpers.js
index 6c3f4771..5ca67e26 100644
--- a/test/e2e-helpers.js
+++ b/test/e2e-helpers.js
@@ -1,3 +1,4 @@
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { startFixtureChild as spawn, reportFixtureChildFailure, runFixtureChild, runFixtureGit } from './fixture-child.js';
import { performance } from 'node:perf_hooks';
@@ -243,7 +244,7 @@ function attackCommit(box, cwd) {
function historicalCheckSubmission(box, commit) {
box.git(box.web, 'update-ref', `refs/pullboard/items/1/${commit.slice(0, 12)}`, commit);
const board = store.openBoard(join(box.repo, '.git/pullboard/board.sqlite'));
- try { store.submit(board, 1, { agentId: 'web-1', commit, tree: box.git(box.web, 'rev-parse', `${commit}^{tree}`) }); }
+ try { submitFixture(board, 1, { agentId: 'web-1', commit, tree: box.git(box.web, 'rev-parse', `${commit}^{tree}`) }); }
finally { store.closeBoard(board); }
}
diff --git a/test/e2e-items.test.js b/test/e2e-items.test.js
index 4426c3ea..41eae282 100644
--- a/test/e2e-items.test.js
+++ b/test/e2e-items.test.js
@@ -2,6 +2,7 @@
* End to end on real repos: the CLI runs as its own process, git runs the installed hooks, and
* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync, runFixtureChild } from './fixture-child.js';
import {
@@ -492,7 +493,7 @@ test('next --verify can reserve a named submitted review and default to the lowe
agentId: 'web-1', lane: 'web', leaseMs: 60 * 60_000,
freeze: (item) => ({ text: item.item_title, digest: `digest:${item.item_title}` }),
});
- store.submit(board, id, { agentId: 'web-1', commit, tree });
+ submitFixture(board, id, { agentId: 'web-1', commit, tree });
return id;
};
first = submit('First review');
diff --git a/test/e2e-policy.test.js b/test/e2e-policy.test.js
index 264d41e4..484e11cf 100644
--- a/test/e2e-policy.test.js
+++ b/test/e2e-policy.test.js
@@ -2,6 +2,7 @@
* End to end on real repos: the CLI runs as its own process, git runs the installed hooks, and
* worktrees are real worktrees (B1–B3, B6, V3, V4, V7, L3, L4, C3, I1, I2, P2).
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { runFixtureExecFile as execFileSync, startFixtureChild as spawn, runFixtureChild as spawnSync } from './fixture-child.js';
import {
@@ -54,7 +55,7 @@ test('the blind gate-bypass repro refuses submit and accept, and doctor audits p
// Model a historical unchecked receipt using the low-level engine in this private fixture.
const board = store.openBoard(join(box.repo, '.git/pullboard/board.sqlite'));
- try { store.submit(board, 1, { agentId: 'web-1', commit, tree: box.git(box.web, 'rev-parse', 'HEAD^{tree}'), policyCommit: original.item_claim_head }); }
+ try { submitFixture(board, 1, { agentId: 'web-1', commit, tree: box.git(box.web, 'rev-parse', 'HEAD^{tree}'), policyCommit: original.item_claim_head }); }
finally { store.closeBoard(board); }
box.git(box.repo, 'update-ref', 'refs/pullboard/items/1/' + commit.slice(0, 12), commit);
const review = join(box.dir, 'review');
@@ -183,7 +184,7 @@ test('accept independently refuses a historically unchecked foreign submission [
writeFileSync(join(box.web, 'coordinator.txt'), 'unauthorized');
const commit = attackCommit(box, box.web);
const board = store.openBoard(join(box.repo, '.git/pullboard/board.sqlite'));
- try { store.submit(board, 1, { agentId: 'web-1', commit, tree: box.git(box.web, 'rev-parse', 'HEAD^{tree}') }); }
+ try { submitFixture(board, 1, { agentId: 'web-1', commit, tree: box.git(box.web, 'rev-parse', 'HEAD^{tree}') }); }
finally { store.closeBoard(board); }
const review = join(box.dir, 'foreign-review');
box.git(box.repo, 'worktree', 'add', '-q', '--detach', review, commit);
@@ -207,7 +208,7 @@ test('replacement refs cannot conceal the real submitted foreign paths [L3,V4,M3
assert.equal(submitted.code, 1);
assert.equal(JSON.parse(submitted.out).error.code, 'OUTSIDE_LANE');
const board = store.openBoard(join(box.repo, '.git/pullboard/board.sqlite'));
- try { store.submit(board, 1, { agentId: 'web-1', commit, tree: 'synthetic unchecked tree' }); }
+ try { submitFixture(board, 1, { agentId: 'web-1', commit, tree: 'synthetic unchecked tree' }); }
finally { store.closeBoard(board); }
const review = join(box.dir, 'replacement-review');
box.git(box.repo, 'worktree', 'add', '-q', '--detach', review, commit);
diff --git a/test/exchange.test.js b/test/exchange.test.js
index fb73dc2d..6b811a60 100644
--- a/test/exchange.test.js
+++ b/test/exchange.test.js
@@ -1,6 +1,7 @@
/**
* The v1 board exchange keeps each SQLite row, including lifecycle history and sequence counters.
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
import { runFixtureChild, runFixtureGit } from './fixture-child.js';
@@ -32,14 +33,14 @@ function populatedBoard(file) {
store.claim(board, claimed, { agentId: 'web-1', lane: 'web', leaseMs: 3_600_000, freeze: FREEZE });
const submitted = add('submitted');
store.claim(board, submitted, { agentId: 'web-2', lane: 'web', leaseMs: 3_600_000, freeze: FREEZE });
- store.submit(board, submitted, { agentId: 'web-2', commit: SHA, tree: 'tree:submitted' });
+ submitFixture(board, submitted, { agentId: 'web-2', commit: SHA, tree: 'tree:submitted' });
const verified = add('verified');
store.claim(board, verified, { agentId: 'web-3', lane: 'web', leaseMs: 3_600_000, freeze: FREEZE });
- store.submit(board, verified, { agentId: 'web-3', commit: SHA, tree: 'tree:verified' });
+ submitFixture(board, verified, { agentId: 'web-3', commit: SHA, tree: 'tree:verified' });
store.verify(board, verified, { agentId: 'web-4', decision: 'ACCEPT', note: 'removed the proof; its test failed', head: SHA, digest: `digest:verified`, policy: 'any' });
const rejected = add('rejected then reopened');
store.claim(board, rejected, { agentId: 'web-5', lane: 'web', leaseMs: 3_600_000, freeze: FREEZE });
- store.submit(board, rejected, { agentId: 'web-5', commit: SHA, tree: 'tree:rejected' });
+ submitFixture(board, rejected, { agentId: 'web-5', commit: SHA, tree: 'tree:rejected' });
store.verify(board, rejected, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'the check fails', head: SHA, digest: `digest:rejected then reopened`, policy: 'any' });
const withdrawn = add('withdrawn');
store.withdraw(board, withdrawn, { agentId: 'coordinator', reason: 'no longer needed' });
@@ -170,7 +171,7 @@ function writeAcceptedItem(board) {
const item = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'written during export' });
const freeze = (row) => ({ text: row.item_title, digest: `digest:${row.item_title}` });
store.claim(board, item, { agentId: 'web-1', lane: 'web', leaseMs: 3_600_000, freeze });
- store.submit(board, item, { agentId: 'web-1', commit: 'b'.repeat(40), tree: 'tree:concurrent' });
+ submitFixture(board, item, { agentId: 'web-1', commit: 'b'.repeat(40), tree: 'tree:concurrent' });
store.verify(board, item, { agentId: 'web-2', decision: 'ACCEPT', note: 'the check passed', head: 'b'.repeat(40), digest: 'digest:written during export', policy: 'any' });
}
diff --git a/test/health.test.js b/test/health.test.js
index 6145e7bf..9b5a568d 100644
--- a/test/health.test.js
+++ b/test/health.test.js
@@ -2,6 +2,7 @@
* pullboard health names every stuck item, why, since when, the next step and who takes it, on a
* real SQLite board in a real git repo with an injected clock, and never changes either [A6].
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -114,7 +115,7 @@ test('health names each stuck cause with its next step and owner [A6]', async (t
const otherReviewer = store.register(board, { lane: 'review', path: join(box.dir, 'review-2') });
const add = (title, extra = {}) => store.addItem(board, { by: 'coordinator', lane: 'core', title, ...extra });
const claim = (id, agentId, leaseMs = 2 * HOUR) => store.claim(board, id, { agentId, lane: 'core', leaseMs, freeze });
- const submit = (id, agentId, commit) => store.submit(board, id, { agentId, commit, tree: `tree-${id}` });
+ const submit = (id, agentId, commit) => submitFixture(board, id, { agentId, commit, tree: `tree-${id}` });
const decide = (id, decision, commit, title, by = reviewer) => store.verify(board, id, { agentId: by, decision,
reason: decision === 'ACCEPT' ? 'CRITERION_MET' : 'TEST_FAILURE', note: 'checked the fixture', head: commit, digest: `digest:${title}`, policy: 'any' });
/** Build an item through claim and submit, optionally to an accept or a reject. */
@@ -254,7 +255,7 @@ test('health on a healthy board says nothing is stuck [A6]', async (t) => {
moving.at(30 * HOUR);
const done = store.addItem(moving.board, { by: 'coordinator', lane: 'core', title: 'Done' });
store.claim(moving.board, done, { agentId: builder, lane: 'core', leaseMs: 2 * HOUR, freeze });
- store.submit(moving.board, done, { agentId: builder, commit, tree: 'tree' });
+ submitFixture(moving.board, done, { agentId: builder, commit, tree: 'tree' });
store.verify(moving.board, done, { agentId: reviewer, decision: 'ACCEPT', reason: 'CRITERION_MET', note: 'ran it', head: commit, digest: 'digest:Done', policy: 'any' });
store.merged(moving.board, done, { agentId: 'coordinator', commit });
moving.at(HOUR / 2);
@@ -262,7 +263,7 @@ test('health on a healthy board says nothing is stuck [A6]', async (t) => {
store.claim(moving.board, building, { agentId: builder, lane: 'core', leaseMs: 2 * HOUR, freeze });
const reviewing = store.addItem(moving.board, { by: 'coordinator', lane: 'core', title: 'Reviewing' });
store.claim(moving.board, reviewing, { agentId: second, lane: 'core', leaseMs: 2 * HOUR, freeze });
- store.submit(moving.board, reviewing, { agentId: second, commit, tree: 'tree' });
+ submitFixture(moving.board, reviewing, { agentId: second, commit, tree: 'tree' });
store.reserveReview(moving.board, reviewing, { agentId: reviewer, leaseMs: HOUR, policy: 'any' });
store.addItem(moving.board, { by: 'coordinator', lane: 'core', title: 'Fresh work' });
const asked = store.shout(moving.board, { from: builder, to: 'coordinator', text: 'Which wording?', lanes: ['core', 'docs', 'review'], decision: true });
diff --git a/test/machine.test.js b/test/machine.test.js
index 0993a35f..13dba751 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -3,6 +3,7 @@
* The item lifecycle's declaration (M1, M2, M4): sound on its own terms, each property shown
* failing on a broken copy, and in step with the refusals the board, CLI and spec parser raise today.
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
@@ -589,7 +590,7 @@ function boardOnDisk(clock) {
function submittedItem(board) {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Page' });
store.claim(board, id, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
- store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree' });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_A, tree: 'tree' });
return id;
}
@@ -914,7 +915,7 @@ test('claim refuses in the declared order, one failure peeled at a time, on a re
holdByHand(raw, target, 'web-2');
store.claim(board, spare, { agentId: strong, lane: 'web', leaseMs: 7_200_000, freeze });
store.claim(board, dependency, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
- store.submit(board, dependency, { agentId: 'web-1', commit: SHA_A, tree: 'tree' });
+ submitFixture(board, dependency, { agentId: 'web-1', commit: SHA_A, tree: 'tree' });
store.holdLane(board, 'web', { agentId: 'coordinator', reason: 'pause' });
store.holdItem(board, target, { agentId: 'coordinator', reason: 'item pause' });
const fired = [claimAs(999, light, 'api'), claimAs(done, light, 'api'), claimAs(target, light, 'api')];
@@ -944,7 +945,7 @@ test('submit, accept and reject refuse in the declared order, one failure peeled
try {
const { board } = lab;
const light = store.register(board, { lane: 'web', path: '/repo-web-light', route: 'light' });
- const submitAs = (id, agentId, commit) => outcome(() => store.submit(board, id, { agentId, commit, tree: 'tree' }));
+ const submitAs = (id, agentId, commit) => outcome(() => submitFixture(board, id, { agentId, commit, tree: 'tree' }));
const piece = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Page' });
const submits = [submitAs(999, 'web-1', SHA_A), submitAs(piece, 'web-1', SHA_A)];
store.claim(board, piece, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
@@ -953,9 +954,9 @@ test('submit, accept and reject refuse in the declared order, one failure peeled
submits.push(submitAs(piece, 'web-1', SHA_A));
assert.equal(submits.at(-1), 'PENDING_REFREEZE', 'a pending correction stops the board submission before later guards');
store.refreeze(board, piece, { agentId: 'web-1', freeze });
- submits.push(outcome(() => store.submit(board, piece, { agentId: 'web-1', commit: SHA_A, tree: 'tree',
+ submits.push(outcome(() => submitFixture(board, piece, { agentId: 'web-1', commit: SHA_A, tree: 'tree',
submissionProof: { version: 99, files: [], full: false, deferred: true, reason: '' } })));
- store.submit(board, piece, { agentId: 'web-1', commit: SHA_A, tree: 'tree' });
+ submitFixture(board, piece, { agentId: 'web-1', commit: SHA_A, tree: 'tree' });
verdictOn(board, piece, 'web-2', 'REJECT');
store.claim(board, piece, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
const child = store.addItem(board, { by: 'web-1', lane: 'web', title: 'Part', parentId: piece });
@@ -1068,7 +1069,7 @@ test('a reserved review refuses every other verdict while its lease lives, and o
assert.equal(holder(), null, 'but holds nothing once the item leaves submitted, though its lease lives until 13:21');
store.claim(board, id, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
- store.submit(board, id, { agentId: 'web-1', commit: SHA_B, tree: 'tree' });
+ submitFixture(board, id, { agentId: 'web-1', commit: SHA_B, tree: 'tree' });
assert.equal(store.getItem(board, id).item_review_by, null, 'a new submission starts with no reservation');
assert.equal(offered('web-2').item.item_id, id, 'though the last lease would live until 13:21');
diff --git a/test/merged.test.js b/test/merged.test.js
index 20d11481..5c983233 100644
--- a/test/merged.test.js
+++ b/test/merged.test.js
@@ -1,4 +1,5 @@
/** Merged receipts only record item work on the primary trunk, unless noted [R3,R1]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { execFileSync, spawnSync } from 'node:child_process';
@@ -73,7 +74,7 @@ async function fixture(t) {
execFileSync('git', ['add', 'web/work.txt'], { cwd: builder, env });
execFileSync('git', ['commit', '-q', '-m', 'feat(web): retain item work [G1]'], { cwd: builder, env });
const itemCommit = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: builder, env, encoding: 'utf8' }).trim();
- store.submit(board, id, { agentId, commit: itemCommit, tree: execFileSync('git', ['rev-parse', 'HEAD^{tree}'], { cwd: builder, env, encoding: 'utf8' }).trim() });
+ submitFixture(board, id, { agentId, commit: itemCommit, tree: execFileSync('git', ['rev-parse', 'HEAD^{tree}'], { cwd: builder, env, encoding: 'utf8' }).trim() });
store.verify(board, id, { agentId: 'coordinator', decision: 'ACCEPT', note: 'confirmed the committed file', head: itemCommit, digest, policy: 'any' });
return { dir, repo, builder, env, git, board, id, base, itemCommit };
}
diff --git a/test/next-order.test.js b/test/next-order.test.js
index 951457a3..33429b37 100644
--- a/test/next-order.test.js
+++ b/test/next-order.test.js
@@ -1,4 +1,5 @@
/** Roadmap position leads next's existing route order only across unfinished milestones [B16]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { test } from 'node:test';
import * as store from '../src/board.js';
@@ -35,7 +36,7 @@ function submitted(board, builder, title, route, number) {
});
store.claim(board, id, { agentId: builder, lane: 'core', leaseMs: HOUR, freeze: FREEZE });
const hash = String(number).repeat(40);
- store.submit(board, id, { agentId: builder, commit: hash, tree: hash });
+ submitFixture(board, id, { agentId: builder, commit: hash, tree: hash });
return id;
}
diff --git a/test/next-verify.test.js b/test/next-verify.test.js
index 08647d67..8edcfc27 100644
--- a/test/next-verify.test.js
+++ b/test/next-verify.test.js
@@ -1,4 +1,5 @@
/** A reviewer who starts before the builder submits is told the builder is still working [C7,P4]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { chmodSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -83,7 +84,7 @@ test('[C7,P4] next --verify with nothing submitted yet says the builder is still
assert.doesNotMatch(said, /NOTHING_FREE/u, 'no NOTHING_FREE when work is in progress');
assert.equal(store.getItem(box.board, id).item_review_by, null, 'nothing is reserved');
- store.submit(box.board, id, { agentId: box.builderId, commit: String(id).padStart(40, 'a'), tree: String(id).padStart(40, 'b') });
+ submitFixture(box.board, id, { agentId: box.builderId, commit: String(id).padStart(40, 'a'), tree: String(id).padStart(40, 'b') });
const ready = await run(box, box.reviewer, ['next', '--verify']);
assert.equal(ready.code, 0, ready.stderr);
assert.match(ready.stdout, new RegExp(`next to verify: #${id} Being built`, 'u'));
diff --git a/test/products.test.js b/test/products.test.js
index 46fd61a5..1e99fbb1 100644
--- a/test/products.test.js
+++ b/test/products.test.js
@@ -3,6 +3,7 @@
* a lane belongs to is read from the spec each time; status prints each product's standing, and
* spec check catches an entry that names no row.
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { runFixtureChild, runFixtureGit } from './fixture-child.js';
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -122,12 +123,12 @@ test('in a real repo, status prints each product, and spec check fails on an ent
const claim = (id, agentId, lane) => store.claim(board, id, { agentId, lane, leaseMs: 7_200_000, freeze });
const leases = add('board', 'Leases', ['B1']);
claim(leases, 'board-1', 'board');
- store.submit(board, leases, { agentId: 'board-1', commit: SHA, tree: 't' });
+ submitFixture(board, leases, { agentId: 'board-1', commit: SHA, tree: 't' });
store.verify(board, leases, { agentId: 'web-1', decision: 'ACCEPT', head: SHA, digest: 'digest:Leases', policy: 'any', note: 'reverted the lease check; its test went red; restored' });
claim(add('board', 'Holders', ['B2']), 'board-1', 'board');
const sidebar = add('web', 'Sidebar', ['N26.1']);
claim(sidebar, 'web-1', 'web');
- store.submit(board, sidebar, { agentId: 'web-1', commit: SHA, tree: 't' });
+ submitFixture(board, sidebar, { agentId: 'web-1', commit: SHA, tree: 't' });
add('web', 'Projects', ['N26']);
add('board', 'Next', ['N1']);
} finally {
diff --git a/test/relay-client.test.js b/test/relay-client.test.js
index 33a73acc..201ea0c7 100644
--- a/test/relay-client.test.js
+++ b/test/relay-client.test.js
@@ -1105,6 +1105,8 @@ async function recoverReplicaReplies(fixture, timing) {
commit: freshStackCommit,
tree: gitAt(worktrees[2], envs[2], 'rev-parse', 'HEAD^{tree}'),
files: ['web/recovery-a.txt', 'web/recovery-fresh.txt'],
+ submissionProof: { version: 1, files: [], full: false, deferred: true,
+ reason: 'synthetic recovery descriptor; no gate execution' },
policyCommit: gitAt(clones[2], envs[2], 'rev-parse', 'main'),
}];
fabricatedReceiptlessMove = prepareEngineMove(freshBoard, 'submit', args);
diff --git a/test/relay-sealed.test.js b/test/relay-sealed.test.js
index dc666fb6..b4c4050e 100644
--- a/test/relay-sealed.test.js
+++ b/test/relay-sealed.test.js
@@ -1,4 +1,5 @@
/** Two real clients and encrypted CLI records exercise the relay without sharing their key [A4,H7]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { createCipheriv, createDecipheriv, createHash, randomBytes } from 'node:crypto';
import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, cleanupFixtureChildren, runFixtureChild, runFixtureGit, runFixtureChildAsync } from './fixture-child.js';
@@ -411,7 +412,7 @@ test('two real clients refuse forged relay actors and person-only requests while
const lane = store.getItem(source, 1).item_lane;
assert.equal(store.register(source, { lane: 'remote', path: join(box.directory, 'remote') }), 'remote-1');
store.claim(source, 1, { agentId: 'remote-1', lane, leaseMs: 3600000, freeze: () => ({ text: '{}', digest: 'd'.repeat(64) }) });
- store.submit(source, 1, { agentId: 'remote-1', commit: 'a'.repeat(40), tree: 'b'.repeat(40) });
+ submitFixture(source, 1, { agentId: 'remote-1', commit: 'a'.repeat(40), tree: 'b'.repeat(40) });
question = store.shout(source, { from: 'coordinator', to: 'person', text: 'Private person decision', decision: true, lanes: [lane] });
checkpointSequence(source, 0);
moves = [
@@ -530,7 +531,7 @@ test('two real clients enforce the verify policy captured in the item freeze [H1
assert.equal(JSON.parse(refreshed.item_frozen).policy.version, 1, 'explicit refreeze repairs malformed captured policy metadata');
assert.deepEqual(JSON.parse(refreshed.item_frozen).policy.verify, { policy: 'coordinator', family: 'require' }, 'explicit native refreeze upgrades the legacy claim policy');
assert.notEqual(refreshed.item_frozen_digest, legacyDigest, 'explicit refreeze establishes a new digest for the newly captured policy');
- store.submit(afterRefreeze, 1, { agentId: builderId, commit, tree, files: [] });
+ submitFixture(afterRefreeze, 1, { agentId: builderId, commit, tree, files: [] });
store.register(afterRefreeze, { lane: 'coordinator', path: box.root, family: 'Coordinator Family' });
store.register(afterRefreeze, { lane, path: join(box.directory, 'verifier-same'), family: 'Builder Family' });
verifierSame = store.agentAt(afterRefreeze, join(box.directory, 'verifier-same')).agent_id;
@@ -546,7 +547,7 @@ test('two real clients enforce the verify policy captured in the item freeze [H1
const makeSubmitted = (title, verify, version = 1) => {
const id = store.addItem(afterRefreeze, { by: 'coordinator', lane, title });
store.claim(afterRefreeze, id, { agentId: builderId, lane, leaseMs: 3_600_000, freeze: makeFrozen(verify, version), head: commit });
- store.submit(afterRefreeze, id, { agentId: builderId, commit, tree, files: [] });
+ submitFixture(afterRefreeze, id, { agentId: builderId, commit, tree, files: [] });
return store.getItem(afterRefreeze, id);
};
const legacy = makeSubmitted('legacy frozen verify without policy capture', null);
diff --git a/test/resume-flow.test.js b/test/resume-flow.test.js
index ce48ed90..3beaa340 100644
--- a/test/resume-flow.test.js
+++ b/test/resume-flow.test.js
@@ -1,4 +1,5 @@
/** Coordinator flow alerts reuse the real Git/SQLite statistics and documented thresholds [N32,R1,R2]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
@@ -286,7 +287,7 @@ function fixture(t, { wait = null, age = null, reservation = null, otherAge = nu
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Flow fixture' });
store.claim(board, id, { agentId: builder, lane: 'web', leaseMs: 1000 * MINUTE, freeze });
at = submitted;
- store.submit(board, id, { agentId: builder, commit: 'a'.repeat(40), tree: 'b'.repeat(40) });
+ submitFixture(board, id, { agentId: builder, commit: 'a'.repeat(40), tree: 'b'.repeat(40) });
return id;
}
if (wait !== null) {
diff --git a/test/review-queue-cli.test.js b/test/review-queue-cli.test.js
index 221d9ad9..02bd366c 100644
--- a/test/review-queue-cli.test.js
+++ b/test/review-queue-cli.test.js
@@ -1,4 +1,5 @@
/** Real CLI and authenticated API review suggestions preserve explicit build and review intent [Q1,V15,A1,A2]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { createHash, randomUUID } from 'node:crypto';
import { runFixtureGit } from './fixture-child.js';
@@ -71,7 +72,7 @@ function submitted(box, builder = box.peerId) {
const text = JSON.stringify({ rows: [{ id: 'G1', text: 'Every move keeps its evidence.', gate: 'true' }] });
store.claim(box.board, id, { agentId: builder, lane: 'web', leaseMs: HOUR,
freeze: () => ({ text, digest: createHash('sha256').update(text).digest('hex') }) });
- store.submit(box.board, id, { agentId: builder, commit: String(id).padStart(40, 'a'), tree: String(id).padStart(40, 'b') });
+ submitFixture(box.board, id, { agentId: builder, commit: String(id).padStart(40, 'a'), tree: String(id).padStart(40, 'b') });
return id;
}
@@ -194,7 +195,7 @@ test('[V1,R1] a review released without a verdict waits an hour for the same rev
assert.equal(rejectedReserve.data.error.code, 'NOT_SUBMITTED', 'an old cooldown must not mask the item-state refusal');
store.claim(box.board, released, { agentId: box.peerId, lane: 'web', leaseMs: HOUR,
freeze: (current) => ({ text: current.item_frozen, digest: current.item_frozen_digest }) });
- store.submit(box.board, released, { agentId: box.peerId, commit: createHash('sha1').update('resubmitted review item').digest('hex'),
+ submitFixture(box.board, released, { agentId: box.peerId, commit: createHash('sha1').update('resubmitted review item').digest('hex'),
tree: createHash('sha1').update('resubmitted review tree').digest('hex') });
const afterResubmit = await run(box, box.reviewer, ['next', '--verify', String(released), '--json']);
assert.equal(afterResubmit.code, 0, afterResubmit.stderr);
diff --git a/test/review-queue-replay.test.js b/test/review-queue-replay.test.js
index 1ddbb5c1..55f9493c 100644
--- a/test/review-queue-replay.test.js
+++ b/test/review-queue-replay.test.js
@@ -1,4 +1,5 @@
/** In-memory engine replay coverage for sealed review-skipped snapshots [Q1,V15,H3,H16]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { test } from 'node:test';
import * as store from '../src/board.js';
@@ -82,7 +83,7 @@ test('v4 review releases keep their replay semantics; v5 notes add cooldowns [V1
for (const board of [legacyBoard, currentBoard]) {
store.claim(board, item, { agentId: 'web-1', lane: 'web', leaseMs: LEASE_MS,
freeze: () => ({ text: 'review criterion', digest: 'c'.repeat(64) }) });
- store.submit(board, item, { agentId: 'web-1', commit: 'a'.repeat(40), tree: 'b'.repeat(40) });
+ submitFixture(board, item, { agentId: 'web-1', commit: 'a'.repeat(40), tree: 'b'.repeat(40) });
store.reserveReview(board, item, { agentId: 'web-2', leaseMs: LEASE_MS, policy: 'any' });
}
assert.throws(() => prepareEngineMove(currentBoard, 'release', [item, 'web-2']), (error) => error.code === 'NOTE_REQUIRED');
diff --git a/test/review-queue.test.js b/test/review-queue.test.js
index 11f1e361..2b0525ad 100644
--- a/test/review-queue.test.js
+++ b/test/review-queue.test.js
@@ -1,4 +1,5 @@
/** A review offer accounts for backlog, live reservations and reviewer eligibility [Q1,V15]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import { test } from 'node:test';
@@ -40,7 +41,7 @@ function submitted(board, { builder, lane = 'web', route = 'strong', title }) {
store.claim(board, id, { agentId: builder, lane, leaseMs: HOUR, freeze });
const commit = createHash('sha1').update(`commit:${title}`).digest('hex');
const tree = createHash('sha1').update(`tree:${title}`).digest('hex');
- store.submit(board, id, { agentId: builder, commit, tree });
+ submitFixture(board, id, { agentId: builder, commit, tree });
return id;
}
diff --git a/test/rigor.test.js b/test/rigor.test.js
index 5e7cb4e2..9819eb13 100644
--- a/test/rigor.test.js
+++ b/test/rigor.test.js
@@ -1,4 +1,5 @@
/** Rigor: a repeated failure cause is noticed from structured fields, never from notes [D1,V1]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { chmodSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
@@ -83,7 +84,7 @@ function history(file) {
const submit = (id) => {
store.claim(board, id, { agentId: builder, lane: 'app', leaseMs: 2 * HOUR, freeze });
const sha = commit();
- store.submit(board, id, { agentId: builder, commit: sha, tree: `tree-${sha}` });
+ submitFixture(board, id, { agentId: builder, commit: sha, tree: `tree-${sha}` });
return sha;
};
/** Reject the current submission, naming a cause key or none. */
diff --git a/test/show.test.js b/test/show.test.js
index 99306a20..74815816 100644
--- a/test/show.test.js
+++ b/test/show.test.js
@@ -2,6 +2,7 @@
* show stays short to read (N30): the latest verdict in full, each earlier one as a line, and every
* note in full on --history or --json.
*/
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { runFixtureExecFile as execFileSync, runFixtureChild } from './fixture-child.js';
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -84,7 +85,7 @@ test('show prints the latest verdict in full and earlier ones as one line; --his
notes.forEach((note, round) => {
const commit = letters[round].repeat(40);
store.claim(board, id, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
- store.submit(board, id, { agentId: 'web-1', commit, tree: 't' });
+ submitFixture(board, id, { agentId: 'web-1', commit, tree: 't' });
const decision = round < notes.length - 1 ? 'REJECT' : 'ACCEPT';
const reason = decision === 'REJECT' ? 'TEST_FAILURE' : undefined;
store.verify(board, id, { agentId: 'web-2', decision, reason, note, head: commit, digest: freeze(store.getItem(board, id)).digest, policy: 'any' });
diff --git a/test/stacked-submit.test.js b/test/stacked-submit.test.js
index 513d49ae..29b7bdbe 100644
--- a/test/stacked-submit.test.js
+++ b/test/stacked-submit.test.js
@@ -1,4 +1,5 @@
/** A candidate cannot carry another item's unverified submission through submit or accept [V17]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { mkdirSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
@@ -71,7 +72,7 @@ test('[V17] accept refuses a historical candidate stacked on another item', () =
const stackedCommit = commitFile(box, box.web, 'web/stacked.txt', 'historical stacked submission');
const board = store.openBoard(join(box.repo, '.git/pullboard/board.sqlite'));
try {
- store.submit(board, stacked, {
+ submitFixture(board, stacked, {
agentId: 'web-1',
commit: stackedCommit,
tree: box.git(box.web, 'rev-parse', 'HEAD^{tree}'),
@@ -103,7 +104,7 @@ function trunkStack(box, { historical = false } = {}) {
if (historical) {
const board = store.openBoard(join(box.repo, '.git/pullboard/board.sqlite'));
try {
- store.submit(board, stacked, {
+ submitFixture(board, stacked, {
agentId: 'coordinator',
commit: trunkHead,
tree: box.git(box.repo, 'rev-parse', 'HEAD^{tree}'),
diff --git a/test/stats-cli.test.js b/test/stats-cli.test.js
index 51b30333..90ed1108 100644
--- a/test/stats-cli.test.js
+++ b/test/stats-cli.test.js
@@ -1,4 +1,5 @@
/** Event-derived proof numbers have the same data in text and versioned JSON [R1,R2,A1]. */
+import { submitFixture } from './board-submit-fixture.js';
import assert from 'node:assert/strict';
import { runFixtureGit } from './fixture-child.js';
import { mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -38,7 +39,7 @@ function fixture(t) {
const freeze = () => ({ text: 'Proof fixture', digest: 'frozen' });
const submit = (commit) => {
store.claim(board, id, { agentId: builder, lane: 'web', leaseMs: 3_600_000, freeze });
- store.submit(board, id, { agentId: builder, commit, tree: 'b'.repeat(40) });
+ submitFixture(board, id, { agentId: builder, commit, tree: 'b'.repeat(40) });
};
submit('a'.repeat(40));
store.verify(board, id, { agentId: reviewer, decision: 'REJECT', reason: 'TEST_FAILURE', note: 'Fixture rejects the first attempt.', head: 'a'.repeat(40), digest: 'frozen', policy: 'any' });
diff --git a/test/submit-invariants.test.js b/test/submit-invariants.test.js
index 2e763066..cafda355 100644
--- a/test/submit-invariants.test.js
+++ b/test/submit-invariants.test.js
@@ -7,6 +7,7 @@ import * as store from '../src/board.js';
import { appliedSequence, applyEngineMove, applyRelayMove, prepareEngineMove } from '../src/engine.js';
import { exportBoard, importBoard } from '../src/exchange.js';
import { SUBMISSION_PROOF_ENGINE, landingFileTimes } from '../src/submit-invariants.js';
+import { ENGINE_VERSION } from '../src/machine.js';
import { landingFailures } from '../src/land.js';
import { createE2eHelpers } from './e2e-helpers.js';
@@ -235,7 +236,8 @@ test('a landing escape is proposed as a submit invariant only when modern submit
{id:'modern-missing-selection',actor:'web-1'});
// Forge the missing wire field after valid preparation so the receiver assertion remains independent.
delete move.args[1].submissionProof;
- assert.equal(move.engine,SUBMISSION_PROOF_ENGINE,'the envelope is the current allocated engine34');
+ assert.equal(SUBMISSION_PROOF_ENGINE,34,'submission receipts keep their stable first engine');
+ assert.equal(move.engine,ENGINE_VERSION,'the new envelope uses the current engine, separately from the minimum');
assert.equal(Object.hasOwn(move.args[1],'submissionProof'),false);
const legacyMove = {...move,engine:33,id:'legacy33-missing-selection'};
const legacyResult = applyRelayMove(legacyTarget,legacyMove,{sequence:1,at:'2026-10-17T00:00:00.000Z',kind:'move',sender:{kind:'agent',userId:'fixture',agent:'web-1'}});
@@ -251,6 +253,8 @@ test('a landing escape is proposed as a submit invariant only when modern submit
assert.equal(result.error?.code,'SUBMISSION_PROOF','a current engine submit must record a selection instead of silently becoming unknown history');
assert.equal(store.getItem(target,id).item_status,'claimed');
assert.equal(store.events(target).length,count);
+ assert.throws(() => store.submit(source,id,options), {code:'SUBMISSION_PROOF'},
+ 'a current local board submission also refuses missing selection');
assert.throws(() => prepareEngineMove(source,'submit',[id,options],
{id:'producer-missing-selection',actor:'web-1'}), {code:'SUBMISSION_PROOF'},
'the current producer refuses a missing receipt before sealing a move');