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
chore(core): fix map main reference fixture
Corey Olson4e95cd31c2f1
diff --git a/src/commands/map.js b/src/commands/map.jsindex 0d0bc339..f5780979 100644--- a/src/commands/map.js+++ b/src/commands/map.js@@ -23,7 +23,7 @@ export async function run(io, { first, values }) {const ctx = context(io);const root = primaryCheckoutRoot(ctx.info);const trunk = root ? mainCheckout(root) : null;- if (!root || trunk?.branch !== 'main' || !trunk.commit) {+ if (!root || trunk?.branch !== 'refs/heads/main' || !trunk.commit) {throw new Refused('NO_TRUNK', 'pullboard map needs a reachable primary main checkout; restore it, then retry');}const { ensureCodeMap, renderCodeMapOverview, renderMapCard, renderItemSlice } = await import('../code-map.js');diff --git a/test/code-map.test.js b/test/code-map.test.jsindex 2b77c875..6359222e 100644--- a/test/code-map.test.js+++ b/test/code-map.test.js@@ -1,9 +1,12 @@/** @pullboard-test-input source-tree */-/** @pullboard-test-loads src/code-map.js src/commands/map.js src/commands/merged.js src/commands/index.js src/cli-main.js src/cli-help.js src/help.js src/land.js src/templates.js */+/** @pullboard-test-loads src/board.js src/code-map.js src/commands/map.js src/commands/merged.js src/commands/index.js src/cli-main.js src/cli-help.js src/help.js src/land.js src/templates.js test/board-submit-fixture.js */import assert from 'node:assert/strict';+import { createHash } from 'node:crypto';import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';import { join } from 'node:path';import { after, test } from 'node:test';+import * as store from '../src/board.js';+import { submitFixture } from './board-submit-fixture.js';import { createE2eHelpers } from './e2e-helpers.js';import { agentsBlock } from '../src/templates.js';@@ -13,9 +16,6 @@ after(e2e.cleanup);test('pullboard map prints the overview, a card and an item slice from one scan [C7]', t => {const box = e2e.project();t.after(() => e2e.cleanup());- const joined = box.run(box.repo, 'join', 'coordinator', '--model', 'fixture');- assert.equal(joined.code, 0, joined.out + joined.err);- assert.match(joined.out, /declared coordinator/u);const configPath = join(box.repo, 'pullboard.json');const config = JSON.parse(readFileSync(configPath, 'utf8'));config.lanes.web.owns.push('src/', 'bin/', 'test/');@@ -42,8 +42,27 @@ test('pullboard map prints the overview, a card and an item slice from one scanbox.git(box.repo, 'commit', '-q', '-m', 'test(core): add code map source fixture');const added = box.run(box.repo, 'add', 'web', 'Map fixture item', '--criterion','src/home.js exports renderHome and test/home.test.js imports it', '--specs', 'G1', '--check', 'true', '--route', 'light',- '--brief', 'Files: src/home.js, src/public.js, bin/start.js, test/home.test.js\nTest: map output follows imports and ignores misleading source text');+ '--brief', 'Files: src/home.js, src/public.js, bin/start.js, test/home.test.js\nTest: map output follows imports and ignores misleading source text', '--json');assert.equal(added.code, 0, added.out + added.err);+ const itemId = JSON.parse(added.out).item.item_id;+ const board = store.openBoard(join(box.repo, '.git', 'pullboard', 'board.sqlite'));+ store.ensureCoordinator(board, box.repo);+ const agentId = store.agentAt(board, box.web);+ assert.ok(agentId, 'the fixture builder remains joined to its web lane');+ const claimHead = box.git(box.repo, 'rev-parse', 'HEAD');+ const frozen = JSON.stringify({ criterion: 'src/home.js exports renderHome and test/home.test.js imports it' });+ const digest = createHash('sha256').update(frozen).digest('hex');+ store.claim(board, itemId, { agentId, lane: 'web', leaseMs: 3_600_000,+ freeze: () => ({ text: frozen, digest }), head: claimHead });+ mkdirSync(join(box.repo, 'web'), { recursive: true });+ writeFileSync(join(box.repo, 'web/map-item.txt'), 'accepted map fixture item\n');+ box.git(box.repo, 'add', 'web/map-item.txt');+ box.git(box.repo, 'commit', '-q', '-m', 'test(web): add mapped fixture item [G1]');+ const itemCommit = box.git(box.repo, 'rev-parse', 'HEAD');+ submitFixture(board, itemId, { agentId, commit: itemCommit, tree: box.git(box.repo, 'rev-parse', 'HEAD^{tree}') });+ store.verify(board, itemId, { agentId: 'coordinator', decision: 'ACCEPT', note: 'confirmed map fixture source',+ head: itemCommit, digest, policy: 'any' });+ t.after(() => store.closeBoard(board));const cache = join(box.repo, '.git', 'pullboard', 'code-map.json');const overview = box.run(box.repo, 'map');@@ -67,7 +86,7 @@ test('pullboard map prints the overview, a card and an item slice from one scanconst alias = box.run(box.repo, 'map', 'bin/start.js');assert.equal(alias.code, 0, alias.out + alias.err);assert.match(alias.out, /home\.js#renderHome/u, 'an import alias follows its local re-export');- const slice = box.run(box.repo, 'map', '--for', '1');+ const slice = box.run(box.repo, 'map', '--for', String(itemId));assert.equal(slice.code, 0, slice.out + slice.err);assert.match(slice.out, /src\/home\.js/u);assert.match(slice.out, /renderHome/u);@@ -80,8 +99,8 @@ test('pullboard map prints the overview, a card and an item slice from one scanwriteFileSync(join(box.repo, 'src/landed.js'), 'export function landed() { return true; }\n');box.git(box.repo, 'add', 'src/landed.js');- box.git(box.repo, 'commit', '-q', '-m', 'fixture: land another module');- const landed = box.run(box.repo, 'merged', '1', 'HEAD');+ box.git(box.repo, 'commit', '-q', '-m', 'test(core): land another code map module');+ const landed = box.run(box.repo, 'merged', String(itemId), 'HEAD');assert.equal(landed.code, 0, landed.out + landed.err);const refreshed = JSON.parse(readFileSync(cache, 'utf8'));assert.equal(refreshed.mainCommit, box.git(box.repo, 'rev-parse', 'main'));