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
fix(needs): report blocks from next-steps; agent steps stay agent [C6]
Corey Olson2287c65e8054
diff --git a/src/cli.js b/src/cli.jsindex 6ed4fd24..a5261c7d 100644--- a/src/cli.js+++ b/src/cli.js@@ -2245,7 +2245,7 @@ async function runCommand(argv, io) {if (error instanceof Refused) {io.refusal?.(error);io.err(`pullboard: ${displayedRefusal(io, error)}\nnext: ${io.refusalDocument(error).error.next}`);- noteBlock(io, error, command);+ reportBlock(io, error, { command });return 1;}throw error;@@ -2296,13 +2296,6 @@ function rememberTrunk(io) {if (primary?.branch) trunkRef(info.root, primary.branch);}-/** Record a refusal that stopped a command, aimed at whoever can clear it [C6]. */-function noteBlock(io, error, command) {- let info;- try { info = repoInfo(io.cwd); } catch { return; /* Outside a repository there is no board to record on. */ }- reportBlock(io, error, { command, info, now: io.clock?.now?.() ?? new Date() });-}-/** Run one command and emit its single versioned JSON result when requested (A1). */export async function main(argv, streams) {if (argv[0] === 'serve' && !startupMainTraced) {@@ -2349,7 +2342,7 @@ async function runMain(argv, streams) {if (!(error instanceof Refused)) throw error;io.refusal(error);io.err(`pullboard: ${displayedRefusal(io, error)}\nnext: ${io.refusalDocument(error).error.next}`);- noteBlock(io, error, parsed.positionals[0]);+ reportBlock(io, error, { command: parsed.positionals[0] });io.flush(1);return 1;}diff --git a/src/next-steps.js b/src/next-steps.jsindex c32b699f..6877369f 100644--- a/src/next-steps.js+++ b/src/next-steps.js@@ -10,6 +10,7 @@import { RECORDED_GENERIC_NEXT } from './recorded-refusal.js';import { Refused } from './refused.js';import { recordBlock } from './blocks.js';+import { repoInfo } from './git.js';/** Describe the queue's actual outstanding reviews and submission age [Q1,V15]. */export function reviewQueueLine(ctx, queue, span) {@@ -660,7 +661,7 @@ const NOT_BLOCKS = new Set(['USAGE', 'UNKNOWN_COMMAND']);* @returns {'person'|'coordinator'|'agent'}*/export function blockAudience(code, message, step) {- const person = /\bonly the person\b|\blet the person act\b|\bbring it to the person\b|\bthe person (?:reissues|runs|sends|approves)\b|\bfrom the paired phone\b|\bthe person['’]s terminal\b/iu;+ const person = /\blet the person act\b|\bbring it to the person\b|\bthe person (?:reissues|runs|sends|approves)\b|\bfrom the paired phone\b|\bthe person['’]s terminal\b/iu;const coordinator = /\bask (?:the|your) coordinator\b|^the coordinator\b/iu;if (/_PERSON_ONLY$|^B26_PERSON_CHANNEL$|^HUMAN_REQUIRED$/u.test(code)) return 'person';// The raise site's own words name who acts before the catalog's general step does: an expired@@ -717,9 +718,11 @@ export function blockLine(block) {** @param {any} io* @param {{ code?: string, message: string, next?: string }} error- * @param {{ command: string, info: { commonDir: string, root: string, isMain: boolean }, now: Date }} context+ * @param {{ command: string, info?: { commonDir: string, root: string, isMain: boolean }, now?: Date }} context - info defaults to the checkout at io.cwd*/-export function reportBlock(io, error, { command, info, now }) {+export function reportBlock(io, error, { command, info: given, now = io.clock?.now?.() ?? new Date() }) {+ let info = given;+ try { info ??= repoInfo(io.cwd); } catch { return null; /* Outside a repository there is no board to record on. */ }const caller = io.callerRole?.();const block = blockNotice(error, { command, at: now, path: info.root, caller,by: caller === 'person' ? 'person' : info.isMain ? 'coordinator' : 'agent' });diff --git a/test/blocks.test.js b/test/blocks.test.jsindex d72a0fbb..b37f6680 100644--- a/test/blocks.test.js+++ b/test/blocks.test.js@@ -4,7 +4,10 @@ import { after, test } from 'node:test';import { serveApi } from '../src/api.js';import { repoInfo } from '../src/git.js';import { personNeedsState } from '../src/needs-state.js';-import { reportBlock } from '../src/next-steps.js';+import {+ blockAudience,+ reportBlock,+} from '../src/next-steps.js';import { Refused } from '../src/refused.js';import { relayPresentation } from '../src/relay-presentation.js';import { createE2eHelpers } from './e2e-helpers.js';@@ -52,6 +55,9 @@ test('a Pullboard block reaches whoever can clear it and repeats are counted [C6assert.equal(raise(new Refused('TOKEN_EXPIRED', 'the coordinator relay token expired; the person reissues it: run pullboard relay on in the main checkout'), 'shout').audience, 'person');assert.equal(raise(new Refused('TOKEN_EXPIRED', 'the relay token of web-1 expired, and only a seat\'s own current token or its creator renews it; ask the coordinator for a fresh worktree: pullboard worktree <lane> --model "<model name>"'), 'claim').audience, 'coordinator');assert.equal(said.filter(line => /only the person can clear this/u.test(line)).length, 2);+ // A step the agent takes stays the agent's even when it mentions the person as an alternative.+ assert.equal(blockAudience('RATCHET_ROSE', 'C9 rose to 54, was 53; fix the new problems, commit, and submit again; only the person can sign an increased count',+ 'fix the new doctrine problems named in the report, commit, and submit again; only the person can sign an increased count'), 'agent');const personRows = personNeedsState(box.repo).needs.filter(row => row.kind === 'block');assert.deepEqual(personRows.map(row => row.text).sort(), ['Pullboard stopped a request that only you can clear: send this person action from the paired phone',