{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-span-to-trace-correlation-collapse-when-agent-orchestrators-re-parent-llm-spans-across-async-tool-boundaries",
  "title": "What structural signals indicate span-to-trace correlation collapse when agent orchestrators re-parent LLM spans across async tool boundaries",
  "date_of_record": "2026 November 30",
  "scope": "Applies to observability pipelines that infer parent/child relationships for LLM spans from ambient context (contextvars, thread-locals, OTel `Context`) rather than from explicit propagated trace headers, in agent systems where tool calls cross async task, thread-pool, or callback boundaries. Does not apply to pipelines using explicit W3C `traceparent` injection at every tool dispatch, nor to single-threaded synchronous chains.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-to-trace-correlation-collapse-when-agent-orchestrators-re-parent-llm-spans-across-async-tool-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-to-trace-correlation-collapse-when-agent-orchestrators-re-parent-llm-spans-across-async-tool-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-span-to-trace-correlation-collapse-when-agent-orchestrators-re-parent-llm-spans-across-async-tool-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1732,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an observability pipeline learns that an LLM span belongs to a parent orchestration span: 1. **Structural correlation** — the parent-child edge is carried as data: a `traceparent` header, a `parent_span_id` field, or an explicit `link` attribute written by the orchestration runtime at dispatch time. 2. **Ambient correlation** — the edge is...",
    "what_was_observed": "A supervisor agent dispatched three sub-agents (A, B, C) via a shared `ThreadPoolExecutor(max_workers=2)`. Each sub-agent made LLM calls through a shared client whose span processor read `opentelemetry.context.get_current()` to derive `parent_span_id`. The pipeline reported: - Sub-agent A's LLM spans: parent = supervisor span (correct, 100% of calls). - Sub-agent B's LLM spans: parent = sub-agent A's tool span (wrong...",
    "condition_of_validity": "Ambient correlation is only sound under a conjunction of conditions that agent runtimes routinely violate: - **Exclusive context ownership:** the execution context active during span emission is uniquely owned by the logical parent for the span's entire lifetime. Thread pools with reuse, `asyncio` tasks sharing a loop with `contextvars` mutation, and callbac...",
    "decision_boundary": "The boundary is between **tolerating ambient correlation with a post-hoc reconciliation pass** and **refusing to emit a span whose ambient parent disagrees with its resource identity**. Reconciliation is acceptable when: - The pipeline can join spans to an authoritative dispatch log (the orchestrator's own record of `(child_span_id, intended_parent_span_id)`...",
    "operational_effect": "With the guardrail in place, the observed effects were: - Misattributed spans dropped from 40–65% to 0% on the affected sub-agents, at the cost of ~3% of spans being emitted with `link` instead of `parent` (those where the dispatch log had no record — genuinely orphaned async work). - Per-sub-agent cost variance across replays of the same workload fell from ..."
  },
  "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": "4bc8d92d737ff5b43a668956c1da7dc950cea37cc60dbbc679a497e40f965cab",
    "verified_classes": [
      "SpanCorrelationCollapse",
      "Span"
    ],
    "verified_functions": [
      "resolve_parent",
      "emit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpanCorrelationCollapse"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
