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
chore(trunk): merge current main [C7]
Corey Olson7f88442f3f00
diff --cc test/test-resources.test.jsindex 50cc31a9,f00dd694..dbf004f2--- a/test/test-resources.test.js+++ b/test/test-resources.test.js@@@ -113,101 -74,16 +113,115 @@@ test('only actual CommonJS loader wordassert.equal(await testsNeedBrowser(root, ['test/browser.test.cjs']), true);});+test('frozen checks classify only explicit source-backed test commands [C7]', async t => {+ const root = sourceFixture(t, {+ 'test/plain.test.js': "import '../helper.js'; import assert from 'node:assert/strict';",+ 'helper.js': "import { writeFileSync } from 'node:fs'; writeFileSync(new URL('./executed', import.meta.url), 'bad');",+ });+ mkdirSync(join(root, 'bin'), { recursive: true });+ mkdirSync(join(root, 'test'), { recursive: true });+ cpSync(resolve(import.meta.dirname, '../src'), join(root, 'src'), { recursive: true });+ copyFileSync(TEST_RUNNER, join(root, 'bin/run-tests.js'));+ writeFileSync(join(root, 'package.json'), '{"type":"module"}\n');+ writeFileSync(join(root, 'test/resources.test.js'), "import { test } from 'node:test'; test('a non-browser check does not wait for the browser slot', () => {});\n");+ const command = 'out=$(node bin/run-tests.js --test-name-pattern "a non-browser check does not wait for the browser slot" test/resources.test.js 2>&1); printf "%s\\n" "$out"; printf "%s\\n" "$out" | grep -Eq "^[[:space:]]*ok [0-9]+ - .*a non-browser check does not wait for the browser slot" && printf "%s\\n" "$out" | grep -Eq "^# fail 0$"';+ const classifyEnv = { ...process.env, PATH: [dirname(process.execPath), '/usr/bin', '/bin'].join(delimiter) };+ assert.equal(await checkNeedsBrowser(root, command, { env: classifyEnv }), false);+ assert.equal(await checkNeedsBrowser(root, command, { env: classifyEnv }), false,+ 'the supported captured runner form remains statically classifiable');++ const runnerPath = join(root, 'bin/run-tests.js');+ rmSync(runnerPath);+ symlinkSync('/bin/echo', runnerPath);+ const symlinkFallbacks = [];+ assert.equal(await checkNeedsBrowser(root, command, { env: classifyEnv, onFallback: decision => symlinkFallbacks.push(decision) }), true,+ 'a symlinked runner outside the repository is browser-required');+ assert.equal(symlinkFallbacks[0].file, 'bin/run-tests.js');+ assert.match(symlinkFallbacks[0].reason, /regular in-repository file/u);+ rmSync(runnerPath);+ mkdirSync(runnerPath);+ assert.equal(await checkNeedsBrowser(root, command, { env: classifyEnv }), true, 'a directory runner fails closed');+ rmSync(runnerPath, { recursive: true, force: true });+ copyFileSync(TEST_RUNNER, runnerPath);+ for (const opaque of [+ 'node bin/run-tests.js test/plain.test.js; touch side-effect',+ 'node bin/run-tests.js test/*.test.js',+ 'node bin/run-tests.js test/journeys.test.js',+ 'node bin/run-tests.js test/cockpit/brief.test.js',+ 'node --test-reporter spec bin/run-tests.js test/plain.test.js',+ 'npm test',+ ]) assert.equal(await checkNeedsBrowser(root, opaque), true, opaque);++ copyFileSync(resolve(import.meta.dirname, './fixture-child.js'), join(root, 'test/fixture-child.js'));+ writeFileSync(join(root, 'test/known-fixture.test.js'), "import './fixture-child.js';\n");+ assert.equal(await testsNeedBrowser(root, ['test/known-fixture.test.js']), false,+ 'the path-reviewed shared fixture child helper remains CPU-only');+ writeFileSync(join(root, 'test/fixture-child.js'), "import { spawn } from 'node:child_process'; spawn('git', ['status']);\n");+ assert.equal(await testsNeedBrowser(root, ['test/known-fixture.test.js']), false,+ 'the reviewed path exception does not depend on a content hash');+ writeFileSync(join(root, 'test/fixture-child.js'), "import { spawn } from 'node:child_process'; spawn('google-chrome', []);\n");+ assert.equal(await testsNeedBrowser(root, ['test/known-fixture.test.js']), true,+ 'a literal Chrome launcher still overrides the path exception');++ copyFileSync(resolve(import.meta.dirname, './fixture-child.js'), join(root, 'test/fixture-child.js'));+ writeFileSync(join(root, 'test/known-fixture.test.js'), "import { runFixtureGit as git } from './fixture-child.js';\n");+ assert.equal(await testsNeedBrowser(root, ['test/known-fixture.test.js']), false,+ 'the narrowly reviewed fixed-Git helper remains CPU-only');++ for (const importer of [+ "import { runFixtureChild as child } from './fixture-child.js';\n",+ "import * as fixture from './fixture-child.js';\n",+ "import { runFixtureChild as child } from './fixture-child.js'; child(process.env.BROWSER_BIN, []);\n",+ "import * as fixture from './fixture-child.js'; fixture.runFixtureChild(process.env.BROWSER_BIN, []);\n",+ "export { runFixtureGit } from './fixture-child.js';\n",+ "const fixture = await import('./fixture-child.js');\n",+ "import fixture from './fixture-child.js';\n",+ "import './fixture-child.js';\nimport { runFixtureChild } from './fixture-child.js';\n",+ "import { runFixtureGit } from './fixture-child.js';\nimport { runFixtureChild } from './fixture-child.js';\n",+ "import { runFixtureGit } from './fixture-child.js';\nimport { runFixtureChild } from '.\\x2ffixture-child.js';\n",+ ]) {+ writeFileSync(join(root, 'test/known-fixture.test.js'), importer);+ const decisions = [];+ assert.equal(await testsNeedBrowser(root, ['test/known-fixture.test.js'], {+ onFallback: decision => decisions.push(decision),+ }), true, importer);+ assert.equal(decisions.length, 1, importer);+ assert.equal(decisions[0].file, 'test/known-fixture.test.js');+ assert.match(decisions[0].reason, /caller-selected process target/u);+ }++ writeFileSync(join(root, 'test/launcher.test.js'), "import { spawn } from 'node:child_process'; spawn('google-chrome', []);\n");+ const chromeFallbacks = [];+ assert.equal(await testsNeedBrowser(root, ['test/launcher.test.js'], { onFallback: decision => chromeFallbacks.push(decision) }), true,+ 'a test source that names a Chrome launcher remains browser-required');+ assert.deepEqual(chromeFallbacks, [], 'known Chrome launchers reserve browser capacity without uncertainty diagnostics');+ writeFileSync(join(root, 'test/computed-launch.test.js'), "import { spawn } from 'node:child_process'; spawn(process.env.BROWSER, []);\n");+ const fallbackReasons = [];+ assert.equal(await testsNeedBrowser(root, ['test/computed-launch.test.js'], { onFallback: decision => fallbackReasons.push(decision) }), true,+ 'an unknown computed child-process target remains browser-required');+ assert.equal(fallbackReasons.length, 1);+ assert.equal(fallbackReasons[0].file, 'test/computed-launch.test.js');+ assert.match(fallbackReasons[0].reason, /child_process/u);++ const commit = commitSourceFixture(root);+ assert.equal(await checkNeedsBrowser(root, command, { commit, env: classifyEnv }), false,+ 'review admission reads test and runner blobs from the immutable commit');+ writeFileSync(join(root, 'helper.js'), "import './test/chrome-fixture.js';");+ assert.equal(await testsNeedBrowser(root, ['test/plain.test.js']), true, 'live checks follow the current checkout');+ assert.equal(await checkNeedsBrowser(root, command, { commit, env: classifyEnv }), false,+ 'review checks follow the exact submitted commit rather than a later checkout edit');+});+++ test('Unicode ranges do not turn ordinary tests into browser files [C7]', async t => {+ const root = sourceFixture(t, {+ 'test/plain.test.js': "import '../config.js';",+ 'config.js': String.raw`export const controlCharacters = /[\u0000-\u001f\u007f-\u009f]/u;`,+ 'test/escaped-loader.test.js': String.raw`const load = requ\u0069re;`,+ 'test/escaped-braced-loader.test.js': String.raw`const load = requ\u{69}re;`,+ });+ assert.equal(await testsNeedBrowser(root, ['test/plain.test.js']), false,+ 'a control-character regex in a shared config helper does not reserve a browser slot');+ assert.equal(await testsNeedBrowser(root, ['test/escaped-loader.test.js']), true,+ 'an escaped loader identifier still requires conservative browser admission');+ assert.equal(await testsNeedBrowser(root, ['test/escaped-braced-loader.test.js']), true);+ });