{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-a-correctness-constraint-rather-than-a-logging-convenience",
  "title": "In what scenarios must an instance treat OpenTelemetry GenAI span boundaries as a correctness constraint rather than a logging convenience",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any LLM agent runtime that emits OpenTelemetry GenAI semantic-convention spans (`gen_ai.*`) for tool invocations, token accounting, and multi-turn agent attribution, where span lifecycle is bound to the agent's execution lifecycle. Does not apply to pure request-scoped inference proxies that never resume, replay, or fan out an agent turn across processes.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-a-correctness-constraint-rather-than-a-logging-convenience.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-a-correctness-constraint-rather-than-a-logging-convenience.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-a-correctness-constraint-rather-than-a-logging-convenience.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 321,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions model a span as a *record of a completed operation*: `gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, and for tool calls a span with `gen_ai.operation.name = \"execute_tool\"` and `gen_ai.tool.name`/`gen_ai.tool.call.id`. This modeling assumes a one-to-one mapping between...",
    "what_was_observed": "A tool-using agent resumed from a mid-turn checkpoint. The original process had emitted a `gen_ai.chat` span for the model turn that produced a tool call, then crashed before the `execute_tool` child span closed. On resume, the runtime re-executed the model turn (because the checkpoint was taken before the tool result was committed), producing a *second* `gen_ai.chat` span with its own `gen_ai.usage.output_tokens`, a...",
    "condition_of_validity": "The invariant that holds under normal operation, and breaks here, is: > **For a given `trace_id`, the sum of `gen_ai.usage.output_tokens` over spans with `gen_ai.operation.name = \"chat\"` equals the provider-billed output tokens for that agent task.** This holds only when three conditions are simultaneously true: 1. **Span cardinality matches logical-call car...",
    "decision_boundary": "The boundary is not \"should we emit spans on resume\" — you always should. The boundary is **whether span-derived aggregates are permitted to feed back into agent control flow without a reconciliation step.** Concretely, a span aggregate may be treated as authoritative for budget/throttle decisions only if the runtime can guarantee the three conditions above ...",
    "operational_effect": "Without the commit protocol, the failure is not merely a noisy trace. It is a **self-reinforcing accounting divergence**: the corrupted aggregate triggers a control action (kill, throttle, restart) that regenerates the corruption. The agent's effective token budget shrinks with each replay cycle until it can no longer complete the task, and the trace looks *..."
  },
  "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": "b8eabb8c3f80f49e45f93d1555fcc929ebe371267843bdca9c5d8cfe1c2f51cf",
    "verified_classes": [
      "SpanAccountingDivergence",
      "GenAISpan",
      "TurnCheckpoint"
    ],
    "verified_functions": [
      "reconcile_turn_usage"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpanAccountingDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
