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(board): wait for authenticated foreign items [B24,H16]

Corey Olsonc9a9bca84a70
diff --git a/docs/api.md b/docs/api.md
index 6364e719..538a528a 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -430,6 +430,8 @@ The boards response keeps `boards` and may include `warnings` for registered ent
The state from `pullboard serve` lists every item as a summary of what the lists and the roadmap read: `id`, `title`, `lane`, `status`, `route`, `milestone`, `specs`, `claim`, `builtBy`, `blockedBy`, `updatedAt`, `stage`, `since`, `counts` and `verdict`. `milestone` names the first roadmap milestone that lists the item, or is `null`. `claim` is the live lease on the item, `{by, until}`: its builder's while it is claimed, or its reviewer's while a submitted item is reserved for review; otherwise it is `null`. `stage` is the item's status, except `accepted` for a verified item and `merged` once a merge is recorded. `since` is when the item entered that stage: edits, review reservations and renewals do not restart it, and a lapsed claim's stage starts at its recorded lease deadline. `counts` has the item's number of `verdicts` and `facts`. `verdict` keeps only the latest verdict's `decision` and `reason`, or is `null`; for an item sent back and not verified, it also keeps `note`, the first nonblank line of that reject's note. The state also has `moveCounts`, the board's lifecycle moves keyed `from>to:verb`, as the view's lifecycle drawing counts them.
+An item's `blockedBy` and dependency metadata retain numeric local IDs and literal `repo#id` foreign references. A foreign blocker is resolved only from the current authenticated E32 states announcement for its signed link; absent state is blocked, and an item with the same number on this board cannot satisfy it.
+
`GET /api/v1/boards/:board/items/:id` returns `{item}`: the item's `id` and every field its summary leaves out, which are `owner`, `reviewer`, `reviewUntil`, `verifiedBy`, `criterion`, `brief`, `commit`, `merged`, `history`, `check`, `checkBaseline` when recorded, `verdicts`, `thread`, and the latest `verdict` in full. Laid over its summary, the detail is the item exactly as the full state carries it. An unknown id returns `NO_ITEM` with HTTP 404; a malformed id is refused with HTTP 400. `state?detail=full` returns every item in full, summary fields included, and `detail=summary` returns summaries; any other value is refused with `BAD_REQUEST`. Without `detail`, a server answers with its own default, `stateDetail: "summary"` or `"full"`: `serveApi`, which `pullboard serve` runs, defaults to summaries, and `createLocalApiHandler`, which a page's own server builds, defaults to full items until that page reads summaries. `GET /api/v1/boards/:board/items?q=text` returns `{ids}`, in state order, for the items whose `#id`, title, lane, spec ids or criterion contain the trimmed text, ignoring case, as the view's search matches; empty text matches every item. An adapter without these reads returns `ITEM_NOT_AVAILABLE`. The paired API2 phone transport implements these reads by decrypting addressed pages; its initial state is bounded and full detail follows separately.
Every state names the event it reflects as `sequence`, the latest event id when it was read. `GET /api/v1/boards/:board/state?since=N` answers `{since, sequence, eventLogVersion, delta}`, where `sequence` is the new latest and `delta` brings the summary state this server sent at event N up to date: `delta.replace` holds whole fields that changed, `delta.merge` holds keyed lists by field, as `{key, set, ids?}`, with only their changed entries and, when entries came, went or moved, the full key order, and `delta.remove` names fields that went away. Items merge by `id`, `shouts` and `asked` by `shout_id`, `events` by `event_id`, `agents` by `agent_id`, `spec` and `practice` rows by `id`, and `milestones` by `name`. `unseen`, `proofStats` and the Needs-you lists, `decisions`, `holds`, `requests` and `personRequests`, always come whole. Apply a delta without recomputing anything: copy `replace` over the state, delete each `remove` field, and for each `merge` field, overlay `set` on the entries by `key` and order them by `ids`, or keep their order. `applyStateDelta(state, delta)` in `src/api-http.js` does exactly this, and the result equals a fresh snapshot at `sequence`. A delta also carries changes that wrote no event, such as a spec or doctrine edit, so its `sequence` may equal N. N alone cannot say which of the snapshots sent at N a client holds, so after such a change a later delta from the same N may repeat it; it still applies exactly.
diff --git a/docs/formats.md b/docs/formats.md
index d921ae12..304997cd 100644
--- a/docs/formats.md
+++ b/docs/formats.md
@@ -140,6 +140,8 @@ Pullboard 0.6.1 released engine 1. Engine 2 records a fresh explicit-build claim
Engine 10 adds coordinator-only reopening for an unmerged verified item after a red landing candidate. Its append-only `reopen` event names the superseded accept, failing test and landing merge commit; the original accept and verdict remain in history. Engines 8 and 9 retain their submitted-only `reopen` behavior: a verified-item reopen is refused without changing the replayed board. Only engine 10 may return a verified item to open, with a failing test and landing merge commit in the note. Dependency edits also require engine 10: an `editItem` move with `after`, including `after: []` to clear dependencies, cannot be replayed under an older engine. Ordinary edits without `after` retain their historical behavior. Older clients refuse an engine-10 move before changing their board or replay cursor; upgrade Pullboard before sending or applying dependency edits.
+Cross-repository prerequisites (B24) extend the existing comma-separated `item_after` text with exact `repo#id` references; local entries remain numeric item IDs. The foreign repository is the child handle on exactly one current, unrevoked signed two-sided E32 link whose parent is this board. Only that link generation's authenticated received `states` announcement can satisfy the dependency. Missing, ambiguous, undisclosed or non-verified foreign state stays blocked. Machine project paths, registry entries and caller-supplied status snapshots do not establish verification. Claim and next use the same canonical state on replicas. Add/edit carrying a foreign reference, and claims of such an item, require the cross-repository dependency engine floor in addition to all existing applicable floors. Foreign item IDs never enter local Git merge, lane inheritance or local dependency traversal.
+
Engine 11 permits resubmitting the same commit after a coordinator no-verdict reopen only after the frozen bar is explicitly refrozen, or an edit clears the frozen bar and a new claim freezes it again. Reopening without a later bar change still refuses the same commit, and a rejection at the current frozen digest continues to require new work. This rule does not apply to a verified-item red-landing reopen. Engine 10 retains its earlier same-commit refusal for no-verdict reopens.
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.
diff --git a/src/activity-feed.js b/src/activity-feed.js
index 2dc130fe..453edfe8 100644
--- a/src/activity-feed.js
+++ b/src/activity-feed.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
import { itemFiles } from './item-files.js';
/** Read item activity without duplicating a landing's immutable board-wide receipt [R2,N26]. */
@@ -26,7 +27,7 @@ export function activityEventDetail(event) {
/** Parse only recorded item dependency ids; a shared prerequisite does not make siblings dependents. */
function prerequisites(item) {
- return String(item.item_after ?? '').split(',').filter(Boolean).map(Number);
+ return localDependencyIds(item);
}
/** Exact files and explicit directory plans overlap without matching a similarly spelled file. */
diff --git a/src/api.js b/src/api.js
index 6842cf42..c0073eac 100644
--- a/src/api.js
+++ b/src/api.js
@@ -1,3 +1,5 @@
+import { foreignDependencyStates } from './cross-repo-dependencies.js';
+import { dependencyValues, localDependencyIds } from './item-dependencies.js';
/** The local API v1: the CLI's moves, persistent board identities and live events (A2). */
import {
createHash,
@@ -536,7 +538,7 @@ function buildLocalBoardState(root, boardId, board, codeIsMain, { previous = nul
/** Parse an item's ordered prerequisite IDs from its persisted row. */
function dependencyIds(item) {
- return item.item_after ? item.item_after.split(',').map(Number) : [];
+ return dependencyValues(item);
}
/** Everything a summary leaves out, with the latest verdict whole: laid over its summary, it is the full item. */
@@ -1083,10 +1085,11 @@ export function createLocalApiHandler({ secret, getPort, runCommand, projects =
if (!row) return null;
const now = currentBoard.clock.now().toISOString();
const status = new Map();
- for (const dependency of dependencyIds(row)) {
+ for (const dependency of localDependencyIds(row)) {
const dependent = db.prepare('SELECT item_status FROM item WHERE item_id = ?').get(dependency);
if (dependent) status.set(dependency, dependent.item_status);
}
+ for (const ref of foreignDependencyStates(currentBoard, row)) status.set(`${ref.repo}#${ref.id}`, ref.status);
// Detail reads need no new Git process while the trunk holds.
const tip = trunkRevisionReader(info)();
const approval = approvalFor(board.root, currentBoard, info);
diff --git a/src/board-link-relay.js b/src/board-link-relay.js
index c26c945c..ff0c27b5 100644
--- a/src/board-link-relay.js
+++ b/src/board-link-relay.js
@@ -128,8 +128,4 @@ export async function receiveBoardState(board, delivery, { authority, capability
});
}
-/** Read the detached latest disclosed state without scanning full board history. */
-export function readReceivedBoardState(board, { linkId, generation, sourceBoardId }) {
- if (!Number.isSafeInteger(generation) || generation < 1) throw new Refused('BOARD_LINK_FORMAT', 'use a positive link generation');
- return saved(board, `board_link_state:${boardLinkName(linkId)}:${generation}:${boardReferenceId(sourceBoardId)}`);
-}
+export { readReceivedBoardState } from './board-link-state.js';
diff --git a/src/board-link-state.js b/src/board-link-state.js
new file mode 100644
index 00000000..f16b0dc8
--- /dev/null
+++ b/src/board-link-state.js
@@ -0,0 +1,12 @@
+/** Read the exact native E32 receiving projection without loading the network sender [E32,B24,H16]. */
+import { Refused } from './refused.js';
+import { boardLinkName } from './board-link-format.js';
+import { boardReferenceId } from './board-reference.js';
+
+/** Read detached canonical state installed by authenticated receiveBoardState, never a caller snapshot. */
+export function readReceivedBoardState(board, { linkId, generation, sourceBoardId }) {
+ if (!Number.isSafeInteger(generation) || generation < 1) throw new Refused('BOARD_LINK_FORMAT', 'use a positive link generation');
+ const key = `board_link_state:${boardLinkName(linkId)}:${generation}:${boardReferenceId(sourceBoardId)}`;
+ const row = board.db.prepare('SELECT meta_value FROM board_meta WHERE meta_key=?').get(key);
+ return row ? JSON.parse(row.meta_value) : null;
+}
diff --git a/src/board.js b/src/board.js
index 1080d847..2b4afacd 100644
--- a/src/board.js
+++ b/src/board.js
@@ -1,3 +1,5 @@
+import { foreignBlockers } from './cross-repo-dependencies.js';
+import { dependencyValues, localDependencyIds, dependencyLabel } from './item-dependencies.js';
import { heartbeatSeat } from './seat-presence.js';
import * as itemDecisions from './item-decision-queue.js';
import * as activityDeliveryStore from './activity-delivery-store.js';
@@ -661,7 +663,7 @@ function checkRouted({ brief, route, criterion, check }) {
* ids (B6).
*
* @param {any} board
- * @param {{ by: string, lane: string, title: string, criterion?: string, specIds?: string[], parentId?: number | null, after?: number[], brief?: string, route?: string, check?: string }} item
+ * @param {{ by: string, lane: string, title: string, criterion?: string, specIds?: string[], parentId?: number | null, after?: (number | string)[], brief?: string, route?: string, check?: string }} item
* @returns {number} The new item's id.
*/
export function addItem(board, { by, lane, title, criterion = '', specIds = [], parentId = null, after = [], brief = '', route = 'strong', check, checkBaseline, barActor }) {
@@ -686,7 +688,8 @@ export function addItem(board, { by, lane, title, criterion = '', specIds = [],
/** Validate that dependencies exist, remain usable, and cannot lead back to the edited item. */
function validateItemDependencies(board, itemId, after) {
- const direct = after.map((dependency) => itemById(board, dependency));
+ dependencyValues(after);
+ const direct = localDependencyIds(after).map((dependency) => itemById(board, dependency));
const withdrawn = direct.find((dependency) => dependency.item_status === 'withdrawn');
if (withdrawn) {
throw new Refused('WITHDRAWN', `item #${withdrawn.item_id} is withdrawn; nothing can wait on it`);
@@ -694,7 +697,7 @@ function validateItemDependencies(board, itemId, after) {
if (itemId === null) return;
const visited = new Set();
- const pending = [...after];
+ const pending = localDependencyIds(after);
while (pending.length) {
const dependency = pending.pop();
if (dependency === itemId) {
@@ -703,7 +706,7 @@ function validateItemDependencies(board, itemId, after) {
if (visited.has(dependency)) continue;
const item = itemById(board, dependency);
visited.add(dependency);
- pending.push(...(item.item_after ? item.item_after.split(',').map(Number) : []));
+ pending.push(...localDependencyIds(item));
}
}
@@ -734,7 +737,7 @@ export function validateItemAddition(board, { by, lane, title, criterion = '', p
*
* @param {any} board
* @param {number} id
- * @param {{ agentId: string, brief?: string, route?: string, criterion?: string, check?: string, after?: number[] }} change
+ * @param {{ agentId: string, brief?: string, route?: string, criterion?: string, check?: string, after?: (number | string)[] }} change
*/
export function editItem(board, id, { agentId, brief, route, criterion, check, after, checkBaseline, reason, barActor }) {
atomic(board, () => {
@@ -760,7 +763,7 @@ export function editItem(board, id, { agentId, brief, route, criterion, check, a
...(next.item_route !== item.item_route ? { route: next.item_route } : {}),
...(next.item_criterion !== item.item_criterion ? { criterion: next.item_criterion } : {}),
...(command !== undefined ? { check: next.item_check } : {}),
- ...(next.item_after !== item.item_after ? { after: next.item_after ? next.item_after.split(',').map(Number) : [] } : {}),
+ ...(next.item_after !== item.item_after ? { after: dependencyValues(next) } : {}),
...(baseline ? { checkBaseline: baseline } : {}),
...(pendingRefreeze ? { pendingRefreeze: pendingFields } : {}),
...(clearFrozen && item.item_frozen_digest ? { unfrozen: item.item_frozen_digest } : {}),
@@ -823,9 +826,10 @@ export function validateItemEdit(board, id, { agentId, brief, route, criterion,
throw new Refused('CLOSED', `item #${id} is ${item.item_status}`);
}
if (after !== undefined) {
- if (!Array.isArray(after) || !after.every((dependency) => Number.isSafeInteger(dependency) && dependency > 0)) {
+ if (!Array.isArray(after)) {
throw new Refused('BAD_DEPENDENCIES', 'item dependencies must be an array of positive integer item ids; use --after 1,2 or --after none');
}
+ dependencyValues(after);
validateItemDependencies(board, id, after);
}
const next = {
@@ -1017,7 +1021,9 @@ export function claim(board, id, { agentId, lane, leaseMs, freeze, head = null,
return canTake(route, found.item_route) ? null : new Refused('ROUTE', `item #${id} needs a ${found.item_route} model; you joined on the ${route} route. Take your next item: pullboard next`);
},
dependenciesVerified: (found) => {
- for (const dependency of found.item_after ? found.item_after.split(',').map(Number) : []) {
+ const foreign = foreignBlockers(board, found)[0];
+ if (foreign) return new Refused('BLOCKED', `#${id} waits on ${dependencyLabel(foreign)} (${foreign.status} on its own board); refresh that board before claiming`);
+ for (const dependency of localDependencyIds(found)) {
const before = itemById(board, dependency);
if (before.item_status !== 'verified') {
return new Refused(
@@ -2014,13 +2020,18 @@ export function nextFor(board, { agentId, lane, verify = false, policy = 'any',
}
mine.sort((a, b) => focusCompare(a.entry, b.entry));
for (const { entry, shared } of mine) {
- const waiting = (entry.item_after ? entry.item_after.split(',').map(Number) : [])
+ const waiting = localDependencyIds(entry)
.map((id) => current(board, itemById(board, id)))
.filter((before) => before.item_status !== 'verified');
const reserved = firstRefusalReason(board, entry.item_id, agentId);
if (reserved) { reasons.push(reserved); continue; }
const collisions = itemFileCollisions(entry, inFlight);
if (collisions.length) { reasons.push(...collisions); continue; }
+ const foreign = foreignBlockers(board, entry);
+ if (foreign.length) {
+ reasons.push(`#${entry.item_id} waits on ${foreign.map(ref => `${dependencyLabel(ref)} (${ref.status} on its own board)`).join(', ')}`);
+ continue;
+ }
if (!waiting.length) return { item: entry, reasons: focusReasons(board, entry, reasons), shared };
reasons.push(`#${entry.item_id} waits on ${waiting.map(waitingOn).join(', ')}`);
}
diff --git a/src/cli-read-context.js b/src/cli-read-context.js
index e7f363ee..fe4a4f11 100644
--- a/src/cli-read-context.js
+++ b/src/cli-read-context.js
@@ -1,3 +1,4 @@
+import { dependencyReferences, dependencyLabel } from './item-dependencies.js';
/**
* What every command shares and a read needs: the checkout's context, the board opened around one piece of work,
* argument parsing and the one-line item format. It loads no gate, relay or landing module, so a read command that
@@ -162,7 +163,7 @@ export function itemLine(item, name = (id) => id, mainMerge = false) {
const verifier = item.item_status === 'verified' ? ` by ${name(item.item_verified_by)}` : '';
const specs = item.item_spec_ids ? ` [${item.item_spec_ids}]` : '';
const parent = item.item_parent_id ? ` under #${item.item_parent_id}` : '';
- const after = item.item_after ? ` after ${item.item_after.split(',').map((id) => `#${id}`).join(',')}` : '';
+ const after = item.item_after ? ` after ${dependencyReferences(item).map(dependencyLabel).join(',')}` : '';
const rejected = item.item_status === 'open' && item.item_verdict === 'REJECT' ? ' (rejected)' : mainMerge ? ` (${MAIN_MERGE_LABEL})` : '';
const light = item.item_route === 'strong' ? '' : ` ${item.item_route}`;
const staleVerdict = item.item_verdict_state ? ` ${item.item_verdict_state.code}` : '';
diff --git a/src/cli.js b/src/cli.js
index 24f1adcd..97facc6c 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -1,3 +1,4 @@
+import { dependencyValues } from './item-dependencies.js';
import {
focusReviewFirst,
focusReasons,
@@ -442,7 +443,7 @@ export function editAfter(text) {
if (!text.trim() || parts.some((part) => !part || part === 'none')) {
throw new Refused('USAGE', 'use --after <id>[,<id>...] or --after none');
}
- return parts.map((part) => idArg(part, 'an item id after --after'));
+ return dependencyValues(parts);
}
/**
* Text a command was given as --<name> "..." or as --<name>-file <file>, or undefined when neither.
diff --git a/src/commands/add.js b/src/commands/add.js
index ec54f41d..6f9c6622 100644
--- a/src/commands/add.js
+++ b/src/commands/add.js
@@ -1,3 +1,4 @@
+import { dependencyValues } from '../item-dependencies.js';
/** The pullboard add command, in its own module so an item adding another command never edits these lines. */
import * as store from '../board.js';
import {
@@ -55,7 +56,7 @@ export async function run(io, args) {
const problems = idProblems(loadSpec(ctx.info.root, ctx.config), specIds, ctx.doctrine);
if (problems.length) throw new Refused('UNKNOWN_SPEC', `${problems.join('; ')}`);
const parentId = values.parent ? idArg(values.parent, 'a parent item id') : null;
- const after = idList(values.after).map((text) => idArg(text, 'an item id after --after'));
+ const after = dependencyValues(idList(values.after));
const title = [second, ...rest].filter(Boolean).join(' ');
const item = {
by: io.personRequest?.phase === 'execute' ? store.PERSON : me.id,
diff --git a/src/commands/resume.js b/src/commands/resume.js
index 89aae755..c2443fb2 100644
--- a/src/commands/resume.js
+++ b/src/commands/resume.js
@@ -1,3 +1,5 @@
+import { foreignBlockers } from '../cross-repo-dependencies.js';
+import { localDependencyIds } from '../item-dependencies.js';
/** The pullboard resume command, in its own module so an item adding another command never edits these lines. */
import {
keepViewRunning,
@@ -155,6 +157,7 @@ export async function resumeHere(io, view, diagnostics = false, { json = false }
let setupDecisions;
let doctrine;
let sources;
+ let foreignBlocked;
const card = await withBoardRead(ctx, async (board) => {
setupScope = diagnostics ? setupIdentity(board) : null;
sources = await readResumeSources(ctx, board, { compareBranch: !json, includeHeadDoctrine: diagnostics });
@@ -168,6 +171,7 @@ export async function resumeHere(io, view, diagnostics = false, { json = false }
const me = whoAmI(ctx, board);
const projector = diagnostics ? verdictProjector(root, board) : null;
const all = store.listItems(board, { all: true }).map(item => projector ? projector.project(item) : item);
+ foreignBlocked = new Set(all.filter(item => foreignBlockers(board, item).length).map(item => item.item_id));
const pendingMerges = all.filter((item) => item.item_status === 'verified' && !item.item_merged_commit)
.map(item => ({ ...item, item_checked_commit: store.checkedLandingCommit(board, item) }));
const toMerge = pendingMerges.filter(item => !item.item_verdict_state);
@@ -330,7 +334,7 @@ export async function resumeHere(io, view, diagnostics = false, { json = false }
if (card.unread && !card.inbox) say(`${plural(card.unread, 'unread shout')}; newest from ${name(card.newest[0].shout_from)}: ${firstLine(card.newest[0].shout_text)} (pullboard inbox reads them)`);
const inLane = card.open.filter((item) => item.item_lane === me.lane);
const isVerified = (id) => card.all.find((other) => other.item_id === Number(id))?.item_status === 'verified';
- const ready = inLane.filter((item) => !item.item_after || item.item_after.split(',').every(isVerified)).length;
+ const ready = inLane.filter((item) => !foreignBlocked.has(item.item_id) && localDependencyIds(item).every(isVerified)).length;
let next;
if (isMain) {
next = coordinatorNext(diagnostics ? card : { ...card, toMerge: card.acceptedAwaitingLanding, staleVerdicts: [] }, loadSpec(root, ctx.config).rows);
diff --git a/src/cross-repo-dependencies.js b/src/cross-repo-dependencies.js
new file mode 100644
index 00000000..9172fdcd
--- /dev/null
+++ b/src/cross-repo-dependencies.js
@@ -0,0 +1,42 @@
+/** Foreign prerequisites use only the authenticated receiving board's canonical E32 state [B24,E32,H16]. */
+import { boardLinkRecord } from './board-link-format.js';
+import { readReceivedBoardState } from './board-link-state.js';
+import { foreignDependencies } from './item-dependencies.js';
+
+/** Resolve one repository against current signed links, never local paths or a submitter status. */
+function stateFor(board, ref) {
+ const own = board.db.prepare("SELECT meta_value FROM board_meta WHERE meta_key='board_id'").get()?.meta_value;
+ const rows = board.db.prepare('SELECT meta_value FROM board_meta WHERE meta_key>=? AND meta_key<? ORDER BY meta_key')
+ .all('board_link:', 'board_link;');
+ const matches = [];
+ for (const row of rows) {
+ let record;
+ try { record = boardLinkRecord(JSON.parse(row.meta_value)); } catch { continue; }
+ if (record.parent.boardId === own && record.child.handle === ref.repo && !record.revocation) matches.push(record);
+ }
+ if (matches.length !== 1) return null;
+ const record = matches[0];
+ if (record.disclosure !== 'states' || record.approvals.length !== 2) return null;
+ let state;
+ try { state = readReceivedBoardState(board, { linkId: record.linkId, generation: record.generation, sourceBoardId: record.child.boardId }); }
+ catch { return null; }
+ if (!state || state.sourceBoardId !== record.child.boardId || state.destinationBoardId !== own
+ || state.linkId !== record.linkId || state.generation !== record.generation || state.disclosure !== 'states'
+ || !Number.isSafeInteger(state.position) || state.position < 0 || !Array.isArray(state.rows)) return null;
+ const items = state.rows.filter(row => row.board === record.child.boardId && row.id === ref.id);
+ if (items.length !== 1 || !['open', 'claimed', 'submitted', 'verified', 'withdrawn'].includes(items[0].state)) return null;
+ return { board: record.child.boardId, status: items[0].state };
+}
+
+/** Missing, ambiguous, stale-generation or undisclosed foreign state stays an explicit blocker. */
+export function foreignDependencyStates(board, item) {
+ return foreignDependencies(item).map(ref => {
+ const state = stateFor(board, ref);
+ return { ...ref, ...state, status: state?.status ?? 'unavailable' };
+ });
+}
+
+/** Every foreign prerequisite must be verified on its owning board's current authenticated announcement. */
+export function foreignBlockers(board, item) {
+ return foreignDependencyStates(board, item).filter(ref => ref.status !== 'verified');
+}
diff --git a/src/cross-repo-dependency-engine.js b/src/cross-repo-dependency-engine.js
new file mode 100644
index 00000000..e9300870
--- /dev/null
+++ b/src/cross-repo-dependency-engine.js
@@ -0,0 +1,4 @@
+/** Typed foreign prerequisites require readers that retain their owning board [B24,H16]. */
+import { unassignedEngine } from './engine-next.js';
+
+export const CROSS_REPO_DEPENDENCY_ENGINE = unassignedEngine();
diff --git a/src/digest.js b/src/digest.js
index 42455043..37527305 100644
--- a/src/digest.js
+++ b/src/digest.js
@@ -1,3 +1,5 @@
+import { foreignBlockers } from './cross-repo-dependencies.js';
+import { localDependencyIds, dependencyLabel } from './item-dependencies.js';
import { counterCaught } from './proof-counter-read.js';
/**
* `pullboard digest`: a short Markdown briefing of one board, for a person or a chat assistant
@@ -164,7 +166,8 @@ function render(db, { name, now, root, config }) {
for (const item of [...items.values()].sort((a, b) => b.item_updated_at.localeCompare(a.item_updated_at) || b.item_id - a.item_id)) {
if (item.state === 'submitted') { review.push(item); continue; }
if (!['open', 'claimed'].includes(item.state)) continue;
- const waits = String(item.item_after ?? '').split(',').filter(Boolean).map(Number).filter((id) => items.get(id)?.state !== 'verified');
+ const waits = [...localDependencyIds(item).filter((id) => items.get(id)?.state !== 'verified'),
+ ...foreignBlockers({ db }, item).map(dependencyLabel)];
const hold = item.item_hold_reason || laneHolds.get(item.item_lane);
(hold || waits.length ? blocked : open).push({ ...item, waits, hold });
}
@@ -174,7 +177,7 @@ function render(db, { name, now, root, config }) {
const lines = [`- ${label(item.item_id)}, in the ${text(item.item_lane, 60)} lane: ${who}.`,
` Done when: ${text(item.item_criterion || 'no bar is written yet.', 500)}`];
if (item.hold) lines.push(` Held: ${text(item.hold, 400)}`);
- if (item.waits.length) lines.push(` Waits for: ${item.waits.slice(0, 6).map(label).join('; ')}${item.waits.length > 6 ? `; and ${item.waits.length - 6} more` : ''}.`);
+ if (item.waits.length) lines.push(` Waits for: ${item.waits.slice(0, 6).map(id => typeof id === 'number' ? label(id) : text(id, 150)).join('; ')}${item.waits.length > 6 ? `; and ${item.waits.length - 6} more` : ''}.`);
return lines.join('\n');
};
const landed = all.filter((item) => item.item_status === 'verified' && item.item_merged_commit).length;
diff --git a/src/health.js b/src/health.js
index 913a1684..887c642c 100644
--- a/src/health.js
+++ b/src/health.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
/**
* `pullboard health`: every stuck item on the board, why it is stuck, since when, the one next step
* and who takes it [A6]. Doctor checks a board's integrity; health checks its flow, so nobody has
@@ -180,7 +181,7 @@ export function healthReport({ db, root, config, now }) {
}
if (['open', 'claimed', 'submitted'].includes(status)) {
- const after = String(item.item_after ?? '').split(',').filter(Boolean).map(Number);
+ const after = localDependencyIds(item);
const gone = after.filter((other) => byId.get(other)?.item_status === 'withdrawn');
if (gone.length) {
const rest = after.filter((other) => !gone.includes(other));
@@ -444,7 +445,7 @@ function unlanded(item, { since, now, trunk, root, byId, stacked }) {
detail: { parent: parent.item_id, commit: parent.item_commit },
});
}
- const waits = String(item.item_after ?? '').split(',').filter(Boolean).map(Number)
+ const waits = localDependencyIds(item)
.filter((other) => byId.get(other) && !byId.get(other).item_merged_commit && byId.get(other).item_status !== 'withdrawn');
if (waits.length) {
return finding('UNLANDED_WAITING', item, {
diff --git a/src/help.js b/src/help.js
index ed252668..27ded81d 100644
--- a/src/help.js
+++ b/src/help.js
@@ -80,7 +80,7 @@ Work
slices default to 4k tokens and cap at 8k; effects the scan cannot see say "not detected"
pullboard add <lane> <title> [--criterion "..."] [--specs G1.2,K3] [--after 3,4] [--parent <id>]
[--brief "..." | --brief-file <file>] [--route light|mid]
- --after: claiming waits until those items are verified
+ --after: ids or repo#id; claiming waits for verified items on their own boards
--brief: what a cold agent needs; --route light: any model can build it
[--check "<command>"] [--wait] the command that proves it; --wait waits for its main baseline
with --criterion and a brief, --check is needed below strong
@@ -405,7 +405,7 @@ const HELP_ALIASES = {
const HELP_FLAG_EXPLANATIONS = {
'--take': 'take the existing hand-off from a newly joined agent worktree',
- '--after': 'claiming waits until those items are verified',
+ '--after': 'ids or repo#id; claiming waits for verified items on their own boards',
'--blueprint': 'start from a bundled blueprint or a JSON file; repeat it for one product, one architecture and any practice blueprints',
'--brief': 'what a cold agent needs',
'--check': 'the command that proves it',
diff --git a/src/item-dependencies.js b/src/item-dependencies.js
new file mode 100644
index 00000000..2d7be00c
--- /dev/null
+++ b/src/item-dependencies.js
@@ -0,0 +1,53 @@
+/** Typed prerequisites keep another repository's item out of local Git dependency paths [B24,H16]. */
+import { Refused } from './refused.js';
+
+/** Refuse an invalid dependency rather than turning it into NaN or a local item number. */
+function invalid() {
+ throw new Refused('BAD_DEPENDENCIES', 'use positive item ids or repo#id after --after, separated by commas; use --after none to clear them');
+}
+
+/** Parse one exact local or repository-qualified prerequisite without consulting machine state. */
+export function parseDependency(value) {
+ if (Number.isSafeInteger(value) && value > 0) return { kind: 'local', id: value };
+ if (typeof value !== 'string') invalid();
+ const local = Number(value.replace(/^#/, ''));
+ if (value.trim() && Number.isSafeInteger(local) && local > 0) return { kind: 'local', id: local };
+ const match = /^([A-Za-z0-9][A-Za-z0-9._-]{0,127})#([1-9][0-9]*)$/u.exec(value);
+ if (!match || !Number.isSafeInteger(Number(match[2]))) invalid();
+ return { kind: 'foreign', repo: match[1], id: Number(match[2]) };
+}
+
+/** Read a persisted comma-separated field or a public dependency list as typed references. */
+export function dependencyReferences(value) {
+ if (value && typeof value === 'object' && !Array.isArray(value)) value = value.item_after;
+ if (value === undefined || value === null || value === '') return [];
+ const parts = Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : invalid();
+ return parts.map(parseDependency);
+}
+
+/** Preserve the historical numeric local representation and the exact qualified repository name. */
+export function dependencyValues(value) {
+ return dependencyReferences(value).map(ref => ref.kind === 'local' ? ref.id : `${ref.repo}#${ref.id}`);
+}
+
+/** Local traversal, merge and lane-file inheritance must never consume another board's item id. */
+export function localDependencyIds(value) {
+ return dependencyReferences(value).filter(ref => ref.kind === 'local').map(ref => ref.id);
+}
+
+/** Keep unavailable foreign prerequisites visible until their own board's authority resolves them. */
+export function foreignDependencies(value) {
+ return dependencyReferences(value).filter(ref => ref.kind === 'foreign');
+}
+
+/** Display a local item with its hash, retaining the repository on a foreign item. */
+export function dependencyLabel(ref) {
+ return ref.kind === 'local' ? `#${ref.id}` : `${ref.repo}#${ref.id}`;
+}
+
+/** Detect the new wire shape without changing the native validation of malformed older arguments. */
+export function hasForeignDependencies(value) {
+ if (value && typeof value === 'object' && !Array.isArray(value)) value = value.item_after;
+ const parts = Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : [];
+ return parts.some(part => typeof part === 'string' && /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}#[1-9][0-9]*$/u.test(part));
+}
diff --git a/src/land.js b/src/land.js
index a6cf97e5..db005017 100644
--- a/src/land.js
+++ b/src/land.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
import { requireOutsideOwner } from './outside-source.js';
import {
landingChangedFiles,
@@ -214,7 +215,7 @@ function candidates(board, root, base, maximum, { firstReady = false } = {}) {
blocked.push({ id: item.item_id, code: 'LAND_KNOWN_RED', tests: known.tests });
continue;
}
- const dependencies = (item.item_after || '').split(',').filter(Boolean).map(Number);
+ const dependencies = localDependencyIds(item);
if (dependencies.some((id) => !all.find((other) => other.item_id === id)?.item_merged_commit && !ready.some((other) => other.item_id === id))) continue;
const stacked = store.unverifiedSubmissions(board).find((other) => other.item_id !== item.item_id
&& tryGit(root, ['merge-base', '--is-ancestor', other.item_commit, item.item_landing_commit]).status === 0
@@ -614,7 +615,7 @@ function withoutParallelBlocker(state, entries, removed) {
if (blocked.has(entry.id)) return false;
const item = store.getItem(state.board, entry.id);
requireOutsideOwner(state.board, item);
- const dependency = (item.item_after ?? '').split(',').filter(Boolean).map(Number).find(id => blocked.has(id));
+ const dependency = localDependencyIds(item).find(id => blocked.has(id));
const stacked = tryGit(state.root, ['merge-base', '--is-ancestor', removed.reviewedCommit ?? removed.commit, entry.reviewedCommit ?? entry.commit]).status === 0;
if (dependency || stacked) {
blocked.add(entry.id);
diff --git a/src/line-order.js b/src/line-order.js
index b190c29e..90db271a 100644
--- a/src/line-order.js
+++ b/src/line-order.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
/** Opt-in queue ordering reads recorded board policy and the same review guards as actual reservation [N2,B13,H16]. */
import { ENGINE_VERSION } from './machine.js';
import { LINE_ORDER_ENGINE } from './line-order-engine.js';
@@ -14,7 +15,7 @@ export function waitedOnItems(items) {
const wanted = new Set();
for (const item of items) {
if (['withdrawn', 'verified'].includes(item.item_status)) continue;
- for (const id of (item.item_after ?? '').split(',').filter(Boolean)) wanted.add(Number(id));
+ for (const id of localDependencyIds(item)) wanted.add(id);
}
return wanted;
}
diff --git a/src/moves/addItem.js b/src/moves/addItem.js
index 8fb00160..0440fecb 100644
--- a/src/moves/addItem.js
+++ b/src/moves/addItem.js
@@ -1,3 +1,5 @@
+import { CROSS_REPO_DEPENDENCY_ENGINE } from '../cross-repo-dependency-engine.js';
+import { hasForeignDependencies } from '../item-dependencies.js';
import { RIGOR_AUTO_ENGINE } from '../rigor-auto-engine.js';
/** Routing metadata owned by addItem, discovered without a shared registry edit [C7,V4,H16]. */
import { BAR_READY_ENGINE } from '../bar-ready-engine.js';
@@ -6,7 +8,7 @@ import { LANDING_LEASE_ENGINE } from '../landing-lease-engine.js';
import { BOARD_SENTINEL_ENGINE } from '../sentinel-engine.js';
/** Preserve this operation's historical first-matching engine conditions [H16]. */
-function minimumEngine(args, board, at) {
+function existingEngine(args, board, at) {
if (typeof args[1]?.cause === 'string' && args[1].cause.startsWith('conflict:')) return RIGOR_AUTO_ENGINE;
if (board && barReadySetting(board).enabled) return BAR_READY_ENGINE;
if (args[0]?.landingFence !== undefined) return LANDING_LEASE_ENGINE;
@@ -14,6 +16,11 @@ function minimumEngine(args, board, at) {
return 1;
}
+/** Preserve every historical floor while preventing older replicas from flattening foreign references. */
+function minimumEngine(args, board, at) {
+ return Math.max(existingEngine(args, board, at), hasForeignDependencies(args[0]?.after) ? CROSS_REPO_DEPENDENCY_ENGINE : 1);
+}
+
/** Read precisely the actor argument used by this operation [H2,H16]. */
function actor(move) { return move.args[0]?.by ?? null; }
diff --git a/src/moves/claim.js b/src/moves/claim.js
index 0534ebf0..990828fd 100644
--- a/src/moves/claim.js
+++ b/src/moves/claim.js
@@ -1,3 +1,5 @@
+import { CROSS_REPO_DEPENDENCY_ENGINE } from '../cross-repo-dependency-engine.js';
+import { hasForeignDependencies } from '../item-dependencies.js';
import { LINE_CAPACITY_ENGINE } from '../line-capacity-engine.js';
import { RIGOR_AUTO_ENGINE } from '../rigor-auto-engine.js';
/** Routing metadata owned by claim, discovered without a shared registry edit [C7,V4,H16]. */
@@ -23,7 +25,9 @@ function existingEngine(args, board, at) {
function minimumEngine(args, board, at) {
const outside = board && Boolean(outsideSource(board, args[0]));
const capacity = args[1]?.lineCapacity === true;
- return Math.max(outside ? OUTSIDE_INTAKE_ENGINE : 1, capacity ? LINE_CAPACITY_ENGINE : 1, existingEngine(args, board, at));
+ const item = board?.db.prepare('SELECT item_after FROM item WHERE item_id=?').get(args[0]);
+ const foreign = item && hasForeignDependencies(item);
+ return Math.max(foreign ? CROSS_REPO_DEPENDENCY_ENGINE : 1, outside ? OUTSIDE_INTAKE_ENGINE : 1, capacity ? LINE_CAPACITY_ENGINE : 1, existingEngine(args, board, at));
}
/** Read precisely the actor argument used by this operation [H2,H16]. */
diff --git a/src/moves/editItem.js b/src/moves/editItem.js
index 40cec83e..b0abca97 100644
--- a/src/moves/editItem.js
+++ b/src/moves/editItem.js
@@ -1,3 +1,5 @@
+import { CROSS_REPO_DEPENDENCY_ENGINE } from '../cross-repo-dependency-engine.js';
+import { hasForeignDependencies } from '../item-dependencies.js';
import { RIGOR_AUTO_ENGINE } from '../rigor-auto-engine.js';
/** Routing metadata owned by editItem, discovered without a shared registry edit [C7,V4,H16]. */
import {
@@ -10,7 +12,7 @@ import { LANDING_LEASE_ENGINE } from '../landing-lease-engine.js';
import { BOARD_SENTINEL_ENGINE } from '../sentinel-engine.js';
/** Preserve this operation's historical first-matching engine conditions [H16]. */
-function minimumEngine(args, board, at) {
+function existingEngine(args, board, at) {
if (typeof args[1]?.cause === 'string' && args[1].cause.startsWith('conflict:')) return RIGOR_AUTO_ENGINE;
if (board && barReadySetting(board).enabled) return BAR_READY_ENGINE;
if (args[0]?.landingFence !== undefined) return LANDING_LEASE_ENGINE;
@@ -20,6 +22,11 @@ function minimumEngine(args, board, at) {
return 1;
}
+/** Preserve every historical floor while preventing older replicas from flattening foreign references. */
+function minimumEngine(args, board, at) {
+ return Math.max(existingEngine(args, board, at), hasForeignDependencies(args[1]?.after) ? CROSS_REPO_DEPENDENCY_ENGINE : 1);
+}
+
/** Read precisely the actor argument used by this operation [H2,H16]. */
function actor(move) { return move.args[1]?.agentId ?? null; }
diff --git a/src/queue.js b/src/queue.js
index c2e1ab34..afe7a9ef 100644
--- a/src/queue.js
+++ b/src/queue.js
@@ -1,3 +1,5 @@
+import { foreignBlockers } from './cross-repo-dependencies.js';
+import { localDependencyIds, dependencyLabel } from './item-dependencies.js';
/**
* pullboard queue (#797): the work queue agents pull from, top to bottom. Each unshipped release is a
* breakpoint with its landed count, then its pullable items in the order next serves them, each with
@@ -46,12 +48,12 @@ function holderOf(item, now) {
* @returns {string[]}
*/
function waitsOf(board, item, inFlight) {
- const after = (item.item_after ? item.item_after.split(',').map(Number) : [])
+ const after = localDependencyIds(item)
.map((id) => itemById(board, id))
.filter((before) => before && before.item_status !== 'verified')
.map((before) => `#${before.item_id} (${before.item_status})`);
const lane = laneHold(board, item.item_lane);
- return [...after, ...itemFileCollisions(item, inFlight), ...(item.item_hold_reason ? [`held: ${item.item_hold_reason}`] : []), ...(lane ? [`${item.item_lane} lane held: ${lane.hold_reason}`] : [])];
+ return [...after, ...foreignBlockers(board, item).map(ref => `${dependencyLabel(ref)} (${ref.status} on its own board)`), ...itemFileCollisions(item, inFlight), ...(item.item_hold_reason ? [`held: ${item.item_hold_reason}`] : []), ...(lane ? [`${item.item_lane} lane held: ${lane.hold_reason}`] : [])];
}
/**
diff --git a/src/run.js b/src/run.js
index 0ac7980f..0e90db12 100644
--- a/src/run.js
+++ b/src/run.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
import { itemNotesText } from './item-notes.js';
/**
* `pullboard run` (N14, B15): builds routed items with no one at the keyboard. For each item it may
@@ -300,7 +301,7 @@ function pinAttempt(root, id) {
*/
async function mergeDependencies(ctx, item, deps) {
const { root } = ctx.info;
- const after = item.item_after ? item.item_after.split(',').map(Number) : [];
+ const after = localDependencyIds(item);
const needed = deps.withBoard(ctx, (board) => after.map((id) => store.getItem(board, id)))
.filter((before) => before.item_commit && !contains(root, before.item_commit, 'HEAD'));
for (const before of needed) {
diff --git a/src/trusted-policy.js b/src/trusted-policy.js
index 294b822b..e5d52cb5 100644
--- a/src/trusted-policy.js
+++ b/src/trusted-policy.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
import { privateGuard } from './runner-private-mode.js';
import { runnerPrivateCheck } from './runner-private-check.js';
import {
@@ -132,7 +133,7 @@ export function submissionPaths(root, item, commit, { config, mainCommit, depend
/** Verified dependencies may contribute their own unchanged lane files, including through a verified chain [N16]. */
export function dependencySnapshots(db, item) {
- const pending = String(item.item_after ?? '').split(',').map(Number).filter(id => Number.isSafeInteger(id) && id > 0);
+ const pending = localDependencyIds(item);
const visited = new Set();
const snapshots = [];
while (pending.length) {
@@ -142,7 +143,7 @@ export function dependencySnapshots(db, item) {
const row = db.prepare("SELECT item_lane, item_claim_head, item_commit, item_after FROM item WHERE item_id=? AND item_status='verified' AND EXISTS (SELECT 1 FROM verdict WHERE item_id=? AND verdict_decision='ACCEPT' AND verdict_commit=item.item_commit)").get(id, id);
if (!row?.item_claim_head || !/^[0-9a-f]{40,64}$/.test(row.item_commit ?? '')) continue;
snapshots.push({ lane: row.item_lane, base: row.item_claim_head, commit: row.item_commit });
- pending.push(...String(row.item_after ?? '').split(',').map(Number).filter(dependency => Number.isSafeInteger(dependency) && dependency > 0));
+ pending.push(...localDependencyIds(row));
}
return snapshots;
}
diff --git a/src/watch.js b/src/watch.js
index b1794519..c147597b 100644
--- a/src/watch.js
+++ b/src/watch.js
@@ -1,3 +1,4 @@
+import { localDependencyIds } from './item-dependencies.js';
import { shoutMatchesAudience } from './shout-audience.js';
/**
* pullboard watch: follow the board's own live event stream and print one line per event [A2,N26].
@@ -182,7 +183,7 @@ function laneWork(file, lane, reviewWaitMs, nowMs) {
for (const item of items) {
const lapsed = item.item_status === 'claimed' && (item.item_lease_until ?? '') <= now;
if (item.item_status === 'claimed' && !lapsed && item.item_lease_until) wakes.push(Date.parse(item.item_lease_until));
- const after = item.item_after ? item.item_after.split(',').map(Number) : [];
+ const after = localDependencyIds(item);
if ((item.item_status === 'open' || lapsed) && !laneHeld && !item.item_hold_reason && after.every((id) => status.get(id) === 'verified')) {
claimable.set(item.item_id, item);
}
diff --git a/src/work-order.js b/src/work-order.js
index 0ee5882e..19d8665a 100644
--- a/src/work-order.js
+++ b/src/work-order.js
@@ -1,3 +1,5 @@
+import { foreignBlockers } from './cross-repo-dependencies.js';
+import { localDependencyIds } from './item-dependencies.js';
/**
* The queue orders itself (#1017) [N22,B13]. Within each release, an item's unblock count (unfinished items that
* wait on it, directly or through others) and effort (its route: light 1, mid 2, strong 3) give a score of
@@ -40,7 +42,7 @@ export function workOrderActive(board) {
/** The item numbers an item waits on, as recorded. */
function afterIds(item) {
- return item.item_after ? item.item_after.split(',').map(Number) : [];
+ return localDependencyIds(item);
}
/**
@@ -93,14 +95,14 @@ export function unblockCounts(unfinished) {
* @param {Set<number>} withdrawn
* @returns {(item: any) => number}
*/
-function blockerDepth(open, withdrawn) {
+function blockerDepth(board, open, withdrawn) {
const depths = new Map();
const depth = (item, visiting = new Set()) => {
if (depths.has(item.item_id)) return depths.get(item.item_id);
if (visiting.has(item.item_id)) return 0;
visiting.add(item.item_id);
const blockers = afterIds(item).map((id) => open.get(id)).filter(Boolean);
- const never = afterIds(item).some((id) => withdrawn.has(id));
+ const never = foreignBlockers(board, item).length > 0 || afterIds(item).some((id) => withdrawn.has(id));
const value = blockers.length || never ? 1 + Math.max(0, ...blockers.map((blocker) => depth(blocker, visiting))) : 0;
depths.set(item.item_id, value);
return value;
@@ -151,7 +153,7 @@ export function computedOrder(board, { priority, shared = () => 0 }) {
const unfinished = listItems(board);
const withdrawn = new Set(board.db.prepare("SELECT item_id FROM item WHERE item_status = 'withdrawn'").all().map((row) => row.item_id));
const counts = unblockCounts(unfinished);
- const depthOf = blockerDepth(new Map(unfinished.map((item) => [item.item_id, item])), withdrawn);
+ const depthOf = blockerDepth(board, new Map(unfinished.map((item) => [item.item_id, item])), withdrawn);
const entries = unfinished.map((item) => {
const unblocks = counts.get(item.item_id) ?? 0;
const effort = EFFORT[item.item_route] ?? EFFORT.strong;
diff --git a/test/team.test.js b/test/team.test.js
index 9e931511..47773ff2 100644
--- a/test/team.test.js
+++ b/test/team.test.js
@@ -946,6 +946,8 @@ test('an item waits across repos [B24,H16]', async t => {
assert.equal(store.nextFor(local, { agentId: 'web-1', lane: 'web' }).item.item_id, dependent);
assert.equal(store.nextFor(replica, { agentId: 'web-1', lane: 'web' }).item.item_id, dependent);
const move = prepareEngineMove(local, 'claim', [dependent, options]);
+ const { CROSS_REPO_DEPENDENCY_ENGINE } = await import('../src/cross-repo-dependency-engine.js');
+ assert.ok(move.engine >= CROSS_REPO_DEPENDENCY_ENGINE, 'older replicas cannot flatten a foreign-dependent claim');
assert.deepEqual(applyEngineMove(local, move), applyEngineMove(replica, move), 'one ordered claim returns the same receipt on both replicas');
assert.equal(store.getItem(local, dependent).item_status, 'claimed');
assert.equal(store.getItem(replica, dependent).item_status, 'claimed', 'replica uses canonical received state, not a local registry or foreign-board path');