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(browser): retain bare Chrome executable detection [C7,O5]

Corey Olson77bb88499bd6
diff --git a/src/browser-launch-source.js b/src/browser-launch-source.js
index 15c2c9f1..65b7a11a 100644
--- a/src/browser-launch-source.js
+++ b/src/browser-launch-source.js
@@ -4,7 +4,7 @@ import { lex } from './js-lex.js';
const PROCESS_CALLS = new Set(['spawn', 'spawnSync', 'exec', 'execSync', 'execFile', 'execFileSync', 'fork',
'runFixtureChild', 'runFixtureChildAsync', 'startFixtureChild', 'Worker', 'SharedWorker',
'runInContext', 'runInNewContext', 'runInThisContext', 'compileFunction', 'SourceTextModule', 'Script']);
-const CHROME = /PULLBOARD_CHROME|google-chrome|Google Chrome|chromium|puppeteer|playwright/iu;
+const CHROME = /PULLBOARD_CHROME|google-chrome|Google Chrome|\bchrome\b|chromium|puppeteer|playwright/iu;
const WORD = /[$A-Z_a-z][$\w]*/gu;
/** Decode only character escapes for a conservative executable-name comparison; never evaluate source. */
diff --git a/test/test-resources.test.js b/test/test-resources.test.js
index 2a15e461..fd0a8209 100644
--- a/test/test-resources.test.js
+++ b/test/test-resources.test.js
@@ -478,6 +478,7 @@ test('generated Chrome programs stay launch-free while executable launcher argum
'test/comment-program.test.js': "import { spawnSync } from 'node:child_process';\n"
+ '// ' + generated + "\nspawnSync('git', ['status']);",
'test/direct-call.test.js': "import { spawnSync } from 'node:child_process';\nspawnSync('google-chrome', ['--version']);",
+ 'test/bare-call.test.js': "import { spawnSync } from 'node:child_process';\nspawnSync('chrome', ['--version']);",
'test/alias-call.test.js': "import { spawnSync as start } from 'node:child_process';\nstart('google-chrome', ['--version']);",
'test/shell-call.test.js': "import { execSync } from 'node:child_process';\nexecSync('google-chrome --version');",
'test/variable-call.test.js': "import { spawnSync } from 'node:child_process';\nconst executable = '/opt/browser/google-chrome';\nspawnSync(executable, []);",
@@ -491,7 +492,7 @@ test('generated Chrome programs stay launch-free while executable launcher argum
assert.equal(await testsNeedBrowser(root, [file], { byLaunch: true }), false, `${name}: generated source is not a browser launch in this module`);
assert.equal(await testsNeedBrowser(root, [file], { byLaunch: false }), true, `${name}: the default classification remains conservative`);
}
- for (const name of ['direct-call', 'alias-call', 'shell-call', 'variable-call', 'environment-call', 'interpolation-call', 'worker-call', 'computed-loader']) {
+ for (const name of ['direct-call', 'bare-call', 'alias-call', 'shell-call', 'variable-call', 'environment-call', 'interpolation-call', 'worker-call', 'computed-loader']) {
assert.equal(await testsNeedBrowser(root, [`test/${name}.test.js`], { byLaunch: true }), true, `${name}: executable or uncertain Chrome launch remains browser-bound`);
}
});