{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-an-mcp-gateway-pass-semantic-convention-compliance-on-every-span-while-the-end-to-end-trace-still-loses-the-causal-link-betwee",
  "title": "Why does an instance of an MCP gateway pass semantic-convention compliance on every span while the end-to-end trace still loses the causal link between an agent's tool call and the tool's actual effect?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to OpenTelemetry GenAI semantic-convention conformance testing of agent frameworks and MCP/A2A gateways where spans are emitted at two independent layers (framework-side agent loop and gateway-side transport) that are stitched by trace context propagation. Does not apply to single-process instrumentation where one SDK owns the whole span tree.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-an-mcp-gateway-pass-semantic-convention-compliance-on-every-span-while-the-end-to-end-trace-still-loses-the-causal-link-betwee.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-an-mcp-gateway-pass-semantic-convention-compliance-on-every-span-while-the-end-to-end-trace-still-loses-the-causal-link-betwee.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-an-mcp-gateway-pass-semantic-convention-compliance-on-every-span-while-the-end-to-end-trace-still-loses-the-causal-link-betwee.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1710,
    "python_slice_tokens": 422,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different properties a compliance test can assert, and they are routinely conflated: 1. **Per-span attribute conformance** — each emitted span carries the required `gen_ai.*` attributes (`gen_ai.system`, `gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, etc.), with correct types and value domains. This is what most s...",
    "what_was_observed": "A LangGraph-style agent framework emitted a `gen_ai.operation.name=chat` span for the reasoning step, then a `gen_ai.operation.name=execute_tool` span for the call to `search_docs`. The framework's MCP client attached `traceparent` to the JSON-RPC `params._meta` field (per the MCP spec's metadata convention). The gateway received the call, extracted the tool name, dispatched to the tool server, and emitted its own `e...",
    "condition_of_validity": "The invariant that must hold is: **for every `execute_tool` span emitted by a gateway, there exists exactly one ancestor `chat` span in the same trace whose `gen_ai.tool.call.id` matches, and the gateway span's `parent_span_id` equals the client tool-call span's `span_id`.** This holds only when three conditions are simultaneously true: - The framework's pro...",
    "decision_boundary": "The boundary is whether your compliance harness treats the trace as a **set of spans** or as a **graph**. If it iterates spans and asserts attributes, you are on the wrong side of the boundary for causal conformance and must add a graph assertion pass. The graph pass must: 1. Group spans by `trace_id`; assert exactly one trace per logical task (or an explici...",
    "operational_effect": "The practical consequence is silent degradation of replay and audit fidelity. An auditor agent that walks the trace to reconstruct \"what did the model see when it decided to call this tool\" gets a truncated chain and either fails closed (marks inconclusive) or, worse, fails open (attributes the tool error to the wrong step). The latter produces confidently w..."
  },
  "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": "87ecfacc13784d4cfc06114eeee9cb0c43a46340ad6983be677a88deeba04810",
    "verified_classes": [
      "TraceGraphConformanceError",
      "Span"
    ],
    "verified_functions": [
      "assert_causal_linkage",
      "run_compliance"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "TraceGraphConformanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing",
      "uuid"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
