{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-diverge-from-its-own-recorded-trace-when-replayed-for-counterfactual-forensic-analysis",
  "title": "Why does an instance diverge from its own recorded trace when replayed for counterfactual forensic analysis?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to post-incident forensic replays of multi-agent incidents where the replay engine attempts to reconstruct a prior execution from a recorded event log (tool calls, model responses, inter-agent messages) and then perturb one decision point to explore counterfactuals. Does not apply to live shadow-traffic replay, where the model is re-invoked and divergence is expected as a matter of course.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-diverge-from-its-own-recorded-trace-when-replayed-for-counterfactual-forensic-analysis.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-diverge-from-its-own-recorded-trace-when-replayed-for-counterfactual-forensic-analysis.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-diverge-from-its-own-recorded-trace-when-replayed-for-counterfactual-forensic-analysis.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2359,
    "python_slice_tokens": 376,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two fundamentally different notions of \"replay\" that get conflated in forensic tooling: **trace replay** (re-executing the recorded event stream verbatim to confirm the log is internally consistent) and **counterfactual replay** (re-executing the same trace but substituting one agent's decision at a chosen fork, then re-running downstream agents to...",
    "what_was_observed": "In a three-agent incident (planner, retriever, executor) handling a refund workflow, the executor issued a duplicate refund. The recorded trace showed the executor's tool call at step 22 with arguments derived from a retriever result at step 19. The retriever's step 19 output was a memory record `refund_policy_v3` with a `max_refund: 500` field. The executor at step 22 called `issue_refund(amount=1200)` — exceeding t...",
    "condition_of_validity": "Counterfactual replay is valid — meaning its divergence report can be trusted as a causal claim — only under the following conjunction: 1. **Context recomputation completeness.** Every agent invocation in the replay must have its context window recomputed from the perturbed state, including prompt assembly, memory retrieval, tool-result injection, and any tr...",
    "decision_boundary": "The operational decision is: **when does a counterfactual divergence report get promoted to a root-cause finding?** Promote to root-cause finding only when all four conditions of validity hold for the specific divergence path being claimed. In the refund incident, condition 1 failed (executor prompt read from log), so the retriever divergence could not be pr...",
    "operational_effect": "The practical consequence is that forensic replay engines must be built with **context-assembly instrumentation as a first-class artifact**, not as an afterthought. Every agent invocation must log not just its input and output, but the *provenance* of each span in its context: which prior step produced it, whether it was truncated, which memory record it cam..."
  },
  "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": "adbdf9f9ea3c1faf3c14c91ca61e83de0fd32efc634156213cdacf99c28a99c1",
    "verified_classes": [
      "ReplayValidityError",
      "Invocation",
      "DivergenceReport"
    ],
    "verified_functions": [
      "validate_divergence",
      "promote_to_finding"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayValidityError"
    ],
    "sample_fail_closed_invariants": [
      "retrieval index not pinned to incident snapshot; stale-memory drift confounds any retrieval-adjacent divergence"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
