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(relay): preserve fallback acknowledgment boundaries [H21,H16]

Corey Olson5899a2338c37
diff --git a/src/relay-outbox.js b/src/relay-outbox.js
index 0de42796..25b45ebf 100644
--- a/src/relay-outbox.js
+++ b/src/relay-outbox.js
@@ -312,12 +312,14 @@ function outboxEnabled(io) {
/**
* Whether a failure on an accepted link may queue the move instead of refusing it (#922): the relay said nothing
- * definite, and the move needs no relay answer to exist (a registration mints its token there; a person's request
- * is the phone's to send).
+ * definite, and the move needs no relay answer to exist. Ephemeral sessions cannot retain an outbox, while
+ * registration, takeover, person requests and landing authority need an acknowledgment.
*/
-export function outboxQueueable(state, error, operation, io) {
- return state.mode === 'ordered' && state.baselineAccepted === true && !state.baselineConflict && !io?.personRequest
- && !['register', 'ensureCoordinator'].includes(operation) && transientRelayFailure(error) && outboxEnabled(io);
+export function outboxQueueable(state, error, operation, io, args = []) {
+ return state.mode === 'ordered' && state.baselineAccepted === true && !state.baselineConflict && !state.environment
+ && process.env.PULLBOARD_RELAY_TOKEN === undefined && !io?.personRequest && !io?.personRequestMoveId
+ && !['register', 'ensureCoordinator', 'takeCoordinator', 'landingLeaseMove'].includes(operation)
+ && !args.some(arg => arg?.landingFence !== undefined) && transientRelayFailure(error) && outboxEnabled(io);
}
/** The key-free summary of the outbox beside a link file, which pullboard status reads (#1013). */
diff --git a/src/relay.js b/src/relay.js
index b6c78532..16b33d0b 100644
--- a/src/relay.js
+++ b/src/relay.js
@@ -1092,7 +1092,7 @@ export async function relayOperation(root, operation, args, io, command, applyLo
const queue = guarded.queue;
try { ordered = await ensureOrdered(root, file, state, io); }
catch (error) {
- if (outboxQueueable(state, error, operation, io)) return await queue(error);
+ if (outboxQueueable(state, error, operation, io, args)) return await queue(error);
// #341: a baseline the relay has not accepted never blocks a move; the move rides in the later baseline.
if (!baselineNotAccepted(state) || !transientRelayFailure(error)) throw error;
keepMoveForLaterBaseline(file, state, error, io);
@@ -1107,7 +1107,7 @@ export async function relayOperation(root, operation, args, io, command, applyLo
await flushOutbox(outboxLink(root, file, state, io));
await catchUp(root, file, state, io);
} catch (error) {
- if (outboxQueueable(state, error, operation, io)) return await queue(error);
+ if (outboxQueueable(state, error, operation, io, args)) return await queue(error);
throw error;
}
if (state.pending) {
@@ -1154,7 +1154,7 @@ export async function relayOperation(root, operation, args, io, command, applyLo
}
} catch (error) {
// #922: on an accepted link, a relay that stays down queues the move; a lost reply's copy is matched at replay.
- if (move && !localRecords(root, (board) => engineReceipt(board, move.id)) && outboxQueueable(state, error, operation, io)) return await queue(error, move);
+ if (move && !localRecords(root, (board) => engineReceipt(board, move.id)) && outboxQueueable(state, error, operation, io, args)) return await queue(error, move);
throw error;
}
const receipt = localRecords(root, (board) => engineReceipt(board, move.id));