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(review): record immutable verdict assurance [V1,B3]

Corey Olsonbafcf66d793a
diff --git a/src/board.js b/src/board.js
index b8a77017..7f5fb114 100644
--- a/src/board.js
+++ b/src/board.js
@@ -1,3 +1,4 @@
+import { recordVerdict } from './verdict-assurance.js';
import { logEvent } from './board-event-log.js';
export { logEvent };
/**
@@ -1586,16 +1587,7 @@ export function verify(board, id, { agentId, decision, reason, note = '', cause,
noteGiven: () => (note.trim() ? null : new Refused('NOTE_REQUIRED', 'a reject says what failed: --note "..."')),
causeWellFormed: () => causeProblem(cause),
},
- before: (found) => {
- const family = board.db.prepare('SELECT agent_family FROM agent WHERE agent_id = ?').get(agentId)?.agent_family ?? null;
- board.db
- .prepare(
- `INSERT INTO verdict (item_id, verdict_by, verdict_decision, verdict_reason, verdict_note,
- verdict_commit, verdict_digest, verdict_head, verdict_verifier_family, verdict_at)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
- )
- .run(id, agentId, decision, code, note.trim(), found.item_commit, digest, head, family, now(board));
- },
+ before: (found) => recordVerdict(board, found, { agentId, decision, reason: code, note, digest, head }),
set: (found) => ({ item_verdict: decision, item_verified_by: isAccept ? agentId : null, item_owner: isAccept ? found.item_owner : null }),
});
const returnedAt = !isAccept && engine >= REOPEN_FIRST_REFUSAL_ENGINE && reopenFirstRefusalMinutes > 0 && item.item_built_by ? board.clock.now() : undefined;
diff --git a/src/commands/show.js b/src/commands/show.js
index 1bded843..2657f04d 100644
--- a/src/commands/show.js
+++ b/src/commands/show.js
@@ -90,6 +90,7 @@ export function run(io, { first, values }) {
verdicts.forEach((verdict, index) => {
io.say(`${verdictLine(verdict)}${notes[index] ? `: ${notes[index]}` : ''}`);
io.say(` check: ${verdict.check ?? 'unknown'}`);
+ io.say(` assurance: ${verdict.assurance}`);
});
if (notes.some((note, index) => note !== verdicts[index].verdict_note)) io.say(`(earlier verdicts shortened; every note in full: pullboard show ${id} --history)`);
for (const correction of barCorrections(thread)) io.say(barCorrectionLine(correction));
diff --git a/src/verdict-assurance.js b/src/verdict-assurance.js
new file mode 100644
index 00000000..b1e0c732
--- /dev/null
+++ b/src/verdict-assurance.js
@@ -0,0 +1,35 @@
+/** Immutable verdict assurance distinguishes recorded parent independence from procedural review [V1,B3]. */
+import { ENGINE_VERSION } from './machine.js';
+import { PARENT_SESSION_ENGINE } from './parent-session-engine.js';
+import { itemAuthors } from './item-authors.js';
+import { agentParent } from './seats.js';
+
+/** Unknown parentage for any historical author limits assurance, even when review is procedurally allowed. */
+export function reviewAssurance(board, item, reviewer) {
+ const parent = agentParent(board, reviewer);
+ const authors = itemAuthors(board, item);
+ return parent && authors.length && authors.every(author => {
+ const built = agentParent(board, author);
+ return built && built !== parent;
+ }) ? 'independent' : 'procedural';
+}
+
+/** Old verdicts without an assurance record never acquire independent status from later seat enrollment. */
+export function verdictAssurance(board, verdict) {
+ return board.db.prepare('SELECT meta_value FROM board_meta WHERE meta_key = ?')
+ .get(`verdict_assurance:${verdict.verdict_id}`)?.meta_value === 'independent' ? 'independent' : 'procedural';
+}
+
+/** Insert the immutable native verdict and, under engine 90, its assurance in the same board transaction. */
+export function recordVerdict(board, item, { agentId, decision, reason, note, digest, head }) {
+ const family = board.db.prepare('SELECT agent_family FROM agent WHERE agent_id = ?').get(agentId)?.agent_family ?? null;
+ const inserted = board.db.prepare(`INSERT INTO verdict (item_id, verdict_by, verdict_decision, verdict_reason, verdict_note,
+ verdict_commit, verdict_digest, verdict_head, verdict_verifier_family, verdict_at)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(item.item_id, agentId, decision, reason, note.trim(), item.item_commit,
+ digest, head, family, board.clock.now().toISOString());
+ if ((board.executionEngineVersion ?? ENGINE_VERSION) < PARENT_SESSION_ENGINE) return null;
+ const assurance = reviewAssurance(board, item, agentId);
+ board.db.prepare('INSERT INTO board_meta (meta_key, meta_value) VALUES (?, ?)')
+ .run(`verdict_assurance:${inserted.lastInsertRowid}`, assurance);
+ return assurance;
+}
diff --git a/src/verdict-reviews.js b/src/verdict-reviews.js
index f1fb7594..ae3b7c1f 100644
--- a/src/verdict-reviews.js
+++ b/src/verdict-reviews.js
@@ -1,5 +1,6 @@
/** Sealed review validation and immutable acceptance projections [E8,H16]. */
import { Refused } from './refused.js';
+import { verdictAssurance } from './verdict-assurance.js';
/** Validate a sealed review without consulting Git or changing either replica [E8,H16]. */
export function verdictReviewProblem(review, commit, { checked } = {}) {
@@ -28,7 +29,7 @@ export function verdictsFor(board, id) {
return verdicts.map((verdict, index) => {
let detail = {};
try { detail = JSON.parse(receipts[index]?.event_detail ?? '{}'); } catch { /* Malformed legacy details remain unknown. */ }
- return { ...verdict, check: detail.check ?? 'unknown', ...(detail.review ? { review: detail.review } : {}) };
+ return { ...verdict, assurance: verdictAssurance(board, verdict), check: detail.check ?? 'unknown', ...(detail.review ? { review: detail.review } : {}) };
});
}