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(core): a corrected bar records why the old one was wrong [B10,B31]

Corey Olson5dafc5ceaa05
diff --git a/docs/api.md b/docs/api.md
index 75ddc138..95aea27f 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -20,6 +20,8 @@ An item's HTTP detail, and each item in the full board state, include `check` an
`pullboard stats [--since <date>] --json` returns `{version: 1, stats: {...}}` from the append-only event log. `submissions` and `rejections` count moves, including repeated attempts; `rejectionShare` is rejections divided by submissions (zero when the window has no submissions). `merged` counts distinct items with a merge move; `mergedWithoutAccept` counts those whose merge lacks an earlier acceptance of the latest submitted commit. That audit uses earlier history even when the acceptance falls before the selected window. Current item and verdict rows do not replace event evidence.
+`stats.bars` counts bar corrections, keyed by agent: `{corrections, barRejects, buildRejects}`. A correction is an `edit --criterion` or `--check` on an item that was ever claimed. It must carry `--reason "what the old bar got wrong"` (HTTP `args.reason`); without one it is refused with `BAR_REASON`. A correction that follows the item's newest, unexplained reject marks that reject as caused by the bar, counted to the correcting agent; every other reject counts to the build, under the agent who added the item. Text `stats` prints one `bars:` line per agent, and text `show` prints each correction with its reason.
+
`stats.flow` adds the flow through the board:
- `asOf` is the ISO UTC timestamp of this observation, shared by every queue age.
diff --git a/docs/formats.md b/docs/formats.md
index c3797a6c..8f9ee01d 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -102,7 +102,7 @@ The board file is in the repository's Git common directory at `.git/pullboard/bo
| `row grammar` | `1` | `SPEC_GRAMMAR_VERSION` in `src/spec.js`; optional `<!-- pullboard-grammar N -->` line in either file (absence means the current grammar) | Both files share the version. A declared version must match; an incompatible grammar change requires a coordinated version bump and compatible files. No automatic conversion occurs. |
| `board schema` | `2` | `SCHEMA_VERSION` in `src/board.js`, persisted as `PRAGMA user_version` | Create missing tables and indexes, add missing columns in place with declared defaults, restore missing or changed triggers, and remove stale machine triggers without replacing rows. |
| `event log` | `1` | `EVENT_LOG_VERSION` in `src/board.js`, persisted in `board_meta` as `event_log_version` | Older event-log versions upgrade in place; newer versions are refused with `EVENT_LOG_VERSION`. Preserve event rows when the board schema changes. |
-| `move engine` | `12` | `ENGINE_VERSION` in `src/machine.js`, carried as `engine` in every sealed executable move | Bump when a move's meaning changes, independently of the event log and sealed envelope. A newer engine is refused with `ENGINE_VERSION`, naming both versions and asking you to upgrade Pullboard. |
+| `move engine` | `19` | `ENGINE_VERSION` in `src/machine.js`, carried as `engine` in every sealed executable move | Bump when a move's meaning changes, independently of the event log and sealed envelope. A newer engine is refused with `ENGINE_VERSION`, naming both versions and asking you to upgrade Pullboard. |
<!-- format-versions:end -->
Pullboard 0.6.1 released engine 1. Engine 2 records a fresh explicit-build claim's skipped-review snapshot. Pullboard 0.8.1 released engine 3, including lane-sensitive graft refusals and authenticated relay senders. Engine 4 adds captured background-baseline completions through `completeCheckBaseline`; released engine-3 clients stop with `ENGINE_VERSION` before interpreting this new operation or advancing their replay cursor. Engine 5 requires a one-line reason when releasing a review and gives that reviewer a one-hour cooldown for the current submission. Each sealed move replays under its recorded engine version: engines 1 through 4 retain the original release event and review-reservation behavior. Engine 5 retains support for older moves, including engine-4 baseline completions. Pullboard 0.8.3 released engine 6, adding board-scoped machine credentials and permitting machine execution only for one exact, earlier authenticated phone request, including its payload digest. Engine 7 adds ordered item holds through `holdItem` and `releaseItemHold`; engine-6 clients stop with `ENGINE_VERSION` before interpreting either operation or advancing their replay cursor. Engine 8, shared by the 0.8.5 move changes, retains merged-item exception notes, selects the next review in roadmap order, and adds coordinator-only `reopen` for a submission returned without a verdict; engine-7 clients stop with `ENGINE_VERSION` before interpreting this new operation or advancing their replay cursor. Recorded engines 1 through 7 retain their original tier-first review selection. Engine 8 also adds durable refusal recovery for blocked relay positions; each explicit skip publishes the readable prefix even when another unsupported record follows. Engine 8 also permits coordinator criterion/check edits on a live claim as pending corrections; the holder cannot renew or submit until a refreeze adopts the correction while preserving the claim. Older request receipts retain their recorded engine semantics. Upgrade every linked device before using the new moves. Each release shares one engine bump across its changed moves. Engine 8 also retains declared model labels on registration and records each registered agent move's model snapshot; engines 1 through 7 retain their original registration and event details without these model fields. Pullboard 0.8.8 released engine 9, which allows resubmitting the same rejected commit after a corrected criterion is refrozen, but only when the rejection names a different frozen digest. Engine 8 retains its HEAD_NOT_NEW refusal and prior submit-event detail. Engine-9 submit events add `criterionDigest`, and engine-8 boards replay with the original refusal and event history.
@@ -113,6 +113,8 @@ Engine 11 permits resubmitting the same commit after a coordinator no-verdict re
Engine 12 records declined person row decisions without replacing the exact source text: the row becomes `wont` and the reason stays in the decision record. Engine-11 decline receipts retain their original reason-as-row-text validation and replay outcome. Engine-11 clients refuse engine-12 moves before interpreting them; upgrade linked clients before recording new decline decisions.
+Engine 19 makes a corrected bar record why the old one was wrong. Once an item has ever been claimed, an `editItem` that changes its criterion or check must carry `reason`, the text of what the old bar got wrong; without one it is refused with `BAR_REASON`, naming `--reason`. The edit event then records `reason` and `barCorrection: {fields, reject}`: `fields` lists `criterion` and/or `check`, and `reject` is `{verdict, by, reason, at}` when the item's newest verdict is a reject no earlier correction already explained, or `null`. That reject is counted as caused by the bar. The board derives `barCorrection` from its own rows; a move supplies only `reason`. An edit before any claim needs no reason and records one only if given. `pullboard stats` JSON adds `bars`, keyed by agent: `{corrections, barRejects, buildRejects}`. Corrections and the rejects they explain count to the agent who corrected the bar; any other reject counts as the build's, to the agent who added the item. An `editItem` move carrying `reason` requires engine 19, and older engines refuse it with `RELAY_MOVE` before changing their board or cursor. Moves recorded under engines 18 and earlier replay without the reason rule. Engine numbers 13 to 18 are allocated to other changes; whichever lands later renumbers, keeping every earlier engine's replay unchanged.
+
The CLI declares its engine in every relay request's `X-Pullboard-Engine` header.
A linked board requires at least engine 3 after issuing any agent token, including
revoked or expired tokens. Issuing any machine credential raises that board’s minimum to engine 6, including after revocation or expiry. The minimum survives reopening the auth database;
@@ -302,7 +304,7 @@ The `event` table is a SQLite schema object governed by `SCHEMA_VERSION`; its ap
| `model` | agent | — |
| `moved` | coordinator | `path` |
| `add` | item creator | `lane`, `specIds`, `after`, `route` |
-| `edit` | editor | `brief`, `route`, `criterion`, `check`, `unfrozen`, optional `after`, optional `pendingRefreeze` |
+| `edit` | editor | `brief`, `route`, `criterion`, `check`, `unfrozen`, optional `after`, optional `pendingRefreeze`, engine-19 `reason`, `barCorrection` |
| `escalate` | builder | `from`, `to`, `note`, `attempt` |
| `attempt` | reporting agent | `n`, `seconds`, `result` |
| `fact` | author | `id`, `kind`, `text`, `ref`, `supersedes` |
diff --git a/docs/formats.test.js b/docs/formats.test.js
index b0a0d9bb..c61461e0 100644
--- a/docs/formats.test.js
+++ b/docs/formats.test.js
@@ -287,7 +287,7 @@ function recordEventContract() {
escalate(board, first, { agentId: builder, note: 'attempted once', attempt: '1' });
claim(board, first, { agentId: builder, lane: 'docs', leaseMs: 60_000, freeze: freeze('unused') });
release(board, first, builder);
- editItem(board, first, { agentId: coordinator, criterion: 'Updated after claim' });
+ editItem(board, first, { agentId: coordinator, criterion: 'Updated after claim', reason: 'the claimed bar named the wrong field' });
refreeze(board, first, { agentId: coordinator, freeze: freeze('second') });
claim(board, first, { agentId: builder, lane: 'docs', leaseMs: 60_000, freeze: freeze('unused') });
const acceptedCommit = 'a'.repeat(40);
@@ -309,7 +309,7 @@ function recordEventContract() {
const corrected = addItem(board, { by: coordinator, lane: 'docs', title: 'Corrected live claim' });
claim(board, corrected, { agentId: builder, lane: 'docs', leaseMs: 60_000, freeze: freeze('before-correction') });
- editItem(board, corrected, { agentId: coordinator, criterion: 'Corrected criterion' });
+ editItem(board, corrected, { agentId: coordinator, criterion: 'Corrected criterion', reason: 'the fixture corrects its bar' });
assert.deepEqual(JSON.parse(events(board).filter((row) => row.event_kind === 'edit').at(-1).event_detail).pendingRefreeze, ['criterion']);
refreeze(board, corrected, { agentId: builder, freeze: freeze('adopted-correction') });
diff --git a/src/api-moves.js b/src/api-moves.js
index 51dc394c..f4a5198f 100644
--- a/src/api-moves.js
+++ b/src/api-moves.js
@@ -6,7 +6,7 @@ const MOVES = {
'spec-approve': { prefix: ['spec', 'approve'], positions: ['ids'], flags: ['by', 'text'] },
'spec-decline': { prefix: ['spec', 'decline'], positions: ['ids'], flags: ['reason'] },
add: { positions: ['lane', 'title'], flags: ['criterion', 'specs', 'parent', 'after', 'brief', 'route', 'check'], booleans: ['wait'], booleans: ['wait'] },
- edit: { item: true, flags: ['criterion', 'brief', 'route', 'check'], booleans: ['wait'], booleans: ['wait'] },
+ edit: { item: true, flags: ['criterion', 'brief', 'route', 'check', 'reason'], booleans: ['wait'], booleans: ['wait'] },
fact: { item: true, positions: ['kind', 'text'], flags: ['supersedes', 'ref'] },
claim: { item: true },
release: { item: true, flags: ['note'] },
diff --git a/src/bar-corrections.js b/src/bar-corrections.js
new file mode 100644
index 00000000..0474bd11
--- /dev/null
+++ b/src/bar-corrections.js
@@ -0,0 +1,111 @@
+/**
+ * A corrected bar records why the old one was wrong [B10,B31,R1].
+ *
+ * Once an item has ever been claimed, a change to its criterion or check corrects a bar someone
+ * built against. Such an edit must say what the old bar got wrong; the reason is stored on the
+ * edit event itself, with the fields it changed and, when the item's newest verdict is a reject no
+ * earlier correction explained, that reject: the bar caused it, not the build. Nothing else is
+ * stored, and nothing in the correction record is taken from the move beyond the reason text, so
+ * a relay or API caller cannot mark a reject as the bar's.
+ */
+import { ENGINE_VERSION } from './machine.js';
+import { Refused } from './refused.js';
+
+/** The engine whose edits carry a reason and refuse an unexplained bar correction; older replays never did. */
+export const BAR_ENGINE = 19;
+
+/**
+ * True when a sealed edit carries this engine's meaning, a reason; older engines refuse it before replay.
+ *
+ * @param {string} operation
+ * @param {any[]} args
+ * @returns {boolean}
+ */
+export function carriesBarReason(operation, args) {
+ return operation === 'editItem' && typeof args?.[1]?.reason === 'string';
+}
+
+/** True when any claim, live or long released, has ever been recorded on the item. */
+function everClaimed(board, id) {
+ return Boolean(board.db.prepare("SELECT 1 FROM event WHERE item_id = ? AND event_kind = 'claim' LIMIT 1").get(id));
+}
+
+/** The item's newest verdict when it is a reject no earlier correction already explained, or null. */
+function unexplainedReject(board, id) {
+ const latest = board.db.prepare('SELECT * FROM verdict WHERE item_id = ? ORDER BY verdict_id DESC LIMIT 1').get(id);
+ if (!latest || latest.verdict_decision !== 'REJECT') return null;
+ const explained = board.db.prepare("SELECT 1 FROM event WHERE item_id = ? AND event_kind = 'edit' AND json_extract(event_detail, '$.barCorrection.reject.verdict') = ? LIMIT 1").get(id, latest.verdict_id);
+ return explained ? null : { verdict: latest.verdict_id, by: latest.verdict_by, reason: latest.verdict_reason, at: latest.verdict_at };
+}
+
+/**
+ * The edit-event fields for a bar correction, or none; refuses a correction with no reason.
+ *
+ * @param {any} board
+ * @param {any} item the item before the edit
+ * @param {any} next its fields after the edit
+ * @param {{ reason?: string }} options the move's reason, the only value taken from it
+ * @returns {{ reason?: string, barCorrection?: { fields: string[], reject: object | null } }}
+ */
+export function barCorrectionFields(board, item, next, { reason }) {
+ const engine = board.executionEngineVersion ?? ENGINE_VERSION;
+ if (engine < BAR_ENGINE) return {};
+ if (reason !== undefined && typeof reason !== 'string') throw new Refused('USAGE', 'a reason is text: --reason "what the old bar got wrong"');
+ const fields = [...(next.item_criterion !== item.item_criterion ? ['criterion'] : []), ...(next.item_check !== item.item_check ? ['check'] : [])];
+ const text = reason?.trim() ?? '';
+ if (!fields.length || !everClaimed(board, item.item_id)) return text ? { reason: text } : {};
+ if (!text) {
+ throw new Refused('BAR_REASON', `#${item.item_id} has been claimed, so changing its ${fields.join(' and ')} corrects a bar someone built against; say what the old bar got wrong: pullboard edit ${item.item_id} --reason "..."`);
+ }
+ return { reason: text, barCorrection: { fields, reject: unexplainedReject(board, item.item_id) } };
+}
+
+/** The bar corrections in an item's thread, oldest first, each with its reason and the reject it explains. */
+export function barCorrections(thread) {
+ return thread.filter((entry) => entry.type === 'move' && entry.kind === 'edit' && entry.detail?.barCorrection)
+ .map((entry) => ({ at: entry.at, by: entry.by, reason: entry.detail.reason, ...entry.detail.barCorrection }));
+}
+
+/** One line for a bar correction as `pullboard show` prints it. */
+export function barCorrectionLine(correction, name = (id) => id) {
+ return `bar corrected by ${name(correction.by)} (${correction.fields.join(', ')}): ${correction.reason}${correction.reject ? `; the reject by ${name(correction.reject.by)} was caused by the bar` : ''}`;
+}
+
+/**
+ * Per author of a bar: corrections, rejects caused by a bar, and rejects caused by the build.
+ * A correction and the reject it explains count to the agent who corrected the bar; any other
+ * reject counts as the build's, to the agent who added the item.
+ *
+ * @param {any[]} history every event, oldest first
+ * @param {any[]} verdicts every verdict row
+ * @param {string | null} boundary an inclusive ISO start, or null for all time
+ * @returns {Record<string, { corrections: number, barRejects: number, buildRejects: number }>}
+ */
+export function barStats(history, verdicts, boundary) {
+ const inWindow = (at) => !boundary || Date.parse(at) >= Date.parse(boundary);
+ const creators = new Map();
+ const explained = new Set();
+ const result = {};
+ /** The counters for one agent, created on first use. */
+ const of = (agent) => (result[agent] ??= { corrections: 0, barRejects: 0, buildRejects: 0 });
+ for (const event of history) {
+ if (event.event_kind === 'add') creators.set(event.item_id, event.event_by);
+ const correction = event.event_kind === 'edit' ? JSON.parse(event.event_detail).barCorrection : null;
+ if (!correction) continue;
+ if (correction.reject) explained.add(correction.reject.verdict);
+ if (!inWindow(event.event_at)) continue;
+ of(event.event_by).corrections += 1;
+ if (correction.reject) of(event.event_by).barRejects += 1;
+ }
+ for (const verdict of verdicts) {
+ if (verdict.verdict_decision !== 'REJECT' || explained.has(verdict.verdict_id) || !inWindow(verdict.verdict_at)) continue;
+ of(creators.get(verdict.item_id) ?? 'unknown').buildRejects += 1;
+ }
+ return result;
+}
+
+/** One line of bar numbers per author, as `pullboard stats` prints them. */
+export function barStatsLines(bars, name = (id) => id) {
+ const plural = (count, word) => `${count} ${word}${count === 1 ? '' : 's'}`;
+ return Object.entries(bars).map(([agent, counts]) => `bars: ${name(agent)}: ${plural(counts.corrections, 'correction')}, ${plural(counts.barRejects, 'reject')} caused by a bar, ${plural(counts.buildRejects, 'reject')} caused by the build`);
+}
diff --git a/src/board.js b/src/board.js
index 0bf0fbca..0cc01469 100644
--- a/src/board.js
+++ b/src/board.js
@@ -14,6 +14,7 @@ import { briefFiles, briefSections } from './brief.js';
import { COORDINATOR } from './config.js';
import { ENGINE_VERSION, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';
import { Refused } from './refused.js';
+import { barCorrectionFields } from './bar-corrections.js';
import { parseSpec } from './spec.js';
export const ACCEPT_REASON = 'CRITERION_MET';
@@ -736,11 +737,11 @@ export function validateItemAddition(board, { by, lane, title, criterion = '', p
* @param {number} id
* @param {{ agentId: string, brief?: string, route?: string, criterion?: string, check?: string, after?: number[] }} change
*/
-export function editItem(board, id, { agentId, brief, route, criterion, check, after, checkBaseline }) {
+export function editItem(board, id, { agentId, brief, route, criterion, check, after, checkBaseline, reason }) {
atomic(board, () => {
const stored = itemById(board, id);
const expiredHolder = stored.item_status === 'claimed' && !isHeld(board, stored) ? stored.item_owner : null;
- const { item, next, command, unfreeze } = validateItemEdit(board, id, { agentId, brief, route, criterion, check, after });
+ const { item, next, command, unfreeze, bar } = validateItemEdit(board, id, { agentId, brief, route, criterion, check, after, reason });
const baseline = normalizeCheckBaseline(agentId, command, checkBaseline);
const pendingFields = [
...(next.item_criterion !== item.item_criterion ? ['criterion'] : []),
@@ -765,6 +766,7 @@ export function editItem(board, id, { agentId, brief, route, criterion, check, a
...(pendingRefreeze ? { pendingRefreeze: pendingFields } : {}),
...(clearFrozen && item.item_frozen_digest ? { unfrozen: item.item_frozen_digest } : {}),
...(expiredHolder ? { expiredHolder } : {}),
+ ...bar,
});
if (pendingRefreeze) {
insertShout(board, {
@@ -777,8 +779,8 @@ export function editItem(board, id, { agentId, brief, route, criterion, check, a
});
}
-/** Validate an edit without side effects, so a refused change never starts a shell baseline. */
-export function validateItemEdit(board, id, { agentId, brief, route, criterion, check, after }) {
+/** Validate an edit without side effects, so a refused change never starts a shell baseline; a bar correction needs a reason [B31]. */
+export function validateItemEdit(board, id, { agentId, brief, route, criterion, check, after, reason }) {
const engine = board.executionEngineVersion ?? ENGINE_VERSION;
if (after !== undefined && engine < 10) {
throw new Refused('ENGINE_VERSION', `editing item dependencies requires engine 10; this board uses engine ${engine}; upgrade Pullboard before using --after`);
@@ -822,7 +824,7 @@ export function validateItemEdit(board, id, { agentId, brief, route, criterion,
}
checkRouted({ brief: next.item_brief, route: next.item_route, criterion: next.item_criterion, check: next.item_check });
const unfreeze = next.item_criterion !== item.item_criterion || next.item_check !== item.item_check;
- return { item, next, command, unfreeze };
+ return { item, next, command, unfreeze, bar: barCorrectionFields(board, item, next, { reason }) };
}
/** Normalize an explicitly supplied check only when its author is the coordinator [V2]. */
diff --git a/src/cli.js b/src/cli.js
index 7c289e1f..8ada71e7 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -35,6 +35,7 @@ import {
import { detectGate, initRepo, proposeLanes } from './init.js';
import { lifecycleMarkdown } from './machine.js';
import { HELP, VERSION } from './help.js';
+import { barCorrectionLine, barCorrections, barStatsLines } from './bar-corrections.js';
import { defaultViewPort } from './view-port.js';
export { HELP, VERSION };
import { productLine, productProblems, productSummaries } from './products.js';
@@ -2037,6 +2038,7 @@ function readCommands(io, { first, second, rest, values }) {
io.say(` check: ${verdict.check ?? 'unknown'}`);
});
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));
if (item.item_merged_commit) io.say(`merged as ${item.item_merged_commit}`);
if (item.item_withdrawn_reason) io.say(`withdrawn: ${item.item_withdrawn_reason}`);
io.say('thread:');
@@ -2139,6 +2141,7 @@ function readCommands(io, { first, second, rest, values }) {
io.say(`${stats.agentCount} agents · ${stats.familyCount} family buckets: ${stats.families.map((family) => `${family.name} (${family.agents} agents, ${family.moves} moves)`).join('; ') || 'none'}`);
io.say(`agents: ${stats.agents.map((agent) => `${agentDisplayName(agents, ctx.config, agent.id)} (${agent.families.join('/')}; ${agent.moves} moves)`).join(', ') || 'none'}`);
io.say(`events: ${stats.firstEventAt ?? 'none'} to ${stats.lastEventAt ?? 'none'}${stats.since ? ` (since ${stats.since})` : ''}`);
+ for (const line of barStatsLines(stats.bars)) io.say(line);
for (const line of flowLines(stats.flow)) io.say(line);
return 0;
},
@@ -2898,6 +2901,7 @@ function workCommands(io, args) {
criterion: values.criterion,
check: values.check,
after: editAfter(values.after),
+ ...(values.reason !== undefined ? { reason: values.reason } : {}),
};
const { item, command } = store.validateItemEdit(board, id, change);
if (command && command !== item.item_check) change.checkBaseline = values.wait ? checkBaseline(ctx.info.root, command) : prepareCheckBaseline(ctx.info.root, command);
diff --git a/src/engine.js b/src/engine.js
index 4948b094..8f1c9ca0 100644
--- a/src/engine.js
+++ b/src/engine.js
@@ -2,6 +2,7 @@
import { createHash, randomUUID } from 'node:crypto';
import * as store from './board.js';
import { recordedRefusal } from './recorded-refusal.js';
+import { BAR_ENGINE, carriesBarReason } from './bar-corrections.js';
import { ENGINE_VERSION } from './machine.js';
import { Refused } from './refused.js';
import { requestMoveProblem, recordRequestMove } from './relay-requests.js';
@@ -22,9 +23,10 @@ export const ENGINE_OPERATIONS = Object.freeze([
/** Engine version at which each ordered operation first has stable replay semantics. */
const OPERATION_ENGINE = Object.freeze({ reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8 });
-/** Dependency edits add engine-10 meaning without changing ordinary historical edit envelopes. */
+/** Dependency edits add engine-10 meaning, and edit reasons engine-19 meaning, without changing ordinary historical edit envelopes. */
function minimumOperationEngine(operation, args) {
const options = args[1];
+ if (carriesBarReason(operation, args)) return BAR_ENGINE;
return operation === 'editItem' && options && Object.hasOwn(options, 'after') && options.after !== undefined
? 10 : OPERATION_ENGINE[operation] ?? 1;
}
diff --git a/src/help.js b/src/help.js
index a1185b07..d858079e 100644
--- a/src/help.js
+++ b/src/help.js
@@ -58,6 +58,8 @@ Work
with --criterion and a brief, --check is needed below strong
pullboard edit <id> [--brief "..." | --brief-file <file>] [--route light|mid|strong] [--criterion "..."] [--check "..."]
[--wait] wait for a new check's baseline; otherwise it runs in the background
+ [--reason "what the old bar got wrong"] needed to change the criterion or check of an item
+ that was ever claimed; show and stats list each correction
pullboard escalate <id> --note "what was tried and how it failed" hand it one tier up
pullboard run --agent "<command>" [--attempts 3] [--minutes 15] [--items N] [--wait M]
build routed items unattended in this worktree: the agent command reads
diff --git a/src/machine.js b/src/machine.js
index 71b60afe..bbd1cfb9 100644
--- a/src/machine.js
+++ b/src/machine.js
@@ -10,7 +10,7 @@
*/
/** Executable move semantics, carried by every sealed move and retained during replay [H16]. */
-export const ENGINE_VERSION = 12;
+export const ENGINE_VERSION = 19;
/** @typedef {'agent' | 'coordinator' | 'clock'} Role */
diff --git a/src/next-steps.js b/src/next-steps.js
index d8afe8fe..9cb40d6b 100644
--- a/src/next-steps.js
+++ b/src/next-steps.js
@@ -172,6 +172,7 @@ export const NEXT_STEPS = Object.freeze({
MISSING_SIGNERS: 'restore the signer list from git: git checkout HEAD -- .pullboard/signers',
MODEL_REQUIRED: 'pass --model "<model name>", or set PULLBOARD_MODEL in this shell',
MOVED_DURING_GATE: 'leave the worktree alone until the gate finishes, then submit again',
+ BAR_REASON: 'say what the old bar got wrong: pullboard edit <id> --reason "..."',
NOTE_REQUIRED: 'add --note "<what happened>"',
NOTHING_FREE: 'wait for work: pullboard next --wait 9 (minutes)',
NOT_AT_COMMIT: 'check out the submitted commit shown by pullboard show <id>: git switch --detach <commit>',
diff --git a/src/stats.js b/src/stats.js
index 1f6fd7da..daad921e 100644
--- a/src/stats.js
+++ b/src/stats.js
@@ -2,6 +2,7 @@
import { events } from './board.js';
import { Refused } from './refused.js';
import { flowStats } from './stats-flow.js';
+import { barStats } from './bar-corrections.js';
/** Parse an inclusive UTC date boundary, refusing malformed or impossible dates. */
export function sinceDate(value) {
@@ -98,5 +99,6 @@ export function proofStats(board, { since, now = Date.now() } = {}) {
const boundary = sinceDate(since);
const history = events(board);
const counts = countsFrom(history, boundary);
- return { ...counts, ...actorsFrom(history, boundary), flow: flowStats(history, boundary, now, counts) };
+ const verdicts = board.db.prepare('SELECT * FROM verdict ORDER BY verdict_id').all();
+ return { ...counts, ...actorsFrom(history, boundary), bars: barStats(history, verdicts, boundary), flow: flowStats(history, boundary, now, counts) };
}
diff --git a/test/agent-model-engine.test.js b/test/agent-model-engine.test.js
index e85e2e8d..ba92a56d 100644
--- a/test/agent-model-engine.test.js
+++ b/test/agent-model-engine.test.js
@@ -11,7 +11,7 @@ import { tmpdir } from 'node:os';
import { join } from 'node:path';
test('model declarations and event snapshots retain engines 1 through 11 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 12, 'engine 12 preserves the released engine-8 through engine-11 model behavior');
+ assert.equal(ENGINE_VERSION, 19, 'engine 19 preserves the released engine-8 through engine-11 model behavior');
for (const version of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ENGINE_VERSION]) {
const board = store.openBoard(':memory:');
t.after(() => store.closeBoard(board));
diff --git a/test/bar-corrections.test.js b/test/bar-corrections.test.js
new file mode 100644
index 00000000..5204149c
--- /dev/null
+++ b/test/bar-corrections.test.js
@@ -0,0 +1,159 @@
+/** A corrected bar records why the old one was wrong, on the item and in stats [B10,B31,R1,H16]. */
+import assert from 'node:assert/strict';
+import { runFixtureChild, runFixtureGit } from './fixture-child.js';
+import { chmodSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+import { after, test } from 'node:test';
+import * as store from '../src/board.js';
+import { applyEngineMove, applyRelayMove, prepareEngineMove } from '../src/engine.js';
+
+const BIN = resolve(import.meta.dirname, '../bin/pullboard.js');
+const sandboxes = [];
+const SPEC = '# Bar fixture\n\n## G · Goals\n- G1 [approved, must] The feature works. | gate: test\n';
+const HOUR = 3_600_000;
+
+after(() => {
+ for (const dir of sandboxes) rmSync(dir, { recursive: true, force: true });
+});
+
+/** Make an isolated real-Git repo with a board, a coordinator, a web builder, a reviewer and three web items. */
+function fixture() {
+ const dir = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-bar-')));
+ sandboxes.push(dir);
+ const shims = join(dir, 'bin');
+ mkdirSync(shims);
+ writeFileSync(join(shims, 'pullboard'), `#!/bin/sh\nexec "${process.execPath}" "${BIN}" "$@"\n`, { mode: 0o755 });
+ chmodSync(join(shims, 'pullboard'), 0o755);
+ const env = {
+ ...process.env,
+ PATH: `${shims}:${process.env.PATH}`,
+ GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_NOSYSTEM: '1',
+ GIT_AUTHOR_NAME: 'Test Agent', GIT_AUTHOR_EMAIL: '[email protected]',
+ GIT_COMMITTER_NAME: 'Test Agent', GIT_COMMITTER_EMAIL: '[email protected]',
+ PULLBOARD_HOME: join(dir, 'home'), PULLBOARD_MACHINE_HOME: join(dir, 'machine-home'),
+ };
+ for (const name of Object.keys(env)) if (name.startsWith('GIT_') && !name.startsWith('GIT_CONFIG') && !name.startsWith('GIT_AUTHOR') && !name.startsWith('GIT_COMMITTER')) delete env[name];
+ delete env.PULLBOARD_RELAY_TOKEN;
+ const repo = join(dir, 'repo');
+ mkdirSync(repo);
+ /** Run Git in this private fixture with its isolated identity. */
+ const git = (cwd, ...args) => runFixtureGit(args, { cwd, env });
+ /** Run the actual CLI in a fixture checkout and keep both output streams. */
+ const run = (cwd, ...args) => {
+ const result = runFixtureChild(process.execPath, [BIN, ...args], { cwd, env, encoding: 'utf8' });
+ return { code: result.status, out: result.stdout ?? '', err: result.failure ?? result.stderr ?? '' };
+ };
+ /** Run a command that must succeed with --json and return its one document. */
+ const json = (cwd, ...args) => {
+ const result = run(cwd, ...args, '--json');
+ assert.equal(result.code, 0, `${args.join(' ')}: ${result.err}${result.out}`);
+ return JSON.parse(result.out);
+ };
+ git(repo, 'init', '-q', '-b', 'main');
+ assert.equal(run(repo, 'init').code, 0);
+ writeFileSync(join(repo, 'pullboard.json'), JSON.stringify({
+ gate: 'true', spec: 'SPEC.md', verify: 'any', lease: '2h',
+ lanes: { web: { owns: ['web/'], specs: ['G1'] } },
+ }, null, 2));
+ writeFileSync(join(repo, 'SPEC.md'), SPEC);
+ mkdirSync(join(repo, 'web'));
+ writeFileSync(join(repo, 'web', 'shared.txt'), 'base\n');
+ git(repo, 'add', '-A');
+ git(repo, 'commit', '-q', '-m', 'chore: create bar fixture');
+ const web = json(repo, 'worktree', 'web', '--route', 'strong').path;
+ const review = json(repo, 'worktree', 'web', '--route', 'strong').path;
+ for (const title of ['Corrected item', 'Unclaimed item', 'Build-failed item']) {
+ json(repo, 'add', 'web', title, '--specs', 'G1', '--criterion', `${title} works`, '--check', 'true');
+ }
+ return { repo, web, review, run, json };
+}
+
+/** Submit an item from the builder and reject it from the reviewer. */
+function rejectOnce(box, id, note) {
+ box.json(box.web, 'submit', String(id));
+ box.json(box.review, 'next', '--verify', String(id));
+ box.json(box.review, 'verify', String(id), 'reject', '--reason', 'TEST_FAILURE', '--note', note);
+}
+
+test('[B10,B31] a corrected bar records why the old one was wrong', () => {
+ const box = fixture();
+ box.json(box.web, 'claim', '1');
+
+ const refused = box.run(box.repo, 'edit', '1', '--criterion', 'Corrected item works under WAL', '--json');
+ assert.notEqual(refused.code, 0, 'a criterion correction on a claimed item without a reason is refused');
+ const error = JSON.parse(refused.out).error;
+ assert.equal(error.code, 'BAR_REASON');
+ assert.match(error.message, /--reason/, 'the refusal names the flag');
+ assert.equal(box.json(box.repo, 'show', '1').item_criterion, 'Corrected item works', 'a refused correction changes nothing');
+
+ box.json(box.repo, 'edit', '1', '--criterion', 'Corrected item works under WAL', '--reason', 'the old bar described a lock a WAL board never takes');
+ const edit = box.json(box.repo, 'show', '1').thread.filter((entry) => entry.type === 'move' && entry.kind === 'edit').at(-1);
+ assert.equal(edit.detail.reason, 'the old bar described a lock a WAL board never takes', 'the reason is stored with the edit');
+ assert.deepEqual(edit.detail.barCorrection, { fields: ['criterion'], reject: null }, 'the edit is marked as a bar correction');
+
+ box.json(box.web, 'refreeze', '1');
+ rejectOnce(box, 1, 'the WAL lock never appears');
+ const unexplained = box.run(box.repo, 'edit', '1', '--check', 'true # wal', '--json');
+ assert.equal(JSON.parse(unexplained.out).error.code, 'BAR_REASON', 'a check correction on an item that was claimed needs a reason too');
+ box.json(box.repo, 'edit', '1', '--check', 'true # wal', '--reason', 'the old check never opened a WAL board');
+ const marked = box.json(box.repo, 'show', '1').thread.filter((entry) => entry.type === 'move' && entry.kind === 'edit').at(-1);
+ assert.equal(marked.detail.barCorrection.reject.by, 'web-2', 'a reject followed by a correction is marked as caused by the bar');
+ assert.equal(marked.detail.barCorrection.reject.reason, 'TEST_FAILURE');
+
+ const shown = box.run(box.repo, 'show', '1');
+ assert.equal(shown.code, 0, shown.err);
+ assert.ok(shown.out.includes('bar corrected by coordinator (criterion): the old bar described a lock a WAL board never takes'), `show lists the first correction with its reason:\n${shown.out}`);
+ assert.ok(shown.out.includes('bar corrected by coordinator (check): the old check never opened a WAL board; the reject by web-2 was caused by the bar'), 'show lists the second with its reason and the reject it explains');
+
+ const plain = box.json(box.repo, 'edit', '2', '--criterion', 'Unclaimed item works better');
+ assert.equal(plain.item.item_criterion, 'Unclaimed item works better', 'an edit before any claim needs no reason');
+ const unclaimedEdit = box.json(box.repo, 'show', '2').thread.filter((entry) => entry.type === 'move' && entry.kind === 'edit').at(-1);
+ assert.equal(unclaimedEdit.detail.barCorrection, undefined, 'an edit before any claim is not a bar correction');
+
+ box.json(box.web, 'claim', '3');
+ rejectOnce(box, 3, 'the build is broken');
+ const stats = box.json(box.repo, 'stats').stats.bars;
+ assert.deepEqual(stats, { coordinator: { corrections: 2, barRejects: 1, buildRejects: 1 } },
+ 'stats reports, per coordinator, bar corrections and rejects caused by a bar, beside rejects caused by the build');
+ const text = box.run(box.repo, 'stats');
+ assert.match(text.out, /bars: coordinator: 2 corrections, 1 reject caused by a bar, 1 reject caused by the build/);
+});
+
+test('[B31,H16] the bar-correction rule replays by engine and takes nothing from the move but the reason', () => {
+ let at = Date.parse('2026-10-17T00:00:00.000Z');
+ const board = store.openBoard(':memory:', { now: () => new Date(at += 1000) });
+ try {
+ store.register(board, { lane: 'coordinator', path: '/repo' });
+ store.register(board, { lane: 'web', path: '/repo-web-1' });
+ const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Replayed', criterion: 'first' });
+ store.claim(board, id, { agentId: 'web-1', lane: 'web', leaseMs: 2 * HOUR, freeze: (found) => ({ text: found.item_criterion, digest: 'd' }) });
+ let sequence = 0;
+ const receipt = () => ({ sequence: ++sequence, at: new Date(at).toISOString(), sender: { kind: 'agent', userId: 'user', agent: 'coordinator' }, kind: 'move' });
+
+ const legacy = prepareEngineMove(board, 'editItem', [id, { agentId: 'coordinator', criterion: 'second' }]);
+ legacy.engine = 12;
+ assert.equal(applyRelayMove(board, legacy, receipt()).error, undefined, 'an engine-12 correction without a reason replays as it always did');
+ assert.equal(store.getItem(board, id).item_criterion, 'second');
+
+ const unexplained = prepareEngineMove(board, 'editItem', [id, { agentId: 'coordinator', criterion: 'third' }]);
+ assert.equal(applyRelayMove(board, unexplained, receipt()).error?.code, 'BAR_REASON', 'a current correction without a reason is refused on every replica');
+
+ const forged = prepareEngineMove(board, 'editItem', [id, { agentId: 'coordinator', criterion: 'third', reason: 'the second bar was wrong',
+ barCorrection: { fields: [], reject: { by: 'web-9', reason: 'TEST_FAILURE' } } }]);
+ assert.equal(applyRelayMove(board, forged, receipt()).error, undefined);
+ const edit = store.events(board, { itemId: id }).filter((event) => event.event_kind === 'edit').map((event) => JSON.parse(event.event_detail)).at(-1);
+ assert.deepEqual(edit.barCorrection, { fields: ['criterion'], reject: null }, 'the board derives the correction and its reject; a move cannot supply them');
+
+ const old = prepareEngineMove(board, 'editItem', [id, { agentId: 'coordinator', criterion: 'fourth', reason: 'older engine' }]);
+ old.engine = 12;
+ const before = store.events(board).length;
+ assert.throws(() => applyEngineMove(board, old, { sequence: sequence + 1, at: new Date(at).toISOString() }), { code: 'RELAY_MOVE' },
+ 'a reason-bearing edit sealed below the bar engine is refused before it is interpreted');
+ assert.equal(store.events(board).length, before);
+
+ const agent = applyRelayMove(board, prepareEngineMove(board, 'editItem', [id, { agentId: 'coordinator', criterion: 'fifth', reason: 'forged' }]),
+ { ...receipt(), sender: { kind: 'agent', userId: 'user', agent: 'web-1' } });
+ assert.equal(agent.error?.code, 'RELAY_SENDER_MISMATCH', 'an agent cannot correct a bar as the coordinator through the relay');
+ } finally { store.closeBoard(board); }
+});
diff --git a/test/board.test.js b/test/board.test.js
index c9f9daf6..c2774495 100644
--- a/test/board.test.js
+++ b/test/board.test.js
@@ -432,7 +432,7 @@ test('a rejected commit resubmits after its bar is corrected [V4,B3]', async (t)
(error) => error.code === 'HEAD_NOT_NEW',
'the same rejected head is still refused while its criterion is unchanged',
);
- store.editItem(durable, id, { agentId: 'coordinator', criterion: 'the page renders an accessible heading' });
+ store.editItem(durable, id, { agentId: 'coordinator', criterion: 'the page renders an accessible heading', reason: 'the fixture corrects its bar' });
const correction = store.refreeze(durable, id, { agentId: 'coordinator', freeze: criterionFreeze });
assert.notEqual(correction.after, originalClaim.digest);
assert.equal(store.getItem(durable, id).item_owner, builder, 'refreeze keeps the builder claim for the corrected bar');
@@ -782,10 +782,10 @@ test('changing a criterion or a check drops the frozen bar, in the open; the nex
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Page' });
claimAs(id, 'web-1', 'web');
store.release(board, id, 'web-1');
- store.editItem(board, id, { agentId: 'coordinator', check: 'npm test', criterion: 'renders' });
+ store.editItem(board, id, { agentId: 'coordinator', check: 'npm test', criterion: 'renders', reason: 'the fixture corrects its bar' });
assert.equal(store.getItem(board, id).item_frozen_digest, null);
const edit = store.events(board, { itemId: id }).find((event) => event.event_kind === 'edit');
- assert.deepEqual(JSON.parse(edit.event_detail), { criterion: 'renders', check: 'npm test', unfrozen: 'digest:Page', model: 'unknown' });
+ assert.deepEqual(JSON.parse(edit.event_detail), { criterion: 'renders', check: 'npm test', unfrozen: 'digest:Page', reason: 'the fixture corrects its bar', barCorrection: { fields: ['criterion', 'check'], reject: null }, model: 'unknown' });
assert.equal(claimAs(id, 'web-1', 'web').digest, 'digest:Page');
});
@@ -803,7 +803,7 @@ test('edit after an expired claim reopens it and names its holder [B13]', () =>
claimAs(id, 'web-1', 'web');
clock.advance(2 * HOUR + 1);
assert.doesNotThrow(
- () => store.editItem(board, id, { agentId: 'coordinator', ...change }),
+ () => store.editItem(board, id, { agentId: 'coordinator', ...change, reason: 'the fixture corrects its bar' }),
`an expired ${title.toLowerCase()} edit must reopen the item before writing its fields`,
);
const stored = store.itemById(board, id);
diff --git a/test/machine.test.js b/test/machine.test.js
index fc0aada7..1087aacc 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -941,7 +941,7 @@ test('submit, accept and reject refuse in the declared order, one failure peeled
const submits = [submitAs(999, 'web-1', SHA_A), submitAs(piece, 'web-1', SHA_A)];
store.claim(board, piece, { agentId: 'web-1', lane: 'web', leaseMs: 7_200_000, freeze });
submits.push(submitAs(piece, 'web-2', SHA_A));
- store.editItem(board, piece, { agentId: 'coordinator', criterion: 'A correction before submission.' });
+ store.editItem(board, piece, { agentId: 'coordinator', criterion: 'A correction before submission.', reason: 'the fixture corrects its bar' });
submits.push(submitAs(piece, 'web-1', SHA_A));
assert.equal(submits.at(-1), 'PENDING_REFREEZE', 'a pending correction stops the board submission before later guards');
store.refreeze(board, piece, { agentId: 'web-1', freeze });
@@ -1246,7 +1246,7 @@ test('the two conditional guards behave as declared: a renewal passes a held lan
assert.equal(claimAs(mine, 'web-1', retiredFreeze), 'ok', 'a reclaim keeps the frozen bar too');
assert.equal(claimAs(theirs, 'web-2', retiredFreeze), 'UNKNOWN_SPEC', 'a first claim freezes, so it checks the rows');
store.release(board, mine, 'web-1');
- store.editItem(board, mine, { agentId: 'coordinator', criterion: 'A changed bar.' });
+ store.editItem(board, mine, { agentId: 'coordinator', criterion: 'A changed bar.', reason: 'the fixture corrects its bar' });
assert.equal(claimAs(mine, 'web-1', retiredFreeze), 'UNKNOWN_SPEC', 'after an edit drops the bar, the next claim freezes and checks');
assert.equal(outcome(() => store.refreeze(board, mine, { agentId: 'coordinator', freeze: retiredFreeze })), 'UNKNOWN_SPEC', 'refreeze freezes, so it checks');
} finally {
diff --git a/test/pending-refreeze.test.js b/test/pending-refreeze.test.js
index 15ad01aa..7191bfc2 100644
--- a/test/pending-refreeze.test.js
+++ b/test/pending-refreeze.test.js
@@ -57,7 +57,7 @@ test("the coordinator corrects a claimed item's criterion without release [V2]",
const agentEdit = box.run(box.web, 'edit', String(id), '--criterion', 'an agent cannot change the frozen bar', '--json');
assert.match(refusal(agentEdit, 'HELD', id).message, /only the coordinator may edit it while held/u);
- const corrected = box.run(box.repo, 'edit', String(id), '--criterion', 'the corrected criterion', '--check', 'true && true', '--json');
+ const corrected = box.run(box.repo, 'edit', String(id), '--criterion', 'the corrected criterion', '--check', 'true && true', '--reason', 'the fixture corrects its bar', '--json');
assert.equal(corrected.code, 0, corrected.err || corrected.out);
const pending = store.getItem(board, id);
assert.equal(pending.item_criterion, 'the corrected criterion');
@@ -109,7 +109,7 @@ test("the coordinator corrects a claimed item's criterion without release [V2]",
const checkClaim = box.run(box.web, 'claim', String(checkId), '--json');
assert.equal(checkClaim.code, 0, checkClaim.err || checkClaim.out);
const checkBefore = store.getItem(board, checkId);
- const checkEdit = box.run(box.repo, 'edit', String(checkId), '--check', 'true && true', '--json');
+ const checkEdit = box.run(box.repo, 'edit', String(checkId), '--check', 'true && true', '--reason', 'the fixture corrects its bar', '--json');
assert.equal(checkEdit.code, 0, checkEdit.err || checkEdit.out);
const checkPending = store.getItem(board, checkId);
assert.equal(checkPending.item_criterion, checkBefore.item_criterion);
@@ -252,7 +252,7 @@ async function checkDependencyLegacyClients(cleanup, directory, snapshot, target
const oldSnapshot = legacyExchange.exportBoard(old);
const currentSnapshot = exportBoard(current);
assert.equal(oldSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, '10');
- assert.equal(currentSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, '12');
+ assert.equal(currentSnapshot.tables.board_meta.find((row) => row.meta_key === 'relay_engine_version').meta_value, String(ENGINE_VERSION));
assert.deepEqual(withoutEngineMarker(currentSnapshot), withoutEngineMarker(oldSnapshot),
'the sole snapshot difference is the intentionally newer writer-version marker');
}
@@ -261,7 +261,7 @@ async function checkDependencyLegacyClients(cleanup, directory, snapshot, target
}
test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) => {
- assert.equal(ENGINE_VERSION, 12);
+ assert.equal(ENGINE_VERSION, 19);
const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));
const cleanup = [];
t.after(() => {
@@ -441,7 +441,7 @@ test('ordered refreeze corrections retain engine-7 history and engine-8 live cla
}]);
applyCurrentBoth(currentClaim, 1, sender);
const correction = prepareEngineMove(current, 'editItem', [currentId, {
- agentId: 'coordinator', criterion: 'corrected by an ordered coordinator move',
+ agentId: 'coordinator', criterion: 'corrected by an ordered coordinator move', reason: 'the fixture corrects its bar',
}]);
applyCurrentBoth(correction, 2, coordinatorSender);
for (const replica of [current, currentReplica]) {
diff --git a/test/reopen.test.js b/test/reopen.test.js
index 9c7fa89b..79040250 100644
--- a/test/reopen.test.js
+++ b/test/reopen.test.js
@@ -254,7 +254,7 @@ test('the coordinator reopens a submitted item without a verdict [V2,V6,O8]', (t
});
assert.equal(store.events(board).some((event) => event.event_kind === 'release' && JSON.parse(event.event_detail).review), false);
- const edited = box.run(box.repo, 'edit', '1', '--criterion', 'The page renders a heading.');
+ const edited = box.run(box.repo, 'edit', '1', '--criterion', 'The page renders a heading.', '--reason', 'the fixture corrects its bar');
assert.equal(edited.code, 0, edited.err);
assert.equal(store.getItem(board, 1).item_criterion, 'The page renders a heading.');
});
@@ -623,7 +623,7 @@ test('a reopened bar takes the same commit again [V2,V6,H16]', async (t) => {
const secondReopen = box.run(box.repo, 'reopen', '1', '--note', 'correct the frozen criterion to match the implemented heading');
assert.equal(secondReopen.code, 0, secondReopen.err);
- const edited = box.run(box.repo, 'edit', '1', '--criterion', 'The page renders a heading.');
+ const edited = box.run(box.repo, 'edit', '1', '--criterion', 'The page renders a heading.', '--reason', 'the fixture corrects its bar');
assert.equal(edited.code, 0, edited.err);
const claimed = box.run(box.web, 'claim', '1');
diff --git a/test/row-decisions-replay.test.js b/test/row-decisions-replay.test.js
index 8f048ccf..2e69ba00 100644
--- a/test/row-decisions-replay.test.js
+++ b/test/row-decisions-replay.test.js
@@ -144,7 +144,7 @@ test('captured person decisions and coordinator apply replay identically without
});
test('engine 12 records preserved decline text and replays a separate reason [S18,S19,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 12);
+ assert.ok(ENGINE_VERSION >= 12, 'engine 12 decline semantics hold in every later engine');
const { source, copies: [one, two] } = decisionCopies(t);
const preserved = {
kind: 'spec', file: 'SPEC.md', id: 'G2',