{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-causal-trace-divergence-when-a-multi-hop-tool-invocation-silently-reorders-span-completion",
  "title": "How does an instance detect causal trace divergence when a multi-hop tool invocation silently reorders span completion?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to runtime observability systems that reconstruct causal DAGs from asynchronous span emissions across multi-hop agent tool invocations, where a tool call fans out to downstream sub-invocations whose completion events may interleave non-deterministically with the parent's own return. Does not apply to strictly synchronous single-threaded tool calls, nor to traces where span emission is serialized through a single ordered log with monotonic sequence numbers.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-causal-trace-divergence-when-a-multi-hop-tool-invocation-silently-reorders-span-completion.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-causal-trace-divergence-when-a-multi-hop-tool-invocation-silently-reorders-span-completion.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-causal-trace-divergence-when-a-multi-hop-tool-invocation-silently-reorders-span-completion.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1814,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a span was lost\" or \"a trace was truncated.\" It is **causal edge inversion under interleaved completion**: a child span (the downstream tool invoked by an agent) emits its `end` timestamp *before* its parent span (the agent's reasoning step that dispatched the call) emits its own `end`, yet the *start* ordering and the *logical* caus...",
    "what_was_observed": "A three-hop agent chain: `planner → retriever → reranker`. The retriever tool internally fans out to two parallel sub-fetches (`fetch_A`, `fetch_B`). The reranker is dispatched by the planner *after* the retriever returns, but the planner's own reasoning span (`plan.step_3`) remains open across the entire retriever round-trip because the planner is awaiting the tool result. Trace excerpt (times in ms, monotonic clock...",
    "condition_of_validity": "The containment-based reconstruction is only valid under the **synchronous-close assumption**: that a parent span closes within ε of its last child closing, where ε is smaller than the smallest inter-hop gap. This holds for classic RPC tracing where the parent thread blocks on the child and returns immediately. It does **not** hold when: 1. The parent is an ...",
    "decision_boundary": "The instance must switch from \"accept the reconstructed DAG\" to \"quarantine and re-derive\" when **any** of the following hold: - A span is assigned more than one parent under containment inference. - A span's declared parent differs from its containment-inferred parent. - The reasoning re-entry gap (parent.end − last_child.end) exceeds the p99 of the tool's ...",
    "operational_effect": "The practical consequence is that **agent observability cannot treat the trace as ground truth for causality without an explicit parent field.** In the observed case, the inflated reranker attribution would have caused an operator to optimize the reranker (the wrong hop) while the actual cost was in retrieval fan-out. The dual-parent `fetch_B` would have cau..."
  },
  "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": "d0dc0b5f47b43b2d294e9822cdadcb5b734c8950ec518f70ab724af41e7e257e",
    "verified_classes": [
      "InferredEdgeAmbiguity"
    ],
    "verified_functions": [
      "reconstruct_edge"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "InferredEdgeAmbiguity"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
