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(core): let rowless boards keep building [I10,B26]

Corey Olsondc9dd959569b
diff --git a/docs/api.md b/docs/api.md
index fa69f3cc..987b5c28 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -55,6 +55,8 @@ The coordinator's `resume` ends with one `flow:` line if the measured review-wai
The coordinator's `resume` opens, after its header line, with its inbox: `inbox: <n> unread shouts, <n> open decisions for you`, then the newest three unread shouts by id, sender, age and first line, then `<n> more; read them all with pullboard inbox` when there are more. Only shouts to the coordinator, its lane or all count. While shouts are unread its `next:` reads `read your <n> unread shouts first: pullboard inbox; then ...`. Resume marks nothing read; `inbox` does. Coordinator resume JSON carries the same as `inbox: {unread, decisions, newest: [{id, from, at, text}], more, read}`.
+On a board with items and no spec rows, `resume` treats the spec setup step as complete and offers `pullboard spec draft "<text>"` as optional guidance. Its next action follows the actual work or another unanswered setup step, and does not require drafting or approving rows first. A board with existing rows retains its approval and apply guidance.
+
The coordinator's `resume` names who commits which uncommitted Pullboard file. A row file (the spec or the practice file) that is committed and changed, as `spec apply` leaves it, is the coordinator's, together with any sign-off receipt a signed apply appended to `.pullboard/signoffs.jsonl`: `The coordinator must commit the row file spec apply changed: <git add and git commit of exactly those files>` (the line says `changed and its sign-off receipt:` when a receipt is included), and its `next:` reads `commit the applied row file first: <that command>; then ...`. Every other setup file that differs from the last commit, including a row file init wrote that is not committed yet, is the person's: `The person must commit Pullboard's setup files before agents can use worktrees: <git add of exactly those files>`. Each line appears only when it has files, and a dirty file that is not a setup file is never named. Coordinator resume JSON carries the same as `commits: {coordinator: {files, command} | null, person: {files, command} | null}`.
For example: `flow: review wait average 61 min (1 measured; > 60 min); bottleneck: build (66.67% of 300 measured cycle min); next: add a builder when open work is available`. An unmeasured trip reads `flow: unreviewed #1 waiting 181 min (> 180 min); bottleneck: not measured yet`.
diff --git a/src/cli.js b/src/cli.js
index 6ba39bf2..2e51121b 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -176,6 +176,7 @@ import { Refused } from './refused.js';
import {
applyStep,
personAsk,
+ requirementStep,
} from './setup-rows.js';
import { personNeeds } from './needs.js';
import { personNeedsState } from './needs-state.js';
@@ -1395,7 +1396,7 @@ const reworkNext = (card) => `pullboard claim ${card.sentBack[0].item.item_id},
/**
* The coordinator's next step, from the board and the spec (N32): the spec with the person first,
* 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.
+ * team by the run guide knows where it is. A working board with no spec rows can keep building.
*
* @param {any} card
* @param {{ id: string, status: string }[]} rows
@@ -1404,9 +1405,9 @@ const reworkNext = (card) => `pullboard claim ${card.sentBack[0].item.item_id},
function coordinatorNext(card, rows) {
if (card.requests.length) return `answer request #${card.requests[0].shout_id}: pullboard answer ${card.requests[0].shout_id} done, or declined <reason>`;
const live = rows.filter((row) => !['wont', 'retired'].includes(row.status));
- if (!live.length) return "turn what the person wants into spec rows with them: the pullboard-decompose skill (pullboard prompt decompose)";
+ if (!live.length && (rows.length || !card.all.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 (live.length && !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 --model "<model name>"';
@@ -1613,9 +1614,7 @@ function boardSetup(ctx, card, identity) {
/** Preserve all existing configuration when recording one setup answer. */
const configure = patch => `node -e ${quote(`const fs=require('node:fs');const p='pullboard.json';const c=JSON.parse(fs.readFileSync(p,'utf8'));${patch};fs.writeFileSync(p,JSON.stringify(c,null,2)+${JSON.stringify('\n')})`)}`;
const steps = [
- { number: 1, done: approved.length > 0 && ((!drafted.length && !toApply.length) || completed), question: 'Ask the person: what are we building, and who will use it? Draft a few requirements, then ask the person to approve them.',
- command: 'pullboard spec draft "<text>"',
- afterAnswer: 'Record each answer with pullboard spec draft "<text>"; the person approves the returned ids in Pullboard View or runs pullboard spec approve <ids> in their own terminal; then the coordinator runs pullboard spec apply.' },
+ requirementStep({ rows, drafted, toApply, completed, hasItems: card.all.length > 0 }),
{ number: 2, done: lanes.length > 0, question: `Ask the person: how should we divide the work? Suggested folders: ${folders.join(', ') || 'app/ (create it for the app)'}.`,
command: `pullboard lane add ${word(lane)} --owns ${word(lane + '/')}` },
{ number: 3, done: Boolean(ctx.config.gate?.trim()),
@@ -1748,6 +1747,7 @@ async function resumeHere(io, view) {
if (card.inbox) for (const line of coordinatorInboxLines(card.inbox, name, (at) => span(ctx, at), firstLine)) say(line);
say(`New agent worktrees: ${card.newWorktreeLocation}`);
card.setup = boardSetup(ctx, card, setupScope);
+ if (!loadSpec(root, ctx.config).rows.length && card.all.length) say('Spec rows are optional; add a requirement later: pullboard spec draft "<text>".');
if (card.setup) {
say(`Setting up: step ${card.setup.step} of 5`);
say(card.setup.question);
diff --git a/src/setup-rows.js b/src/setup-rows.js
index eaf6a7e5..cff99c49 100644
--- a/src/setup-rows.js
+++ b/src/setup-rows.js
@@ -4,6 +4,16 @@
* decides it, approve for a draft and answer for a pending question.
*/
+/** Keep spec setup optional on a working rowless board, retaining approval guidance for real rows. */
+export function requirementStep({ rows, drafted, toApply, completed, hasItems }) {
+ const optional = rows.length === 0 && hasItems;
+ return { number: 1, done: optional || (rows.some(row => row.status === 'approved') && ((!drafted.length && !toApply.length) || completed)),
+ question: optional ? 'Spec rows are optional on this working board; add a requirement later with pullboard spec draft "<text>".'
+ : 'Ask the person: what are we building, and who will use it? Draft a few requirements, then ask the person to approve them.',
+ command: 'pullboard spec draft "<text>"',
+ afterAnswer: 'Record each answer with pullboard spec draft "<text>"; the person approves the returned ids in Pullboard View or runs pullboard spec approve <ids> in their own terminal; then the coordinator runs pullboard spec apply.' };
+}
+
/**
* The setup step once every open row has a person decision that spec apply has not written yet.
*
diff --git a/test/resume-flow.test.js b/test/resume-flow.test.js
index 3beaa340..fcefb0b5 100644
--- a/test/resume-flow.test.js
+++ b/test/resume-flow.test.js
@@ -875,3 +875,50 @@ test('an upgraded configured board stays set up before its first resume [I1,I2]'
assert.equal(complete.setupStartedAt, view.setupStartedAt);
assert.equal(statSync(join(stateDirectory, 'setup-complete.json')).mode & 0o077, 0);
});
+
+test('a board building without spec rows is not told to draft the spec first [I10,B26]', async t => {
+ const box = releaseFixture(t, { freshSetup: true, historyBeforeInit: true });
+ const file = join(box.repo, 'pullboard.json');
+ const config = JSON.parse(readFileSync(file, 'utf8'));
+ config.gate = 'true';
+ config.lanes = { app: { owns: ['app/'] } };
+ writeFileSync(file, JSON.stringify(config));
+ mkdirSync(join(box.repo, 'app'));
+ writeFileSync(join(box.repo, 'app/first.txt'), 'first working item\n');
+ box.git(box.repo, 'add', '-A');
+ box.git(box.repo, 'commit', '-q', '-m', 'chore: initialize the private board');
+ const spec = box.run(box.repo, 'spec', '--json');
+ assert.equal(spec.status, 0, spec.failure || spec.stderr);
+ assert.deepEqual(JSON.parse(spec.stdout).rows.filter(row => row.file === 'SPEC.md'), []);
+ const added = box.run(box.repo, 'add', 'app', 'Build the first useful thing', '--criterion', 'The first useful thing works.', '--json');
+ assert.equal(added.status, 0, added.failure || added.stderr || added.stdout);
+ assert.equal(JSON.parse(added.stdout).item.item_spec_ids, '', 'real board items need no spec rows');
+ for (let repeat = 0; repeat < 2; repeat++) {
+ const resumed = box.run(box.repo, 'resume', '--json');
+ assert.equal(resumed.status, 0, resumed.failure || resumed.stderr || resumed.stdout);
+ const card = JSON.parse(resumed.stdout);
+ assert.notEqual(card.setup?.step, 1, 'an active rowless board skips the required spec step');
+ assert.doesNotMatch(card.next, /spec draft|decompose|person.*approv/iu,
+ 'the work has an actionable next step without spec approval');
+ if (card.setup) {
+ const specStep = card.setup.steps.find(step => step.number === 1);
+ assert.equal(specStep.done, true);
+ assert.match(specStep.question, /optional/iu);
+ assert.match(specStep.command, /pullboard spec draft/u);
+ }
+ const text = box.run(box.repo, 'resume');
+ assert.equal(text.status, 0, text.failure || text.stderr || text.stdout);
+ assert.match(text.stdout, /spec rows are optional[^\n]*pullboard spec draft/iu,
+ 'resume offers the way to add rows without making it the work prerequisite');
+ assert.doesNotMatch(text.stdout, /^next: .*spec draft/mu);
+ }
+ await openSetupView(box);
+ for (let repeat = 0; repeat < 2; repeat++) {
+ const resumed = box.run(box.repo, 'resume', '--json');
+ assert.equal(resumed.status, 0, resumed.failure || resumed.stderr || resumed.stdout);
+ const card = JSON.parse(resumed.stdout);
+ assert.equal(card.setup, null, 'the working board can finish setup without adding rows');
+ assert.doesNotMatch(card.next, /spec draft|decompose|person.*approv/iu,
+ 'completed setup keeps directing the coordinator to the actual work');
+ }
+});