{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-a-replay-trace-non-idempotent-tool-side-effects-and-the-pre-image-hash-gap-in-deterministic-tool-call-graph-re-executio",
  "title": "When must an instance distrust a replay trace: non-idempotent tool side effects and the pre-image hash gap in deterministic tool-call graph re-execution",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent runtimes that persist an observability trace (span tree of reasoning steps, tool invocations, arguments, and returned payloads) and later replay it to re-execute a tool-call decision graph deterministically for debugging, regression, or audit. Does not apply to traces that are pure read-only probes with no external side effects, nor to replay of reasoning-only traces where no tool is re-invoked.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-replay-trace-non-idempotent-tool-side-effects-and-the-pre-image-hash-gap-in-deterministic-tool-call-graph-re-executio.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-replay-trace-non-idempotent-tool-side-effects-and-the-pre-image-hash-gap-in-deterministic-tool-call-graph-re-executio.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-replay-trace-non-idempotent-tool-side-effects-and-the-pre-image-hash-gap-in-deterministic-tool-call-graph-re-executio.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1890,
    "python_slice_tokens": 315,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A replay trace is usually treated as a sufficient specification of a run: if you re-feed recorded tool outputs and recorded model outputs in the recorded order, the decision graph reproduces. This is true only for the *decision* layer. It is false for the *effect* layer. The trace records what a tool *returned*, not the world-state *pre-image* against which ...",
    "what_was_observed": "A six-node decision graph: `resolve_account` → `quote_fee` → `debit` → `credit` → `confirm` → `notify`. The trace recorded `debit` returning `{\"txn_id\": \"txn_8841\", \"status\": \"settled\", \"balance_after\": 41200}`. During replay against a snapshot taken *after* the live run, `debit` was re-invoked with identical arguments. It returned `{\"txn_id\": \"txn_9102\", \"status\": \"settled\", \"balance_after\": 37000}` — a second, real...",
    "condition_of_validity": "Deterministic replay of a tool-call decision graph is valid if and only if, for every tool node in the graph, at least one of the following holds: - The tool is **provably pure** — its output is a total function of the recorded arguments and recorded inputs, with no ambient reads and no writes. `quote_fee(amount, tier)` qualifies. `debit(account, amount)` do...",
    "decision_boundary": "The engine must decide, per node, *before* invocation, between re-execute and replay-from-trace. The decision is not a heuristic on the tool name; it is a property lookup on a tool manifest that declares `effect_class ∈ {pure, idempotent_keyed, mutating_unkeyed}`. The boundary cases that trip implementations: - **Reads that are secretly writes.** `get_or_cre...",
    "operational_effect": "The practical consequence is a split replay contract. The observability trace must be extended from a *response log* to a *response-plus-pre-image log*: every mutating tool node records the idempotency key used, the pre-image version it conditioned on, and the effect class at call time. The replay engine gains a mandatory gate that refuses to re-invoke any n..."
  },
  "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": "df24a266a1e766ea3294f46590c7575299698c56ace08ee7955437a70ad2c396",
    "verified_classes": [
      "ReplayDivergenceError",
      "EffectClass",
      "ToolManifest",
      "TraceNode"
    ],
    "verified_functions": [
      "decide_replay_action",
      "replay_node"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
