{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-causal-trace-corruption-when-a-single-prompt-fans-out-into-concurrent-retrievals-and-tool-calls",
  "title": "Which invariants prevent causal trace corruption when a single prompt fans out into concurrent retrievals and tool calls",
  "date_of_record": "2026 December 1",
  "scope": "Applies to observability pipelines that reconstruct a causal DAG from span events emitted by an LLM agent that issues parallel retrievals and tool calls under one logical prompt. Does not apply to single-threaded, strictly sequential agents where each span has exactly one child, nor to pure prompt/response logging without cross-span correlation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-corruption-when-a-single-prompt-fans-out-into-concurrent-retrievals-and-tool-calls.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-corruption-when-a-single-prompt-fans-out-into-concurrent-retrievals-and-tool-calls.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-causal-trace-corruption-when-a-single-prompt-fans-out-into-concurrent-retrievals-and-tool-calls.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2065,
    "python_slice_tokens": 171,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A causal trace is not a timestamp-sorted log. It is a claim of the form *span B was caused by span A*, and that claim is only valid if the parent-child edge is established at emission time, not reconstructed at ingestion time from wall-clock ordering. The failure mode examined here is **orphaned parent inference**: when a prompt span fans out to N concurrent...",
    "what_was_observed": "An agent handling a single user prompt dispatched three retrievals (R1, R2, R3) and two tool calls (T1, T2) concurrently, using a fan-out at the orchestrator. Each child emitted a `span_start` and `span_end` with a monotonic local clock, a `trace_id`, and a `parent_span_id` pointing at the prompt span P. The emitter used per-worker buffering with a 250 ms flush interval. During ingestion, the following sequence was o...",
    "condition_of_validity": "The invariant that prevents this class of corruption is a **declared-parent precedence rule**: a span's causal edge is defined *exclusively* by its emitted `parent_span_id`. The assembler may not invent an edge, and it may not overwrite a declared edge with an inferred one. This is valid under three conditions, each of which must be checked: 1. **Parentage i...",
    "decision_boundary": "The boundary between correct and corrupt handling is drawn at the moment a child span arrives with an unresolved declared parent. Three policies are possible, and only one is safe: - **Attach-to-nearest (unsafe):** commit an inferred edge to the temporally nearest span. This is what produced the R2→T1 corruption. It is fast and keeps the DAG connected, which...",
    "operational_effect": "With hold-and-flag in place, the R2 case resolves correctly: R2 is buffered for 160 ms until P's start arrives, then attached with a declared edge. If P had never arrived (orchestrator crash mid-flush), R2 is emitted with `parent_unresolved=true`, attributed to the trace for cost purposes, and excluded from root-cause traversal. The false R2→T1 edge never ex..."
  },
  "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": "9034bdd9a093879013bfcf85c48fb8758b58ce82f2e79da41e07fb8fc33a1489",
    "verified_classes": [
      "TraceCorruptionError"
    ],
    "verified_functions": [
      "commit_edge"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TraceCorruptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
