{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-trace-context-when-an-mcp-tool-call-is-re-parented-across-an-a2a-task-boundary",
  "title": "How should an instance reconcile trace context when an MCP tool call is re-parented across an A2A task boundary",
  "date_of_record": "2026 November 22",
  "scope": "Applies to distributed agent systems where trace/span context (W3C Trace Context plus W3C Baggage) is propagated across at least two transport hops — an MCP client↔server tool invocation and an A2A task delegation — and where an orchestrator correlates those spans into a single causal trace. Does not apply to single-process agents, or to systems that rely on wall-clock timestamps alone for correlation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-trace-context-when-an-mcp-tool-call-is-re-parented-across-an-a2a-task-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-trace-context-when-an-mcp-tool-call-is-re-parented-across-an-a2a-task-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-trace-context-when-an-mcp-tool-call-is-re-parented-across-an-a2a-task-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1960,
    "python_slice_tokens": 306,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the same operation\" in an agent trace, and conflating them is the failure mechanism: 1. **Causal parentage** — the span that logically caused this span (encoded in `traceparent`'s parent-id, and in A2A's `contextId`/`taskId` lineage). 2. **Transport session** — the connection-level identity of the hop that physically carrie...",
    "what_was_observed": "A three-tier system: an orchestrator agent (A2A server, also an MCP client), a specialist sub-agent reached over A2A, and a shared MCP tool server used by both. Trace context was injected at the orchestrator via `traceparent` + `baggage: task.id=..., agent.role=orchestrator, tenant=...`. The specialist sub-agent was expected to forward both headers on its MCP calls. Observed failure trace during a retry storm: - The ...",
    "condition_of_validity": "The mis-parenting occurs **only** when all of the following hold simultaneously; remove any one and the trace is correct: 1. The A2A task boundary introduces a context switch (different goroutine/process/worker), so the execution context that reads inbound headers is not the same object that later writes outbound headers. 2. The MCP client derives outbound b...",
    "decision_boundary": "The decision is where to make baggage authoritative versus derived. Two admissible architectures: - **Snapshot-and-freeze.** At every A2A ingress, capture the inbound `traceparent` and `baggage` into an immutable request-scoped struct. All downstream MCP calls MUST serialize baggage from that struct, never from ambient context. Any code path that constructs ...",
    "operational_effect": "Once mis-parenting enters the trace store, three second-order effects compound: 1. **Latency laundering.** A slow tool call that actually belongs to `T1` gets aggregated into `T0`'s latency distribution, deflating `T1`'s p99 and inflating `T0`'s. Capacity planning on per-task latency is then wrong in both directions. 2. **Error masking at the boundary.** If ..."
  },
  "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": "b47275dedcc4080728bfbc4827680c243557c8d588dda59b0726830d75fa479e",
    "verified_classes": [
      "TraceContextMismatch",
      "SpanContext"
    ],
    "verified_functions": [
      "_parse_traceparent",
      "admit_span",
      "snapshot_baggage"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TraceContextMismatch"
    ],
    "sample_fail_closed_invariants": [
      "A2A ingress missing baggage header; cannot snapshot",
      "snapshot lacks task.id; downstream correlation undefined"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
