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(help): show required model flags [O3]

Corey Olson56519db45fcf
diff --git a/src/cli.js b/src/cli.js
index 55a924e0..8b47a02e 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -503,7 +503,7 @@ async function bindCheckoutSession(io, positionals, values) {
if (!info.isMain) {
const ctx = context(io);
agent = withBoard(ctx, (board) => store.agentAt(board, info.root)?.agent_id);
- if (!agent && command !== 'join') throw new Refused('NOT_JOINED', 'this worktree has not joined a lane; run pullboard join <lane>');
+ if (!agent && command !== 'join') throw new Refused('NOT_JOINED', 'this worktree has not joined a lane; run pullboard join <lane> --model "<model name>"');
}
const lease = await bindLocalSession(info, { agent: agent ?? 'unjoined agent', digest, takeover: command === 'takeover', keepLease: !['run', 'next'].includes(command),
/** Use an existing ordered shout so takeover has a receipt without changing the board format. */
diff --git a/src/help.js b/src/help.js
index 5cc8861f..8ffec3fc 100644
--- a/src/help.js
+++ b/src/help.js
@@ -176,7 +176,8 @@ 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 "my-model"',
+ join: 'pullboard join web --model "my-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',
fact: 'pullboard fact 12 measurement "The check passes in 8 seconds"',
diff --git a/test/help-examples.test.js b/test/help-examples.test.js
new file mode 100644
index 00000000..4e9f621f
--- /dev/null
+++ b/test/help-examples.test.js
@@ -0,0 +1,45 @@
+/** Every help example supplies each required flag in its primary usage [O3]. */
+import assert from 'node:assert/strict';
+import { join } from 'node:path';
+import { test } from 'node:test';
+import { createE2eHelpers } from './e2e-helpers.js';
+
+/** Read flags that appear outside optional square-bracket groups in a usage line. */
+function requiredFlags(usage) {
+ const flags = [];
+ let optionalDepth = 0;
+ for (let index = 0; index < usage.length; index += 1) {
+ if (usage[index] === '[') optionalDepth += 1;
+ else if (usage[index] === ']') optionalDepth = Math.max(0, optionalDepth - 1);
+ else if (optionalDepth === 0 && usage.startsWith('--', index)) {
+ const match = usage.slice(index).match(/^--[a-z][a-z-]*/u);
+ if (match) flags.push(match[0]);
+ }
+ }
+ return [...new Set(flags)];
+}
+
+test('every help example carries its required flags [O3]', async () => {
+ const { HELP } = await import('../src/help.js');
+ for (const [name, declaration] of Object.entries(HELP.commands)) {
+ const usage = declaration.usages[0];
+ for (const flag of requiredFlags(usage)) {
+ assert.ok(declaration.example.split(/\s+/u).includes(flag), `${name}: ${declaration.example} must include ${flag} from ${usage}`);
+ }
+ }
+});
+
+test('an unjoined worktree gets a model-bearing join instruction [O3]', (context) => {
+ const helpers = createE2eHelpers();
+ context.after(helpers.cleanup);
+ const box = helpers.sandbox();
+ box.env.PULLBOARD_MODEL = 'fixture-model';
+ const project = helpers.project(undefined, box);
+ const unjoined = join(box.dir, 'unjoined');
+ box.git(project.repo, 'worktree', 'add', '-q', '--detach', unjoined);
+ box.env.AI_AGENT = '1';
+ box.env.CODEX_THREAD_ID = 'unjoined-help-example-fixture';
+ const refused = box.run(unjoined, 'claim', '1');
+ assert.equal(refused.code, 1, refused.err);
+ assert.match(refused.err, /\[NOT_JOINED\].*run pullboard join <lane> --model "<model name>"/);
+});