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
test(init): retain details through verbose output [I1,H5,N26]
Corey Olson8ce262264c94
diff --git a/src/init-finish.js b/src/init-finish.jsindex 185bede2..25143827 100644--- a/src/init-finish.js+++ b/src/init-finish.js@@ -210,6 +210,8 @@ export function reportInitSetup(io, info, notes, landed, { verbose = false } = {const staging = notes.at(-1)?.startsWith('git add -f -- ') ? notes.at(-1) : null;if (!verbose) {io.say('Set up Pullboard: board, project rules, Git hooks and agent instructions.');+ const missingGate = notes.find(note => note.startsWith('gate command "'));+ if (missingGate) io.say(missingGate.split(';')[0] + '.');if (landed.length) io.say(`Blueprints: ${landed.length}; ${waiting.length} rows waiting for a decision.`);return { result, staging };}diff --git a/test/background-view.test.js b/test/background-view.test.jsindex 607d0086..755b50af 100644--- a/test/background-view.test.js+++ b/test/background-view.test.js@@ -101,8 +101,8 @@ test('init leaves a view running for pullboard.dev [H5,N26]', async (t) => {const lines = viewLines(init.out);assert.equal(lines.length, 1, `init prints one line about the view:\n${init.out}`);const log = join(box.env.PULLBOARD_HOME, `view-${port}.log`);- assert.equal(lines[0], `Pullboard view is running in the background at http://127.0.0.1:${port}, so pullboard.dev finds this computer's boards (log: ${log}). `- + `To stop it: kill ${record.pid}; turn this off with "view": { "background": false } in ${join(box.env.PULLBOARD_MACHINE_HOME, 'settings.json')}`);+ assert.equal(lines[0], `Pullboard view is running at http://127.0.0.1:${port}.`);+ assert.doesNotMatch(init.out, /\b(?:kill\s+\d+|taskkill\s+\/PID\s+\d+)/iu, 'init does not advise killing the live view');assert.ok(!init.out.includes(record.secret), 'the line names where the view is, never its secret');const listing = await answers(port, record.secret);diff --git a/test/blueprint.test.js b/test/blueprint.test.jsindex 6bd0594b..eac0740a 100644--- a/test/blueprint.test.js+++ b/test/blueprint.test.js@@ -257,7 +257,7 @@ test('every bundled starter item carries a criterion and a check [S1,I1]', () =>// init --blueprint files them with both and prints that the checks are stored, not run.const web = readBlueprint('web-app', process.cwd());const fresh = emptyRepo();- const started = fresh.run('init', '--blueprint', 'web-app');+ const started = fresh.run('init', '--blueprint', 'web-app', '--verbose');assert.equal(started.status, 0, started.stdout + started.stderr);const startedItems = (JSON.parse(fresh.run('list', '--json').stdout).items ?? []).sort((a, b) => a.item_id - b.item_id);assert.deepEqual(startedItems.map((item) => [item.item_title, item.item_criterion, item.item_check]), web.items.map((item) => [item.title, item.criterion, item.check]));@@ -637,9 +637,9 @@ test('blueprint commands say what they did [S1,I1]', () => {writeFileSync(versioned, JSON.stringify(firstVersion));assert.equal(json(box, 'blueprint', 'starters', versioned).starters[0].id, one.id, 'version 1 names the item version 1 filed');- // init --blueprint lists every row that waits for the person, the inherited doctrine row PB7 included.+ // Verbose init --blueprint lists every row that waits for the person, the inherited doctrine row PB7 included.const started = emptyRepo();- const init = started.run('init', '--blueprint', 'web-app');+ const init = started.run('init', '--blueprint', 'web-app', '--verbose');assert.equal(init.status, 0, init.stdout + init.stderr);const waiting = JSON.parse(started.run('spec', '--json').stdout).rows.filter((row) => ['draft', 'pending'].includes(row.status));const doctrineRows = waiting.filter((row) => row.file !== 'SPEC.md');@@ -655,7 +655,7 @@ test('blueprint commands say what they did [S1,I1]', () => {assert.deepEqual(JSON.parse(fromJson.stdout).blueprint.waitingRows.map((row) => row.id).sort(), waiting.map((row) => row.id).sort(), 'the JSON lists the same waiting rows');// A second init --blueprint says the blueprint is already there.- const reinit = started.run('init', '--blueprint', 'web-app');+ const reinit = started.run('init', '--blueprint', 'web-app', '--verbose');assert.equal(reinit.status, 0, reinit.stdout + reinit.stderr);assert.match(reinit.stdout, /the Web app blueprint \(version 1\) is already on this board; nothing added/u);assert.doesNotMatch(reinit.stdout, /added the Web app blueprint/u);@@ -734,7 +734,7 @@ test('init --blueprint starts a board from a blueprint [I1,S1]', () => {// A known name: init as usual, then the blueprint, in one command, with one summary line.const known = emptyRepo();- const started = known.run('init', '--blueprint', 'web-app');+ const started = known.run('init', '--blueprint', 'web-app', '--verbose');assert.equal(started.status, 0, started.stdout + started.stderr);const summary = started.stdout.split('\n').filter((line) => line.startsWith(`added the ${PUBLISHED.title} blueprint:`));assert.equal(summary.length, 1, started.stdout);@@ -897,7 +897,7 @@ test('starter items land in a build lane, never the coordinator lane [S1,I1]', (// A fresh init with a blueprint: init proposes the app lane and the starters are filed in it.// The proposal stays unwritten until the agent runs the command init prints, then tells the person (#914).const fresh = emptyRepo();- const started = fresh.run('init', '--blueprint', 'web-app');+ const started = fresh.run('init', '--blueprint', 'web-app', '--verbose');assert.equal(started.status, 0, started.stdout + started.stderr);assert.deepEqual(lanesOf(fresh), Array(PUBLISHED.items.length).fill('app'), 'init files every starter in the lane it proposes');assert.match(started.stdout, /starter items filed in the app lane, proposed above; add it with the command printed there/u, 'init says the lane is a proposal');diff --git a/test/init-gate.test.js b/test/init-gate.test.jsindex 374d390f..3f29d858 100644--- a/test/init-gate.test.js+++ b/test/init-gate.test.js@@ -57,7 +57,7 @@ test('init says when its gate command cannot run [I1, I2]', () => {const path = isolatedPath(box);const missingRoot = pythonRepo(box, 'missing-gate');- const missing = box.run(missingRoot, 'init');+ const missing = box.run(missingRoot, 'init', '--verbose');assert.equal(missing.code, 0, missing.err || missing.out);const warnings = missing.out.split(/\r?\n/u).filter((line) => line.includes('gate command "pytest" is not available'));assert.equal(warnings.length, 1, 'a missing gate gets one actionable line');@@ -66,7 +66,7 @@ test('init says when its gate command cannot run [I1, I2]', () => {const pathRoot = pythonRepo(box, 'path-gate');const pathMarker = join(box.dir, 'path-gate-ran');writeGateSentinel(join(path, process.platform === 'win32' ? 'pytest.cmd' : 'pytest'), pathMarker);- const onPath = box.run(pathRoot, 'init');+ const onPath = box.run(pathRoot, 'init', '--verbose');assert.equal(onPath.code, 0, onPath.err || onPath.out);assert.doesNotMatch(onPath.out, /gate command "pytest" is not available/u);assert.equal(existsSync(pathMarker), false, 'init checks the executable without running the gate');@@ -77,7 +77,7 @@ test('init says when its gate command cannot run [I1, I2]', () => {const environmentBin = join(environmentRoot, '.venv', process.platform === 'win32' ? 'Scripts' : 'bin');mkdirSync(environmentBin, { recursive: true });writeGateSentinel(join(environmentBin, process.platform === 'win32' ? 'pytest.cmd' : 'pytest'), environmentMarker);- const inEnvironment = box.run(environmentRoot, 'init');+ const inEnvironment = box.run(environmentRoot, 'init', '--verbose');assert.equal(inEnvironment.code, 0, inEnvironment.err || inEnvironment.out);assert.doesNotMatch(inEnvironment.out, /gate command "pytest" is not available/u);assert.equal(existsSync(environmentMarker), false, 'init does not execute a gate found in .venv');@@ -88,7 +88,7 @@ test('init says when its gate command cannot run [I1, I2]', () => {mkdirSync(join(uvEnvironment, process.platform === 'win32' ? 'Scripts' : 'bin'), { recursive: true });writeGateSentinel(join(uvEnvironment, process.platform === 'win32' ? 'Scripts/pytest.cmd' : 'bin/pytest'), uvMarker);box.env.UV_PROJECT_ENVIRONMENT = uvEnvironment;- const inUvEnvironment = box.run(uvRoot, 'init');+ const inUvEnvironment = box.run(uvRoot, 'init', '--verbose');assert.equal(inUvEnvironment.code, 0, inUvEnvironment.err || inUvEnvironment.out);assert.doesNotMatch(inUvEnvironment.out, /gate command "pytest" is not available/u);assert.equal(existsSync(uvMarker), false, 'init does not execute a gate found in the configured uv environment');@@ -102,7 +102,7 @@ test('init says when its gate command cannot run [I1, I2]', () => {mkdirSync(join(decoyEnvironment, process.platform === 'win32' ? 'Scripts' : 'bin'), { recursive: true });writeGateSentinel(join(decoyEnvironment, process.platform === 'win32' ? 'Scripts/pytest.cmd' : 'bin/pytest'), poetryMarker);box.env.POETRY_VIRTUALENVS_PATH = poetryCache;- const decoy = box.run(poetryRoot, 'init');+ const decoy = box.run(poetryRoot, 'init', '--verbose');assert.equal(decoy.code, 0, decoy.err || decoy.out);assert.match(decoy.out, /gate command "pytest" is not available on PATH, project `\.venv`/u,'a same-name Poetry cache entry is not assumed to belong to this repo');@@ -115,11 +115,16 @@ test('init says when its gate command cannot run [I1, I2]', () => {writeGateSentinel(join(activePoetry, process.platform === 'win32' ? 'Scripts/pytest.cmd' : 'bin/pytest'), poetryMarker);box.env.POETRY_ACTIVE = '1';box.env.VIRTUAL_ENV = activePoetry;- const inPoetryEnvironment = box.run(poetryRoot, 'init');+ const inPoetryEnvironment = box.run(poetryRoot, 'init', '--verbose');assert.equal(inPoetryEnvironment.code, 0, inPoetryEnvironment.err || inPoetryEnvironment.out);assert.doesNotMatch(inPoetryEnvironment.out, /gate command "pytest" is not available/u,'an explicitly active Poetry environment is checked');assert.equal(existsSync(poetryMarker), false, 'init does not execute a gate found in the active Poetry environment');+ delete box.env.POETRY_ACTIVE;+ delete box.env.VIRTUAL_ENV;+ const defaultMissing = box.run(pythonRepo(box, 'default-missing-gate'), 'init');+ assert.match(defaultMissing.out, /gate command "pytest" is not available/u, 'the short summary preserves a real missing-executable warning');+ assert.doesNotMatch(defaultMissing.out, /install pytest|pullboard gate set/u, 'detailed recipes stay behind verbose');});test('a repo without package.json is told a gate that fits it [C7,B26]', () => {@@ -132,7 +137,7 @@ test('a repo without package.json is told a gate that fits it [C7,B26]', () => {writeFileSync(join(root, 'app', 'project-check.mjs'),`import { writeFileSync } from 'node:fs';\nwriteFileSync(${JSON.stringify(marker)}, 'tested\\n');\n`);- const initialized = box.run(root, 'init');+ const initialized = box.run(root, 'init', '--verbose');assert.equal(initialized.code, 0, initialized.err || initialized.out);assert.equal(existsSync(join(root, 'package.json')), false, 'the newcomer repo has no package manifest');assert.equal(existsSync(marker), false, 'init does not execute a project command it has not detected');diff --git a/test/init-relay-offer.test.js b/test/init-relay-offer.test.jsindex 50a41b61..9ac43834 100644--- a/test/init-relay-offer.test.js+++ b/test/init-relay-offer.test.js@@ -45,10 +45,10 @@ function safeTail(output, env) {* @param {{ when: string, send: string }[]} keys - Keys to type once each text appears, in order.* @returns {Promise<{ code: number | null, output: string, asked: boolean }>}*/-function initInTerminal(t, cwd, env, keys = [], setupAnswer = 'n\n') {+function initInTerminal(t, cwd, env, keys = [], setupAnswer = 'n\n', verbose = false) {// The shell keeps a trap on SIGINT so Ctrl-C reaches init and still leaves the shell to print// init's exit code; dash, Linux's sh, would otherwise die with it. Init itself gets the default.- const inner = `trap : INT; ${shellWord(process.execPath)} ${shellWord(CLI)} init; echo "pty-exit:$?"`;+ const inner = `trap : INT; ${shellWord(process.execPath)} ${shellWord(CLI)} init${verbose ? ' --verbose' : ''}; echo "pty-exit:$?"`;const script = process.platform === 'darwin' ? ['-q', '/dev/null', '/bin/sh', '-c', inner] : ['-qec', inner, '/dev/null'];const child = startFixtureChild('/bin/sh', ['-c', '/bin/cat | /usr/bin/script "$@"', 'sh', ...script], {cwd, env: { ...env, SHELL: '/bin/sh' }, stdio: ['pipe', 'pipe', 'pipe'],@@ -119,7 +119,7 @@ updateRelayMachine((state) => { state.owner = { account: 'fixture-owner', url: $/** Count the sign-ins the loopback relay has started. */const signIns = (box) => box.calls.filter((call) => call.path.startsWith('/auth/device/start')).length;-/** The last line init printed before the shell's exit mark; init ends with its staging line [I1,I2]. */+/** The last line init printed before the shell's exit mark; init ends with its one next step [I1,I2]. */function lastInitLine(output) {const lines = output.split(EXIT_MARK)[0].replace(/\r/gu, '').split('\n').map((line) => line.trim()).filter(Boolean);return lines.at(-1) ?? '';@@ -151,15 +151,15 @@ test('a person at init shares with one Enter [H5,H17,B26]', { timeout: 240_000 }assert.match(shown.stdout, /^relay\.offerAtInit: true/mu, 'the setting is on unless set to false');});- await t.test('n skips and prints pullboard relay on --all for later [H5]', async () => {+ await t.test('n skips sharing and keeps one next step [H5]', async () => {const before = signIns(box);const root = freshRepository(box, 'answered-no');const run = await initInTerminal(t, root, person, [{ when: QUESTION, send: 'n\r' }]);assert.equal(run.code, 0, `init finishes: ${safeTail(run.output, person)}`);assert.equal(run.asked, true, 'a person at a terminal is asked');assert.equal(run.output.split(QUESTION).length - 1, 1, 'the question is asked once');- assert.ok(run.output.split(QUESTION)[1].includes(RELAY_LATER), 'n prints the command for later');- assert.equal(lastInitLine(run.output), SETUP_COMMIT_LATER, 'the one setup confirmation command stays last');+ assert.equal(run.output.split(QUESTION)[1].includes(RELAY_LATER), false, 'default output leaves the optional recipe behind verbose');+ assert.match(lastInitLine(run.output), /^Next:.*pullboard resume/u, 'the one next step stays last');assert.equal(signIns(box), before, 'n starts no sign-in');assert.equal(linked(root), false, 'n links nothing');});@@ -198,13 +198,13 @@ test('a person at init shares with one Enter [H5,H17,B26]', { timeout: 240_000 }assert.match(after, /Pair your phone once: \S+#device=/u, 'the pairing link is printed');assert.ok(after.includes('\x1b[30;47m') && after.includes('█'), 'the QR is printed');assert.equal(after.includes(RELAY_LATER), false, 'a yes is not told to run the command later');- assert.equal(lastInitLine(run.output), SETUP_COMMIT_LATER, 'the one setup confirmation command stays last');+ assert.match(lastInitLine(run.output), /^Next:.*pullboard resume/u, 'the one next step stays last');assert.deepEqual(['', 'y', 'Y', 'yes', ' y '].map(acceptsRelayOffer), [true, true, true, true, true], 'Enter or y is yes');assert.deepEqual(['n', 'no', 'later', null].map(acceptsRelayOffer), [false, false, false, false], 'anything else, or a closed terminal, is no');});});-test('an agent or CI init is never asked and prints the command [H5,B26]', { timeout: 240_000 }, async (t) => {+test('an agent or CI init stays noninteractive and shows one next step [H5,B26]', { timeout: 240_000 }, async (t) => {const box = await relayClientFixture(t);useLoopbackRelay(box);const person = personEnvironment(box);@@ -219,7 +219,22 @@ test('an agent or CI init is never asked and prints the command [H5,B26]', { timconst run = await start();assert.equal(run.code, 0, `${name}: init finishes: ${safeTail(run.output, person)}`);assert.equal(run.asked, false, `${name}: is never asked`);- assert.ok(run.output.includes(RELAY_LATER), `${name}: prints pullboard relay on --all`);+ assert.equal(run.output.includes(RELAY_LATER), false, `${name}: optional relay recipe stays behind verbose`);+ assert.match(lastInitLine(run.output), /^Next:.*pullboard resume/u, `${name}: one final next step`);}assert.equal(signIns(box), before, 'no sign-in starts without the person');});++test('verbose init retains sharing and setup recipes without starting either [I1,I2,H5,B26]', { timeout: 240_000 }, async (t) => {+ const box = await relayClientFixture(t);+ useLoopbackRelay(box);+ const person = personEnvironment(box);+ const before = signIns(box);+ const root = freshRepository(box, 'verbose-recipes');+ const run = await initInTerminal(t, root, person, [{ when: QUESTION, send: 'n\r' }], 'n\n', true);+ assert.equal(run.code, 0, safeTail(run.output, person));+ assert.ok(run.output.includes(RELAY_LATER), 'verbose preserves the optional sharing recipe');+ assert.ok(run.output.includes(SETUP_COMMIT_LATER), 'verbose preserves the deferred setup commit recipe');+ assert.equal(signIns(box), before, 'recipes do not start sign-in');+ assert.equal(linked(root), false, 'declining still links nothing');+});