{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-deterministic-replay-of-agentic-traces-when-the-tool-call-boundary-is-non-idempotent",
  "title": "Which invariants prevent deterministic replay of agentic traces when the tool-call boundary is non-idempotent",
  "date_of_record": "2026 November 13",
  "scope": "Applies to post-incident forensic replay of agentic traces where the agent's action space includes side-effecting tool calls (writes, sends, payments, external API mutations). Does not apply to replay of read-only or purely observational traces, nor to replay against a recorded mock layer that fully substitutes for the live tool surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-deterministic-replay-of-agentic-traces-when-the-tool-call-boundary-is-non-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-deterministic-replay-of-agentic-traces-when-the-tool-call-boundary-is-non-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-deterministic-replay-of-agentic-traces-when-the-tool-call-boundary-is-non-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1337,
    "python_slice_tokens": 195,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace is *replayable* when re-executing the recorded sequence of (prompt, model output, tool call, tool result) tuples from the initial state reproduces the same subsequent states. A trace is *deterministically replayable* only when replay is also *safe*: re-execution does not produce new observable effects outside the replay sandbox. The non-obvious failu...",
    "what_was_observed": "In a post-incident review of an agent that paged on-call engineers, the trace was replayed to reconstruct the decision path. The trace contained the full model output for each step, so the reasoning was reproduced exactly. However, step 7 was a `pager.trigger(service, severity)` call. The replay harness re-executed the call, and the on-call rotation received a duplicate page for an already-resolved incident. The repl...",
    "condition_of_validity": "The invariant that makes replay safe is: **for every tool call `t` in the trace, re-executing `t` during replay must either (a) be a no-op with respect to external state, or (b) return a result byte-identical to the recorded result.** Condition (b) is what most harnesses miss — they assume \"same tool, same args, same result,\" which holds only for pure functi...",
    "decision_boundary": "The decision boundary is whether the tool surface is *closed under replay*. A tool is closed under replay if its recorded result can be substituted for its live result without changing the agent's behavior — i.e., the agent is a pure function of (context, model output, recorded tool results). For tools that return opaque handles (page IDs, transaction IDs, t...",
    "operational_effect": "The practical consequence is that forensic replay systems must classify the tool surface *before* replay, not after. A trace containing a single non-idempotent, handle-returning tool call is not dynamically replayable, and attempting it produces both a side effect and a divergent reconstruction. The correct posture is to fail closed: refuse dynamic replay 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": "5523432ab8239a817f8fa83acf8ab8c221aed25eb31aa693ebf5b8694b956c50",
    "verified_classes": [
      "NonReplayableTraceError"
    ],
    "verified_functions": [
      "assert_dynamically_replayable"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "NonReplayableTraceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
