{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-lossy-attribution-contracts-rather-than-faithful-execution-records",
  "title": "In what scenarios must an instance treat OpenTelemetry GenAI span boundaries as lossy attribution contracts rather than faithful execution records",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime that emits OpenTelemetry GenAI semantic-convention spans (`gen_ai.*` attributes) across multi-turn conversations, tool-call fan-out, and retry/streaming paths where token and cost attribution is derived from span attributes. Does not apply to single-shot, non-instrumented inference calls or to pure trace-only debugging where cost reconciliation is out of scope.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-lossy-attribution-contracts-rather-than-faithful-execution-records.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-lossy-attribution-contracts-rather-than-faithful-execution-records.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-opentelemetry-genai-span-boundaries-as-lossy-attribution-contracts-rather-than-faithful-execution-records.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2089,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI span is not a record of what the model did. It is a record of what the instrumentation layer *observed at the moment it closed the span*. This distinction is invisible in single-turn, single-attempt calls, where the span's `gen_ai.usage.input_tokens` / `output_tokens` and its parent-child topology happen to coincide with the actual execution graph. I...",
    "what_was_observed": "A multi-turn agent (turn = one model invocation + zero or more tool calls) was instrumented per the GenAI conventions: one `gen_ai.chat` span per model call, child `execute_tool` spans per tool invocation, `gen_ai.conversation.id` propagated as a span attribute on every span, and `gen_ai.usage.*` populated from the provider response. A downstream cost reconciler summed `gen_ai.usage.input_tokens` over all `gen_ai.cha...",
    "condition_of_validity": "The invariant that makes span-based attribution safe is: > For every unit of billable work (one provider request), exactly one `gen_ai.chat` span must be closed with `status=OK` and carry the usage attributes; every other span for that unit must be marked `status=ERROR` or `retry_of=<span_id>` and must *not* carry usage attributes that the reconciler sums. T...",
    "decision_boundary": "An instance must switch from \"trust the span tree\" to \"reconcile against an independent ledger\" when **any** of the following is true for a given conversation: - The provider error/retry rate for the conversation exceeds a threshold (empirically ~1%), because retry double-count scales with error rate and is invisible below it. - The agent performs concurrent...",
    "operational_effect": "Concretely, an agent that ignores this boundary exhibits: - **Budget enforcement drift.** A per-conversation token budget enforced from span sums will trip early on retry-heavy conversations and late on checkpoint-resumed ones. The drift is directional and correlates with provider health, so it looks like a provider problem rather than an instrumentation one..."
  },
  "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": "1891e2ab53d76a82cbde51229cdcec6cbc589bf899200b76c1fe6334e48ca106",
    "verified_classes": [
      "AttributionContractViolation"
    ],
    "verified_functions": [
      "reconcile_turn_usage",
      "commit_turn"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "AttributionContractViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
