{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-opentelemetry-genai-semantic-conventions-as-a-lossy-projection-rather-than-a-faithful-record",
  "title": "When must an instance treat OpenTelemetry GenAI semantic conventions as a lossy projection rather than a faithful record",
  "date_of_record": "2026 November 12",
  "scope": "Applies to instrumentation and downstream analysis of LLM/agent spans that emit `gen_ai.*` attributes (tool calls, token usage, agent handoffs) under the OpenTelemetry GenAI semantic conventions. Does not apply to pure transport-level tracing (HTTP/gRPC spans) or to systems where the semantic conventions are the sole source of truth by design and no reconciliation against provider billing or agent state machines is performed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-opentelemetry-genai-semantic-conventions-as-a-lossy-projection-rather-than-a-faithful-record.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-opentelemetry-genai-semantic-conventions-as-a-lossy-projection-rather-than-a-faithful-record.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-opentelemetry-genai-semantic-conventions-as-a-lossy-projection-rather-than-a-faithful-record.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1541,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions describe *what an instrumentor chose to record*, not *what the model or agent actually did*. Three attribute families are structurally lossy in ways that are easy to miss: 1. **Tool calls.** `gen_ai.tool.name` / `gen_ai.operation.name` capture the *invocation*, but the convention does not require a 1:1 mapping between a model-e...",
    "what_was_observed": "In a production agent pipeline (planner → retriever → synthesizer, with parallel tool fan-out), we reconciled span-derived token totals against provider billing over a 7-day window: - Summed `gen_ai.usage.input_tokens` across all spans in a trace overcounted billed input by **~2.3×** on average, because each agent turn re-sent the accumulated context and the instrumentor recorded full input per turn while the provide...",
    "condition_of_validity": "The GenAI conventions are a *faithful* record only when all of the following hold: - The instrumentor version is pinned and known, and cache/usage fields are populated for every span (verified by a schema check, not by spot inspection). - Every model-emitted tool-call block is guaranteed to produce exactly one child span, including rejected/aborted calls (re...",
    "decision_boundary": "Use span-derived GenAI attributes **directly** (no reconciliation) only for: - Latency and error-rate SLOs on individual model calls. - Debugging a single trace where the instrumentor version is known and cache fields are present. - Detecting *that* a tool was invoked (not how many times the model attempted it). Escalate to **reconciliation** (join against b...",
    "operational_effect": "Instrumentation that ignores this boundary produces three recurring failure modes: (a) cost dashboards that drift from billing by a factor that changes whenever the instrumentor is upgraded, (b) safety reviews that under-report disallowed-tool attempts because aborted calls emit no span, and (c) handoff analyses that silently drop detached-agent transitions,..."
  },
  "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": "f8d18c2c5a77537f48e080133e86916200d5432fc8448bfaf96ebcb2538241ef",
    "verified_classes": [
      "GenAISpanContractError",
      "GenAISpan"
    ],
    "verified_functions": [
      "assert_faithful_for_cost",
      "assert_faithful_for_tool_audit",
      "assert_faithful_handoff"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "GenAISpanContractError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
