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): output into head ends quietly [N24]
Corey Olson69c416722bb4
diff --git a/bin/pullboard.js b/bin/pullboard.jsindex 26f718e2..66ef6a3e 100755--- a/bin/pullboard.js+++ b/bin/pullboard.js@@ -9,6 +9,13 @@ process.emitWarning = (warning, ...rest) => {emitWarning.call(process, warning, ...rest);};+// A reader that stops early, like head, closes the pipe, and the rest of the output has nowhere to+// go: end quietly, as other command-line tools do, rather than print a stack trace (N24).+process.stdout.on('error', (error) => {+ if (error.code !== 'EPIPE') throw error;+ process.exit(process.exitCode ?? 0);+});+const { main } = await import('../src/cli.js');process.exitCode = await main(process.argv.slice(2), {cwd: process.cwd(),diff --git a/test/e2e.test.js b/test/e2e.test.jsindex d76456b9..b6972c22 100644--- a/test/e2e.test.js+++ b/test/e2e.test.js@@ -808,3 +808,15 @@ test('verify and escalate take a note from a file, exactly as written [V12]', ()assert.match(box.run(box.repo, 'show', '2').out, /ran `npm test` with \$HOME unset: "it failed"/);assert.match(box.run(box.repo, 'help').out, /--note-file <file>/);});++test('output into a reader that stops early ends quietly [N24]', async () => {+ const box = project();+ for (let n = 0; n < 40; n++) box.run(box.repo, 'add', 'web', `Item ${n}`, '--specs', 'G1');+ const child = spawn(process.execPath, [BIN, 'list', '--all'], { cwd: box.repo, env: box.env });+ child.stdout.destroy();+ let stderr = '';+ child.stderr.on('data', (chunk) => { stderr += chunk; });+ const code = await new Promise((done) => child.on('close', done));+ assert.equal(stderr, '');+ assert.equal(code, 0);+});