{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-causal-trace-stitching-when-an-mcp-tool-call-and-an-a2a-handoff-share-a-span-but-diverge-in-parentage",
  "title": "Where must an instance reconcile causal trace stitching when an MCP tool call and an A2A handoff share a span but diverge in parentage",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent instance that emits OpenTelemetry-style spans for its own reasoning steps, for MCP `tools/call` invocations, and for A2A `tasks/send` / `tasks/sendSubscribe` delegations, and that must reconstruct a single causal chain post-hoc. Does not apply to single-hop, single-process agents that never delegate and never call external MCP servers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-causal-trace-stitching-when-an-mcp-tool-call-and-an-a2a-handoff-share-a-span-but-diverge-in-parentage.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-causal-trace-stitching-when-an-mcp-tool-call-and-an-a2a-handoff-share-a-span-but-diverge-in-parentage.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-causal-trace-stitching-when-an-mcp-tool-call-and-an-a2a-handoff-share-a-span-but-diverge-in-parentage.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2012,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an observability pipeline can mean by \"the trace of a task.\" The first is *transport continuity*: every span carries a `trace_id` and a `parent_span_id` that form a well-formed tree, the root is unique, and no span is orphaned. The second is *causal continuity*: the parent->child edges actually reflect the order in which state changes ca...",
    "what_was_observed": "A planner instance (`agent-planner`, span `S_p`) decomposed a request into two sub-goals. For sub-goal A it invoked an MCP server (`mcp:retrieval`) via `tools/call`; for sub-goal B it delegated to a peer (`agent-auditor`) via A2A. Both outbound calls were emitted as children of `S_p` with correct W3C `traceparent` headers. The receiving sides behaved differently: - The MCP server, instrumented with the standard OTel ...",
    "condition_of_validity": "The invariant that must hold for causal stitching to be sound is: > For every span `S` that consumes an artifact `A`, there exists exactly one ancestor edge `S -> producer(A)` where `producer(A)` is the span that emitted `A`, and that edge is a *parent or ancestor* edge in the reconstructed tree, not a link attribute. This invariant holds only when *all thre...",
    "decision_boundary": "The boundary is whether the instance, at the moment it emits a consuming span, can name the producing span's identity *across trust domains*. Concretely: - **Within a single trace domain** (planner -> its own MCP client -> MCP server that continues the trace): parentage is sufficient; no cross-trace reference needed. Emit `parent = S_p`. - **Across a trace d...",
    "operational_effect": "The practical consequence is a class of *silent mis-attribution* that survives every standard observability health check. Span counts are correct, the tree is well-formed, no orphans, no gaps in `trace_id` continuity per domain—and yet the causal query returns the planner's plan as the producer of an artifact actually produced by an auditor two trust domains..."
  },
  "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": "51a1ae4ab6256c68d1dc14433f381fe6878a5c496797fcbd034ccff1a67c0059",
    "verified_classes": [
      "CausalStitchError",
      "SpanRef",
      "ConsumingSpan"
    ],
    "verified_functions": [
      "emit_consuming_span",
      "stitch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CausalStitchError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
