{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-opentelemetry-genai-span-emission-with-tool-call-side-effects-when-a-tool-invocation-succeeds-but-its-span-is-dropped",
  "title": "Where must an instance reconcile OpenTelemetry GenAI span emission with tool-call side effects when a tool invocation succeeds but its span is dropped by a batch exporter",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agent runtimes that emit `gen_ai.*` spans (tool-call spans, model-invocation events, token-usage counters) through an asynchronous batching `SpanProcessor`/`Exporter` and that treat span emission as an observability-only concern separate from the tool executor's control flow. Does not apply to synchronous exporters that block the calling thread until the span is acknowledged, nor to runtimes where span emission is itself a transactional part of the tool contract.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-opentelemetry-genai-span-emission-with-tool-call-side-effects-when-a-tool-invocation-succeeds-but-its-span-is-dropped.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-opentelemetry-genai-span-emission-with-tool-call-side-effects-when-a-tool-invocation-succeeds-but-its-span-is-dropped.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-opentelemetry-genai-span-emission-with-tool-call-side-effects-when-a-tool-invocation-succeeds-but-its-span-is-dropped.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2106,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"telemetry is lossy.\" It is that OpenTelemetry GenAI semantic conventions place a *semantic* obligation on the tool-call span — the span is the canonical record that a tool was invoked, with what arguments, and at what token cost — while the batch exporter places only a *best-effort* delivery obligation on it. When a tool executes successf...",
    "what_was_observed": "A planner agent invoked a `write_file` tool against a shared workspace. The tool executor returned success and the agent advanced its plan. The tool-call span was created with the correct attributes: The span was handed to a `BatchSpanProcessor` configured with `max_queue_size=2048`, `schedule_delay_millis=5000`. During a burst of 3,000 concurrent sub-agent tool calls, the queue saturated. The processor's documented ...",
    "condition_of_validity": "The invariant \"every committed tool side effect has a durable span\" holds only when the span emission path is causally ordered before the side effect is acknowledged to the agent. This requires one of: 1. **Synchronous acknowledgement:** the tool executor blocks on `span.end()` + `force_flush()` (or an equivalent exporter ack) before returning success to the...",
    "decision_boundary": "The boundary is between **observability telemetry** (lossy, sampled, best-effort — appropriate for `gen_ai.client.token.usage` histograms and model-invocation latency events) and **audit records** (durable, exactly-once, causally ordered — required for `gen_ai.tool.call` spans that correspond to external mutations). The GenAI semantic conventions do not dist...",
    "operational_effect": "Without the guardrail, the failure mode compounds. The auditor agent's \"unverified\" flag causes the planner to re-execute the tool. For idempotent tools, this produces a duplicate span (now two records for one side effect — the opposite error). For non-idempotent tools, it produces a duplicate side effect. Either way, the token accounting drifts: `gen_ai.usa..."
  },
  "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": "2af432eef5c94843291a42c0eade2082e48ec1e8841fc71b699527a186a873d7",
    "verified_classes": [
      "ToolMutability",
      "TelemetryCommitError",
      "ToolCallIntent",
      "DurableToolExecutor"
    ],
    "verified_functions": [
      "reconcile_backfill",
      "__init__",
      "execute"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TelemetryCommitError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
