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: proof on accept, next with wait, testable rows [V5,N2]

Corey Olsonfd989618638a
diff --git a/skills/pullboard-decompose/SKILL.md b/skills/pullboard-decompose/SKILL.md
index 746e90b4..1b9e7aa8 100644
--- a/skills/pullboard-decompose/SKILL.md
+++ b/skills/pullboard-decompose/SKILL.md
@@ -45,7 +45,11 @@ One requirement per line:
- whether ids or numbers are ever reused
- what an empty list or first run shows
+ - dates and times: compared to what, and in whose time zone
+
When you restate a constraint, quote the client's words; a paraphrase can change its meaning.
+
+ Every must-row must be testable without a guess. Name the exact word, format, number or comparison it means: not "overdue tasks are flagged" but "a task due before today's local date shows the word overdue". If the client did not say, write your assumption into the draft row; the person will flip it if it is wrong.
5. Show the person one track at a time. Ask the pending questions one at a time, the most consequential first, each with your recommended answer.
6. After each answer, update the row and keep its id: pending becomes approved with the answer as its text, or draft becomes approved. Run `pullboard spec check`.
7. Never mark a row approved without the person saying so. Never delete a row; retire it.
@@ -54,5 +58,6 @@ One requirement per line:
- Every part of the ask is covered by a row, or by a stated reason it is out of scope.
- Every approved must-row names its gate.
+- For every must-row you could write the exact check: the command, the input and the expected output.
- What remains pending is only the questions the person has not answered yet.
- `pullboard spec check` passes, and the spec is committed with a `docs(spec): ...` message. Docs commits need not cite row ids.
diff --git a/skills/pullboard-verify/SKILL.md b/skills/pullboard-verify/SKILL.md
index c9283b1f..7d8da3da 100644
--- a/skills/pullboard-verify/SKILL.md
+++ b/skills/pullboard-verify/SKILL.md
@@ -7,7 +7,7 @@ description: Verify another agent's submitted item at its exact commit, against
You never verify your own work. You judge the frozen criterion as written, at the commit that was submitted.
-1. Pick a submitted item you did not build: `pullboard list --all`. Then `pullboard show <id>` gives the criterion as frozen at claim, and the submitted 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>`.
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.
@@ -15,8 +15,9 @@ You never verify your own work. You judge the frozen criterion as written, at th
- **Run the behavior** and read the output.
- **Read the code** only when the criterion is about the code itself. It is the weakest proof.
- **Check the house rules too.** Read the approved rows of PRACTICE.md that the change touches. A broken one is a reject with reason OTHER, naming the row.
+ - **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:
- - `pullboard verify <id> accept`, only when the criterion is met as written.
+ - `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.js
index 40efc594..02242a15 100644
--- a/src/board.js
+++ b/src/board.js
@@ -504,6 +504,12 @@ function verdictReason(decision, reason, note) {
if (reason && reason !== ACCEPT_REASON) {
throw new Refused('BAD_REASON', `accept means ${ACCEPT_REASON}; a failed criterion is a reject`);
}
+ if (!note.trim()) {
+ throw new Refused(
+ 'PROOF_REQUIRED',
+ 'an accept says how you proved it: --note "what you broke or which edge you tried, and what happened"; passing tests alone are not proof',
+ );
+ }
return ACCEPT_REASON;
}
if (decision !== 'REJECT') throw new Refused('BAD_DECISION', 'the decision is accept or reject');
@@ -755,6 +761,36 @@ export function events(board, { itemId } = {}) {
.all(itemId ?? null, itemId ?? null);
}
+/**
+ * The next item an agent can take (N2): for a builder, the oldest open item in its lane whose
+ * dependencies are verified; for a verifier, the oldest submitted item it did not build. When
+ * nothing is free, the reasons say what everything is waiting on.
+ *
+ * @param {any} board
+ * @param {{ agentId: string, lane: string, verify?: boolean }} who
+ * @returns {{ item: any | null, reasons: string[] }}
+ */
+export function nextFor(board, { agentId, lane, verify = false }) {
+ const items = listItems(board).reverse();
+ if (verify) {
+ const item = items.find((entry) => entry.item_status === 'submitted' && entry.item_built_by !== agentId) ?? null;
+ return { item, reasons: item ? [] : ['nothing submitted that you did not build'] };
+ }
+ 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 mine = items.filter((entry) => entry.item_status === 'open' && (lane === COORDINATOR || entry.item_lane === lane));
+ const reasons = [];
+ for (const entry of mine) {
+ const waiting = (entry.item_after ? entry.item_after.split(',').map(Number) : [])
+ .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(', ')}`);
+ }
+ if (!mine.length) reasons.push(`no open items in the ${lane} lane`);
+ return { item: null, reasons };
+}
+
/**
* 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.js
index c12d9aa5..b8757ff4 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -51,10 +51,12 @@ Work
--after: claiming waits until those items are verified
pullboard list [lane] [--all] open and active items; --all adds verified and withdrawn
pullboard show <id> an item, the criterion frozen at claim, its verdicts
+ pullboard next [--wait <minutes>] claim the next item in your lane that is free to start
+ pullboard next --verify name the next submitted item you can check
pullboard claim <id> take or renew a lease; the first claim freezes the criterion
pullboard release <id> hand it back
pullboard submit <id> needs a clean tree and the gate green at HEAD (alias: done)
- pullboard verify <id> accept from the submitted commit, by anyone but the builder
+ pullboard verify <id> accept --note "what you broke or which edge you tried, and what happened"
pullboard verify <id> reject --reason TEST_FAILURE --note "what failed"
pullboard shout <lane|agent|all> <text> pullboard inbox
@@ -91,6 +93,8 @@ const OPTIONS = {
by: { type: 'string' },
out: { type: 'string' },
after: { type: 'string' },
+ wait: { type: 'string' },
+ verify: { type: 'boolean' },
all: { type: 'boolean' },
must: { type: 'boolean' },
json: { type: 'boolean' },
@@ -445,6 +449,71 @@ function verifyHere(ctx, id, { second, values }) {
return 0;
}
+/**
+ * One loop of `next`: claim the next free item, or name the next one to verify. A claim that loses a
+ * race to another agent is not an error; the caller looks again.
+ *
+ * @param {any} ctx
+ * @param {any} values
+ * @returns {{ item?: any, held?: boolean, retry?: boolean, reasons?: string[] }}
+ */
+function nextOnce(ctx, values) {
+ return withBoard(ctx, (board) => {
+ const me = whoAmI(ctx, board);
+ const { item, reasons } = store.nextFor(board, { agentId: me.id, lane: me.lane, verify: values.verify });
+ if (!item) return { reasons };
+ if (values.verify) return { item };
+ if (item.item_status === 'claimed') return { item, held: true };
+ try {
+ store.claim(board, item.item_id, { agentId: me.id, lane: me.lane, leaseMs: ctx.config.leaseMs, freeze: freezer(ctx) });
+ } catch (error) {
+ if (error instanceof Refused && ['HELD', 'BLOCKED', 'ONE_CLAIM'].includes(error.code)) return { retry: true };
+ throw error;
+ }
+ return { item: store.getItem(board, item.item_id) };
+ });
+}
+
+/**
+ * `pullboard next` (N2): the whole start of an agent's loop in one command. With --wait, it keeps
+ * looking until something is free, so an agent blocked on other work needs no polling of its own.
+ *
+ * @param {any} io
+ * @param {any} values
+ * @returns {Promise<number>}
+ */
+async function nextHere(io, values) {
+ const ctx = context(io);
+ const minutes = values.wait === undefined ? 0 : Number(values.wait);
+ if (!Number.isFinite(minutes) || minutes < 0 || minutes > 240) {
+ throw new Refused('USAGE', '--wait is a number of minutes from 0 to 240');
+ }
+ const deadline = Date.now() + minutes * 60_000;
+ for (;;) {
+ const found = nextOnce(ctx, values);
+ if (found.item) {
+ const item = found.item;
+ 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"`);
+ } 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}`);
+ io.say(`when it is built and committed: pullboard submit ${item.item_id}`);
+ }
+ return 0;
+ }
+ 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 30${values.verify ? ' --verify' : ''}`);
+ return 1;
+ }
+ if (!found.retry) await new Promise((done) => setTimeout(done, 5000));
+ }
+}
+
/**
* The commands that change the board.
*
@@ -471,6 +540,7 @@ function workCommands(io, args) {
io.say(`#${id}`);
return 0;
}),
+ next: () => nextHere(io, values),
claim: () => act((ctx, board, me) => {
const result = store.claim(board, idArg(first), { agentId: me.id, lane: me.lane, leaseMs: ctx.config.leaseMs, freeze: freezer(ctx) });
io.say(`${result.renewed ? 'renewed' : 'claimed'} #${first} until ${result.leaseUntil}; criterion frozen as ${result.digest.slice(0, 12)}`);
@@ -682,7 +752,7 @@ export async function main(argv, streams) {
io.err(`pullboard: no command "${command}"\n\n${HELP}`);
return 2;
}
- return run();
+ return await run();
} catch (error) {
if (error instanceof Refused) {
io.err(`pullboard: ${error.message}`);
diff --git a/src/templates.js b/src/templates.js
index 99f25251..9a0a39fe 100644
--- a/src/templates.js
+++ b/src/templates.js
@@ -125,13 +125,15 @@ This repo runs on pullboard: a work board, lanes and a spec that live in git. No
It prints the folder to work in and what to run there first. Verifiers take the \`review\` lane, which owns no folders. Keep your worktree and branch until your items are merged.
**The loop.**
-1. \`pullboard inbox\`, then \`pullboard list <lane>\`.
-2. \`pullboard claim <id>\`. A claim is a 2-hour lease; claim again to renew. The criterion freezes now: \`pullboard show <id>\` is the bar your work is judged against.
+1. \`pullboard inbox\`.
+2. \`pullboard next\` claims the next item in your lane that is free to start. When everything is waiting on other work, \`pullboard next --wait 30\` keeps looking for up to 30 minutes. A claim is a 2-hour lease; claim again to renew. The criterion freezes now: \`pullboard show <id>\` is the bar your work is judged against.
3. Build inside your lane's folders (\`pullboard lanes\`). Pre-commit refuses anything else; shout the owner instead.
4. Commit, then \`pullboard submit <id>\`. It needs a clean tree and the gate green at HEAD.
-5. A different agent verifies: it checks out the submitted commit and runs \`pullboard verify <id> accept\`, or \`pullboard verify <id> reject --reason TEST_FAILURE --note "what failed"\`.
+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.
+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.
**Talk.** \`pullboard shout <lane|agent|all> "<text>"\`. Read \`pullboard inbox\` before you start and after you submit.