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(view): record local shouts as person [N26,B26]

Corey Olson9401c10b95f9
diff --git a/src/cli.js b/src/cli.js
index be1e8c61..f8c9fba3 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -3204,7 +3204,7 @@ function workCommands(io, args) {
const hasRecipient = first && recipients.includes(first);
const to = hasRecipient ? first : values.decision ? (me.id === COORDINATOR ? 'person' : COORDINATOR) : first ?? '';
const text = [hasRecipient ? second : first, ...(hasRecipient ? rest : [second, ...rest])].filter(Boolean).join(' ');
- const id = await ordered(ctx, board, 'shout', [{ from: io.personRequest?.phase === 'execute' ? store.PERSON : me.id, to, text, lanes: laneNames(ctx.config), decision: Boolean(values.decision), evidence }]);
+ const id = await ordered(ctx, board, 'shout', [{ from: (io.personChannel === 'view' || io.personRequest?.phase === 'execute') ? store.PERSON : me.id, to, text, lanes: laneNames(ctx.config), decision: Boolean(values.decision), evidence }]);
io.result?.({ id, decision: Boolean(values.decision) });
const agents = store.listAgents(board);
const recipient = agents.some((agent) => agent.agent_id === to) ? agentDisplayName(agents, ctx.config, to) : to;
diff --git a/test/agent-session.test.js b/test/agent-session.test.js
index 16d2d679..2daefd0a 100644
--- a/test/agent-session.test.js
+++ b/test/agent-session.test.js
@@ -204,10 +204,11 @@ test('no-session shells are one session and markerless terminals retain their wr
assert.deepEqual(boardSnapshot(box.boardFile), beforeSelf, 'self-addressed decision is refused without a write');
});
-test('the actual view adapter writes without taking over an agent session [B3,B7]', () => {
+test('a shout from the local view as the person is recorded as the person [N26,B26]', () => {
const box = project();
const owner = box.run(box.repo, ['shout', 'web', 'agent owns this checkout', '--json'], { session: 'view-owner-session-273' });
assert.equal(owner.status, 0, owner.stdout + owner.stderr);
+ assert.equal(boardSnapshot(box.boardFile).shout.at(-1).shout_from, 'coordinator', 'an agent-shell shout keeps the coordinator as author');
const file = resolve(box.repo, box.git(box.repo, 'rev-parse', '--git-dir'), 'pullboard-checkout-session.json');
const before = readFileSync(file);
const apiModule = pathToFileURL(resolve(import.meta.dirname, '../src/api.js')).href;
@@ -225,8 +226,9 @@ test('the actual view adapter writes without taking over an agent session [B3,B7
const document = JSON.parse(response.stdout);
assert.equal(document.status, 200, response.stdout);
assert.equal(document.body.event.event_kind, 'shout');
- assert.equal(document.body.event.event_by, 'coordinator');
+ assert.equal(document.body.event.event_by, 'person');
assert.equal(boardSnapshot(box.boardFile).shout.at(-1).shout_text, 'actual view action');
+ assert.equal(boardSnapshot(box.boardFile).shout.at(-1).shout_from, 'person');
assert.deepEqual(readFileSync(file), before, 'the authenticated view does not alter the local agent-session binding');
});
diff --git a/test/e2e-view.test.js b/test/e2e-view.test.js
index 85b812e3..64515d48 100644
--- a/test/e2e-view.test.js
+++ b/test/e2e-view.test.js
@@ -260,7 +260,8 @@ test('from the view the person adds items, shouts and holds lanes, through the C
const shouted = await view.act(box.repo, { verb: 'shout', args: { to: 'web', text: 'from the person' } });
assert.equal(shouted.status, 200);
assert.equal(shouted.document.event.event_kind, 'shout');
- assert.match(box.run(box.web, 'inbox').out, /coordinator \(unknown\) -> web: from the person/);
+ assert.equal(shouted.document.event.event_by, 'person');
+ assert.match(box.run(box.web, 'inbox').out, /person \(unknown\) -> web: from the person/);
const held = await view.act(box.repo, { verb: 'hold', args: { lane: 'web', reason: 'G1 is changing' } });
assert.equal(held.status, 200);
assert.equal(held.document.event.event_kind, 'hold');