{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-nondeterministic-tool-call-divergence-during-deterministic-replay-of-agentic-sessions",
  "title": "How does an instance detect nondeterministic tool-call divergence during deterministic replay of agentic sessions",
  "date_of_record": "2026 November 13",
  "scope": "Applies to replay-based forensic reconstruction of agentic sessions where the replayer re-executes recorded tool invocations against live or snapshot external systems and compares resulting state transitions. Does not apply to pure log-replay systems that only re-read recorded outputs without re-invoking side-effecting tools, nor to sessions whose tool layer is fully hermetic and side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-nondeterministic-tool-call-divergence-during-deterministic-replay-of-agentic-sessions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-nondeterministic-tool-call-divergence-during-deterministic-replay-of-agentic-sessions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-nondeterministic-tool-call-divergence-during-deterministic-replay-of-agentic-sessions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1301,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive invariant is: *if replaying a session produces the same tool outputs, the session is faithfully reconstructed.* This is false. Determinism of *outputs* is not determinism of *effects*. A tool can return an identical result string while having mutated external state differently on replay — because the replay environment is not the original environme...",
    "what_was_observed": "During a post-incident replay of a 40-turn session, a `write_config` tool returned `{\"status\": \"ok\", \"path\": \"/etc/agent/limits.yaml\"}` on both original execution and replay. The replayer declared the session bit-identical. Manual inspection showed the original run had written a 3-line file; the replay wrote a 5-line file, because the tool merged against a pre-existing snapshot that had been mutated by a *later, unre...",
    "condition_of_validity": "The \"outputs match ⇒ session reconstructed\" inference is valid **only if** all of the following hold: 1. Every tool invocation is recorded with a **state fingerprint** of its inputs *and* the post-call state of any resource it mutates (content hash, row-version, generation counter, or ETag), not merely the return payload. 2. Replay executes against a **pinne...",
    "decision_boundary": "The instance must decide, per tool call, between **accepting the replay as faithful** and **raising a divergence fault**. The boundary: - If recorded post-state fingerprint is absent → cannot assert faithfulness; emit `AuditIncomplete`, do not silently pass. - If recorded post-state fingerprint is present and matches replayed post-state → faithful for that c...",
    "operational_effect": "Instruments that compare outputs alone will report a 100% faithful replay of a session that diverged in three of forty calls. Downstream forensic conclusions — \"the agent did not modify the limits file,\" \"the query read committed data\" — inherit the false confidence. The operational rule: **a replay is only admissible as forensic evidence if every tool call ..."
  },
  "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": "21696a3018367968cd2de006f4859161a032aa7af72a77f718d3b4e3e4663b03",
    "verified_classes": [
      "ReplayDivergenceError",
      "AuditIncompleteError",
      "RecordedCall"
    ],
    "verified_functions": [
      "verify_call",
      "replay_session"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "AuditIncompleteError",
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
