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.

test(view): keep fixture coordinator unknown [N26]

Corey Olson3c8b78553c13
diff --git a/test/cockpit/fixture.js b/test/cockpit/fixture.js
index 671688f8..28806f52 100644
--- a/test/cockpit/fixture.js
+++ b/test/cockpit/fixture.js
@@ -51,12 +51,17 @@ function machine() {
PULLBOARD_MACHINE_HOME: join(dir, 'machine-home'),
};
const git = (cwd, ...args) => execFileSync('git', args, { cwd, env, encoding: 'utf8', stdio: 'pipe' }).trim();
- const run = (cwd, ...args) => {
- const result = spawnSync(process.execPath, [BIN, ...args], { cwd, env, encoding: 'utf8' });
+ const invocations = [];
+ /** Run the CLI with an explicit environment and retain facts used by fixture checks. */
+ const runWithEnv = (cwd, commandEnv, ...args) => {
+ invocations.push({ args, hasModel: Object.hasOwn(commandEnv, 'PULLBOARD_MODEL'), model: commandEnv.PULLBOARD_MODEL });
+ const result = spawnSync(process.execPath, [BIN, ...args], { cwd, env: commandEnv, encoding: 'utf8' });
assert.equal(result.status, 0, `pullboard ${args.join(' ')}: ${result.stderr}`);
return result.stdout;
};
- return { dir, env, git, run };
+ /** Run the CLI with the machine environment used by later agent commands. */
+ const run = (cwd, ...args) => runWithEnv(cwd, env, ...args);
+ return { dir, env, git, run, runWithEnv, invocations };
}
/**
@@ -67,7 +72,9 @@ function project(box, name, spec = SPEC, extra = {}) {
const repo = join(box.dir, name);
mkdirSync(repo);
box.git(repo, 'init', '-q', '-b', 'main');
- box.run(repo, 'init');
+ const initEnv = { ...box.env };
+ delete initEnv.PULLBOARD_MODEL;
+ box.runWithEnv(repo, initEnv, 'init');
const config = { gate: 'true', spec: 'SPEC.md', verify: 'any', lease: '2h', lanes: { web: { owns: ['web/'], specs: ['G'] } }, shared: [], ...extra };
writeFileSync(join(repo, 'pullboard.json'), JSON.stringify(config, null, 2));
writeFileSync(join(repo, 'SPEC.md'), spec);
diff --git a/test/cockpit/fixture.test.js b/test/cockpit/fixture.test.js
index 78c32204..d238ca92 100644
--- a/test/cockpit/fixture.test.js
+++ b/test/cockpit/fixture.test.js
@@ -12,6 +12,18 @@ import { projectState } from '../../src/serve.js';
import { scratch, machine, project, build, fetchView, fetchLive, startView, styleOf, openPage, boardId, boardOf, assertObservationsEqual, chromeExecutable, startSnapshotChrome, openSnapshotChrome, stopOwnedChrome, closeSnapshotChrome } from './fixture.js';
+test('the cockpit fixture inits its board without a model [N26]', () => {
+ const box = machine();
+ project(box, 'model-free-coordinator');
+ const init = box.invocations.find((call) => call.args.length === 1 && call.args[0] === 'init');
+ const join = box.invocations.find((call) => call.args[0] === 'join' && call.args[1] === 'web');
+ assert.ok(init, 'the fixture ran init');
+ assert.equal(init.hasModel, false, 'init does not inherit the test runner model');
+ assert.ok(join, 'the fixture ran a later agent join');
+ assert.equal(join.hasModel, true, 'later agent joins retain the machine model');
+ assert.equal(join.model, 'Test Model');
+});
+
test('borrowed board presentation keeps parity, shows staged rows, and leaves the caller connection open [N26,H16]', () => {
const box = machine();
const p = project(box, 'projector');