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
feat: remove registered runners [C7]
Corey Olson21988f9a74ef
diff --git a/docs/api.md b/docs/api.mdindex b9c2602e..60aed5fa 100644--- a/docs/api.md+++ b/docs/api.md@@ -566,7 +566,7 @@ A `pullboard serve` key grants access to a board; it does not identify the persoThe view's own page retains its person channel. The standalone API refuses `POST /api/v1/boards/:board/requests` with `B26_PERSON_CHANNEL`; the view continues to record the person's coordinator request. Residual: an agent that starts `pullboard view` itself also holds that view's link; this change does not isolate that link from the agent. Signed person moves (#408) address that separate boundary.-`runner add` registers machine-local SSH capacity. Optional `--node` and `--root` select absolute remote paths when Node is outside the SSH login path or runner storage needs a specific location. The default storage root is `~/.pullboard-runner`; runner work shares the remote machine resource pool.+`runner add` registers machine-local SSH capacity. Optional `--node` and `--root` select absolute remote paths when Node is outside the SSH login path or runner storage needs a specific location. `runner remove <ssh-host>` removes exactly that registered runner while preserving other machine settings; it refuses an unknown host and lists the registered hosts as the next step. If that runner has active slots, removal is refused until they finish. The default storage root is `~/.pullboard-runner`; runner work shares the remote machine resource pool.Runner storage keeps one repository object cache and creates an isolated checkout with complete history per run. A locked inventory handshake transfers only missing committed objects after scanning their blobs, paths and commit metadata, including ancestors. Historical protected paths are checked before connecting. A credential-free HTTPS origin may seed the cache at a locally known published ancestor; caller credentials are never forwarded. Cached object contents are not rescanned on every run.diff --git a/src/commands/runner.js b/src/commands/runner.jsindex 0b5dea89..c062bb38 100644--- a/src/commands/runner.js+++ b/src/commands/runner.js@@ -4,10 +4,20 @@ import {} from '../refused.js';import {addRunner,+ removeRunner,} from '../settings.js';-/** Register machine-level SSH capacity without requiring a board identity or a runner account. */+/** Add or remove machine-level SSH capacity without requiring a board identity or runner account. */export function runnerCommand(io, { first, second, rest, values }) {+ if (first === 'remove') {+ if (!second || second.trim() !== second || rest.length || Object.keys(values).some(key => key !== 'json')) {+ throw new Refused('USAGE', 'pullboard runner remove <ssh-host>');+ }+ const runner = removeRunner(second);+ io.result?.({ runner });+ io.say(`removed runner ${runner.host}`);+ return 0;+ }if (first !== 'add' || !second || rest.length || !/^[1-9]\d*$/u.test(values.slots ?? '')|| !/^(?:0|[1-9]\d*)$/u.test(values.browser ?? '')) {throw new Refused('USAGE', 'pullboard runner add <ssh-host> --slots <positive integer> --browser <integer from zero through slots>');diff --git a/src/settings.js b/src/settings.jsindex c2854c1c..3e54be72 100644--- a/src/settings.js+++ b/src/settings.js@@ -199,3 +199,20 @@ export function addRunner(value) {return runner;});}++/** Remove one registered runner while serialized against its active remote leases. */+export function removeRunner(host) {+ return updateRunnerSettings(host, () => {+ const current = readMachineSettingsFile(machineSettingsFile()) ?? {};+ const runners = loadMachineSettings().runners ?? [];+ const index = runners.findIndex(runner => runner.host === host);+ if (index < 0) {+ const registered = runners.map(runner => runner.host);+ throw new Refused('RUNNER_NOT_REGISTERED', `runner ${host} is not registered`,+ registered.length ? `registered runners: ${registered.join(', ')}` : 'run pullboard runner add <ssh-host> --slots <n> --browser <n> first');+ }+ const [runner] = runners.splice(index, 1);+ writeMachineSettings({ ...current, runners });+ return runner;+ });+}diff --git a/test/runner-probe-fixture.js b/test/runner-probe-fixture.jsnew file mode 100644index 00000000..80c87410--- /dev/null+++ b/test/runner-probe-fixture.js@@ -0,0 +1,110 @@+import { join } from 'node:path';+import { writeFileSync } from 'node:fs';+/** Build one committed probe that observes the actual checkout and remote process environment. */+export function writeProbe(repo, { remoteStateRoot, remoteMachineHome, sourceHome, sourceMachineHome, callerPool, callerToken,+ historyBaseCommit, annotatedTagObject, lightweightTagObject }) {+ const probe = `import assert from 'node:assert/strict';+import { execFileSync } from 'node:child_process';+import { existsSync, readFileSync } from 'node:fs';+import { isAbsolute, join, relative, sep } from 'node:path';+import { DatabaseSync } from 'node:sqlite';+import { test } from 'node:test';+test('runner executed the committed source in its private checkout', () => {+ assert.equal(readFileSync('empty.bin').length, 0, 'an empty blob preserves the next object boundary');+ assert.deepEqual(readFileSync('binary.bin'), Buffer.from([0, 10, 255, 13, 0, 128]), 'binary framing preserves exact bytes');+ const commit = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim();+ const tree = execFileSync('git', ['rev-parse', 'HEAD^{tree}'], { encoding: 'utf8' }).trim();+ const shallow = execFileSync('git', ['rev-parse', '--is-shallow-repository'], { encoding: 'utf8' }).trim();+ const count = execFileSync('git', ['rev-list', '--count', 'HEAD'], { encoding: 'utf8' }).trim();+ const history = execFileSync('git', ['log', '--follow', '--format=%H', '--', 'history-renamed.txt'], { encoding: 'utf8' }).trim().split(/\\r?\\n/u);+ const runnerHome = process.env.HOME;+ const privateHomeRelative = relative(${JSON.stringify(remoteStateRoot)}, runnerHome);+ assert.ok(privateHomeRelative && !privateHomeRelative.startsWith('..' + sep) && privateHomeRelative !== '..', runnerHome);+ const checkoutRelative = relative(${JSON.stringify(remoteStateRoot)}, process.cwd());+ assert.equal(checkoutRelative.split(sep)[0], 'jobs', checkoutRelative);+ assert.notEqual(process.cwd(), ${JSON.stringify(sourceHome)});+ assert.ok(checkoutRelative && !checkoutRelative.startsWith('..' + sep) && checkoutRelative !== '..', process.cwd());+ assert.ok(isAbsolute(process.env.HOME));+ assert.equal(relative(process.cwd(), runnerHome), join('..', 'home'));+ assert.equal(process.env.PULLBOARD_MACHINE_HOME, ${JSON.stringify(remoteMachineHome)});+ assert.equal(shallow, 'false', 'the worker receives full selected-candidate history');+ assert.equal(count, '3', 'the full selected candidate has the fixture base, rename, and probe commits');+ assert.ok(history.includes(${JSON.stringify(historyBaseCommit)}), 'the rename retains its original committed file in history');+ assert.equal(execFileSync('git', ['rev-parse', 'refs/tags/runner-release'], { encoding: 'utf8' }).trim(),+ ${JSON.stringify(annotatedTagObject)}, 'the annotated tag ref keeps its original object identity');+ assert.equal(execFileSync('git', ['rev-parse', 'refs/tags/runner-lightweight'], { encoding: 'utf8' }).trim(),+ ${JSON.stringify(lightweightTagObject)}, 'the lightweight tag ref points to its original commit');+ const annotation = execFileSync('git', ['cat-file', '-p', 'refs/tags/runner-release'], { encoding: 'utf8' });+ assert.match(annotation, /runner release annotation witness/u);+ const annotatedArchive = execFileSync('git', ['archive', '--format=tar', 'refs/tags/runner-release', 'history-original.txt']);+ const lightweightArchive = execFileSync('git', ['archive', '--format=tar', 'refs/tags/runner-lightweight', 'history-original.txt']);+ assert.ok(annotatedArchive.length > 512 && annotatedArchive.includes(Buffer.from('history-original.txt')),+ 'the annotated archive can read the tagged historical file');+ assert.ok(lightweightArchive.length > 512 && lightweightArchive.includes(Buffer.from('history-original.txt')),+ 'the lightweight archive can read the tagged historical file');+ assert.deepEqual(execFileSync('git', ['tag', '--list', 'runner-unrelated'], { encoding: 'utf8' }).trim(), '',+ 'a tag outside candidate ancestry is not copied');+ assert.equal(execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8' }).trim(), '');+ assert.equal(existsSync('.env'), false, 'ignored, untracked caller files are not transferred');+ assert.equal(process.env.PULLBOARD_RUNNER_FIXTURE_SECRET, undefined);+ assert.equal(process.env.PULLBOARD_GATE_SLOT_HELD, '1');+ assert.ok(process.env.PULLBOARD_GATE_SLOT_POOL.endsWith('/resources.sqlite'));+ assert.notEqual(process.env.PULLBOARD_GATE_SLOT_POOL, ${JSON.stringify(callerPool)});+ assert.ok(process.env.PULLBOARD_GATE_SLOT_TOKEN);+ assert.notEqual(process.env.PULLBOARD_GATE_SLOT_TOKEN, ${JSON.stringify(callerToken)});+ assert.equal(process.env.PULLBOARD_BROWSER_SLOT_HELD, '1');+ const db = new DatabaseSync(process.env.PULLBOARD_GATE_SLOT_POOL, { readOnly: true });+ try {+ const holder = db.prepare('SELECT pid, browser, kind FROM holder WHERE token = ?').get(process.env.PULLBOARD_GATE_SLOT_TOKEN);+ assert.ok(holder, 'the child inherited a live remote parent lease');+ assert.notEqual(holder.pid, process.pid);+ assert.equal(holder.browser, 1);+ assert.equal(holder.kind, 'check');+ } finally { db.close(); }+ assert.equal(process.env.SSH_AUTH_SOCK, undefined);+ assert.notEqual(process.env.PULLBOARD_HOME, ${JSON.stringify(sourceHome)});+ assert.notEqual(process.env.PULLBOARD_MACHINE_HOME, ${JSON.stringify(sourceMachineHome)});+ console.log('RUNNER_FACT ' + JSON.stringify({ commit, tree, cwd: process.cwd(), home: process.env.HOME,+ runnerHome, stateRoot: ${JSON.stringify(remoteStateRoot)}, machineHome: process.env.PULLBOARD_MACHINE_HOME, gatePool: process.env.PULLBOARD_GATE_SLOT_POOL,+ gateToken: process.env.PULLBOARD_GATE_SLOT_TOKEN, browser: process.env.PULLBOARD_BROWSER_SLOT_HELD,+ landing: process.env.PULLBOARD_LANDING_RUN }));+});+`;+ writeFileSync(join(repo, 'runner-probe.test.js'), probe);+}++/** Build a committed probe for the cache copy of one local workspace dependency. */+export function writeCacheProbe(repo, { remoteStateRoot, nodePath, historyBaseCommit }) {+ const probe = `import assert from 'node:assert/strict';+import { execFileSync } from 'node:child_process';+import { readFileSync, readlinkSync, realpathSync } from 'node:fs';+import { isAbsolute, join, relative, sep } from 'node:path';+import { test } from 'node:test';+test('a cached workspace link resolves inside this fresh runner checkout', () => {+ const root = process.cwd();+ const stateRelative = relative(${JSON.stringify(remoteStateRoot)}, root);+ assert.ok(stateRelative && !stateRelative.startsWith('..' + sep) && stateRelative !== '..');+ assert.equal(process.execPath, ${JSON.stringify(nodePath)}, 'the configured runner Node executes the command');+ const commit = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim();+ const tree = execFileSync('git', ['rev-parse', 'HEAD^{tree}'], { encoding: 'utf8' }).trim();+ const generated = JSON.parse(readFileSync(join(root, 'generated/config.json'), 'utf8'));+ assert.equal(generated.root, root, 'root prepare ran in this fresh checkout and generated a job-local file');+ const shallow = execFileSync('git', ['rev-parse', '--is-shallow-repository'], { encoding: 'utf8' }).trim();+ const count = execFileSync('git', ['rev-list', '--count', 'HEAD'], { encoding: 'utf8' }).trim();+ const history = execFileSync('git', ['log', '--follow', '--format=%H', '--', 'history-renamed.txt'], { encoding: 'utf8' }).trim().split(/\\r?\\n/u);+ assert.equal(shallow, 'false', 'the cache contains full candidate history');+ assert.equal(count, '3', 'the cache preserves the complete selected history');+ assert.ok(history.includes(${JSON.stringify(historyBaseCommit)}), 'cached history follows the original filename through the rename');+ const committed = execFileSync('git', ['show', 'HEAD:packages/runner-fixture-dep/witness.txt'], { encoding: 'utf8' });+ assert.equal(readFileSync('node_modules/.runner-cache-witness', 'utf8'), committed);+ const link = readlinkSync('node_modules/runner-fixture-dep');+ assert.equal(isAbsolute(link), false, 'the cached workspace symlink stays relative');+ const target = realpathSync(join(root, 'node_modules/runner-fixture-dep'));+ assert.equal(target, join(root, 'packages/runner-fixture-dep'));+ const targetRelative = relative(root, target);+ assert.ok(targetRelative && !targetRelative.startsWith('..' + sep) && targetRelative !== '..');+ console.log('RUNNER_CACHE_FACT ' + JSON.stringify({ root, link, target, commit, tree, shallow, count, history, generatedRoot: generated.root }));+});+`;+ writeFileSync(join(repo, 'runner-cache-probe.test.js'), probe);+}diff --git a/test/runners.test.js b/test/runners.test.jsindex 5f6f5e6e..d09eb06d 100644--- a/test/runners.test.js+++ b/test/runners.test.js@@ -21,6 +21,7 @@ import { refuseSandboxBlocked } from '../src/gate.js';import { SECRET, HOST, shellQuote, installSshStandIn } from './runner-ssh-fixture.js';import { sourceSetupFailureFixture } from './runner-source-setup-fixture.js';import { runnerSourceRefusalCases } from './runner-source-refusal-fixture.js';+import { writeCacheProbe, writeProbe } from './runner-probe-fixture.js';/** Per-phase deadlines for one runner round trip; together they stay near the 60-second hang ceiling. */const ROUND_TRIP_DEADLINES = { dispatch: 20_000, 'remote run': 30_000, 'result return': 10_000 }; // budget: a stuck runner fails by name in about a minute, far under the 660-second per-test limit.@@ -88,114 +89,6 @@ function cli(repo, env, ...args) {return runFixtureChild(process.execPath, [BIN, ...args], { cwd: repo, env, encoding: 'utf8' });}-/** Build one committed probe that observes the actual checkout and remote process environment. */-function writeProbe(repo, { remoteStateRoot, remoteMachineHome, sourceHome, sourceMachineHome, callerPool, callerToken,- historyBaseCommit, annotatedTagObject, lightweightTagObject }) {- const probe = `import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { existsSync, readFileSync } from 'node:fs';-import { isAbsolute, join, relative, sep } from 'node:path';-import { DatabaseSync } from 'node:sqlite';-import { test } from 'node:test';-test('runner executed the committed source in its private checkout', () => {- assert.equal(readFileSync('empty.bin').length, 0, 'an empty blob preserves the next object boundary');- assert.deepEqual(readFileSync('binary.bin'), Buffer.from([0, 10, 255, 13, 0, 128]), 'binary framing preserves exact bytes');- const commit = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim();- const tree = execFileSync('git', ['rev-parse', 'HEAD^{tree}'], { encoding: 'utf8' }).trim();- const shallow = execFileSync('git', ['rev-parse', '--is-shallow-repository'], { encoding: 'utf8' }).trim();- const count = execFileSync('git', ['rev-list', '--count', 'HEAD'], { encoding: 'utf8' }).trim();- const history = execFileSync('git', ['log', '--follow', '--format=%H', '--', 'history-renamed.txt'], { encoding: 'utf8' }).trim().split(/\\r?\\n/u);- const runnerHome = process.env.HOME;- const privateHomeRelative = relative(${JSON.stringify(remoteStateRoot)}, runnerHome);- assert.ok(privateHomeRelative && !privateHomeRelative.startsWith('..' + sep) && privateHomeRelative !== '..', runnerHome);- const checkoutRelative = relative(${JSON.stringify(remoteStateRoot)}, process.cwd());- assert.equal(checkoutRelative.split(sep)[0], 'jobs', checkoutRelative);- assert.notEqual(process.cwd(), ${JSON.stringify(sourceHome)});- assert.ok(checkoutRelative && !checkoutRelative.startsWith('..' + sep) && checkoutRelative !== '..', process.cwd());- assert.ok(isAbsolute(process.env.HOME));- assert.equal(relative(process.cwd(), runnerHome), join('..', 'home'));- assert.equal(process.env.PULLBOARD_MACHINE_HOME, ${JSON.stringify(remoteMachineHome)});- assert.equal(shallow, 'false', 'the worker receives full selected-candidate history');- assert.equal(count, '3', 'the full selected candidate has the fixture base, rename, and probe commits');- assert.ok(history.includes(${JSON.stringify(historyBaseCommit)}), 'the rename retains its original committed file in history');- assert.equal(execFileSync('git', ['rev-parse', 'refs/tags/runner-release'], { encoding: 'utf8' }).trim(),- ${JSON.stringify(annotatedTagObject)}, 'the annotated tag ref keeps its original object identity');- assert.equal(execFileSync('git', ['rev-parse', 'refs/tags/runner-lightweight'], { encoding: 'utf8' }).trim(),- ${JSON.stringify(lightweightTagObject)}, 'the lightweight tag ref points to its original commit');- const annotation = execFileSync('git', ['cat-file', '-p', 'refs/tags/runner-release'], { encoding: 'utf8' });- assert.match(annotation, /runner release annotation witness/u);- const annotatedArchive = execFileSync('git', ['archive', '--format=tar', 'refs/tags/runner-release', 'history-original.txt']);- const lightweightArchive = execFileSync('git', ['archive', '--format=tar', 'refs/tags/runner-lightweight', 'history-original.txt']);- assert.ok(annotatedArchive.length > 512 && annotatedArchive.includes(Buffer.from('history-original.txt')),- 'the annotated archive can read the tagged historical file');- assert.ok(lightweightArchive.length > 512 && lightweightArchive.includes(Buffer.from('history-original.txt')),- 'the lightweight archive can read the tagged historical file');- assert.deepEqual(execFileSync('git', ['tag', '--list', 'runner-unrelated'], { encoding: 'utf8' }).trim(), '',- 'a tag outside candidate ancestry is not copied');- assert.equal(execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8' }).trim(), '');- assert.equal(existsSync('.env'), false, 'ignored, untracked caller files are not transferred');- assert.equal(process.env.PULLBOARD_RUNNER_FIXTURE_SECRET, undefined);- assert.equal(process.env.PULLBOARD_GATE_SLOT_HELD, '1');- assert.ok(process.env.PULLBOARD_GATE_SLOT_POOL.endsWith('/resources.sqlite'));- assert.notEqual(process.env.PULLBOARD_GATE_SLOT_POOL, ${JSON.stringify(callerPool)});- assert.ok(process.env.PULLBOARD_GATE_SLOT_TOKEN);- assert.notEqual(process.env.PULLBOARD_GATE_SLOT_TOKEN, ${JSON.stringify(callerToken)});- assert.equal(process.env.PULLBOARD_BROWSER_SLOT_HELD, '1');- const db = new DatabaseSync(process.env.PULLBOARD_GATE_SLOT_POOL, { readOnly: true });- try {- const holder = db.prepare('SELECT pid, browser, kind FROM holder WHERE token = ?').get(process.env.PULLBOARD_GATE_SLOT_TOKEN);- assert.ok(holder, 'the child inherited a live remote parent lease');- assert.notEqual(holder.pid, process.pid);- assert.equal(holder.browser, 1);- assert.equal(holder.kind, 'check');- } finally { db.close(); }- assert.equal(process.env.SSH_AUTH_SOCK, undefined);- assert.notEqual(process.env.PULLBOARD_HOME, ${JSON.stringify(sourceHome)});- assert.notEqual(process.env.PULLBOARD_MACHINE_HOME, ${JSON.stringify(sourceMachineHome)});- console.log('RUNNER_FACT ' + JSON.stringify({ commit, tree, cwd: process.cwd(), home: process.env.HOME,- runnerHome, stateRoot: ${JSON.stringify(remoteStateRoot)}, machineHome: process.env.PULLBOARD_MACHINE_HOME, gatePool: process.env.PULLBOARD_GATE_SLOT_POOL,- gateToken: process.env.PULLBOARD_GATE_SLOT_TOKEN, browser: process.env.PULLBOARD_BROWSER_SLOT_HELD,- landing: process.env.PULLBOARD_LANDING_RUN }));-});-`;- writeFileSync(join(repo, 'runner-probe.test.js'), probe);-}--/** Build a committed probe for the cache copy of one local workspace dependency. */-function writeCacheProbe(repo, { remoteStateRoot, nodePath, historyBaseCommit }) {- const probe = `import assert from 'node:assert/strict';-import { execFileSync } from 'node:child_process';-import { readFileSync, readlinkSync, realpathSync } from 'node:fs';-import { isAbsolute, join, relative, sep } from 'node:path';-import { test } from 'node:test';-test('a cached workspace link resolves inside this fresh runner checkout', () => {- const root = process.cwd();- const stateRelative = relative(${JSON.stringify(remoteStateRoot)}, root);- assert.ok(stateRelative && !stateRelative.startsWith('..' + sep) && stateRelative !== '..');- assert.equal(process.execPath, ${JSON.stringify(nodePath)}, 'the configured runner Node executes the command');- const commit = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim();- const tree = execFileSync('git', ['rev-parse', 'HEAD^{tree}'], { encoding: 'utf8' }).trim();- const generated = JSON.parse(readFileSync(join(root, 'generated/config.json'), 'utf8'));- assert.equal(generated.root, root, 'root prepare ran in this fresh checkout and generated a job-local file');- const shallow = execFileSync('git', ['rev-parse', '--is-shallow-repository'], { encoding: 'utf8' }).trim();- const count = execFileSync('git', ['rev-list', '--count', 'HEAD'], { encoding: 'utf8' }).trim();- const history = execFileSync('git', ['log', '--follow', '--format=%H', '--', 'history-renamed.txt'], { encoding: 'utf8' }).trim().split(/\\r?\\n/u);- assert.equal(shallow, 'false', 'the cache contains full candidate history');- assert.equal(count, '3', 'the cache preserves the complete selected history');- assert.ok(history.includes(${JSON.stringify(historyBaseCommit)}), 'cached history follows the original filename through the rename');- const committed = execFileSync('git', ['show', 'HEAD:packages/runner-fixture-dep/witness.txt'], { encoding: 'utf8' });- assert.equal(readFileSync('node_modules/.runner-cache-witness', 'utf8'), committed);- const link = readlinkSync('node_modules/runner-fixture-dep');- assert.equal(isAbsolute(link), false, 'the cached workspace symlink stays relative');- const target = realpathSync(join(root, 'node_modules/runner-fixture-dep'));- assert.equal(target, join(root, 'packages/runner-fixture-dep'));- const targetRelative = relative(root, target);- assert.ok(targetRelative && !targetRelative.startsWith('..' + sep) && targetRelative !== '..');- console.log('RUNNER_CACHE_FACT ' + JSON.stringify({ root, link, target, commit, tree, shallow, count, history, generatedRoot: generated.root }));-});-`;- writeFileSync(join(repo, 'runner-cache-probe.test.js'), probe);-}/** Start the current CLI from the same clean committed tooling snapshot used by API fixtures. */function startToolingCli(repo, env, args, { toolingRoot = resolve(import.meta.dirname, '..'), ...options } = {}) {@@ -416,6 +309,37 @@ test("the runner's trusted runtime list is closed under its relative imports [C7}});+test('runner remove deletes one runner and keeps the rest [C7]', (t) => {+ const box = e2e.project();+ const settingsFile = join(box.env.PULLBOARD_MACHINE_HOME, 'settings.json');+ const removed = { host: 'runner-one.example.invalid', slots: 2, browser: 1, node: 'node', root: '/srv/runner-one' };+ const remaining = { host: 'runner-two.example.invalid', slots: 1, browser: 0 };+ const original = { gateSlots: 3, browserSlots: 2, gate: { shortSlots: 1, queue: { reviewsFirst: true } },+ relay: { offerAtInit: true }, custom: { keep: 'unchanged' } };+ mkdirSync(box.env.PULLBOARD_MACHINE_HOME, { recursive: true });+ writeFileSync(settingsFile, JSON.stringify(original, null, 2));+ const firstAdded = box.run(box.repo, 'runner', 'add', removed.host, '--slots', String(removed.slots), '--browser', String(removed.browser),+ '--node', removed.node, '--root', removed.root);+ assert.equal(firstAdded.code, 0, firstAdded.err);+ const secondAdded = box.run(box.repo, 'runner', 'add', remaining.host, '--slots', String(remaining.slots), '--browser', String(remaining.browser));+ assert.equal(secondAdded.code, 0, secondAdded.err);+ const registered = { ...original, runners: [removed, remaining] };+ assert.deepEqual(JSON.parse(readFileSync(settingsFile, 'utf8')), registered);++ const result = box.run(box.repo, 'runner', 'remove', removed.host);+ assert.equal(result.code, 0, result.err);+ assert.ok(result.out.includes(`removed runner ${removed.host}`), result.out);+ assert.deepEqual(JSON.parse(readFileSync(settingsFile, 'utf8')), { ...original, runners: [remaining] });++ const missing = box.run(box.repo, 'runner', 'remove', removed.host, '--json');+ assert.equal(missing.code, 1, missing.err);+ const refusal = JSON.parse(missing.out).error;+ assert.equal(refusal.code, 'RUNNER_NOT_REGISTERED');+ assert.ok(refusal.next.includes(remaining.host), refusal.next);+ assert.ok(!refusal.next.includes(removed.host), refusal.next);+ assert.deepEqual(JSON.parse(readFileSync(settingsFile, 'utf8')), { ...original, runners: [remaining] });+});+test('a queued run executes on a registered runner and its result comes back (host checkout isolation) [C7]', async (t) => {const dir = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-runner-tooling-isolation-')));let completedCleanly = false;