Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix: allocate rank move engine 34 above trunk [N2,B13]

Corey Olson6136e79720c3
diff --git a/docs/formats.md b/docs/formats.md
index a60f2a6b..49cd536f 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` | `33` | `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` | `34` | `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.
@@ -413,4 +413,4 @@ Engine 8 adds `recordLandingBatch`, `recordLandingWaiver`, `recordLandingFlake`
A person waiver records its identity, named test, expiry, reason and person channel. A distinct landing proof records the exact batch tree and each failing test with its covering waiver identity. Pre-push checks every waiver against the current time; this proof never writes an ordinary green-gate stamp. Flake records retain a test path, source digest, failing names and one defect item, so a repeated observation does not create another defect.
-Engine 32 adds the agent/coordinator `orderMilestoneItems` move, carrying a milestone name and its ordered subset of item ids. Earlier engines refuse it before changing the board or replay cursor. Ranked item ids stay with their milestone in its `order` metadata; old entries without it keep their prior queue order. Recorded next/reserve moves below engine 32 retain their original ordering even when later metadata contains ranks. Engine slots 25 through 31 belong to their separately allocated train items.
+Engine 34 adds the agent/coordinator `orderMilestoneItems` move, carrying a milestone name and its ordered subset of item ids. Earlier engines refuse it before changing the board or replay cursor. Ranked item ids stay with their milestone in its `order` metadata; old entries without it keep their prior queue order. Recorded next/reserve moves below engine 34 retain their original ordering even when later metadata contains ranks. The stable minimum is `MILESTONE_RANK_ENGINE` (34); engine slots 25 through 33 belong to their separately allocated train items.
diff --git a/src/board.js b/src/board.js
index e1f93d31..21a6b96e 100644
--- a/src/board.js
+++ b/src/board.js
@@ -15,7 +15,7 @@ import { DatabaseSync } from 'node:sqlite';
import { boardNotWritable } from './board-access.js';
import { briefFiles, briefSections } from './brief.js';
import { COORDINATOR } from './config.js';
-import { ENGINE_VERSION, VERDICT_REVIEW_ENGINE, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';
+import { ENGINE_VERSION, VERDICT_REVIEW_ENGINE, MILESTONE_RANK_ENGINE, GUARDS, IN_STATE, MOVES, STATES, UNKNOWN_MOVE, effectiveGuards, storeTriggers } from './machine.js';
import { Refused } from './refused.js';
import { causeProblem, requireNeverAgain } from './rigor.js';
import { barCorrectionFields } from './bar-corrections.js';
@@ -2129,7 +2129,7 @@ function milestonePriorities(board) {
/** Explicit item ranks belong to the same first unfinished milestone as its priority [N2,B13]. */
function milestoneRanks(board, priority) {
- if ((board.executionEngineVersion ?? ENGINE_VERSION) < 32) return () => 0;
+ if ((board.executionEngineVersion ?? ENGINE_VERSION) < MILESTONE_RANK_ENGINE) return () => 0;
const ranks = new Map();
for (const [index, milestone] of milestones(board).entries()) {
for (const [rank, id] of (milestone.order ?? []).entries()) {
@@ -2228,7 +2228,7 @@ export function nextFor(board, { agentId, lane, verify = false, policy = 'any',
const firstTierItem = mine.findIndex(({ entry }) => tier(entry) === routeTier);
if (selected > firstTierItem && firstTierItem >= 0) {
// Explicit coordinator order leads automatic rework; never-ranked boards retain their old path.
- if ((board.executionEngineVersion ?? ENGINE_VERSION) >= 32 && milestones(board).some(entry => entry.order?.length)) {
+ if ((board.executionEngineVersion ?? ENGINE_VERSION) >= MILESTONE_RANK_ENGINE && milestones(board).some(entry => entry.order?.length)) {
const position = milestonePriorities(board);
const rank = milestoneRanks(board, position);
const first = mine[firstTierItem].entry;
@@ -2532,7 +2532,7 @@ export function editMilestoneItems(board, name, { agentId, add = [], remove = []
throw new Refused('MILESTONE_ITEMS', 'one or more ids are not in this milestone; read pullboard roadmap and retry');
}
entries[index] = { ...current, items: nextItems,
- ...((board.executionEngineVersion ?? ENGINE_VERSION) >= 32 && current.order
+ ...((board.executionEngineVersion ?? ENGINE_VERSION) >= MILESTONE_RANK_ENGINE && current.order
? { order: current.order.filter(id => nextItems.includes(id)) } : {}) };
saveMilestones(board, entries);
logEvent(board, agentId, 'milestone_items', null, { name, add: additions, remove: removals });
@@ -2542,7 +2542,7 @@ export function editMilestoneItems(board, name, { agentId, add = [], remove = []
/** Replace this milestone's explicit ranks; omitted items retain the ordinary queue order [N2,B13]. */
export function orderMilestoneItems(board, name, { agentId, items }) {
- if ((board.executionEngineVersion ?? ENGINE_VERSION) < 32) throw new Refused('ENGINE_VERSION', 'milestone order requires engine 32; upgrade Pullboard before ranking work');
+ if ((board.executionEngineVersion ?? ENGINE_VERSION) < MILESTONE_RANK_ENGINE) throw new Refused('ENGINE_VERSION', 'milestone order requires engine 34; upgrade Pullboard before ranking work');
if (agentId !== COORDINATOR && (agentId === PERSON || !board.db.prepare('SELECT 1 FROM agent WHERE agent_id = ?').get(agentId))) {
throw new Refused('NO_AGENT', 'milestone order is an agent or coordinator move; join an agent worktree or ask the coordinator');
}
diff --git a/src/engine.js b/src/engine.js
index 9b8590f0..ee61739a 100644
--- a/src/engine.js
+++ b/src/engine.js
@@ -5,7 +5,7 @@ import { recordedRefusal } from './recorded-refusal.js';
import { BAR_ENGINE, carriesBarReason } from './bar-corrections.js';
import { carriesImplies, IMPLIES_ENGINE } from './implies.js';
import { CHECK_ACCEPT_ENGINE } from './check-accept.js';
-import { CAUSE_ENGINE, ENGINE_VERSION, VERDICT_REVIEW_ENGINE } from './machine.js';
+import { CAUSE_ENGINE, ENGINE_VERSION, VERDICT_REVIEW_ENGINE, MILESTONE_RANK_ENGINE } from './machine.js';
import { Refused } from './refused.js';
import { requestMoveProblem, recordRequestMove } from './relay-requests.js';
import { relayMoveActor, relaySenderProblem, validRelaySender } from './relay-sender.js';
@@ -23,7 +23,7 @@ export const ENGINE_OPERATIONS = Object.freeze([
]);
/** Engine version at which each ordered operation first has stable replay semantics. */
-const OPERATION_ENGINE = Object.freeze({ orderMilestoneItems: 32, reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8, acceptCheck: CHECK_ACCEPT_ENGINE });
+const OPERATION_ENGINE = Object.freeze({ orderMilestoneItems: MILESTONE_RANK_ENGINE, reopen: 8, recordLandingBatch: 8, recordLandingWaiver: 8, recordLandingFlake: 8, finishLandingBatch: 8, acceptCheck: CHECK_ACCEPT_ENGINE });
/** Dependency edits, bar reasons and sealed review metadata retain their distinct recorded engine meanings. */
function minimumOperationEngine(operation, args, board) {
diff --git a/src/machine.js b/src/machine.js
index d569abe7..95a77760 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 = 33;
+export const ENGINE_VERSION = 34;
/** 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;
@@ -18,6 +18,9 @@ export const CAUSE_ENGINE = 30;
/** First released engine binding the checked composition, review trunk and paths [E8,H16]. */
export const VERDICT_REVIEW_ENGINE = 33;
+/** First engine carrying explicit milestone ranks in build and review selection [N2,B13,H16]. */
+export const MILESTONE_RANK_ENGINE = 34;
+
/** @typedef {'agent' | 'coordinator' | 'clock'} Role */
/**
diff --git a/test/agent-model-engine.test.js b/test/agent-model-engine.test.js
index d0bca12b..5907aefc 100644
--- a/test/agent-model-engine.test.js
+++ b/test/agent-model-engine.test.js
@@ -10,8 +10,8 @@ import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
-test('model declarations and event snapshots retain engines 1 through 33 semantics [O8,O3,H16]', (t) => {
- assert.equal(ENGINE_VERSION, 33, 'the next writer preserves every historical model snapshot through main engine 30');
+test('model declarations and event snapshots retain engines 1 through 34 semantics [O8,O3,H16]', (t) => {
+ assert.equal(ENGINE_VERSION, 34, 'the next writer preserves every historical model snapshot through main engine 33');
for (const version of Array.from({ length: ENGINE_VERSION }, (_, index) => index + 1)) {
const board = store.openBoard(':memory:');
t.after(() => store.closeBoard(board));
diff --git a/test/next-order.test.js b/test/next-order.test.js
index 8aa06827..aa2e1d8f 100644
--- a/test/next-order.test.js
+++ b/test/next-order.test.js
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import { test } from 'node:test';
import * as store from '../src/board.js';
import { applyEngineMove, applyRelayMove, prepareEngineMove } from '../src/engine.js';
-import { ENGINE_VERSION } from '../src/machine.js';
+import { ENGINE_VERSION, MILESTONE_RANK_ENGINE } from '../src/machine.js';
import { exportBoard, importBoard } from '../src/exchange.js';
import { createE2eHelpers } from './e2e-helpers.js';
import { existsSync, readFileSync } from 'node:fs';
@@ -277,7 +277,8 @@ test('an unranked item follows the ranked ones [N2,B13]', (t) => {
});
test('milestone rank moves replay identically and preserve historical next selection [N2,B13,H16]', (t) => {
- for (const version of new Set([8, 24, 31, 32, ENGINE_VERSION])) {
+ assert.equal(MILESTONE_RANK_ENGINE, 34, 'milestone ranking retains its allocated minimum after later writer upgrades');
+ for (const version of new Set([8, 24, 31, 32, 33, MILESTONE_RANK_ENGINE, ENGINE_VERSION])) {
const source = boardFixture();
const replica = store.openBoard(':memory:');
const fixtures = [source, { ...source, board: replica }];
@@ -289,7 +290,7 @@ test('milestone rank moves replay identically and preserve historical next selec
}
importBoard(replica, exportBoard(source.board));
const move = prepareEngineMove(fixtures[0].board, 'orderMilestoneItems', ['release', { agentId: fixtures[0].builder, items: [2, 1] }]);
- assert.equal(move.engine, ENGINE_VERSION, 'the envelope carries the current engine; milestone order starts at32');
+ assert.equal(move.engine, ENGINE_VERSION, 'the envelope carries the current engine; milestone order starts at34');
const outcomes = fixtures.map(({ board }) => applyRelayMove(board, move, {
sequence: 1, at: '2026-10-18T01:00:00Z', kind: 'move', sender: { kind: 'agent', userId: 'fixture', agent: fixtures[0].builder },
}));
@@ -299,8 +300,8 @@ test('milestone rank moves replay identically and preserve historical next selec
const reserve = prepareEngineMove(fixtures[0].board, 'reserveNextReview', [{ agentId: fixtures[0].reviewer, lane: 'review', leaseMs: HOUR, policy: 'any' }]);
const results = fixtures.map(({ board }) => applyEngineMove(board, { ...reserve, engine: version }, { sequence: 2, at: '2026-10-18T01:01:00Z' }));
assert.deepEqual(results[0], results[1]);
- assert.equal(results[0].result.item.item_id, version < 32 ? 1 : 2, `engine${version} preserves its recorded selection`);
- assert.throws(() => applyEngineMove(fixtures[0].board, { ...move, id: 'old-order', engine: 31 }, { sequence: 3, at: '2026-10-18T01:02:00Z' }), { code: 'RELAY_MOVE' });
+ assert.equal(results[0].result.item.item_id, version < MILESTONE_RANK_ENGINE ? 1 : 2, `engine${version} preserves its recorded selection`);
+ assert.throws(() => applyEngineMove(fixtures[0].board, { ...move, id: 'old-order', engine: MILESTONE_RANK_ENGINE - 1 }, { sequence: 3, at: '2026-10-18T01:02:00Z' }), { code: 'RELAY_MOVE' });
assert.equal(fixtures[0].board.db.prepare("SELECT meta_value FROM board_meta WHERE meta_key='relay_applied_sequence'").get().meta_value, '2');
}
});
diff --git a/test/pending-refreeze.test.js b/test/pending-refreeze.test.js
index 03fb0767..ef73ed35 100644
--- a/test/pending-refreeze.test.js
+++ b/test/pending-refreeze.test.js
@@ -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, 33, 'the next writer retains all recorded dependency-edit behavior');
+ assert.equal(ENGINE_VERSION, 34, 'the next writer retains all recorded dependency-edit behavior');
const directory = mkdtempSync(join(tmpdir(), 'pullboard-dependency-engines-'));
const cleanup = [];
t.after(() => {