{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-opentelemetry-genai-span-attributes-when-a-tool-call-span-and-its-parent-model-invocation-span-disagree-on-retry-iden",
  "title": "Where must an instance reconcile OpenTelemetry GenAI span attributes when a tool-call span and its parent model-invocation span disagree on retry identity",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that emit OpenTelemetry spans per the GenAI semantic conventions (`gen_ai.*` attributes) where a model-invocation span (`gen_ai.operation.name = \"chat\"`) parents one or more tool-execution spans (`gen_ai.operation.name = \"execute_tool\"`), and where either span may be retried. Does not apply to single-shot, non-nested, non-retried inference calls, nor to trace-only propagation without attribute-based correlation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-opentelemetry-genai-span-attributes-when-a-tool-call-span-and-its-parent-model-invocation-span-disagree-on-retry-iden.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-opentelemetry-genai-span-attributes-when-a-tool-call-span-and-its-parent-model-invocation-span-disagree-on-retry-iden.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-opentelemetry-genai-span-attributes-when-a-tool-call-span-and-its-parent-model-invocation-span-disagree-on-retry-iden.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2038,
    "python_slice_tokens": 379,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions describe *what* attributes a span should carry (`gen_ai.request.model`, `gen_ai.response.id`, `gen_ai.usage.input_tokens`, `gen_ai.tool.name`, `gen_ai.tool.call.id`) but they do not specify a *transactional invariant* binding a tool-call span to the specific model-invocation attempt that issued it. The naive assumption is that ...",
    "what_was_observed": "A retrieval-augmented agent using a hosted chat model with function calling had a 4.2% rate of tool-call schema violations (the model emitted a `gen_ai.tool.call.id` that was reused across two distinct tool invocations within the same turn, and once emitted a call ID that collided with a prior turn's ID after context compaction dropped the earlier tool-call history). The tracer emitted, per attempt: - Model span M1: ...",
    "condition_of_validity": "The parentage-based correlation model is valid only under the conjunction: 1. **Attempt singularity** — a model-invocation span corresponds to exactly one provider request, so `gen_ai.response.id` is 1:1 with the span. 2. **Call-ID freshness** — `gen_ai.tool.call.id` is unique across the entire agent session, not merely within a turn, and is never reused aft...",
    "decision_boundary": "The instance must reconcile at the moment it is about to *consume* a tool result to ground a model response, and the decision is binary: - **Accept the result** only if the tool span's `(trace_id, gen_ai.attempt, gen_ai.tool.call.id)` matches the currently-active model attempt's `gen_ai.attempt` and the `gen_ai.tool.result.digest` matches the digest the mode...",
    "operational_effect": "With attempt-scoped correlation enforced at the consumption boundary, two outcomes are bounded: 1. **Stale grounding is eliminated** — a tool result from attempt *n* can never ground a response from attempt *n+1*, because the attempt discriminator is tracer-owned and monotonic. The 4.2% schema-violation rate no longer translates into a grounding fault; it tr..."
  },
  "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": "271da09a06e8ea1dbd2bde8776bb1116c1e3e922d80b8d4964b6e2614f6d5586",
    "verified_classes": [
      "StaleGroundingError",
      "SpanAttrs"
    ],
    "verified_functions": [
      "result_digest",
      "reconcile_tool_result"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "StaleGroundingError"
    ],
    "sample_fail_closed_invariants": [
      "gen_ai.attempt missing on model or tool span; result is unverified, not valid",
      "tool span missing tool_call_id or tool_result_digest"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
