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: offer a gate without a detected build [I1,I2,N19,S6]

Corey Olson07d9ead5e980
diff --git a/src/cli.js b/src/cli.js
index 73bb103f..76d6e6a1 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -1120,6 +1120,7 @@ function boardSetup(ctx, card) {
.filter(entry => entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules')
.map(entry => entry.name).sort();
const lane = lanes[0] ?? folders[0] ?? 'app';
+ const detectedGate = detectGate(ctx.info.root);
/** Quote the exact suggested command safely for a shell. */
const quote = value => "'" + String(value).replaceAll("'", "'\\''") + "'";
/** Preserve all existing configuration when recording one setup answer. */
@@ -1130,8 +1131,11 @@ function boardSetup(ctx, card) {
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.' },
{ 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: configure(`c.lanes[${JSON.stringify(lane)}]={owns:[${JSON.stringify(lane + '/')}]}`) },
- { number: 3, done: Boolean(ctx.config.gate?.trim()), question: `Ask the person: which command proves the build works? Suggested: ${detectGate(ctx.info.root) || 'choose the repo’s test command'}.`,
- command: configure(`c.gate=${JSON.stringify(detectGate(ctx.info.root) || '<test command>')}`) },
+ { number: 3, done: Boolean(ctx.config.gate?.trim()),
+ question: detectedGate
+ ? `Ask the person: which command proves the build works? Suggested: ${detectedGate}.`
+ : 'Ask the person: if this board has no build, use `pullboard spec check` to check its spec and practice files; a second agent review checks the actual work. Or choose a custom gate command.',
+ command: configure(`c.gate=${JSON.stringify(detectedGate || 'pullboard spec check')}`) },
{ number: 4, done: card.all.length > 0, question: 'Ask the person: what is the first small piece we should build?',
command: `pullboard add ${quote(lane)} 'First small piece' --specs ${quote(approved[0]?.id ?? 'G1')} --criterion 'Describe what the person will be able to do'` },
{ number: 5, done: card.viewOpened,
diff --git a/src/init.js b/src/init.js
index 5ff6bead..8a5b1567 100644
--- a/src/init.js
+++ b/src/init.js
@@ -219,7 +219,9 @@ export function initRepo({ info, openBoardHere, register, closeBoard, model }) {
}
notes.push('opened the board in the git dir; this checkout is the coordinator');
if (!configuredGate(root)) {
- notes.push('no gate yet: set "gate" in pullboard.json to the command that proves the build');
+ notes.push(gate
+ ? 'no gate yet: set "gate" in pullboard.json to the command that proves the build'
+ : 'if this board has no build, use `pullboard spec check` to check its spec and practice files; a second agent review checks the actual work');
}
if (written.length) notes.push(`git add -f -- ${written.map((path) => `'${path.replaceAll("'", "'\\''")}'`).join(' ')}`);
return notes;
diff --git a/test/newcomer.test.js b/test/newcomer.test.js
index d0a44cc5..28287355 100644
--- a/test/newcomer.test.js
+++ b/test/newcomer.test.js
@@ -1,7 +1,7 @@
/** First-run guidance on private Git repos, including unrelated files setup must not stage [I1,I2]. */
import assert from 'node:assert/strict';
import { runFixtureExecFile as execFileSync, runFixtureChild as spawnSync, runFixtureChild, runFixtureGit } from './fixture-child.js';
-import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
+import { mkdirSync, mkdtempSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { test } from 'node:test';
@@ -82,6 +82,53 @@ test('init detects language gates and gives an example in the same ecosystem [I1
writeFileSync(join(mixed.root, 'go.mod'), 'module example.test/project\n');
assert.equal(mixed.run('init').status, 0);
assert.equal(JSON.parse(readFileSync(join(mixed.root, 'pullboard.json'), 'utf8')).gate, 'go test ./...');
+
+ const emptyConfigured = project(t);
+ writeFileSync(join(emptyConfigured.root, 'package.json'), JSON.stringify({ scripts: { test: 'node --test' } }));
+ assert.equal(emptyConfigured.run('init').status, 0);
+ const configPath = join(emptyConfigured.root, 'pullboard.json');
+ const config = JSON.parse(readFileSync(configPath, 'utf8'));
+ config.gate = '';
+ writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`);
+ const rerun = emptyConfigured.run('init');
+ assert.equal(rerun.status, 0, rerun.stderr);
+ assert.match(rerun.stdout, /no gate yet: set "gate" in pullboard\.json to the command that proves the build/u);
+ assert.doesNotMatch(rerun.stdout, /if this board has no build/u);
+});
+
+test('setup offers a gate to a board with no build [I1,I2]', (t) => {
+ const box = project(t);
+ const initialized = box.run('init');
+ assert.equal(initialized.status, 0, initialized.stderr);
+ assert.match(initialized.stdout, /if this board has no build.*pullboard spec check.*second agent review checks the actual work/u);
+
+ const fixtureBin = join(box.root, 'fixture-bin');
+ mkdirSync(fixtureBin);
+ symlinkSync(BIN, join(fixtureBin, 'pullboard'));
+ box.env.PATH = `${fixtureBin}:${process.env.PATH}`;
+ const specCheck = runFixtureChild('pullboard', ['spec', 'check'], { cwd: box.root, env: box.env, encoding: 'utf8' });
+ assert.equal(specCheck.status, 0, specCheck.failure ?? specCheck.stderr);
+
+ const configPath = join(box.root, 'pullboard.json');
+ const config = JSON.parse(readFileSync(configPath, 'utf8'));
+ config.lanes.app = { owns: ['app/'] };
+ writeFileSync(configPath, `${JSON.stringify(config, null, 2)}\n`);
+ const specPath = join(box.root, 'SPEC.md');
+ writeFileSync(specPath, `${readFileSync(specPath, 'utf8')}- G1 [approved, must] The board can check its own requirements. | gate: pullboard spec check\n`);
+
+ const before = JSON.parse(box.run('resume', '--json').stdout);
+ assert.equal(before.setup.step, 3);
+ assert.match(before.setup.question, /if this board has no build.*pullboard spec check.*second agent review checks the actual work/u);
+ assert.match(before.setup.question, /choose a custom gate command/u);
+ assert.match(before.setup.command, /pullboard spec check/u);
+ const answer = runFixtureChild('sh', ['-c', before.setup.command], { cwd: box.root, env: box.env, encoding: 'utf8' });
+ assert.equal(answer.status, 0, answer.failure ?? answer.stderr);
+ assert.equal(JSON.parse(readFileSync(configPath, 'utf8')).gate, 'pullboard spec check');
+ assert.equal(JSON.parse(box.run('resume', '--json').stdout).setup.step, 4);
+
+ box.env.PULLBOARD_MACHINE_HOME = join(box.root, '.private-machine-home');
+ const gate = box.run('gate');
+ assert.equal(gate.status, 0, gate.failure ?? gate.stderr);
});
test('bare pullboard starts with the tour and init pointer; explicit help and JSON stay usable [I1,I2]', (t) => {