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.

feat(cli): submit refuses a bar that moved since claim [V11]

Corey Olsona68787946777
diff --git a/SPEC.md b/SPEC.md
index 13a62f51..8c2163ee 100644
--- a/SPEC.md
+++ b/SPEC.md
@@ -39,6 +39,7 @@ Statuses: approved = decided · draft = proposed · pending = open question · f
- V8 [approved, must] Every verdict binds the submitted commit and the frozen digest. | gate: test/board.test.js
- V9 [approved, must] In the main checkout, verifying needs --as coordinator, so no agent's verdict is filed as the coordinator's. | gate: test/e2e.test.js | serves: V1
- V10 [draft, must] Agents see a gate digest: one line when green, the failures when red; the full log stays in .git. | gate: test/e2e.test.js | serves: V4
+- V11 [draft, must] Submit refuses when the cited rows changed since claim, before a verifier spends a run on it. | gate: test/e2e.test.js | serves: V3
## L · Lanes
- L1 [approved, must] Lanes live in pullboard.json: folders owned, spec prefixes, when it starts. | gate: test/lanes.test.js
diff --git a/src/cli.js b/src/cli.js
index 4434af3c..7d305f6b 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -677,6 +677,11 @@ function submitHere(ctx, id) {
if (item.item_status !== 'claimed' || item.item_owner !== who.id) {
throw new Refused('NOT_YOURS', `item #${id} is not claimed by you; claim it first`);
}
+ // A bar that moved since claim can get no verdict (V3), so say so now, not after a verifier's run (V11).
+ if (item.item_frozen_digest && freezer(ctx)(item).digest !== item.item_frozen_digest) {
+ const refreeze = who.id === COORDINATOR ? `pullboard refreeze ${id}` : `shout the coordinator to run pullboard refreeze ${id}`;
+ throw new Refused('CRITERIA_CHANGED', `the spec rows #${id} cites changed after it was claimed, so no verifier could judge it; ${refreeze}, then claim it and submit again`);
+ }
return { me: who, claimHead: item.item_claim_head };
});
if (!isClean(root)) throw new Refused('DIRTY', 'commit your changes first; the gate must check what you submit');
diff --git a/test/e2e.test.js b/test/e2e.test.js
index 0665d6f8..9d6641e0 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -715,3 +715,20 @@ test('the gate reaches the agent as a digest: one line when green, the failure w
box.run(box.repo, 'claim', '1');
assert.match(box.run(box.repo, 'submit', '1').err, /GATE_RED[\s\S]*not ok 401 - the page renders a heading/);
});
+
+test('submit refuses a bar that moved since the claim, before any verifier runs; a refreeze and a fresh claim recover [V11]', () => {
+ const box = project();
+ box.run(box.repo, 'add', 'web', 'Page', '--specs', 'G1', '--criterion', 'renders');
+ box.run(box.web, 'claim', '1');
+ writeFileSync(join(box.repo, 'SPEC.md'), SPEC.replace('The page renders.', 'The page renders a heading.'));
+ box.git(box.repo, 'commit', '-qam', 'docs: tighten G1');
+ box.git(box.web, 'merge', '-q', '--ff-only', 'main');
+ commitFile(box, box.web, 'web/a.html', '<h1>Hi</h1>', 'feat(web): page [G1]');
+ const refused = box.run(box.web, 'submit', '1');
+ assert.equal(refused.code, 1);
+ assert.match(refused.err, /CRITERIA_CHANGED\] the spec rows #1 cites changed after it was claimed.*shout the coordinator to run pullboard refreeze 1, then claim it and submit again/);
+ assert.equal(JSON.parse(box.run(box.repo, 'show', '1', '--json').out).item_status, 'claimed');
+ assert.match(box.run(box.repo, 'refreeze', '1').out, /refrozen/);
+ box.run(box.web, 'claim', '1');
+ assert.match(box.run(box.web, 'submit', '1').out, /submitted #1/);
+});