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
chore(merge): carry #677's head into #679 [S1]
Corey Olson2d3e59e15b67
diff --cc test/blueprint.test.jsindex cf5db24d,d33ba216..0359183e--- a/test/blueprint.test.js+++ b/test/blueprint.test.js@@@ -1,7 -1,7 +1,7 @@@/** pullboard blueprint add: a blueprint lands on a board as drafts, once [S1,I1]. */import assert from 'node:assert/strict';- import { chmodSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';+ import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';-import { tmpdir } from 'node:os';+import { hostname, tmpdir } from 'node:os';import { join, resolve } from 'node:path';import { after, test } from 'node:test';import { runFixtureChild, runFixtureGit } from './fixture-child.js';@@@ -239,71 -238,27 +239,96 @@@ test('blueprint add files a blueprint aassert.equal(json(box, 'blueprint', 'add', 'web-app').items.length, 0, 'and then a repeat adds nothing');});+ 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');+ }+ });+++const e2e = createE2eHelpers();+after(e2e.cleanup);++test('a saved board adds back as the same rows [S1]', () => {+ const box = e2e.project();+ const machine = hostname().split('.')[0];+ box.git(box.repo, 'config', 'user.name', 'Dana Whitlock');+ box.git(box.repo, 'config', 'user.email', '[email protected]');+ const kept = [+ '- K1 [approved, must] Every change ships with a test that fails without it. Why: a test that passes either way proves nothing. | gate: web/page.test.js | signers: DW',+ '- K2 [approved, aim] Every page works at phone width. Why: a page that only works on a laptop is a bug nobody reports. | gate: review',+ '- K3 [approved, must] The app is built with: SvelteKit. Choices: Next.js, SvelteKit, Rails. | gate: review',+ '- K12 [approved, must] Deploy: where it goes: Fly.io. Choices: Vercel, Fly.io. | gate: review',+ '- K13 [approved, must] People sign in with: Email, then a link. Choices: Email, then a link, Passwords. | gate: review',+ ];+ const planted = [+ '- K4 [approved, must] Logs live in web/logs/app.js. Why: one place to look. | gate: review',+ '- K5 [approved, must] Escalations go to [email protected] first. Why: she owns releases. | gate: review',+ '- K6 [approved, must] Agent web-1 owns the header. Why: it wrote it. | gate: review',+ '- K7 [approved, must] Dana approves every release. Why: she carries the pager. | gate: review',+ `- K8 [approved, must] Builds run on ${machine} only. Why: it holds the signing key. | gate: review`,+ '- K9 [approved, must] The page renders without a reason. | gate: review',+ '- K10 [draft, must] A draft never leaves. Why: nobody decided it. | gate: review',+ '- K11 [pending, must] Deploys go to: Vercel. Choices: Vercel, Fly.io. | gate: review',+ '- K14 [approved, must] Pick one: x. Choices: x, y, z, w. | gate: review',+ '- K15 [approved, must] Pick a host: Rails. Choices: Vercel, Fly.io. | gate: review',+ '- K16 [approved, must] A rule. Why: one. Why: two. | gate: review',+ ];+ const config = JSON.parse(readFileSync(join(box.repo, 'pullboard.json'), 'utf8'));+ writeFileSync(join(box.repo, 'pullboard.json'), JSON.stringify({ ...config, name: 'Dana Whitlock board' }, null, 2));+ writeFileSync(join(box.repo, 'SPEC.md'), `${readFileSync(join(box.repo, 'SPEC.md'), 'utf8')}\n## K · Kept\n\n<!-- pullboard-blueprint kept 1 -->\n<!-- pullboard-blueprint kept 2 adding K1=K1 K3=K3 -->\n${[...kept, ...planted].join('\n')}\n`);+ box.git(box.repo, 'add', 'SPEC.md', 'pullboard.json');+ box.git(box.repo, 'commit', '-q', '-m', 'chore: plant private rows');+ const item = box.run(box.repo, 'add', 'web', 'Private item title zebra', '--specs', 'G1', '--criterion', 'secret criterion walrus');+ assert.equal(item.code, 0, item.err);+ assert.equal(box.run(box.web, 'shout', 'all', 'private shout narwhal').code, 0);++ const saved = box.run(box.repo, 'blueprint', 'save', '--json');+ assert.equal(saved.code, 0, `${saved.err}\n${saved.out}`);+ assert.deepEqual(JSON.parse(saved.out).left.map((entry) => entry.id).sort(), ['G1', 'G2', 'K14', 'K15', 'K16', 'K4', 'K5', 'K6', 'K7', 'K8', 'K9'], 'only clean, exactly readable approved rows leave');+ const file = join(box.repo, 'Dana Whitlock board.blueprint.json');+ const text = readFileSync(file, 'utf8');+ for (const secret of ['web/', '@', 'Dana', 'Whitlock', 'web-1', machine, 'zebra', 'walrus', 'narwhal', 'signers', 'DW', 'items', 'pullboard-blueprint', 'Logs live', 'draft never', 'Deploys go']) {+ assert.ok(!text.includes(secret), `the blueprint never carries ${JSON.stringify(secret)}`);+ }+ const blueprint = JSON.parse(text);+ assert.deepEqual([blueprint.name, blueprint.title], ['my-blueprint', 'My blueprint'], 'the project name never goes in; a neutral default does');+ const named = box.run(box.repo, 'blueprint', 'save', 'named.json', '--name', 'dana-whitlock', '--json');+ assert.equal(JSON.parse(named.out).error?.code, 'PRIVATE_BLUEPRINT', 'a chosen name that names someone is refused');+ assert.deepEqual(Object.keys(blueprint).sort(), ['blueprint', 'gate', 'name', 'questions', 'rules', 'title', 'version'], 'only allow-listed fields are written');+ assert.deepEqual(blueprint.rules.map((rule) => Object.keys(rule).sort()), [['gate', 'key', 'text', 'tier', 'why'], ['gate', 'key', 'text', 'tier', 'why']]);+ assert.deepEqual(blueprint.questions.map((question) => Object.keys(question).sort()), Array(3).fill(['ask', 'choices', 'default', 'key']));+ assert.equal(box.run(box.repo, 'blueprint', 'save', '--json').code, 1, 'an existing file is never overwritten');++ const fresh = e2e.project();+ const before = parseSpec(readFileSync(join(fresh.repo, 'SPEC.md'), 'utf8')).rows.map((row) => row.id);+ const added = fresh.run(fresh.repo, 'blueprint', 'add', file);+ assert.equal(added.code, 0, `${added.err}\n${added.out}`);+ const rows = parseSpec(readFileSync(join(fresh.repo, 'SPEC.md'), 'utf8')).rows.filter((row) => !before.includes(row.id));+ assert.deepEqual(rows.map((row) => [row.status, row.tier, row.text]), [+ ['draft', 'must', 'Every change ships with a test that fails without it. Why: a test that passes either way proves nothing.'],+ ['draft', 'aim', 'Every page works at phone width. Why: a page that only works on a laptop is a bug nobody reports.'],+ ['pending', 'must', 'The app is built with: SvelteKit. Choices: Next.js, SvelteKit, Rails.'],+ ['pending', 'must', 'Deploy: where it goes: Fly.io. Choices: Vercel, Fly.io.'],+ ['pending', 'must', 'People sign in with: Email, then a link. Choices: Email, then a link, Passwords.'],+ ], 'the approved rows come back as drafts, each answered question exactly, its answer the default');+ assert.deepEqual(JSON.parse(fresh.run(fresh.repo, 'list', '--json').out).items ?? [], [], 'a saved blueprint files no items');+});