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(board): replace ceiling escalation with a notice [B15,H16]
Corey Olsonce52b86b034e
diff --git a/docs/api.md b/docs/api.mdindex 323061ca..997a7e99 100644--- a/docs/api.md+++ b/docs/api.md@@ -223,7 +223,7 @@ The health sentinel runs this read-only scan on `pullboard resume` and every ten## Automatic escalation-Starting with engine 50, the second REJECT verdict since an item's latest route change records the existing escalation move automatically. Releases do not count as failed attempts. One `escalate` event carries both rejection records, including their reason, note, commit, digest, checked head and timestamp. A hand escalation or a route edit starts a new count; strong remains the ceiling. Sealed operations from engines below 50 retain their prior replay behavior.+Starting with engine 50, the second REJECT verdict since an item's latest route change records the existing escalation move automatically. Releases do not count as failed attempts. One `escalate` event carries both rejection records, including their reason, note, commit, digest, checked head and timestamp. A hand escalation or a route edit starts a new count; strong remains the ceiling. Sealed operations from engines below 50 retain their prior replay behavior. Starting with engine 54, a pair at the strongest route records a `strong-rejection-notice` and sends the coordinator one message naming the builder and both rejection receipts, without an `escalate` event or route change. The notice starts the next pair count; ordinary reject, owner and lease behavior is unchanged. Engine 50 through 53 replay retains its ceiling escalation.## Item threadsdiff --git a/docs/formats.md b/docs/formats.mdindex cbc0ebe8..b4c96519 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -113,7 +113,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` | `50` | `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` | `54` | `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.@@ -432,3 +432,5 @@ Engine 34 adds the agent/coordinator `orderMilestoneItems` move, carrying a mileEngine 43 (`RIGOR_NOTICE_ENGINE`) posts one coordinator shout and one typed `rigor-notice` receipt when a reject, reopen or person never-again fact makes a cause repeat. Both are part of that move’s transaction. Recorded engines through 42 retain their original event streams. A person’s exact row-decision receipt for a typed Rigor source silences that repeat until a new item repeats it; later commits on an already known item do not override the decline.A proved Rigor draft carries `source: rigor:<percent-encoded JSON>` with `version: 1`, its `key`, `evidence` (`items`, `occurrences`, `neverAgain`) and `proof` (`check`, `red`, `green`). The proof contains actual full commits, executed exit statuses and problem counts. The existing spec and doctrine row grammar reads this field; prose mentioning Rigor is not a typed source. The person uses ordinary Approve or Decline, and the coordinator applies the approved row without a new build item.++Engine 54 replaces the automatic strong-to-strong ceiling escalation with one coordinator notice per rejection pair, naming the builder and both rejection receipts. Ordinary rejection still reopens and clears the owner and lease. Light and mid routes keep engine-50 automatic escalation. Engines 50 through 53 retain their original ceiling escalation when replayed.diff --git a/src/board.js b/src/board.jsindex c534d834..72bbf517 100644--- a/src/board.js+++ b/src/board.js@@ -46,7 +46,7 @@ import { Refused } from './refused.js';import {ROUTES,canTake,- rejectedItemEscalation,+ recordRejectedItemRoute,} from './route-escalation.js';export { ROUTES, canTake };import {@@ -1590,8 +1590,7 @@ export function verify(board, id, { agentId, decision, reason, note = '', cause,if (newReview) detail.review = { commit: review.commit, ...(Object.hasOwn(review, 'head') ? { head: review.head } : {}), trunk: review.trunk, paths: [...review.paths] };logEvent(board, agentId, verb, id, implies?.length ? { ...detail, implies } : detail);const trigger = board.lastEvent;- const escalation = !isAccept && rejectedItemEscalation(board, id, engine, item.item_route);- if (escalation) escalate(board, id, escalation);+ if (!isAccept) recordRejectedItemRoute(board, id, engine, item, { escalate, shout, logEvent });tellVerdictImplications(board, (by, itemId, fact) => logEvent(board, by, 'fact', itemId, fact), id, { seed: impliesId, implies });if (!isAccept) postRigorNotices(board, trigger);return { decision, reason: code, ...(isAccept && check !== undefined ? { check } : {}) };diff --git a/src/machine.js b/src/machine.jsindex bf39c8c1..19f7c73d 100644--- a/src/machine.js+++ b/src/machine.js@@ -14,8 +14,11 @@ import { RIGOR_NOTICE_ENGINE } from './rigor-source.js';/** First engine that automatically escalates an item's second rejection at its current route [B15]. */export const AUTO_ESCALATE_ENGINE = 50;+/** First engine replacing an automatic ceiling escalation with a paired notice [B15,H16]. */+export const STRONG_REJECTION_NOTICE_ENGINE = 54;+/** Executable move semantics, carried by every sealed move and retained during replay [H16]. */-export const ENGINE_VERSION = Math.max(AUTO_ESCALATE_ENGINE, RIGOR_NOTICE_ENGINE);+export const ENGINE_VERSION = Math.max(AUTO_ESCALATE_ENGINE, RIGOR_NOTICE_ENGINE, STRONG_REJECTION_NOTICE_ENGINE);/*** The engine whose relay moves carry seat provenance and verifier standing (#579). It is its owndiff --git a/src/route-escalation.js b/src/route-escalation.jsindex 09d61f76..a795f3ab 100644--- a/src/route-escalation.js+++ b/src/route-escalation.js@@ -1,6 +1,7 @@/** Model route policy and rejection receipts for automatic escalation [B13,B15,H16]. */import { COORDINATOR } from './config.js';import { AUTO_ESCALATE_ENGINE } from './machine.js';+import { STRONG_REJECTION_NOTICE_ENGINE } from './machine.js';import { verdictsFor } from './verdict-reviews.js';/**@@ -26,7 +27,7 @@ export const canTake = (agentRoute, itemRoute) => ROUTES.indexOf(itemRoute) <= R* @param {number} id* @returns {object[]}*/-function rejectionsSinceRouteChange(board, id) {+function rejectionsSinceRouteChange(board, id, engine) {const thread = board.db.prepare('SELECT * FROM event WHERE item_id = ? ORDER BY event_id').all(id);let lastRouteChange = -1;for (const [index, event] of thread.entries()) {@@ -34,6 +35,8 @@ function rejectionsSinceRouteChange(board, id) {lastRouteChange = index;continue;}+ if (engine >= STRONG_REJECTION_NOTICE_ENGINE && event.event_kind === 'strong-rejection-notice'+ && JSON.parse(event.event_detail).engine === STRONG_REJECTION_NOTICE_ENGINE) lastRouteChange = index;if (event.event_kind === 'edit' && Object.hasOwn(JSON.parse(event.event_detail), 'route')) lastRouteChange = index;}const verdictEvents = thread.filter((event) => ['accept', 'reject'].includes(event.event_kind));@@ -70,7 +73,7 @@ function rejectionsSinceRouteChange(board, id) {*/export function rejectedItemEscalation(board, id, engine, route) {if (engine < AUTO_ESCALATE_ENGINE) return null;- const rejections = rejectionsSinceRouteChange(board, id).slice(-2);+ const rejections = rejectionsSinceRouteChange(board, id, engine).slice(-2);if (rejections.length < 2) return null;return {agentId: COORDINATOR,@@ -78,3 +81,20 @@ export function rejectedItemEscalation(board, id, engine, route) {rejections,};}++/** Finish the rejection's route action atomically; old engines retain ceiling escalation [B15,H16]. */+export function recordRejectedItemRoute(board, id, engine, item, { escalate, shout, logEvent }) {+ const escalation = rejectedItemEscalation(board, id, engine, item.item_route);+ if (!escalation) return;+ if (engine < STRONG_REJECTION_NOTICE_ENGINE || item.item_route !== ROUTES.at(-1)) {+ escalate(board, id, escalation);+ return;+ }+ const builder = item.item_built_by ?? item.item_owner;+ logEvent(board, COORDINATOR, 'strong-rejection-notice', id, {+ engine: STRONG_REJECTION_NOTICE_ENGINE, route: item.item_route, builder, rejections: escalation.rejections,+ });+ const receipts = escalation.rejections.map(entry => `#${entry.verdictId} (${entry.reason})`).join(', ');+ shout(board, { from: COORDINATOR, to: COORDINATOR, lanes: [COORDINATOR],+ text: `#${id} has two send-backs at the strongest route; ${builder} built it. Rejections: ${receipts}.` });+}diff --git a/test/agent-model-engine.test.js b/test/agent-model-engine.test.jsindex 82cfcf04..5d883a8d 100644--- a/test/agent-model-engine.test.js+++ b/test/agent-model-engine.test.js@@ -16,11 +16,11 @@ import { tmpdir } from 'node:os';import { join } from 'node:path';test('model declarations and event snapshots retain all supported engine semantics [O8,O3,H16]', (t) => {- assert.equal(ENGINE_VERSION, AUTO_ESCALATE_ENGINE, 'the current writer is the automatic-escalation engine');+ assert.ok(ENGINE_VERSION >= AUTO_ESCALATE_ENGINE, 'the current writer retains automatic escalation');assert.ok(ENGINE_VERSION >= 45, 'the current writer retains engine-45 milestone semantics');assert.ok(ENGINE_VERSION >= RIGOR_NOTICE_ENGINE, 'the next writer preserves every historical model snapshot through main engine 33');assert.ok(ENGINE_VERSION >= HEALTH_SENTINEL_ENGINE, 'the current writer retains the sentinel minimum and historical behavior');- assert.equal(AUTO_ESCALATE_ENGINE, ENGINE_VERSION, 'the current writer includes automatic escalation and preserves historical model snapshots');+ assert.ok(ENGINE_VERSION >= AUTO_ESCALATE_ENGINE, 'the current writer includes automatic escalation and preserves historical model snapshots');assert.ok(ENGINE_VERSION >= VERIFIER_STANDING_ENGINE, 'the current writer retains verifier standing');assert.ok(ENGINE_VERSION >= MILESTONE_SHIP_ENGINE, 'the current writer retains milestone shipping');for (const version of Array.from({ length: ENGINE_VERSION }, (_, index) => index + 1)) {diff --git a/test/board.test.js b/test/board.test.jsindex 50716f59..4a04893f 100644--- a/test/board.test.js+++ b/test/board.test.js@@ -13,11 +13,11 @@ import * as store from '../src/board.js';import { displayAgentName } from '../src/agent-names.js';import { projectState } from '../src/serve.js';import { applyEngineMove, prepareEngineMove } from '../src/engine.js';-import { exportBoard } from '../src/exchange.js';+import { exportBoard, importBoard } from '../src/exchange.js';import { main } from '../src/cli.js';import { briefFiles } from '../src/brief.js';import { JSON_SHAPES } from '../src/json.js';-import { AUTO_ESCALATE_ENGINE, ENGINE_VERSION } from '../src/machine.js';+import { AUTO_ESCALATE_ENGINE, ENGINE_VERSION, STRONG_REJECTION_NOTICE_ENGINE } from '../src/machine.js';import { pathToFileURL } from 'node:url';import { unpackRelease } from './release-archive.js';@@ -943,9 +943,18 @@ test('two send-backs at the strongest route record no escalation [B15,B13,H16]',assert.equal(notices.length, 1, 'one coordinator notice for this rejection pair');assert.match(notices[0].shout_text, /web-1 built it/u);for (const rejection of rejections) assert.ok(notices[0].shout_text.includes(`#${rejection.verdict_id}`), 'the notice names both rejection receipts');+ rejectRevision(id, SHA_C, 'third strong send-back');+ assert.equal(store.allShouts(board).length, 1, 'one further rejection cannot repeat the pair notice');+ rejectRevision(id, SHA_D, 'fourth strong send-back');+ const nextNotices = store.allShouts(board);+ assert.equal(nextNotices.length, 2, 'a new pair gets its own single notice');+ const nextRejections = store.verdictsFor(board, id).filter(entry => entry.verdict_decision === 'REJECT').slice(-2);+ for (const rejection of nextRejections) assert.ok(nextNotices[1].shout_text.includes(`#${rejection.verdict_id}`));+ assert.equal(store.events(board, { itemId: id }).filter(event => event.event_kind === 'escalate').length, 0);});test('an item at strong stays at strong after more failures [B15,B13]', () => {+ board.executionEngineVersion = AUTO_ESCALATE_ENGINE;const id = routed('Strong ceiling', 'strong');rejectRevision(id, SHA_A, 'strong reject one');rejectRevision(id, SHA_B, 'strong reject two');@@ -961,6 +970,45 @@ test('an item at strong stays at strong after more failures [B15,B13]', () => {}));});+for (const version of [50, 51, 52, 53, STRONG_REJECTION_NOTICE_ENGINE]) {+ test(`engine ${version} ceiling send-backs replay identically on replicas [B15,H16]`, (t) => {+ const id = routed('Recorded ceiling behavior', 'strong');+ const copy = store.openBoard(':memory:', clock);+ t.after(() => store.closeBoard(copy));+ importBoard(copy, exportBoard(board));+ const frozen = item => ({ text: JSON.stringify({ criterion: item.item_criterion,+ policy: { version: 1, commit: SHA_A, verify: { policy: 'any', family: 'off' } } }), digest: `digest:${item.item_title}` });+ const proof = { version: 1, files: [], full: false, deferred: true, reason: 'synthetic replay fixture' };+ let sequence = 0;+ let latest;+ const apply = (operation, args) => {+ sequence += 1;+ latest = { ...prepareEngineMove(board, operation, args, { id: `ceiling-${version}-${sequence}` }), engine: version };+ for (const replica of [board, copy]) {+ const result = applyEngineMove(replica, latest, { sequence, at: `2026-10-18T00:00:0${sequence}.000Z` });+ assert.equal(result.error, undefined, `${operation} applies at engine ${version}`);+ }+ };+ for (const [commit, note] of [[SHA_A, 'first send-back'], [SHA_B, 'second send-back']]) {+ apply('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: frozen }]);+ apply('submit', [id, { agentId: 'web-1', commit, tree: `tree-${commit[0]}`, submissionProof: proof }]);+ apply('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note,+ head: commit, digest: 'digest:Recorded ceiling behavior', policy: 'any' }]);+ }+ const events = store.events(board, { itemId: id });+ const current = version >= STRONG_REJECTION_NOTICE_ENGINE;+ assert.equal(events.filter(event => event.event_kind === 'escalate').length, current ? 0 : 1, 'old engine50..53 retains its recorded ceiling event');+ assert.equal(events.filter(event => event.event_kind === 'strong-rejection-notice').length, current ? 1 : 0);+ assert.equal(store.allShouts(board).length, current ? 1 : 0);+ assert.deepEqual(store.getItem(copy, id), store.getItem(board, id));+ assert.deepEqual(store.events(copy), store.events(board));+ assert.deepEqual(store.allShouts(copy), store.allShouts(board));+ const before = exportBoard(board);+ applyEngineMove(board, latest, { sequence, at: `2026-10-18T00:00:0${sequence}.000Z` });+ assert.deepEqual(exportBoard(board), before, 'replaying the exact receipt cannot duplicate the notice');+ });+}+test('engine 40 reject moves replay without automatic escalation [B15,H16]', () => {const id = routed('Legacy engine', 'light');const legacyFreeze = (item) => ({diff --git a/test/pending-refreeze.test.js b/test/pending-refreeze.test.jsindex 0e91dc6b..a9a847d7 100644--- a/test/pending-refreeze.test.js+++ b/test/pending-refreeze.test.js@@ -265,11 +265,11 @@ 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, AUTO_ESCALATE_ENGINE, 'the current writer is the automatic-escalation engine');+ assert.ok(ENGINE_VERSION >= AUTO_ESCALATE_ENGINE, 'the current writer retains automatic escalation');assert.ok(ENGINE_VERSION >= 45, 'the current writer retains engine-45 milestone semantics');assert.ok(ENGINE_VERSION >= RIGOR_NOTICE_ENGINE, 'the next writer retains all recorded dependency-edit behavior');assert.ok(ENGINE_VERSION >= HEALTH_SENTINEL_ENGINE, 'the current writer retains the sentinel minimum and historical behavior');- assert.equal(AUTO_ESCALATE_ENGINE, ENGINE_VERSION, 'the current writer retains recorded dependency-edit behavior and automatic escalation');+ assert.ok(ENGINE_VERSION >= AUTO_ESCALATE_ENGINE, 'the current writer retains recorded dependency-edit behavior and automatic escalation');assert.ok(ENGINE_VERSION >= VERIFIER_STANDING_ENGINE, 'the current writer retains verifier standing');const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));const cleanup = [];