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.

fix(tour): one demo in the project list, never linked [N10]

Corey Olsonec50eb401478
diff --git a/src/tour.js b/src/tour.js
index 09ae9f1d..b0892cc9 100644
--- a/src/tour.js
+++ b/src/tour.js
@@ -26,7 +26,11 @@ import {
AGENT_SESSION_IDS,
AGENT_SHELL_MARKERS,
} from './person.js';
-import { registerProjectAndLink } from './projects.js';
+import {
+ forgetProject,
+ listProjects,
+ registerProject,
+} from './projects.js';
/**
* The caller's agent-session identity and checkout lease. A scripted seat must never inherit them: a seat that did
@@ -235,7 +239,10 @@ export async function tour(io) {
io.err(slowestSteps(timings));
return 1;
}
- await registerProjectAndLink(repo, new Date(), loadConfig(repo), io);
+ // One demo stays in the list: each run replaces the last tour demo, and listProjects drops any whose folder is gone.
+ // The demo is registered locally only, never linked to the relay, even when relay on --all is set (#951).
+ for (const entry of listProjects()) if (entry.project === CONFIG.project && entry.root !== repo) forgetProject(entry.root);
+ registerProject(repo, new Date(), loadConfig(repo));
io.say('\nNothing shipped until a second agent verified it.');
io.say(`Look around: cd ${repo} && pullboard log`);
io.say('see it: pullboard view');
diff --git a/test/e2e.test.js b/test/e2e.test.js
index d83e6f75..e927a036 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -451,6 +451,33 @@ function sessionDigest(name, value) {
return createHash('sha256').update(JSON.stringify([name, value])).digest('hex');
}
+test('a second tour replaces the first demo and links nothing to the relay [N10]', { timeout: 300_000 }, () => {
+ // The machine's own list and relay state hold their own home, so a tour run here can only touch that home (#951).
+ const box = sandbox();
+ const home = join(box.dir, 'private-home');
+ mkdirSync(home);
+ const real = join(box.dir, 'real-project');
+ mkdirSync(real);
+ box.git(real, 'init', '-q', '-b', 'main');
+ writeFileSync(join(home, 'projects.json'), JSON.stringify({ projects: [{ root: real, name: 'real-project', project: '', added: '2026-01-01T00:00:00.000Z' }] }));
+ mkdirSync(join(home, 'relay-machine'), { mode: 0o700 });
+ writeFileSync(join(home, 'relay-machine', 'state.json'), JSON.stringify({ v: 2, autoLink: true, owner: null, machine: 'machine-951', devices: [], excluded: [], pending: null, revocations: [], approvals: [] }), { mode: 0o600 });
+ const tourEnv = { ...box.env, TMPDIR: box.dir, PULLBOARD_HOME: home };
+ delete tourEnv.NO_COLOR;
+ delete tourEnv.FORCE_COLOR;
+ delete tourEnv.PULLBOARD_MODEL;
+ const repos = [];
+ for (let run = 1; run <= 2; run += 1) {
+ const shown = spawnSync(process.execPath, [BIN, 'tour'], { cwd: box.dir, env: tourEnv, encoding: 'utf8' });
+ assert.equal(shown.status, 0, `run ${run}: ${shown.stdout}${shown.stderr}`);
+ repos.push(/Look around: cd (\S+) && pullboard log/u.exec(shown.stdout)[1]);
+ }
+ const registry = JSON.parse(readFileSync(join(home, 'projects.json'), 'utf8')).projects;
+ assert.deepEqual(registry.map((entry) => entry.root), [real, repos[1]], 'the list holds the real project and the demo of the second run, and no other');
+ const state = JSON.parse(readFileSync(join(home, 'relay-machine', 'state.json'), 'utf8'));
+ assert.deepEqual(state.approvals, [], 'no relay link request or approval was made for either demo');
+});
+
test('the tour finishes when an agent session runs it [N10]', () => {
// A caller in Claude Code or Codex runs the tour; the scripted seats must not inherit the caller's session, so the
// reject-and-rework still verifies (#952). The caller's own digest must appear on no item the tour moved.