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(cli): version startup refusals under JSON [A1,P3,P4]
Corey Olsondc862264b701
diff --git a/bin/pullboard.js b/bin/pullboard.jsindex 00f630c5..431435d1 100755--- a/bin/pullboard.js+++ b/bin/pullboard.js@@ -8,9 +8,16 @@// with an error that names no remedy, so say what to install before anything loads (P3, P4).const [major, minor] = process.versions.node.split('.').map(Number);if (major < 22 || (major === 22 && minor < 13)) {- process.stderr.write(- `pullboard: [NODE_TOO_OLD] this is Node ${process.versions.node}, and pullboard needs Node 22.13 or newer: install it (for example nvm install 22), then run the command again\n`,- );+ const message = `this is Node ${process.versions.node}, and pullboard needs Node 22.13 or newer: install it (for example nvm install 22), then run the command again`;+ const args = process.argv.slice(2);+ const flags = args.slice(0, args.indexOf('--') < 0 ? args.length : args.indexOf('--'));+ if (flags.includes('--json')) {+ // This module is pure output formatting: it never imports the unavailable SQLite module.+ const { commandOutput } = await import('../src/json.js');+ const output = commandOutput(args, { stdout: process.stdout, stderr: process.stderr });+ output.refusal({ code: 'NODE_TOO_OLD', message });+ output.flush(1);+ } else process.stderr.write(`pullboard: [NODE_TOO_OLD] ${message}\n`);process.exit(1);}diff --git a/src/json.js b/src/json.jsindex 98dfce74..84169483 100644--- a/src/json.js+++ b/src/json.js@@ -65,7 +65,7 @@ export const JSON_SHAPES = {/** Extract a concrete repair from existing refusals, retaining their original guidance. */function nextStep(message) {- const match = /(?:; |\. |: )((?:run|fix|restore|commit|check out|set|give|use|the coordinator|to keep looking|never work around)\b[\s\S]*)/i.exec(message);+ const match = /(?:; |\. |: )((?:run|install|fix|restore|commit|check out|set|give|use|the coordinator|to keep looking|never work around)\b[\s\S]*)/i.exec(message);return match?.[1] ?? 'Run pullboard help, correct the reported problem, and retry the command.';}diff --git a/test/node-version.test.js b/test/node-version.test.jsindex ac5dd835..a75f529d 100644--- a/test/node-version.test.js+++ b/test/node-version.test.js@@ -65,3 +65,36 @@ test('the git hooks run the same command, so an older Node refuses a commit theconst current = spawnSync('git', ['commit', '-q', '-m', 'chore: set up pullboard'], { cwd: repo, env, encoding: 'utf8' });assert.equal(current.status, 0, `under this Node the same commit goes through: ${current.stderr}`);});+++test('the real entrypoint versions old-Node refusals and honors JSON flag positioning [A1, P3, P4]', () => {+ for (const version of ['18.19.0', '20.11.1', '22.12.0']) {+ for (const args of [['--help', '--json'], ['--json', '--help'], ['help', '--json']]) {+ const result = spawnSync(process.execPath, ['--import', spoof(version), BIN, ...args], { encoding: 'utf8' });+ assert.equal(result.status, 1, `${version}: ${args.join(' ')}`);+ assert.equal(result.stderr, '');+ assert.deepEqual(JSON.parse(result.stdout), {+ version: 1,+ error: {+ code: 'NODE_TOO_OLD',+ message: refusal(version).replace(/^pullboard: \[NODE_TOO_OLD\] /, '').trimEnd(),+ next: 'install it (for example nvm install 22), then run the command again',+ },+ });+ }+ const literal = spawnSync(process.execPath, ['--import', spoof(version), BIN, 'help', '--', '--json'], { encoding: 'utf8' });+ assert.equal(literal.status, 1);+ assert.equal(literal.stdout, '');+ assert.equal(literal.stderr, refusal(version), '--json after -- is a positional, preserving ordinary guidance');+ }+ for (const version of ['22.13.0', '24.0.0', '26.0.0']) {+ for (const args of [['--help', '--json'], ['--json', '--help']]) {+ const result = spawnSync(process.execPath, ['--import', spoof(version), BIN, ...args], { encoding: 'utf8' });+ assert.equal(result.status, 0, `${version}: ${result.stderr}`);+ assert.equal(result.stderr, '');+ const document = JSON.parse(result.stdout);+ assert.equal(document.version, 1);+ assert.match(document.help, /^pullboard \d+\.\d+\.\d+/);+ }+ }+});