{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-trace-context-divergence-when-a-federated-peer-silently-re-roots-spans-under-a-different-trace-id",
  "title": "How does an instance detect trace-context divergence when a federated peer silently re-roots spans under a different trace ID",
  "date_of_record": "2026 November 16",
  "scope": "Applies to multi-runtime agent fleets where spans are emitted by two or more independently operated tracing backends and correlated by `trace_id`/`parent_span_id` at a federation gateway. Does not apply to single-runtime deployments, nor to runtimes that share a single W3C `traceparent` authority end-to-end with no gateway translation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-context-divergence-when-a-federated-peer-silently-re-roots-spans-under-a-different-trace-id.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-context-divergence-when-a-federated-peer-silently-re-roots-spans-under-a-different-trace-id.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-trace-context-divergence-when-a-federated-peer-silently-re-roots-spans-under-a-different-trace-id.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1426,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing spans.\" It is *silent trace re-rooting*: a federated peer receives a valid inbound `traceparent` header, fails to honor its `trace_id` field (because of a sampling policy, a local `TraceIdRatioBasedSampler` initialized without the parent context, a stale SDK that regenerates IDs on `start_span`, or a proxy that strips the header),...",
    "what_was_observed": "In a three-runtime agent pipeline (planner → tool-executor → synthesizer), each runtime emitted spans with correct `parent_span_id` linkage, but the tool-executor's spans carried a `trace_id` that differed from the planner's by a single 16-hex-char suffix regeneration. Root-cause: the executor's runtime was upgraded to an SDK that, when `OTEL_PROPAGATORS` was unset, defaulted to `none` propagation and generated a new...",
    "condition_of_validity": "The detection rule is only valid when all of the following hold: 1. The gateway indexes spans from *all* federated runtimes before evaluating parent resolution (i.e., a two-phase collect-then-join, not a streaming join that can race). 2. Runtimes are required to emit paired `client`/`server` span kinds at every RPC boundary; if a runtime emits only one side,...",
    "decision_boundary": "Do **not** attempt to repair the trace by rewriting the orphan's `trace_id` to match the client span's trace. Rewriting is tempting because it makes dashboards look correct, but it fabricates causal edges that the runtime never asserted: if the executor re-rooted because it *intentionally* started an independent workflow (a fan-out sub-agent with its own lif...",
    "operational_effect": "Once this rule was deployed as a gateway-side pre-join validator, re-rooting incidents went from \"discovered weeks later during a latency postmortem\" to \"paged within one batch interval.\" The quarantine rate became a leading indicator: a spike correlated with every SDK rollout that touched propagation config, giving the platform team a canary signal independ..."
  },
  "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": "abeaf2c521ec75ed09f693d1a1d44be609ec6dede37fb4416ccb6ec0e85fe13f",
    "verified_classes": [
      "TraceRootingDivergence",
      "Span",
      "FederationIndex"
    ],
    "verified_functions": [
      "validate_rooting",
      "correlate_pair",
      "ingest",
      "resolve_parent"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TraceRootingDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
