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.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(setup): build starters while row decisions proceed [S1,B26]
Corey Olson95048aecf400
diff --git a/src/cli.js b/src/cli.jsindex acfdd3b7..fe73ef63 100644--- a/src/cli.js+++ b/src/cli.js@@ -175,6 +175,7 @@ import { Refused } from './refused.js';import {applyStep,personAsk,+ withStarterWork,} from './setup-rows.js';import { personNeeds } from './needs.js';import { personNeedsState } from './needs-state.js';@@ -1643,7 +1644,6 @@ function boardSetup(ctx, card, identity) {question: seat ? seatQuestion : `Waiting for the person to ${verb} ${names}.`, command,personCommand,afterAnswer: (toApply.length ? `The person already approved ${toApply.map(row => row.id).join(', ')}; pullboard spec apply writes them. ` : '') + 'The person approves draft rows and answers questions in Pullboard View or their own terminal; then the coordinator runs pullboard spec apply.',- meanwhile: seat ? 'While waiting, review independent approved work or send questions to the coordinator with pullboard shout coordinator "<what is needed>" --decision.' : 'While waiting, the agent may review independent approved work or prepare questions for the person.',agentNext: seat ? seatNext : (toApply.length ? 'pullboard spec apply for the approved rows; then ' : '') + `wait for the person to ${verb} ${names}; meanwhile ${command}` };}return current ? { step: current.number, total: 5, ...current, steps } : null;@@ -1746,7 +1746,7 @@ async function resumeHere(io, view) {if (view.state !== 'running' && backgroundViewLine(view)) say(backgroundViewLine(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);+ card.setup = withBoard(ctx, board => withStarterWork(boardSetup(ctx, card, setupScope), { board, me, main: isMain, config: ctx.config, root, seat: ctx.io.callerRole() === 'seat' }));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.jsindex eaf6a7e5..7e0e8083 100644--- a/src/setup-rows.js+++ b/src/setup-rows.js@@ -3,6 +3,33 @@* coordinator's spec apply, never for the person again, and each open row gets the command that* decides it, approve for a draft and answer for a pending question.*/+import { nextFor } from './board.js';+import { proposeLanes } from './init.js';++/** Show available starter work beside undecided rows, without changing any approval or apply move [S1,B26]. */+export function withStarterWork(setup, { board, me, main, config, root, seat }) {+ if (setup?.waitingOn !== 'person-approval') return setup;+ const meanwhile = seat+ ? 'While waiting, review independent approved work or send questions to the coordinator with pullboard shout coordinator "<what is needed>" --decision.'+ : 'While waiting, the agent may review independent approved work or prepare questions for the person.';+ const waiting = { ...setup, meanwhile };+ const proposed = main ? proposeLanes(root, config) : [];+ const lanes = Object.entries(config.lanes).filter(([, lane]) => lane.owns.length).map(([name]) => name);+ if (!main && !lanes.includes(me.lane)) return waiting;+ const item = nextFor(board, { agentId: me.id, lane: me.lane,+ ...(main ? { lanes: [...lanes, ...proposed.map(lane => lane.name)] } : {}) }).item;+ if (!item || (main && ![...lanes, ...proposed.map(lane => lane.name)].includes(item.item_lane))) return waiting;+ /** Quote a configured path only when the command needs it. */+ const word = value => /^[A-Za-z0-9._/,-]+$/u.test(value) ? value : "'" + value.replaceAll("'", "'\\''") + "'";+ const proposal = proposed.find(lane => lane.name === item.item_lane);+ const command = !main ? `pullboard claim ${item.item_id}` : !Object.hasOwn(config.lanes, item.item_lane)+ ? `pullboard lane add ${item.item_lane} --owns ${word(proposal.owns.join(','))}`+ : `pullboard worktree ${item.item_lane} --model "<model name>"`;+ return { ...waiting,+ buildNow: { item: item.item_id, lane: item.item_lane, title: item.item_title, command },+ meanwhile: `Starter items can be claimed and built now while the person decides these rows in parallel. First: #${item.item_id} ${item.item_title}. Start: ${command}`,+ agentNext: main && setup.approvedRowIds?.length ? 'pullboard spec apply' : command };+}/*** 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.jsindex 3beaa340..b8e7b93f 100644--- a/test/resume-flow.test.js+++ b/test/resume-flow.test.js@@ -524,6 +524,51 @@ test('spec draft adds draft rows and resume names them [N32]', t => {'draft preserves every existing status row and inserts in the first section');});+test('setup lets agents build starter items while rows wait [S1,B26]', t => {+ const box = releaseFixture(t, { freshSetup: true, historyBeforeInit: true });+ const initialized = box.run(box.repo, 'init', '--blueprint', 'web-app');+ assert.equal(initialized.status, 0, initialized.failure || initialized.stderr);+ const rows = JSON.parse(box.run(box.repo, 'spec', '--json').stdout).rows;+ const starters = JSON.parse(box.run(box.repo, 'list', '--all', '--json').stdout).items.sort((a, b) => a.item_id - b.item_id);+ const first = starters.find(item => !item.item_after);+ assert.ok(first, 'the bundled blueprint files a starter with no dependency');+ const initial = JSON.parse(box.run(box.repo, 'resume', '--json').stdout);+ assert.equal(initial.setup.waitingOn, 'person-approval');+ assert.equal(initial.setup.buildNow?.item, first.item_id, 'setup names the first starter while rows are undecided');+ assert.match(initial.setup.meanwhile, /claimed and built now.*person.*parallel/iu);+ assert.equal(initial.setup.buildNow.command, `pullboard lane add ${first.item_lane} --owns ${first.item_lane}/`,+ 'a proposed lane is declared before an agent tries to join it');+ const lane = box.run(box.repo, 'lane', 'add', first.item_lane, '--owns', `${first.item_lane}/`);+ assert.equal(lane.status, 0, lane.failure || lane.stderr);+ box.git(box.repo, 'add', '-A');+ box.git(box.repo, 'commit', '-q', '-m', 'chore: commit blueprint setup');+ const coordinator = box.run(box.repo, 'resume');+ assert.match(coordinator.stdout, /claimed and built now.*person.*parallel/iu);+ assert.ok(coordinator.stdout.includes(`#${first.item_id}`), 'prose names the same first starter');+ const prepared = JSON.parse(box.run(box.repo, 'resume', '--json').stdout);+ assert.equal(prepared.setup.buildNow.command, `pullboard worktree ${first.item_lane} --model "<model name>"`);+ box.env.CODEX_THREAD_ID = 'starter-builder-session';+ const opened = box.run(box.repo, 'worktree', first.item_lane, '--model', 'Starter fixture', '--json');+ assert.equal(opened.status, 0, opened.failure || opened.stderr);+ const worktree = JSON.parse(opened.stdout).path;+ const ready = JSON.parse(box.run(worktree, 'resume', '--json').stdout);+ assert.equal(ready.setup.waitingOn, 'person-approval', 'approval remains a separate person decision');+ assert.equal(ready.setup.buildNow.item, first.item_id);+ assert.equal(ready.setup.buildNow.command, `pullboard claim ${first.item_id}`);+ assert.equal(ready.next, `pullboard claim ${first.item_id}`, 'the agent is sent to build rather than wait for approval');+ const claimed = box.run(worktree, 'claim', String(first.item_id));+ assert.equal(claimed.status, 0, claimed.failure || claimed.stderr);+ mkdirSync(join(worktree, first.item_lane));+ writeFileSync(join(worktree, first.item_lane, 'starter.js'), 'export const started = true;\n');+ box.git(worktree, 'add', `${first.item_lane}/starter.js`);+ box.git(worktree, 'commit', '-q', '-m', `feat(app): start the requested runner [${first.item_spec_ids}]`);+ const denied = box.run(worktree, 'spec', 'approve', first.item_spec_ids.split(',')[0]);+ assert.equal(denied.status, 1, 'building does not give the agent approval rights');+ assert.match(denied.stderr, /B26_PERSON/u);+ assert.deepEqual(JSON.parse(box.run(worktree, 'spec', '--json').stdout).rows, rows,+ 'the real claim and build neither approve nor apply any row');+});+test("resume says setup waits on the person's approval [I1,I2]", async t => {const box = releaseFixture(t, { freshSetup: true });box.env.AI_AGENT = 'fixture-agent';