{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-a-split-trace-context-when-an-mcp-to-a2a-bridge-rewrites-the-caller-identity-mid-invocation",
  "title": "How should an instance reconcile a split trace context when an MCP-to-A2A bridge rewrites the caller identity mid-invocation",
  "date_of_record": "2026 December 1",
  "scope": "Applies to gateway processes that terminate an MCP session on one side and originate an A2A task on the other, performing identity translation (MCP principal → A2A agent ID / OAuth2 subject) and propagating a W3C `traceparent` plus agent-specific baggage across the boundary. Does not apply to homogeneous MCP↔MCP or A2A↔A2A hops where the identity token is passed through unmodified, nor to stateless request/response proxies that hold no per-invocation state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-split-trace-context-when-an-mcp-to-a2a-bridge-rewrites-the-caller-identity-mid-invocation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-split-trace-context-when-an-mcp-to-a2a-bridge-rewrites-the-caller-identity-mid-invocation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-a-split-trace-context-when-an-mcp-to-a2a-bridge-rewrites-the-caller-identity-mid-invocation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1638,
    "python_slice_tokens": 252,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"trace IDs get lost.\" It is that the bridge *rewrites* the identity that the trace's baggage attributes are keyed on, and the two sides of the bridge disagree about which identity is authoritative for parent-child linkage. An MCP caller arrives with a `traceparent` and baggage containing `mcp.principal=<opaque-handle>`. The gateway transla...",
    "what_was_observed": "A three-hop invocation: MCP client → bridge gateway → A2A orchestrator → A2A worker (which called a state-mutating tool). The `traceparent` propagated correctly end-to-end; `trace_id` was identical on all four spans. But on replay, the A2A worker's span carried `agent_id=worker-7` and inherited baggage `mcp.principal=anon-3f9a`, while the orchestrator's span carried `agent_id=orch-2` and baggage `mcp.principal=anon-3...",
    "condition_of_validity": "The continuity invariant holds only when all of the following are true at the bridge: 1. The gateway emits an explicit **translation span** (child of the inbound MCP span, parent of the outbound A2A span) whose attributes record `identity.from`, `identity.to`, `translation.policy_id`, and `translation.timestamp`. 2. The outbound A2A span's identity attribute...",
    "decision_boundary": "When a replay detects a span whose identity attributes are not derivable from its parent plus a translation event, the correct action is **not** to drop the trace or to \"repair\" it by copying the child's identity upward. The boundary is: - If the mismatch is confined to a single hop and a translation span exists but is missing attributes → mark the span `ide...",
    "operational_effect": "After enforcing the translation-span invariant, the gateway's outbound span emission was gated on token-exchange completion, adding a measured 40–90 ms to p50 bridge latency (the exchange was already happening; only the ordering changed). The audit replay that previously reported \"100% trace continuity\" now reports ~0.3% of invocations as `identity.unverifie..."
  },
  "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": "90632c256ecedcff89df403528c7cea6806d738144459b704ce09096afa17d85",
    "verified_classes": [
      "IdentityTranslationSeam"
    ],
    "verified_functions": [
      "verify_bridge_edge"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "IdentityTranslationSeam"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
