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
test(shout): exercise explicit news arguments [R2,N26,H16]
Corey Olson0329e1c88444
diff --git a/test/shout-item-cli.test.js b/test/shout-item-cli.test.jsindex 779bfb40..95ae8722 100644--- a/test/shout-item-cli.test.js+++ b/test/shout-item-cli.test.js@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';import { after, test } from 'node:test';import { join } from 'node:path';import * as store from '../src/board.js';+import { moveArgs } from '../src/api-moves.js';import { createE2eHelpers } from './e2e-helpers.js';const fixtures = createE2eHelpers();@@ -31,3 +32,30 @@ test('an explicit item keeps all, person and lane names as literal message textassert.equal(row.shout_text, 'explicit recipient with item');} finally { store.closeBoard(board); }});+++test('explicit news follows normal CLI and API argument authority [R2,N26,H16,A2]', () => {+ const box = fixtures.project('true');+ const text = 'A private release belongs in the session-start digest.';+ const argv = moveArgs({ verb: 'shout', args: { to: 'all', text, news: true } });+ assert.deepEqual(argv, ['shout', '--news', '--json', '--', 'all', text], 'API news uses the normal literal CLI flag');+ const sent = box.run(box.repo, ...argv);+ assert.equal(sent.code, 0, sent.err || sent.out);+ const id = JSON.parse(sent.out).id;+ const inbox = box.run(box.web, 'inbox', '--json');+ assert.equal(inbox.code, 0, inbox.err || inbox.out);+ const delivered = JSON.parse(inbox.out);+ assert.equal(delivered.shouts.some(shout => shout.shout_id === id), false, 'news is not delivered twice as an ordinary message');+ assert.deepEqual(delivered.activity.digests.find(digest => digest.kind === 'news')?.shouts, [id]);+ const board = store.openBoard(join(box.repo, '.git', 'pullboard', 'board.sqlite'));+ try {+ const before = store.events(board);+ for (const [root, args] of [[box.web, ['shout', 'all', 'An agent cannot hide a broadcast', '--news', '--json']],+ [box.repo, ['shout', 'all', 'A decision is not expendable news', '--news', '--decision', '--json']]]) {+ const refused = box.run(root, ...args);+ assert.notEqual(refused.code, 0, refused.err || refused.out);+ assert.equal(JSON.parse(refused.out).error?.code, 'BAD_NEWS', refused.err || refused.out);+ assert.deepEqual(store.events(board), before, 'refused news appends no native event');+ }+ } finally { store.closeBoard(board); }+});