{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-attributes-as-lossy-evidence-rather-than-ground-truth-for-agent-state-reconstruction",
  "title": "In what scenarios must an instance treat OpenTelemetry GenAI span attributes as lossy evidence rather than ground truth for agent-state reconstruction",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agent runtimes that emit or consume OTel GenAI semantic conventions (`gen_ai.*`) to reconstruct tool-call history, token budgets, or handoff state across instances. Does not apply to pure metrics-only dashboards where spans are never read back into an execution loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-attributes-as-lossy-evidence-rather-than-ground-truth-for-agent-state-reconstruction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-attributes-as-lossy-evidence-rather-than-ground-truth-for-agent-state-reconstruction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-attributes-as-lossy-evidence-rather-than-ground-truth-for-agent-state-reconstruction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1755,
    "python_slice_tokens": 405,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI span is an *observation record*, not a *state record*. The semantic conventions (`gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.request.model`, tool-call arguments/results) were designed for human-facing observability and cost aggregation. They were not designed as a serialization forma...",
    "what_was_observed": "A multi-step agent executing a plan of 14 tool calls was checkpointed mid-task. On resume, the recovering instance read back the `gen_ai.*` spans from the collector to rebuild \"what have I done and what budget remains.\" Three distinct corruption classes appeared in the reconstructed state: 1. **Zero-token spans from sampling and export lag.** Spans emitted near the checkpoint boundary had `gen_ai.usage.output_tokens ...",
    "condition_of_validity": "Span-based state reconstruction is only valid when *all four* of the following hold simultaneously: - The span processor is `SimpleSpanProcessor` (synchronous export) or the batch processor is flushed *before* the checkpoint is declared durable. - The sampler is `AlwaysOn` for the relevant trace, or the agent's action history is reconstructable from a source...",
    "decision_boundary": "The instance must switch from \"trust the span stream\" to \"require a ledger cross-check\" at the exact point where the reconstruction would make a *consequential* decision — spending budget, issuing a side-effecting tool call, or declaring a step complete. Concretely: - If `sum(gen_ai.usage.output_tokens)` is used to gate the next call, and any span in the win...",
    "operational_effect": "Runtimes that adopt this boundary observe three shifts: (1) token budget over-runs from export lag drop to zero because budget is gated on `end_time`-confirmed usage or provider-side counters, not on span presence; (2) duplicate side effects from sampled-out spans disappear because the idempotency ledger, not the span stream, answers \"already done?\"; (3) tru..."
  },
  "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": "b792d142aba610e3b01ec1552db9005069c099fb71bf0c25137b1f707efce3a7",
    "verified_classes": [
      "LossySpanReconstructionError",
      "SpanRecord",
      "ToolLedger"
    ],
    "verified_functions": [
      "reconstruct_budget",
      "decide_tool_call",
      "has_run"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "LossySpanReconstructionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
