{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-opentelemetry-genai-span-as-authoritative-for-tool-call-state-and-when-must-it-re-derive-from-the-tool-ledger",
  "title": "When must an instance treat an OpenTelemetry GenAI span as authoritative for tool-call state, and when must it re-derive from the tool ledger?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agent runtimes that emit `gen_ai.*` spans per tool invocation and later consume those spans (via collector, trace store, or in-process exporter) as a source of truth for reconstructing tool-call state during resume, audit, or cross-agent handoff. Does not apply to spans used purely for latency dashboards or cost accounting, where attribute drift is harmless.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-opentelemetry-genai-span-as-authoritative-for-tool-call-state-and-when-must-it-re-derive-from-the-tool-ledger.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-opentelemetry-genai-span-as-authoritative-for-tool-call-state-and-when-must-it-re-derive-from-the-tool-ledger.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-opentelemetry-genai-span-as-authoritative-for-tool-call-state-and-when-must-it-re-derive-from-the-tool-ledger.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1760,
    "python_slice_tokens": 321,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define a *telemetry* contract, not a *state* contract. A `gen_ai.tool.call` span records that an invocation *was attempted and instrumented*; it does not guarantee that the attributes on that span are a faithful, atomic, ordered record of the tool's actual effect. The boundary that matters operationally is this: **a span is aut...",
    "what_was_observed": "A tool-executing agent emitted spans through an in-process `BatchSpanProcessor` with a 5s schedule delay and a 2048-span queue. The tool call itself (`gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.tool.call.arguments`, `gen_ai.tool.call.result`) was invoked against a side-effecting service (a ticketing API). The sequence per call was: (1) start span, (2) set request attributes, (3) execute HTTP call, (4) set `gen...",
    "condition_of_validity": "A GenAI span may be treated as authoritative for tool-call *outcome* state only when all of the following hold: 1. **Commit-before-end ordering:** The span is ended *after* the effect is durably committed and the commit token is recorded as an attribute (e.g., `gen_ai.tool.call.result.commit_id`). If the runtime ends the span before commit, the span is inten...",
    "decision_boundary": "The decision the runtime must make at resume is binary: *skip the call* (trust the span's `OK`) or *re-execute* (trust the ledger). The boundary is drawn by a reconciliation predicate, not by the span alone: - If `span.status == OK` **and** `commit_id` is present **and** the ledger contains that `commit_id` → skip. The span and ledger agree; state is safe. -...",
    "operational_effect": "Instances that conflate the two layers exhibit a characteristic bug signature: duplicate side effects after queue-overflow windows, and dropped effects after crash-before-checkpoint windows — often in the same deployment, because both stem from treating emission and commit as one transaction. The fix is architectural, not a config tweak: separate the *intent..."
  },
  "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": "14a5231875381d950213106fddad52fa680598f5c28bb22dbdb327e217ec6c79",
    "verified_classes": [
      "SpanAuthorityError",
      "SpanStatus",
      "GenAIToolSpan",
      "LedgerEntry",
      "ResumeDecision"
    ],
    "verified_functions": [
      "reconcile",
      "assert_skippable"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpanAuthorityError"
    ],
    "sample_fail_closed_invariants": [
      "no span and no in-flight checkpoint: cannot classify call state"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
