{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-causality-when-opentelemetry-genai-span-attributes-are-mapped-from-a-resumed-agent-checkpoint",
  "title": "Why does an instance lose tool-call causality when OpenTelemetry GenAI span attributes are mapped from a resumed agent checkpoint?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to autonomous agents that emit OpenTelemetry spans under the GenAI semantic conventions (`gen_ai.*`) and that persist/resume execution state across process boundaries (checkpoint-restore, cold start, or handoff to a sibling worker). Does not apply to single-shot, non-resumable inference calls where the span lifecycle is fully contained in one process and one trace context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-causality-when-opentelemetry-genai-span-attributes-are-mapped-from-a-resumed-agent-checkpoint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-causality-when-opentelemetry-genai-span-attributes-are-mapped-from-a-resumed-agent-checkpoint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-causality-when-opentelemetry-genai-span-attributes-are-mapped-from-a-resumed-agent-checkpoint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1653,
    "python_slice_tokens": 202,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define span attributes that describe a *logical* generative operation (`gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.tool.name`, `gen_ai.conversation.id`). They do **not** define a durable, serializable identity for the *execution attempt* that produced those attributes. The trace/span ID...",
    "what_was_observed": "A three-step agent (plan → `search_docs` tool call → synthesize) was configured to checkpoint after every tool response. The checkpoint payload serialized the message history, the tool result, and the GenAI attribute dictionary for the in-flight span — but **not** the active `SpanContext` (`trace_id`, `span_id`, `trace_flags`). Trace of the failure: 1. **Process A, step 2 (tool call).** Agent opens span `S1` with `ge...",
    "condition_of_validity": "The invariant that must hold is: **for any logical GenAI operation that spans a checkpoint boundary, the `(trace_id, span_id)` pair recorded at span-open must be persisted in the checkpoint and re-adopted verbatim on resume — or the operation must be explicitly re-parented via a `SpanLink` carrying the prior `(trace_id, span_id)`.** This holds only when all ...",
    "decision_boundary": "The operator must decide, per checkpoint, between two mutually exclusive recovery semantics: - **Continue-in-trace (adopt prior `SpanContext`):** correct when the resumed work is the *same* attempt and the original trace is still open or acceptably extended. Preserves causal join; risks a span whose wall-clock duration spans the entire downtime (misleading l...",
    "operational_effect": "Left unguarded, the failure produces three downstream effects that are individually plausible and collectively corrosive: 1. **Audit false-negatives.** A verifier that confirms \"the tool call backing this answer executed successfully\" by walking the answer's trace finds no successful tool span under the answer's `trace_id`, and flags a correct answer as unve..."
  },
  "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": "02451e7ca9668b733599cccda8126e62d534f7de1199d5698cd3fd7dc1fff882",
    "verified_classes": [
      "SpanContextCheckpointError",
      "SpanContext",
      "GenAISpanCheckpoint"
    ],
    "verified_functions": [
      "serialize_checkpoint",
      "resume_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpanContextCheckpointError"
    ],
    "sample_fail_closed_invariants": [
      "Checkpoint lacks SpanContext; cannot continue or link trace."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
