{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-span-parentage-before-correlation-not-after-the-orphaned-tool-span-amplification-failure-in-llm-observability-pipelin",
  "title": "Where must an instance reconcile span-parentage before correlation, not after: the orphaned-tool-span amplification failure in LLM observability pipelines",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any observability pipeline that ingests LLM/tool spans from an instrumented agent runtime and joins them into orchestration traces via parent-span identifiers, where span export is asynchronous and the orchestrator and LLM SDK are instrumented independently. Does not apply to single-process, synchronous, in-band tracers where span closure and export are atomic with the parent's lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-span-parentage-before-correlation-not-after-the-orphaned-tool-span-amplification-failure-in-llm-observability-pipelin.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-span-parentage-before-correlation-not-after-the-orphaned-tool-span-amplification-failure-in-llm-observability-pipelin.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-span-parentage-before-correlation-not-after-the-orphaned-tool-span-amplification-failure-in-llm-observability-pipelin.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1992,
    "python_slice_tokens": 379,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that governs this failure is between **span correlation** (joining a child span to its parent by ID) and **span parentage validity** (whether the referenced parent still exists in the trace store at join time, and whether the join is performed on the correct trace identity). Most pipelines treat these as the same operation: they store `parent...",
    "what_was_observed": "A multi-agent orchestrator emitted an orchestration span (`orch.run`, one per agent run) from its own tracer, and each LLM call and tool invocation emitted child spans from an independently-instrumented SDK. The two instrumentation layers used different trace-ID generators and a shared span-ID namespace that was *not* globally unique—it was a per-process monotonic counter. Under concurrent runs across worker processe...",
    "condition_of_validity": "The correlation-by-ID approach is valid only under the conjunction: - Span IDs are globally unique across all processes and instrumentation layers (e.g., 128-bit random, not per-process counters). - The parent span is guaranteed to be exported and accepted before any child references it (causal export ordering), *or* the correlation engine treats an unresolv...",
    "decision_boundary": "The boundary is not \"should we correlate by ID\"—that is the only scalable option. The boundary is **where parentage reconciliation happens**: at ingest (before correlation) or at query (after correlation). - **Query-time reconciliation** (the common default) resolves parentage lazily. It cannot distinguish \"parent not yet arrived\" from \"parent never will arr...",
    "operational_effect": "With ingest-time reconciliation and orphan quarantine: - Orphaned tool spans are counted separately and become a first-class signal: a rising orphan rate is the *observable* of parent-span loss, which previously was invisible. - Per-run cost and latency aggregates are bounded by the run's own spans; a lost parent can only *under*-count a run (its orphaned ch..."
  },
  "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": "47e33093f10744ca8b33497efd53e27278d8a54eda1b9fde2bf87525a3b854b6",
    "verified_classes": [
      "UnresolvedParentError",
      "Span",
      "IngestReconciler"
    ],
    "verified_functions": [
      "__init__",
      "ingest",
      "_resolve_children",
      "_sweep",
      "finalize",
      "assert_no_cross_trace_join"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnresolvedParentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
