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: keep explicit queue rank ahead of rework ties [N2,B13]

Corey Olsona5ad7eb8166d
diff --git a/src/board.js b/src/board.js
index 7ca74976..f02feeb5 100644
--- a/src/board.js
+++ b/src/board.js
@@ -2236,6 +2236,14 @@ export function nextFor(board, { agentId, lane, verify = false, policy = 'any',
const selected = mine.findIndex(({ entry }) => tier(entry) === routeTier && mainRed.has(entry.item_id));
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)) {
+ const position = milestonePriorities(board);
+ const rank = milestoneRanks(board, position);
+ const first = mine[firstTierItem].entry;
+ const selectedItem = mine[selected].entry;
+ if (position(first) !== position(selectedItem) || rank(first) !== rank(selectedItem)) continue;
+ }
const [rework] = mine.splice(selected, 1);
mine.splice(firstTierItem, 0, rework);
}
diff --git a/test/next-order.test.js b/test/next-order.test.js
index 06391169..259d7b00 100644
--- a/test/next-order.test.js
+++ b/test/next-order.test.js
@@ -273,7 +273,7 @@ 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 [8, 24, 31, 32]) {
+ for (const version of new Set([8, 24, 31, 32, ENGINE_VERSION])) {
const source = boardFixture();
const replica = store.openBoard(':memory:');
const fixtures = [source, { ...source, board: replica }];
@@ -285,7 +285,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, 32, 'the coordinator allocated engine32 to the sealed order move');
+ assert.equal(move.engine, ENGINE_VERSION, 'the envelope carries the current engine; milestone order starts at32');
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 },
}));