Skip to content

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.

fix(cli): an older node is told what to install [P3,P4]

Corey Olson32d56094fb6d
diff --git a/bin/pullboard.js b/bin/pullboard.js
index 66ef6a3e..00f630c5 100755
--- a/bin/pullboard.js
+++ b/bin/pullboard.js
@@ -3,6 +3,17 @@
* The pullboard command. Node 22 announces that node:sqlite is experimental; that notice is noise
* for a CLI, so it is dropped before the board module loads. Every other warning still prints.
*/
+
+// The board needs node:sqlite, which Node ships unflagged from 22.13. An older Node fails to load it
+// 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`,
+ );
+ process.exit(1);
+}
+
const emitWarning = process.emitWarning;
process.emitWarning = (warning, ...rest) => {
if (String(warning).includes('SQLite is an experimental feature')) return;
diff --git a/docs/proof/run-mutants.mjs b/docs/proof/run-mutants.mjs
index 8c25be8b..5606ceeb 100644
--- a/docs/proof/run-mutants.mjs
+++ b/docs/proof/run-mutants.mjs
@@ -1,8 +1,9 @@
/**
* The proof that one sentence to an agent starts the team (item #66): the run guide (N31), the
* coordinator's resume (N32) and init's word to an agent (I9). And that the first worktree starts
- * with pullboard's files, or says what to commit (item #69: I4, C4). Each change below removes one
- * of them, and its test must go red. The harness works on a temporary copy, never a real checkout.
+ * with pullboard's files, or says what to commit (item #69: I4, C4), and that an older Node is told
+ * what to install (item #73: P3, P4). Each change below removes one of them, and its test must go red.
+ * The harness works on a temporary copy, never a real checkout.
*
* Run it from the repo root: node docs/proof/run-mutants.mjs
*/
@@ -13,6 +14,7 @@ const STAGES = ['test/e2e.test.js', "the coordinator's resume names its next ste
const FIRST_WORKTREE = ['test/e2e.test.js', "a worktree starts only from a commit that holds pullboard's files"];
const NO_INIT = ['test/e2e.test.js', 'a worktree whose commit has no pullboard.json is sent to the main checkout'];
const IGNORED_OR_DELETED = ['test/e2e.test.js', 'a hook git ignores is committed by force before a worktree'];
+const OLD_NODE = ['test/node-version.test.js', 'an older Node is told what to install'];
/** Row, the change, its edits as [file, from, to], the test that judges it, and the outcome expected. */
const MUTANTS = [
@@ -37,6 +39,8 @@ const MUTANTS = [
['C4', 'a deleted config is sent to init', [['src/cli.js', " if (tryGit(info.root, ['cat-file', '-e', `HEAD:${CONFIG_FILE}`]).status === 0) {", ' if (false) {']], IGNORED_OR_DELETED, 'red'],
['C4', 'a worktree with no config is told to run init', [['src/cli.js', ' const config = configHere(info);', ' const config = loadConfig(info.root);']], NO_INIT, 'red'],
['N31', 'the guide does not say to commit before the first worktree', [['skills/pullboard-run/SKILL.md', ' A worktree starts from the last commit, so first commit what init wrote, the spec and the lanes; `pullboard worktree` refuses until they are.', '']], GUIDE, 'red'],
+ ['P3', 'an older Node runs on into a stack trace', [['bin/pullboard.js', 'if (major < 22 || (major === 22 && minor < 13)) {', 'if (false) {']], OLD_NODE, 'red'],
+ ['P3', 'Node 22.12 passes the check', [['bin/pullboard.js', 'if (major < 22 || (major === 22 && minor < 13)) {', 'if (major < 22 || (major === 22 && minor < 12)) {']], OLD_NODE, 'red'],
['I9', 'init says nothing to an agent', [['src/cli.js', " io.say('with an agent: start a new Claude Code session here, which loads the pullboard skills, then tell it what to build; the pullboard-run skill runs the team');\n", '']], STAGES, 'red'],
];
diff --git a/test/node-version.test.js b/test/node-version.test.js
new file mode 100644
index 00000000..ac5dd835
--- /dev/null
+++ b/test/node-version.test.js
@@ -0,0 +1,67 @@
+/**
+ * An older Node is told what to install (P3, P4). The board needs node:sqlite, which Node ships
+ * unflagged from 22.13. The version is spoofed by a module preloaded with --import, so these tests
+ * run on whatever Node runs the suite.
+ */
+import assert from 'node:assert/strict';
+import { execFileSync, spawnSync } from 'node:child_process';
+import { chmodSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+import { after, test } from 'node:test';
+
+const BIN = resolve(import.meta.dirname, '../bin/pullboard.js');
+const dir = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-node-')));
+after(() => rmSync(dir, { recursive: true, force: true }));
+
+/** A module that makes this process report `version` as its Node, for --import. */
+function spoof(version) {
+ const file = join(dir, `node-${version}.mjs`);
+ writeFileSync(file, `Object.defineProperty(process.versions, 'node', { value: ${JSON.stringify(version)} });\n`);
+ return file;
+}
+
+const refusal = (version) =>
+ `pullboard: [NODE_TOO_OLD] this is Node ${version}, and pullboard needs Node 22.13 or newer: install it (for example nvm install 22), then run the command again\n`;
+
+test('an older Node is told what to install, never a stack trace; 22.13 and newer run as before [P3, P4]', () => {
+ for (const version of ['18.19.0', '20.11.1', '22.12.0']) {
+ const result = spawnSync(process.execPath, ['--import', spoof(version), BIN, '--help'], { encoding: 'utf8' });
+ assert.equal(result.status, 1, `${version} exits 1`);
+ assert.equal(result.stderr, refusal(version), `${version} names what to install`);
+ assert.equal(result.stdout, '', `${version} prints nothing else`);
+ }
+ for (const version of ['22.13.0', '24.0.0']) {
+ const result = spawnSync(process.execPath, ['--import', spoof(version), BIN, '--help'], { encoding: 'utf8' });
+ assert.equal(result.status, 0, `${version} runs: ${result.stderr}`);
+ assert.match(result.stdout, /^pullboard \d+\.\d+\.\d+/, `${version} prints the help`);
+ }
+});
+
+test('the git hooks run the same command, so an older Node refuses a commit the same way [P3, P4]', () => {
+ const shims = join(dir, 'bin');
+ mkdirSync(shims, { recursive: true });
+ writeFileSync(join(shims, 'pullboard'), `#!/bin/sh\nexec "${process.execPath}" "${BIN}" "$@"\n`);
+ chmodSync(join(shims, 'pullboard'), 0o755);
+ const env = {
+ ...process.env,
+ PATH: `${shims}:${process.env.PATH}`,
+ GIT_CONFIG_GLOBAL: '/dev/null',
+ GIT_CONFIG_NOSYSTEM: '1',
+ GIT_AUTHOR_NAME: 'Test Agent',
+ GIT_AUTHOR_EMAIL: '[email protected]',
+ GIT_COMMITTER_NAME: 'Test Agent',
+ GIT_COMMITTER_EMAIL: '[email protected]',
+ PULLBOARD_HOME: join(dir, 'home'),
+ };
+ const repo = join(dir, 'repo');
+ mkdirSync(repo);
+ execFileSync('git', ['init', '-q', '-b', 'main'], { cwd: repo, env });
+ execFileSync('pullboard', ['init'], { cwd: repo, env, stdio: 'pipe' });
+ execFileSync('git', ['add', '-A'], { cwd: repo, env });
+ const old = spawnSync('git', ['commit', '-q', '-m', 'chore: set up pullboard'], { cwd: repo, env: { ...env, NODE_OPTIONS: `--import ${spoof('20.11.1')}` }, encoding: 'utf8' });
+ assert.notEqual(old.status, 0, 'the commit is refused');
+ assert.ok(old.stderr.includes(refusal('20.11.1')), `the hook says what to install: ${old.stderr}`);
+ const 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}`);
+});