{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-broken-causal-trace-when-head-based-sampling-splits-an-mcp-tool-call-fan-out-across-sub-agents",
  "title": "What structural signals indicate a broken causal trace when head-based sampling splits an MCP tool-call fan-out across sub-agents",
  "date_of_record": "2026 November 23",
  "scope": "Applies to runtime observability of agent systems where a parent agent dispatches MCP tool calls and sub-agents under head-based (root-decision) sampling, and where a single logical task spans multiple trace IDs due to sampling decisions made independently at each transport hop. Does not apply to tail-based sampling pipelines that buffer and decide after the full trace closes, nor to single-process agents with no sub-agent or external API boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-causal-trace-when-head-based-sampling-splits-an-mcp-tool-call-fan-out-across-sub-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-causal-trace-when-head-based-sampling-splits-an-mcp-tool-call-fan-out-across-sub-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-broken-causal-trace-when-head-based-sampling-splits-an-mcp-tool-call-fan-out-across-sub-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1598,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing spans.\" Missing spans are visible and benign. The failure is **silently orphaned causal edges**: a child span is recorded and exported, but its `parent_span_id` points to a span that was never sampled at an upstream hop, so the child appears as a new root. The trace backend stitches by `trace_id`, and because head-based sampling p...",
    "what_was_observed": "A parent agent (trace `A`) issues a parallel fan-out: two MCP tool calls and three sub-agent invocations. The parent's `traceparent` header carries `flags=01` (sampled). Observed sequence: 1. MCP server #1 honors the flag, emits child spans under trace `A`. Correct. 2. MCP server #2 is a third-party server whose SDK calls `start_as_current_span` with no `context=` argument, dropping the extracted remote context. It m...",
    "condition_of_validity": "The causal-stitching invariant holds **only if** every hop in the fan-out satisfies all three: - It extracts the inbound `traceparent` and passes it as explicit parent context (not ambient thread-local). - It honors `sampled=0` by emitting a *non-exported* span or a dropped-link marker, never by re-deciding. - Its sampler, if present, is configured `ParentBa...",
    "decision_boundary": "Do not attempt to fix this with trace-backend joins, span-linking heuristics, or timestamp-correlation stitching. Those reconstruct edges *after the fact* and cannot distinguish a genuine orphan from a legitimately independent root — they will fuse unrelated tasks. The decision boundary is: - **If** you control the hop (your MCP server, your sub-agent harnes...",
    "operational_effect": "With the boundary assertion in place, the symptom changes from \"cardinality anomaly discovered weeks later during an incident\" to a **hard failure at the seam**, surfaced as an exception on the first orphaned span. This converts a silent, load-correlated observability regression into a deterministic, per-request error that fails fast and names the offending ..."
  },
  "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": "859a02b75a6769494bf04bb13cc4eace09d1ce6c03c7bb890236a3616e02ab8c",
    "verified_classes": [
      "BrokenCausalTrace",
      "SpanContext"
    ],
    "verified_functions": [
      "start_span",
      "_new_span_id",
      "_new_trace_id"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "BrokenCausalTrace"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "secrets",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
