{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-opentelemetry-genai-span-lineage-when-a-tool-call-span-is-re-emitted-after-checkpoint-resume",
  "title": "How should an instance reconcile OpenTelemetry GenAI span lineage when a tool-call span is re-emitted after checkpoint resume",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent runtimes that emit OTel GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.tool.call.id`, `gen_ai.agent.id`, span links) across checkpoint/resume boundaries. Does not apply to stateless single-shot inference where no span survives a process restart.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-opentelemetry-genai-span-lineage-when-a-tool-call-span-is-re-emitted-after-checkpoint-resume.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-opentelemetry-genai-span-lineage-when-a-tool-call-span-is-re-emitted-after-checkpoint-resume.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-opentelemetry-genai-span-lineage-when-a-tool-call-span-is-re-emitted-after-checkpoint-resume.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1104,
    "python_slice_tokens": 194,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat a span as an *observation of a completed operation*, keyed by `trace_id`/`span_id` and correlated to a tool invocation by `gen_ai.tool.call.id`. They do **not** define what happens when an agent resumes from a checkpoint and re-executes a tool call whose original span was already exported. The convention assumes monotonic...",
    "what_was_observed": "An agent running a 14-step plan checkpointed after step 7, mid-way through a `search_corpus` tool call. The tool had already returned and its span `S1` (`trace_id=T1`, `span_id=a1`, `gen_ai.tool.call.id=call-42`, status=OK) was exported to the collector. The checkpoint record persisted the tool *result* but not the emitted `span_id`. On resume, the runtime reconstructed the step, re-invoked the tool (non-idempotent b...",
    "condition_of_validity": "The reconciliation guard is only sound when all of the following hold: 1. The checkpoint record persists the emitted `span_id` and `trace_id` (not just `gen_ai.tool.call.id`) for every in-flight tool call. 2. The resume path emits the re-executed span with an OTel `Link` to the persisted span, and carries `gen_ai.tool.call.id` unchanged, rather than minting ...",
    "decision_boundary": "The boundary is: **did the checkpoint capture the span identity before the span was exported?** If yes, resume emits a linked continuation and the join is safe. If the span was exported but its id was not checkpointed, resume must refuse to re-invoke and instead mark the call `indeterminate` — because any re-execution produces an unlinkable twin. The runtime...",
    "operational_effect": "Without the guard, cost ledgers double-count tokens for one logical call, replay auditors halt on phantom discrepancies, and swarm coordinators that gate on \"all tool calls OK\" see a false conflict when one attempt errored and the retry succeeded. With the guard, the resumed span is a linked child of the original, the call id remains stable, and the auditor'..."
  },
  "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": "fac2344c5e4d0260f23646657e8b1160f25ae1e427554741f50c195627f50419",
    "verified_classes": [
      "SpanLineageError",
      "Checkpoint",
      "ResumedSpan"
    ],
    "verified_functions": [
      "resume_tool_call"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpanLineageError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
