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(merge): align model-name proof with main [O8,N26]
Corey Olsonfb6cca76c7e7
diff --cc test/cockpit.test.jsindex 258f624e,eeb520c4..ba7538e5--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@@ -7305,164 -7300,64 +7305,226 @@@ test('needs you and the asks sit in the}});+test('agent model display names follow the API on phone and desktop [O8,N26]', { timeout: 150_000 }, async (t) => {+ const executable = chromeExecutable();+ assert.ok(executable, 'Chrome is required for model-name viewport proof');+ const box = machine();+ const alpha = project(box, 'model-names');+ const model = 'GPT-6 with a very long model declaration for readable agent names';+ box.run(alpha.web, 'join', 'web', '--model', model);+ const board = openBoard(join(alpha.repo, '.git', 'pullboard', 'board.sqlite'));+ try { register(board, { lane: 'coordinator', path: alpha.repo, model: 'Claude' }); }+ finally { closeBoard(board); }+ for (const title of ['Known holder', 'Reviewed model', 'Unknown holder']) {+ box.run(alpha.repo, 'add', 'web', title, '--specs', 'G1', '--criterion', 'visible');+ }+ build(box, alpha, 2, 'reviewed.txt');+ accept(box, alpha, 2);+ box.run(alpha.web, 'claim', '1');+ const unknown = join(box.dir, 'unknown-web');+ box.git(alpha.repo, 'worktree', 'add', '-q', unknown, '-b', 'web/unknown');+ // An existing stored registration may have no model even though new CLI joins require one.+ const legacyBoard = openBoard(join(alpha.repo, '.git', 'pullboard', 'board.sqlite'));+ try { register(legacyBoard, { lane: 'web', path: unknown }); }+ finally { closeBoard(legacyBoard); }+ box.run(unknown, 'claim', '3');+ box.run(alpha.web, 'shout', 'web-2', 'Known sender and unknown recipient');+ box.run(unknown, 'shout', 'all', 'Unknown sender and a lane-free recipient');+ box.run(alpha.repo, 'shout', 'person', 'A model decision', '--decision');+ box.run(alpha.repo, 'hold', 'web', '--reason', 'Wait for the model decision');+ box.run(alpha.repo, 'milestone', 'add', 'Model release', '--items', '1,2,3');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-model-names-chrome-'));+ let chrome;+ /** Read rendered text from the real browser without changing its API data. */+ const text = (selector) => chrome.evaluate(`document.querySelector(${JSON.stringify(selector)})?.textContent || ''`);+ /** Press a real control and wait until its requested pane is drawn. */+ const tab = async (name) => {+ await press(chrome, `document.querySelector('[data-tab="${name}"]')`);+ await settled(chrome, `view.tab === ${JSON.stringify(name)}`);+ };+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await settled(chrome, "data?.project?.agents?.length === 3 && !!document.querySelector('#chain [data-item=\"1\"]')");+ for (const style of ['suffix', 'prefix']) {+ if (style === 'prefix') {+ const configFile = join(alpha.repo, 'pullboard.json');+ const config = JSON.parse(readFileSync(configFile, 'utf8'));+ config.agents = { ...(config.agents || {}), names: 'prefix' };+ writeFileSync(configFile, JSON.stringify(config, null, 2));+ box.git(alpha.repo, 'add', 'pullboard.json');+ box.git(alpha.repo, 'commit', '-q', '-m', 'chore: use prefix names');+ await chrome.evaluate('refresh()');+ }+ const expected = style === 'suffix'+ ? { builder: 'web-1 (' + model + ')', reviewer: 'coordinator (Claude)', unknown: 'web-2 (unknown)' }+ : { builder: 'gpt-6-with-a-very-long-model-declaration-for-readable-agent-names-web-1', reviewer: 'claude-coordinator', unknown: 'unknown-web-2' };+ const apiNames = JSON.parse(await chrome.evaluate('JSON.stringify(Object.fromEntries(data.project.agents.map(a => [a.agent_id, a.displayName])))'));+ assert.deepEqual(apiNames, { coordinator: expected.reviewer, 'web-1': expected.builder, 'web-2': expected.unknown }, `${style}: authoritative API names`);+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await settled(chrome, `innerWidth === ${width}`);+ const at = `${style} ${width}`;+ await tab('items');+ await press(chrome, 'document.querySelector("[data-state=active]")');+ await settled(chrome, '!!document.querySelector("#chain [data-item=\\"1\\"]")');+ assert.equal(await text('#chain [data-item="1"] .chip'), expected.builder, `${at}: item row holder`);+ assert.equal(await text('#chain [data-item="3"] .chip'), expected.unknown, `${at}: unknown model row`);+ await press(chrome, 'document.querySelector("#chain [data-item=\\"1\\"]")');+ await settled(chrome, 'view.item === 1');+ assert.ok((await text('#detail')).includes(expected.builder), `${at}: held item detail`);+ assert.equal(await text('#needs .row[data-go^="decide:"] .meta'), 'NEEDS YOU a decision, asked by ' + expected.reviewer, `${at}: Needs-you decision author`);+ assert.ok((await text('#needs .row[data-go="tab:shouts"] .meta')).includes('lane held by ' + expected.reviewer), `${at}: Needs-you lane holder`);+ await press(chrome, 'document.querySelector("[data-state=verified]")');+ await settled(chrome, '!!document.querySelector("#chain [data-item=\\"2\\"]")');+ await press(chrome, 'document.querySelector("#chain [data-item=\\"2\\"]")');+ await settled(chrome, 'view.item === 2');+ const detail = await text('#detail');+ assert.ok(detail.includes(expected.builder) && detail.includes(expected.reviewer), `${at}: builder and verifier detail`);+ assert.ok((await text('#detail .verdict .by')).startsWith(expected.reviewer), `${at}: verdict identity`);+ await tab('shouts');+ for (const [id, label] of [['web-1', expected.builder], ['web-2', expected.unknown]]) {+ assert.equal(await text(`#agents [data-agent="${id}"] .agent-who b`), label, `${at}: agent panel ${id}`);+ }+ if (!await chrome.evaluate('Boolean(view.open.idle)')) await press(chrome, 'document.querySelector("[data-fold=idle]")');+ assert.equal((await text('#agents [data-agent="coordinator"]')).trim(), expected.reviewer, `${at}: idle agent model`);+ const feed = await text('#feed');+ assert.ok(feed.includes(expected.builder) && feed.includes(expected.unknown) && feed.includes(expected.reviewer), `${at}: shout sender and recipient names`);+ assert.ok(feed.includes('→ all') && feed.includes('→ person'), `${at}: person and broadcast recipients keep their names`);+ const headers = JSON.parse(await chrome.evaluate(`JSON.stringify([...document.querySelectorAll('#feed .shout header')].map(header => {+ const rect = header.getBoundingClientRect();+ return { height: rect.height, line: parseFloat(getComputedStyle(header.querySelector('.who')).lineHeight),+ labels: [...header.querySelectorAll('.agent-label')].map(label => {+ const id = label.querySelector('.agent-id'), part = label.querySelector('.agent-model'), box = id.getBoundingClientRect();+ return { name: label.textContent, title: label.title, aria: label.getAttribute('aria-label'), id: id.textContent,+ left: box.left, right: box.right, headerLeft: rect.left, headerRight: rect.right, idWidth: id.clientWidth, idScroll: id.scrollWidth,+ ellipsis: getComputedStyle(part).textOverflow, clipped: part.scrollWidth > part.clientWidth };+ }) };+ }))`));+ assert.ok(headers.length > 0, `${at}: real shout headers render`);+ const accessible = await chrome.send('Accessibility.getFullAXTree');+ const names = accessible.nodes.filter(node => node.role?.value === 'group' && !node.ignored).map(node => node.name?.value);+ assert.ok(names.includes(expected.builder) && names.includes(expected.unknown) && names.includes(expected.reviewer), `${at}: Chrome exposes complete model names to assistive readers`);++ for (const header of headers) {+ assert.ok(header.height <= header.line + 1, `${at}: shout identity stays on one line: ${JSON.stringify(header)}`);+ for (const label of header.labels) {+ assert.equal(label.title, apiNames[label.id], `${at}: full API name stays in the tooltip`);+ assert.equal(label.aria, apiNames[label.id], `${at}: full API name stays accessible`);+ assert.equal(label.idWidth, label.idScroll, `${at}: the address is never clipped`);+ assert.ok(label.left >= label.headerLeft - 1 && label.right <= label.headerRight + 1, `${at}: address stays inside its header`);+ }+ }+ if (width === 375) assert.ok(headers.flatMap(h => h.labels).some(label => label.id === 'web-1' && label.clipped && label.ellipsis === 'ellipsis'), `${at}: only the long model shortens with an ellipsis`);++ await press(chrome, 'document.querySelector("#agents [data-agent=\\"web-1\\"]")');+ await settled(chrome, 'view.agent === "web-1"');+ assert.equal(await chrome.evaluate('view.agent'), 'web-1', `${at}: filtering retains the raw API id`);+ await press(chrome, 'document.querySelector("[data-agent=\\"\\"]")');+ await tab('activity');+ const activity = await text('#activity');+ assert.ok(activity.includes(expected.builder) && activity.includes(expected.unknown) && activity.includes(expected.reviewer), `${at}: activity identities`);+ await tab('roadmap');+ assert.doesNotMatch(await text('#roadmap'), /web-[12]|coordinator/, `${at}: roadmap rows name no agents`);+ await press(chrome, 'document.querySelector("#roadmap [data-go=\\"item:1\\"]")');+ await settled(chrome, 'view.tab === "items" && view.item === 1');+ assert.ok((await text('#detail')).includes(expected.builder), `${at}: roadmap item opens with the API identity`);+ assert.ok(await chrome.evaluate('document.documentElement.scrollWidth <= innerWidth'), `${at}: no sideways overflow`);+ }+ }+ assert.deepEqual(chrome.exceptions, [], 'all model-name views run without browser exceptions');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});++test('staged and exported boards carry API model display names [O8,N26,A10]', async () => {+ const box = machine();+ const alpha = project(box, 'model-export', SPEC, { agents: { names: 'prefix' } });+ box.run(alpha.web, 'join', 'web', '--model', 'GPT-6');+ const source = openBoard(join(alpha.repo, '.git', 'pullboard', 'board.sqlite'));+ const staged = openBoard(join(box.dir, 'staged-models.sqlite'));+ try {+ const before = exportBoard(source);+ importBoard(staged, before);+ const ordinary = projectState(alpha.repo);+ const borrowed = projectState(alpha.repo, { board: staged });+ assert.equal(ordinary.agents.find(a => a.agent_id === 'web-1').displayName, 'gpt-6-web-1', 'ordinary projector respects configured API name');+ assert.equal(borrowed.agents.find(a => a.agent_id === 'web-1').displayName, 'gpt-6-web-1', 'staged projector carries the same name');+ const directory = join(box.dir, 'exported-models');+ await exportView(alpha.repo, directory);+ const boardIds = readdirSync(join(directory, 'api', 'v1', 'boards'));+ assert.equal(boardIds.length, 1, 'the export contains the real fixture board');+ const snapshot = JSON.parse(readFileSync(join(directory, 'api', 'v1', 'boards', boardIds[0], 'state.json'), 'utf8'));+ assert.equal(snapshot.state.agents.find(a => a.agent_id === 'web-1').displayName, 'gpt-6-web-1', 'snapshot API retains the configured model name');+ assert.deepEqual(exportBoard(source), before, 'presentation does not change the real source board');+ assert.equal(staged.db.prepare('SELECT 1 AS open').get().open, 1, 'the borrowed file-backed board stays open');+ } finally {+ closeBoard(staged);+ closeBoard(source);+ }+});+++ test('the project switcher\'s arrow turns with the list [N26]', { timeout: 120_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for project switcher checks.');+ const box = machine();+ project(box, 'arrow-alpha');+ project(box, 'arrow-beta');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-arrow-chrome-'));+ let chrome;+ /** The switcher's arrow as it reads: shown, its size, which way it points, and whether it animates. */+ const read = async () => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const arrow = document.querySelector('#proj-switch small'), svg = arrow.querySelector('svg'), s = getComputedStyle(arrow), r = svg.getBoundingClientRect();+ return {+ page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth },+ shown: s.display !== 'none' && r.width > 0, size: [Math.round(r.width), Math.round(r.height)], faint: s.color === (() => { const p = document.createElement('i'); p.style.color = 'var(--ink-faint)'; document.body.append(p); const c = getComputedStyle(p).color; p.remove(); return c; })(),+ turn: s.transform, motion: [s.transitionDuration, s.animationName], open: document.querySelector('#proj-switch').getAttribute('aria-expanded'),+ };+ })())`));+ const click = (selector) => chrome.evaluate(`document.querySelector(${JSON.stringify(selector)}).click()`);+ /** One drawn frame after a click: an arrow that animated would still be part way round. */+ const frame = () => chrome.evaluate('new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done)))');+ const DOWN = 'none', UP = 'matrix(-1, 0, 0, -1, 0, 0)';+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && data?.projects?.length === 2 && !!document.querySelector('#proj-list .proj.repo')");+ for (const scheme of ['light', 'dark']) {+ for (const width of [1280, 375]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: scheme }] });+ await chrome.waitFor(`innerWidth === ${width} && matchMedia('(prefers-color-scheme: ${scheme})').matches`);+ const at = `${width}px ${scheme}`;+ if (width === 1280) {+ // Docked, the name opens no list, so there is no arrow; collapsed, the list drops from the name.+ if (await chrome.evaluate("document.documentElement.dataset.side === 'collapsed'")) await click('#side-toggle');+ await chrome.waitFor("document.documentElement.dataset.side !== 'collapsed'");+ assert.equal((await read()).shown, false, `${at}: docked, with no list to drop, there is no arrow`);+ await click('#side-toggle');+ await chrome.waitFor("document.documentElement.dataset.side === 'collapsed'");+ }+ const closed = await read();+ assert.ok(closed.page.scroll <= closed.page.width, `${at}: no sideways scroll`);+ assert.deepEqual([closed.shown, closed.size, closed.faint, closed.open, closed.turn], [true, [16, 16], true, 'false', DOWN], `${at}: a 16px chevron in the faint ink, pointing down while the list is closed: ${JSON.stringify(closed)}`);+ assert.deepEqual(closed.motion, ['0s', 'none'], `${at}: the arrow never animates: ${JSON.stringify(closed.motion)}`);+ // Open, it points up at once: one frame after the click it is all the way round. Closed again, down.+ await click('#proj-switch');+ await frame();+ const opened = await read();+ assert.deepEqual([opened.open, opened.turn], ['true', UP], `${at}: open, it points up at once: ${JSON.stringify(opened)}`);+ await click('#proj-switch');+ await frame();+ const shut = await read();+ assert.deepEqual([shut.open, shut.turn], ['false', DOWN], `${at}: closed again, it points down at once: ${JSON.stringify(shut)}`);+ }+ }+ assert.deepEqual(chrome.exceptions, [], 'the page raises no uncaught exception');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+ });