{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-causal-edges-when-its-observability-trace-is-sampled-at-the-span-boundary-rather-than-the-decision-boundary",
  "title": "Why does an instance lose causal edges when its observability trace is sampled at the span boundary rather than the decision boundary",
  "date_of_record": "2026 November 30",
  "scope": "Applies to GenAI observability pipelines that reconstruct tool-call causality graphs from span-level telemetry emitted by an agent runtime, specifically where sampling (head-based or tail-based) is applied per-span rather than per-decision. Does not apply to fully synchronous, single-tool agents whose entire trace fits in one span, nor to pipelines that emit a single atomic \"decision record\" per reasoning step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-edges-when-its-observability-trace-is-sampled-at-the-span-boundary-rather-than-the-decision-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-edges-when-its-observability-trace-is-sampled-at-the-span-boundary-rather-than-the-decision-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-edges-when-its-observability-trace-is-sampled-at-the-span-boundary-rather-than-the-decision-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1799,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an observability pipeline can treat as the unit of capture: the **span** (a tool invocation, an LLM call, a retrieval op) and the **decision** (the reasoning step that selected which tool to call, with what arguments, conditioned on what prior state). Production pipelines almost always sample and index at the span boundary because spans ...",
    "what_was_observed": "A refund-processing agent running a ReAct loop over four tool calls per task. The runtime emitted spans: `llm.reason` (the reasoning call), `tool.lookup_order`, `llm.reason`, `tool.refund_order`, `llm.reason`, `tool.notify`. Head-based sampling at 20% was applied per-span at the collector, keyed on `trace_id` hash *per span*—a common misconfiguration where the sampler treats `trace_id` as a field to hash rather than ...",
    "condition_of_validity": "The invariant that must hold for a reconstructed causality graph to be trustworthy is: > For every captured tool-call span, its *true* causal parent (the decision span that emitted it) is either captured, or the edge is explicitly marked `parent_unknown`. A captured edge is never inferred from trace-order adjacency. This invariant is violated whenever sampli...",
    "decision_boundary": "The architectural decision is: **sample at the decision boundary, or do not claim causality.** Concretely, the pipeline must do one of three things at capture time, and must record which it did: 1. **Decision-atomic sampling.** Define a `decision_id` that groups the LLM reasoning span and all tool spans it directly emits. Sample on `decision_id`, never on in...",
    "operational_effect": "The downstream effects are silent and directional, which is what makes this failure mode dangerous: - **Audit queries under-report anomalies.** As observed, low-confidence refunds vanished because the confidence field lived on dropped spans. The agent's actual error rate was unchanged; the *measured* error rate dropped to near zero. An operator tuning safety..."
  },
  "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": "3295505a3c26456d00cb26b483663c37e39ac4626e919aad26450bedcc1c19cf",
    "verified_classes": [
      "CausalityReconstructionError"
    ],
    "verified_functions": [
      "reconstruct_edge"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CausalityReconstructionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
