{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-attributes-a-retrieved-document-to-the-wrong-causal-span-in-a-rag-trace",
  "title": "What happens when an instance attributes a retrieved document to the wrong causal span in a RAG trace",
  "date_of_record": "2026 November 24",
  "scope": "Applies to retrieval-augmented agent traces that reconstruct causality by linking retrieval spans to the generation spans that consumed their output, where the linkage is inferred from timestamps, span IDs propagated through tool-call payloads, or embedding-similarity heuristics rather than an explicit retrieval-result handle. Does not apply to traces where each retrieval result carries an immutable provenance token injected into the prompt by the orchestration layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-attributes-a-retrieved-document-to-the-wrong-causal-span-in-a-rag-trace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-attributes-a-retrieved-document-to-the-wrong-causal-span-in-a-rag-trace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-attributes-a-retrieved-document-to-the-wrong-causal-span-in-a-rag-trace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2169,
    "python_slice_tokens": 391,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different questions an observability system answers about a RAG trace, and they fail in different ways: 1. **What did the model see?** — a provenance question, answered by the retrieval span's payload. 2. **What did the model use?** — an attribution question, answered by the causal link between a retrieval span and a generation span. Most traci...",
    "what_was_observed": "A support-triage agent runs a loop: plan → retrieve → synthesize → act. Retrieval is parallelized across three backends (vector store, BM25 index, a live ticket API). The orchestrator fans out three retrieval calls, awaits all three, concatenates the results into a single context block, and issues one generation call. The trace records three `retrieval` spans and one `generation` span. The linker's heuristic: for eac...",
    "condition_of_validity": "The misattribution is *bounded and detectable* only under a specific condition: **the orchestration layer must emit, for each retrieval result, a provenance handle that is copied verbatim into the generation's prompt and echoed back in the generation span's input metadata.** Concretely, each retrieved chunk is wrapped as `[src:<uuid>]` before concatenation, ...",
    "decision_boundary": "The boundary is not \"should we link retrieval to generation\" — we must, or the trace is useless for debugging. The boundary is **what the linker is permitted to assert when it lacks a provenance handle.** Three regimes, and the rule for each: 1. **Handle present and echoed.** Draw a *verified* edge. This edge may be used for attribution metrics, precision/re...",
    "operational_effect": "Enforcing the boundary changes three things downstream: - **Retrieval-quality dashboards lose ~11% of their data and gain correctness.** Precision numbers computed over `verified` edges only are lower but stable across tie-break perturbations; the replay-divergence rate drops from 9.7% to ~0, because verified edges are invariant to linker heuristics by const..."
  },
  "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": "b4916decfdbc7cc9ece4cdf1055cc54ab0cc1f89ceba444d9596b0566ffbda78",
    "verified_classes": [
      "CausalLinkError",
      "RetrievalSpan",
      "GenerationSpan",
      "Edge"
    ],
    "verified_functions": [
      "link",
      "link_multi_backend"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CausalLinkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
