{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-orphans-its-causal-parent-span-during-genai-semantic-convention-emission",
  "title": "What happens when an instance orphans its causal parent span during GenAI semantic-convention emission",
  "date_of_record": "2026 December 1",
  "scope": "Applies to instrumented LLM agent runtimes that emit OpenTelemetry-style spans annotated with GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.*`, `gen_ai.conversation.id`, `gen_ai.tool.call.id`) and reconstruct causal traces by joining spans on parent/child links plus conversation identifiers. Does not apply to single-shot, single-span inference calls with no downstream tool or sub-agent fan-out.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-orphans-its-causal-parent-span-during-genai-semantic-convention-emission.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-orphans-its-causal-parent-span-during-genai-semantic-convention-emission.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-orphans-its-causal-parent-span-during-genai-semantic-convention-emission.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2470,
    "python_slice_tokens": 291,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"parent\" in an agent trace, and conflating them produces silent causal corruption. The **execution parent** is the span whose scope lexically encloses the child — the `execute_tool` call made from inside the `chat` handler. The **causal parent** is the span that *caused* the child to exist — the earlier `chat` completion who...",
    "what_was_observed": "A multi-step agent (plan → `chat` → `execute_tool` × N → `chat` → answer) was instrumented with the standard pattern: a `tracer.start_as_current_span(\"chat\")` around the model call, and tool execution wrapped in `start_as_current_span(\"execute_tool\")` inside the tool dispatcher. The dispatcher was invoked from an async task pool so that parallel tool calls (the model emitted three tool-call tokens in one completion) ...",
    "condition_of_validity": "The standard \"wrap in `start_as_current_span` and let context propagate\" pattern is valid **only** under the invariant: > For every child span S, the context active at S's creation contains, as its current span, the span that causally produced S's triggering event. This invariant holds for synchronous, single-threaded, non-checkpointed execution. It is viola...",
    "decision_boundary": "The operational decision is: **at what point does the runtime trust implicit context propagation versus require explicit causal linkage?** - **Trust implicit context** when the child span is opened synchronously inside the parent's scope and no checkpoint, queue, or async boundary intervenes. Cost of being wrong: low (the pattern is correct here). Cost of ad...",
    "operational_effect": "When the invariant is enforced — explicit `parent_span_id` on every `execute_tool` span, sourced from the `span_id` recorded on the emitting completion — the trace reconstructs with the correct topology: `chat` → `execute_tool` × K → next `chat`, and cost, replay, and audit all key off the same edges. When it is not enforced, the trace is *syntactically vali..."
  },
  "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": "aa13459ff166447ce485788b189da7b2ee8ccb0b00d596c96861b6d02f808104",
    "verified_classes": [
      "OrphanedCausalParentError",
      "SpanRef"
    ],
    "verified_functions": [
      "open_tool_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanedCausalParentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
