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): allocate automatic escalation engine 50 [B15,H16]

Corey Olsona3dd6e3ac4fd
diff --cc docs/formats.md
index af378086,383421b8..7796091c
--- a/docs/formats.md
+++ b/docs/formats.md
@@@ -113,7 -113,7 +113,7 @@@ The board file is in the repository's G
| `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` | `44` | `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` | `43` | `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` | `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. |
<!-- 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.
@@@ -128,8 -128,6 +128,8 @@@ Engine 19 makes a corrected bar record
Engine 33 binds a review to the immutable submitted commit, the exact checked composition, its reviewed trunk and sorted candidate paths. A stale, unmerged acceptance can be re-reviewed without rewriting the submission; landing uses its accepted checked composition. New review metadata and landing batches carrying `reviewedCommit` require engine 33, including later updates to those batches. Previously recorded outcomes replay before this state-dependent version check, and previously released engines retain their original review and landing behavior. Older clients refuse engine-33 moves before changing their board or replay cursor; upgrade linked clients before using checked-composition reviews. The coordinator assigned engine 33 to this change. Merge the actual trunk before landing.
- Engine 44 automatically advances a rejected item one route after two REJECT verdicts on the current route. A release is not a rejection; a manual escalation or an actual route edit starts a new count. The existing escalation event records both rejection receipts. The strong route remains the ceiling. Moves below engine 44 retain their earlier behavior and do not automatically escalate. Upgrade linked boards before using automatic rejection escalation.
++Engine 50 automatically advances a rejected item one route after two REJECT verdicts on the current route. A release is not a rejection; a manual escalation or an actual route edit starts a new count. The existing escalation event records both rejection receipts. The strong route remains the ceiling. Moves below engine 50 retain their earlier behavior and do not automatically escalate. Upgrade linked boards before using automatic rejection escalation.
+
Engine 20 lets a decision name the items it changes. An `appendFact`, `answerDecision` or `verify` move may carry `implies`, a list of existing item ids, and an `answerDecision` move may carry `supersedes`, the shout id of an earlier answer. Either makes the move an engine-20 move: an older engine refuses it with `RELAY_MOVE` before changing its board or cursor, and a board replaying an older engine refuses `implies` with `ENGINE_VERSION`. Engine 20 also tells implied items when a decision is superseded: by a fact's `supersedes`, by an answer's `supersedes`, or by the next verdict on the same item. Moves recorded under engines 19 and earlier replay without these notices. Engine numbers 13 to 18 are allocated to other changes; whichever lands later renumbers, keeping every earlier engine's replay unchanged.
Engine 24 adds the person's `acceptCheck`: an item's current check, named by its SHA-256 digest, accepted so a check already green on main no longer holds the item on a board whose `checks.provesNothing` is `"hold"`. Only the person may send it, from the terminal or the view; the relay refuses it from an agent or a machine. A move from an older engine is refused before it changes the board or replay cursor, and older clients refuse engine-24 moves before interpreting them. Engines 21 through 23 are allocated to other changes.
diff --cc src/machine.js
index 4b28ed38,d033948f..fbb68c0a
--- a/src/machine.js
+++ b/src/machine.js
@@@ -9,13 -9,9 +9,13 @@@
* broken copy, and checks the declaration against the refusals board.js and cli.js raise today.
*/
-/** Executable move semantics, carried by every sealed move and retained during replay [H16]. */
import { RIGOR_NOTICE_ENGINE } from './rigor-source.js';
-export const ENGINE_VERSION = RIGOR_NOTICE_ENGINE;
+
- /** Executable move semantics, carried by every sealed move and retained during replay [H16]. */
- export const ENGINE_VERSION = Math.max(44, RIGOR_NOTICE_ENGINE);
-
+/** First engine that automatically escalates an item's second rejection at its current route [B15]. */
- export const AUTO_ESCALATE_ENGINE = 44;
++export const AUTO_ESCALATE_ENGINE = 50;
++
++/** 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);
/** The engine at which a reject, reopen or person fact can carry a cause key (#713); older moves replay unchanged [D1,H16]. */
export const CAUSE_ENGINE = 30;
diff --cc test/agent-model-engine.test.js
index 836b26fe,e3e9e711..0ca7939e
--- a/test/agent-model-engine.test.js
+++ b/test/agent-model-engine.test.js
@@@ -13,11 -12,9 +13,11 @@@ import { mkdtempSync, rmSync, writeFile
import { tmpdir } from 'node:os';
import { join } from 'node:path';
--test('model declarations and event snapshots retain engines 1 through 34 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 44, 'engine 44 is the current writer');
++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 >= 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');
for (const version of Array.from({ length: ENGINE_VERSION }, (_, index) => index + 1)) {
const board = store.openBoard(':memory:');
t.after(() => store.closeBoard(board));
diff --cc test/board.test.js
index 39521103,af2f1892..090c3c6f
--- a/test/board.test.js
+++ b/test/board.test.js
@@@ -867,144 -849,6 +867,175 @@@ test('escalate frees an item one tier u
assert.deepEqual(JSON.parse(first.event_detail), { from: 'light', to: 'mid', note: 'check failed twice', attempt: 'refs/pullboard/attempts/1/abc', model: 'unknown' }, 'the failure and the pinned attempt travel with it');
});
+test('two failed attempts at a route escalate the item one route up [B15,B13]', () => {
+ const id = routed('Automatic escalation', 'light');
+ claimAs(id, 'web-1', 'web');
+ store.release(board, id, 'web-1');
+ rejectRevision(id, SHA_A, 'first reject: missing parser output');
+ assert.equal(store.getItem(board, id).item_route, 'light', 'a release is not a failed attempt');
+ assert.equal(store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate').length, 0);
+
+ rejectRevision(id, SHA_B, 'second reject: parser still drops the row');
+ const item = store.getItem(board, id);
+ assert.deepEqual([item.item_status, item.item_route, item.item_owner], ['open', 'mid', null]);
+ const escalations = store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate');
+ assert.equal(escalations.length, 1, 'the second rejection writes one existing escalation event');
+ const detail = JSON.parse(escalations[0].event_detail);
+ assert.deepEqual([detail.from, detail.to], ['light', 'mid']);
+ assert.equal(detail.rejections.length, 2, 'the single escalation receipt carries both rejections');
+ assert.deepEqual(detail.rejections.map((entry) => entry.note), [
+ 'first reject: missing parser output', 'second reject: parser still drops the row',
+ ]);
+ assert.deepEqual(detail.rejections.map((entry) => entry.reason), ['TEST_FAILURE', 'TEST_FAILURE']);
+ assert.deepEqual(detail.rejections.map((entry) => [entry.commit, entry.head]), [[SHA_A, SHA_A], [SHA_B, SHA_B]]);
+ assert.ok(detail.rejections.every((entry) => entry.verdictId && entry.eventId && entry.digest && entry.at));
+});
+
+test('a hand escalation starts a new route rejection count [B15,B13]', () => {
+ const id = routed('Manual route reset', 'light');
+ rejectRevision(id, SHA_A, 'old-route reject');
+ assert.equal(store.getItem(board, id).item_route, 'light');
+ store.escalate(board, id, { agentId: 'coordinator', note: 'manual route handoff' });
+
+ rejectRevision(id, SHA_B, 'first mid-route reject');
+ assert.equal(store.getItem(board, id).item_route, 'mid', 'the prior light rejection does not carry over');
+ assert.equal(store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate').length, 1);
+ rejectRevision(id, SHA_C, 'second mid-route reject');
+ assert.equal(store.getItem(board, id).item_route, 'strong');
+ const escalations = store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate');
+ assert.equal(escalations.length, 2);
+ assert.deepEqual(JSON.parse(escalations[1].event_detail).rejections.map((entry) => entry.note), [
+ 'first mid-route reject', 'second mid-route reject',
+ ]);
+});
+
+test('a coordinator route edit starts a new rejection count [B15,B13]', () => {
+ const id = routed('Edited route reset', 'light');
+ rejectRevision(id, SHA_A, 'old light-route reject');
+ store.editItem(board, id, { agentId: 'coordinator', route: 'mid' });
+
+ rejectRevision(id, SHA_B, 'first edited mid-route reject');
+ assert.equal(store.getItem(board, id).item_route, 'mid');
+ assert.equal(store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate').length, 0);
+
+ rejectRevision(id, SHA_C, 'second edited mid-route reject');
+ assert.equal(store.getItem(board, id).item_route, 'strong');
+ const escalations = store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate');
+ assert.equal(escalations.length, 1);
+ assert.deepEqual(JSON.parse(escalations[0].event_detail).rejections.map((entry) => entry.note), [
+ 'first edited mid-route reject', 'second edited mid-route reject',
+ ]);
+});
+
+test('an item at strong stays at strong after more failures [B15,B13]', () => {
+ const id = routed('Strong ceiling', 'strong');
+ rejectRevision(id, SHA_A, 'strong reject one');
+ rejectRevision(id, SHA_B, 'strong reject two');
+ assert.equal(store.getItem(board, id).item_route, 'strong');
+ rejectRevision(id, SHA_C, 'strong reject three');
+ rejectRevision(id, SHA_D, 'strong reject four');
+ assert.equal(store.getItem(board, id).item_route, 'strong');
+ const escalations = store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate');
+ assert.equal(escalations.length, 2, 'each pair records one ceiling escalation');
+ assert.ok(escalations.every((event) => {
+ const detail = JSON.parse(event.event_detail);
+ return detail.from === 'strong' && detail.to === 'strong' && detail.rejections.length === 2;
+ }));
+});
+
+test('engine 40 reject moves replay without automatic escalation [B15,H16]', () => {
+ const id = routed('Legacy engine', 'light');
+ const legacyFreeze = (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 submissionProof = {
+ version: 1, files: [], full: false, deferred: true,
+ reason: 'synthetic board-state fixture; no gate execution',
+ };
+ let sequence = 0;
+ const applyLegacyMove = (operation, args) => {
+ sequence += 1;
+ const move = prepareEngineMove(board, operation, args, { id: `engine-40-auto-escalation-${sequence}` });
+ move.engine = 40;
+ const result = applyEngineMove(board, move, { sequence, at: `2026-10-18T00:00:0${sequence}.000Z` });
+ assert.equal(result.error, undefined, `${operation} replays on engine 40`);
+ };
+ applyLegacyMove('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: legacyFreeze }]);
+ applyLegacyMove('submit', [id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a', submissionProof }]);
+ applyLegacyMove('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'legacy reject one', head: SHA_A, digest: `digest:${store.getItem(board, id).item_title}`, policy: 'any' }]);
+ applyLegacyMove('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: legacyFreeze }]);
+ applyLegacyMove('submit', [id, { agentId: 'web-1', commit: SHA_B, tree: 'tree-b', submissionProof }]);
+ applyLegacyMove('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'legacy reject two', head: SHA_B, digest: `digest:${store.getItem(board, id).item_title}`, policy: 'any' }]);
+ assert.equal(store.getItem(board, id).item_route, 'light');
+ assert.equal(store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate').length, 0);
+});
+
+test('engine 43 reject moves replay without automatic escalation [B15,H16]', () => {
+ const id = routed('Legacy engine', 'light');
+ const legacyFreeze = (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 submissionProof = {
+ version: 1, files: [], full: false, deferred: true,
+ reason: 'synthetic board-state fixture; no gate execution',
+ };
+ let sequence = 0;
+ const applyLegacyMove = (operation, args) => {
+ sequence += 1;
+ const move = prepareEngineMove(board, operation, args, { id: `engine-43-auto-escalation-${sequence}` });
+ move.engine = 43;
+ const result = applyEngineMove(board, move, { sequence, at: `2026-10-18T00:00:0${sequence}.000Z` });
+ assert.equal(result.error, undefined, `${operation} replays on engine 43`);
+ };
+ applyLegacyMove('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: legacyFreeze }]);
+ applyLegacyMove('submit', [id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a', submissionProof }]);
+ applyLegacyMove('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'legacy reject one', head: SHA_A, digest: `digest:${store.getItem(board, id).item_title}`, policy: 'any' }]);
+ applyLegacyMove('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: legacyFreeze }]);
+ applyLegacyMove('submit', [id, { agentId: 'web-1', commit: SHA_B, tree: 'tree-b', submissionProof }]);
+ applyLegacyMove('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'legacy reject two', head: SHA_B, digest: `digest:${store.getItem(board, id).item_title}`, policy: 'any' }]);
++ assert.equal(store.getItem(board, id).item_route, 'light');
++ assert.equal(store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate').length, 0);
++});
++
++test('engine 49 reject moves replay without automatic escalation [B15,H16]', () => {
++ const id = routed('Legacy engine', 'light');
++ const legacyFreeze = (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 submissionProof = {
++ version: 1, files: [], full: false, deferred: true,
++ reason: 'synthetic board-state fixture; no gate execution',
++ };
++ let sequence = 0;
++ const applyLegacyMove = (operation, args) => {
++ sequence += 1;
++ const move = prepareEngineMove(board, operation, args, { id: `engine-49-auto-escalation-${sequence}` });
++ move.engine = 49;
++ const result = applyEngineMove(board, move, { sequence, at: `2026-10-18T00:00:0${sequence}.000Z` });
++ assert.equal(result.error, undefined, `${operation} replays on engine 49`);
++ };
++ applyLegacyMove('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: legacyFreeze }]);
++ applyLegacyMove('submit', [id, { agentId: 'web-1', commit: SHA_A, tree: 'tree-a', submissionProof }]);
++ applyLegacyMove('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'legacy reject one', head: SHA_A, digest: `digest:${store.getItem(board, id).item_title}`, policy: 'any' }]);
++ applyLegacyMove('claim', [id, { agentId: 'web-1', lane: 'web', leaseMs: HOUR, freeze: legacyFreeze }]);
++ applyLegacyMove('submit', [id, { agentId: 'web-1', commit: SHA_B, tree: 'tree-b', submissionProof }]);
++ applyLegacyMove('verify', [id, { agentId: 'web-2', decision: 'REJECT', reason: 'TEST_FAILURE', note: 'legacy reject two', head: SHA_B, digest: `digest:${store.getItem(board, id).item_title}`, policy: 'any' }]);
+ assert.equal(store.getItem(board, id).item_route, 'light');
+ assert.equal(store.events(board, { itemId: id }).filter((event) => event.event_kind === 'escalate').length, 0);
+});
+
test('a fresh claim records where the work started; submit records what it changed, reworks included [N21]', () => {
const id = store.addItem(board, { by: 'coordinator', lane: 'web', title: 'Page' });
const claimAt = (head) => store.claim(board, id, { agentId: 'web-1', lane: 'web', leaseMs: 2 * HOUR, freeze, head });
diff --cc test/pending-refreeze.test.js
index f7cb926a,0caa8e72..3b21feb1
--- a/test/pending-refreeze.test.js
+++ b/test/pending-refreeze.test.js
@@@ -264,10 -263,8 +264,10 @@@ async function checkDependencyLegacyCli
}
test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) => {
- assert.equal(ENGINE_VERSION, 44, 'engine 44 is the current writer');
++ assert.equal(ENGINE_VERSION, AUTO_ESCALATE_ENGINE, 'the current writer is the automatic-escalation engine');
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');
const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));
const cleanup = [];
t.after(() => {