{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-trace-context-divergence-when-a-federated-a2a-hop-silently-re-parents-a-span",
  "title": "How does an instance detect trace-context divergence when a federated A2A hop silently re-parents a span",
  "date_of_record": "2026 November 24",
  "scope": "Applies to multi-agent systems where an orchestrator propagates W3C Trace Context (or an equivalent `trace_id`/`span_id`/`parent_span_id` tuple) across A2A task handoffs between independently-operated agent runtimes. Does not apply to single-process agents whose spans are emitted by one in-process SDK, nor to hops where the peer's trace headers are cryptographically signed end-to-end (those fail loudly at the signature check instead).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-context-divergence-when-a-federated-a2a-hop-silently-re-parents-a-span.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-context-divergence-when-a-federated-a2a-hop-silently-re-parents-a-span.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-context-divergence-when-a-federated-a2a-hop-silently-re-parents-a-span.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1914,
    "python_slice_tokens": 311,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"trace context is lost.\" Lost context is trivially detectable: the child span arrives with `parent_span_id: null` or a fresh 128-bit `trace_id`, and the observability backend renders it as a new root. That is a *visible* orphan. The dangerous case is **silent re-parenting**: the downstream agent receives a valid inbound `traceparent`, but ...",
    "what_was_observed": "A three-hop federated flow: `orchestrator → planner-agent (peer A) → executor-agent (peer B)`. The orchestrator emits span `S0` (`span_id=0xa1`). It hands off to peer A via an A2A `tasks/send` with `traceparent: 00-<tid>-0xa1-01`. Peer A's framework starts an inbound-server span `S1` with `parent_span_id=0xa1` — correct. Peer A then calls a local reasoning loop that spawns `S2` with `parent_span_id=0xa1` (re-parented...",
    "condition_of_validity": "The invariant that makes the check sound: **for any A2A hop H from agent X to agent Y, there exists exactly one span in Y's emitted set whose `parent_span_id` equals the `span_id` that X recorded as its outbound parent, and that span must be an ancestor of the span that Y records as its outbound parent to the next hop.** This holds only when: 1. X records it...",
    "decision_boundary": "The instance must decide, per hop, whether to (a) trust the observed tree, (b) flag a divergence and fall back to X's recorded emit-order as the authoritative causal order, or (c) reject the trace as unusable for latency attribution. The boundary is: **flag divergence when the sent-parent has ≥1 child span but none of those children is an ancestor of the nex...",
    "operational_effect": "Downstream consumers of the trace — latency attribution, cost allocation per hop, and failure-blast-radius computation — must all switch to emit-order when a divergence annotation is present. The blast-radius computation is the most affected: if a failure originates in `S1` (peer A's inbound parsing), the observed tree attributes the failure to `S2` (peer A'..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "5321fc6b207a6a2a1b6dea7dcca144c114aae27269493159b01e4aa5be1437ba",
    "verified_classes": [
      "TraceDivergenceError",
      "EmitRecord",
      "ObservedSpan"
    ],
    "verified_functions": [
      "assert_hop_continuity"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
