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): the coordinator's own claim waits for the spec [N32]

Corey Olsonb51acd5ebcd9
diff --git a/docs/proof/run-mutants.mjs b/docs/proof/run-mutants.mjs
index f7c064a3..d7633b47 100644
--- a/docs/proof/run-mutants.mjs
+++ b/docs/proof/run-mutants.mjs
@@ -17,6 +17,8 @@ const MUTANTS = [
['N31', 'the guide drops the rule against merging unverified history', [['skills/pullboard-run/SKILL.md', ' Never merge a commit whose history holds another item\'s commit that is not yet verified.', ' Merge in any order.']], GUIDE, 'red'],
['N32', 'an empty spec is not sent to the person', [['src/cli.js', " if (!live.length) return \"turn what the person wants into spec rows with them: the pullboard-decompose skill (pullboard prompt decompose)\";\n", '']], STAGES, 'red'],
['N32', 'draft rows are planned before the person approves them', [['src/cli.js', " if (!approved.length) return 'the person approves rows in SPEC.md; then plan them: the pullboard-plan skill';\n", '']], STAGES, 'red'],
+ ['N32', "the coordinator's own claim jumps the spec", [['src/cli.js', " if (isMain) next = coordinatorNext(card, loadSpec(root, ctx.config).rows);\n else if (card.holding.length) next = buildNext(card);", " if (card.holding.length) next = buildNext(card);\n else if (isMain) next = coordinatorNext(card, loadSpec(root, ctx.config).rows);"]], STAGES, 'red'],
+ ['N32', "the coordinator's own claim is never named", [['src/cli.js', ' if (card.holding.length) return buildNext(card);\n', '']], STAGES, 'red'],
['N32', 'verified work is never named for merging', [['src/cli.js', ' if (card.toMerge.length) {', ' if (false) {']], STAGES, 'red'],
['N32', 'open items get no builders', [['src/cli.js', ' if (card.open.length) {\n const lanes', ' if (false) {\n const lanes']], STAGES, 'red'],
['N32', 'approved rows no item cites are never planned', [['src/cli.js', ' if (unplanned.length) {', ' if (false) {']], STAGES, 'red'],
diff --git a/src/cli.js b/src/cli.js
index 5b0352d9..0c9542e2 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -475,10 +475,16 @@ const firstLine = (text) => {
return line.length > 100 ? `${line.slice(0, 99)}…` : line;
};
+/** The next step for an agent holding a claim: build it and submit. */
+const buildNext = (card) => `build #${card.holding[0].item_id}, commit, then pullboard submit ${card.holding[0].item_id}`;
+
+/** The next step for an agent whose work came back: rework it. */
+const reworkNext = (card) => `pullboard claim ${card.sentBack[0].item.item_id}, fix what the verifier found, and submit again`;
+
/**
* The coordinator's next step, from the board and the spec (N32): the spec with the person first,
- * then the plan, then verdicts, merges and builders, so an agent that runs the team by the run guide
- * always knows where it is.
+ * then its own work in hand, then verdicts, merges, builders and the plan, so an agent that runs the
+ * team by the run guide always knows where it is. Nothing jumps the spec, not even its own claim.
*
* @param {any} card
* @param {{ id: string, status: string }[]} rows
@@ -489,6 +495,8 @@ function coordinatorNext(card, rows) {
if (!live.length) return "turn what the person wants into spec rows with them: the pullboard-decompose skill (pullboard prompt decompose)";
const approved = live.filter((row) => row.status === 'approved');
if (!approved.length) return 'the person approves rows in SPEC.md; then plan them: the pullboard-plan skill';
+ if (card.holding.length) return buildNext(card);
+ if (card.sentBack.length) return reworkNext(card);
if (card.toVerify.length) return 'pullboard next --verify --as coordinator, or a verifier that built nothing: pullboard worktree review';
if (card.toMerge.length) {
const [first] = card.toMerge;
@@ -574,9 +582,9 @@ function resumeHere(io) {
const isVerified = (id) => card.all.find((other) => other.item_id === Number(id))?.item_status === 'verified';
const ready = inLane.filter((item) => !item.item_after || item.item_after.split(',').every(isVerified)).length;
let next;
- if (card.holding.length) next = `build #${card.holding[0].item_id}, commit, then pullboard submit ${card.holding[0].item_id}`;
- else if (card.sentBack.length) next = `pullboard claim ${card.sentBack[0].item.item_id}, fix what the verifier found, and submit again`;
- else if (isMain) next = coordinatorNext(card, loadSpec(root, ctx.config).rows);
+ if (isMain) next = coordinatorNext(card, loadSpec(root, ctx.config).rows);
+ else if (card.holding.length) next = buildNext(card);
+ else if (card.sentBack.length) next = reworkNext(card);
else if (card.hold) next = 'wait for the hold to lift: pullboard next --wait 9 (minutes)';
else if (ready) next = `pullboard next (${ready} ready in your lane)`;
else if (inLane.length) next = `pullboard next --wait 9 (minutes); ${inLane.length} in your lane ${inLane.length === 1 ? 'waits' : 'wait'} on other work`;
diff --git a/test/e2e.test.js b/test/e2e.test.js
index abfabd7a..4e3a2aff 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -162,8 +162,13 @@ test("the coordinator's resume names its next step from the spec and the board,
const initialized = fresh.run(repo, 'init');
assert.match(initialized.out, /with an agent: start a new Claude Code session here, which loads the pullboard skills, then tell it what to build/, 'init tells an agent to start a new session [I9]');
assert.match(next(fresh, repo), /^turn what the person wants into spec rows with them: the pullboard-decompose skill/);
+ assert.equal(fresh.run(repo, 'add', 'coordinator', 'Tidy the readme').code, 0);
+ assert.equal(fresh.run(repo, 'claim', '1').code, 0);
+ assert.match(next(fresh, repo), /^turn what the person wants into spec rows with them/, "the coordinator's own claim does not jump the spec");
writeFileSync(join(repo, 'SPEC.md'), '# Fresh\n\n## G · Goals\n- G1 [draft, must] It works. | gate: test\n');
- assert.match(next(fresh, repo), /^the person approves rows in SPEC.md; then plan them/);
+ assert.match(next(fresh, repo), /^the person approves rows in SPEC.md; then plan them/, 'nor the approval');
+ writeFileSync(join(repo, 'SPEC.md'), '# Fresh\n\n## G · Goals\n- G1 [approved, must] It works. | gate: test\n');
+ assert.match(next(fresh, repo), /^build #1, commit, then pullboard submit 1/, 'then it comes first');
const box = project();
assert.match(next(box, box.repo), /^plan the approved rows no item cites \(G1, G2\): the pullboard-plan skill/);