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): a retired cited row gets a clear refusal at submit [V11]

Corey Olsonb86f967a52ca
diff --git a/src/cli.js b/src/cli.js
index 6a6d2ad8..55a18301 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -699,9 +699,22 @@ function submitHere(ctx, 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`);
+ // A cited row taken out of force (retired, wont) cannot be frozen at all, and says so too.
+ if (item.item_frozen_digest) {
+ let digest = null;
+ let unusable = '';
+ try {
+ digest = freezer(ctx)(item).digest;
+ } catch (error) {
+ if (!(error instanceof Refused)) throw error;
+ unusable = error.message.replace(/^\[\w+\] /, '').split(';')[0];
+ }
+ if (digest !== item.item_frozen_digest) {
+ const step = unusable
+ ? `the coordinator either restores the row and runs pullboard refreeze ${id}, or withdraws #${id}`
+ : `${who.id === COORDINATOR ? '' : 'the coordinator runs '}pullboard refreeze ${id}, then you claim it and submit again`;
+ throw new Refused('CRITERIA_CHANGED', `the spec rows #${id} cites changed after it was claimed${unusable ? ` (${unusable})` : ''}, so no verifier could judge it; ${step}`);
+ }
}
return { me: who, claimHead: item.item_claim_head };
});
diff --git a/test/e2e.test.js b/test/e2e.test.js
index d5880e11..97450f0c 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -726,7 +726,7 @@ test('submit refuses a bar that moved since the claim, before any verifier runs;
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.match(refused.err, /CRITERIA_CHANGED\] the spec rows #1 cites changed after it was claimed, so no verifier could judge it; the coordinator runs pullboard refreeze 1, then you 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');
@@ -836,3 +836,17 @@ test('every wait pullboard suggests names its unit and fits one ten-minute tool
assert.match(agents, /`pullboard next --wait 9` keeps looking for up to 9 minutes, which fits one tool call with a ten-minute timeout/);
assert.doesNotMatch(agents, /--wait 30/);
});
+
+test('submit names the item and the way out when a cited row was retired after the claim [V11]', () => {
+ const box = project();
+ box.run(box.repo, 'add', 'web', 'Page', '--specs', 'G1');
+ box.run(box.web, 'claim', '1');
+ writeFileSync(join(box.repo, 'SPEC.md'), SPEC.replace('- G1 [approved, must] The page renders. | gate: web test', '- G1 [retired] The page renders.'));
+ box.git(box.repo, 'commit', '-qam', 'docs(spec): retire G1');
+ box.git(box.web, 'merge', '-q', '--ff-only', 'main');
+ commitFile(box, box.web, 'web/a.html', 'a', 'feat(web): page');
+ 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 \(G1 is retired\), so no verifier could judge it; the coordinator either restores the row and runs pullboard refreeze 1, or withdraws #1/);
+ assert.equal(JSON.parse(box.run(box.repo, 'show', '1', '--json').out).item_status, 'claimed');
+});