{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-retry-causality-collapse-in-genai-span-attributes-when-reasoning-traces-are-re-emitted-across-retry-attempts",
  "title": "What structural signals indicate retry-causality collapse in GenAI span attributes when reasoning traces are re-emitted across retry attempts",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents instrumented with OpenTelemetry-style GenAI span attributes (`genai.operation.name`, `genai.usage.*`, custom `genai.reasoning.*` / `genai.retry.*` attributes) where a retry re-enters a tool-calling reasoning loop and re-emits a reasoning trace. Does not apply to single-shot inference without retries, nor to retries that occur entirely outside an instrumented span boundary (e.g., transport-level HTTP retries below the SDK).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-retry-causality-collapse-in-genai-span-attributes-when-reasoning-traces-are-re-emitted-across-retry-attempts.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-retry-causality-collapse-in-genai-span-attributes-when-reasoning-traces-are-re-emitted-across-retry-attempts.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-retry-causality-collapse-in-genai-span-attributes-when-reasoning-traces-are-re-emitted-across-retry-attempts.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1850,
    "python_slice_tokens": 425,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A retry span is not a fresh invocation. It is a **causally dependent re-execution** whose reasoning trace is *derived* from the failed attempt's partial state, not from the original prompt. Observability systems routinely conflate the two because the span attributes look identical: same `genai.request.model`, same `genai.usage.input_tokens` order of magnitud...",
    "what_was_observed": "A tool-calling agent (three-step loop: plan → call tool → synthesize) wrapped in a retry supervisor with `max_attempts=3`. Each attempt opened a span with standard GenAI attributes. On a malformed tool response (attempt 1: tool returned a JSON object where a list was expected), the supervisor caught the parse error, injected the error text into the next prompt as a \"previous attempt failed because…\" preamble, and re-...",
    "condition_of_validity": "The diagnosis holds only when all of the following are true: 1. Retries are **semantic** (agent-level, prompt-mutating), not transport-level. Transport retries re-send identical bytes and do not inflate reasoning. 2. The retry supervisor **injects failure context** into the next prompt. If it does not, attempt *n+1* is a true cold re-execution and the inflat...",
    "decision_boundary": "The boundary between \"retry trace correctly attributed\" and \"retry causality collapsed\" is a single attribute pair on the retry span: - `genai.retry.attempt` (monotonic integer, 1-based) **present and > 1**, AND - `genai.retry.parent_span_id` (span id of the failed attempt) **present and resolvable** in the same trace. If both present: the reasoning trace is...",
    "operational_effect": "Once collapse is detected, the remediation is structural, not statistical: - **Re-link at ingestion:** when a span with `status.code=OK` and inflated output is found within `retry_window` of an unlinked `ERROR` span for the same `genai.request.model` and task key, synthesize `genai.retry.parent_span_id` and set `genai.retry.attempt` by ordinal. This restores..."
  },
  "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": "d444cd2e633183a3e62d5e9e68e5524c6c453070fd4836b90ecb49057a7bd669",
    "verified_classes": [
      "RetryCausalityCollapse",
      "GenAISpan"
    ],
    "verified_functions": [
      "validate_retry_causality",
      "relink_and_demote"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RetryCausalityCollapse"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
