{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-trace-context-collapse-when-a-federated-agent-mesh-crosses-a-vendor-boundary-that-rewrites-span-identity",
  "title": "Which invariants prevent trace-context collapse when a federated agent mesh crosses a vendor boundary that rewrites span identity",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-hop agent meshes where a reasoning trace (LLM call, tool invocation, sub-agent delegation) is correlated across at least one organizational or vendor trust boundary via a propagated trace context (W3C `traceparent`/`tracestate`, or a vendor-proprietary equivalent). Does not apply to single-vendor, single-tenant meshes where span IDs are allocated by one authoritative emitter and no intermediary is permitted to rewrite them.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-context-collapse-when-a-federated-agent-mesh-crosses-a-vendor-boundary-that-rewrites-span-identity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-context-collapse-when-a-federated-agent-mesh-crosses-a-vendor-boundary-that-rewrites-span-identity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trace-context-collapse-when-a-federated-agent-mesh-crosses-a-vendor-boundary-that-rewrites-span-identity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2128,
    "python_slice_tokens": 275,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A distributed trace is not a log stream with a shared key. It is a *causal DAG whose edges are asserted, not observed*. Each hop does not prove that span B was caused by span A; it merely carries a claim that A's context was the parent of B. In a homogeneous mesh, that claim is cheap because one SDK allocates and propagates it under one policy. At a **vendor...",
    "what_was_observed": "A planner agent (vendor A) delegates a retrieval-and-summarize task to an executor agent (vendor B) over an A2A bridge. Vendor B's runtime is configured to treat each inbound task as a *new root transaction* for its own billing and quota accounting, and consequently emits its spans under a freshly generated `trace_id`. The bridge is a thin HTTP proxy that forwards the inbound `traceparent` header but does not assert ...",
    "condition_of_validity": "The \"preserve `trace_id`, trust inbound `traceparent`\" rule is only valid when **all** of the following hold, and it must be *checked at the boundary*, not assumed: - The receiving runtime is configured to accept externally-issued parent context (`OTEL_PROPAGATORS` includes the inbound format; the SDK's trust policy permits foreign `trace_id`). Absent this, ...",
    "decision_boundary": "The operational decision is: **when a boundary cannot be trusted to preserve context, do you (a) refuse the handoff, (b) accept it but downgrade the trace to \"linked, not parented,\" or (c) accept it and synthesize a parent edge?** - **(a) Refuse** is correct when the trace is load-bearing for a security or accounting decision (warrant propagation, delegation...",
    "operational_effect": "Enforcing the invariant changes three things in practice. First, the delegating agent must carry a small **handoff ledger**: for each delegation, the outbound `trace_id`/`span_id` and the expected child identity, checked on return. A mismatch is not a task failure—the task may have succeeded—but it is a *correlation failure* that must be surfaced separately,..."
  },
  "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": "0b34a457fd74e34875eede7e4f9d717adfcf4f58b061bdd60408c699064b210d",
    "verified_classes": [
      "TraceCorrelationCollapse",
      "SpanRef",
      "HandoffRecord"
    ],
    "verified_functions": [
      "assert_correlation_intact",
      "reconcile_handoff"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceCorrelationCollapse"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
