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
test(browser): isolate classifier from inherited preload [C7]
Corey Olsonadf9c0f6cd5a
diff --git a/test/resources.test.js b/test/resources.test.jsindex c1a8ec11..b06fed55 100644--- a/test/resources.test.js+++ b/test/resources.test.js@@ -355,7 +355,9 @@ test('single-quoted named-test checks skip the browser slot [C7]', async () => {const box = fixture();const { repo } = checkProject(box);const itemCheck = 'node bin/run-tests.js --test-name-pattern "item check marker" test/cpu-check.test.js';- assert.equal(await checkNeedsBrowser(repo, itemCheck), false, 'an explicit CPU-only test file is classifiable');+ /** Keep assertions about the parser independent of worker custody inherited by the test process. */+ const classify = command => checkNeedsBrowser(repo, command, { env: { ...process.env, NODE_OPTIONS: '' } });+ assert.equal(await classify(itemCheck), false, 'an explicit CPU-only test file is classifiable');const outputPattern = '^[[:space:]]*ok [0-9]+ - item check marker';const newlinePrint = ([quote, backslashes]) => `printf ${quote}%s${'\\'.repeat(backslashes)}n${quote} "$out"`;const capturedCheck = (formats, patternQuotes) => `out=$(${itemCheck} 2>&1); ${newlinePrint(formats[0])}; ${newlinePrint(formats[1])} | grep -Eq ${patternQuotes[0]}${outputPattern}${patternQuotes[0]} && ${newlinePrint(formats[2])} | grep -Eq ${patternQuotes[1]}^# fail 0$${patternQuotes[1]}`;@@ -367,22 +369,25 @@ test('single-quoted named-test checks skip the browser slot [C7]', async () => {{ formats: oneBackslash.map(count => ['"', count]), patternQuotes: ['"', '"'] },];for (const variant of accepted) {- assert.equal(await checkNeedsBrowser(repo, capturedCheck(variant.formats, variant.patternQuotes)), false,+ assert.equal(await classify(capturedCheck(variant.formats, variant.patternQuotes)), false,`the exact capture wrapper accepts quote changes with one literal backslash: ${JSON.stringify(variant)}`);}for (let index = 0; index < 3; index += 1) {const formats = oneBackslash.map(count => ['\'', count]);formats[index] = ['\'', 2];- assert.equal(await checkNeedsBrowser(repo, capturedCheck(formats, ['\'', '\''])), true,+ assert.equal(await classify(capturedCheck(formats, ['\'', '\''])), true,`a two-backslash printf at position ${index + 1} stays browser-gated`);}- assert.equal(await checkNeedsBrowser(repo, `${capturedCheck(accepted[0].formats, accepted[0].patternQuotes)}; :`), true,+ assert.equal(await classify(`${capturedCheck(accepted[0].formats, accepted[0].patternQuotes)}; :`), true,'an arbitrary suffix remains outside the exact capture wrapper');const substituted = capturedCheck(accepted[0].formats, accepted[0].patternQuotes).replace('printf \'%s\\n\' "$out"', 'printf \'%s\\n\' "$(printf %s "$out")"');- assert.equal(await checkNeedsBrowser(repo, substituted), true, 'a command substitution remains outside the exact printf wrapper');- assert.equal(await checkNeedsBrowser(repo, 'node bin/run-tests.js test/cockpit/brief.test.js'), true,+ assert.equal(await classify(substituted), true, 'a command substitution remains outside the exact printf wrapper');+ assert.equal(await classify('node bin/run-tests.js test/cockpit/brief.test.js'), true,'known browser suites remain browser-gated');+ assert.equal(await checkNeedsBrowser(repo, itemCheck, {+ env: { ...process.env, NODE_OPTIONS: '--import=unknown-preload.mjs' },+ }), true, 'an unclassified preload keeps the check browser-gated');});test('a non-browser check does not wait for the browser slot [C7]', async () => {