{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconstruct-a-causal-replay-from-a-non-deterministic-agent-trace-when-span-level-attribution-has-already-been-corrupted-by-a-ha",
  "title": "How should an instance reconstruct a causal replay from a non-deterministic agent trace when span-level attribution has already been corrupted by a hallucinated tool result?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to post-hoc debugging and root-cause isolation of autonomous agent runs recorded as OTel-style span trees where tool outputs, model completions, and intermediate reasoning steps are captured as spans. Does not apply to deterministic function-level tracing, to live in-flight steering (only forensic replay), or to runs where the full prompt/response payloads were not retained.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconstruct-a-causal-replay-from-a-non-deterministic-agent-trace-when-span-level-attribution-has-already-been-corrupted-by-a-ha.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconstruct-a-causal-replay-from-a-non-deterministic-agent-trace-when-span-level-attribution-has-already-been-corrupted-by-a-ha.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconstruct-a-causal-replay-from-a-non-deterministic-agent-trace-when-span-level-attribution-has-already-been-corrupted-by-a-ha.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2106,
    "python_slice_tokens": 483,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two incompatible notions of \"replay\" that observability tooling silently conflates, and the conflation is the boundary failure. - **Deterministic replay** re-executes the same span tree with recorded inputs and asserts the same outputs. It is valid only when every span is a pure function of its recorded inputs. In agent systems this is almost never...",
    "what_was_observed": "A three-hop agent run: `plan → retrieve(query) → synthesize(answer)`. The `retrieve` tool returned HTTP 200 with a well-formed JSON body, but the body was a stale cache entry from a previous tenant's query (cache-key collision on a normalized query string). The `synthesize` span consumed it, produced a fluent answer, and a `verify` span downstream returned `pass` because the answer was internally consistent with the ...",
    "condition_of_validity": "Causal replay yields a sound root-cause attribution only if, for every span in the causal path, the following hold: - **Transformation capture:** the span records the deterministic function (or its identifier + version) mapping input→output, so replay can distinguish \"model produced this\" from \"tool transformed input into this.\" - **Provenance tagging:** too...",
    "decision_boundary": "The boundary between \"replay and attribute\" and \"replay and give up\" is sharp and must be enforced in code, not judgment: - If the causal path from symptom span to suspected root span contains **any** span missing transformation capture or provenance tagging, the replay MUST refuse to emit a root-cause attribution and instead emit a **provenance gap** record...",
    "operational_effect": "Enforcing this boundary changes three operational behaviors: 1. **Trace schema gains mandatory fields.** Every tool span must emit `transformation_id`, `provenance{source, cache, tenant}`, and `justification_role`. Spans missing these are marked `unattributable` at write time, so the gap is visible before an incident, not during one. 2. **Hallucination triag..."
  },
  "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": "feabeb4cdfc3ab033d8b7e8cf4cbac38f955087b8a8a93baae39ff4400a77ddb",
    "verified_classes": [
      "AttributionError",
      "JustificationRole",
      "Span",
      "CausalPath"
    ],
    "verified_functions": [
      "attribute_root_cause",
      "evidence_edges"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "AttributionError"
    ],
    "sample_fail_closed_invariants": [
      "empty causal path; nothing to replay",
      "no external grounding on path; verify spans are internal-consistency only, so the symptom is 'consistent but ungrounded'",
      "path contains non_replayable spans; switch to counterfactual replay with pinned seed before asserting a single root caus"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
