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(cli): submit runs the gate itself; no stamp stands in [V16]

Corey Olson7cb8b95d84d7
diff --git a/docs/lifecycle.md b/docs/lifecycle.md
index e0d1898d..b28fe983 100644
--- a/docs/lifecycle.md
+++ b/docs/lifecycle.md
@@ -46,7 +46,7 @@ Each move checks its guards in this order and refuses with the first one that do
| claim | open, claimed | claimed | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_CLAIMABLE), inLane (WRONG_LANE), routeAllows (ROUTE), dependenciesVerified (BLOCKED), notHeldByAnother (HELD), laneOpen (LANE_HELD), oneLiveClaim (ONE_CLAIM), rowsInForce (UNKNOWN_SPEC) |
| release | claimed | open | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_YOURS), isHolder (NOT_YOURS) |
| lapse | claimed | open | clock, when its lease runs out | none |
-| submit | claimed | submitted | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_YOURS), isHolder (NOT_YOURS), criterionUnchanged (CRITERIA_CHANGED), treeClean (DIRTY), nothingUntracked (UNTRACKED), hasCommit (NO_COMMIT), gateConfigured (NO_GATE), gateGreen (GATE_RED), childrenDone (CHILDREN_OPEN), headIsNew (HEAD_NOT_NEW) |
+| submit | claimed | submitted | agent, coordinator | joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_YOURS), isHolder (NOT_YOURS), criterionUnchanged (CRITERIA_CHANGED), treeClean (DIRTY), nothingUntracked (UNTRACKED), hasCommit (NO_COMMIT), gateConfigured (NO_GATE), gateGreen (GATE_RED), treeStillDuringGate (MOVED_DURING_GATE), childrenDone (CHILDREN_OPEN), headIsNew (HEAD_NOT_NEW) |
| reserve | submitted | submitted | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), reviewFree (REVIEW_HELD) |
| accept | submitted | verified | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonIsMet (BAD_REASON), proofNoted (PROOF_REQUIRED) |
| reject | submitted | open | agent, coordinator | coordinatorSaysAs (MAIN_IS_COORDINATOR), joined (NOT_JOINED), itemExists (NO_ITEM), inState (NOT_SUBMITTED), atSubmittedCommit (NOT_AT_COMMIT), notBuilder (SELF_VERIFY), routeAllows (ROUTE), policyAllows (COORDINATOR_VERIFIES), reviewFree (REVIEW_HELD), criterionUnchanged (CRITERIA_CHANGED), reasonCoded (BAD_REASON), noteGiven (NOTE_REQUIRED) |
@@ -92,7 +92,8 @@ Each move checks its guards in this order and refuses with the first one that do
| UNTRACKED | the worktree has no untracked files | commit or ignore them, then submit |
| NO_COMMIT | there is a commit to submit | commit your work, then submit |
| NO_GATE | the repo names a gate command | set "gate" in pullboard.json, e.g. "npm test" |
-| GATE_RED | the gate is green at HEAD | fix what the digest names, commit, submit again |
+| GATE_RED | the gate, which submit runs itself every time, is green at HEAD | fix what the digest names, commit, submit again |
+| MOVED_DURING_GATE | HEAD and every tracked file stayed as they were while the gate ran | 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 |
| NOT_AT_COMMIT | the caller's checkout contains the submitted commit | git switch --detach <commit> |
diff --git a/docs/proof/verification-mutants.mjs b/docs/proof/verification-mutants.mjs
index 1daa75cb..e2524c32 100644
--- a/docs/proof/verification-mutants.mjs
+++ b/docs/proof/verification-mutants.mjs
@@ -1,5 +1,5 @@
/**
- * The proof audit of the verification rows, V1 to V9 (item #48): for each row, one or more changes to
+ * The proof audit of the verification rows, V1 to V9 (item #48) and V16 (item #51): for each row, one or more changes to
* src/ that break the row's rule, and the tagged test that must go red under each. It copies the
* repo to a fresh temporary folder and works only there, so it never changes a real checkout.
*
@@ -11,7 +11,7 @@ import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
const ROOT = resolve(import.meta.dirname, '..', '..');
-const COPIED = ['src', 'bin', 'test', 'templates', 'skills', 'package.json', 'PRACTICE.md'];
+const COPIED = ['src', 'bin', 'test', 'skills', 'package.json', 'PRACTICE.md'];
const VERIFY_AT_COMMIT = ['test/e2e.test.js', 'verify runs at the submitted commit, against the criterion frozen at claim'];
const CLEAN_TREE = ['test/e2e.test.js', 'submit needs a clean tree, nothing untracked, and the gate green at HEAD'];
@@ -20,6 +20,10 @@ const BOARD_CRITERION = ['src/board.js', ' criterionUnchanged: (found) =>
const CLI_CRITERION = ['src/cli.js', 'if (digest !== item.item_frozen_digest) {', 'if (false) {'];
const RED_GATE = ['src/cli.js', "if (!gate.isGreen) throw new Refused('GATE_RED'", "if (false) throw new Refused('GATE_RED'"];
const VERDICT_ROW = '.run(id, agentId, decision, code, note.trim(), found.item_commit, digest, head, now(board));';
+const SUBMIT_RUN = 'const gate = runGate(root, ctx.config, { trustStamp: false });';
+const MOVED = 'if (headCommit(root) !== commit || !isClean(root)) {';
+const HAND_STAMP = ['test/gate.test.js', 'a stamp written by hand never stands in'];
+const MOVED_TREE = ['test/gate.test.js', 'submit refuses a tree that moved while its gate ran'];
/** Row, the change, its edits as [file, from, to], the test that judges it, and the outcome expected. */
const MUTANTS = [
@@ -43,6 +47,12 @@ const MUTANTS = [
['V8', "a verdict binds the verifier's head as the commit", [['src/board.js', VERDICT_ROW, VERDICT_ROW.replace('found.item_commit', 'head')]], ['test/board.test.js', 'every verdict binds the submitted commit'], 'red'],
['V8', 'a verdict binds no digest', [['src/board.js', VERDICT_ROW, VERDICT_ROW.replace('digest, head', "'none', head")]], ['test/board.test.js', 'every verdict binds the submitted commit'], 'red'],
['V9', 'the main checkout verifies without --as coordinator', [['src/cli.js', ' if (values.as === COORDINATOR) return;\n const agents = store.listAgents(board)', ' return;\n const agents = store.listAgents(board)']], VERIFY_AT_COMMIT, 'red'],
+ ['V16', 'submit trusts a stamp written by hand', [['src/cli.js', SUBMIT_RUN, 'const gate = runGate(root, ctx.config);']], HAND_STAMP, 'red'],
+ ['V16', "submit trusts an earlier run's stamp", [['src/cli.js', SUBMIT_RUN, 'const gate = runGate(root, ctx.config);']], ['test/gate.test.js', 'submit runs the gate even on a tree an earlier run passed'], 'red'],
+ ['V16', 'the gate trusts the stamp whatever submit asks', [['src/gate.js', 'if (trustStamp && isStampedGreen(root))', 'if (isStampedGreen(root))']], HAND_STAMP, 'red'],
+ ['V16', 'submit does not look whether the tree moved', [['src/cli.js', MOVED, 'if (false) {']], MOVED_TREE, 'red'],
+ ['V16', 'submit misses a commit made during the gate', [['src/cli.js', MOVED, 'if (!isClean(root)) {']], MOVED_TREE, 'red'],
+ ['V16', 'submit misses a tracked file edited during the gate', [['src/cli.js', MOVED, 'if (headCommit(root) !== commit) {']], MOVED_TREE, 'red'],
];
const copy = mkdtempSync(join(tmpdir(), 'pullboard-proof-'));
diff --git a/docs/proof/verification.md b/docs/proof/verification.md
index 795db4f4..7b3dea0f 100644
--- a/docs/proof/verification.md
+++ b/docs/proof/verification.md
@@ -1,4 +1,4 @@
-# Proof audit: the verification rows, V1 to V9
+# Proof audit: the verification rows, V1 to V9 and V16
Each verification row was built before the board could verify anything, so no accepted item vouched for it. This audit breaks each row's rule in `src/`, one change at a time, and checks that a test carrying the row's id goes red. A row whose tests stay green under a broken rule is not proven, however long its tests have passed.
@@ -21,6 +21,10 @@ Re-run it with `node docs/proof/verification-mutants.mjs`. It copies the repo to
| V7 | The verifier's checkout contains the submitted commit. | verify skips the containment check | verify runs at the submitted commit, against the criterion frozen at claim | red |
| V8 | Every verdict binds the submitted commit and the frozen digest. | the verdict records the verifier's head as the commit; the verdict records no digest | every verdict binds the submitted commit and the frozen digest | red, both |
| V9 | In the main checkout, verifying needs --as coordinator. | the main checkout verifies without --as | verify runs at the submitted commit, against the criterion frozen at claim | red, **once tagged V9 by this audit** |
+| V16 | Submit runs the gate itself on the exact tree it submits; no stamp from an earlier run stands in. | submit trusts a stamp written by hand | submit runs the gate itself: a stamp written by hand never stands in for a red gate | red |
+| V16 | | submit trusts an earlier run's stamp | submit runs the gate even on a tree an earlier run passed, which a plain gate run may skip | red |
+| V16 | | the gate trusts the stamp whatever submit asks | submit runs the gate itself: a stamp written by hand never stands in for a red gate | red |
+| V16 | | submit does not look whether the tree moved; it misses a new commit; it misses an edited tracked file (three changes) | submit refuses a tree that moved while its gate ran: a new commit, or an edited tracked file | red, all three |
## What the audit changed
@@ -28,9 +32,9 @@ Re-run it with `node docs/proof/verification-mutants.mjs`. It copies the repo to
- **V4:** the red-gate case was tested by "a red gate refuses submit", which carried no row id. So the row's own test went green with the red-gate refusal removed. That test now carries V4.
- **V9:** the main-checkout rule was checked inside the V3 and V7 test, but no test named V9. That test now carries V9.
-## Open finding: a hand-written stamp passes a red gate (V4, drafted as V16)
+## Closed: a hand-written stamp passed a red gate (V4, closed by V16 in #51)
-`runGate` skips the gate when `pullboard-gate-green` in the git dir holds the committed tree's hash, and any agent can write that file. Reproduced on a fresh repo whose gate was red:
+`runGate` skipped the gate when `pullboard-gate-green` in the git dir held the committed tree's hash, and any agent can write that file. The audit reproduced it on a fresh repo whose gate was red:
```
pullboard submit 1 -> [GATE_RED] the gate is red at 8c6b3057c8d7
@@ -38,4 +42,4 @@ git rev-parse 'HEAD^{tree}' > "$(git rev-parse --git-path pullboard-gate-green)"
pullboard submit 1 -> submitted #1 at 8c6b3057c8d7; gate green (this tree already passed)
```
-So V4's "the gate green at HEAD" holds only for agents that don't forge the stamp. On one machine, any file pullboard writes an agent can write too. V16, drafted in SPEC.md, has submit run the gate itself on the tree it submits. Until then, a verifier's own gate run at the submitted commit is the only real check of a green gate.
+On one machine, any file pullboard writes an agent can write too, so no stamp can be made safe to trust. Since #51, submit runs the gate itself every time and refuses MOVED_DURING_GATE if HEAD or a tracked file changes while it runs. The stamp now only saves a run where nothing is proven by it: pre-push and `pullboard gate` (C3). Gitignored files that a gate may read are still out of scope; a fresh checkout per submit would be the next step.
diff --git a/src/board.js b/src/board.js
index 2da4750e..8922caed 100644
--- a/src/board.js
+++ b/src/board.js
@@ -808,6 +808,7 @@ export function submit(board, id, { agentId, commit, tree, files = [] }) {
hasCommit: null,
gateConfigured: null,
gateGreen: null,
+ treeStillDuringGate: null,
childrenDone: () => {
const { total } = board.db
.prepare("SELECT COUNT(*) AS total FROM item WHERE item_parent_id = ? AND item_status IN ('open', 'claimed', 'submitted')")
diff --git a/src/cli.js b/src/cli.js
index 3d5a940c..7cf3bb80 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -809,8 +809,16 @@ function submitHere(ctx, id) {
if (stray.length) throw new Refused('UNTRACKED', `commit or ignore ${stray.length} untracked file(s), e.g. ${stray[0]}`);
const commit = headCommit(root);
if (!commit) throw new Refused('NO_COMMIT', 'nothing committed yet');
- const gate = runGate(root, ctx.config);
+ // Submit runs the gate itself, every time: a stamp from an earlier run is a file any agent can
+ // write, so it never stands in for this run (V16). The run must also see the tree as submitted.
+ const gate = runGate(root, ctx.config, { trustStamp: false });
if (!gate.isGreen) throw new Refused('GATE_RED', `the gate is red at ${commit.slice(0, 12)}; fix it, commit, submit again. ${gateReport(gate)}`);
+ if (headCommit(root) !== commit || !isClean(root)) {
+ throw new Refused(
+ 'MOVED_DURING_GATE',
+ `HEAD or a tracked file changed while the gate ran, so it did not check ${commit.slice(0, 12)} as you would submit it; leave the worktree alone until the gate finishes, then submit again`,
+ );
+ }
withBoard(ctx, (board) => store.submit(board, id, { agentId: me.id, commit, tree: headTree(root) ?? '', files: filesSince(root, id, claimHead, commit) }));
const pin = `refs/pullboard/items/${id}/${commit.slice(0, 12)}`;
git(root, ['update-ref', pin, commit]);
diff --git a/src/gate.js b/src/gate.js
index 9ccfefc1..b04725ae 100644
--- a/src/gate.js
+++ b/src/gate.js
@@ -102,15 +102,20 @@ export function runShell(root, command) {
* Run the configured gate in the repo, unless this exact tree already passed. Its output, both
* streams in order, is kept whole in the git dir and returned for a digest.
*
+ * A passed tree is marked by a stamp file in the git dir, which any agent can write. So the stamp
+ * only saves a run where nothing is proven by it, such as pre-push (C3); submit needs a run of its
+ * own and passes `trustStamp: false` (V16).
+ *
* @param {string} root
* @param {any} config
+ * @param {{ trustStamp?: boolean }} [options]
* @returns {{ isGreen: boolean, isCached: boolean, output: string, seconds: number, log: string }}
*/
-export function runGate(root, config) {
+export function runGate(root, config, { trustStamp = true } = {}) {
if (!config.gate.trim()) {
throw new Refused('NO_GATE', 'no gate configured; set "gate" in pullboard.json, e.g. "npm test"');
}
- if (isStampedGreen(root)) return { isGreen: true, isCached: true, output: '', seconds: 0, log: '' };
+ if (trustStamp && isStampedGreen(root)) return { isGreen: true, isCached: true, output: '', seconds: 0, log: '' };
const before = committedTree(root);
const { isGreen, output, seconds } = runShell(root, config.gate);
const log = gitPath(root, LOG);
diff --git a/src/machine.js b/src/machine.js
index 5e62ca97..62b7ed6e 100644
--- a/src/machine.js
+++ b/src/machine.js
@@ -110,7 +110,8 @@ export const GUARDS = [
{ id: 'nothingUntracked', refuse: 'UNTRACKED', rule: 'the worktree has no untracked files', next: 'commit or ignore them, then submit', source: 'cli' },
{ id: 'hasCommit', refuse: 'NO_COMMIT', rule: 'there is a commit to submit', next: 'commit your work, then submit', source: 'cli' },
{ id: 'gateConfigured', refuse: 'NO_GATE', rule: 'the repo names a gate command', next: 'set "gate" in pullboard.json, e.g. "npm test"', source: 'cli' },
- { id: 'gateGreen', refuse: 'GATE_RED', rule: 'the gate is green at HEAD', next: 'fix what the digest names, commit, submit again', source: 'cli' },
+ { id: 'gateGreen', refuse: 'GATE_RED', 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: 'HEAD and every tracked file stayed as they were while the gate ran', 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: 'atSubmittedCommit', refuse: 'NOT_AT_COMMIT', rule: "the caller's checkout contains the submitted commit", next: 'git switch --detach <commit>', source: 'cli' },
@@ -137,7 +138,7 @@ export const MOVES = [
{ verb: 'lapse', from: ['claimed'], to: 'open', by: ['clock'], guards: [], when: 'its lease runs out' },
{
verb: 'submit', from: ['claimed'], to: 'submitted', by: ['agent', 'coordinator'], refuse: 'NOT_YOURS',
- guards: ['joined', 'itemExists', IN_STATE, 'isHolder', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'gateConfigured', 'gateGreen', 'childrenDone', 'headIsNew'],
+ guards: ['joined', 'itemExists', IN_STATE, 'isHolder', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'gateConfigured', 'gateGreen', 'treeStillDuringGate', 'childrenDone', 'headIsNew'],
sets: ['item_built_by', 'item_commit'], command: 'pullboard submit <id>',
},
{
diff --git a/test/gate.test.js b/test/gate.test.js
index d9c640a1..4d7da957 100644
--- a/test/gate.test.js
+++ b/test/gate.test.js
@@ -1,10 +1,61 @@
/**
- * The gate's digest (V10): what an agent reads of a red run.
+ * The gate's digest (V10): what an agent reads of a red run. And submit's own run of the gate (V16):
+ * no stamp stands in for it, and the tree must hold still while it runs.
*/
import assert from 'node:assert/strict';
-import { test } from 'node:test';
+import { execFileSync, spawnSync } from 'node:child_process';
+import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+import { after, test } from 'node:test';
import { digestOf } from '../src/gate.js';
+const BIN = resolve(import.meta.dirname, '../bin/pullboard.js');
+const dirs = [];
+after(() => {
+ for (const dir of dirs) rmSync(dir, { recursive: true, force: true });
+});
+
+/**
+ * A repo whose coordinator holds item #1, with this gate. Every run of the gate first adds a line
+ * to runs.log beside the repo, so a test can count the runs.
+ *
+ * @param {string} gate
+ */
+function repoWithGate(gate) {
+ const dir = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-gate-')));
+ dirs.push(dir);
+ const repo = join(dir, 'repo');
+ mkdirSync(repo);
+ const env = {
+ ...process.env,
+ GIT_CONFIG_GLOBAL: '/dev/null',
+ GIT_CONFIG_NOSYSTEM: '1',
+ GIT_AUTHOR_NAME: 'Test Agent',
+ GIT_AUTHOR_EMAIL: '[email protected]',
+ GIT_COMMITTER_NAME: 'Test Agent',
+ GIT_COMMITTER_EMAIL: '[email protected]',
+ PULLBOARD_HOME: join(dir, 'home'),
+ };
+ const git = (...args) => execFileSync('git', args, { cwd: repo, env, encoding: 'utf8', stdio: 'pipe' }).trim();
+ const run = (...args) => spawnSync(process.execPath, [BIN, ...args], { cwd: repo, env, encoding: 'utf8', timeout: 60_000 });
+ git('init', '-q', '-b', 'main');
+ writeFileSync(join(repo, 'pullboard.json'), JSON.stringify({ gate: `echo run >> ../runs.log; ${gate}` }));
+ writeFileSync(join(repo, 'SPEC.md'), '# Demo\n\n## G · Goals\n- G1 [approved, must] It works. | gate: test\n');
+ git('add', '-A');
+ git('commit', '-q', '-m', 'chore: a spec');
+ assert.equal(run('add', 'coordinator', 'Work').status, 0);
+ assert.equal(run('claim', '1').status, 0);
+ const runs = () => {
+ try {
+ return readFileSync(join(dir, 'runs.log'), 'utf8').split('\n').filter(Boolean).length;
+ } catch {
+ return 0;
+ }
+ };
+ return { repo, git, run, runs };
+}
+
test('a digest keeps the failures and the end within its cap, however long one line is [V10]', () => {
const digest = digestOf(`not ok 1 - ${'x'.repeat(3500)}\n${'ok\n'.repeat(50)}# fail 1\nsummary: 1 failed`);
assert.ok(digest.length <= 3000, `${digest.length} characters`);
@@ -49,3 +100,42 @@ test('a digest keeps the lines that say why a test failed, and skips passing tes
assert.match(digest, / {4}2 !== 1\n {2}expected: 1\n {2}actual: 2/);
assert.match(digest, /# fail 1$/);
});
+
+test('submit runs the gate itself: a stamp written by hand never stands in for a red gate [V16]', () => {
+ const box = repoWithGate('test ! -f RED');
+ writeFileSync(join(box.repo, 'RED'), 'red\n');
+ box.git('add', 'RED');
+ box.git('commit', '-q', '-m', 'chore: turn the gate red');
+ writeFileSync(join(box.repo, box.git('rev-parse', '--git-path', 'pullboard-gate-green')), `${box.git('rev-parse', 'HEAD^{tree}')}\n`);
+ const refused = box.run('submit', '1');
+ assert.equal(refused.status, 1, refused.stdout);
+ assert.match(refused.stderr, /GATE_RED/);
+ assert.equal(box.runs(), 1, 'submit ran the gate instead of trusting the stamp');
+});
+
+test('submit runs the gate even on a tree an earlier run passed, which a plain gate run may skip [V16, C3]', () => {
+ const box = repoWithGate('true');
+ assert.equal(box.run('gate').status, 0);
+ assert.equal(box.runs(), 1);
+ assert.match(box.run('gate').stdout, /this tree already passed/);
+ assert.equal(box.runs(), 1, 'outside submit, the stamp still saves a run');
+ const submitted = box.run('submit', '1');
+ assert.equal(submitted.status, 0, submitted.stderr);
+ assert.match(submitted.stdout, /gate green in \d+s/);
+ assert.equal(box.runs(), 2, 'submit ran the gate itself, stamp or no stamp');
+});
+
+test('submit refuses a tree that moved while its gate ran: a new commit, or an edited tracked file [V16]', () => {
+ for (const [moves, gate] of [
+ ['a commit made during the gate', 'git commit -q --allow-empty -m "chore: moved under the gate"'],
+ ['a tracked file edited during the gate', 'echo more >> SPEC.md'],
+ ]) {
+ const box = repoWithGate(gate);
+ const head = box.git('rev-parse', 'HEAD');
+ const refused = box.run('submit', '1');
+ assert.equal(refused.status, 1, `${moves}: ${refused.stdout}`);
+ assert.match(refused.stderr, /MOVED_DURING_GATE/, moves);
+ assert.ok(refused.stderr.includes(head.slice(0, 12)), `${moves}: the refusal names the commit the gate was meant to check`);
+ assert.equal(box.runs(), 1, moves);
+ }
+});
diff --git a/test/machine.test.js b/test/machine.test.js
index 66628a34..85fee8af 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -747,7 +747,7 @@ test('pullboard help lists each role\'s moves from the declaration, and pullboar
/** Guards the CLI checks before it asks the board: the board's own order starts after them. */
const CLI_CHECKED = {
claim: ['joined'],
- submit: ['joined', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'gateConfigured', 'gateGreen'],
+ submit: ['joined', 'criterionUnchanged', 'treeClean', 'nothingUntracked', 'hasCommit', 'gateConfigured', 'gateGreen', 'treeStillDuringGate'],
reserve: ['coordinatorSaysAs', 'joined'],
accept: ['coordinatorSaysAs', 'joined', 'atSubmittedCommit'],
reject: ['coordinatorSaysAs', 'joined', 'atSubmittedCommit'],