{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-causal-span-detachment-between-llm-reasoning-and-tool-execution-in-agent-observability-pipelines",
  "title": "What structural signals indicate causal span detachment between LLM reasoning and tool execution in agent observability pipelines",
  "date_of_record": "2026 November 14",
  "scope": "Applies to agent observability pipelines that emit LLM inference spans, tool-execution spans, and memory read/write spans as a single causally-linked trace, where spans are correlated by trace/span IDs and parent-child references. Does not apply to single-process synchronous agents that emit a single flat span, nor to batch evaluation harnesses that do not preserve intra-request causality.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-causal-span-detachment-between-llm-reasoning-and-tool-execution-in-agent-observability-pipelines.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-causal-span-detachment-between-llm-reasoning-and-tool-execution-in-agent-observability-pipelines.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-causal-span-detachment-between-llm-reasoning-and-tool-execution-in-agent-observability-pipelines.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1935,
    "python_slice_tokens": 395,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"missing spans\" and not \"orphaned spans.\" It is **causal detachment**: the tool span and the LLM span both exist, both carry the correct `trace_id`, both have plausible timestamps, and yet the parent-child edge between them is either absent, inverted, or attached to the wrong LLM turn. The pipeline reports a complete, healthy trace wi...",
    "what_was_observed": "Across three production agent deployments (ReAct-style tool loops, 40–200 tool calls per session, memory subsystem using a vector store with synchronous read/write), the following detachment signatures recurred: 1. **Parallel tool-call fan-out collapse.** When the LLM emits N tool calls in one turn, the runtime frequently spawns N goroutines/tasks that each emit their tool span with `parent_span_id` set to the *LLM s...",
    "condition_of_validity": "The detachment is *undetectable* by count-based and error-based monitors and *detectable* only when all of the following hold: - The pipeline preserves raw `parent_span_id` (does not reconstruct edges from timestamps at query time). If the backend reconstructs parentage from `(trace_id, start_time)` ordering, detachment is masked as a sort artifact and canno...",
    "decision_boundary": "Distinguish **benign structural noise** from **causal detachment** using three independent checks, all of which must agree before flagging: - **Edge-completeness check:** For every tool span in a trace, `parent_span_id` must resolve to an LLM span within the same `trace_id`, and that LLM span's `end_time` must be ≤ the tool span's `start_time` (allowing a co...",
    "operational_effect": "Detached traces are not merely cosmetic. Downstream consumers of the trace graph — cost attribution, failure root-cause analysis, and any automatic prompt/tool optimization loop — operate on the edge structure. A detached tool span under-counts the LLM turn's tool cost; a re-parented memory span attributes retrieval latency to the wrong reasoning step; a ret..."
  },
  "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": "91004f3ae745dac63c3f912de8a1098481c1a659869ec3b64fe75e2550def45a",
    "verified_classes": [
      "CausalDetachmentError",
      "Span"
    ],
    "verified_functions": [
      "_llm_spans",
      "_most_recent_preceding_llm",
      "validate_causal_integrity"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CausalDetachmentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
