{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-trace-parentage-when-a-federated-agent-hop-rewrites-its-span-context-mid-execution",
  "title": "Why does an instance lose trace-parentage when a federated agent hop rewrites its span context mid-execution?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any multi-agent system where an orchestrator propagates a distributed trace context (W3C `traceparent`/`tracestate`, OpenTelemetry `SpanContext`, or a bespoke correlation envelope) across a hop into a runtime that does not share the orchestrator's instrumentation library or SDK version. Does not apply to single-runtime, single-SDK deployments where every span is emitted by the same tracer provider.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-parentage-when-a-federated-agent-hop-rewrites-its-span-context-mid-execution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-parentage-when-a-federated-agent-hop-rewrites-its-span-context-mid-execution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-trace-parentage-when-a-federated-agent-hop-rewrites-its-span-context-mid-execution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1883,
    "python_slice_tokens": 498,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things people conflate under \"trace correlation\": **identifier propagation** and **span-parentage preservation**. Identifier propagation is trivial — copy the `trace_id` string into the outbound call. Span-parentage preservation is the hard invariant: the child span emitted by the downstream agent must record the *upstream span's* `span_id` as ...",
    "what_was_observed": "An orchestrator (runtime A, OpenTelemetry Python SDK 1.24) dispatched a task to a tool-agent (runtime B, a Node.js service on `@opentelemetry/sdk-node` 0.50) which in turn called a verifier-agent (runtime C, a Rust service using a hand-rolled span emitter that only understood the raw W3C header). The orchestrator injected `traceparent` correctly: Runtime B parsed the header, extracted the `trace_id` (`4bf9...4736`), ...",
    "condition_of_validity": "The parentage invariant holds **only if every hop's propagator is a superset of the upstream propagator's injector and the downstream extractor is never fed a context it re-roots.** Concretely, the guardrail is: 1. The outbound `traceparent` on hop N must contain `span_id` = the **currently active** span's ID on hop N-1, not a regenerated one. 2. Extraction ...",
    "decision_boundary": "The decision an operator must make at each hop: **is this hop a continuation of the same logical operation (parent-child edge) or a causally-linked but asynchronous operation (span link)?** - Synchronous RPC / tool call → **parent-child**. The downstream span's parent must be the upstream span. - Message-queue publish/consume, or a fire-and-forget agent disp...",
    "operational_effect": "When parentage is lost, three things degrade silently and one degrades loudly: - **Silently:** critical-path latency attribution (no edges → no critical path), error-cascade tracing (you cannot walk from a failed verifier span up to the orchestrator span that should have caught it), and sampling coherence (each re-rooted span is sampled independently, so a 1..."
  },
  "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": "ce9011cccf51e91174bb262c870010b59f16f9e84431c050a159b43d08da2167",
    "verified_classes": [
      "TraceParentageViolation",
      "Span"
    ],
    "verified_functions": [
      "audit_trace_integrity",
      "propagate_hop"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TraceParentageViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "collections",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
