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.

fix(cli): model names follow refusals and setup [O8,O3]

Corey Olson399b793d420a
diff --git a/docs/lifecycle.md b/docs/lifecycle.md
index 991b2450..1938ef7f 100644
--- a/docs/lifecycle.md
+++ b/docs/lifecycle.md
@@ -74,7 +74,7 @@ Each move checks its guards in this order and refuses with the first one that do
| CLOSED | escalate: the item is in open, claimed | pullboard show <id> |
| CLOSED | refreeze: the item is in open, claimed, submitted | pullboard show <id> |
| CLOSED | withdraw: the item is in open, claimed, submitted | pullboard show <id> |
-| NOT_JOINED | the caller is the main checkout, or a worktree that joined a lane | pullboard join <lane> (see: pullboard lanes) |
+| NOT_JOINED | the caller is the main checkout, or a worktree that joined a lane | pullboard join <lane> --model "<model name>" (see: pullboard lanes) |
| NO_ITEM | the item exists | pullboard list --all |
| COORDINATOR_ONLY | the caller is the coordinator | run it from the main checkout |
| MAIN_IS_COORDINATOR | in the main checkout, the caller says it is the coordinator | verify from your own worktree; the coordinator adds --as coordinator |
diff --git a/src/cli.js b/src/cli.js
index 5cf682e0..5228da88 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -608,7 +608,7 @@ function configHere(info) {
if (info.isMain || !existsSync(join(mainRoot, CONFIG_FILE))) throw error;
throw new Refused(
'NO_CONFIG',
- `this worktree's commit has no ${CONFIG_FILE}, though the main checkout has one: make a new worktree from the main checkout, which says what to commit first: ${cdTo(mainRoot)} pullboard worktree <lane>`,
+ `this worktree's commit has no ${CONFIG_FILE}, though the main checkout has one: make a new worktree from the main checkout, which says what to commit first: ${cdTo(mainRoot)} pullboard worktree <lane> --model "<model name>"`,
);
}
}
@@ -671,7 +671,7 @@ function whoAmI(ctx, board) {
}
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)');
+ throw new Refused('NOT_JOINED', 'this worktree has not joined a lane: pullboard join <lane> --model "<model name>" (see: pullboard lanes)');
}
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) };
}
@@ -759,6 +759,38 @@ function agentDisplayName(agents, config, id) {
return displayAgentName({ agent_id: id }, config.agents.names);
}
+/** Render only declared actor positions in a refusal, preserving user text and stable JSON ids. */
+function agentRefusalText(message, code, name) {
+ const patterns = {
+ ALREADY_JOINED: /^(\[ALREADY_JOINED\] this worktree is )(\S+)( in )/,
+ HELD: /^(\[HELD\] item #\d+ is held by )(\S+)( until )/,
+ LANE_HELD: /^(\[LANE_HELD\] )(\S+)( holds the )/,
+ REVIEW_HELD: /^(\[REVIEW_HELD\] )(\S+)( holds the )/,
+ NOT_YOURS: /^(\[NOT_YOURS\] only the coordinator or )(\S+)(, who )/,
+ NO_AGENT: /^(\[NO_AGENT\] no agent )(\S+)()$/,
+ };
+ if (code === 'NOT_YOUR_DECISION') {
+ return message.replace(/^(\[NOT_YOUR_DECISION\] shout #\d+ is addressed to )(\S+)(, not your \S+ lane \(agent )(\S+)(\))$/,
+ (_, before, to, middle, caller, after) => `${before}${name(to)}${middle}${name(caller)}${after}`);
+ }
+ return patterns[code] ? message.replace(patterns[code], (_, before, id, after) => `${before}${name(id)}${after}`) : message;
+}
+
+/** Read current display settings for text refusals; the structured error retains its stable identifiers. */
+function displayedRefusal(io, error) {
+ if (!['ALREADY_JOINED', 'HELD', 'LANE_HELD', 'REVIEW_HELD', 'NOT_YOURS', 'NOT_YOUR_DECISION', 'NO_AGENT'].includes(error.code)) return error.message;
+ try {
+ const ctx = context(io);
+ const agents = withBoard(ctx, (board) => store.listAgents(board));
+ return agentRefusalText(error.message, error.code, (id) => agentDisplayName(agents, ctx.config, id));
+ } catch { return error.message; }
+}
+
+/** Label the holder at the start of a generated wait reason without rewriting its quoted reason. */
+function displayedWait(reason, agents, config) {
+ return reason.replace(/^(\S+)( holds the )/, (_, id, rest) => `${agentDisplayName(agents, config, id)}${rest}`);
+}
+
/**
* The files an agent has been working in (N20): what its latest three items touched, and what is
* uncommitted in its worktree now.
@@ -854,14 +886,14 @@ function coordinatorNext(card, rows) {
if (!approved.length) return 'the person approves rows in SPEC.md; then plan them: the pullboard-plan skill';
if (card.holding.length) return buildNext(card);
if (card.sentBack.length) return reworkNext(card);
- if (card.toVerify.length) return 'pullboard next --verify --as coordinator, or a verifier that built nothing: pullboard worktree review';
+ if (card.toVerify.length) return 'pullboard next --verify --as coordinator, or a verifier that built nothing: pullboard worktree review --model "<model name>"';
if (card.toMerge.length) {
const [first] = card.toMerge;
return `merge #${first.item_id}: git merge --no-edit ${first.item_commit.slice(0, 12)}, run the gate, then pullboard merged ${first.item_id} <merge commit>`;
}
if (card.open.length) {
const lanes = [...new Set(card.open.map((item) => item.item_lane))];
- return `start a builder for each lane with open items (${lanes.join(', ')}): pullboard worktree <lane>, then the pullboard-run skill`;
+ return `start a builder for each lane with open items (${lanes.join(', ')}): pullboard worktree <lane> --model "<model name>", then the pullboard-run skill`;
}
const cited = new Set(card.all.flatMap((item) => (item.item_spec_ids ?? '').split(',').filter(Boolean)));
const unplanned = approved.filter((row) => !cited.has(row.id));
@@ -1646,7 +1678,8 @@ async function nextHere(io, values) {
}
if (!found.retry && Date.now() >= deadline) {
const waited = minutes ? ` after ${minutes} minutes` : '';
- io.err(`pullboard: [NOTHING_FREE] ${found.reasons.join('; ')}${waited}. To keep looking: pullboard next --wait 9${values.verify ? ' --verify' : ''} (minutes; give the command a ten-minute timeout)`);
+ const agents = withBoard(ctx, (board) => store.listAgents(board));
+ io.err(`pullboard: [NOTHING_FREE] ${found.reasons.map((reason) => displayedWait(reason, agents, ctx.config)).join('; ')}${waited}. To keep looking: pullboard next --wait 9${values.verify ? ' --verify' : ''} (minutes; give the command a ten-minute timeout)`);
return 1;
}
if (!found.retry) await new Promise((done) => setTimeout(done, 5000));
@@ -1834,19 +1867,20 @@ function workCommands(io, args) {
next: () => nextHere(io, { ...values, verifyId: first }),
check: async () => {
const ctx = context(io);
- const { item, author, caller } = withBoard(ctx, (board) => {
+ const { item, author, caller, agents } = withBoard(ctx, (board) => {
const me = first ? (ctx.info.isMain ? { id: COORDINATOR } : { id: store.agentAt(board, ctx.info.root)?.agent_id }) : whoAmI(ctx, board);
const held = first ? store.getItem(board, idArg(first))
: store.listItems(board).find((entry) => entry.item_status === 'claimed' && entry.item_owner === me.id && entry.item_parent_id === null);
if (!held) throw new Refused('NOT_HOLDING', 'you hold no item; name one, pullboard check <id>, or run the project gate: pullboard gate');
- return { item: held, author: store.itemCheckAuthor(board, held.item_id), caller: me.id };
+ return { item: held, author: store.itemCheckAuthor(board, held.item_id), caller: me.id, agents: store.listAgents(board) };
});
const check = frozenCheck(item);
if (!check) throw new Refused('NO_CHECK', `#${item.item_id} has no check command; its proof is the project gate: pullboard gate`);
if (item.item_claim_head) itemPolicy(ctx.info.root, item);
else mainPolicy(ctx.info.root);
const by = author || 'unknown (legacy)';
- const notice = `check #${item.item_id} set by ${by}: ${check}`;
+ const authorName = author ? agentDisplayName(agents, ctx.config, author) : by;
+ const notice = `check #${item.item_id} set by ${authorName}: ${check}`;
if (values.json) io.stderr.write(`${notice}\n`);
else io.say(notice);
if (!values.yes && (!author || author !== caller)) {
@@ -1854,7 +1888,7 @@ function workCommands(io, args) {
else io.err('Run this check? [y/N]');
const answer = await firstInputLine(io.stdin);
if (!/^y(?:es)?$/iu.test(answer.trim())) {
- throw new Refused('CHECK_CONFIRM', `the check set by ${by} was not run: ${check}; run pullboard check ${item.item_id} --yes after reading the command, or answer yes at the prompt`);
+ throw new Refused('CHECK_CONFIRM', `the check set by ${authorName} was not run: ${check}; run pullboard check ${item.item_id} --yes after reading the command, or answer yes at the prompt`);
}
}
const run = runShell(ctx.info.root, check);
@@ -2336,7 +2370,7 @@ async function runCommand(argv, io) {
} catch (error) {
if (error instanceof Refused) {
io.refusal?.(error);
- io.err(`pullboard: ${error.message}`);
+ io.err(`pullboard: ${displayedRefusal(io, error)}`);
return 1;
}
throw error;
diff --git a/src/hooks.js b/src/hooks.js
index 3fab8157..2394ee72 100644
--- a/src/hooks.js
+++ b/src/hooks.js
@@ -220,7 +220,7 @@ export function preCommitProblems({ root, isMain, config, agent, boardFile }) {
problems.push(...approvedRowProblems(root, config, boardFile));
if (isMain) return problems;
if (!agent) {
- problems.push('this worktree has not joined a lane: pullboard join <lane>');
+ problems.push('this worktree has not joined a lane: pullboard join <lane> --model "<model name>"');
return problems;
}
const mergeBase = mainMergeBase(root);
diff --git a/src/machine.js b/src/machine.js
index d93cce97..9dd5e99f 100644
--- a/src/machine.js
+++ b/src/machine.js
@@ -96,7 +96,7 @@ export const STATES = [
/** @type {Guard[]} */
export const GUARDS = [
{ id: IN_STATE, refuse: '', rule: "the move can start from the item's current state", next: 'pullboard show <id>', source: 'board' },
- { id: 'joined', refuse: 'NOT_JOINED', rule: 'the caller is the main checkout, or a worktree that joined a lane', next: 'pullboard join <lane> (see: pullboard lanes)', source: 'cli' },
+ { id: 'joined', refuse: 'NOT_JOINED', rule: 'the caller is the main checkout, or a worktree that joined a lane', next: 'pullboard join <lane> --model "<model name>" (see: pullboard lanes)', source: 'cli' },
{ id: 'itemExists', refuse: 'NO_ITEM', rule: 'the item exists', next: 'pullboard list --all', source: 'board' },
{ id: 'coordinatorOnly', refuse: 'COORDINATOR_ONLY', rule: 'the caller is the coordinator', next: 'run it from the main checkout', source: 'board' },
{ id: 'coordinatorSaysAs', refuse: 'MAIN_IS_COORDINATOR', rule: 'in the main checkout, the caller says it is the coordinator', next: 'verify from your own worktree; the coordinator adds --as coordinator', source: 'cli' },
diff --git a/src/run.js b/src/run.js
index 9f590e38..59f05d86 100644
--- a/src/run.js
+++ b/src/run.js
@@ -382,7 +382,7 @@ async function buildItem(ctx, item, { agents, attempts, minutes, deps, me }) {
export async function runItems(io, values, deps) {
const ctx = deps.context(io);
if (ctx.info.isMain) {
- throw new Refused('MAIN_IS_COORDINATOR', 'the runner builds lane items, so it runs in a lane worktree: pullboard worktree <lane> --route light, then run it there');
+ throw new Refused('MAIN_IS_COORDINATOR', 'the runner builds lane items, so it runs in a lane worktree: pullboard worktree <lane> --model "<model name>" --route light, then run it there');
}
const agents = Object.fromEntries(
store.ROUTES.map((route) => [route, String(values[`agent-${route}`] ?? values.agent ?? '').trim()]).filter(([, command]) => command),
@@ -401,7 +401,7 @@ export async function runItems(io, values, deps) {
const me = deps.withBoard(ctx, (board) => deps.whoAmI(ctx, board));
const above = Object.keys(agents).filter((route) => !store.canTake(me.route, route) && values[`agent-${route}`]);
if (above.length) {
- throw new Refused('ROUTE', `this worktree joined on the ${me.route} route, so it cannot take ${above.join(' or ')} items; make one that can: pullboard worktree ${me.lane} --route ${above.at(-1)}`);
+ throw new Refused('ROUTE', `this worktree joined on the ${me.route} route, so it cannot take ${above.join(' or ')} items; make one that can: pullboard worktree ${me.lane} --model "<model name>" --route ${above.at(-1)}`);
}
const routes = Object.keys(agents).filter((route) => store.canTake(me.route, route));
const totals = { submitted: 0, escalated: 0 };
diff --git a/src/tour.js b/src/tour.js
index 66226bd3..42ec5c07 100644
--- a/src/tour.js
+++ b/src/tour.js
@@ -141,7 +141,7 @@ export function tour(io) {
pb('coordinator', ['add', 'app', 'Greeting', '--specs', 'G1', '--criterion', 'greet() meets G1']);
step(2, 'A builder agent gets its own worktree in the app lane and claims the next item. Its criterion freezes.');
- pb('coordinator', ['worktree', 'app'], { show: /^made /, label: 'pullboard worktree app' });
+ pb('coordinator', ['worktree', 'app', '--model', 'Scripted'], { show: /^made /, label: 'pullboard worktree app --model Scripted' });
pb('app-1', ['next'], { show: /^claimed|^criterion/ });
step(3, 'It writes greet(), tests the happy path and submits. Its own gate is green.');
@@ -151,7 +151,7 @@ export function tour(io) {
const first = pb('app-1', ['submit', '1'], { show: /^submitted/ }).match(/at ([0-9a-f]{12})/)[1];
step(4, 'A second agent checks out exactly that commit and tries the edge the builder skipped.');
- pb('coordinator', ['worktree', 'review'], { show: /^made /, label: 'pullboard worktree review' });
+ pb('coordinator', ['worktree', 'review', '--model', 'Scripted'], { show: /^made /, label: 'pullboard worktree review --model Scripted' });
run('review-1', 'git', ['switch', '-q', '--detach', first]);
const edge = run('review-1', process.execPath, TRY_EDGE, { label: "node -e \"greet('')\"" });
pb('review-1', ['verify', '1', 'reject', '--reason', 'BEHAVIOR_MISMATCH', '--note', `greet('') returns "${edge}"; G1 says a blank name greets the world`], { tone: 'red' });
diff --git a/test/e2e.test.js b/test/e2e.test.js
index f6760244..afb07c13 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -1176,7 +1176,7 @@ test('hold pauses a lane: next names who held it and why; --off lets it go [N22]
assert.match(box.run(box.repo, 'hold', 'web', '--reason', 'G1 is being rewritten').out, /holding the web lane: G1 is being rewritten/);
const held = box.run(box.web, 'next');
assert.equal(held.code, 1);
- assert.match(held.err, /coordinator holds the web lane: G1 is being rewritten/);
+ assert.match(held.err, /coordinator \(unknown\) holds the web lane: G1 is being rewritten/);
assert.match(box.run(box.web, 'claim', '1').err, /LANE_HELD/);
assert.match(box.run(box.web, 'resume').out, /the web lane is held by coordinator \(unknown\): G1 is being rewritten/);
assert.match(box.run(box.repo, 'hold', 'web', '--off').out, /released the web lane/);
@@ -1205,21 +1205,22 @@ test('init adds a Claude Code session hook that runs resume, and keeps every oth
assert.equal(bare.stdout, '');
});
-test('the tour runs a reject and its rework on a throwaway repo, in under thirty seconds [N10]', () => {
+test('the tour runs a reject and its rework on a throwaway repo, in under thirty seconds without a model environment [N10,O8]', () => {
const box = sandbox();
const plainEnv = { ...box.env, TMPDIR: box.dir };
delete plainEnv.NO_COLOR;
delete plainEnv.FORCE_COLOR;
+ delete plainEnv.PULLBOARD_MODEL;
const started = Date.now();
const shown = spawnSync(process.execPath, [BIN, 'tour'], { cwd: box.dir, env: plainEnv, encoding: 'utf8' });
assert.equal(shown.status, 0, `${shown.stdout}${shown.stderr}`);
assert.ok(Date.now() - started < 30_000, 'thirty seconds');
assert.doesNotMatch(shown.stdout, /\u001b\[/, 'piped output stays plain');
assert.match(shown.stdout, /review-1 \$ pullboard verify 1 reject --reason BEHAVIOR_MISMATCH/);
- assert.match(shown.stdout, /sent back: #1 BEHAVIOR_MISMATCH by review-1 \(Test Model\): greet\(''\) returns "Hello, !"/);
+ assert.match(shown.stdout, /sent back: #1 BEHAVIOR_MISMATCH by review-1 \(Scripted\): greet\(''\) returns "Hello, !"/);
assert.match(shown.stdout, /with the fix removed\n {7}# pass 1\n {7}# fail 1/);
assert.match(shown.stdout, /verified #1: CRITERION_MET/);
- assert.match(shown.stdout, /\| 1 \| app \| Greeting \| G1 \| app-1 \(Test Model\) \| review-1 \(Test Model\) \|/);
+ assert.match(shown.stdout, /\| 1 \| app \| Greeting \| G1 \| app-1 \(Scripted\) \| review-1 \(Scripted\) \|/);
const forced = spawnSync(process.execPath, [BIN, 'tour'], { cwd: box.dir, env: { ...plainEnv, FORCE_COLOR: '1' }, encoding: 'utf8' });
assert.equal(forced.status, 0, `${forced.stdout}${forced.stderr}`);
@@ -1381,7 +1382,7 @@ test('check runs the item\'s own check command, yours by default, and prints a d
assert.equal(green.code, 0, green.out);
assert.match(green.out, /^check green in \d+s: test -f web\/a.html/m);
assert.equal(green.out.split('\n').filter(Boolean).length, 2);
- assert.match(green.out, /^check #1 set by coordinator:/);
+ assert.match(green.out, /^check #1 set by coordinator \(unknown\):/);
assert.equal(box.run(box.repo, 'check', '1').code, 1, 'named, from another checkout: there the file is missing');
assert.match(box.run(box.web, 'check', '2').err, /NO_CHECK.*#2 has no check command/);
assert.match(box.run(box.repo, 'help', '--all').out, /pullboard check \[id\]/);
@@ -1612,7 +1613,7 @@ test('from the view the person adds items, shouts and holds lanes, through the C
const held = await view.act(box.repo, { verb: 'hold', args: { lane: 'web', reason: 'G1 is changing' } });
assert.equal(held.status, 200);
assert.equal(held.document.event.event_kind, 'hold');
- assert.match(box.run(box.web, 'next').err, /coordinator holds the web lane: G1 is changing/);
+ assert.match(box.run(box.web, 'next').err, /coordinator \(unknown\) holds the web lane: G1 is changing/);
const released = await view.act(box.repo, { verb: 'hold', args: { lane: 'web', off: true } });
assert.equal(released.status, 200);
assert.equal(released.document.event.event_kind, 'unhold');
@@ -1979,3 +1980,88 @@ test('a detached coordinator review cannot become a new claim policy [V4,V16]',
assert.equal(submitted.code, 1);
assert.equal(JSON.parse(submitted.out).error.code, 'OUTSIDE_LANE');
});
+
+
+test('configured model names cover refusals, waits and check authors while IDs and user text stay stable [O8,O3]', () => {
+ for (const style of ['suffix', 'prefix']) {
+ const box = project('true');
+ const config = JSON.parse(readFileSync(join(box.repo, 'pullboard.json'), 'utf8'));
+ config.agents = { names: style };
+ writeFileSync(join(box.repo, 'pullboard.json'), JSON.stringify(config, null, 2));
+ box.git(box.repo, 'add', 'pullboard.json');
+ box.git(box.repo, 'commit', '-q', '-m', 'chore(repo): choose agent names [G1]');
+ box.git(box.web, 'merge', '-q', '--ff-only', 'main');
+ const joined = box.run(box.web, 'join', 'web', '--model', 'Claude', '--json');
+ assert.equal(joined.code, 0, joined.err || joined.out);
+ assert.equal(JSON.parse(joined.out).agent, 'web-1');
+ const made = box.run(box.repo, 'worktree', 'web', '--model', 'GPT 6', '--json');
+ assert.equal(made.code, 0, made.err || made.out);
+ const second = JSON.parse(made.out);
+ assert.equal(second.agent, 'web-2');
+ const builderName = style === 'suffix' ? 'web-1 (Claude)' : 'claude-web-1';
+ const otherName = style === 'suffix' ? 'web-2 (GPT 6)' : 'gpt-6-web-2';
+ const coordinatorName = style === 'suffix' ? 'coordinator (unknown)' : 'unknown-coordinator';
+ const wrongLane = box.run(box.web, 'join', 'api', '--model', 'Claude');
+ assert.equal(wrongLane.code, 1);
+ assert.ok(wrongLane.err.includes(`this worktree is ${builderName} in the web lane`), wrongLane.err);
+ const added = box.run(box.repo, 'add', 'web', 'Model receipt', '--specs', 'G1', '--check', 'true', '--json');
+ assert.equal(added.code, 0, added.err || added.out);
+ const id = JSON.parse(added.out).item.item_id;
+ const claimed = box.run(box.web, 'claim', String(id));
+ assert.equal(claimed.code, 0, claimed.err || claimed.out);
+ const held = box.run(second.path, 'claim', String(id));
+ assert.equal(held.code, 1);
+ assert.ok(held.err.includes(`held by ${builderName} until`), held.err);
+ const structuredHeld = box.run(second.path, 'claim', String(id), '--json');
+ assert.equal(JSON.parse(structuredHeld.out).error.code, 'HELD');
+ assert.match(JSON.parse(structuredHeld.out).error.message, /held by web-1 until/);
+ const check = box.run(box.repo, 'check', String(id), '--yes', '--json');
+ assert.equal(check.code, 0, check.err || check.out);
+ assert.equal(JSON.parse(check.out).by, 'coordinator', 'the check receipt uses the stable actor id');
+ assert.ok(check.err.includes(`set by ${coordinatorName}: true`), check.err);
+ const refusedCheck = spawnSync(process.execPath, [BIN, 'check', String(id)], {
+ cwd: second.path, env: box.env, encoding: 'utf8', input: 'n\n',
+ });
+ assert.equal(refusedCheck.status, 1);
+ assert.ok(refusedCheck.stderr.includes(`the check set by ${coordinatorName} was not run`), refusedCheck.stderr);
+ const asked = box.run(box.repo, 'shout', 'web-1', 'Keep web-1 literal', '--decision', '--json');
+ assert.equal(asked.code, 0, asked.err || asked.out);
+ const ask = JSON.parse(asked.out).id;
+ const wrongAnswer = box.run(second.path, 'answer', String(ask), 'wrong agent');
+ assert.equal(wrongAnswer.code, 1);
+ assert.ok(wrongAnswer.err.includes(`addressed to ${builderName}, not your web lane (agent ${otherName})`), wrongAnswer.err);
+ assert.equal(box.run(box.repo, 'hold', 'web', '--reason', 'Keep web-1 literal in the reason').code, 0);
+ const waiting = box.run(second.path, 'next', '--build');
+ assert.equal(waiting.code, 1);
+ assert.ok(waiting.err.includes(`${coordinatorName} holds the web lane: Keep web-1 literal in the reason`), waiting.err);
+ const additional = box.run(box.repo, 'add', 'web', 'Another item', '--specs', 'G1', '--json');
+ assert.equal(additional.code, 0, additional.err || additional.out);
+ const id2 = JSON.parse(additional.out).item.item_id;
+ const laneHeld = box.run(second.path, 'claim', String(id2));
+ assert.equal(laneHeld.code, 1);
+ assert.ok(laneHeld.err.includes(`${coordinatorName} holds the web lane: Keep web-1 literal in the reason`), laneHeld.err);
+ const wrongEdit = box.run(second.path, 'edit', String(id2), '--brief', 'not mine');
+ assert.equal(wrongEdit.code, 1);
+ assert.ok(wrongEdit.err.includes(`only the coordinator or ${coordinatorName}, who added`), wrongEdit.err);
+ assert.equal(box.run(box.repo, 'hold', 'web', '--off').code, 0);
+ const submitted = box.run(box.web, 'submit', String(id));
+ assert.equal(submitted.code, 0, submitted.err || submitted.out);
+ const reserved = box.run(second.path, 'next', '--verify', String(id));
+ assert.equal(reserved.code, 0, reserved.err || reserved.out);
+ const reviewHeld = box.run(box.repo, 'next', '--verify', String(id), '--as', 'coordinator');
+ assert.equal(reviewHeld.code, 1);
+ assert.ok(reviewHeld.err.includes(`${otherName} holds the review of #${id}`), reviewHeld.err);
+ const reviewWaiting = box.run(box.repo, 'next', '--verify', '--as', 'coordinator');
+ assert.equal(reviewWaiting.code, 1);
+ assert.ok(reviewWaiting.err.includes(`${otherName} holds the review of #${id}`), reviewWaiting.err);
+ const identity = box.run(box.web, 'whoami', '--json');
+ assert.equal(identity.code, 0, identity.err || identity.out);
+ assert.equal(JSON.parse(identity.out).id, 'web-1');
+ assert.equal(JSON.parse(identity.out).displayName, builderName);
+ const log = box.run(box.repo, 'log', '--json');
+ assert.equal(log.code, 0, log.err || log.out);
+ const claim = JSON.parse(log.out).events.find((event) => event.event_kind === 'claim' && event.item_id === id);
+ assert.equal(claim.event_by, 'web-1');
+ assert.equal(JSON.parse(claim.event_detail).model, 'Claude');
+ }
+});
diff --git a/test/machine.test.js b/test/machine.test.js
index eb274b74..5565618c 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -1064,12 +1064,12 @@ test('next --verify reserves the review for the reviewLease and says until when;
const passed = run(other, 'next', '--verify');
assert.equal(passed.status, 1, passed.stdout);
assert.match(passed.stderr, /NOTHING_FREE/);
- assert.ok(passed.stderr.includes(`web-2 holds the review of #1 until ${until}`), passed.stderr);
+ assert.ok(passed.stderr.includes(`web-2 (Test Model) holds the review of #1 until ${until}`), passed.stderr);
git(other, 'switch', '-q', '--detach', commit);
const refused = run(other, 'verify', '1', 'accept', '--note', 'it greets');
assert.equal(refused.status, 1, refused.stdout);
assert.match(refused.stderr, /REVIEW_HELD/);
- assert.ok(refused.stderr.includes(`web-2 holds the review of #1 until ${until}`), refused.stderr);
+ assert.ok(refused.stderr.includes(`web-2 (Test Model) holds the review of #1 until ${until}`), refused.stderr);
const renewed = run(holder, 'next', '--verify');
const again = /reserved for you until (\S+):/.exec(renewed.stdout)?.[1];
diff --git a/test/show.test.js b/test/show.test.js
index 5a632e73..0502b15a 100644
--- a/test/show.test.js
+++ b/test/show.test.js
@@ -123,7 +123,7 @@ test('show prints the latest verdict in full and earlier ones as one line; --his
const whole = run('show', '2');
assert.equal(whole.status, 0, whole.stderr);
- assert.ok(whole.stdout.includes(`REJECT TEST_FAILURE by web-2 (unknown) at dddddddddddd: ${EXACT}\n`), 'a first line of exactly 120 characters is printed whole');
+ assert.ok(whole.stdout.includes(`REJECT TEST_FAILURE by web-2 (unknown) at dddddddddddd: ${EXACT}\n`), 'a first line of exactly 120 characters is printed whole');
assert.doesNotMatch(whole.stdout, /earlier verdicts shortened/, 'no hint when no earlier note was shortened');
const breaks = run('show', '3');