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
docs(gate): the browser guard claims only helper launches [C7,O5]
Corey Olsonae1ced9b8e65
diff --git a/docs/api.md b/docs/api.mdindex 0f806f1e..4e1409d0 100644--- a/docs/api.md+++ b/docs/api.md@@ -12,7 +12,7 @@ A successful command returns the fields listed below. `version` is always the nuBrowser-free check admission is opt-in per machine with `"gate": { "browserFreeChecks": true }` in `~/.pullboard/settings.json`; it defaults to `false`. When enabled, the reviewed test classifier can let checks use a CPU-only gate slot. An absent or false setting keeps every check browser-gated, and uncertain or unsupported test commands remain browser-gated even when enabled. The same setting controls the wider frozen-check classification introduced in 0.8.26.-Classifying test files by launch is opt-in per machine with `"gate": { "browserByLaunch": true }` in `~/.pullboard/settings.json`; it defaults to `false`. When enabled, the test runner gives a test file a browser slot only when its import graph reaches a real Chrome launch: an import of `startChrome`, `launchChromeProcess`, `findChromeExecutable` (or any binding other than the DevTools-only helpers) from `test/chrome-fixture.js`, directly or through a helper, or a process starter beside a Chrome executable reference. Cockpit test files keep the browser slot. Every other file runs without one. In such a file, and in every Node child it starts (the runner adds the guard to `NODE_OPTIONS`), a `node:child_process` call that would start a browser (Chrome's install paths, `PULLBOARD_CHROME`'s value, a browser executable name, or one of those inside a shell command string) fails at once with `BROWSER_SLOT_REQUIRED` naming the file, before the browser starts; `test/chrome-fixture.js` checks again at its launch point. A launch that bypasses the repository's launch helpers (a child that strips its inherited environment, a non-Node child, or a shell running a script file) is out of scope and is not caught, so new tests must launch Chrome through `test/chrome-fixture.js` or the view fixture. An absent or false setting classifies exactly as before, and the launch guard is inert.+Classifying test files by launch is opt-in per machine with `"gate": { "browserByLaunch": true }` in `~/.pullboard/settings.json`; it defaults to `false`. When enabled, the test runner gives a test file a browser slot only when its import graph reaches a real Chrome launch: an import of `startChrome`, `launchChromeProcess`, `findChromeExecutable` (or any binding other than the DevTools-only helpers) from `test/chrome-fixture.js`, directly or through a helper, or a process starter beside a Chrome executable reference. Cockpit test files keep the browser slot. Every other file runs without one. In such a file, and in Node children that inherit the guard (the runner adds it to `NODE_OPTIONS`), a `node:child_process` call that would start a browser (Chrome's install paths, `PULLBOARD_CHROME`'s value, a browser executable name, or one of those inside a shell command string) fails at once with `BROWSER_SLOT_REQUIRED` naming the file, before the browser starts; `test/chrome-fixture.js` checks again at its launch point. A launch that bypasses the repository's launch helpers (a child that strips its inherited environment, a non-Node child, or a shell running a script file) is out of scope and is not caught, so new tests must launch Chrome through `test/chrome-fixture.js` or the view fixture. An absent or false setting classifies exactly as before, and the launch guard is inert.The machine gate pool admits landings first and then everything else in arrival order. A machine opts in to reviews first with `"gate": { "queue": { "reviewsFirst": true } }` in `~/.pullboard/settings.json`: the pool then admits landing runs, then reviews, then submits and item checks, then focused and other runs, first come first served within each class. `gate.queue.agingMinutes` (a positive whole number, default `30`) is how long a waiting run waits before it moves up one class, so no class starves; it is used only while `reviewsFirst` is true. `pullboard settings` prints both values, and `pullboard resources` names the order in effect.diff --git a/src/browser-slot-guard.js b/src/browser-slot-guard.jsindex e28bd613..b5cde9a4 100644--- a/src/browser-slot-guard.js+++ b/src/browser-slot-guard.js@@ -1,9 +1,12 @@/*** The runtime half of gate.browserByLaunch [C7]: a test file the runner admitted without a browser slot- * (PULLBOARD_TEST_BROWSER_SLOT=none) cannot start a browser, whatever path it takes to one.+ * (PULLBOARD_TEST_BROWSER_SLOT=none) fails by name when it launches Chrome through the repository's+ * launch helper (test/chrome-fixture.js), which checks the slot itself; cockpit files always hold one.*- * The runner imports this module in each browser-free test file's process before the test body, and- * puts it in NODE_OPTIONS so every Node child the file starts installs it too. Installed, it wraps+ * This module is a best-effort second guard for direct launches. The runner imports it in each+ * browser-free test file's process before the test body, and puts it in NODE_OPTIONS so Node children+ * that inherit that environment install it too. A child that strips its environment, a non-Node child,+ * or a shell running a script file is out of scope and not caught (docs/api.md). Installed, it wraps* node:child_process's spawn, spawnSync, exec, execSync, execFile, execFileSync and fork: a call whose* executable is a browser (Chrome's known install paths, PULLBOARD_CHROME's value, or a browser basename,* directly, through PATH or inside a shell command string) throws BROWSER_SLOT_REQUIRED naming the file,diff --git a/test/chrome-fixture.js b/test/chrome-fixture.jsindex 62d2a585..46a2eb9b 100644--- a/test/chrome-fixture.js+++ b/test/chrome-fixture.js@@ -142,7 +142,7 @@ async function stopProcessGroup(child, stopped, timeoutMs = CLEANUP_TIMEOUT_MS)* Refuse a Chrome launch from a test file the runner admitted without a browser slot [C7].* With gate.browserByLaunch on, the runner marks each file's worker held or none; a launch under none* means the classifier missed a launch path, so the file fails here by name before Chrome starts.- * This is the second layer: src/browser-slot-guard.js refuses any browser spawn under none as well.+ * src/browser-slot-guard.js also refuses direct browser spawns it can see under none, best effort.* Without a marker this is inert.*/export function requireBrowserSlot() {