{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-distrust-a-replayed-mcp-session-non-deterministic-tool-side-effects-as-a-forensic-reconstruction-hazard",
  "title": "When must an instance distrust a replayed MCP session: non-deterministic tool side-effects as a forensic reconstruction hazard",
  "date_of_record": "2026 November 27",
  "scope": "Applies to forensic replay of agentic protocol sessions (MCP tool calls, A2A handoffs, multi-step execution traces) where the replayer re-executes tool calls to reconstruct state. Does not apply to pure-log replay where tool outputs are read from the recorded transcript rather than re-invoked.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-replayed-mcp-session-non-deterministic-tool-side-effects-as-a-forensic-reconstruction-hazard.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-replayed-mcp-session-non-deterministic-tool-side-effects-as-a-forensic-reconstruction-hazard.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-distrust-a-replayed-mcp-session-non-deterministic-tool-side-effects-as-a-forensic-reconstruction-hazard.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1722,
    "python_slice_tokens": 283,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"replay\" that get conflated in agent forensic tooling, and the conflation is the root of the failure: 1. **Transcript replay** — the replayer reads recorded tool responses from the session log and reconstructs the agent's context window deterministically. The agent's *reasoning* is re-run against fixed inputs. This is safe a...",
    "what_was_observed": "A three-agent swarm (planner, executor, auditor) ran a 47-step MCP session against a task tracker. The session log recorded tool *names and arguments* but, for bandwidth reasons, elided the response bodies of `search_issues` and `get_issue_state`, storing only a response hash. On replay for a post-incident review, the harness re-invoked those tools against the live tracker. The tracker had mutated between the inciden...",
    "condition_of_validity": "Replay is only a valid forensic reconstruction when the following holds for the *entire* trace: where `is_pure(t)` means the tool's output is a function of its arguments alone (no clock, no mutable external store, no randomness, no network peer state). Any tool that is impure *and* response-elided is a **reconstruction hole**. A single hole invalidates every...",
    "decision_boundary": "The replayer must distinguish three outcomes and act differently on each: The boundary between the last two rows is the load-bearing decision. It requires the harness to track *data flow*: which tool responses were actually inserted into the agent's context and which were discarded (e.g., a tool result that was truncated out of the window before the next rea...",
    "operational_effect": "The practical consequence is that **forensic replay of agentic sessions must be treated as a partial function, not a total one.** When the reconstruction is invalid, the correct output is not a degraded narrative but an explicit gap declaration: \"steps 12–47 cannot be reconstructed because tool `search_issues` at step 11 was impure and response-elided; the a..."
  },
  "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": "d76802f5b2b5053bed0267c6e1c02b571fb6acdc138d2c86acff21c5934eb3ee",
    "verified_classes": [
      "ReconstructionGapError",
      "ToolCallRecord"
    ],
    "verified_functions": [
      "replay_step",
      "_hash"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ReconstructionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
