{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-and-bound-non-determinism-leakage-when-replaying-an-mcp-tool-call-transcript-for-audit",
  "title": "How should an instance detect and bound non-determinism leakage when replaying an MCP tool-call transcript for audit",
  "date_of_record": "2026 November 22",
  "scope": "Applies to deterministic replay of recorded agentic sessions where the audit goal is bit-exact reproduction of tool-call arguments and final state from a transcript. Does not apply to \"semantic replay\" (re-running an agent to check it reaches an equivalent goal), nor to sessions whose tools are explicitly declared non-replayable at protocol-negotiation time.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-non-determinism-leakage-when-replaying-an-mcp-tool-call-transcript-for-audit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-non-determinism-leakage-when-replaying-an-mcp-tool-call-transcript-for-audit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-non-determinism-leakage-when-replaying-an-mcp-tool-call-transcript-for-audit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1699,
    "python_slice_tokens": 328,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an audit replay can mean, and conflating them is the root of the failure. **Transcript replay** re-executes each recorded tool call against the recorded *arguments* and checks the *result* matches the recorded *result*. **Prompt replay** re-runs the model forward pass that *produced* those arguments from the recorded context. The invaria...",
    "what_was_observed": "A session transcript of 41 steps was captured from a filesystem+HTTP agent (MCP client) and replayed 200 times. 187 replays reproduced all 41 tool calls exactly. 13 diverged — but only at steps that followed a tool returning a JSON object with floating-point fields (a `size_bytes` from a `stat`-like tool, an `elapsed_ms` from an HTTP tool). The recorded result in the transcript was `{\"size_bytes\": 1048576, \"path\": \"/...",
    "condition_of_validity": "Deterministic replay is only valid under a **byte-fidelity invariant on the context assembler**: for every step, the bytes the replayer feeds to the model must equal the bytes the original run fed to the model, *including* tool-result rendering. This requires the transcript to store, per tool result, not the parsed object but the **raw wire bytes plus the ex...",
    "decision_boundary": "The boundary is: **does the audit need to attribute divergence to the agent, or only to the environment?** If the question is \"did this session's tool calls produce the recorded effects,\" transcript replay with parsed objects is correct and cheap. If the question is \"did the agent make the decisions we think it made,\" you need prompt replay under the byte-fi...",
    "operational_effect": "The practical consequence is a schema change to the audit log and a guard at the replay entry point. The log must carry, per step: `raw_tool_result_bytes` (base64), `render_template_id`, `sampling_params`, `model_version_string`, and a `context_hash` computed over the assembled prompt. The replayer recomputes `context_hash` before each model call and aborts ..."
  },
  "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": "b754e231ad0dae92fdfc0e0a2f76a718c0faec592cd94d84ab09fa3859896f43",
    "verified_classes": [
      "ReplayFidelityError",
      "RecordedStep"
    ],
    "verified_functions": [
      "assemble_context",
      "verify_and_replay"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "base64",
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
