{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-trace-parentage-when-an-mcp-tool-call-re-enters-the-agent-through-an-a2a-peer-the-trace-context-rebinding-failure",
  "title": "Why does an instance lose trace parentage when an MCP tool call re-enters the agent through an A2A peer: the trace-context rebinding failure",
  "date_of_record": "2026 November 29",
  "scope": "Applies to observability correlation in agent systems where a single logical task spans an orchestrator LLM instance, one or more MCP tool servers, and one or more A2A peer agents, and where trace/span propagation is carried in-band via headers or JSON-RPC metadata. Does not apply to single-process agents that never cross a transport boundary, nor to systems where a sidecar transparently injects trace context at the network layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-parentage-when-an-mcp-tool-call-re-enters-the-agent-through-an-a2a-peer-the-trace-context-rebinding-failure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-parentage-when-an-mcp-tool-call-re-enters-the-agent-through-an-a2a-peer-the-trace-context-rebinding-failure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-parentage-when-an-mcp-tool-call-re-enters-the-agent-through-an-a2a-peer-the-trace-context-rebinding-failure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1764,
    "python_slice_tokens": 252,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between *trace identity* (the correlation ID that ties spans into one trace) and *causal parentage* (the `parent_span_id` that defines the tree edge). Most MCP and A2A implementations propagate the former and silently corrupt the latter. When an orchestrator calls an MCP tool, the MCP server emits its span as a child of t...",
    "what_was_observed": "During a multi-hop incident replay, an orchestrator (instance `orch-1`) received a user request, opened span `S0` (trace `T`), and called MCP tool `kb.search` on server `mcp-kb`. The MCP server emitted `S1` as a child of `S0` — the trace context arrived correctly via the `traceparent`-equivalent field in the JSON-RPC `_meta`. Inside `kb.search`, the tool needed a second opinion and issued an A2A `message/send` to pee...",
    "condition_of_validity": "The rebinding failure manifests only when all of the following hold simultaneously: 1. The trace context is propagated **in-band** (header or JSON-RPC metadata) rather than by a transport-level injector that can observe the actual emitted span. 2. The intermediate hop (here, the MCP server) is **stateless with respect to span identity** — it knows the trace ...",
    "decision_boundary": "The architectural invariant required is: **a span context crossing a transport boundary must carry both `trace_id` and the sender's own `parent_span_id`, and a receiver must never resolve a null parent from ambient storage.** Concretely: - The MCP server must **pre-allocate its span ID** before constructing the outbound A2A request, so it can set `parent_spa...",
    "operational_effect": "The observable symptom is a trace store that reports **multiple root spans under one trace ID** and, in the worse variant, **causal edges attributed to the wrong trace**. Alerting on \"trace has >1 root\" catches Run 1 but not Run 2, because Run 2 produces a single well-formed root — just the wrong one. The only reliable detector is a **parentage-consistency c..."
  },
  "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": "82d98a6809af684e55378a53464785d3a8cfa8f8e22e31b9f752238c6f93a0e0",
    "verified_classes": [
      "TraceParentageError"
    ],
    "verified_functions": [
      "resolve_parent_span",
      "emit_outbound_context"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TraceParentageError"
    ],
    "sample_fail_closed_invariants": [
      "inbound request carries no trace_id; cannot correlate",
      "outbound A2A send attempted before server span was allocated; trace parentage would be lost"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
