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(runner): keep clone census browser-free [C7,O5]

Corey Olsonb380e2453a1e
diff --git a/src/chrome-clone-check.js b/src/chrome-clone-check.js
index 1458ab9f..683bba82 100644
--- a/src/chrome-clone-check.js
+++ b/src/chrome-clone-check.js
@@ -1,5 +1,5 @@
/** Observe macOS Chrome clone growth without deleting or attributing directories [C7]. */
-import { execFileSync } from 'node:child_process';
+import { nativeUserDirectory } from './native-user-directory.js';
import {
lstatSync,
readdirSync,
@@ -13,7 +13,7 @@ import {
/** Locate only the current account's native Chrome clone namespaces. */
export function chromeCloneDirectories() {
if (process.platform !== 'darwin') return [];
- const user = execFileSync('/usr/bin/getconf', ['DARWIN_USER_DIR'], { encoding: 'utf8', timeout: 2_000 }).trim();
+ const user = nativeUserDirectory();
const root = join(dirname(user.replace(/\/$/u, '')), 'X');
return ['com.google.Chrome', 'org.chromium.Chromium'].map(bundle => join(root, `${bundle}.code_sign_clone`));
}
diff --git a/src/native-user-directory.js b/src/native-user-directory.js
new file mode 100644
index 00000000..b9a1b2da
--- /dev/null
+++ b/src/native-user-directory.js
@@ -0,0 +1,7 @@
+/** Read the current account's native macOS working directory without browser-specific policy [C7]. */
+import { execFileSync } from 'node:child_process';
+
+/** Keep the fixed getconf invocation separate from consumers' application-specific path names. */
+export function nativeUserDirectory() {
+ return execFileSync('/usr/bin/getconf', ['DARWIN_USER_DIR'], { encoding: 'utf8', timeout: 2_000 }).trim();
+}
diff --git a/test/test-resources.test.js b/test/test-resources.test.js
index 89834ff1..8beae523 100644
--- a/test/test-resources.test.js
+++ b/test/test-resources.test.js
@@ -367,7 +367,7 @@ function runnerFixture(t, tests) {
writeFileSync(join(root, 'package.json'), '{"type":"module"}\n');
copyFileSync(TEST_RUNNER, join(root, 'bin/run-tests.js'));
cpSync(resolve(import.meta.dirname, '../src'), join(root, 'src'), { recursive: true });
- for (const helper of ['chrome-fixture.js', 'fixture-child.js']) copyFileSync(resolve(import.meta.dirname, helper), join(root, 'test', helper));
+ for (const helper of ['chrome-fixture.js', 'chrome-launch-args.js', 'fixture-child.js']) copyFileSync(resolve(import.meta.dirname, helper), join(root, 'test', helper));
for (const [path, source] of Object.entries(tests)) writeFileSync(join(root, path), source);
const chrome = join(root, 'stand-in-browser');
writeFileSync(chrome, '#!/bin/sh\nprintf "%s\\n" "$1" >> "$PULLBOARD_FIXTURE_LAUNCHES"\n');