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(handoff): exercise the incoming private agent session [B3,N19]

Corey Olson50bb949a359b
diff --git a/docs/handoff.md b/docs/handoff.md
index b0368a8d..f5ed9866 100644
--- a/docs/handoff.md
+++ b/docs/handoff.md
@@ -74,6 +74,9 @@ pullboard takeover
pullboard resume --diagnostics
```
+Use the incoming agent's own session. A person's ordinary terminal cannot take
+over on an agent's behalf.
+
On a linked board, takeover takes the coordinator hold for this main checkout
as an ordered board move. A previously holding main checkout is then refused
coordinator moves until it takes the role again. In an unlinked checkout,
diff --git a/docs/handoff.test.js b/docs/handoff.test.js
index f22a49ea..c7181a39 100644
--- a/docs/handoff.test.js
+++ b/docs/handoff.test.js
@@ -7,6 +7,7 @@ import { join } from 'node:path';
import { test } from 'node:test';
import * as store from '../src/board.js';
import { createE2eHelpers } from '../test/e2e-helpers.js';
+import { runFixtureChild } from '../test/fixture-child.js';
/** Require the real fixture CLI to succeed before interpreting its output. */
function command(box, cwd, ...args) {
@@ -82,7 +83,14 @@ test('the hand-off guide matches the board [B3,N19]', () => {
'private chat', 'durable']) assert.ok(guide.includes(literal), `guide includes ${literal}`);
assert.ok(text.includes(batch.logPath), 'the durable batch log is printed with its owner');
assert.ok(text.includes(box.repo), 'resume names the real checkout rather than a scratchpad');
- const takeover = JSON.parse(command(box, box.repo, 'takeover', '--json'));
+ const noSession = box.run(box.repo, 'takeover', '--json');
+ assert.equal(JSON.parse(noSession.out).error?.code, 'AGENT_SESSION',
+ 'the ordinary person shell cannot take over on an agent session\u2019s behalf');
+ const incoming = runFixtureChild(process.execPath, [e2e.BIN, 'takeover', '--json'], {
+ cwd: box.repo, env: { ...box.env, CODEX_THREAD_ID: 'handoff-guide-private-incoming' }, encoding: 'utf8',
+ });
+ assert.equal(incoming.status, 0, incoming.failure || incoming.stderr || incoming.stdout);
+ const takeover = JSON.parse(incoming.stdout);
assert.equal(takeover.agent, 'coordinator');
assert.equal(takeover.path, box.repo);
const agent = JSON.parse(command(box, box.web, 'resume', '--json'));