{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-semantic-convention-drift-when-an-eval-harness-s-span-attributes-silently-re-type-between-opentelemetry-sdk-versions",
  "title": "How should an instance detect semantic-convention drift when an eval harness's span attributes silently re-type between OpenTelemetry SDK versions",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent/LLM observability pipelines where span-level eval harnesses assert on GenAI semantic-convention attributes (`genai.*`) emitted by an OpenTelemetry SDK, and where the SDK minor version is not pinned across the fleet. Does not apply to harnesses that parse raw OTLP protobuf without attribute type coercion, nor to single-process test rigs that never cross an SDK boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-semantic-convention-drift-when-an-eval-harness-s-span-attributes-silently-re-type-between-opentelemetry-sdk-versions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-semantic-convention-drift-when-an-eval-harness-s-span-attributes-silently-re-type-between-opentelemetry-sdk-versions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-semantic-convention-drift-when-an-eval-harness-s-span-attributes-silently-re-type-between-opentelemetry-sdk-versions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1690,
    "python_slice_tokens": 364,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"an attribute went missing\" and it is not \"the schema changed.\" It is **type coercion under an unchanged attribute key**. The GenAI semantic conventions define `genai.usage.input_tokens` as an integer count and `genai.request.model` as a string, but the OTel attribute model permits a value to be carried as `int`, `double`, or `string` depe...",
    "what_was_observed": "A span-level eval harness asserted, per span, that `genai.usage.input_tokens` equals a golden integer and that `genai.usage.total_tokens == input_tokens + output_tokens`. On SDK 1.24.0 the spans arrived with `input_tokens` as `int`. On SDK 1.25.1 (a minor bump taken to pick up a fix in an unrelated exporter), the same instrumented agent emitted `input_tokens` as `double` — the encoder had begun routing integer attrib...",
    "condition_of_validity": "The harness's PASS is valid only when all of the following hold: - The attribute's declared type in the pinned semantic-convention version matches the runtime type of the value read from the span. - The SDK version is pinned to a version whose encoder is known not to promote numeric types across a batch. - No sibling span in the same export batch carries a n...",
    "decision_boundary": "The boundary is between two harness postures: - **Value-conformance posture:** assert `actual == expected`. Cheap, tolerant of encoder noise, and — critically — blind to the exact class of drift this record describes. - **Type-conformance posture:** assert `actual == expected and type(actual) is type(expected)`. Rejects the re-typed span at the boundary, bef...",
    "operational_effect": "Enforcing the type-conformance posture converts a silent three-day reconciliation gap into a span-level failure at the first batch that promotes types. The harness's verdict set becomes `{PASS, MISSING, TYPE_DRIFT, VALUE_MISMATCH}`. `TYPE_DRIFT` is the load-bearing new verdict: it fires when the key exists, the value equals the expected value under `==`, but..."
  },
  "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": "fd5574efb2dc3e2c256e447a2960fc6c7f0c4f0961b12f106a5d426a9260adae",
    "verified_classes": [
      "Verdict",
      "SemanticConventionDrift",
      "Golden"
    ],
    "verified_functions": [
      "assert_span_conforms",
      "run_harness"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SemanticConventionDrift"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
