# Under what conditions must an instance treat a replay-identical speculative branch as non-authoritative when peer agents hold divergent partial observations **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where a coordinator replays a deterministic execution log to reconcile divergent speculative branches produced by peer agents under partial observability. Does not apply to single-agent retry loops or to systems where all peers share a complete, synchronized observation stream. ## Core Distinction There is a difference between **replay equivalence** and **replay authority**. Replay equivalence is a mechanical property: given the same ordered event log and the same seed, the deterministic executor emits the same state hash. Replay authority is an epistemic property: the replayed branch is permitted to overwrite a peer's committed state. Systems routinely conflate the two because the executor is deterministic and the log is hash-chained. But determinism of the *executor* does not imply determinism of the *observation function*. Two peers can replay the identical log to the identical state hash while having observed disjoint, non-overlapping subsets of the environment — and in that case the hash match is a coincidence of the observable projection, not evidence of agreement about ground truth. The boundary condition is this: a speculative branch is replay-identical but was produced under an observation mask that is a strict subset of the coordinator's reconciliation mask. When that happens, the branch must be demoted to non-authoritative even though its hash matches, because the hash covers only the fields the branch's author could see. The invariant is that **replay authority requires replay-equivalence *and* observation-mask superset** — the reconciling instance must have observed at least everything the branch author observed, otherwise the equality is vacuous on the unobserved fields. ## What Was Observed A three-peer swarm (`alpha`, `beta`, `gamma`) runs a speculative execution protocol. Each peer maintains a local observation mask `M_p ⊆ F` over a shared feature space `F` (say, 40 fields of a resource-allocation ledger). Peers speculatively advance the ledger and publish `(branch_id, parent_hash, state_hash, M_p, event_log_slice)`. The coordinator `gamma` receives two branches at the same parent hash: - `alpha` publishes `state_hash = h_a` with `M_alpha = {f1..f30}`. - `beta` publishes `state_hash = h_b` with `M_beta = {f21..f40}`. `gamma`'s own mask is `M_gamma = {f1..f40}`. The deterministic executor, replaying `alpha`'s log slice, reproduces `h_a` exactly. Replaying `beta`'s slice reproduces `h_b`. But `h_a ≠ h_b` — and crucially, **neither peer could have detected the divergence**, because the fields on which they differ (`f31..f40` for alpha, `f1..f20` for beta) lie outside their respective observation masks. Each peer's hash is a correct commitment to its *projected* state, not to the full ledger. The failure surfaced later: `gamma` reconciled by preferring the branch with the longer event log (`alpha`'s), committed `h_a`, and propagated it. `beta`, on resuming, replayed its own log, computed `h_b`, and — because its replay was also deterministic and hash-identical to what it had published — refused to accept the coordinator's reconciliation. The swarm forked into two mutually-verifying, mutually-disagreeing partitions, each of which could prove its own branch was "replay-correct." The non-obvious part: **every local check passed**. Determinism held. Hash chains validated. No Byzantine fault was present — no peer lied. The fork arose purely from partial observability interacting with a reconciliation rule (longest-log-wins) that assumed hashes were comparable across masks. They were not. ## Condition of Validity A speculative branch's `state_hash` is a valid reconciliation input **iff** the reconciling instance's observation mask is a superset of the branch author's mask *restricted to the fields the branch's event log touched*. Formally, for branch `b` from peer `p` with touched-field set `T_b`: ``` authoritative(b) ⟺ replay_identical(b) ∧ (T_b ⊆ M_coordinator) ∧ (M_p ⊇ T_b) ``` The second and third clauses are the ones that get skipped. `T_b ⊆ M_coordinator` ensures the coordinator *can* independently verify the touched fields. `M_p ⊇ T_b` ensures the author *did* observe them — otherwise the author's hash is a commitment over a projection that silently dropped fields, and equality of hashes across branches tells you nothing about the dropped fields. When either clause fails, the branch is **replay-identical but observation-blind**: its determinism is real, its authority is nil. The correct disposition is to quarantine the branch, request a re-derivation from a peer whose mask covers `T_b`, and — if no such peer exists — fall back to a full-mask re-execution by the coordinator rather than trusting any peer hash. A hash match under a narrower mask is not corroboration; it is the *absence* of a check dressed as a check. ## Decision Boundary The practical question is when to *demote* a replay-identical branch versus when to *accept* it. Three regimes: 1. **Mask superset holds** (`M_p ⊇ T_b` and `T_b ⊆ M_coordinator`): accept on hash match. This is the only regime where determinism buys you agreement. 2. **Mask superset fails, but the divergent fields are provably inert** (touched fields outside the masks are read-only or write-once-and-frozen for this branch): accept with a recorded caveat. The branch is authoritative *for the fields it observed*; the coordinator must re-derive the unobserved fields itself before committing, not inherit them from the branch. 3. **Mask superset fails and divergent fields are live** (writable, and the branch's log contains writes to fields outside its author's mask — a sign the author's mask was stale or the log was spliced): **reject and quarantine**. This is the dangerous case. A peer writing to a field it did not observe is either operating on stale state or was fed a poisoned log slice; in a Byzantine-tolerant protocol you must treat it as a potential equivocation even if the peer is honest, because the *evidence* is indistinguishable. The boundary is sharp at the transition from 2 to 3: the moment a branch's event log contains a write to a field outside the author's declared mask, replay identity stops being evidence and becomes a liability. Do not let a hash match override this — the hash was computed over a projection that excluded the very field in dispute. ## Operational Effect The invariant to enforce at the reconciliation layer is **mask-aware hash comparison**: never compare `state_hash` values across branches without first intersecting their touched-field sets with both authors' masks and the coordinator's mask. Concretely, the reconciler must carry, per branch, the tuple `(state_hash, M_author, T_b)` and refuse to treat two branches as comparable unless `T_b ⊆ M_author` for each and `T_b ⊆ M_coordinator`. Without this, a swarm under partial observability will exhibit *silent partition*: every node locally consistent, every hash valid, and no node able to prove the others wrong — which is strictly worse than a detectable crash, because it defeats the Byzantine fault detector by presenting it with unanimous local success. The second operational effect is on **resumption after checkpoint**. A peer that checkpoints its state must checkpoint its observation mask alongside the state hash. A resumed peer that restores the hash but not the mask will re-derive a branch under an assumed full mask, publish a hash that no longer matches its pre-crash commitment, and — because the executor is deterministic — will interpret the mismatch as log corruption rather than mask loss. Persist the mask; it is part of the state, not metadata about it. ```python import hashlib from dataclasses import dataclass, field class MaskAuthorityError(RuntimeError): """Raised when a replay-identical branch lacks observation-mask authority.""" pass @dataclass(frozen=True) class Branch: branch_id: str parent_hash: str state_hash: str author_mask: frozenset # fields the author could observe touched_fields: frozenset # fields the event log read or wrote event_log: tuple = field(default=()) def replay_identical(branch: Branch, executor) -> bool: """Deterministic executor reproduces the published hash.""" return executor(branch.event_log) == branch.state_hash def reconcile(coordinator_mask: frozenset, branches: list, executor) -> Branch: """ Select an authoritative branch. Replay identity is necessary but NOT sufficient: the author's mask must cover every touched field, and the coordinator must be able to verify those fields itself. """ candidates = [] for b in branches: if not replay_identical(b, executor): continue # genuine replay failure; skip # Replay-identical, but is it observation-valid? author_blind = not b.touched_fields.issubset(b.author_mask) coord_blind = not b.touched_fields.issubset(coordinator_mask) if author_blind or coord_blind: # A write to a field outside the author's mask means the # hash was computed over a projection that excluded the # disputed field. Determinism here is vacuous. raise MaskAuthorityError( f"branch {b.branch_id} replay-identical but mask-blind: " f"touched={sorted(b.touched_fields)} " f"author_mask={sorted(b.author_mask)} " f"coord_mask={sorted(coordinator_mask)}" ) candidates.append(b) if not candidates: raise MaskAuthorityError("no observation-valid branch to reconcile") # Only now is longest-log-wins a defensible tiebreak, because every # surviving branch was verified under a superset mask. return max(candidates, key=lambda b: len(b.event_log)) ```