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): ask before choosing an unknown gate [C7,B26]
Corey Olson76b5a79d188d
diff --git a/src/init.js b/src/init.jsindex be60c078..1f409923 100644--- a/src/init.js+++ b/src/init.js@@ -580,7 +580,7 @@ export function initRepo({ info, openBoardHere, register, closeBoard, model, perconst { root } = info;const worktreeMode = existsSync(join(root, CONFIG_FILE)) ? loadConfig(root).worktrees : 'inside';const doctrine = existsSync(join(root, CONFIG_FILE)) ? loadConfig(root).practice : doctrineFile(root);- const gate = detectGate(root) || 'pullboard spec check';+ const gate = detectGate(root);const configured = configuredGate(root);const written = [];/** Record only paths setup actually writes; unrelated files never enter its staging command. */@@ -619,7 +619,7 @@ export function initRepo({ info, openBoardHere, register, closeBoard, model, perif (!configuredGate(root)) {notes.push(gate? 'no gate yet: set "gate" in pullboard.json to the command that proves the build'- : 'if this board has no build, use `pullboard spec check` to check its spec and practice files; a second agent review checks the actual work');+ : 'no test command detected; ask the person which command tests this project, then set "gate" in pullboard.json to that command; if this board has no build, use `pullboard spec check` to check its spec and practice files; a second agent review checks the actual work');}if (written.length) notes.push(`git add -f -- ${written.map((path) => `'${path.replaceAll("'", "'\\''")}'`).join(' ')}`);return notes;diff --git a/test/init-gate.test.js b/test/init-gate.test.jsindex 33d995da..9b27725a 100644--- a/test/init-gate.test.js+++ b/test/init-gate.test.js@@ -122,11 +122,20 @@ test('a repo without package.json is told a gate that fits it [C7,B26]', () => {mkdirSync(root);box.git(root, 'init', '-q', '-b', 'main');mkdirSync(join(root, 'app'));+ const marker = join(box.dir, 'project-gate-ran');+ 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');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');+ assert.match(initialized.out, /ask the person which command tests this project/u);const initializedGate = JSON.parse(readFileSync(join(root, 'pullboard.json'), 'utf8')).gate;+ const pending = box.run(root, 'resume', '--json');+ assert.equal(pending.code, 0, pending.err || pending.out);+ assert.equal(JSON.parse(pending.out).setup.steps.find(step => step.number === 3).done, false,+ 'an unknown project keeps its gate choice unanswered');// Keep a legacy empty-gate board to exercise the real NO_GATE refusal after init.const config = JSON.parse(readFileSync(join(root, 'pullboard.json'), 'utf8'));@@ -162,9 +171,34 @@ test('a repo without package.json is told a gate that fits it [C7,B26]', () => {nextNamesInitCommand: /pullboard spec check/u.test(refusal.next),nextNamesUnavailableNpm: /\bnpm test\b/u.test(refusal.next),}, {- initializedGate: 'pullboard spec check',+ initializedGate: '',refusalCode: 'NO_GATE',nextNamesInitCommand: true,nextNamesUnavailableNpm: false,});++ const chosenConfig = JSON.parse(readFileSync(join(root, 'pullboard.json'), 'utf8'));+ chosenConfig.gate = 'node app/project-check.mjs';+ writeFileSync(join(root, 'pullboard.json'), JSON.stringify(chosenConfig, null, 2));+ box.git(root, 'add', 'pullboard.json');+ box.git(root, 'commit', '-q', '-m', 'chore: choose the project test command');+ const chosen = box.run(root, 'resume', '--json');+ assert.equal(chosen.code, 0, chosen.err || chosen.out);+ assert.equal(JSON.parse(chosen.out).setup.steps.find(step => step.number === 3).done, true,+ 'the person choosing an actual project command completes the gate step');+ assert.equal(existsSync(marker), false, 'choosing a gate does not run it');+ const released = box.run(worktree, 'release', id, '--json');+ assert.equal(released.code, 0, released.err || released.out);+ const configuredWorktree = join(box.dir, 'configured-app-agent');+ box.git(root, 'worktree', 'add', '-q', '-b', 'app/chosen', configuredWorktree, 'main');+ const configuredJoin = box.run(configuredWorktree, 'join', 'app');+ assert.equal(configuredJoin.code, 0, configuredJoin.err || configuredJoin.out);+ const configuredClaim = box.run(configuredWorktree, 'claim', id, '--json');+ assert.equal(configuredClaim.code, 0, configuredClaim.err || configuredClaim.out);+ writeFileSync(join(configuredWorktree, 'app', 'result.txt'), 'done\n');+ box.git(configuredWorktree, 'add', 'app/result.txt');+ box.git(configuredWorktree, 'commit', '-q', '-m', 'chore: finish with the chosen project test');+ const completed = box.run(configuredWorktree, 'submit', id, '--json');+ assert.equal(completed.code, 0, completed.err || completed.out);+ assert.equal(readFileSync(marker, 'utf8'), 'tested\n', 'submit runs the chosen project test');});