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.

feat(settings): opt in to browser-free checks [O5,O6,C7]

Corey Olson6de50ee0e3f2
diff --git a/docs/api.md b/docs/api.md
index e5e7d4b1..dbafe4db 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -10,6 +10,8 @@ A successful command returns the fields listed below. `version` is always the nu
`pullboard settings` reads machine-wide settings from the OS account's `~/.pullboard/settings.json`; the gate queue database is beside it. This location does not follow `HOME` or `PULLBOARD_HOME`, so agents with private board homes still share one machine gate limit. Set `PULLBOARD_MACHINE_HOME` to an explicit directory only when a separate private machine settings and gate pool is intended; tests use this override. `pullboard settings gateSlots <n>` changes the gate queue capacity, which defaults to `2`. Capacity changes are refused while a gate is running or waiting, so existing holders and FIFO order remain intact.
+Browser-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.
+
When `add` or `edit` supplies a new nonempty check, it records the item before measuring that check in a background temporary checkout of the captured `main` commit. Use `--wait` to wait for the measurement before returning, or `args.wait: true` for an HTTP add/edit move. The item returned by `add`, `edit`, `show`, and `next --verify` may include `item_check_baseline`: `{command, main, result, request?, seconds?, reason?, warning?}`. `main` is the commit id or `null`, and `result` is `pending`, `green`, `red`, or `unavailable`. A background request carries an opaque `request` identity; an older completion cannot overwrite a newly edited or cleared check.
An item's HTTP detail, and each item in the full board state, include `check` and, when recorded, `checkBaseline` with the same observation fields. A green result carries `warning: "CRITERION_PROVES_NOTHING"`; text output names that warning when showing or reserving the item for review, and when filing it with `--wait`. An exact match with the project gate configured at that main commit records green with `reason: "repo gate"` without running it again. A missing main records unavailable with `reason: "no main"` and still files the item. Changing the check replaces this observation; clearing it removes the observation. Captured observations and completions travel through ordered board moves, so replicas store results without executing commands. A completed result awaiting relay delivery stays on the measuring device and is retried by the next normal CLI command.
diff --git a/src/cli.js b/src/cli.js
index e4974ff0..d707ebc7 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -78,7 +78,7 @@ import { flowLines, flowAlertLine } from './stats-flow.js';
import { releaseHeadlinesBetween } from './changelog.js';
import { exportBoard, importBoard } from './exchange.js';
import { addSigner, assertRequiredSigners, defaultPrincipal, hasSignerFile } from './signature.js';
-import { loadMachineSettings, setBrowserSlots, setGateSlots } from './settings.js';
+import { browserFreeChecksEnabled, loadMachineSettings, setBrowserSlots, setGateSlots } from './settings.js';
import { formatSnapshotLimit, pendingSnapshotSize, pendingCheckpointProblem, relayCommandReceipt, relayCommandReceiptReported, relayLinked, relayOff, relayOn, relayOperation, relayRecover, relayRecovered, relayRevoke, relayStatus, relayTokens, syncRelay } from './relay.js';
import { autoLinkProject, relayOnAll, revokeRelayDevice, unlinkedRelayProjects } from './relay-setup.js';
import { readRelayMachine } from './relay-machine.js';
@@ -2229,7 +2229,7 @@ async function verifyHere(ctx, id, { second, values }) {
if (digest !== item.item_frozen_digest) throw new Refused('CRITERIA_CHANGED', 'the criterion changed; ask the coordinator to refreeze this item before checking it');
const trunk = requireTrunkMerge(root, commit);
refuseUnverifiedStack(root, board, item, commit, trunk);
- const browser = await checkNeedsBrowser(root, frozenCheck(item), { commit, onFallback: browserAdmissionReporter(ctx.io, ctx.io.relayJson) });
+ const browser = !browserFreeChecksEnabled() || await checkNeedsBrowser(root, frozenCheck(item), { commit, onFallback: browserAdmissionReporter(ctx.io, ctx.io.relayJson) });
check = await withGateSlot(root, (lease) => checkAtCommit(root, item, { waitMs: lease.waitMs, gateLease: lease }), { browser, agent: me.id, item: String(id), kind: 'review', itemCheck: true, onWait: gateWaitReporter(ctx.io) });
verificationProfile = check.profile ?? null;
const evidence = check.checked
@@ -2633,7 +2633,7 @@ function workCommands(io, args) {
throw new Refused('CHECK_CONFIRM', `the check set by ${authorName} was not run: ${check}; run pullboard check ${item.item_id} --yes after reading the command, or answer yes at the prompt`);
}
}
- const browser = await checkNeedsBrowser(ctx.info.root, check, { onFallback: browserAdmissionReporter(io, values.json) });
+ const browser = !browserFreeChecksEnabled() || await checkNeedsBrowser(ctx.info.root, check, { onFallback: browserAdmissionReporter(io, values.json) });
const run = await withGateSlot(ctx.info.root, (lease) => runProfiledShell(ctx.info.root, check, { waitMs: lease.waitMs, artifactPrefix: `pullboard-check-${item.item_id}`, persistLog: true, gateLease: lease }), { browser, agent: caller, item: String(item.item_id), kind: 'check', itemCheck: true, onWait: gateWaitReporter(io) });
io.result?.({ id: item.item_id, green: run.isGreen, seconds: run.seconds, check, by, report: run.isGreen ? '' : digestOf(run.output) });
const timings = timingDigest(run.profile);
diff --git a/src/gate.js b/src/gate.js
index 06069172..f2154b49 100644
--- a/src/gate.js
+++ b/src/gate.js
@@ -13,7 +13,7 @@ import { gitChildEnv, gitPath, headTree, invalidateGitFacts, isClean, untracked
import { secretsIn } from './hooks.js';
import { Refused } from './refused.js';
import { GATE_SLOT_HELD_ENV, gateSlotEnvironment, inheritedGateSlot, takeResource } from './resources.js';
-import { loadMachineSettings } from './settings.js';
+import { browserFreeChecksEnabled, loadMachineSettings } from './settings.js';
import { selectAffectedTests } from './affected-tests.js';
import { checkNeedsBrowser, testsNeedBrowser } from './browser-admission.js';
import { timingFromOutput, timingRunner } from './timing.js';
@@ -362,8 +362,10 @@ export async function runSubmitGate(root, config, { base, trunk, changed, check,
: { full: true, reason: 'affected-test selection is not enabled for this project', files: [] };
const deferred = config.submitGate === 'landing';
const deferFullFallback = deferred && selection.full;
- const checkUsesBrowser = check ? await checkNeedsBrowser(root, check, { onFallback: onBrowserFallback }) : false;
- const browser = checkUsesBrowser || (!deferFullFallback && (selection.full || await testsNeedBrowser(root, selection.files, { onFallback: onBrowserFallback })));
+ const allowBrowserFreeChecks = browserFreeChecksEnabled();
+ const checkUsesBrowser = check ? (!allowBrowserFreeChecks || await checkNeedsBrowser(root, check, { onFallback: onBrowserFallback })) : false;
+ const proofUsesBrowser = !deferFullFallback && (selection.full || !allowBrowserFreeChecks || await testsNeedBrowser(root, selection.files, { onFallback: onBrowserFallback }));
+ const browser = checkUsesBrowser || proofUsesBrowser;
return await withGateSlot(root, (lease) => {
const startedAt = Date.now();
const log = gitPath(root, 'pullboard-submit.log');
diff --git a/src/help.js b/src/help.js
index 7d541e91..d2485849 100644
--- a/src/help.js
+++ b/src/help.js
@@ -20,6 +20,7 @@ Set up
pullboard takeover rebind this checkout when the same agent starts a new session
pullboard resources local resource holders and their FIFO queues
pullboard settings [gateSlots <n> | browserSlots <n>] view or set machine capacity (gate default 2; browser default 1)
+ browser-free check slots are opt-in: gate.browserFreeChecks in ~/.pullboard/settings.json (default false)
pullboard view [--project] [--port N] [--no-open] every project on this machine in your browser; default http://127.0.0.1:${DEFAULT_VIEW_PORT}
items, shouts, doctrine, agents and activity; --port 0 chooses a free port
--project limits this view to the registered project for this repository
diff --git a/src/settings.js b/src/settings.js
index 7dc7904d..5c3f3542 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -24,6 +24,12 @@ export function loadMachineSettings() {
if (!value || typeof value !== 'object' || Array.isArray(value)) {
throw new Refused('BAD_MACHINE_SETTINGS', `settings in ${file} must be a JSON object; fix it before running Pullboard`);
}
+ if (value.gate !== undefined && (!value.gate || typeof value.gate !== 'object' || Array.isArray(value.gate))) {
+ throw new Refused('BAD_MACHINE_SETTINGS', `gate in ${file} must be an object; fix it before running Pullboard`);
+ }
+ if (value.gate?.browserFreeChecks !== undefined && typeof value.gate.browserFreeChecks !== 'boolean') {
+ throw new Refused('BAD_MACHINE_SETTINGS', `gate.browserFreeChecks in ${file} must be true or false`);
+ }
const gateSlots = value.gateSlots ?? DEFAULT_GATE_SLOTS;
if (!Number.isSafeInteger(gateSlots) || gateSlots < 1) {
throw new Refused('BAD_GATE_SLOTS', `gateSlots in ${file} must be a positive integer; run pullboard settings gateSlots <n>`);
@@ -35,6 +41,11 @@ export function loadMachineSettings() {
return { ...value, gateSlots, browserSlots };
}
+/** Browser-free check admission is deliberately opt-in per machine. */
+export function browserFreeChecksEnabled() {
+ return loadMachineSettings().gate?.browserFreeChecks === true;
+}
+
/** Atomically replace machine settings without exposing a partial JSON file. */
function writeMachineSettings(settings) {
const file = machineSettingsFile();