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): preserve model attribution across flows [O8,O3]

Corey Olsonf109b6bbf89b
diff --git a/docs/formats.md b/docs/formats.md
index c5424d75..e50227af 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -223,7 +223,7 @@ Each connection also has a temporary `moving(token INTEGER)` table and `status_t
## Event log
-The `event` table is a SQLite schema object governed by `SCHEMA_VERSION`; its append-only record format has the independent `EVENT_LOG_VERSION`. Each event has an increasing integer id, an ISO timestamp, the actor, the event kind, an optional item id, and a JSON object in `event_detail`. Board moves append their event inside the same immediate transaction as the move. Events are append-only; board triggers reject updates and deletes. The actor column is the acting agent id, except guard-repair events, which use `board`. The following rows name the emitted kinds and the union of their detail keys:
+The `event` table is a SQLite schema object governed by `SCHEMA_VERSION`; its append-only record format has the independent `EVENT_LOG_VERSION`. Each event has an increasing integer id, an ISO timestamp, the actor, the event kind, an optional item id, and a JSON object in `event_detail`. Board moves append their event inside the same immediate transaction as the move. Events are append-only; board triggers reject updates and deletes. The actor column is the acting agent id, except guard-repair events, which use `board`. Each event by a registered agent also carries a `model` string snapshot in `event_detail`; legacy agents without a declaration use `unknown`. This common snapshot is separate from the per-kind payload fields listed below. The following rows name the emitted kinds and the union of their operation-specific detail keys:
<!-- events:start -->
| Kind | Actor | Detail fields |
diff --git a/docs/formats.test.js b/docs/formats.test.js
index a411d45f..b0e28022 100644
--- a/docs/formats.test.js
+++ b/docs/formats.test.js
@@ -360,7 +360,9 @@ test('[A5] schema, versions, event kinds and event detail fields match live beha
const entry = actual[kind] ?? { actors: new Set(), fields: new Set() };
const actor = actorByKind[kind] ?? actors[row.event_by] ?? 'unknown';
entry.actors.add(actor);
- for (const field of Object.keys(row.detail)) entry.fields.add(field);
+ for (const field of Object.keys(row.detail)) {
+ if (field !== 'model') entry.fields.add(field);
+ }
actual[kind] = entry;
}
const documented = documentedEvents();
diff --git a/src/cli.js b/src/cli.js
index 46a196e7..5cf682e0 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -193,7 +193,7 @@ const HELP_GROUPS = [
];
const HELP_EXAMPLES = {
- tour: 'pullboard tour', init: 'pullboard init', worktree: 'pullboard worktree web --model "Claude Sonnet"', join: 'pullboard join web --model "Claude Sonnet"', resume: 'pullboard resume',
+ tour: 'pullboard tour', init: 'pullboard init', worktree: 'pullboard worktree web --model "Example Model"', join: 'pullboard join web --model "Example Model"', 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"',
diff --git a/src/exchange.js b/src/exchange.js
index fa2ec72f..8c896a92 100644
--- a/src/exchange.js
+++ b/src/exchange.js
@@ -127,7 +127,10 @@ function hasOnlyInitCoordinator(db, names) {
|| sequence[0].seq !== 1
) return false;
try {
- if (JSON.stringify(JSON.parse(event.event_detail)) !== JSON.stringify({ lane: 'coordinator' })) return false;
+ const detail = JSON.parse(event.event_detail);
+ if (detail.model !== undefined && detail.model !== 'unknown') return false;
+ delete detail.model;
+ if (JSON.stringify(detail) !== JSON.stringify({ lane: 'coordinator' })) return false;
} catch {
return false;
}
diff --git a/test/api-requests.test.js b/test/api-requests.test.js
index e3a98859..bdea2e50 100644
--- a/test/api-requests.test.js
+++ b/test/api-requests.test.js
@@ -97,7 +97,7 @@ test('[A2] successful shouts and answers each append their corresponding event',
assert.equal(answerEvent.event_by, 'coordinator');
assert.equal(answerEvent.event_kind, 'answer');
assert.deepEqual(JSON.parse(answerEvent.event_detail), {
- shout: answer, to: 'person', decision: false, request: false, answers: request, outcome: 'done',
+ shout: answer, to: 'person', decision: false, request: false, answers: request, outcome: 'done', model: 'unknown',
});
assert.deepEqual(afterAnswer.slice(-2).map((event) => event.event_id), [requestEvent.event_id, answerEvent.event_id]);
assert.equal(store.getShout(board, answer).shout_answers, request);
diff --git a/test/api.test.js b/test/api.test.js
index 02fa6561..2fdb49ad 100644
--- a/test/api.test.js
+++ b/test/api.test.js
@@ -275,7 +275,7 @@ test('[A1] command results match the catalog across roots and subcommands', () =
const plainStatus = box.run(repo, 'status');
assert.equal(plainStatus.status, 0, plainStatus.stderr);
assert.equal(plainStatus.stderr, '');
- assert.match(plainStatus.stdout, /^coordinator: /, 'ordinary text mode remains readable');
+ assert.match(plainStatus.stdout, /^coordinator \(unknown\): /, 'ordinary text mode remains readable');
assert.throws(() => JSON.parse(plainStatus.stdout));
json(box, repo, 'inbox');
json(box, repo, 'decisions');
diff --git a/test/board.test.js b/test/board.test.js
index 00b5442d..a38e709f 100644
--- a/test/board.test.js
+++ b/test/board.test.js
@@ -580,7 +580,7 @@ test('an item carries a brief; editing it changes how to build, never what [B10]
assert.throws(() => store.editItem(board, id, { agentId: 'api-1', brief: 'mine now' }), /NOT_YOURS.*coordinator/);
assert.throws(() => store.editItem(board, id, { agentId: 'coordinator' }), /USAGE/);
assert.throws(() => store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Huge', brief: 'x'.repeat(8001) }), /BRIEF_TOO_LONG/);
- assert.deepEqual(JSON.parse(store.events(board, { itemId: id }).find((event) => event.event_kind === 'edit').event_detail), { brief: '38 characters' });
+ assert.deepEqual(JSON.parse(store.events(board, { itemId: id }).find((event) => event.event_kind === 'edit').event_detail), { brief: '38 characters', model: 'unknown' });
store.submit(board, id, { agentId: 'web-1', commit: SHA_A, tree: 't' });
store.verify(board, id, { agentId: 'web-2', decision: 'ACCEPT', head: SHA_A, digest, policy: 'any', note: 'removed the help case; its test failed' });
assert.throws(() => store.editItem(board, id, { agentId: 'coordinator', brief: 'late' }), /CLOSED/);
@@ -636,7 +636,7 @@ test('changing a criterion or a check drops the frozen bar, in the open; the nex
store.editItem(board, id, { agentId: 'coordinator', check: 'npm test', criterion: 'renders' });
assert.equal(store.getItem(board, id).item_frozen_digest, null);
const edit = store.events(board, { itemId: id }).find((event) => event.event_kind === 'edit');
- assert.deepEqual(JSON.parse(edit.event_detail), { criterion: 'renders', check: 'npm test', unfrozen: 'digest:Page' });
+ assert.deepEqual(JSON.parse(edit.event_detail), { criterion: 'renders', check: 'npm test', unfrozen: 'digest:Page', model: 'unknown' });
assert.equal(claimAs(id, 'web-1', 'web').digest, 'digest:Page');
});
@@ -656,7 +656,7 @@ test('escalate frees an item one tier up, with what was tried attached [B15]', (
const moves = store.events(board, { itemId: id }).map((event) => event.event_kind).filter((kind) => ['attempt', 'escalate'].includes(kind));
assert.deepEqual(moves, ['attempt', 'escalate', 'escalate', 'escalate']);
const first = store.events(board, { itemId: id }).find((event) => event.event_kind === 'escalate');
- assert.deepEqual(JSON.parse(first.event_detail), { from: 'light', to: 'mid', note: 'check failed twice', attempt: 'refs/pullboard/attempts/1/abc' }, 'the failure and the pinned attempt travel with it');
+ assert.deepEqual(JSON.parse(first.event_detail), { from: 'light', to: 'mid', note: 'check failed twice', attempt: 'refs/pullboard/attempts/1/abc', model: 'unknown' }, 'the failure and the pinned attempt travel with it');
});
test('a fresh claim records where the work started; submit records what it changed, reworks included [N21]', () => {
diff --git a/test/e2e.test.js b/test/e2e.test.js
index 83b387b8..f6760244 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -497,9 +497,9 @@ test('pullboard worktree makes a joined worktree for a lane in one command [I4]'
const made = box.run(box.repo, 'worktree', 'api');
assert.equal(made.code, 0, made.err);
const path = join(box.dir, 'repo-api-1');
- assert.match(made.out, /on branch api\/1, joined as api-1 in the api lane/);
+ assert.match(made.out, /on branch api\/1, joined as api-1 \(Test Model\) in the api lane/);
assert.match(made.out, new RegExp(`start every command with: cd ${path} &&\n {2}cd ${path} && pullboard inbox\n {2}cd ${path} && pullboard next`));
- assert.match(box.run(path, 'whoami').out, /^api-1 \(api lane\)/);
+ assert.match(box.run(path, 'whoami').out, /^api-1 \(Test Model\) \(api lane\)/);
assert.match(box.run(box.repo, 'worktree', 'api').out, /repo-api-2 on branch api\/2, joined as api-2/);
assert.match(box.run(box.repo, 'worktree', 'nope').err, /NO_LANE/);
});
@@ -645,7 +645,7 @@ test('verify runs at the submitted commit, against the criterion frozen at claim
assert.match(box.run(box.web, 'verify', '1', 'accept').err, /SELF_VERIFY/);
const unsaid = box.run(box.repo, 'verify', '1', 'accept', '--note', 'ran it');
assert.match(unsaid.err, /MAIN_IS_COORDINATOR\] this is the main checkout, so this verdict would be the coordinator's/);
- assert.match(unsaid.err, new RegExp(`Agent worktrees: web-1 at ${box.web}`));
+ assert.match(unsaid.err, new RegExp(`Agent worktrees: web-1 \\(Test Model\\) at ${box.web}`));
assert.match(box.run(box.web, 'verify', '1', 'accept', '--as', 'coordinator').err, /USAGE.*only in the main checkout/);
assert.match(box.run(box.repo, 'verify', '1', 'accept', '--as', 'coordinator').err, /NOT_AT_COMMIT/);
box.git(box.repo, 'merge', '-q', '--ff-only', 'web/one');
@@ -958,9 +958,9 @@ test('an item carries a brief to whoever claims it; a light agent sees only its
assert.match(box.run(box.repo, 'list').out, /#2 {2}open {2}web {2}Copy the header {2}light/);
assert.doesNotMatch(box.run(box.repo, 'list', '--route', 'light').out, /Design the page/);
const made = box.run(box.repo, 'worktree', 'web', '--route', 'light');
- assert.match(made.out, /joined as web-2 in the web lane, on the light route/);
+ assert.match(made.out, /joined as web-2 \(Test Model\) in the web lane, on the light route/);
const light = made.out.match(/^made (\S+) /)[1];
- assert.match(box.run(light, 'whoami').out, /^web-2 \(web lane, light route\)/);
+ assert.match(box.run(light, 'whoami').out, /^web-2 \(Test Model\) \(web lane, light route\)/);
const next = box.run(light, 'next');
assert.match(next.out, /claimed #2: Copy the header\ncriterion: the page shows the header\ncheck: test -f web\/page.js {3}\(run it before you submit\)\nbrief:\n {2}Files:\n {2}- web\/page.js/);
assert.match(box.run(light, 'claim', '1').err, /ROUTE/);
@@ -1011,8 +1011,8 @@ test('run builds routed items unattended: the failure feeds the next attempt; re
const shown = box.run(box.repo, 'show', '2').out;
assert.match(shown, /#2 {2}open {2}web {2}Say bye {2}mid/);
assert.match(shown, /unattended attempts: red, red/);
- assert.match(shown, /escalated light -> mid by web-2, pinned at refs\/pullboard\/attempts\/2\/[0-9a-f]{12}: 2 attempts stayed red/);
- assert.match(box.run(box.repo, 'inbox').out, /web-2 -> coordinator: #2 escalated light -> mid after 2 red attempts/);
+ assert.match(shown, /escalated light -> mid by web-2 \(Test Model\), pinned at refs\/pullboard\/attempts\/2\/[0-9a-f]{12}: 2 attempts stayed red/);
+ assert.match(box.run(box.repo, 'inbox').out, /web-2 \(Test Model\) -> coordinator \(unknown\): #2 escalated light -> mid after 2 red attempts/);
});
test('one runner climbs the tiers: an escalated item goes to the next command, with the earlier tries; it merges the verified work an item waits on [N16]', () => {
@@ -1123,7 +1123,7 @@ test('resume puts an agent back to work from the board: its claim, its branch, w
assert.match(building, /1 file uncommitted/);
assert.match(building, /holding #1 Page, lease \d+[mh] left/);
assert.match(building, /files: web\/page\.html/);
- assert.match(building, /1 unread shout; newest from coordinator: the heading text is in G1/);
+ assert.match(building, /1 unread shout; newest from coordinator \(unknown\): the heading text is in G1/);
assert.match(building, /next: build #1, commit, then pullboard submit 1/);
box.git(box.web, 'add', '-A');
box.git(box.web, 'commit', '-q', '-m', 'feat(web): page [G1]');
@@ -1138,7 +1138,7 @@ test('resume puts an agent back to work from the board: its claim, its branch, w
assert.match(back, /branch web\/one: main is detached for a verification/);
box.git(box.repo, 'switch', '-q', 'main');
assert.match(box.run(box.web, 'resume').out, /branch web\/one: 1 ahead of main, 0 behind/);
- assert.match(back, /sent back: #1 TEST_FAILURE by coordinator: no test proves the heading$/m);
+ assert.match(back, /sent back: #1 TEST_FAILURE by coordinator \(unknown\): no test proves the heading$/m);
assert.match(back, /next: pullboard claim 1, fix what the verifier found, and submit again/);
});
@@ -1178,7 +1178,7 @@ test('hold pauses a lane: next names who held it and why; --off lets it go [N22]
assert.equal(held.code, 1);
assert.match(held.err, /coordinator 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: G1 is being rewritten/);
+ 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/);
assert.match(box.run(box.web, 'next').out, /claimed #1: Page/);
});
@@ -1216,10 +1216,10 @@ test('the tour runs a reject and its rework on a throwaway repo, in under thirty
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: greet\(''\) returns "Hello, !"/);
+ assert.match(shown.stdout, /sent back: #1 BEHAVIOR_MISMATCH by review-1 \(Test Model\): 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 \| review-1 \|/);
+ assert.match(shown.stdout, /\| 1 \| app \| Greeting \| G1 \| app-1 \(Test Model\) \| review-1 \(Test Model\) \|/);
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}`);
@@ -1608,7 +1608,7 @@ test('from the view the person adds items, shouts and holds lanes, through the C
const shouted = await view.act(box.repo, { verb: 'shout', args: { to: 'web', text: 'from the person' } });
assert.equal(shouted.status, 200);
assert.equal(shouted.document.event.event_kind, 'shout');
- assert.match(box.run(box.web, 'inbox').out, /coordinator -> web: from the person/);
+ assert.match(box.run(box.web, 'inbox').out, /coordinator \(unknown\) -> web: from the person/);
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');
diff --git a/test/machine.test.js b/test/machine.test.js
index 01a0e795..eb274b74 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -1059,7 +1059,7 @@ test('next --verify reserves the review for the reviewLease and says until when;
assert.ok(until, first.stdout);
const lease = 45 * 60_000;
assert.ok(Date.parse(until) >= before + lease && Date.parse(until) <= after + lease, `${until} is 45 minutes on, the repo's reviewLease`);
- assert.ok(run(repo, 'show', '1').stdout.includes(`under review by web-2 until ${until}`), 'show names the holder and the time');
+ assert.ok(run(repo, 'show', '1').stdout.includes(`under review by web-2 (Test Model) until ${until}`), 'show names the holder and the time');
const passed = run(other, 'next', '--verify');
assert.equal(passed.status, 1, passed.stdout);
diff --git a/test/show.test.js b/test/show.test.js
index 57ff15d7..5a632e73 100644
--- a/test/show.test.js
+++ b/test/show.test.js
@@ -103,10 +103,10 @@ test('show prints the latest verdict in full and earlier ones as one line; --his
assert.equal(plain.status, 0, plain.stderr);
const verdictLines = plain.stdout.split('\n').filter((line) => /^(REJECT|ACCEPT) /.test(line));
assert.deepEqual(verdictLines.slice(0, 2), [
- `REJECT TEST_FAILURE by web-2 at aaaaaaaaaaaa: ${LEAD}${FAMILY}…`,
- 'REJECT TEST_FAILURE by web-2 at bbbbbbbbbbbb: Second reject: the guard returns undefined.',
+ `REJECT TEST_FAILURE by web-2 (unknown) at aaaaaaaaaaaa: ${LEAD}${FAMILY}…`,
+ 'REJECT TEST_FAILURE by web-2 (unknown) at bbbbbbbbbbbb: Second reject: the guard returns undefined.',
], 'earlier verdicts are one line each: decision, reason, verifier, commit, the note\'s first line cut at 120 characters');
- assert.ok(plain.stdout.includes(`ACCEPT CRITERION_MET by web-2 at cccccccccccc: ${NOTES[2]}`), 'the latest verdict keeps its full note');
+ assert.ok(plain.stdout.includes(`ACCEPT CRITERION_MET by web-2 (unknown) at cccccccccccc: ${NOTES[2]}`), 'the latest verdict keeps its full note');
for (const later of ['keeps going past the cut', 'Repro: greet("") throws.', 'Repro: greet("") is undefined.']) {
assert.ok(!plain.stdout.includes(later), `an earlier note's cut and later lines are left out: ${later}`);
}
@@ -123,13 +123,13 @@ 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 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');
assert.equal(breaks.status, 0, breaks.stderr);
Object.keys(BREAKS).forEach((name, round) => {
- assert.ok(breaks.stdout.includes(`REJECT TEST_FAILURE by web-2 at ${String(round + 1).repeat(12)}: Break ${name} first.\n`), `${name} ends the first line`);
+ assert.ok(breaks.stdout.includes(`REJECT TEST_FAILURE by web-2 (unknown) at ${String(round + 1).repeat(12)}: Break ${name} first.\n`), `${name} ends the first line`);
});
assert.doesNotMatch(breaks.stdout, /hidden after/, 'nothing after any break is printed');
});