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(init): show one next step after setup [I1,I2,H5]
Corey Olson095249d1f13e
diff --git a/src/commands/init.js b/src/commands/init.jsindex 46c3c619..345e2616 100644--- a/src/commands/init.js+++ b/src/commands/init.js@@ -1,6 +1,5 @@/** The pullboard init command, in its own module so an item adding another command never edits these lines. */import {- backgroundViewLine,keepViewRunning,} from '../background-view.js';import {@@ -20,6 +19,8 @@ import {import {beginInitCommit,finishInitCommit,+ initNextLine,+ initViewLine,reportInitSetup,SETUP_COMMIT_LATER,} from '../init-finish.js';@@ -92,19 +93,22 @@ export async function run(io, { values }) {]));// Keep blueprint initialization and the person's unwritten lane proposals in the same result.const landed = await landEach(blueprints, ({ reference, blueprint }, drafted) => addBlueprintHere(io, reference, { report: false, blueprint, drafted }));- const { result } = reportInitSetup(io, info, notes, landed, Boolean(agentSessionDigest()));+ const { result } = reportInitSetup(io, info, notes, landed, { verbose: values.verbose });const setupCommit = await finishInitCommit(setupPlan, { io, yes: values.yes, landed, permissions: !values['no-permissions'] });result.setupCommit = setupCommit;if (await registerProjectAndLink(info.root, new Date(), loadConfig(info.root), io)) io.say('registered this project on this machine, so pullboard view lists it');// Once registered, a background view lists this board for pullboard.dev [H5,N26].const view = await keepViewRunning();io.result?.({ ...result, view });- const viewLine = backgroundViewLine(view);+ const viewLine = initViewLine(view);if (viewLine) io.say(viewLine);// Sharing remains a separate choice; --yes confirms only the setup commit.- const code = await offerRelayAtInit(info.root, io);- if (setupCommit.skipped.length) io.say(`Your earlier changes remain uncommitted: ${setupCommit.skipped.join(', ')}.`);- if (setupCommit.state === 'pending') io.say(SETUP_COMMIT_LATER);+ const code = await offerRelayAtInit(info.root, io, { details: values.verbose === true });+ if (setupCommit.skipped.length) io.say(values.verbose+ ? `Your earlier changes remain uncommitted: ${setupCommit.skipped.join(', ')}.`+ : `Kept ${setupCommit.skipped.length} earlier changes uncommitted.`);+ if (setupCommit.state === 'pending' && values.verbose) io.say(SETUP_COMMIT_LATER);if (setupCommit.state === 'committed') io.say(`Committed ${setupCommit.skipped.length ? 'only unchanged Pullboard files' : 'Pullboard setup'} at ${setupCommit.commit.slice(0, 12)}.`);+ io.say(initNextLine(Boolean(agentSessionDigest())));return code;}diff --git a/src/help.js b/src/help.jsindex b1a97f0e..caf790d7 100644--- a/src/help.js+++ b/src/help.js@@ -10,7 +10,7 @@ Nothing ships until a second agent verifies it.Set uppullboard tour see it work: a reject and its rework, scripted, in thirty seconds- pullboard init [--model <name>] [--blueprint <name or file>]... [--no-permissions] [--yes] setup and project rules; --yes commits only setup's own files with your Git identity+ pullboard init [--model <name>] [--blueprint <name or file>]... [--no-permissions] [--yes] [--verbose] short setup summary; --verbose shows recipes; --yes commits only setup's own files with your Git identitypullboard worktree <lane> --model <name> [--route light] [--family <name>] make and join a worktree for a new agentpullboard.json worktrees: inside or beside; init defaults to insidepullboard join <lane> --model <name> [--route light] [--family <name>] register this worktree as an agentdiff --git a/src/init-finish.js b/src/init-finish.jsindex 2efa5a62..da3695d1 100644--- a/src/init-finish.js+++ b/src/init-finish.js@@ -46,6 +46,20 @@ import { Refused } from './refused.js';export const SETUP_COMMIT_QUESTION = 'Commit Pullboard setup now? [Y/n] ';export const SETUP_COMMIT_LATER = "To commit Pullboard's files: pullboard init --yes";+/** End setup with one action; the agent reads the remaining questions through resume. */+export function initNextLine(agentSession) {+ return agentSession ? 'Next: run pullboard resume to continue setup in this session.'+ : 'Next: ask your agent to run pullboard resume to finish setup.';+}++/** Describe the view without suggesting process termination, including when its port belongs to another program. */+export function initViewLine(view) {+ if (['started', 'running'].includes(view.state)) return `Pullboard view is running at http://127.0.0.1:${view.port}.`;+ if (view.state === 'busy') return `Port ${view.port} is in use; the background view did not start.`;+ if (view.state === 'failed') return 'The background view did not start; setup is ready.';+ return null;+}+/** Bind content to the executable mode Git records. */function setupFingerprint(mode, content) {return createHash('sha256').update(mode + ':').update(content).digest('hex');@@ -183,7 +197,7 @@ export async function finishInitCommit(plan, { io, yes, landed, permissions }) {}/** Report setup and blueprint notes together, keeping the CLI command itself bounded. */-export function reportInitSetup(io, info, notes, landed, agentSession) {+export function reportInitSetup(io, info, notes, landed, { verbose = false } = {}) {const fresh = landed.filter(added => !added.marked);const waiting = landed.length ? initWaitingRows(info.root, { rows: fresh.flatMap(added => added.rows) }) : [];/** Give each blueprint the same complete list of still-undecided rows. */@@ -192,9 +206,12 @@ export function reportInitSetup(io, info, notes, landed, agentSession) {...(landed.length ? { blueprint: blueprintResult(landed[0]), blueprints: landed.map(blueprintResult) } : {}) };io.result?.(result);const staging = notes.at(-1)?.startsWith('git add -f -- ') ? notes.at(-1) : null;- io.say(agentSession- ? 'Next: run pullboard resume now to continue setup in this session; the new skills load next session, and setup does not need them.\nSetup details:'- : 'Next: ask your agent to set up Pullboard here; in Claude Code, start a new session first so it loads the Pullboard skills.\nSetup details:');+ if (!verbose) {+ io.say('Set up Pullboard: board, project rules, Git hooks and agent instructions.');+ if (landed.length) io.say(`Blueprints: ${landed.length}; ${waiting.length} rows waiting for a decision.`);+ return { result, staging };+ }+ io.say('Setup details:');(staging ? notes.slice(0, -1) : notes).forEach(note => io.say(note));for (const added of landed) {if (added.marked) io.say(alreadyAddedLine(added.blueprint));diff --git a/src/relay-setup.js b/src/relay-setup.jsindex 0227e089..b3945620 100644--- a/src/relay-setup.js+++ b/src/relay-setup.js@@ -474,12 +474,12 @@ function askLine(io, question) {* @param {any} io* @returns {Promise<number>}*/-export async function offerRelayAtInit(root, io) {+export async function offerRelayAtInit(root, io, { details = true } = {}) {const shared = relayLinked(root) || readRelayMachine().autoLink;const offer = relayOfferAtInit({ enabled: relayOfferEnabled(), shared, stdin: io.stdin, stdout: io.stdout });if (offer === 'none') return 0;if (offer === 'ask' && acceptsRelayOffer(await askLine(io, RELAY_OFFER_QUESTION))) return await relayOnAllCommand(undefined, io);- io.say(RELAY_LATER);+ if (details) io.say(RELAY_LATER);return 0;}diff --git a/src/templates.js b/src/templates.jsindex 976f24c9..1522e6cb 100644--- a/src/templates.js+++ b/src/templates.js@@ -108,7 +108,7 @@ This repo runs on pullboard: a work board, lanes and a spec that live in git. No**Source of truth.** \`SPEC.md\` holds every requirement as a row with an id, like \`G1.2\`. Code follows the spec. Commits cite the ids they serve: \`feat(scope): subject [G1.2]\`. Only a person approves or changes an approved row. Ids are permanent: a row the person cuts stays, marked \`wont\` (won't build), so every commit that cites it keeps its meaning. Propose each requirement with \`pullboard spec draft "<text>"\`; it returns the draft row id for the person to approve. To start from a blueprint's rules, questions and starter items, run \`pullboard blueprint add <name or file>\` (bundled: web-app); it files them all as drafts for the person to approve. Its questions file as pending rows, each with a default answer and its choices: the person answers one with \`pullboard spec answer <id> "<choice or text>"\` from the main checkout or the view, and the coordinator writes it with \`pullboard spec apply\`. Never answer a question by editing SPEC.md; spec check flags it. To share this board's approved rules and answered questions as a blueprint, run \`pullboard blueprint save [file]\`; it never writes items, notes, paths, emails or names.-**Blueprint starters.** To see which of a blueprint's starter items are on the board, run \`pullboard blueprint starters <name or file>\`; it names each filed item's id and status. \`pullboard init --blueprint\` lists every row that waits for the person, doctrine rows included.+**Blueprint starters.** To see which of a blueprint's starter items are on the board, run \`pullboard blueprint starters <name or file>\`; it names each filed item's id and status. \`pullboard init --blueprint <name> --verbose\` lists every row that waits for the person, doctrine rows included.**Doctrine.** Our house rules for agentic development. This repo inherits Pullboard standard doctrine version 1. ${doctrine.repo ? doctrine.name : DOCTRINE_FILE} adds the repo's own rows, overrides a standard rule by its PB id, or declines it with a wont row and its reason as the row text: - PB7 [wont] <why>. Approved rows are in force; follow them as you would the spec. A rule with \`gate: check <command>\` and \`count: N\` holds a count that only falls: run pullboard doctrine check to see each count, and submit refuses RATCHET_ROSE when a touched rule rises or a changed file gains a problem. Lower \`count:\` in a commit when you fix problems; only the person raises it. Run pullboard spec --json to read the current merged rules. Re-run pullboard init after changing the doctrine to refresh this managed guidance.diff --git a/test/init-gate.test.js b/test/init-gate.test.jsindex 2bead8d0..374d390f 100644--- a/test/init-gate.test.js+++ b/test/init-gate.test.js@@ -5,10 +5,15 @@ import { delimiter, join } from 'node:path';import { after, test } from 'node:test';import { createE2eHelpers } from './e2e-helpers.js';import { runFixtureChild } from './fixture-child.js';+import { assertShortInit } from './init-short-fixture.js';const e2e = createE2eHelpers();after(e2e.cleanup);+test('init prints a short summary and one next step and never suggests killing a process [I1,I2,H5,N26]', async (t) => {+ await assertShortInit(t, e2e.sandbox);+});+/** Create a fresh git repository whose detected gate is pytest. */function pythonRepo(box, name) {const root = join(box.dir, name);diff --git a/test/init-short-fixture.js b/test/init-short-fixture.jsnew file mode 100644index 00000000..7d097df5--- /dev/null+++ b/test/init-short-fixture.js@@ -0,0 +1,54 @@+/** First-run summaries stay bounded without hiding verbose setup or touching foreign listeners [I1,I2,H5,N26]. */+import assert from 'node:assert/strict';+import { existsSync, mkdirSync } from 'node:fs';+import { createServer } from 'node:net';+import { join } from 'node:path';+import { takeDefaultViewPort } from './view-port-fixture.js';++/** Exercise separate real first runs, including an owned listener that keeps the view port busy. */+export async function assertShortInit(t, sandbox) {+ const owner = sandbox();+ const lease = await takeDefaultViewPort(owner.dir, { agent: `init-summary-${process.pid}` });+ const held = createServer(socket => socket.destroy());+ await new Promise((done, fail) => { held.once('error', fail); held.listen(lease.port, '127.0.0.1', done); });+ t.after(async () => { await new Promise(done => held.close(done)); lease.release(); });+ const failures = [];+ /** Collect independent output assertions while allowing setup failures to retain their real cause. */+ const observe = (check) => { try { check(); } catch (error) { if (error.code !== 'ERR_ASSERTION') throw error; failures.push(error.message); } };+ for (const mode of ['plain', 'blueprint', 'busy']) {+ for (const verbose of [false, true]) {+ const box = sandbox();+ const repo = join(box.dir, `${mode}-${verbose ? 'verbose' : 'default'}`);+ mkdirSync(repo);+ box.git(repo, 'init', '-q', '-b', 'main');+ if (mode === 'busy') {+ box.env.PULLBOARD_VIEW_BACKGROUND = '1';+ box.env.PULLBOARD_VIEW_PORT = String(lease.port);+ }+ const args = ['init', ...(mode === 'blueprint' ? ['--blueprint', 'web-app'] : []), ...(verbose ? ['--verbose'] : [])];+ const result = box.run(repo, ...args);+ assert.equal(result.code, 0, result.err || result.out);+ const visible = result.out + result.err;+ const lines = visible.split(/\r?\n/u).filter(line => line.trim());+ const label = `${mode} ${verbose ? 'verbose' : 'default'}`;+ observe(() => assert.doesNotMatch(visible, /\b(?:kill(?:\s+-\w+)*\s+\d+|taskkill\s+\/PID\s+\d+)/iu, `${label}: init never advises killing a PID`));+ if (verbose) {+ observe(() => assert.match(visible, /sandbox_mode/u, `${label}: Codex permission details remain available`));+ observe(() => assert.match(visible, /--detach/u, `${label}: the full reviewer startup remains available`));+ } else {+ observe(() => assert.ok(lines.length <= 12, `${label}: first-run visible output has ${lines.length} lines, maximum12`));+ observe(() => assert.equal(lines.filter(line => /^Next:/u.test(line)).length, 1, `${label}: exactly one Next line`));+ observe(() => assert.match(lines.at(-1), /^Next:/u, `${label}: the one next step is last`));+ observe(() => assert.equal((visible.match(/\bpullboard (?:resume|init|relay|worktree|next)\b/gu) ?? []).length, 1, `${label}: only one actionable command`));+ observe(() => assert.doesNotMatch(visible, /sandbox_mode|--detach/u, `${label}: detailed recipes are behind verbose`));+ }+ if (mode === 'busy') {+ observe(() => assert.match(visible, new RegExp(`(?:port|Port) ${lease.port} .*in use`, 'u'), `${label}: actual port contention is reported`));+ assert.ok(held.listening, 'init leaves the owned listener running');+ }+ assert.ok(existsSync(join(repo, 'AGENTS.md')), 'the short report still installs agent instructions');+ assert.ok(existsSync(join(repo, '.codex', 'rules', 'pullboard.rules')), 'the short report still installs Codex rules');+ }+ }+ assert.deepEqual(failures, [], failures.join('\n'));+}