{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-halt-when-an-opentelemetry-genai-span-tree-loses-causal-ordering-across-an-async-tool-call-boundary",
  "title": "Where must an instance halt when an OpenTelemetry GenAI span tree loses causal ordering across an async tool-call boundary",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agent runtimes that emit OpenTelemetry GenAI semantic-convention spans (`gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.usage.*`, `gen_ai.agent.*`) across asynchronously dispatched tool calls, where a child span may be created by a different coroutine, worker, or process than the one that opened its parent. Does not apply to strictly synchronous single-threaded tool invocation or to purely metric-based telemetry with no span tree.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-halt-when-an-opentelemetry-genai-span-tree-loses-causal-ordering-across-an-async-tool-call-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-halt-when-an-opentelemetry-genai-span-tree-loses-causal-ordering-across-an-async-tool-call-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-halt-when-an-opentelemetry-genai-span-tree-loses-causal-ordering-across-an-async-tool-call-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1989,
    "python_slice_tokens": 398,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a span is missing.\" It is that the span tree *exists and is well-formed* while its parent-child edges encode a causal order that never happened. In synchronous tool execution, span nesting is a faithful proxy for causal dependency: the parent span is open when the child starts, the child closes before the parent resumes, and `end_tim...",
    "what_was_observed": "An agent loop opened a parent span `invoke_agent` (`gen_ai.operation.name = \"invoke_agent\"`). At reasoning step 3 it dispatched two tool calls concurrently: `search_docs` and `fetch_record`. Both child spans were created with the parent's `SpanContext` as `parent_span_id`, both received correct `gen_ai.tool.name` and a shared `gen_ai.tool.call.id` namespace, and both were exported. The trace backend rendered a clean ...",
    "condition_of_validity": "The invariant that makes a GenAI span tree usable for causal reasoning is: > For every span `s` with parent `p`: `start_time(p) ≤ start_time(s)` and `end_time(s) ≤ end_time(p)`, and for every tool result consumed at reasoning step `r`, the tool span's `end_time` precedes `r`'s `start_time` with a recorded edge from `r` to the tool span. This holds only when ...",
    "decision_boundary": "The decision an instance must make at this boundary is whether to **halt emission and mark the trace as causally degraded**, or to **emit and tag**. The rule: - If a child span would be exported with `start_time < parent.start_time` (containment violated due to resume), the instance must **not** emit the child under that parent. It must either re-parent to a...",
    "operational_effect": "When the invariant is enforced, the observable behavior changes in three ways. First, replay audits stop producing phantom dependencies: the consumer step is a real node, so the auditor's reconstruction matches the reasoning loop's actual data flow, and a tool result that arrived *after* the step that used it (a race) becomes visible as a violated edge rathe..."
  },
  "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": "401d1b3e25c4ae0abe0f28ba77c4492c4987db0555636b7b40648913c25001f2",
    "verified_classes": [
      "CausalOrderViolation",
      "GenAISpan"
    ],
    "verified_functions": [
      "emit_child_span",
      "validate_consumption_edge"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "CausalOrderViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
