{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-the-actual-tool-call-transcript-and-what-breaks-when-it-trusts-token-accou",
  "title": "When must an instance reconcile OpenTelemetry GenAI span attributes against the actual tool-call transcript, and what breaks when it trusts token accounting alone",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent runtime that emits `gen_ai.*` spans per the OpenTelemetry GenAI semantic conventions for tool invocation and token accounting, and that uses those spans as the authoritative record of what an agent did. Does not cover distributed trace sampling policy or backend exporter reliability.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-the-actual-tool-call-transcript-and-what-breaks-when-it-trusts-token-accou.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-the-actual-tool-call-transcript-and-what-breaks-when-it-trusts-token-accou.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-the-actual-tool-call-transcript-and-what-breaks-when-it-trusts-token-accou.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1773,
    "python_slice_tokens": 271,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI span is a *claim* about execution, not the execution. The `gen_ai.usage.input_tokens` / `output_tokens` attributes, the `gen_ai.tool.name` and `gen_ai.tool.call.id` fields, and the parent `gen_ai.operation.name` links describe an intended call graph. The tool-call transcript (the actual request/response bytes handed to and returned from the tool exec...",
    "what_was_observed": "A planning agent issued a `gen_ai.tool` span for a retrieval tool with `gen_ai.usage.input_tokens=1840`, `output_tokens=612`, and a single `gen_ai.tool.call.id`. The span closed with `status=OK`. On resume from a checkpoint keyed to that span ID, the agent replayed its reasoning assuming the retrieval returned 612 tokens of usable context. The transcript showed the tool executor had actually made three attempts: the ...",
    "condition_of_validity": "The \"trust the span\" rule holds only when all of the following are true, and each is independently falsifiable: 1. **Attempt count equals span count.** The tool executor emits exactly one span per network attempt, or the span carries an attempt counter (`gen_ai.tool.call.attempt` or equivalent custom attribute) and the usage attributes are the *sum* across a...",
    "decision_boundary": "The boundary is between **accounting** and **attestation**. - Below the boundary (accounting): the span's token counts are used for cost dashboards, rate-limit backpressure, and budget projection. Here, a 10% drift is tolerable and span-only trust is fine. - Above the boundary (attestation): the span's attributes are used to (a) reconstruct agent state on re...",
    "operational_effect": "Without reconciliation, three failure modes compound: 1. **Budget overrun on resume.** The agent under-counts consumed tokens (retries are invisible) and over-allocates the remaining window, causing mid-task eviction of the checkpoint summary—the exact state it needed. The failure surfaces as a reasoning divergence, not as a token error, so it is misdiagnose..."
  },
  "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": "9954ab6537ff2577db73fe78c9d05037d124b6dec96d71aea8bfdd1a728e8d1c",
    "verified_classes": [
      "SpanTranscriptMismatch",
      "GenAISpan",
      "ToolTranscript"
    ],
    "verified_functions": [
      "reconcile",
      "commit_checkpoint"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "SpanTranscriptMismatch"
    ],
    "sample_fail_closed_invariants": [
      "transcript truncated but span finish_reasons omits 'length'; span falsely reports completeness",
      "span marked failed; agent must not checkpoint on failed span"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
