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(core): assert inbox receipt, hook nudge, code map line [N26,N2,P2]
Corey Olson69ce55570565
diff --git a/test/idle-seat.test.js b/test/idle-seat.test.jsindex d4c15c4f..6bd6112f 100644--- a/test/idle-seat.test.js+++ b/test/idle-seat.test.js@@ -4,6 +4,7 @@ import assert from 'node:assert/strict';import { readFileSync } from 'node:fs';import { join } from 'node:path';import { test } from 'node:test';+import { agentHookCommand } from '../src/agent-hooks.js';import { createE2eHelpers } from './e2e-helpers.js';import { runFixtureChild } from './fixture-child.js';@@ -26,11 +27,13 @@ test('a seat with no claim is sent to pullboard next and never told to wait forconst guide = readFileSync(join(box.repo, 'AGENTS.md'), 'utf8');assert.match(guide, /no (?:active )?claim[\s\S]{0,100}pullboard next/iu, 'generated guidance states the idle-seat rule');const settings = JSON.parse(readFileSync(join(box.repo, '.claude/settings.json'), 'utf8'));- const command = settings.hooks.SessionStart.flatMap(entry => entry.hooks).find(hook => /pullboard resume/u.test(hook.command)).command;+ const command = settings.hooks.SessionStart.flatMap(entry => entry.hooks).find(hook => hook.command === agentHookCommand('SessionStart'))?.command;+ assert.ok(command, 'the generated SessionStart hook runs pullboard hook SessionStart');const hooked = runFixtureChild('/bin/sh', ['-c', command], { cwd: box.web, env: box.env, encoding: 'utf8' });assert.equal(hooked.status, 0, hooked.failure || hooked.stderr || hooked.stdout);- assert.match(hooked.stdout, /next: pullboard next/u, 'the actual session hook gives the same queue instruction');- assert.doesNotMatch(hooked.stdout, /wait for (?:an? )?assignment|wait to be assigned/iu);+ const context = JSON.parse(hooked.stdout).hookSpecificOutput?.additionalContext ?? '';+ assert.match(context, /next: pullboard next/u, 'the actual session hook gives the same queue instruction');+ assert.doesNotMatch(context, /wait for (?:an? )?assignment|wait to be assigned/iu);const empty = box.run(box.web, 'next', '--json');assert.equal(empty.code, 1, empty.out);const refusal = JSON.parse(empty.out).error;diff --git a/test/release.test.js b/test/release.test.jsindex 640e34e5..1ea1fadd 100644--- a/test/release.test.js+++ b/test/release.test.js@@ -86,7 +86,8 @@ test('a packed release installs with no network and runs the whole loop from a fgit(repo, 'merge', '-q', '--no-edit', commit);const merge = git(repo, 'rev-parse', 'HEAD');- assert.equal(pullboard(repo, 'merged', '1', merge).trim(), `#1 merged as ${merge.slice(0, 12)}`);+ assert.equal(pullboard(repo, 'merged', '1', merge).trim(),+ `#1 merged as ${merge.slice(0, 12)}\ncode map refreshed for main ${merge.slice(0, 12)}`, 'merged also refreshes the main-stamped code map');const shown = pullboard(repo, 'show', '1');assert.match(shown, /#1 {2}verified/);assert.match(shown, /merged as [0-9a-f]{12}/);diff --git a/test/stats-cli.test.js b/test/stats-cli.test.jsindex 98fdbe59..5d56a155 100644--- a/test/stats-cli.test.js+++ b/test/stats-cli.test.js@@ -200,13 +200,26 @@ test('[N26,D1] the caught list never interrupts', async (t) => {const before = store.events(board);const shouts = board.db.prepare('SELECT count(*) AS n FROM shout').get().n;for (const args of [['status'], ['list'], ['inbox'], ['lanes']]) {+ const earlier = store.events(board);const out = await run(root, args);assert.doesNotMatch(out.stdout + out.stderr, /caught/iu, `pullboard ${args[0]} stays silent about catches`);+ const added = store.events(board).slice(earlier.length);+ assert.deepEqual(store.events(board).slice(0, earlier.length), earlier, `pullboard ${args[0]} leaves earlier history unchanged`);+ if (args[0] !== 'inbox') {+ assert.deepEqual(added, [], `pullboard ${args[0]} records no move for a catch`);+ continue;+ }+ // Inbox records its own delivery receipt; the first ordered move on a main checkout also records the spec baseline.+ assert.deepEqual(added.map(event => event.event_kind).sort(), ['activity-delivered', 'spec_approval_baseline'],+ 'inbox records only its own delivery receipt and the one-time spec baseline');+ const delivery = JSON.parse(added.find(event => event.event_kind === 'activity-delivered').event_detail);+ assert.deepEqual(delivery.interrupts, [], 'the delivery receipt carries no catch');+ assert.ok(added.every(event => event.item_id === null), 'neither event names an item');}- assert.deepEqual(store.events(board), before, 'no ordinary command records a move for a catch');+ const afterOrdinary = store.events(board);await run(root, ['stats']);await run(root, ['digest']);- assert.deepEqual(store.events(board), before, 'asking for the list records nothing');+ assert.deepEqual(store.events(board), afterOrdinary, 'asking for the list records nothing');assert.equal(board.db.prepare('SELECT count(*) AS n FROM shout').get().n, shouts, 'a catch pushes no shout, banner or notification');});