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
feat(view): the agents panel says what each agent holds [N26]
Corey Olsona12cdf394024
diff --git a/src/cockpit.js b/src/cockpit.jsindex 0f33c86e..b4cbb9b6 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -166,6 +166,12 @@ input, select { border: 1px solid var(--line-strong); background: var(--surface).agent { display: grid; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }.agent:first-child { border-top: 0; }.agent small { color: var(--ink-faint); font: 11.5px var(--mono); overflow-wrap: anywhere; }+.agent > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }+.agent > div > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.agent time { margin-left: auto; color: var(--ink-faint); font: 12px var(--mono); }+.agent button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; }+.agent button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.agent button:hover > span:first-child { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }.lane { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }.lane:first-child { border-top: 0; }.rows { padding: 4px 10px 10px; }@@ -385,7 +391,15 @@ function render() {$('feed').innerHTML = p.shouts.length ? p.shouts.map((x) => '<div><time>' + clock(x.shout_at) + '</time><div><b>' + esc(x.shout_from) + ' → ' + esc(x.shout_to) + '</b> ' + esc(x.shout_text) + '</div></div>').join('') : '<div class="empty">No shouts yet.</div>';$('shout-targets').innerHTML = ['all', ...lanes, ...p.agents.map((a) => a.agent_id)].map((t) => '<option value="' + esc(t) + '">').join('');- $('agents').innerHTML = p.agents.length ? p.agents.map((a) => '<div class="agent"><b>' + esc(a.agent_id) + '</b><span class="muted">' + esc(a.agent_lane) + ' lane · ' + esc(a.agent_route) + '</span><small>' + esc(a.agent_path) + '</small></div>').join('') : '<div class="empty">No agents yet.</div>';+ // Each agent with what it holds: its claim, then its work sent back, then its work waiting for a+ // verdict. The worktree path is there on hover; what the person reads is who is doing what.+ const order = ['building', 'back', 'verify'];+ const holding = (a) => items.filter((i) => i.status === 'claimed' ? i.owner === a.agent_id : i.builtBy === a.agent_id && order.includes(stateOf(i))).sort((x, y) => order.indexOf(stateOf(x)) - order.indexOf(stateOf(y)));+ $('agents').innerHTML = p.agents.length ? p.agents.map((a) => {+ const mine = holding(a);+ return '<div class="agent"><div><b title="' + esc(a.agent_path) + '">' + esc(a.agent_id) + '</b><span class="muted">' + esc(a.agent_lane) + ' · ' + esc(a.agent_route) + '</span>' + (a.lastMoveAt ? '<time title="last moved ' + when(a.lastMoveAt) + '">' + ago(a.lastMoveAt) + '</time>' : '') + '</div>'+ + (mine.length ? mine.map((i) => '<button data-go="item:' + i.id + '" type="button"><span>#' + i.id + ' ' + esc(i.title) + '</span>' + chip(stateOf(i)) + '</button>').join('') : '<small>idle</small>') + '</div>';+ }).join('') : '<div class="empty">No agents yet.</div>';const held = new Map(p.holds.map((h) => [h.hold_lane, h]));$('lanes').innerHTML = working.map((l) => '<div class="lane"><span><b>' + esc(l) + '</b> ' + (held.has(l) ? '<span class="chip no">held</span> <span class="muted">' + esc(held.get(l).hold_reason) + '</span>' : '<span class="chip ok">open</span>') + '</span>' + (held.has(l) ? '<button class="ghost" data-release="' + esc(l) + '" type="button">Release</button>' : '') + '</div>').join('');diff --git a/src/serve.js b/src/serve.jsindex ea993218..84992746 100644--- a/src/serve.js+++ b/src/serve.js@@ -83,6 +83,9 @@ export function projectState(root) {const status = new Map(all.map((item) => [item.item_id, item.item_status]));const rows = (file) => loadSpec(info.root, { ...config, spec: file }).rows.map(({ id, status: state, tier, text, gate, serves, section }) => ({ id, status: state, tier, text, gate, serves, section }));const verdict = (row) => ({ decision: row.verdict_decision, reason: row.verdict_reason, note: row.verdict_note, by: row.verdict_by, at: row.verdict_at, commit: row.verdict_commit });+ const log = store.events(board);+ // When each agent last moved on the board: the log is in order, so the last write wins.+ const lastMove = new Map(log.map((event) => [event.event_by, event.event_at]));return {root: info.root,lanes: [COORDINATOR, ...Object.keys(config.lanes)],@@ -111,8 +114,8 @@ export function projectState(root) {};}),shouts: store.recentShouts(board, 40),- events: store.events(board).slice(-80).reverse(),- agents: store.listAgents(board),+ events: log.slice(-80).reverse(),+ agents: store.listAgents(board).map((agent) => ({ ...agent, lastMoveAt: lastMove.get(agent.agent_id) ?? null })),holds: store.laneHolds(board),spec: rows(config.spec),practice: rows(config.practice),diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex fd95eea6..020acf8b 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -307,6 +307,56 @@ test('the sidebar lists every project and what needs the person [N26]', async ()}});+/**+ * The agents the panel shows: id, the path on hover, its last move, what it holds and whether it+ * reads idle, and its entry's text with the tags taken out.+ */+function agentEntries(html) {+ return html.split('<div class="agent">').slice(1).map((entry) => ({+ id: /<b[^>]*>([^<]*)<\/b>/.exec(entry)?.[1],+ path: /<b title="([^"]*)"/.exec(entry)?.[1],+ age: /<time[^>]*>([^<]*)<\/time>/.exec(entry)?.[1],+ holds: [...entry.matchAll(/data-go="item:(\d+)"[^>]*><span>([^]*?)<\/span><span class="chip[^"]*">([^<]*)</g)].map((match) => `${match[2]}: ${match[3]}`),+ idle: entry.includes('<small>idle</small>'),+ text: entry.replace(/<[^>]*>/g, ' '),+ }));+}++test('the agents panel says what each agent holds [N26]', async () => {+ const box = machine();+ const alpha = project(box, 'alpha');+ const second = join(box.dir, 'alpha-web-two');+ box.git(alpha.repo, 'worktree', 'add', '-q', second, '-b', 'web/two');+ box.run(second, 'join', 'web');+ for (const title of ['Header', 'Farewell', 'Greeting <b>bold</b>', 'Footer']) box.run(alpha.repo, 'add', 'web', title, '--specs', 'G1', '--criterion', 'renders');+ // The board lists items newest first; each agent's rows must put its higher id second.+ build(box, alpha, 3, 'greeting.html');+ const two = { ...alpha, web: second, branch: 'web/two' };+ build(box, two, 2, 'farewell.html');+ sendBack(box, two, 2, 'no farewell on the page');+ build(box, two, 4, 'footer.html');+ box.run(alpha.web, 'claim', '1');+ const view = await startView(box);+ try {+ const page = await openPage(view);+ const agents = agentEntries(page.show('agents'));+ assert.deepEqual(agents.map((agent) => [agent.id, agent.holds, agent.idle]), [+ ['coordinator', [], true],+ // The claim first, then work sent back, then work waiting for a verdict.+ ['web-1', ['#1 Header: building', '#3 Greeting <b>bold</b>: to verify'], false],+ ['web-2', ['#2 Farewell: sent back', '#4 Footer: to verify'], false],+ ]);+ for (const agent of agents) assert.match(agent.age, /^(now|\d+[mhd])$/, `${agent.id} shows when it last moved`);+ assert.deepEqual(agents.map((agent) => agent.path), [alpha.repo, alpha.web, second], 'each path is on hover');+ for (const agent of agents) assert.ok(!agent.text.includes(agent.path), `${agent.id}'s path is not in the text`);++ await page.click({ go: 'item:1' });+ assert.match(page.show('detail'), /<h2><span>#1<\/span>Header<\/h2>/, 'a held item opens on the Items tab');+ } finally {+ await view.stop();+ }+});+/*** The coordinator accepts an item from a checkout of its submitted commit.*/