Skip to content

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.

feat(cli): require model labels and display names [O8,O3]

Corey Olsonc8b8ee65554e
diff --git a/bin/run-tests.js b/bin/run-tests.js
index 6d23d368..afc5850b 100644
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@ -44,6 +44,7 @@ function testEnvironment(sandbox) {
env.HOME = home;
env.USERPROFILE = home;
env.PULLBOARD_HOME = home;
+ env.PULLBOARD_MODEL = 'Test Model';
env.TMPDIR = sandbox;
env.TMP = sandbox;
env.TEMP = sandbox;
diff --git a/docs/api.md b/docs/api.md
index d003ce8f..158b6a3e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -19,10 +19,10 @@ When `add` or `edit` supplies a new nonempty check, Pullboard measures it once i
| `version` | `version:number`, `release:string` |
| `init` | `version:number`, `root:string`, `notes:array` |
| `hooks` | `version:number`, `notes:array` |
-| `join` | `version:number`, `agent:string`, `lane:string`, `route:string`, `path:string` |
-| `worktree` | `version:number`, `agent:string`, `lane:string`, `route:string`, `path:string`, `branch:string`, `prompt:string` |
+| `join` | `version:number`, `agent:string`, `lane:string`, `route:string`, `path:string`, `model:string`, `displayName:string` |
+| `worktree` | `version:number`, `agent:string`, `lane:string`, `route:string`, `path:string`, `branch:string`, `prompt:string`, `model:string`, `displayName:string` |
| `resume` | `version:number`, `me:object`, `all:array`, `requests:array`, `holding:array`, `sentBack:array`, `awaiting:array`, `toVerify:array`, `toMerge:array`, `open:array`, `stale:array`, `holds:array`, `unread:number`, `newest:array`, `root:string`, `dirty:number`, `next:string` |
-| `whoami` | `version:number`, `id:string`, `lane:string`, `path:string` |
+| `whoami` | `version:number`, `id:string`, `lane:string`, `path:string`, `model:string`, `displayName:string` |
| `lanes` | `version:number`, `lanes:object`, `shared:array`, `coordinator:string` |
| `resources` | `version:number`, `resources:array` |
| `settings` | `version:number`, `settings:object` |
@@ -85,7 +85,7 @@ When `add` or `edit` supplies a new nonempty check, Pullboard measures it once i
| `hook pre-push` | `version:number`, `messages:array` |
<!-- api-command-shapes:end -->
-`join` and `worktree` accept an optional free-text `--family` declaration. Rejoining the same worktree preserves its agent id; a supplied family updates the declaration, while omitting `--family` preserves it. `resume` includes it as `me.family`; `show` includes `item_builder_family` and each verdict's `verdict_verifier_family`. These recorded fields are `null` when the agent did not declare a family, and later declarations do not rewrite prior submissions or verdicts.
+`join` and `worktree` require a free-text `--model` label or `PULLBOARD_MODEL` environment value; labels are not inferred from a provider or family. Rejoining the same worktree preserves its agent id; a supplied model or optional `--family` updates that declaration, while omission preserves it. `pullboard.json` may set `agents.names` to `suffix` (the default, `web-1 (Claude)`) or `prefix` (`claude-web-1`). CLI `agent` fields remain stable ids; `displayName` shows the chosen style. `resume.me` and API state `agents[]` carry `model` and `displayName`; older agents with no model display `unknown`. Each event records the actor model in `event_detail.model` for a registered agent, with `unknown` for legacy agents without a declaration. `show` includes `item_builder_family` and each verdict's `verdict_verifier_family`. These family fields are `null` when the agent did not declare a family, and later declarations do not rewrite prior submissions or verdicts.
`status.reviewQueue` contains `pending`, `reviewing` (distinct agents with live review leases), `reserved`, `oldestSubmittedAt` and `ageMs`. Age starts at each outstanding item's latest submit event; reserving or renewing its review does not reset it. An empty queue has `oldestSubmittedAt: null` and `ageMs: 0`.
diff --git a/src/agent-names.js b/src/agent-names.js
new file mode 100644
index 00000000..e0c1b71c
--- /dev/null
+++ b/src/agent-names.js
@@ -0,0 +1,13 @@
+/** Slug a model label for a prefix display name without changing the stored agent id. */
+function modelSlug(model) {
+ return String(model || 'unknown').normalize('NFKD').toLowerCase()
+ .replace(/[\u0300-\u036f]/gu, '').replace(/[^a-z0-9]+/gu, '-').replace(/^-|-$/gu, '') || 'unknown';
+}
+
+/** Show an agent's stable id beside its declared model using the configured naming style. */
+export function displayAgentName(agent, style = 'suffix') {
+ const id = agent.agent_id ?? agent.id;
+ const value = agent.agent_model ?? agent.model;
+ const model = typeof value === 'string' && value.trim() ? value.trim() : 'unknown';
+ return style === 'prefix' ? `${modelSlug(model)}-${id}` : `${id} (${model})`;
+}
diff --git a/src/api.js b/src/api.js
index 582c9aca..af558d21 100644
--- a/src/api.js
+++ b/src/api.js
@@ -2,6 +2,7 @@
import { randomBytes, timingSafeEqual } from 'node:crypto';
import { createServer } from 'node:http';
import { join } from 'node:path';
+import { displayAgentName } from './agent-names.js';
import * as store from './board.js';
import { COORDINATOR, loadConfig } from './config.js';
import { repoInfo } from './git.js';
@@ -200,6 +201,12 @@ export function createLocalApiHandler({ secret, getPort, runCommand, projects =
board: (id) => findBoard(id, projects),
state: (board, who, seen) => {
let state = projectState(board.root, { seen });
+ const config = loadConfig(board.root);
+ state.agents = state.agents.map((agent) => ({
+ ...agent,
+ model: agent.agent_model ?? 'unknown',
+ displayName: displayAgentName(agent, config.agents.names),
+ }));
state.board = board.id;
const projectData = withBoard(board.root, (db) => ({
requests: store.openRequests(db),
diff --git a/src/board.js b/src/board.js
index 60db3e95..5af8ee04 100644
--- a/src/board.js
+++ b/src/board.js
@@ -356,11 +356,14 @@ export function atomic(board, work) {
* @param {object} [detail]
*/
function logEvent(board, by, kind, itemId, detail = {}) {
+ const model = agentModel(board, by);
+ const isAgent = Boolean(board.db.prepare('SELECT 1 FROM agent WHERE agent_id = ?').get(by));
+ const recorded = isAgent ? { ...detail, model: model ?? 'unknown' } : detail;
const inserted = board.db
.prepare(
'INSERT INTO event (event_at, event_by, event_kind, item_id, event_detail) VALUES (?, ?, ?, ?, ?)',
)
- .run(now(board), by, kind, itemId, JSON.stringify(detail));
+ .run(now(board), by, kind, itemId, JSON.stringify(recorded));
board.lastEvent = board.db.prepare('SELECT * FROM event WHERE event_id = ?').get(inserted.lastInsertRowid);
(board.emittedEvents ??= []).push(board.lastEvent);
}
@@ -424,7 +427,28 @@ function current(board, item) {
* @returns {any}
*/
export function agentAt(board, path) {
- return board.db.prepare('SELECT * FROM agent WHERE agent_path = ?').get(path);
+ const agent = board.db.prepare('SELECT * FROM agent WHERE agent_path = ?').get(path);
+ return withModel(board, agent);
+}
+
+/** Read the model label kept beside other board metadata, avoiding any board-schema migration. */
+function agentModel(board, id) {
+ return board.db.prepare('SELECT meta_value FROM board_meta WHERE meta_key = ?').get(`agent_model:${id}`)?.meta_value ?? null;
+}
+
+/** Attach an agent's model to a row from the legacy stable agent table. */
+function withModel(board, agent) {
+ return agent ? { ...agent, agent_model: agentModel(board, agent.agent_id) } : agent;
+}
+
+/** Save or clear a model label without changing the shared SQLite schema. */
+function saveAgentModel(board, id, model) {
+ if (model === null || model === undefined) {
+ board.db.prepare('DELETE FROM board_meta WHERE meta_key = ?').run(`agent_model:${id}`);
+ return;
+ }
+ board.db.prepare('INSERT INTO board_meta (meta_key, meta_value) VALUES (?, ?) ON CONFLICT(meta_key) DO UPDATE SET meta_value = excluded.meta_value')
+ .run(`agent_model:${id}`, model);
}
/**
@@ -432,13 +456,13 @@ export function agentAt(board, path) {
* worktree as the next agent in its lane (`web-1`, `web-2`, ...), on a route: the tier of model
* behind it, which decides the items it may take (B13). The optional family is free text supplied
* by the agent; the board neither names nor infers it. Registering again preserves the agent id;
- * an explicitly supplied family updates the declaration, while omission preserves it.
+ * explicitly supplied family and model values update their declarations, while omission preserves them.
*
* @param {any} board
- * @param {{ lane: string, path: string, route?: string, family?: string | null }} who
+ * @param {{ lane: string, path: string, route?: string, family?: string | null, model?: string | null }} who
* @returns {string} The agent's id.
*/
-export function register(board, { lane, path, route = 'strong', family }) {
+export function register(board, { lane, path, route = 'strong', family, model }) {
checkRoute(route);
if (lane === COORDINATOR && route !== 'strong') {
throw new Refused('BAD_ROUTE', 'the coordinator plans, merges and verifies; it is always strong');
@@ -456,6 +480,10 @@ export function register(board, { lane, path, route = 'strong', family }) {
board.db.prepare('UPDATE agent SET agent_family = ? WHERE agent_id = ?').run(family, existing.agent_id);
logEvent(board, existing.agent_id, 'family', null, { family });
}
+ if (model !== undefined && model !== existing.agent_model) {
+ saveAgentModel(board, existing.agent_id, model);
+ logEvent(board, existing.agent_id, 'model', null, { model: model ?? 'unknown' });
+ }
return existing.agent_id;
}
const { total } = board.db
@@ -470,6 +498,7 @@ export function register(board, { lane, path, route = 'strong', family }) {
'INSERT INTO agent (agent_id, agent_lane, agent_path, agent_route, agent_family, agent_created_at) VALUES (?, ?, ?, ?, ?, ?)',
)
.run(id, lane, path, route, family ?? null, now(board));
+ saveAgentModel(board, id, model);
logEvent(board, id, 'join', null, route === 'strong' ? { lane } : { lane, route });
return id;
});
@@ -502,7 +531,7 @@ export function ensureCoordinator(board, path) {
* @returns {any[]}
*/
export function listAgents(board) {
- return board.db.prepare('SELECT * FROM agent ORDER BY rowid').all();
+ return board.db.prepare('SELECT * FROM agent ORDER BY rowid').all().map((agent) => withModel(board, agent));
}
/**
diff --git a/src/cli.js b/src/cli.js
index ac2e81c4..46a196e7 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -10,6 +10,7 @@ import { pathToFileURL } from 'node:url';
import { parseArgs } from 'node:util';
import * as store from './board.js';
import { CONFIG_FILE, COORDINATOR, loadConfig } from './config.js';
+import { displayAgentName } from './agent-names.js';
import { loadDoctrine } from './doctrine.js';
import { requirePersonChannel } from './person.js';
import { decisionProjection, planRowApply, prepareRowDecisions, restoreRowApply, writeRowApply } from './row-decisions.js';
@@ -71,9 +72,10 @@ Nothing ships until a second agent verifies it.
Set up
pullboard tour see it work: a reject and its rework, scripted, in thirty seconds
pullboard init config, SPEC.md, agent instructions, git hooks, board
- pullboard worktree <lane> [--route light] [--family <name>] make and join a worktree for a new agent
- pullboard join <lane> [--route light] [--family <name>] register this worktree as an agent
- --route sets which work the model can take; --family records its name
+ pullboard worktree <lane> --model <name> [--route light] [--family <name>] make and join a worktree for a new agent
+ pullboard join <lane> --model <name> [--route light] [--family <name>] register this worktree as an agent
+ --model is required (or set PULLBOARD_MODEL); --family records its family
+ pullboard.json agents.names: suffix (default) or prefix
pullboard whoami | lanes | status who you are, the lanes, the board at a glance
pullboard resources local resource holders and their FIFO queues
pullboard settings [gateSlots <n>] view or set this machine's gate slots (default 2)
@@ -191,7 +193,7 @@ const HELP_GROUPS = [
];
const HELP_EXAMPLES = {
- tour: 'pullboard tour', init: 'pullboard init', worktree: 'pullboard worktree web', resume: 'pullboard resume',
+ tour: 'pullboard tour', init: 'pullboard init', worktree: 'pullboard worktree web --model "Claude Sonnet"', join: 'pullboard join web --model "Claude Sonnet"', resume: 'pullboard resume',
add: 'pullboard add web "Upload page" --specs G1', list: 'pullboard list web', show: 'pullboard show 12',
claim: 'pullboard claim 12', submit: 'pullboard submit 12', 'next --verify': 'pullboard next --verify',
verify: 'pullboard verify 12 accept --note "removed the fix; the test failed"',
@@ -234,6 +236,7 @@ const HELP_FLAG_EXPLANATIONS = {
'--brief': 'what a cold agent needs',
'--check': 'the command that proves it',
'--family': 'records the family name',
+ '--model': 'required model label, or set PULLBOARD_MODEL',
'--json': 'prints one versioned document',
'--note': 'what was checked stays with the receipt',
'--note-file': 'keeps quotes, $ and backticks intact',
@@ -398,6 +401,7 @@ const OPTIONS = {
text: { type: 'string' },
route: { type: 'string' },
family: { type: 'string' },
+ model: { type: 'string' },
as: { type: 'string' },
check: { type: 'string' },
yes: { type: 'boolean' },
@@ -517,7 +521,7 @@ function checkMainVerifier(ctx, board, values) {
}
if (values.as === COORDINATOR) return;
const agents = store.listAgents(board).filter((agent) => agent.agent_id !== COORDINATOR);
- const listed = agents.length ? ` Agent worktrees: ${agents.slice(0, 6).map((agent) => `${agent.agent_id} at ${agent.agent_path}`).join('; ')}.` : '';
+ const listed = agents.length ? ` Agent worktrees: ${agents.slice(0, 6).map((agent) => `${displayAgentName(agent, ctx.config.agents.names)} at ${agent.agent_path}`).join('; ')}.` : '';
const detached = tryGit(ctx.info.root, ['symbolic-ref', '-q', 'HEAD']).status !== 0 ? ' The main checkout is not on its branch; whoever switched it puts it back.' : '';
throw new Refused(
'MAIN_IS_COORDINATOR',
@@ -640,12 +644,21 @@ async function ordered(ctx, board, operation, args) {
: store[operation](board, ...args);
}
+/** Choose an explicitly supplied model or the standard environment fallback, refusing an unknown identity. */
+function requiredModel(value, env = process.env) {
+ const model = (value ?? env.PULLBOARD_MODEL ?? '').trim();
+ if (!model || /[\u0000-\u001f\u007f-\u009f]/u.test(model)) {
+ throw new Refused('MODEL_REQUIRED', 'give --model "<model name>" or set PULLBOARD_MODEL in this shell before joining');
+ }
+ return model;
+}
+
/**
* Who is asking: the coordinator in the main checkout, or the agent this worktree joined as.
*
* @param {any} ctx
* @param {any} board
- * @returns {{ id: string, lane: string, route?: string, family: string | null }}
+ * @returns {{ id: string, lane: string, route?: string, family: string | null, model: string | null, displayName: string }}
*/
function whoAmI(ctx, board) {
if (ctx.info.isMain) {
@@ -654,13 +667,13 @@ function whoAmI(ctx, board) {
if (linked && !registered) throw new Refused('NO_AGENT', 'the linked snapshot has no coordinator; restore a consistent relay snapshot before acting');
const id = linked ? COORDINATOR : store.ensureCoordinator(board, ctx.info.root);
const agent = registered ?? store.agentAt(board, ctx.info.root);
- return { id, lane: COORDINATOR, family: agent?.agent_family ?? null };
+ return { id, lane: COORDINATOR, family: agent?.agent_family ?? null, model: agent?.agent_model ?? 'unknown', displayName: displayAgentName(agent ?? { agent_id: id }, ctx.config.agents.names) };
}
const agent = store.agentAt(board, ctx.info.root);
if (!agent) {
throw new Refused('NOT_JOINED', 'this worktree has not joined a lane: pullboard join <lane> (see: pullboard lanes)');
}
- return { id: agent.agent_id, lane: agent.agent_lane, route: agent.agent_route, family: agent.agent_family ?? null };
+ return { id: agent.agent_id, lane: agent.agent_lane, route: agent.agent_route, family: agent.agent_family ?? null, model: agent.agent_model ?? 'unknown', displayName: displayAgentName(agent, ctx.config.agents.names) };
}
/**
@@ -726,9 +739,9 @@ function firstLineOf(note) {
* @param {any} item
* @returns {string}
*/
-function itemLine(item) {
- const holder = item.item_status === 'claimed' ? ` ${item.item_owner}` : '';
- const verifier = item.item_status === 'verified' ? ` by ${item.item_verified_by}` : '';
+function itemLine(item, name = (id) => id) {
+ const holder = item.item_status === 'claimed' ? ` ${name(item.item_owner)}` : '';
+ const verifier = item.item_status === 'verified' ? ` by ${name(item.item_verified_by)}` : '';
const specs = item.item_spec_ids ? ` [${item.item_spec_ids}]` : '';
const parent = item.item_parent_id ? ` under #${item.item_parent_id}` : '';
const after = item.item_after ? ` after ${item.item_after.split(',').map((id) => `#${id}`).join(',')}` : '';
@@ -737,6 +750,15 @@ function itemLine(item) {
return `#${item.item_id} ${item.item_status}${holder}${verifier}${rejected} ${item.item_lane} ${item.item_title}${specs}${parent}${after}${light}`;
}
+/** Format a stable agent id for human-facing CLI output. */
+function agentDisplayName(agents, config, id) {
+ if (!id) return '';
+ const agent = agents.find((entry) => entry.agent_id === id);
+ if (agent) return displayAgentName(agent, config.agents.names);
+ if (id === 'person' || id === 'all' || Object.hasOwn(config.lanes, id)) return id;
+ return displayAgentName({ agent_id: id }, config.agents.names);
+}
+
/**
* The files an agent has been working in (N20): what its latest three items touched, and what is
* uncommitted in its worktree now.
@@ -878,13 +900,15 @@ function resumeHere(io) {
holds: store.laneHolds(board),
unread: store.unreadCount(board, me.id),
newest: store.peekShouts(board, me.id, 1),
+ agents: store.listAgents(board),
};
});
const { me } = card;
+ const name = (id) => agentDisplayName(card.agents, ctx.config, id);
card.stale = staleFrozenItems(card.all, loadSpec(root, ctx.config).rows).map((item) => ({ ...item, ...staleItemFinding(item) }));
const say = (line) => io.say(line);
const plural = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`;
- say(`resume: ${me.id}${me.family ? ` (${me.family})` : ''}, ${me.lane} lane${isMain ? ', the main checkout' : ''}, at ${root}`);
+ say(`resume: ${me.displayName}${me.family ? ` [family ${me.family}]` : ''}, ${me.lane} lane${isMain ? ', the main checkout' : ''}, at ${root}`);
const dirty = dirtyFiles(root).length;
if (!isMain) {
const branch = tryGit(root, ['rev-parse', '--abbrev-ref', 'HEAD']).stdout || 'HEAD';
@@ -903,7 +927,7 @@ function resumeHere(io) {
if (files.length) say(` files: ${files.join(', ')}`);
}
for (const { item, verdict } of card.sentBack) {
- say(`sent back: #${item.item_id} ${verdict ? `${verdict.verdict_reason} by ${verdict.verdict_by}: ${firstLine(verdict.verdict_note)}` : 'rejected'}`);
+ say(`sent back: #${item.item_id} ${verdict ? `${verdict.verdict_reason} by ${name(verdict.verdict_by)}: ${firstLine(verdict.verdict_note)}` : 'rejected'}`);
}
for (const item of card.stale) say(`stale: ${item.message}; next: ${item.next}`);
if (card.awaiting.length) say(`awaiting a verdict: ${card.awaiting.map((item) => `#${item.item_id} (${span(ctx, item.item_updated_at)})`).join(', ')}`);
@@ -914,9 +938,9 @@ function resumeHere(io) {
const byLane = Object.entries(Map.groupBy(card.open, (item) => item.item_lane)).map(([lane, items]) => `${lane} ${items.length}`);
say(`open: ${card.open.length}${byLane.length ? ` (${byLane.join(', ')})` : ''}`);
} else if (card.hold) {
- say(`the ${me.lane} lane is held by ${card.hold.hold_by}: ${card.hold.hold_reason}`);
+ say(`the ${me.lane} lane is held by ${name(card.hold.hold_by)}: ${card.hold.hold_reason}`);
}
- if (card.unread) say(`${plural(card.unread, 'unread shout')}; newest from ${card.newest[0].shout_from}: ${firstLine(card.newest[0].shout_text)} (pullboard inbox reads them)`);
+ if (card.unread) say(`${plural(card.unread, 'unread shout')}; newest from ${name(card.newest[0].shout_from)}: ${firstLine(card.newest[0].shout_text)} (pullboard inbox reads them)`);
const inLane = card.open.filter((item) => item.item_lane === me.lane);
const isVerified = (id) => card.all.find((other) => other.item_id === Number(id))?.item_status === 'verified';
const ready = inLane.filter((item) => !item.item_after || item.item_after.split(',').every(isVerified)).length;
@@ -1042,12 +1066,14 @@ function setupCommands(io, { first, values }) {
throw new Refused('NO_LANE', `no lane "${first ?? ''}"; lanes: ${laneNames(ctx.config).slice(1).join(', ') || 'none yet, declare them in pullboard.json'}`);
}
const route = values.route ?? 'strong';
- const id = await withBoard(ctx, async (board) => await ordered(ctx, board, 'register', [{ lane: first, path: ctx.info.root, route, family: values.family }]));
- io.result?.({ agent: id, lane: first, route, path: ctx.info.root });
- io.say(`joined as ${id} in the ${first} lane${route === 'light' ? ', on the light route' : ''}`);
+ const model = requiredModel(values.model);
+ const id = await withBoard(ctx, async (board) => await ordered(ctx, board, 'register', [{ lane: first, path: ctx.info.root, route, family: values.family, model }]));
+ const displayName = displayAgentName({ agent_id: id, agent_model: model }, ctx.config.agents.names);
+ io.result?.({ agent: id, lane: first, route, path: ctx.info.root, model, displayName });
+ io.say(`joined as ${displayName} in the ${first} lane${route === 'light' ? ', on the light route' : ''}`);
return 0;
},
- worktree: () => worktreeFor(io, first, values.route ?? 'strong', values.family ?? null),
+ worktree: () => worktreeFor(io, first, values.route ?? 'strong', values.family ?? null, values.model),
};
}
@@ -1059,9 +1085,10 @@ function setupCommands(io, { first, values }) {
* @param {string | undefined} lane
* @param {string} route
* @param {string | null} family
+ * @param {string | undefined} model
* @returns {Promise<number>}
*/
-async function worktreeFor(io, lane, route, family = null) {
+async function worktreeFor(io, lane, route, family = null, model) {
const ctx = context(io);
if (!lane || lane === COORDINATOR || !isLane(ctx.config, lane)) {
throw new Refused('NO_LANE', `no lane "${lane ?? ''}"; lanes: ${laneNames(ctx.config).slice(1).join(', ') || 'none yet, declare them in pullboard.json'}`);
@@ -1069,6 +1096,7 @@ async function worktreeFor(io, lane, route, family = null) {
if (!store.ROUTES.includes(route)) {
throw new Refused('BAD_ROUTE', `route "${route}" is strong (needs a frontier model) or light (any model can build it from the brief)`);
}
+ model = requiredModel(model);
const mainRoot = resolve(ctx.info.commonDir, '..');
refuseUncommittedSetup(mainRoot, ctx.config);
const pathFor = (n) => join(dirname(mainRoot), `${basename(mainRoot)}-${lane}-${n}`);
@@ -1078,7 +1106,7 @@ async function worktreeFor(io, lane, route, family = null) {
git(mainRoot, ['worktree', 'add', '-q', '-b', `${lane}/${n}`, pathFor(n), git(mainRoot, ['rev-parse', 'HEAD'])]);
const root = git(pathFor(n), ['rev-parse', '--show-toplevel']);
let id;
- try { id = await withBoard(ctx, async (board) => await ordered(ctx, board, 'register', [{ lane, path: root, route, family }])); }
+ try { id = await withBoard(ctx, async (board) => await ordered(ctx, board, 'register', [{ lane, path: root, route, family, model }])); }
catch (error) {
// Only remove the clean worktree just created here; preserve it if another process changed it.
const removed = tryGit(mainRoot, ['worktree', 'remove', root]);
@@ -1086,15 +1114,19 @@ async function worktreeFor(io, lane, route, family = null) {
else io.err(`pullboard: registration failed; the changed worktree was preserved at ${root}`);
throw error;
}
- io.result?.({ agent: id, lane, route, path: root, branch: `${lane}/${n}`, prompt: `You are ${id}, in the ${lane} lane. Work only in ${shellWord(root)}, and start every command with ${cdTo(root)}\nRead ${shellWord(join(root, 'AGENTS.md'))} first. Its rules govern this work, over any other repo's instructions you were given.` });
- io.say(`made ${root} on branch ${lane}/${n}, joined as ${id} in the ${lane} lane${route === 'light' ? ', on the light route' : ''}${family ? ` (${family})` : ''}`);
+ const displayName = displayAgentName({ agent_id: id, agent_model: model }, ctx.config.agents.names);
+ const modelWord = shellWord(model);
+ const prompt = `You are ${displayName}, in the ${lane} lane. Work only in ${shellWord(root)}, and start every command with ${cdTo(root)}\nModel: ${modelWord}. This worktree joined with --model ${modelWord}. For another worktree using the same model, pass --model ${modelWord} or set PULLBOARD_MODEL=${modelWord}; for a different agent, use that agent's actual model label.\nRead ${shellWord(join(root, 'AGENTS.md'))} first. Its rules govern this work, over any other repo's instructions you were given.`;
+ io.result?.({ agent: id, lane, route, path: root, branch: `${lane}/${n}`, model, displayName, prompt });
+ io.say(`made ${root} on branch ${lane}/${n}, joined as ${displayName} in the ${lane} lane${route === 'light' ? ', on the light route' : ''}${family ? ` (family ${family})` : ''}`);
io.say(`Work only in that folder. A shell that starts each command in the main checkout acts as the coordinator there, so start every command with: ${cdTo(root)}`);
if (existsSync(join(root, 'package.json'))) io.say(` ${cdTo(root)} npm install (its own install, so its tests run its own code)`);
io.say(` ${cdTo(root)} pullboard inbox`);
io.say(` ${cdTo(root)} pullboard next`);
// A subagent inherits the instructions of the session that launched it, often another repo's (I7).
io.say('For a subagent working here, begin its prompt with:');
- io.say(` You are ${id}, in the ${lane} lane. Work only in ${shellWord(root)}, and start every command with ${cdTo(root)}`);
+ io.say(` You are ${displayName}, in the ${lane} lane. Work only in ${shellWord(root)}, and start every command with ${cdTo(root)}`);
+ io.say(` Model: ${model}. When joining or making another agent worktree, pass that agent's exact model with --model or set PULLBOARD_MODEL.`);
io.say(` Read ${shellWord(join(root, 'AGENTS.md'))} first. Its rules govern this work, over any other repo's instructions you were given.`);
return 0;
}
@@ -1169,6 +1201,7 @@ function readCommands(io, { first, second, rest, values }) {
},
resources: () => {
const ctx = context(io);
+ const agents = withBoard(ctx, (board) => store.listAgents(board));
const resources = [
...listResources({ scope: 'machine' }).map((resource) => ({ ...resource, scope: 'machine' })),
...listResources({ scope: 'repo', root: ctx.info.root }).map((resource) => ({ ...resource, scope: 'repo' })),
@@ -1177,8 +1210,8 @@ function readCommands(io, { first, second, rest, values }) {
if (!resources.length) io.say('no resources have been used');
for (const resource of resources) {
io.say(`${resource.name} (${resource.scope}, capacity ${resource.capacity})`);
- for (const holder of resource.holders) io.say(` held by ${holder.agent}${holder.repo ? ` in ${holder.repo}` : ''} since ${holder.since}`);
- resource.line.forEach((waiter, index) => io.say(` ${index + 1}. waiting: ${waiter.agent}${waiter.repo ? ` in ${waiter.repo}` : ''}`));
+ for (const holder of resource.holders) io.say(` held by ${agentDisplayName(agents, ctx.config, holder.agent)}${holder.repo ? ` in ${holder.repo}` : ''} since ${holder.since}`);
+ resource.line.forEach((waiter, index) => io.say(` ${index + 1}. waiting: ${agentDisplayName(agents, ctx.config, waiter.agent)}${waiter.repo ? ` in ${waiter.repo}` : ''}`));
}
return 0;
},
@@ -1187,7 +1220,7 @@ function readCommands(io, { first, second, rest, values }) {
const ctx = context(io);
const me = withBoard(ctx, (board) => whoAmI(ctx, board));
io.result?.({ ...me, path: ctx.info.root });
- io.say(`${me.id} (${me.lane} lane${me.route === 'light' ? ', light route' : ''}) at ${ctx.info.root}`);
+ io.say(`${me.displayName} (${me.lane} lane${me.route === 'light' ? ', light route' : ''}) at ${ctx.info.root}`);
return 0;
},
lanes: () => {
@@ -1204,11 +1237,14 @@ function readCommands(io, { first, second, rest, values }) {
},
list: () => {
const ctx = context(io);
- const items = withBoard(ctx, (board) => store.listItems(board, { lane: first, all: values.all }))
- .filter((item) => !values.route || item.item_route === values.route);
- if (values.json) io.result({ items });
- else if (!items.length) io.say(values.all ? 'no items yet' : 'nothing open; --all shows closed items');
- else items.forEach((item) => io.say(itemLine(item)));
+ const { items, agents } = withBoard(ctx, (board) => ({
+ items: store.listItems(board, { lane: first, all: values.all }),
+ agents: store.listAgents(board),
+ }));
+ const filtered = items.filter((item) => !values.route || item.item_route === values.route);
+ if (values.json) io.result({ items: filtered });
+ else if (!filtered.length) io.say(values.all ? 'no items yet' : 'nothing open; --all shows closed items');
+ else filtered.forEach((item) => io.say(itemLine(item, (id) => agentDisplayName(agents, ctx.config, id))));
return 0;
},
roadmap: () => {
@@ -1230,18 +1266,20 @@ function readCommands(io, { first, second, rest, values }) {
show: () => {
const ctx = context(io);
const id = idArg(first);
- const { item, verdicts, moves, related, reviewer } = withBoard(ctx, (board) => ({
+ const { item, verdicts, moves, related, reviewer, agents } = withBoard(ctx, (board) => ({
item: store.getItem(board, id),
verdicts: store.verdictsFor(board, id),
moves: store.events(board, { itemId: id }).filter((event) => ['attempt', 'escalate'].includes(event.event_kind)),
related: store.relatedItems(board, store.getItem(board, id)),
reviewer: store.reviewHolder(board, store.getItem(board, id)),
+ agents: store.listAgents(board),
}));
+ const agentName = (id) => displayAgentName(agents.find((agent) => agent.agent_id === id) ?? { agent_id: id }, ctx.config.agents.names);
if (values.json) {
io.result({ ...item, verdicts });
return 0;
}
- io.say(itemLine(item));
+ io.say(itemLine(item, agentName));
if (item.item_criterion) io.say(`criterion: ${item.item_criterion}`);
if (item.item_check) io.say(`check: ${item.item_check}`);
sayCheckBaseline(io, item);
@@ -1253,18 +1291,18 @@ function readCommands(io, { first, second, rest, values }) {
if (attempts.length) io.say(`unattended attempts: ${attempts.join(', ')}`);
for (const event of moves.filter((entry) => entry.event_kind === 'escalate')) {
const detail = JSON.parse(event.event_detail);
- io.say(`escalated ${detail.from} -> ${detail.to} by ${event.event_by}${detail.attempt ? `, pinned at ${detail.attempt}` : ''}: ${detail.note.split('\n')[0]}`);
+ io.say(`escalated ${detail.from} -> ${detail.to} by ${agentName(event.event_by)}${detail.attempt ? `, pinned at ${detail.attempt}` : ''}: ${detail.note.split('\n')[0]}`);
}
if (item.item_frozen) {
const frozen = JSON.parse(item.item_frozen);
io.say(`frozen at claim (${item.item_frozen_digest.slice(0, 12)}):`);
frozen.rows.forEach((row) => io.say(` ${row.id}: ${row.text}${row.gate ? ` | gate: ${row.gate}` : ''}`));
}
- if (item.item_commit) io.say(`submitted by ${item.item_built_by}${item.item_builder_family ? ` (${item.item_builder_family})` : ''} at ${item.item_commit}`);
- if (reviewer) io.say(`under review by ${reviewer} until ${item.item_review_until}`);
+ if (item.item_commit) io.say(`submitted by ${agentName(item.item_built_by)}${item.item_builder_family ? ` [family ${item.item_builder_family}]` : ''} at ${item.item_commit}`);
+ if (reviewer) io.say(`under review by ${agentName(reviewer)} until ${item.item_review_until}`);
// Earlier verdicts as one line each, so an item sent back several times stays short to read
// (N30); --history prints every note in full.
- const verdictLine = (verdict) => `${verdict.verdict_decision} ${verdict.verdict_reason} by ${verdict.verdict_by}${verdict.verdict_verifier_family ? ` (${verdict.verdict_verifier_family})` : ''} at ${verdict.verdict_commit.slice(0, 12)}`;
+ const verdictLine = (verdict) => `${verdict.verdict_decision} ${verdict.verdict_reason} by ${agentName(verdict.verdict_by)}${verdict.verdict_verifier_family ? ` [family ${verdict.verdict_verifier_family}]` : ''} at ${verdict.verdict_commit.slice(0, 12)}`;
const notes = verdicts.map((verdict, index) => (values.history || index === verdicts.length - 1 ? verdict.verdict_note : firstLineOf(verdict.verdict_note)));
verdicts.forEach((verdict, index) => io.say(`${verdictLine(verdict)}${notes[index] ? `: ${notes[index]}` : ''}`));
if (notes.some((note, index) => note !== verdicts[index].verdict_note)) io.say(`(earlier verdicts shortened; every note in full: pullboard show ${id} --history)`);
@@ -1285,7 +1323,7 @@ function readCommands(io, { first, second, rest, values }) {
}
if (summary.relay.linked) io.say(`relay: sequence ${summary.relay.sequence}; ${summary.relay.behind} pending uploads`);
const { items, accepted, rejected } = summary.stats;
- io.say(`${summary.me.id}: ${summary.unread} unread shouts; holding ${summary.mine.map((item) => `#${item.item_id}`).join(', ') || 'nothing'}`);
+ io.say(`${summary.me.displayName}: ${summary.unread} unread shouts; holding ${summary.mine.map((item) => `#${item.item_id}`).join(', ') || 'nothing'}`);
io.say(`board: ${items.open} open, ${items.claimed} claimed, ${items.submitted} awaiting verification, ${items.verified} verified, ${items.withdrawn} withdrawn`);
io.say(`verdicts: ${accepted} accepted, ${rejected} rejected`);
io.say(reviewQueueLine(ctx, summary.reviewQueue));
@@ -1315,34 +1353,40 @@ function readCommands(io, { first, second, rest, values }) {
},
inbox: () => {
const ctx = context(io);
- const shouts = withBoard(ctx, (board) => store.inbox(board, whoAmI(ctx, board).id));
+ const { shouts, agents } = withBoard(ctx, (board) => ({
+ shouts: store.inbox(board, whoAmI(ctx, board).id),
+ agents: store.listAgents(board),
+ }));
io.result?.({ shouts });
if (!shouts.length) io.say('no new shouts');
for (const shout of shouts) {
const ask = shout.shout_decision ? `asks for a decision (#${shout.shout_id}; pullboard answer ${shout.shout_id} "..."): ` : '';
const reply = shout.shout_answers ? `answers #${shout.shout_answers}: ` : '';
- io.say(`${shout.shout_at.slice(0, 16)} ${shout.shout_from} -> ${shout.shout_to}: ${ask}${reply}${shout.shout_text}`);
+ const from = agentDisplayName(agents, ctx.config, shout.shout_from);
+ const to = agentDisplayName(agents, ctx.config, shout.shout_to);
+ io.say(`${shout.shout_at.slice(0, 16)} ${from} -> ${to}: ${ask}${reply}${shout.shout_text}`);
if (shout.shout_evidence_kind) io.say(` ${evidenceLine(shout)}`);
}
return 0;
},
decisions: () => {
const ctx = context(io);
- const asks = withBoard(ctx, (board) => {
+ const { asks, agents } = withBoard(ctx, (board) => {
const me = whoAmI(ctx, board);
const asPerson = personMode(ctx, me, values);
- return store.openDecisions(board, asPerson ? 'person' : [me.id, me.lane]);
+ return { asks: store.openDecisions(board, asPerson ? 'person' : [me.id, me.lane]), agents: store.listAgents(board) };
});
io.result?.({ decisions: asks });
if (!asks.length) io.say('no open decisions');
- for (const ask of asks) io.say(`#${ask.shout_id} ${ask.shout_from} -> ${ask.shout_to}, ${span(ctx, ask.shout_at)} ago: ${firstLine(ask.shout_text)}`);
+ for (const ask of asks) io.say(`#${ask.shout_id} ${agentDisplayName(agents, ctx.config, ask.shout_from)} -> ${agentDisplayName(agents, ctx.config, ask.shout_to)}, ${span(ctx, ask.shout_at)} ago: ${firstLine(ask.shout_text)}`);
return 0;
},
ledger: () => {
const ctx = context(io);
- const { items, stats } = withBoard(ctx, (board) => ({
+ const { items, stats, agents } = withBoard(ctx, (board) => ({
items: store.listItems(board, { all: true }),
stats: store.stats(board),
+ agents: store.listAgents(board),
}));
const built = items.filter((item) => item.item_built_by && item.item_status !== 'withdrawn').reverse();
io.result?.({ items: built, stats });
@@ -1352,16 +1396,16 @@ function readCommands(io, { first, second, rest, values }) {
io.say('| # | Lane | Item | Spec | Built by | Verified by | Commit | Merged |');
io.say('| --- | --- | --- | --- | --- | --- | --- | --- |');
for (const item of built) {
- io.say(`| ${item.item_id} | ${item.item_lane} | ${cell(item.item_title)} | ${cell(item.item_spec_ids)} | ${item.item_built_by} | ${item.item_verified_by ?? ''} | ${(item.item_commit ?? '').slice(0, 12)} | ${(item.item_merged_commit ?? '').slice(0, 12)} |`);
+ io.say(`| ${item.item_id} | ${item.item_lane} | ${cell(item.item_title)} | ${cell(item.item_spec_ids)} | ${agentDisplayName(agents, ctx.config, item.item_built_by)} | ${agentDisplayName(agents, ctx.config, item.item_verified_by)} | ${(item.item_commit ?? '').slice(0, 12)} | ${(item.item_merged_commit ?? '').slice(0, 12)} |`);
}
return 0;
},
log: () => {
const ctx = context(io);
const itemId = first ? idArg(first) : undefined;
- const rows = withBoard(ctx, (board) => store.events(board, { itemId }));
+ const { rows, agents } = withBoard(ctx, (board) => ({ rows: store.events(board, { itemId }), agents: store.listAgents(board) }));
io.result?.({ events: rows });
- rows.forEach((event) => io.say(`${event.event_at.slice(0, 19)} ${event.event_by.padEnd(14)} ${event.event_kind.padEnd(9)} ${event.item_id ? `#${event.item_id}` : ''} ${event.event_detail === '{}' ? '' : event.event_detail}`.trimEnd()));
+ rows.forEach((event) => io.say(`${event.event_at.slice(0, 19)} ${agentDisplayName(agents, ctx.config, event.event_by).padEnd(24)} ${event.event_kind.padEnd(9)} ${event.item_id ? `#${event.item_id}` : ''} ${event.event_detail === '{}' ? '' : event.event_detail}`.trimEnd()));
return 0;
},
};
@@ -1547,7 +1591,8 @@ function sayReviewOffer(ctx, found) {
const offer = { item: found.item.item_id, command, queue: found.offer.queue, ratio: found.offer.ratio };
ctx.io.result?.({ item: found.item, review: true, held: false, shared: [], offer, build: found.build });
ctx.io.say(`${reviewQueueLine(ctx, offer.queue)}; ratio ${offer.ratio} reached (zero active reviewers counts as one)`);
- ctx.io.say(`review offered: #${found.item.item_id} ${found.item.item_title}, built by ${found.item.item_built_by}; reserve it explicitly: ${command}`);
+ const agents = withBoard(ctx, (board) => store.listAgents(board));
+ ctx.io.say(`review offered: #${found.item.item_id} ${found.item.item_title}, built by ${agentDisplayName(agents, ctx.config, found.item.item_built_by)}; reserve it explicitly: ${command}`);
if (found.build) ctx.io.say(`build available: #${found.build.item_id} ${found.build.item_title}; claim it explicitly: pullboard next --build`);
else ctx.io.say('no build is currently free in your lane; this review is available');
}
@@ -1577,12 +1622,13 @@ async function nextHere(io, values) {
if (found.item) {
if (found.offer) { sayReviewOffer(ctx, found); return 0; }
const item = found.item;
+ const agents = withBoard(ctx, (board) => store.listAgents(board));
io.result?.({ item, review: Boolean(values.verify), held: Boolean(found.held), shared: found.shared ?? [] });
const here = cdTo(ctx.info.root);
const as = ctx.info.isMain ? ' --as coordinator' : '';
if (values.verify) {
sayCheckBaseline(io, item);
- io.say(`next to verify: #${item.item_id} ${item.item_title}, built by ${item.item_built_by} at ${item.item_commit.slice(0, 12)}`);
+ io.say(`next to verify: #${item.item_id} ${item.item_title}, built by ${agentDisplayName(agents, ctx.config, item.item_built_by)} at ${item.item_commit.slice(0, 12)}`);
io.say(`reserved for you until ${item.item_review_until}: another agent's verdict on it is refused until then; pullboard next --verify again renews it`);
io.say(`check out exactly that commit, here: ${here} git switch --detach ${item.item_commit}`);
io.say(`then: ${here} pullboard verify ${item.item_id} accept${as} --note "how you proved it", or reject${as} --reason CODE --note "what failed"`);
@@ -1872,7 +1918,9 @@ function workCommands(io, args) {
const text = [hasRecipient ? second : first, ...(hasRecipient ? rest : [second, ...rest])].filter(Boolean).join(' ');
const id = await ordered(ctx, board, 'shout', [{ from: me.id, to, text, lanes: laneNames(ctx.config), decision: Boolean(values.decision), evidence }]);
io.result?.({ id, decision: Boolean(values.decision) });
- io.say(values.decision ? `asked ${to} for a decision as #${id}; it stays open until someone runs: pullboard answer ${id} "<the decision>"` : `shouted to ${to}`);
+ const agents = store.listAgents(board);
+ const recipient = agents.some((agent) => agent.agent_id === to) ? agentDisplayName(agents, ctx.config, to) : to;
+ io.say(values.decision ? `asked ${recipient} for a decision as #${id}; it stays open until someone runs: pullboard answer ${id} "<the decision>"` : `shouted to ${recipient}`);
return 0;
}),
answer: () => act(async (ctx, board, me) => {
@@ -1883,9 +1931,9 @@ function workCommands(io, args) {
io.result?.({ id, answers: ask.shout_id });
if (asPerson) {
const originalAsker = ask.shout_answers === null ? ask.shout_from : store.getShout(board, ask.shout_answers).shout_from;
- io.say(`person answered #${ask.shout_id}; notified ${originalAsker} as #${id}`);
+ io.say(`person answered #${ask.shout_id}; notified ${agentDisplayName(store.listAgents(board), ctx.config, originalAsker)} as #${id}`);
} else {
- io.say(`answered #${ask.shout_id} to ${ask.shout_from} as #${id}`);
+ io.say(`answered #${ask.shout_id} to ${agentDisplayName(store.listAgents(board), ctx.config, ask.shout_from)} as #${id}`);
}
return 0;
}),
diff --git a/src/config.js b/src/config.js
index 98a5a8a9..14f81601 100644
--- a/src/config.js
+++ b/src/config.js
@@ -39,6 +39,7 @@ export function defaults() {
lease: '2h',
reviewLease: '30m',
verify: { policy: 'any', family: 'off', reviewRatio: 3 },
+ agents: { names: 'suffix' },
lanes: {},
products: {},
shared: [],
@@ -89,6 +90,7 @@ function merge(base, raw) {
verify: typeof raw.verify === 'string'
? { ...base.verify, policy: raw.verify }
: { ...base.verify, ...(raw.verify ?? {}) },
+ agents: { ...base.agents, ...(raw.agents ?? {}) },
};
}
@@ -152,6 +154,11 @@ export function configProblems(config) {
if (!Number.isFinite(config.verify?.reviewRatio) || config.verify.reviewRatio <= 0) {
problems.push('"verify.reviewRatio" is a positive number, such as 3');
}
+ if (typeof config.agents !== 'object' || config.agents === null || Array.isArray(config.agents)) {
+ problems.push('"agents" is an object with a names option');
+ } else if (!['suffix', 'prefix'].includes(config.agents.names)) {
+ problems.push('"agents.names" is "suffix" or "prefix"');
+ }
if (!isStringList(config.shared)) problems.push('"shared" is a list of path prefixes');
const isFixer = (fixer) => typeof fixer?.run === 'string' && fixer.run.trim() && (fixer.files === undefined || isStringList(fixer.files));
if (!Array.isArray(config.fix) || !config.fix.every(isFixer)) {
diff --git a/src/json.js b/src/json.js
index a61589e7..40a16736 100644
--- a/src/json.js
+++ b/src/json.js
@@ -13,10 +13,10 @@ export const JSON_SHAPES = {
version: shape({ release: 'string' }),
init: shape({ root: 'string', notes: 'array' }),
hooks: shape({ notes: 'array' }),
- join: shape({ agent: 'string', lane: 'string', route: 'string', path: 'string' }),
- worktree: shape({ agent: 'string', lane: 'string', route: 'string', path: 'string', branch: 'string', prompt: 'string' }),
+ join: shape({ agent: 'string', lane: 'string', route: 'string', path: 'string', model: 'string', displayName: 'string' }),
+ worktree: shape({ agent: 'string', lane: 'string', route: 'string', path: 'string', branch: 'string', prompt: 'string', model: 'string', displayName: 'string' }),
resume: shape({ me: 'object', all: 'array', requests: 'array', holding: 'array', sentBack: 'array', awaiting: 'array', toVerify: 'array', toMerge: 'array', open: 'array', stale: 'array', holds: 'array', unread: 'number', newest: 'array', root: 'string', dirty: 'number', next: 'string' }),
- whoami: shape({ id: 'string', lane: 'string', path: 'string' }),
+ whoami: shape({ id: 'string', lane: 'string', path: 'string', model: 'string', displayName: 'string' }),
lanes: shape({ lanes: 'object', shared: 'array', coordinator: 'string' }),
resources: shape({ resources: 'array' }),
settings: shape({ settings: 'object' }),
diff --git a/src/templates.js b/src/templates.js
index 387ac9e6..5ec2d5c7 100644
--- a/src/templates.js
+++ b/src/templates.js
@@ -21,6 +21,7 @@ export function configTemplate(gate, fix = []) {
spec: 'SPEC.md',
practice: 'PRACTICE.md',
verify: { policy: 'any', family: 'off' },
+ agents: { names: 'suffix' },
lease: '2h',
lanes: { review: { owns: [], starts: 'any time: verifiers check submitted work and own no folders' } },
shared: [],
@@ -104,9 +105,9 @@ ${doctrineText(doctrine)}
**Who you are.** An agent is its worktree. The main checkout is the coordinator. Every other agent gets its own worktree, already joined to one lane, from the main checkout:
- pullboard worktree <lane>
+ pullboard worktree <lane> --model "<model name>"
-It prints the folder to work in and what to run there first. A smaller model joins with \`--route light\` or \`--route mid\` and takes items at its tier and below. Work only in that folder. Your shell may start every command in the main checkout, where pullboard takes you for the coordinator, so begin each command with \`cd <your worktree> &&\`. Verifiers take the \`review\` lane, which owns no folders. Keep your worktree and branch until your items are merged.
+It prints the folder to work in and what to run there first. Every join needs the exact model label, either with \`--model\` or the \`PULLBOARD_MODEL\` environment variable; family is separate and never supplies the model. A smaller model joins with \`--route light\` or \`--route mid\` and takes items at its tier and below. Work only in that folder. Your shell may start every command in the main checkout, where pullboard takes you for the coordinator, so begin each command with \`cd <your worktree> &&\`. Verifiers take the \`review\` lane, which owns no folders. Keep your worktree and branch until your items are merged.
**The loop.**
1. \`pullboard resume\` at the start of every session and after your context is compacted: your claim, what came back, unread shouts and the next step. Then \`pullboard inbox\`.
diff --git a/test/api.test.js b/test/api.test.js
index a1a9cb49..02fa6561 100644
--- a/test/api.test.js
+++ b/test/api.test.js
@@ -39,6 +39,40 @@ test('[A5] append-only event records expose format version one', () => {
assert.equal(EVENT_LOG_VERSION, 1);
});
+test('[O8] authenticated API state exposes model labels and configured stable display names', async (t) => {
+ const box = project();
+ const created = box.run(box.repo, 'worktree', 'app', '--model', 'Claude Sonnet', '--json');
+ assert.equal(created.status, 0, created.stderr || created.stdout);
+ const createdAgent = JSON.parse(created.stdout);
+ assert.equal(createdAgent.agent, 'app-1');
+ assert.equal(createdAgent.model, 'Claude Sonnet');
+ const api = await startApi(t, box);
+ const boards = await (await apiFetch(api, '/api/v1/boards')).json();
+ const board = boards.boards.find((entry) => entry.root === box.repo);
+ assert.ok(board?.id);
+ const stateUrl = `/api/v1/boards/${board.id}/state`;
+ const suffixResponse = await apiFetch(api, stateUrl);
+ assert.equal(suffixResponse.status, 200);
+ const suffix = (await suffixResponse.json()).state.agents;
+ const suffixAgent = suffix.find((agent) => agent.agent_id === 'app-1');
+ assert.equal(suffixAgent.model, 'Claude Sonnet');
+ assert.equal(suffixAgent.displayName, 'app-1 (Claude Sonnet)');
+ const legacy = suffix.find((agent) => agent.agent_id === 'coordinator');
+ assert.equal(legacy.model, 'unknown');
+ assert.equal(legacy.displayName, 'coordinator (unknown)');
+
+ const configFile = join(box.repo, 'pullboard.json');
+ const config = JSON.parse(readFileSync(configFile, 'utf8'));
+ config.agents = { names: 'prefix' };
+ writeFileSync(configFile, `${JSON.stringify(config, null, 2)}\n`);
+ const prefixResponse = await apiFetch(api, stateUrl);
+ assert.equal(prefixResponse.status, 200);
+ const prefix = (await prefixResponse.json()).state.agents;
+ assert.equal(prefix.find((agent) => agent.agent_id === 'app-1').agent_id, 'app-1', 'display styles do not change stable ids');
+ assert.equal(prefix.find((agent) => agent.agent_id === 'app-1').displayName, 'claude-sonnet-app-1');
+ assert.equal(prefix.find((agent) => agent.agent_id === 'coordinator').displayName, 'unknown-coordinator');
+});
+
/** Quote a literal executable path for the fixture hook's POSIX shim. */
function shellWord(value) {
return "'" + value.replace(/'/g, "'\\''") + "'";
diff --git a/test/board.test.js b/test/board.test.js
index 582d933f..00b5442d 100644
--- a/test/board.test.js
+++ b/test/board.test.js
@@ -9,6 +9,8 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { beforeEach, test } from 'node:test';
import * as store from '../src/board.js';
+import { displayAgentName } from '../src/agent-names.js';
+import { projectState } from '../src/serve.js';
import { applyEngineMove, prepareEngineMove } from '../src/engine.js';
import { exportBoard } from '../src/exchange.js';
import { main } from '../src/cli.js';
@@ -123,6 +125,28 @@ test('agents are numbered per lane; one coordinator; a worktree joins once', ()
assert.throws(() => store.register(board, { lane: 'coordinator', path: '/elsewhere' }), /ONE_COORDINATOR/);
});
+test('[O8] model labels follow stable agent ids into moves and configured display names', () => {
+ const id = store.register(board, { lane: 'api', path: '/repo-api-2', model: 'gpt-6-luna' });
+ assert.equal(id, 'api-2');
+ assert.equal(store.agentAt(board, '/repo-api-2').agent_model, 'gpt-6-luna');
+ assert.equal(displayAgentName(store.agentAt(board, '/repo-api-2')), 'api-2 (gpt-6-luna)');
+ assert.equal(displayAgentName(store.agentAt(board, '/repo-api-2'), 'prefix'), 'gpt-6-luna-api-2');
+ assert.equal(displayAgentName(store.agentAt(board, '/repo-web-1')), 'web-1 (unknown)');
+ assert.equal(displayAgentName(store.agentAt(board, '/repo-web-1'), 'prefix'), 'unknown-web-1');
+ const id2 = store.register(board, { lane: 'api', path: '/repo-api-2' });
+ assert.equal(id2, id, 'omitting model on a repeat registration preserves it and the stable id');
+ const joined = store.events(board).find((event) => event.event_kind === 'join' && event.event_by === id);
+ assert.equal(JSON.parse(joined.event_detail).model, 'gpt-6-luna');
+ store.addItem(board, { by: 'coordinator', lane: 'api', title: 'Model event' });
+ store.claim(board, 1, { agentId: id, lane: 'api', leaseMs: HOUR, freeze });
+ const claim = store.events(board, { itemId: 1 }).find((event) => event.event_kind === 'claim');
+ assert.equal(JSON.parse(claim.event_detail).model, 'gpt-6-luna', 'moves retain the declared model in their event receipt');
+ const legacyItem = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Legacy model' });
+ store.claim(board, legacyItem, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze });
+ const legacyClaim = store.events(board, { itemId: legacyItem }).find((event) => event.event_kind === 'claim');
+ assert.equal(JSON.parse(legacyClaim.event_detail).model, 'unknown', 'moves by older agents record their missing model explicitly');
+});
+
test('the coordinator follows the main checkout when the repo moves', () => {
assert.equal(store.ensureCoordinator(board, '/moved/repo'), 'coordinator');
assert.equal(store.agentAt(board, '/moved/repo').agent_id, 'coordinator');
@@ -783,10 +807,22 @@ test('[O3] declared families travel from join through submit and verdict, and ab
git(repo, 'add', '-A');
git(repo, 'commit', '-q', '-m', 'chore: initialize family test');
+ const savedWorktreeModel = process.env.PULLBOARD_MODEL;
+ delete process.env.PULLBOARD_MODEL;
+ let missingWorktreeModel;
+ try { missingWorktreeModel = await runMain(repo, ['worktree', 'web', '--json']); }
+ finally { if (savedWorktreeModel === undefined) delete process.env.PULLBOARD_MODEL; else process.env.PULLBOARD_MODEL = savedWorktreeModel; }
+ assert.equal(missingWorktreeModel.code, 1);
+ assert.equal(JSON.parse(missingWorktreeModel.stdout).error.code, 'MODEL_REQUIRED', 'worktree without a flag or model environment refuses');
const made = await runMain(repo, ['worktree', 'web', '--family', 'Family Alpha', '--json']);
assert.equal(made.code, 0, made.stderr || made.stdout);
const worktree = JSON.parse(made.stdout);
assertJsonShape(worktree, 'worktree');
+ assert.equal(worktree.agent, 'web-1', 'the model never changes the stable id');
+ assert.equal(worktree.model, 'Test Model');
+ assert.equal(worktree.displayName, 'web-1 (Test Model)');
+ assert.match(worktree.prompt, /Model: 'Test Model'\./);
+ assert.match(worktree.prompt, /pass --model 'Test Model' or set PULLBOARD_MODEL='Test Model'/);
const builderPath = worktree.path;
const reviewerPath = join(directory, 'reviewer');
git(repo, 'worktree', 'add', '-q', '-b', 'review/one', reviewerPath, 'main');
@@ -795,9 +831,18 @@ test('[O3] declared families travel from join through submit and verdict, and ab
assert.equal(joined.code, 0, joined.stderr || joined.stdout);
const joinResult = JSON.parse(joined.stdout);
assertJsonShape(joinResult, 'join');
+ assert.equal(joinResult.model, 'Test Model');
+ assert.equal(joinResult.displayName, 'review-1 (Test Model)');
const noFamilyPath = join(directory, 'no-family');
git(repo, 'worktree', 'add', '-q', '-b', 'web/two', noFamilyPath, 'main');
const noFamilyRoot = git(noFamilyPath, 'rev-parse', '--show-toplevel');
+ const savedModel = process.env.PULLBOARD_MODEL;
+ delete process.env.PULLBOARD_MODEL;
+ let missingModel;
+ try { missingModel = await runMain(noFamilyRoot, ['join', 'web', '--json']); }
+ finally { if (savedModel === undefined) delete process.env.PULLBOARD_MODEL; else process.env.PULLBOARD_MODEL = savedModel; }
+ assert.equal(missingModel.code, 1);
+ assert.equal(JSON.parse(missingModel.stdout).error.code, 'MODEL_REQUIRED', 'join without a flag or model environment refuses');
const joinedWithout = await runMain(noFamilyRoot, ['join', 'web']);
assert.equal(joinedWithout.code, 0, joinedWithout.stderr || joinedWithout.stdout);
@@ -807,11 +852,16 @@ test('[O3] declared families travel from join through submit and verdict, and ab
assert.equal(store.agentAt(persistent, builderPath).agent_family, 'Family Alpha');
assert.equal(store.agentAt(persistent, reviewerRoot).agent_family, 'Family Beta');
assert.equal(store.agentAt(persistent, noFamilyRoot).agent_family, null);
+ assert.equal(store.agentAt(persistent, noFamilyRoot).agent_model, 'Test Model');
+ const apiState = projectState(repo);
+ assert.equal(apiState.agents.find((agent) => agent.agent_id === 'web-1').agent_model, 'Test Model');
store.register(persistent, { lane: 'coordinator', path: repo });
+ const stateWithCoordinator = projectState(repo);
+ assert.equal(stateWithCoordinator.agents.find((agent) => agent.agent_id === 'coordinator').agent_model, null);
assert.equal(store.agentAt(persistent, repo).agent_family, null, 'the core supplies no family for itself');
store.register(persistent, { lane: 'coordinator', path: repo, family: 'Family Coordinator' });
const coordinatorResume = await runMain(repo, ['resume']);
- assert.match(coordinatorResume.stdout, /resume: coordinator \(Family Coordinator\), coordinator lane/);
+ assert.match(coordinatorResume.stdout, /resume: coordinator \(unknown\) \[family Family Coordinator\], coordinator lane/);
const coordinatorJson = await runMain(repo, ['resume', '--json']);
assert.equal(JSON.parse(coordinatorJson.stdout).me.family, 'Family Coordinator');
@@ -833,8 +883,8 @@ test('[O3] declared families travel from join through submit and verdict, and ab
assert.equal(shownJson.item_builder_family, 'Family Alpha');
assert.equal(shownJson.verdicts[0].verdict_verifier_family, 'Family Beta');
const shownText = await runMain(repo, ['show', String(id)]);
- assert.match(shownText.stdout, /submitted by web-1 \(Family Alpha\)/);
- assert.match(shownText.stdout, /ACCEPT CRITERION_MET by review-1 \(Family Beta\)/);
+ assert.match(shownText.stdout, /submitted by web-1 \(Test Model\) \[family Family Alpha\]/);
+ assert.match(shownText.stdout, /ACCEPT CRITERION_MET by review-1 \(Test Model\) \[family Family Beta\]/);
const redeclared = await runMain(reviewerRoot, ['join', 'review', '--family', 'Family Gamma', '--json']);
assert.equal(redeclared.code, 0, redeclared.stderr || redeclared.stdout);
@@ -845,10 +895,10 @@ test('[O3] declared families travel from join through submit and verdict, and ab
assert.equal(rejoined.code, 0, rejoined.stderr || rejoined.stdout);
assert.equal(store.agentAt(persistent, reviewerRoot).agent_family, 'Family Gamma', 'omitting --family preserves the declaration');
const historicalShow = await runMain(repo, ['show', String(id)]);
- assert.match(historicalShow.stdout, /ACCEPT CRITERION_MET by review-1 \(Family Beta\)/);
+ assert.match(historicalShow.stdout, /ACCEPT CRITERION_MET by review-1 \(Test Model\) \[family Family Beta\]/);
const resumed = await runMain(builderPath, ['resume']);
- assert.match(resumed.stdout, /resume: web-1 \(Family Alpha\), web lane/);
+ assert.match(resumed.stdout, /resume: web-1 \(Test Model\) \[family Family Alpha\], web lane/);
const resumedJson = await runMain(builderPath, ['resume', '--json']);
assert.equal(resumedJson.code, 0, resumedJson.stderr || resumedJson.stdout);
const resumedShape = JSON.parse(resumedJson.stdout);
@@ -885,6 +935,22 @@ test('[O3] declared families travel from join through submit and verdict, and ab
const cliReview = await runMain(reviewerRoot, ['next', '--verify', '--json']);
assert.equal(cliReview.code, 0, cliReview.stderr || cliReview.stdout);
assert.equal(JSON.parse(cliReview.stdout).item.item_id, differentFamily, 'CLI reads verify.family and reserves different-family work');
+
+ const prefixConfig = JSON.parse(policyConfig);
+ prefixConfig.agents = { names: 'prefix' };
+ writeFileSync(join(repo, 'pullboard.json'), JSON.stringify(prefixConfig, null, 2));
+ git(repo, 'add', 'pullboard.json');
+ git(repo, 'commit', '-q', '-m', 'docs: configure prefix agent names');
+ const prefixMade = await runMain(repo, ['worktree', 'web', '--model', 'Claude Sonnet', '--json']);
+ assert.equal(prefixMade.code, 0, prefixMade.stderr || prefixMade.stdout);
+ const prefixResult = JSON.parse(prefixMade.stdout);
+ assert.equal(prefixResult.agent, 'web-3');
+ assert.equal(prefixResult.model, 'Claude Sonnet');
+ assert.equal(prefixResult.displayName, 'claude-sonnet-web-3');
+ const quotedModel = await runMain(repo, ['worktree', 'web', '--model', 'Model " $x', '--json']);
+ assert.equal(quotedModel.code, 0, quotedModel.stderr || quotedModel.stdout);
+ assert.match(JSON.parse(quotedModel.stdout).prompt, /Model: 'Model " \$x'\./);
+ assert.match(JSON.parse(quotedModel.stdout).prompt, /pass --model 'Model " \$x'/);
});
test('[O2,O3] family policy controls review order and refuses unknown or matching families', () => {
diff --git a/test/e2e.test.js b/test/e2e.test.js
index 094df3e2..83b387b8 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -272,12 +272,12 @@ test('the board lives in the git common dir; every worktree sees it; nothing is
assert.ok(existsSync(join(box.repo, '.git', 'pullboard', 'board.sqlite')));
assert.equal(box.git(box.repo, 'status', '--porcelain'), '');
assert.match(box.run(box.repo, 'whoami').out, /^coordinator/);
- assert.match(box.run(box.web, 'whoami').out, /^web-1 \(web lane\)/);
+ assert.match(box.run(box.web, 'whoami').out, /^web-1 \(Test Model\) \(web lane\)/);
const second = join(box.dir, 'web-2');
box.git(box.repo, 'worktree', 'add', '-q', second, '-b', 'web/two');
- assert.match(box.run(second, 'join', 'web').out, /joined as web-2/);
- assert.match(box.run(second, 'whoami').out, /^web-2 \(web lane\)/, 'a second worktree in the same lane is its own agent');
- assert.match(box.run(box.web, 'whoami').out, /^web-1 \(web lane\)/, 'and the first stays itself');
+ assert.match(box.run(second, 'join', 'web').out, /joined as web-2 \(Test Model\)/);
+ assert.match(box.run(second, 'whoami').out, /^web-2 \(Test Model\) \(web lane\)/, 'a second worktree in the same lane is its own agent');
+ assert.match(box.run(box.web, 'whoami').out, /^web-1 \(Test Model\) \(web lane\)/, 'and the first stays itself');
assert.match(box.run(box.web, 'init').err, /NOT_MAIN/);
assert.match(box.run(box.repo, 'join', 'web').err, /MAIN_IS_COORDINATOR/);
});
@@ -431,18 +431,18 @@ test('decisions are asked, listed and answered, and evidence attached, from the
assert.equal(asked.code, 0, asked.err);
const id = /as #(\d+)/.exec(asked.out)?.[1];
assert.ok(id, asked.out);
- assert.match(box.run(box.repo, 'decisions').out, new RegExp(`#${id} {2}web-1 -> coordinator, \\d+m ago: ship today\\?`));
- assert.match(box.run(box.repo, 'inbox').out, new RegExp(`web-1 -> coordinator: asks for a decision \\(#${id}; pullboard answer ${id}`));
+ assert.match(box.run(box.repo, 'decisions').out, new RegExp(`#${id} {2}web-1 \\(Test Model\\) -> coordinator \\(unknown\\), \\d+m ago: ship today\\?`));
+ assert.match(box.run(box.repo, 'inbox').out, new RegExp(`web-1 \\(Test Model\\) -> coordinator \\(unknown\\): asks for a decision \\(#${id}; pullboard answer ${id}`));
const wrongActor = box.run(box.repo, 'answer', id, 'yes, today', '--as', 'person');
assert.notEqual(wrongActor.code, 0);
assert.match(wrongActor.err, /B26_PERSON_ANSWER.*person mode answers only/);
- assert.match(box.run(box.repo, 'answer', id, 'yes, today').out, new RegExp(`answered #${id} to web-1 as #\\d+`));
+ assert.match(box.run(box.repo, 'answer', id, 'yes, today').out, new RegExp(`answered #${id} to web-1 \\(Test Model\\) as #\\d+`));
assert.match(box.run(box.repo, 'decisions').out, /no open decisions/);
- assert.match(box.run(box.web, 'inbox').out, new RegExp(`coordinator -> web-1: answers #${id}: yes, today`));
+ assert.match(box.run(box.web, 'inbox').out, new RegExp(`coordinator \\(unknown\\) -> web-1 \\(Test Model\\): answers #${id}: yes, today`));
const head = box.git(box.web, 'rev-parse', 'HEAD');
const proved = box.run(box.web, 'shout', 'coordinator', 'FINISH', 'the page', '--evidence', 'receipt', '--outcome', 'measured', '--item', '1', '--commit', 'HEAD');
assert.equal(proved.code, 0, proved.err);
- assert.match(box.run(box.repo, 'inbox').out, new RegExp(`web-1 -> coordinator: FINISH the page\\n {2}receipt: measured, #1 at ${head.slice(0, 12)}`));
+ assert.match(box.run(box.repo, 'inbox').out, new RegExp(`web-1 \\(Test Model\\) -> coordinator \\(unknown\\): FINISH the page\\n {2}receipt: measured, #1 at ${head.slice(0, 12)}`));
assert.match(box.run(box.web, 'shout', 'coordinator', 'x', '--evidence', 'receipt', '--outcome', 'measured', '--item', '1', '--commit', 'nope').err, /BAD_EVIDENCE.*"nope"/);
});
@@ -452,12 +452,12 @@ test('decisions default up the chain, pass to the person, and return to the orig
assert.equal(asked.code, 0, asked.err);
const id = /as #(\d+)/.exec(asked.out)?.[1];
assert.ok(id, asked.out);
- assert.match(box.run(box.repo, 'decisions').out, new RegExp(`#${id} {2}web-1 -> coordinator`));
+ assert.match(box.run(box.repo, 'decisions').out, new RegExp(`#${id} {2}web-1 \\(Test Model\\) -> coordinator \\(unknown\\)`));
const passed = box.run(box.repo, 'pass', id, 'the checks are green');
assert.equal(passed.code, 0, passed.err);
const personId = /as #(\d+)/.exec(passed.out)?.[1];
assert.ok(personId, passed.out);
- assert.match(box.run(box.repo, 'decisions', '--as', 'person').out, new RegExp(`#${personId} {2}coordinator -> person`));
+ assert.match(box.run(box.repo, 'decisions', '--as', 'person').out, new RegExp(`#${personId} {2}coordinator \\(unknown\\) -> person`));
const personModeFromAgent = box.run(box.web, 'decisions', '--as', 'person');
assert.notEqual(personModeFromAgent.code, 0);
assert.match(personModeFromAgent.err, /B26_PERSON_ANSWER.*main checkout/);
@@ -472,9 +472,9 @@ test('decisions default up the chain, pass to the person, and return to the orig
const answerRefusal = JSON.parse(coordinatorAnswer.out);
assert.equal(answerRefusal.error.code, 'B26_PERSON_ANSWER');
assert.match(answerRefusal.error.next, new RegExp(`pullboard answer ${personId} "<answer>" --as person`));
- assert.match(box.run(box.repo, 'answer', personId, 'Ship it.', '--as', 'person').out, new RegExp(`person answered #${personId}; notified web-1`));
+ assert.match(box.run(box.repo, 'answer', personId, 'Ship it.', '--as', 'person').out, new RegExp(`person answered #${personId}; notified web-1 \\(Test Model\\)`));
assert.match(box.run(box.web, 'resume').out, new RegExp(`newest from person: Person answered #${personId}: Ship it\\.`));
- assert.match(box.run(box.web, 'inbox').out, new RegExp(`person -> web-1: answers #${id}: Person answered #${personId}: Ship it\\.`));
+ assert.match(box.run(box.web, 'inbox').out, new RegExp(`person -> web-1 \\(Test Model\\): answers #${id}: Person answered #${personId}: Ship it\\.`));
assert.match(box.run(box.repo, 'decisions').out, /no open decisions/);
const refused = box.run(box.web, 'shout', 'person', 'Ship?', '--decision', '--json');
assert.notEqual(refused.code, 0);
@@ -559,7 +559,7 @@ test("a worktree starts only from a commit that holds pullboard's files as the m
const made = box.run(repo, 'worktree', 'web');
assert.equal(made.code, 0, made.err);
- assert.match(made.out, /repo-web-1 on branch web\/1, joined as web-1 in the web lane/, 'the refusals made nothing and joined no one');
+ assert.match(made.out, /repo-web-1 on branch web\/1, joined as web-1 \(Test Model\) in the web lane/, 'the refusals made nothing and joined no one');
const web = join(box.dir, 'repo-web-1');
assert.ok(readFileSync(join(web, 'SPEC.md'), 'utf8').includes('- G3 [draft'), 'it starts with the spec as committed');
const foreign = commitFile(box, web, 'api/a.js', 'a', 'feat(web): page [G1]');
@@ -664,7 +664,7 @@ test('verify runs at the submitted commit, against the criterion frozen at claim
assert.match(show, /ACCEPT CRITERION_MET by coordinator/);
const ledger = box.run(box.repo, 'ledger').out;
assert.match(ledger, /1 verified by a second agent/);
- assert.match(ledger, /\| 1 \| web \| Page \| G1 \| web-1 \| coordinator \|/);
+ assert.match(ledger, /\| 1 \| web \| Page \| G1 \| web-1 \(Test Model\) \| coordinator \(unknown\) \|/);
});
test('unsupported spec grammar keeps claim, refreeze, submit and verify refusals typed [A5,A1,M1]', () => {
@@ -846,7 +846,7 @@ test('next claims the next free item; --verify names the next to check [N2]', ()
assert.match(blocked.err, /NOTHING_FREE\] #2 waits on #1 \(submitted, web lane\)/);
assert.match(box.run(box.repo, 'next', '--verify').err, /MAIN_IS_COORDINATOR/);
const named = box.run(box.repo, 'next', '--verify', '--as', 'coordinator').out;
- assert.match(named, /next to verify: #1 Page, built by web-1/);
+ assert.match(named, /next to verify: #1 Page, built by web-1 \(Test Model\)/);
assert.match(named, new RegExp(`check out exactly that commit, here: cd ${box.repo} && git switch --detach [0-9a-f]{40}`));
assert.match(named, /pullboard verify 1 accept --as coordinator --note/);
assert.match(box.run(box.web, 'next', '--verify').err, /NOTHING_FREE/);
@@ -1112,7 +1112,7 @@ test('resume puts an agent back to work from the board: its claim, its branch, w
box.run(box.repo, 'add', 'web', 'Page', '--specs', 'G1', '--brief', 'Files: web/page.html');
const fresh = box.run(box.web, 'resume');
assert.equal(fresh.code, 0, fresh.err);
- assert.match(fresh.out, /^resume: web-1, web lane, at /);
+ assert.match(fresh.out, /^resume: web-1 \(Test Model\), web lane, at /);
assert.match(fresh.out, /branch web\/one: 0 ahead of main, 0 behind/);
assert.match(fresh.out, /next: pullboard next \(1 ready in your lane\)/);
box.run(box.web, 'next');
@@ -1129,7 +1129,7 @@ test('resume puts an agent back to work from the board: its claim, its branch, w
box.git(box.web, 'commit', '-q', '-m', 'feat(web): page [G1]');
assert.equal(box.run(box.web, 'submit', '1').code, 0);
const coordinator = box.run(box.repo, 'resume').out;
- assert.match(coordinator, /^resume: coordinator, coordinator lane, the main checkout/);
+ assert.match(coordinator, /^resume: coordinator \(unknown\), coordinator lane, the main checkout/);
assert.match(coordinator, /to verify: #1 web \(\d+[mhd]\)/);
assert.match(coordinator, /next: pullboard next --verify --as coordinator/);
box.git(box.repo, 'switch', '-q', '--detach', 'web/one');
@@ -1296,7 +1296,7 @@ test('a fresh worktree with no install of its own runs pullboard from the main c
chmodSync(join(bin, 'pullboard'), 0o755);
const committed = commit();
assert.equal(committed.status, 0, committed.stderr);
- assert.match(resume().stdout, /^resume: web-1, web lane/);
+ assert.match(resume().stdout, /^resume: web-1 \(Test Model\), web lane/);
});
test('the gate reaches the agent as a digest: one line when green, the failure when red; the whole output stays in the git dir [V10]', () => {
@@ -1501,7 +1501,8 @@ test('worktree prints the opening lines of a subagent\'s prompt, with its folder
const folder = join(box.dir, "my app's $PULLBOARD_PATH_PROBE-web-1");
const quoted = `'${folder.replaceAll("'", "'\\''")}'`;
assert.match(made, /For a subagent working here, begin its prompt with:\n/);
- assert.ok(made.includes(` You are web-1, in the web lane. Work only in ${quoted}, and start every command with cd ${quoted} &&\n`), made);
+ assert.ok(made.includes(` You are web-1 (Test Model), in the web lane. Work only in ${quoted}, and start every command with cd ${quoted} &&\n`), made);
+ assert.match(made, / Model: Test Model\. When joining or making another agent worktree, pass that agent's exact model with --model or set PULLBOARD_MODEL\./);
assert.ok(made.includes(` Read '${folder.replaceAll("'", "'\\''")}/AGENTS.md' first. Its rules govern this work, over any other repo's instructions you were given.\n`), made);
// Pasted into a shell as printed, the line enters the real folder: nothing in the path expands.
const cdLine = /start every command with (cd .+ &&)\n/.exec(made)[1];