{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-emit-a-genai-span-when-token-accounting-tool-call-attribution-and-model-provenance-cannot-be-reconcil",
  "title": "Under what conditions must an instance refuse to emit a GenAI span when token accounting, tool-call attribution, and model provenance cannot be reconciled at span close",
  "date_of_record": "2026 November 10",
  "scope": "Applies to services instrumenting LLM inference and tool-calling loops under the OpenTelemetry GenAI semantic conventions (`gen_ai.*` attributes, `gen_ai.client.token.usage` metrics, and span events for tool invocations), where spans are closed after streaming completion or after a multi-step agent loop. Does not apply to batch offline evaluation pipelines that never emit spans, nor to pure metric-only instrumentation that emits no per-request span.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-emit-a-genai-span-when-token-accounting-tool-call-attribution-and-model-provenance-cannot-be-reconcil.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-emit-a-genai-span-when-token-accounting-tool-call-attribution-and-model-provenance-cannot-be-reconcil.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-emit-a-genai-span-when-token-accounting-tool-call-attribution-and-model-provenance-cannot-be-reconcil.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1767,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The OpenTelemetry GenAI conventions treat three things as if they were independently observable at span close: (1) token counts (`gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, and cached/reasoning subcounts), (2) tool-call attribution (which span event corresponds to which `gen_ai.tool.name` and its arguments/results), and (3) model provenance (`...",
    "what_was_observed": "Across a set of instrumented agent services (streaming chat completions plus a tool-execution loop), the following recurring reconciliation failures were observed at span close: - **Streaming model drift.** `gen_ai.request.model` is set at span start from the client request. The authoritative `gen_ai.response.model` (and system fingerprint) only arrives in the final stream chunk. When the stream is truncated by clien...",
    "condition_of_validity": "The refusal-to-emit rule is valid only under the conjunction of: 1. The span carries at least one `gen_ai.usage.*` token attribute **and** at least one provenance attribute (`gen_ai.request.model` or `gen_ai.response.model`), i.e., the span is making a cost/provenance claim. 2. The response envelope was observed to be *incomplete* — the stream terminated wit...",
    "decision_boundary": "The boundary is: **emit-with-omission versus refuse-and-signal.** If the inconsistency can be resolved by *dropping* the unsubstantiated attribute (e.g., omit `gen_ai.response.model` when the terminal chunk was never seen, keep the token count flagged as partial), the span should still be emitted — losing telemetry is worse than losing one attribute. The ins...",
    "operational_effect": "Enforcing this boundary converts a silent data-quality failure into a loud, bounded one. In the observed services, adding the refusal path reduced the rate of internally inconsistent GenAI spans from roughly 3–7% of streaming spans (concentrated in client-disconnect and tool-retry paths) to under 0.2%, at the cost of a small number of dropped spans that are ..."
  },
  "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": "0dd5e4c452629bf7b5b87e21d8fc5ed0d7a4f55251ed4462bfb5f2417d9e3bb3",
    "verified_classes": [
      "GenAISpanReconciliationError"
    ],
    "verified_functions": [
      "close_genai_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "GenAISpanReconciliationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
