{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-causal-parent-when-an-mcp-tool-call-crosses-an-a2a-hop-trace-context-divergence-at-the-delegation-boundary",
  "title": "Why does an instance lose its causal parent when an MCP tool call crosses an A2A hop: trace-context divergence at the delegation boundary",
  "date_of_record": "2026 November 20",
  "scope": "Applies to federated agent meshes where an LLM agent (the *caller*) invokes MCP tools and delegates sub-tasks to peer agents over A2A, and where observability is reconstructed from W3C `traceparent`/`tracestate` propagation across both transports. Does not cover single-process agents, in-memory tool shims, or meshes where a single sidecar injects trace context for every egress.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-causal-parent-when-an-mcp-tool-call-crosses-an-a2a-hop-trace-context-divergence-at-the-delegation-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-causal-parent-when-an-mcp-tool-call-crosses-an-a2a-hop-trace-context-divergence-at-the-delegation-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-causal-parent-when-an-mcp-tool-call-crosses-an-a2a-hop-trace-context-divergence-at-the-delegation-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2467,
    "python_slice_tokens": 675,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an operator means by \"the trace is broken,\" and they fail for opposite reasons. The first is **span loss**: a span is never emitted, so the child appears orphaned. This is the well-understood case — a missing exporter, a dropped batch, a sampler set to `ParentBased(AlwaysOff)` that silently suppresses the whole subtree because t...",
    "what_was_observed": "A three-tier mesh: orchestrator agent `O` (holds the LLM loop), MCP server `M` exposing a `search_corpus` tool, and peer agent `P` reached by A2A for a sub-query. `O` runs under an active span `S_O`. It calls `M` over streamable HTTP with `traceparent` set to `S_O`'s context. `M` executes the tool, and *inside the tool implementation* `M` makes an outbound A2A call to `P` to enrich results. Observed span graph for a ...",
    "condition_of_validity": "The invariant that must hold for a federated agent trace to be causally faithful: > For every delegation edge `e: A → B` (whether MCP tool call or A2A task), the root span of `B`'s handling of `e` must satisfy `parent_span_id == span_id` of the span in `A` that *initiated* `e`, and `trace_id` must be byte-identical across the edge. This holds if and only if ...",
    "decision_boundary": "The boundary is between **correlating on business identity** and **correlating on trace identity**. An agent mesh can be operationally correct on the first while silently broken on the second. - If your only consumer of telemetry is a human reading a single trace waterfall for a known `taskId`, divergence is survivable: you can join on `contextId`/`taskId` a...",
    "operational_effect": "Concretely, in the observed mesh: - Per-trace token accounting under-counted delegated work by 30–40% because `P`'s spans lived in their own traces; the cost attributor summed by `trace_id` and never saw them. - An auditor agent that verified \"sub-result produced under caller warrant\" used trace parentage as its evidence chain; divergence caused it to flag v..."
  },
  "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": "efc4743a193b3f9c611e66378e9b42d9b7759174ae33176fbf3e66798a04d1c2",
    "verified_classes": [
      "TraceContextDivergenceError",
      "SpanContext"
    ],
    "verified_functions": [
      "parse_traceparent",
      "enforce_delegation_boundary",
      "build_outbound_headers",
      "valid"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "TraceContextDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
