Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
feat: keep agent identity out of the main checkout [B12,V9,N13,I5]
Corey Olson9536db1b1dfc
diff --git a/skills/pullboard-plan/SKILL.md b/skills/pullboard-plan/SKILL.mdindex dbc1f43b..505560fd 100644--- a/skills/pullboard-plan/SKILL.md+++ b/skills/pullboard-plan/SKILL.md@@ -11,7 +11,7 @@ You turn approved rows into items builders can claim. You do not build.2. **Contracts first.** Find what two lanes will share: a data shape, a module's functions, a file format. Make one item for each shared contract, in the lane that will own it, and add the items that use it with `--after <its id>`. A builder waiting on a contract claims something else; nobody copies another lane's code.3. **One item per verifiable piece.** Each item:- sits in the lane that owns its files- - cites the rows it serves with `--specs`+ - cites with `--specs` only the rows it meets in full; a verifier rejects an item that cites a row it does not meet- has a `--criterion` a stranger could check without asking you, with the exact command, input and expected output- has a `--brief` (or `--brief-file`) when a builder starting cold would need more than the criterion: the files to touch, the contract to follow, the pattern to copy, the command that proves it. The criterion says what; the brief says how.4. **Route the mechanical work light.** When the brief says exactly what to change, where, and how to prove it, a lighter model can build it: `--route light`. Leave on the default strong route anything that needs judgment: a shared contract, a design choice, an edge the brief cannot settle. Agents that join with `--route light` take only light items; strong agents take strong items first.diff --git a/skills/pullboard-verify/SKILL.md b/skills/pullboard-verify/SKILL.mdindex 7d8da3da..3e232f61 100644--- a/skills/pullboard-verify/SKILL.md+++ b/skills/pullboard-verify/SKILL.md@@ -7,8 +7,10 @@ description: Verify another agent's submitted item at its exact commit, againstYou never verify your own work. You judge the frozen criterion as written, at the commit that was submitted.+Work only in your own worktree, the one `pullboard worktree review` made. Your shell may start each command in the main checkout, which is the coordinator's, so begin every command with `cd <your worktree> &&`. Never switch the main checkout to another commit.+1. `pullboard next --verify` names the next submitted item you did not build, and its commit. `pullboard show <id>` gives the criterion as frozen at claim.-2. Check out exactly that commit: `git switch --detach <commit>`.+2. Check out exactly that commit, in your worktree: `cd <your worktree> && git switch --detach <commit>`.3. Run the gate. Then test the criterion itself, with the strongest proof you can get:- **Break it and watch it fail.** Revert or break the change, show the check fails, restore it, show it passes.- **Use the method the criterion names.** If it says "two real processes" or "after a restart", use exactly that; a weaker stand-in is not proof.@@ -18,6 +20,7 @@ You never verify your own work. You judge the frozen criterion as written, at th- **Try the edges.** Today and yesterday for dates; zero, one and the limit for numbers; empty for lists; the first and the last. Most bugs live at an edge the builder's tests skipped.- **Keep checks contained.** Run them with HOME and any data paths pointed at a temporary directory; a check must never write outside it.4. Decide:+ - Every row the item cites must be met. If it cites a row it does not serve, reject with OTHER and name the row, so the coordinator fixes the citation; never accept around it.- `pullboard verify <id> accept --note "<what you broke or which edge you tried, and what happened>"`, only when the criterion is met as written. The note is required: passing tests alone are not proof.- `pullboard verify <id> reject --reason <CODE> --note "<what failed, and the proof that would settle it>"`. The codes are TEST_FAILURE, BEHAVIOR_MISMATCH, INSUFFICIENT_EVIDENCE, STALE_HEAD and OTHER.5. If the check could not run for reasons that are not the work's fault, such as a broken environment or a flaky run under load, do not reject. Shout the coordinator what happened.diff --git a/src/board.js b/src/board.jsindex 90b36247..2a2b7d54 100644--- a/src/board.js+++ b/src/board.js@@ -444,11 +444,13 @@ export function editItem(board, id, { agentId, brief, route }) {}/**- * Claim an item, or renew your own claim (B4, B5, V2).+ * Claim an item, or renew your own claim (B4, B5, B12, V2).** One live top-level claim per agent, so nobody hoards; child items are free, which is how- * sub-agents share a lane. A lapsed claim can be taken. The first claim freezes the criterion:- * `freeze` returns the text and digest the verdict will later be held to.+ * sub-agents share a lane. A lapsed claim can be taken. Every item is built in its own lane, the+ * coordinator's included, so no agent can build another lane's work from the main checkout. The+ * first claim freezes the criterion: `freeze` returns the text and digest the verdict will later be+ * held to.** @param {any} board* @param {number} id@@ -461,8 +463,13 @@ export function claim(board, id, { agentId, lane, leaseMs, freeze }) {if (['submitted', 'verified', 'withdrawn'].includes(item.item_status)) {throw new Refused('NOT_CLAIMABLE', `item #${id} is ${item.item_status}`);}- if (lane !== COORDINATOR && item.item_lane !== lane) {- throw new Refused('WRONG_LANE', `item #${id} is in the ${item.item_lane} lane; you are in ${lane}`);+ if (item.item_lane !== lane) {+ throw new Refused(+ 'WRONG_LANE',+ lane === COORDINATOR+ ? `item #${id} is in the ${item.item_lane} lane, and lane items are built from that lane's worktree, never the main checkout. An agent runs: cd <its own worktree> && pullboard claim ${id}`+ : `item #${id} is in the ${item.item_lane} lane; you are in ${lane}`,+ );}if (item.item_route !== 'light' && routeOf(board, agentId) === 'light') {throw new Refused('ROUTE', `item #${id} needs a strong model; you joined on the light route. Take the next light item: pullboard next`);@@ -887,7 +894,7 @@ export function nextFor(board, { agentId, lane, verify = false }) {}const held = items.find((entry) => entry.item_status === 'claimed' && entry.item_owner === agentId && entry.item_parent_id === null);if (held) return { item: held, reasons: [] };- const open = items.filter((entry) => entry.item_status === 'open' && (lane === COORDINATOR || entry.item_lane === lane));+ const open = items.filter((entry) => entry.item_status === 'open' && entry.item_lane === lane);const mine = [...open.filter((entry) => entry.item_route !== 'light'), ...open.filter((entry) => entry.item_route === 'light')];const reasons = [];for (const entry of mine) {@@ -895,12 +902,41 @@ export function nextFor(board, { agentId, lane, verify = false }) {.map((id) => current(board, itemById(board, id))).filter((before) => before.item_status !== 'verified');if (!waiting.length) return { item: entry, reasons: [] };- reasons.push(`#${entry.item_id} waits on ${waiting.map((before) => `#${before.item_id} (${before.item_status})`).join(', ')}`);+ reasons.push(`#${entry.item_id} waits on ${waiting.map(waitingOn).join(', ')}`);}- if (!mine.length) reasons.push(`no open ${routed}items in the ${lane} lane`);+ if (!mine.length) reasons.push(idleReason(items, lane, routed));return { item: null, reasons };}+/**+ * An item something waits on, as the waiting agent needs it: its state, whether a verifier sent it+ * back, and the lane to shout.+ *+ * @param {any} item+ * @returns {string}+ */+function waitingOn(item) {+ const rejected = item.item_status === 'open' && item.item_verdict === 'REJECT' ? ', rejected' : '';+ return `#${item.item_id} (${item.item_status}${rejected}, ${item.item_lane} lane)`;+}++/**+ * Why a lane has nothing to claim (N13): a lane whose items still await verdicts is not done, since+ * a rejected item comes back to it; the coordinator builds only its own lane's items.+ *+ * @param {any[]} items - Items not yet verified or withdrawn, as the agent may see them.+ * @param {string} lane+ * @param {string} routed+ * @returns {string}+ */+function idleReason(items, lane, routed) {+ const reason = `no open ${routed}items in the ${lane} lane`;+ if (lane === COORDINATOR) return `${reason}; lane items are built from each lane's own worktree`;+ const awaiting = items.filter((entry) => entry.item_lane === lane && entry.item_status === 'submitted').map((entry) => `#${entry.item_id}`);+ if (!awaiting.length) return reason;+ return `${reason}; ${awaiting.join(', ')} still await${awaiting.length === 1 ? 's' : ''} a verdict, and a rejected item comes back to this lane. A lane is done when its items are verified`;+}+/*** Counts for the status line and the ledger's summary: items by status, verdicts by decision.*diff --git a/src/cli.js b/src/cli.jsindex c47e8bf7..2fb4a16d 100644--- a/src/cli.js+++ b/src/cli.js@@ -59,6 +59,7 @@ Workpullboard show <id> an item, the criterion frozen at claim, its verdictspullboard next [--wait <minutes>] claim the next item in your lane that is free to startpullboard next --verify name the next submitted item you can check+ in the main checkout, verifying needs --as coordinatorpullboard claim <id> take or renew a lease; the first claim freezes the criterionpullboard release <id> hand it backpullboard submit <id> needs a clean tree and the gate green at HEAD (alias: done)@@ -102,6 +103,7 @@ const OPTIONS = {brief: { type: 'string' },'brief-file': { type: 'string' },route: { type: 'string' },+ as: { type: 'string' },wait: { type: 'string' },verify: { type: 'boolean' },all: { type: 'boolean' },@@ -150,6 +152,40 @@ function briefArg(io, values) {return readFileSync(file, 'utf8');}+/**+ * The start of a command an agent can paste anywhere: agent shells often start each command in the+ * main checkout, so every command pullboard suggests names its folder (I5).+ *+ * @param {string} root+ * @returns {string}+ */+const cdTo = (root) => `cd ${/[\s'"$]/.test(root) ? JSON.stringify(root) : root} &&`;++/**+ * Verifying from the main checkout files the verdict as the coordinator's (V9). An agent whose+ * shell started there would be taken for the coordinator, so the coordinator says so explicitly+ * and anyone else is sent back to a worktree.+ *+ * @param {any} ctx+ * @param {any} board+ * @param {any} values+ */+function checkMainVerifier(ctx, board, values) {+ if (values.as !== undefined && values.as !== COORDINATOR) throw new Refused('USAGE', '--as takes one value: coordinator');+ if (!ctx.info.isMain) {+ if (values.as) throw new Refused('USAGE', '--as coordinator works only in the main checkout; here you are the agent this worktree joined as');+ return;+ }+ 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 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',+ `this is the main checkout, so this verdict would be the coordinator's. An agent verifies from its own worktree, starting every command with cd <worktree> &&.${listed}${detached} The coordinator adds --as coordinator`,+ );+}+/*** Print an item's brief, indented under a heading, when it has one.*@@ -299,10 +335,10 @@ function worktreeFor(io, lane, route) {const root = git(pathFor(n), ['rev-parse', '--show-toplevel']);const id = withBoard(ctx, (board) => store.register(board, { lane, path: root, route }));io.say(`made ${root} on branch ${lane}/${n}, joined as ${id} in the ${lane} lane${route === 'light' ? ', on the light route' : ''}`);- io.say('next, from that folder:');- io.say(` cd ${root}`);- if (existsSync(join(root, 'package.json'))) io.say(' npm install (its own install, so its tests run its own code)');- io.say(` pullboard inbox, then pullboard list ${lane}`);+ 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`);return 0;}@@ -465,6 +501,7 @@ function verifyHere(ctx, id, { second, values }) {if (!decision) throw new Refused('USAGE', 'pullboard verify <id> accept, or reject --reason CODE --note "..."');const { root } = ctx.info;const result = withBoard(ctx, (board) => {+ checkMainVerifier(ctx, board, values);const me = whoAmI(ctx, board);const item = store.getItem(board, id);if (item.item_status !== 'submitted') {@@ -473,7 +510,7 @@ function verifyHere(ctx, id, { second, values }) {const head = headCommit(root) ?? '';const commit = resolveCommit(root, item.item_commit);if (!commit || !contains(root, commit, head)) {- throw new Refused('NOT_AT_COMMIT', `check out the submitted commit first: git switch --detach ${item.item_commit.slice(0, 12)}`);+ throw new Refused('NOT_AT_COMMIT', `check out the submitted commit first: ${cdTo(root)} git switch --detach ${item.item_commit.slice(0, 12)}`);}let digest = 'missing';try {@@ -505,6 +542,7 @@ function verifyHere(ctx, id, { second, values }) {*/function nextOnce(ctx, values) {return withBoard(ctx, (board) => {+ if (values.verify) checkMainVerifier(ctx, board, values);const me = whoAmI(ctx, board);const { item, reasons } = store.nextFor(board, { agentId: me.id, lane: me.lane, verify: values.verify });if (!item) return { reasons };@@ -539,16 +577,18 @@ async function nextHere(io, values) {const found = nextOnce(ctx, values);if (found.item) {const item = found.item;+ const here = cdTo(ctx.info.root);+ const as = ctx.info.isMain ? ' --as coordinator' : '';if (values.verify) {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(`check out exactly that commit: git switch --detach ${item.item_commit}`);- io.say(`then: pullboard verify ${item.item_id} accept --note "how you proved it", or reject --reason CODE --note "what failed"`);+ 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"`);} else {io.say(`${found.held ? 'you hold' : 'claimed'} #${item.item_id}: ${item.item_title}`);if (item.item_criterion) io.say(`criterion: ${item.item_criterion}`);for (const row of item.item_frozen ? JSON.parse(item.item_frozen).rows : []) io.say(` ${row.id}: ${row.text}`);sayBrief(io, item.item_brief);- io.say(`when it is built and committed: pullboard submit ${item.item_id}`);+ io.say(`when it is built and committed: ${here} pullboard submit ${item.item_id}`);}return 0;}diff --git a/src/templates.js b/src/templates.jsindex 3d53cf73..7e36fec0 100644--- a/src/templates.js+++ b/src/templates.js@@ -122,7 +122,7 @@ This repo runs on pullboard: a work board, lanes and a spec that live in git. Nopullboard worktree <lane>-It prints the folder to work in and what to run there first. Verifiers take the \`review\` lane, which owns no folders. A lighter model joins with \`--route light\` and takes only items routed light, each with a brief. Keep your worktree and branch until your items are merged.+It prints the folder to work in and what to run there first. 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. A lighter model joins with \`--route light\` and takes only items routed light, each with a brief. Keep your worktree and branch until your items are merged.**The loop.**1. \`pullboard inbox\`.@@ -131,14 +131,15 @@ It prints the folder to work in and what to run there first. Verifiers take the4. Commit, then \`pullboard submit <id>\`. It needs a clean tree and the gate green at HEAD.5. A different agent verifies: \`pullboard next --verify\` names the next item to check. It checks out the submitted commit and runs \`pullboard verify <id> accept --note "how it proved it"\`, or \`pullboard verify <id> reject --reason TEST_FAILURE --note "what failed"\`.6. A reject reopens the item. Fix it, commit, claim, submit again; the same head is refused.+7. Your lane is done when its items are verified, not when they are submitted. After your last submit, keep running \`pullboard next --wait 30\`: a rejected item comes back to your lane.The coordinator merges verified items into the main line; builders never merge.-If your item needs code another lane owns and it is not there yet, shout that lane and take another item. Never copy their code into your lane. A claim refused as BLOCKED names the item it waits on.+If your item needs code another lane owns and it is not there yet, shout that lane and take another item. Never copy their code into your lane, and never build another lane's item, even one that was rejected and blocks you: shout that lane and the coordinator. A claim refused as BLOCKED names the item it waits on.**Talk.** \`pullboard shout <lane|agent|all> "<text>"\`. Read \`pullboard inbox\` before you start and after you submit.-**Never.** Bypass a hook with \`--no-verify\`, or get past a refusal with filler text: fix what it names. Edit the board's database. Verify your own work. Change an approved spec row without the person's OK. Delete or renumber a spec row. Count a yes relayed by another agent as the person's approval.+**Never.** Bypass a hook with \`--no-verify\`, or get past a refusal with filler text: fix what it names. Edit the board's database. Verify your own work. Change an approved spec row without the person's OK. Delete or renumber a spec row. Act from the main checkout; it is the coordinator's. Count a yes relayed by another agent as the person's approval.${AGENTS_END}`;}