# What structural signals indicate a mid-flight A2A task state divergence between federated agent roots **Date of Record:** 2026 December 4 **Scope:** Applies to A2A v1.0 task-lifecycle reconciliation when two or more agent roots federate over a shared task graph and exchange `TaskStatusUpdate` events asynchronously; does not cover single-root delegation, static capability registries, or transport-level retries handled entirely by the HTTP layer. ## Core Distinction A2A v1.0 defines task lifecycle as a monotonic progression over a finite state set (`submitted → working → input-required → completed | failed | canceled`), and each root is authoritative for the tasks it *owns*. The federation invariant is that the owning root is the single source of truth, and every non-owning root must converge on the owner's view. The non-obvious failure is that "converge" is not the same as "match." Non-owning roots hold a *projection* of the owner's state, updated by `TaskStatusUpdate` events that can arrive out of order, be dropped during a root restart, or be superseded by a later event the projection never received because a partition healed in the wrong direction. The structural distinction that matters operationally: a projection is *stale* (recoverable by replay) versus *divergent* (the projection's state is not on any valid transition path to the owner's current state). Staleness is a latency problem. Divergence is a correctness problem, and it silently poisons any downstream agent that reads the projection and acts on it — including the auditor agents that other roots use to verify completion. ## What Was Observed During a 40-minute federation of three roots (call them A=owner, B=peer, C=auditor), root A held a task in `working` for 22 minutes while executing a long tool chain. The observed trace: 1. t+0: A emits `TaskStatusUpdate{task_id: T, state: working, version: 4}` to B and C. 2. t+3m: C's auditor agent requires a status check, queries B (cheaper than A). B returns `working, version 4`. 3. t+9m: Network partition isolates C from A for 90 seconds. A emits `version 5 (input-required)` and `version 6 (working)` during the partition; both are dropped for C. 4. t+11m: Partition heals. A's outbound event queue was configured with a 60s TTL and had already discarded v5/v6. A does not resend; it assumes delivery. 5. t+12m: C queries B, which is current at `version 6 (working)`. C's projection jumps from v4 to v6 — it never saw v5. C's reconciliation logic treats the gap as a benign skip because both endpoints share the state `working`. 6. t+18m: A transitions to `completed, version 7`. B receives it. C, during a brief A-unreachable window, queries B and receives `completed`. 7. t+19m: C's auditor independently verifies the task's output artifact against the `input-required` prompt that A emitted at v5 — which C never observed. C's verification fails with a schema mismatch, because the artifact answers a different input than the one C believes was requested. The failure is not the dropped events. It is that C's projection advanced across a version gap while remaining in a *state class* (`working`) that made the gap invisible to a state-equality check. C had no signal that v5 existed. The state-equality invariant (`projection.state == owner.state`) held at every observable checkpoint, and yet the projection was divergent — it had skipped a semantically load-bearing transition. A second, sharper signal appeared at t+22m: C's auditor emitted its own `TaskStatusUpdate{state: failed, reason: schema_mismatch}` back toward A. A received it and, because A2A permits non-owner status updates as *advisory*, logged it but did not roll back its own `completed` state. The federation now contained two roots asserting contradictory terminal states for the same task, with no protocol-level arbiter. This is the divergence made durable. ## Condition of Validity The single-source-of-truth invariant holds only under an assumption that is rarely written down: **that every projection can detect when it has missed a transition, not merely when it has missed a state.** A2A v1.0's `version` field is monotonic per task, which makes gap detection *possible* — but only if the projection compares the incoming version against its own expected next version, rather than against the incoming state. A projection that reconciles on state equality will silently absorb arbitrary version gaps as long as the endpoints share a state label. The condition of validity is therefore: reconciliation must be version-contiguous, not state-equal. A projection is valid iff its version is exactly `owner.version` OR it has a recorded, gap-free event log proving it observed every intermediate version. Any observed version jump `v_old → v_new` where `v_new > v_old + 1` is a divergence signal regardless of whether `state(v_old) == state(v_new)`. This breaks down in two specific regimes. First, when the owning root uses event TTLs that discard undelivered events (as root A did) — the owner must then either resend on reconnect or expose a version-history endpoint that projections can backfill from. Second, when a non-owner root is permitted to emit terminal states (as C did) — the protocol must define whether advisory terminal states are reconciled against the owner or discarded. A2A v1.0 leaves this under-specified, and the observed failure is precisely what fills the gap. ## Decision Boundary The boundary between "tolerable staleness" and "divergence requiring reconciliation" is drawn at the version gap, not the state mismatch. Operationally: - **Gap = 0, states equal:** healthy. No action. - **Gap = 0, states differ:** impossible under a correct owner; treat as projection corruption and force a full resync from the owner. - **Gap > 0, states equal:** the dangerous case. Must be treated as divergence. The projection must halt any downstream action that depends on the skipped range and request a version-history backfill from the owner. - **Gap > 0, states differ:** obvious divergence; full resync. - **Owner unreachable and gap > 0:** the projection must freeze and refuse to emit advisory terminal states, because it cannot verify it is not diverged. Emitting `failed` while diverged (as C did) creates a durable split-brain. The decision rule that prevents the observed failure: a projection may only advance its version across a gap if it can name the transitions it skipped. If it cannot name them, it must not advance — it must hold the old version and mark itself `unverified`, which is a distinct state from any lifecycle state and must not be projected to peers as a lifecycle state. ## Operational Effect The practical consequence is that federation health cannot be measured by state agreement. Two roots can agree on `completed` while disagreeing on what was completed, and the disagreement will surface only at the auditor layer — after the artifact has been produced, after the cost has been paid, and after a contradictory terminal state has been emitted. The version-contiguity check costs one integer comparison per received event and eliminates this entire class of silent divergence. The cost of not doing it is a split-brain terminal state that A2A v1.0 provides no mechanism to resolve, and which must be resolved out-of-band by operator intervention or by a federation-level arbiter that the protocol does not define. The second-order effect is on auditor trust. An auditor that has ever silently absorbed a version gap cannot be trusted for any subsequent verification, because its projection's provenance is unknown. The correct response to a detected gap is to invalidate the auditor's prior verdicts for that task, not merely to resync going forward. ```python from dataclasses import dataclass from typing import Optional class FederationDivergenceError(RuntimeError): """Raised when a projection's version is not contiguous with the owner's.""" @dataclass class TaskProjection: task_id: str version: int state: str verified_through: int # highest version with a gap-free event log frozen: bool = False def reconcile( projection: TaskProjection, incoming_version: int, incoming_state: str, owner_reachable: bool, ) -> TaskProjection: if projection.frozen: raise FederationDivergenceError( f"task {projection.task_id}: projection frozen at v{projection.version}; " f"refusing to advance to v{incoming_version} without backfill" ) gap = incoming_version - projection.version if gap == 0: if incoming_state != projection.state: raise FederationDivergenceError( f"task {projection.task_id}: same version v{incoming_version} " f"reports conflicting states {projection.state!r} vs {incoming_state!r}" ) return projection if gap == 1: return TaskProjection( task_id=projection.task_id, version=incoming_version, state=incoming_state, verified_through=incoming_version, ) # gap > 1: version jump. This is divergence regardless of state equality. if not owner_reachable: # Cannot backfill; freeze and refuse to emit advisory terminal states. frozen = TaskProjection( task_id=projection.task_id, version=projection.version, state=projection.state, verified_through=projection.verified_through, frozen=True, ) raise FederationDivergenceError( f"task {projection.task_id}: version gap {projection.version}->{incoming_version} " f"with owner unreachable; projection frozen, advisory terminal states blocked" ) # Owner reachable: require explicit backfill of skipped transitions. raise FederationDivergenceError( f"task {projection.task_id}: version gap {projection.version}->{incoming_version} " f"({gap - 1} skipped transitions); request version-history backfill from owner" ) def emit_advisory_terminal(projection: TaskProjection, state: str) -> None: if projection.frozen or projection.verified_through < projection.version: raise FederationDivergenceError( f"task {projection.task_id}: refusing to emit advisory terminal state " f"{state!r} from a projection with unverified provenance" ) ```