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
Merge commit '1c478182' into core/678-claude-b
Corey Olson7966aae03965
diff --cc src/cli.jsindex 6daea5f0,e108832a..dfb93e8f--- a/src/cli.js+++ b/src/cli.js@@@ -1581,13 -1580,6 +1581,10 @@@ function setupCommands(io, { first, valreturn {init: async () => {const info = repoInfo(io.cwd);+ // A named blueprint is read and checked before anything is written, so an unknown name- // or a broken file leaves the repository untouched (#678). Init fetches no URL; past that it- // adds the blueprint exactly as pullboard blueprint add does, through the same function.- if (values.blueprint !== undefined && /^[a-z][a-z0-9+.-]*:\/\//iu.test(values.blueprint)) {- throw new Refused('BLUEPRINT_URL', `init reads a bundled blueprint name or a local file, never a URL; download ${values.blueprint} yourself, read it, then run pullboard init --blueprint <file>`);- }++ // or a broken file or a URL leaves the repository untouched (#678). Past that, init adds the++ // blueprint exactly as pullboard blueprint add does, through the same function.+ const blueprint = values.blueprint === undefined ? null : readBlueprint(values.blueprint, info.root);const model = optionalModel(values.model);const linked = relayLinked(info.root);const ctx = linked && model !== undefined ? context(io) : null;diff --cc test/blueprint.test.jsindex 273c4343,d33ba216..7057a487--- a/test/blueprint.test.js+++ b/test/blueprint.test.js@@@ -238,86 -238,27 +238,111 @@@ test('blueprint add files a blueprint aassert.equal(json(box, 'blueprint', 'add', 'web-app').items.length, 0, 'and then a repeat adds nothing');});+/** A Git repository with history but no Pullboard yet, using the same private homes as freshBoard. */+function emptyRepo() {+ const dir = mkdtempSync(join(tmpdir(), 'pullboard-blueprint-init-'));+ DIRS.push(dir);+ const bin = join(dir, 'bin');+ mkdirSync(bin);+ writeFileSync(join(bin, 'pullboard'), `#!/bin/sh\nexec '${process.execPath.replaceAll("'", "'\\''")}' '${BIN.replaceAll("'", "'\\''")}' "$@"\n`);+ chmodSync(join(bin, 'pullboard'), 0o755);+ const env = { ...process.env };+ for (const key of Object.keys(env)) if (key.startsWith('GIT_') || MARKERS.includes(key)) delete env[key];+ Object.assign(env, {+ PATH: `${bin}:${process.env.PATH}`,+ PULLBOARD_HOME: join(dir, 'home'), PULLBOARD_MACHINE_HOME: join(dir, 'machine-home'),+ GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_NOSYSTEM: '1',+ GIT_AUTHOR_NAME: 'Blueprint fixture', GIT_AUTHOR_EMAIL: '[email protected]',+ GIT_COMMITTER_NAME: 'Blueprint fixture', GIT_COMMITTER_EMAIL: '[email protected]',+ });+ const repo = join(dir, 'repo');+ mkdirSync(repo);+ const run = (...args) => runFixtureChild(process.execPath, [BIN, ...args], { cwd: repo, env, encoding: 'utf8' });+ runFixtureGit(['init', '-q', '-b', 'main'], { cwd: repo, env });+ return { dir, repo, run };+}++test('init --blueprint starts a board from a blueprint [I1,S1]', () => {+ const waiting = PUBLISHED.rules.length + PUBLISHED.questions.length;++ // 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');+ 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);+ assert.match(summary[0], new RegExp(`: ${waiting} rows wait for your approval in SPEC\\.md \\(.*${PUBLISHED.title}\\), ${PUBLISHED.items.length} starter items filed`, 'u'));+ const spec = parseSpec(readFileSync(join(known.repo, 'SPEC.md'), 'utf8'));+ const section = spec.sections.find((entry) => entry.name.includes(PUBLISHED.title));+ assert.ok(section, 'the blueprint has its own SPEC.md section');+ const rows = spec.rows.filter((row) => row.section === section.name);+ assert.equal(rows.length, waiting);+ assert.ok(rows.every((row) => row.status !== 'approved'), 'nothing is approved');+ const items = JSON.parse(known.run('list', '--json').stdout).items ?? [];+ assert.equal(items.length, PUBLISHED.items.length, 'each starter item is filed once');+ assert.ok(existsSync(join(known.repo, 'pullboard.json')) && existsSync(join(known.repo, 'DOCTRINE.md')), 'init set the repository up as usual');++ // An unknown name: refused before anything is written, naming the bundled blueprints.+ const unknown = emptyRepo();+ const refused = unknown.run('init', '--blueprint', 'no-such-blueprint', '--json');+ assert.notEqual(refused.status, 0);+ const refusal = JSON.parse(refused.stdout).error;+ assert.equal(refusal.code, 'NO_BLUEPRINT');+ assert.match(refusal.message, /web-app/u, 'the refusal lists the bundled blueprints');+ assert.deepEqual(readdirSync(unknown.repo).filter((name) => name !== '.git'), [], 'nothing is written');+ assert.equal(existsSync(join(unknown.repo, '.git', 'pullboard')), false, 'no board is created');++ // A URL is refused unfetched and leaves the repository untouched. A starter that carries a check+ // is filed with that check stored, exactly as pullboard blueprint add files it.+ const remote = emptyRepo();+ const fetched = remote.run('init', '--blueprint', 'https://example.invalid/web-app.json', '--json');+ assert.notEqual(fetched.status, 0);+ assert.equal(JSON.parse(fetched.stdout).error.code, 'BLUEPRINT_URL');+ assert.deepEqual(readdirSync(remote.repo).filter((name) => name !== '.git'), [], 'a URL writes nothing');+ assert.equal(existsSync(join(remote.repo, '.git', 'pullboard')), false, 'a URL creates no board');+ const outside = mkdtempSync(join(tmpdir(), 'pullboard-blueprint-check-'));+ const withCheck = join(outside, 'checked.blueprint.json');+ writeFileSync(withCheck, JSON.stringify({ ...PUBLISHED, items: PUBLISHED.items.map((item, index) => (index === 0 ? { ...item, check: 'true' } : item)) }));+ const checkedRepo = emptyRepo();+ const checked = checkedRepo.run('init', '--blueprint', withCheck);+ assert.equal(checked.status, 0, checked.stdout + checked.stderr);+ const filed = JSON.parse(checkedRepo.run('list', '--json').stdout).items ?? [];+ assert.equal(filed.length, PUBLISHED.items.length, 'every starter is filed, the checked one included');+ const starter = filed.find((item) => item.item_title === PUBLISHED.items[0].title);+ assert.ok(starter, 'the checked starter is on the board');+ assert.equal(starter.item_check, 'true', 'its check is stored as written');+ rmSync(outside, { recursive: true, force: true });++ // Plain init is unchanged: no blueprint section, no items, no summary line.+ const plain = emptyRepo();+ const initialized = plain.run('init');+ assert.equal(initialized.status, 0, initialized.stdout + initialized.stderr);+ assert.doesNotMatch(initialized.stdout, /blueprint/u);+ assert.doesNotMatch(readFileSync(join(plain.repo, 'SPEC.md'), 'utf8'), /pullboard-blueprint/u);+ assert.deepEqual(JSON.parse(plain.run('list', '--json').stdout).items ?? [], []);+});+++ test('blueprint add files a blueprint as drafts and runs nothing it supplies [S1,I1]', () => {+ // A starter's check is stored on the item, but no check baseline starts: add executes nothing+ // from a blueprint, and says so. A blueprint is never read from a URL.+ const box = freshBoard({ gate: 'true' });+ const marker = join(box.dir, 'check-ran');+ const brief = 'Files:\n- web/index.html\nTest:\n- test/home.test.js asserts the page loads';+ const check = `touch '${marker}'`;+ writeFileSync(join(box.repo, 'checked.json'), `${JSON.stringify({ ...PUBLISHED, name: 'checked',+ items: [{ key: '1', title: 'Checked starter', cites: ['W1'], route: 'light', brief, criterion: 'The page loads.', check }] })}\n`);+ const added = json(box, 'blueprint', 'add', 'checked.json');+ const id = added.items[0].id;+ const item = json(box, 'show', String(id));+ assert.equal(item.item_check, check, 'the check is stored unchanged');+ assert.equal(item.item_check_baseline ?? null, null, 'no check baseline was started');+ assert.equal(existsSync(marker), false, 'the check command never ran');+ assert.deepEqual(added.checksNotRun, [id], 'the summary names the checks that were not run');+ const text = box.run('blueprint', 'add', 'checked.json');+ assert.match(text.stdout, /already on this board/u);+ for (const url of ['https://pullboard.dev/blueprints/web-app.json', 'file:///tmp/web-app.json']) {+ const refused = box.run('blueprint', 'add', url, '--json');+ assert.equal(refused.status, 1, refused.stdout + refused.stderr);+ assert.equal(JSON.parse(refused.stdout).error.code, 'BLUEPRINT_URL');+ }+ });