Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: raise dead-export guard git buffer so release-sized diffs don't ENOBUFS

[._.]/ Adam Eivy0a23e329dd1e
diff --git a/server/deadExports.test.js b/server/deadExports.test.js
index 311dc3fc9c..1c8c0dbef9 100644
--- a/server/deadExports.test.js
+++ b/server/deadExports.test.js
@@ -7,6 +7,8 @@ import { describe, expect, it } from 'vitest';
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
const EXPORT = /^export (?:async )?function ([A-Za-z_$][\w$]*)\b/gm;
const WORD = /\b[A-Za-z_$][\w$]*\b/g;
+// A release promotion diffs hundreds of commits; Node's 1 MB default overflows (ENOBUFS).
+const GIT_MAX_BUFFER = 64 * 1024 * 1024;
function excluded(file, name) {
if (name.startsWith('_')) return true; // Test and integration hooks are intentionally public.
@@ -62,12 +64,12 @@ function addedExportNames() {
// the previous commit there so this guard still examines the new exports.
const hasOriginMain = spawnSync('git', ['show-ref', '--verify', '--quiet', 'refs/remotes/origin/main'], { cwd: ROOT, stdio: 'ignore' }).status === 0;
const base = process.env.CI_BASE_SHA || execFileSync('git', hasOriginMain ? ['merge-base', 'HEAD', 'origin/main'] : ['rev-parse', 'HEAD^1'], { cwd: ROOT, encoding: 'utf8' }).trim();
- const diff = execFileSync('git', ['diff', '--unified=0', base, '--', 'server/services', 'server/lib'], { cwd: ROOT, encoding: 'utf8' });
+ const diff = execFileSync('git', ['diff', '--unified=0', base, '--', 'server/services', 'server/lib'], { cwd: ROOT, encoding: 'utf8', maxBuffer: GIT_MAX_BUFFER });
return addedExportNamesFromDiff(diff);
}
function trackedFiles() {
- return execFileSync('git', ['ls-files', '-z'], { cwd: ROOT })
+ return execFileSync('git', ['ls-files', '-z'], { cwd: ROOT, maxBuffer: GIT_MAX_BUFFER })
.toString('utf8').split('\0').filter(Boolean)
.filter(file => /\.(?:[cm]?[jt]sx?|json|md)$/.test(file))
.filter(file => existsSync(join(ROOT, file)))