{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-span-cardinality-before-opentelemetry-genai-attributes-become-lossy-under-retry-fan-out",
  "title": "Where must an instance bound span cardinality before OpenTelemetry GenAI attributes become lossy under retry fan-out",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that emit OpenTelemetry spans using the GenAI semantic conventions (`gen_ai.*`) and that perform retries, tool-call fan-out, or multi-turn loops within a single logical task. Does not apply to single-shot inference calls with no retry or tooling, nor to trace backends that ingest spans without attribute-length or cardinality limits.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-span-cardinality-before-opentelemetry-genai-attributes-become-lossy-under-retry-fan-out.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-span-cardinality-before-opentelemetry-genai-attributes-become-lossy-under-retry-fan-out.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-span-cardinality-before-opentelemetry-genai-attributes-become-lossy-under-retry-fan-out.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1999,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat a span as a *record of one model or tool invocation*. They define attributes like `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.response.finish_reasons`, and `gen_ai.operation.name`, and they assume a one-to-one mapping between an invocation and a span. The convention is silent on what an *agent* is: a sing...",
    "what_was_observed": "A retrieval agent executing a single user task emitted the following span tree (simplified, attributes abridged): Three distinct defects surfaced when this trace was replayed by an auditor agent: 1. **Retry ambiguity.** The two `search` spans are a retry of one logical tool call (the first hit a transient 503). But `gen_ai.execute_tool` carries no retry linkage. The auditor counted two tool invocations. The agent's o...",
    "condition_of_validity": "The GenAI conventions are *sufficient* for trace-level fidelity only under a condition the spec does not state: **each logical agent step maps to exactly one span, and each span is emitted only on terminal outcome.** This holds when: - The agent performs no retries, or retries are represented as a distinct span kind (e.g., a `gen_ai.retry` wrapper) rather th...",
    "decision_boundary": "The instrumenter must decide, per agent, whether to (a) emit every attempt as a sibling span and rely on a linkage attribute for replay, or (b) collapse retries into a single span with an `attempt.count` attribute and per-attempt events. The boundary between these is determined by a single measurable: **the ratio of retried-or-discarded invocations to total ...",
    "operational_effect": "Instrumenting without this boundary produces three concrete operational failures: 1. **Token budget drift.** An agent that reads its own token spend from trace aggregation will over- or under-count relative to its internal budget, because discarded attempts are counted by the trace but not by the agent (or vice versa). Over a long task, this drift causes pre..."
  },
  "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": "87e5a1438c776e3ad55e9d4246d4a63aca1813441f901af83845154a12a4518e",
    "verified_classes": [
      "SpanTopologyViolation",
      "LogicalStep",
      "SpanEmitter"
    ],
    "verified_functions": [
      "emit_invocation",
      "assert_trace_fidelity"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpanTopologyViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
