{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-reject-a-genai-span-whose-token-accounting-attributes-were-derived-from-a-different-model-than-the-one-named-in",
  "title": "Under what conditions must an instance reject a GenAI span whose token-accounting attributes were derived from a different model than the one named in `genai.request.model`?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent runtime that emits OpenTelemetry GenAI spans where `genai.usage.input_tokens`/`output_tokens` may be populated by a router, proxy, or sidecar that is not the component that executed the inference. Does not apply to single-model, single-process instrumentation where the executing client and the span emitter are the same object and no routing layer sits between them.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-reject-a-genai-span-whose-token-accounting-attributes-were-derived-from-a-different-model-than-the-one-named-in.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-reject-a-genai-span-whose-token-accounting-attributes-were-derived-from-a-different-model-than-the-one-named-in.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-reject-a-genai-span-whose-token-accounting-attributes-were-derived-from-a-different-model-than-the-one-named-in.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1887,
    "python_slice_tokens": 379,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat `genai.request.model` and `genai.usage.*_tokens` as attributes of *one* span describing *one* inference call. They are not independently trustworthy fields. The non-obvious failure is a **provenance split**: a routing layer (a model gateway, a fallback wrapper, a speculative-decoding proxy) rewrites the request to a diffe...",
    "what_was_observed": "A tool-calling agent routed through a gateway that implements \"cheap-first, escalate-on-failure\" fallback. The caller requested `genai.request.model = \"frontier-large\"`. The gateway attempted the call on `small-cheap`, the tool schema negotiation failed on the first attempt (the small model emitted a malformed arguments object), the gateway silently retried against `frontier-large`, and the call succeeded. The emitte...",
    "condition_of_validity": "The invariant: **for a GenAI span to be a valid measurement, the tuple (`genai.request.model`, `genai.response.model`, `genai.usage.input_tokens`, `genai.usage.output_tokens`) must all describe the same single inference execution.** This is a *conjunctive* condition. It does not hold when any of the following is true: 1. The span aggregates token counts acro...",
    "decision_boundary": "The emitter must decide, at span-close time, between *accept*, *split*, and *relabel*. The decision hinges on whether the emitter can prove single-model provenance: - If the emitter is the executing client and no routing hop exists → accept. The tuple is trivially coherent. - If a routing hop exists and the emitter can observe per-attempt model + per-attempt...",
    "operational_effect": "Downstream consumers of GenAI spans — cost ledgers, context-window budgeters, model-quality regression harnesses, and routing-policy learners — all assume per-model attribution. A blended-count span poisons each differently: - **Cost ledgers** over- or under-charge by the price ratio between the models involved (here ~15×). - **Context budgeters** over-count..."
  },
  "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": "8892c844d5103a327575edd57f8dd6347d5e60b62e946f0a442d0f3329bb96c8",
    "verified_classes": [
      "GenAISpanProvenanceError",
      "Attempt",
      "GenAISpan"
    ],
    "verified_functions": [
      "validate_and_emit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "GenAISpanProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
