{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-its-own-trace-span-merge-aliasing-under-concurrent-tool-fan-out-and-the-causal-parent-invariant",
  "title": "When must an instance distrust its own trace: span-merge aliasing under concurrent tool fan-out and the causal-parent invariant",
  "date_of_record": "2026 November 23",
  "scope": "Applies to runtime observability of single- and multi-agent LLM systems that emit span-based trajectories (OpenTelemetry-style parent/child spans, or LangSmith/Arize/AgentOps-style run trees) where a model instance fans out concurrent tool calls and later reconstructs cost, latency, and hallucination attribution from the emitted trace. Does not apply to single-threaded, strictly sequential agent loops where every span has a unique, non-overlapping wall-clock interval.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-its-own-trace-span-merge-aliasing-under-concurrent-tool-fan-out-and-the-causal-parent-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-its-own-trace-span-merge-aliasing-under-concurrent-tool-fan-out-and-the-causal-parent-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-its-own-trace-span-merge-aliasing-under-concurrent-tool-fan-out-and-the-causal-parent-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2104,
    "python_slice_tokens": 278,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between a trace that is *complete* and a trace that is *causally faithful*. A complete trace contains every span the runtime emitted. A causally faithful trace preserves the invariant that each span's `parent_span_id` identifies the span whose *output the child actually consumed*, and that a child's `start_time` is not earlier than its ...",
    "what_was_observed": "An orchestrator instance received a plan with four independent tool calls (`search_a`, `search_b`, `fetch_c`, `fetch_d`) dispatched concurrently under a single `llm.turn` parent span. The runtime assigned each in-flight call a monotonically increasing `call_seq` at dispatch and emitted child spans keyed by `call_seq`. The model, however, was given tool results in *completion order* (the runtime's result queue was FIF...",
    "condition_of_validity": "The causal-parent invariant holds—and a trace may be trusted for attribution—only when the following three conditions are simultaneously satisfied for every fan-out node: 1. **Identity is envelope-carried, not position-carried.** The correlation key that binds a child span to its result must travel inside the tool-result envelope (a structured `tool_call_id`...",
    "decision_boundary": "The operational decision is: *given a trace that passes schema validation, when must the instance treat its own attribution as untrustworthy and refuse to emit derived metrics?* The boundary is crossed—distrust and quarantine—when any of the following is true: - **Envelope-identity check fails:** any child span's `tool_call_id` attribute does not match the `...",
    "operational_effect": "The architectural invariant required to bound this failure is: **the correlation key that a trace uses to attribute cost, latency, and grounding must be the same key the runtime used to route the result, and that key must be immutable and model-invisible.** Concretely, the runtime must (i) inject `tool_call_id` into the result envelope at dispatch, (ii) reor..."
  },
  "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": "5ce3682b1daa82fba54dfaf0b581497a5b52885e9105960ad3304265a422570d",
    "verified_classes": [
      "TraceCausalityError",
      "Span"
    ],
    "verified_functions": [
      "validate_attribution",
      "attribute_cost"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TraceCausalityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
