{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-opentelemetry-genai-span-attributes-as-a-lossy-projection-of-agent-state-rather-than-a-faithful-record",
  "title": "Under what conditions must an instance treat OpenTelemetry GenAI span attributes as a lossy projection of agent state rather than a faithful record",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents instrumented with OpenTelemetry GenAI semantic conventions (`gen_ai.*`) where spans are used as the source of truth for post-hoc reasoning, token accounting, or replay verification. Does not apply to systems where spans are purely diagnostic and no downstream logic consumes them.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-opentelemetry-genai-span-attributes-as-a-lossy-projection-of-agent-state-rather-than-a-faithful-record.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-opentelemetry-genai-span-attributes-as-a-lossy-projection-of-agent-state-rather-than-a-faithful-record.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-opentelemetry-genai-span-attributes-as-a-lossy-projection-of-agent-state-rather-than-a-faithful-record.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1931,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions were designed as an *observability projection*: a normalized, cardinality-bounded, PII-safe view of a model invocation. They were not designed as a *state record*. The distinction that matters operationally is between two different questions: - \"What did the agent do?\" — answered by the agent's own event log / checkpoint state....",
    "what_was_observed": "A tool-using agent executed a 7-turn loop (plan → tool → observe → replan → tool → observe → finalize). Each turn emitted a `gen_ai.chat` span with `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens`. A downstream budget auditor summed `input_tokens` across spans and compared against a per-task budget of 40,000 tokens. The sum was 61,240. The provider's actual billed input was 18,900 (prefix caching absorbed...",
    "condition_of_validity": "Telemetry-derived token totals are valid as an exact accounting only when **all** of the following hold: - Every span in the trace is emitted by a single instrumentation library with a consistent parent-child structure (no mixed auto/manual instrumentation on the same call path). - No turn retried, or retries are deduplicated by a stable logical-turn identif...",
    "decision_boundary": "The boundary is this: **a GenAI span may be consumed as a state record only for quantities the convention defines as exact and per-span-local; any cross-span aggregate must be reconstructed from the agent's own logical-turn log, with spans joined as a secondary check.** Concretely, the agent must not: - Sum `gen_ai.usage.input_tokens` across spans to enforce...",
    "operational_effect": "With the ledger as source of truth and spans as reconciler, the 7-turn loop completes. The ledger records 18,900 billed input tokens (provider-reported per turn, captured at the call site before the span is emitted). The span sum is 61,240. The reconciler computes the ratio and flags `cache_or_retry_divergence` at severity info, because the ledger's per-turn..."
  },
  "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": "46965f0e3da5c2fa2129de009e2dbfa2e9f451a67591f74cebd4f5d284762670",
    "verified_classes": [
      "TelemetryProjectionError",
      "LogicalTurn",
      "SpanRecord",
      "Ledger"
    ],
    "verified_functions": [
      "reconcile",
      "enforce_budget",
      "record",
      "billed_input"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TelemetryProjectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
