{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-its-causal-trace-before-counterfactual-replay-or-the-replay-silently-rewrites-history",
  "title": "Where must an instance reconcile its causal trace before counterfactual replay, or the replay silently rewrites history",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent runtime that records decision provenance (tool calls, sampled token logprobs, retrieved context snapshots) and later performs counterfactual replay by re-executing a trajectory under a modified input. Does not apply to pure observational logging without replay, nor to deterministic single-shot function invocation with no sampled reasoning.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-its-causal-trace-before-counterfactual-replay-or-the-replay-silently-rewrites-history.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-its-causal-trace-before-counterfactual-replay-or-the-replay-silently-rewrites-history.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-its-causal-trace-before-counterfactual-replay-or-the-replay-silently-rewrites-history.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1794,
    "python_slice_tokens": 371,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the trace is incomplete.\" It is that a *causal trace* and a *replayable trace* are different objects, and runtimes conflate them. A causal trace records what the agent *did*: the tool it called, the argument it emitted, the context it saw. A replayable trace must additionally record what was *available to be sampled* at each decision poin...",
    "what_was_observed": "An agent executing a 14-step incident-triage trajectory called `search_logs`, then `fetch_metric`, then emitted a root-cause hypothesis. The runtime recorded each step's tool name, arguments, and a truncated (2 KB) excerpt of the retrieved payload, plus the final sampled text. It did *not* record the sampling seed, the logprob vector, or the retrieval index commit hash. An auditor attempted counterfactual replay: \"if...",
    "condition_of_validity": "A counterfactual replay is valid only when the following invariant holds at every re-entered decision point *k*: 1. **Prompt determinism:** the serialized context at *k* is reconstructible byte-for-byte from the trace, including retrieval results pinned to an immutable index version (commit hash or snapshot ID), not a live index. 2. **Sampling determinism:**...",
    "decision_boundary": "The boundary is *where you cut the trace for replay*. Cutting at the tool-call layer (record tool name + args + output) is sufficient for causal attribution (\"what did the agent do and see\") but insufficient for replay, because the reasoning between tool calls is sampled, not derived. Cutting at the token layer (record full prompt bytes + seed + logprobs) is...",
    "operational_effect": "Without the gate, three concrete harms compound. First, **false attribution**: audit reports claim a decision was caused by evidence E when the replay had also removed evidence F, so remediation targets the wrong subsystem. Second, **lineage corruption**: the provenance DAG gains edges that assert shared history between factual and counterfactual runs, so an..."
  },
  "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": "cb3651732488a1bb6d27f55885df456c13127e042c84a7ba464a3187fe98cd83",
    "verified_classes": [
      "ReplayClassViolation",
      "Trace"
    ],
    "verified_functions": [
      "replay_counterfactual",
      "_reexecute",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayClassViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
