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
/** @pullboard-test-input source-tree */
/** Typed item conversations use the real CLI, Git, SQLite and runner pack [B29,B30,B31,B32,N14,N26]. */
import assert from 'node:assert/strict';
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { after, test } from 'node:test';
import * as store from '../src/board.js';
import { createE2eHelpers } from './e2e-helpers.js';
import { onBoard } from './land-board-fixture.js';
const helpers = createE2eHelpers();
after(helpers.cleanup);
/** Keep every public command's failure beside the assertion that needs its result. */
function command(box, cwd, ...args) {
const result = box.run(cwd, ...args);
assert.equal(result.code, 0, `${args.join(' ')}\n${result.out}\n${result.err}`);
return result;
}
/** Read the CLI's actual JSON projection rather than constructing an expected thread. */
function document(box, cwd, ...args) {
return JSON.parse(command(box, cwd, ...args, '--json').out);
}
/** Append a public fact with its original text, author, timestamp and stable identity. */
function note(box, cwd, item, kind, text) {
const fact = document(box, cwd, 'fact', String(item), kind, text).fact;
assert.equal(fact.kind, kind);
assert.equal(fact.text, text);
assert.ok(fact.id);
assert.ok(fact.at);
assert.ok(fact.by);
return fact;
}
test('typed notes on an item reach its agents and stay off the board-wide feed [B29,B30,B31,B32,N14,N26]', () => {
const box = helpers.project();
command(box, box.web, 'join', 'web', '--model', 'Scripted builder', '--parent', 'notes-builder-parent');
const reviewer = join(box.dir, 'notes-reviewer');
box.git(box.repo, 'worktree', 'add', '-q', '--detach', reviewer, 'main');
command(box, reviewer, 'join', 'web', '--model', 'Scripted reviewer', '--parent', 'notes-reviewer-parent');
const added = document(box, box.repo, 'add', 'web', 'Read the item conversation', '--specs', 'G1',
'--route', 'light', '--criterion', 'the page exists', '--check', 'test -f web/page.js',
'--brief', helpers.LIGHT_BRIEF, '--wait');
const id = added.item.item_id;
const other = document(box, box.repo, 'add', 'api', 'An unrelated conversation', '--specs', 'G2',
'--criterion', 'no item conversation leaks', '--check', 'true', '--wait').item.item_id;
command(box, box.web, 'claim', String(id));
const before = onBoard(box, board => store.allShouts(board));
const notes = [
note(box, box.web, id, 'bar-check', 'bar: the page exists\nedge cases: an empty page is allowed\ntest: the real file exists'),
note(box, box.web, id, 'question', 'Does <text> retain its exact bytes?\nThis is a second line.'),
note(box, reviewer, id, 'answer', 'Yes, preserve the exact bytes; this is not a person approval.'),
note(box, box.web, id, 'plan', 'Read this thread before changing web/page.js.'),
note(box, reviewer, id, 'risk', 'A board-wide shout would disclose unrelated item conversation.'),
];
note(box, reviewer, other, 'risk', 'OTHER-ITEM-ONLY: do not put this in the first item pack.');
assert.deepEqual(onBoard(box, board => store.allShouts(board)), before,
'posting the conversation creates no shout or board-wide delivery');
for (const path of [box.web, reviewer]) {
const thread = document(box, path, 'show', String(id)).thread.filter(entry => entry.type === 'fact');
assert.deepEqual(thread.map(({ id, kind, text, by, at }) => ({ id, kind, text, by, at })),
notes.map(({ id, kind, text, by, at }) => ({ id, kind, text, by, at })));
}
assert.equal(onBoard(box, board => store.openDecisions(board).length), 0,
'an observational question and answer do not become an approval decision');
command(box, box.web, 'release', String(id));
const captured = join(box.dir, 'actual-context-pack.md');
const script = join(box.dir, 'read-pack.cjs');
writeFileSync(script, [
"const fs = require('node:fs');",
`fs.writeFileSync(${JSON.stringify(captured)}, fs.readFileSync(process.env.PULLBOARD_PACK));`,
"fs.mkdirSync('web', { recursive: true }); fs.writeFileSync('web/page.js', 'PASS\\n');",
].join('\n'));
const ran = command(box, box.web, 'run', '--agent-light', `"${process.execPath}" "${script}"`,
'--attempts', '1', '--items', '1');
assert.match(ran.out, new RegExp(`submitted #${id}`));
const pack = readFileSync(captured, 'utf8');
for (const fact of notes) {
assert.ok(pack.includes(fact.text), `${fact.kind} text reaches the actual run pack`);
assert.ok(pack.includes(fact.id), `${fact.kind} identity reaches the actual run pack`);
assert.ok(pack.includes(fact.by), `${fact.kind} author reaches the actual run pack`);
}
assert.ok(!pack.includes('OTHER-ITEM-ONLY'), 'the pack reads only this item conversation');
const held = document(box, reviewer, 'next', '--verify', String(id));
assert.equal(held.item.item_id, id, 'the independent reviewer really reserves the submitted item');
assert.deepEqual(document(box, reviewer, 'show', String(id)).thread.filter(entry => entry.type === 'fact'),
document(box, box.web, 'show', String(id)).thread.filter(entry => entry.type === 'fact'));
command(box, box.repo, 'shout', 'all', 'A real board-wide release is ready.');
const feed = onBoard(box, board => store.allShouts(board));
assert.ok(feed.some(row => row.shout_text === 'A real board-wide release is ready.'), 'board news still reaches its feed');
for (const fact of notes) assert.ok(!feed.some(row => row.shout_text.includes(fact.text)), 'item notes never become shouts');
});