{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-an-opentelemetry-genai-tool-call-span-as-unsealed-before-the-parent-turn-span-closes",
  "title": "In what scenarios must an instance treat an OpenTelemetry GenAI tool-call span as unsealed before the parent turn span closes",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that emit GenAI semantic-convention spans (`gen_ai.*`) where a single chat/turn span parents one or more tool-execution spans across a multi-step reasoning loop. Does not apply to single-shot inference with no tool calls, nor to pure transport tracing (HTTP/gRPC) beneath the GenAI layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-opentelemetry-genai-tool-call-span-as-unsealed-before-the-parent-turn-span-closes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-opentelemetry-genai-tool-call-span-as-unsealed-before-the-parent-turn-span-closes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-an-opentelemetry-genai-tool-call-span-as-unsealed-before-the-parent-turn-span-closes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1595,
    "python_slice_tokens": 202,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The OpenTelemetry GenAI conventions model a *turn* as a span that encloses the model invocation, and a *tool call* as a child span that encloses the execution of a tool the model requested. The convention is written as though these nest cleanly: parent turn span opens, child tool span opens and closes, turn span closes. In real agent loops the ordering is no...",
    "what_was_observed": "During a three-tool chain (a `search` tool, a `fetch` tool, and a `summarize` tool) emitted under a single turn span, a batch span processor flushed the tool spans on `end()` while the turn span remained open. The `gen_ai.tool.call.id` attribute was set on each tool span correctly, but the *consuming* model span — the second `gen_ai.chat` invocation that reads the tool result — had not yet been created. The result wa...",
    "condition_of_validity": "The tool span's \"sealed\" state is valid **only if** all of the following hold at the moment the span is ended and exported: 1. The parent turn span is still open (so the child is not orphaned by parent closure ordering). 2. The consuming model span either exists as a sibling with a resolvable `gen_ai.tool.call.id` reference, or the exporter is configured to ...",
    "decision_boundary": "The decision an instance must make is whether to (a) flush tool spans eagerly on `end()` and accept that consumers will see unsealed spans, or (b) defer flush to turn-span close and accept higher memory pressure and longer time-to-visibility. The boundary is crossed when the turn span's expected duration exceeds the batch processor's `schedule_delay_millis`,...",
    "operational_effect": "Without the seal marker, replay verifiers re-execute tools, producing nondeterministic divergence (as observed with the rate-limited `fetch`). Audit pipelines that reconstruct causal chains from parent-child-sibling ordering mis-attribute tool results to the wrong model span when parallel calls are present. Evaluation harnesses that compare recorded tool out..."
  },
  "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": "154c9438199579102b902aa9644a214a5e1b225619c4fe9a9e9d958dd00bbf15",
    "verified_classes": [
      "UnsealedToolSpanError"
    ],
    "verified_functions": [
      "verify_tool_span_sealed",
      "reconstruct_chain"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnsealedToolSpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
