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(spec): preserve pending decisions and setup coverage [S1,P6]

Corey Olsondda02aadb523
diff --git a/src/commands/spec.js b/src/commands/spec.js
index 1dabc388..eeddf15c 100644
--- a/src/commands/spec.js
+++ b/src/commands/spec.js
@@ -150,7 +150,7 @@ export async function specCommand(io, { first, second, rest, values }) {
apply: [],
fit: ['text', 'reason'],
}[first ?? '--json'];
- if (!commandFlags) throw new Refused('USAGE', 'use pullboard spec --json | check | view | show <id> | unmet [--must] | draft "<text>" | signoff <ids> | approve <ids> | decline <ids> --reason "why" | answer <id> "<choice or text>" | apply');
+ if (!commandFlags) throw new Refused('USAGE', 'use pullboard spec --json | check | view | show <id> | verify <id> accepted|rejected --reason "why" | unmet [--must] | draft "<text>" | signoff <ids> | approve <ids> | decline <ids> --reason "why" | answer <id> "<choice or text>" | apply');
const allowedFlags = [...new Set([...commandFlags, 'json'])];
for (const flag of Object.keys(values)) {
if (!allowedFlags.includes(flag)) {
diff --git a/src/help.js b/src/help.js
index d627754c..0866ac37 100644
--- a/src/help.js
+++ b/src/help.js
@@ -246,6 +246,7 @@ Spec
pullboard spec check lint SPEC.md and the doctrine (house rules for agentic development)
pullboard spec view [--out file] the spec, open questions, sign-offs and doctrine as one page
pullboard spec show <id> | unmet [--must] | signoff <ids> [--by <principal>]
+ pullboard spec verify <id> accepted|rejected --reason "why" record an outside-parent verdict
signoff: --note "what was checked" stays with the receipt
pullboard spec draft <text> [--section <letter>] [--aim] [--gate "<gate>"] any agent appends a draft row; never approves it
pullboard spec draft <text> --revises <id> --reason "why" [--gate "<gate>"] [--status <status>] propose an approved-row change in Needs you
diff --git a/src/moves/recordRowVerification.js b/src/moves/recordRowVerification.js
index 57ec776b..4c3cf116 100644
--- a/src/moves/recordRowVerification.js
+++ b/src/moves/recordRowVerification.js
@@ -11,5 +11,6 @@ export default Object.freeze({ operation: 'recordRowVerification', engine: SPEC_
nextSteps: Object.freeze({
ROW_VERIFY: 'pullboard spec show <id>, then pullboard spec verify <id> accepted --reason "why"',
ROW_VERIFY_PROVENANCE: 'draft the row through pullboard spec draft and join normally before verifying it',
+ ROW_VERIFY_PENDING: 'ask the coordinator to run pullboard spec apply before recording a verifier verdict',
ROW_VERIFY_SELF: 'ask an outside-parent verifier to run pullboard spec verify',
}) });
diff --git a/src/spec-verdicts.js b/src/spec-verdicts.js
index d3380654..84727850 100644
--- a/src/spec-verdicts.js
+++ b/src/spec-verdicts.js
@@ -6,6 +6,7 @@ import {
logEvent,
} from './board.js';
import { rowDrafts } from './board-query.js';
+import { rowDecisions } from './board-query.js';
import {
lintSpec,
parseSpec,
@@ -58,6 +59,9 @@ export function recordRowVerification(board, { agentId, source, decision, reason
throw new Refused('ROW_VERIFY', 'the verdict needs one exact spec row without malformed fields; run pullboard spec check first');
}
const row = parsed.rows[0];
+ if (rowDecisions(board).some(record => record.kind === 'spec' && record.id === row.id && !record.applied)) {
+ throw new Refused('ROW_VERIFY_PENDING', `${row.id} has a pending person decision; run pullboard spec apply before recording a verifier verdict`);
+ }
const author = rowAuthor(board, row);
outsideParent(board, author, agentId);
const record = { id: row.id, source: base, decision, reason: reason.trim(), by: agentId, author };
diff --git a/test/spec.test.js b/test/spec.test.js
index 2dd5cf50..ec5991d7 100644
--- a/test/spec.test.js
+++ b/test/spec.test.js
@@ -938,9 +938,9 @@ const SETUP_SPEC = `# Spec
test('an approved row waits for apply, not for the person [S1,I1,P6]', (t) => {
const box = specBox(t, { specSource: SETUP_SPEC });
- /** The coordinator's resume, as an agent would read it at session start. */
+ /** Setup details live on the diagnostic card; retain all original person/apply assertions. */
const resume = () => {
- const read = runIn(box, box.root, ['resume']);
+ const read = runIn(box, box.root, ['resume', '--diagnostics']);
assert.equal(read.status, 0, read.stdout + read.stderr);
return read.stdout;
};
@@ -1176,7 +1176,7 @@ test('a verdict on a spec row is recorded by an outside verifier [S1,V4,H16]', t
test('verifier fields reject duplicate and malformed annotations without swallowing check pipelines [S1,V4]', () => {
- const base = '- G1 [draft, must] A row. | gate: check printf yes | grep yes';
+ const base = '- G1 [draft, must] A row. | gate: check printf yes | grep yes | count: 0';
assert.equal(parseSpec(`## G\n${base}\n`).rows[0].gate, 'check printf yes | grep yes');
const valid = parseSpec(`## G\n${base} | verify: rejected by tests-2 | Missing evidence.\n`);
assert.equal(valid.rows[0].gate, 'check printf yes | grep yes');
@@ -1186,3 +1186,32 @@ test('verifier fields reject duplicate and malformed annotations without swallow
assert.ok(lintSpec(parseSpec(`## G\n${base} | ${suffix}\n`)).some(finding => finding.level === 'error'), suffix);
}
});
+
+
+test('spec verify binds the real caller and preserves a pending person decision [S1,V4,P6]', t => {
+ const box = specBox(t, { specSource: '# Demo\n\n## G · Goals\n' });
+ const board = store.openBoard(join(box.root, '.git', 'pullboard', 'board.sqlite'));
+ t.after(() => store.closeBoard(board));
+ store.register(board, { lane: 'coordinator', path: box.root, parentDigest: 'c'.repeat(64) });
+ const author = store.register(board, { lane: 'core', path: join(box.root, 'author'), parentDigest: 'a'.repeat(64) });
+ store.draftSpecRow(board, { agentId: author, row: { id: 'G1', text: 'Keep the actual requirement.',
+ gate: 'review', tier: 'must', section: 'G · Goals' } });
+ assert.equal(box.run('apply').status, 0);
+ const original = readFileSync(join(box.root, box.specName), 'utf8');
+ const result = box.run('verify', 'G1', 'accepted', '--reason', 'The exact draft was reviewed.', '--json');
+ assert.equal(result.status, 0, result.stdout + result.stderr);
+ const record = JSON.parse(result.stdout).verification;
+ assert.equal(record.by, 'coordinator', 'the actual joined caller is the verifier; the CLI takes no claimed seat');
+ assert.equal(readFileSync(join(box.root, box.specName), 'utf8'), original, 'recording a verdict changes no spec file');
+ assert.equal(box.run('approve', 'G1').status, 0);
+ const pending = box.run('verify', 'G1', 'rejected', '--reason', 'A newer opinion.');
+ assert.equal(pending.status, 1);
+ assert.match(pending.stderr, /ROW_VERIFY_PENDING/u);
+ assert.equal(store.rowVerifications(board)[0].decision, 'accepted', 'the pending signed source cannot be superseded');
+ assert.equal(readFileSync(join(box.root, box.specName), 'utf8'), original);
+ assert.equal(box.run('apply').status, 0);
+ const applied = readFileSync(join(box.root, box.specName), 'utf8');
+ assert.match(applied, /G1 \[approved, must\]/u);
+ assert.ok(!applied.includes('verify:'), 'the stale draft verdict does not overwrite the person-approved replacement');
+ assert.equal(box.run('check').status, 0);
+});