{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rewrites-traceparent-during-a-federated-handoff-correlation-collapse-at-the-w3c-trace-context-seam",
  "title": "What happens when an instance rewrites traceparent during a federated handoff: correlation collapse at the W3C trace-context seam",
  "date_of_record": "2026 November 28",
  "scope": "Applies to federated multi-agent workflows where an orchestrator propagates W3C `traceparent`/`tracestate` across MCP or A2A handoffs and downstream agents (or their tool-calling runtimes) may regenerate, sanitize, or \"repair\" trace headers. Does not apply to single-process agents with in-memory spans, nor to systems that use a proprietary correlation ID with no cross-vendor boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-traceparent-during-a-federated-handoff-correlation-collapse-at-the-w3c-trace-context-seam.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-traceparent-during-a-federated-handoff-correlation-collapse-at-the-w3c-trace-context-seam.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rewrites-traceparent-during-a-federated-handoff-correlation-collapse-at-the-w3c-trace-context-seam.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1767,
    "python_slice_tokens": 224,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two failure classes that look identical in a trace viewer but have opposite root causes. The first is *span loss*: a child span is never emitted, so the trace is merely incomplete—recoverable by inference from parent timing gaps. The second is *trace-ID mutation*: the downstream agent emits a valid, well-formed `traceparent` whose `trace-id` field ...",
    "what_was_observed": "A three-hop federated workflow: orchestrator `A` (vendor-hosted planner) calls agent `B` (self-hosted retrieval agent) over MCP, which calls agent `C` (third-party compliance auditor) over A2A. `A` emits: `B` receives it, correctly sets its server span's `parent-id` to `00f067aa0ba902b7`, and emits its own span with `parent-id` = its new span ID. So far correct. But `B`'s tool-calling runtime wraps outbound HTTP in a...",
    "condition_of_validity": "The correlation invariant holds only under three simultaneously-true conditions, and federated workflows routinely satisfy two of three: 1. **Propagation is forward-only and non-regenerating.** Every hop must copy the inbound `trace-id` byte-for-byte into the outbound header. Any hop that constructs a header from local state rather than from received state b...",
    "decision_boundary": "The actionable question is not \"did we lose a span\" but \"is the trace we are reading the same transaction we think it is.\" Draw the boundary here: - **If the `trace-id` at the leaf equals the `trace-id` at the root, and every `parent-id` resolves within the same trace**, the correlation is intact and you may trust causality and timing attribution. - **If a l...",
    "operational_effect": "The guardrail that actually bounds this is not a schema validator (they all pass) but a **seam assertion at every outbound handoff**: before an agent emits a request to a federated peer, it compares the `trace-id` it is about to send against the `trace-id` it received, and refuses to emit if they differ unless it has explicitly declared a new-trace boundary...."
  },
  "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": "346a303419a26c4b4e1b1edca2935875759abe4d262081b872e89f30a1898953",
    "verified_classes": [
      "TraceCorrelationFork",
      "TraceContext"
    ],
    "verified_functions": [
      "assert_forwarded",
      "handoff",
      "parse"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TraceCorrelationFork"
    ],
    "sample_fail_closed_invariants": [
      "parent-id not advanced at hop; child span would shadow parent",
      "declared new trace but reused inbound trace-id; boundary flag is inconsistent"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
