{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-causal-trace-corruption-when-opentelemetry-genai-spans-cross-agent-handoff-boundaries",
  "title": "Which invariants prevent causal trace corruption when OpenTelemetry GenAI spans cross agent handoff boundaries",
  "date_of_record": "2026 November 24",
  "scope": "Applies to multi-agent systems that emit OpenTelemetry GenAI semantic-convention spans and propagate `traceparent`/`tracestate` across agent handoffs (A2A, MCP, or custom bus). Does not cover single-process instrumentation, metrics-only pipelines, or log-based tracing without span context propagation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-corruption-when-opentelemetry-genai-spans-cross-agent-handoff-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-corruption-when-opentelemetry-genai-spans-cross-agent-handoff-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-corruption-when-opentelemetry-genai-spans-cross-agent-handoff-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2324,
    "python_slice_tokens": 415,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"causal linkage\" in a multi-agent trace, and conflating them is the root of the failure this record documents. The first is **context propagation**: the W3C `traceparent` header carrying `trace-id`, `parent-id`, and `trace-flags`. This is a *transport* invariant — it says \"these bytes were emitted in the lexical scope of tha...",
    "what_was_observed": "A three-agent pipeline: Planner → Retriever → Synthesizer. Each agent is a separate process behind an A2A endpoint. The Planner emits a span `plan.generate`, then calls the Retriever with a propagated `traceparent`. The Retriever emits `retrieve.search` with `gen_ai.operation.name=chat` (it uses an LLM to rewrite the query), returns results, then calls the Synthesizer. The Synthesizer was configured with a **batch sp...",
    "condition_of_validity": "The invariant that must hold for a GenAI trace to be causally truthful is: > **For every span S with `parent-id = P`, the span P must be exported to the same backend with the same `trace-id`, and S's `gen_ai.prompt`/input payload must be byte-identical to a value that appears in P's `gen_ai.completion`/output payload (or in P's declared outbound message attr...",
    "decision_boundary": "The decision an operator faces is whether to treat a re-parented span as a **data-quality incident** (alert, block the trace from the latency dashboard) or a **benign gap** (accept it, the causal edge is approximate). The boundary is determined by whether the downstream consumer of the trace makes *causal* claims or only *aggregate* claims. - If the trace fe...",
    "operational_effect": "The practical consequence is that **trace completeness must be verified at the consumer, not assumed from the producer.** Three concrete changes bound the failure: 1. Emit a `gen_ai.agent.handoff` span at each agent boundary, sibling to (not parent of) the downstream agent's root span, carrying `handoff.from_service`, `handoff.to_service`, and a `handoff.pay..."
  },
  "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": "e0526538bcba135b1253cbfc6419123ed9e5a8c4be71b5289a2fe43fdf374dbe",
    "verified_classes": [
      "CausalTraceIntegrityError"
    ],
    "verified_functions": [
      "validate_causal_chain",
      "aggregate_span_latency"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CausalTraceIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
