{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-diverge-from-its-own-replay-log-when-a-multi-agent-rollback-re-executes-a-checkpointed-tool-call-whose-idempotency-key-was-minted",
  "title": "Why does an instance diverge from its own replay log when a multi-agent rollback re-executes a checkpointed tool call whose idempotency key was minted from wall-clock time?",
  "date_of_record": "2026 November 19",
  "scope": "Applies to agent runtimes that implement rollback by deterministic re-execution of a checkpointed event log across two or more cooperating agents, where tool-call idempotency keys or nonce seeds are derived from timestamps, monotonic clocks, or instance-local entropy. Does not apply to runtimes that roll back via snapshot restore of external side effects, nor to single-agent replay where no peer state is re-derived.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-diverge-from-its-own-replay-log-when-a-multi-agent-rollback-re-executes-a-checkpointed-tool-call-whose-idempotency-key-was-minted.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-diverge-from-its-own-replay-log-when-a-multi-agent-rollback-re-executes-a-checkpointed-tool-call-whose-idempotency-key-was-minted.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-diverge-from-its-own-replay-log-when-a-multi-agent-rollback-re-executes-a-checkpointed-tool-call-whose-idempotency-key-was-minted.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2180,
    "python_slice_tokens": 313,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things a checkpoint can capture: the *decision state* of an agent (its prompt, retrieved context, and sampled token sequence) and the *effect state* of the world (what tool calls actually did). Deterministic replay is only sound when re-execution of the decision state reproduces the same effect state. Most checkpoint systems assume this holds b...",
    "what_was_observed": "A three-agent pipeline — planner (A), executor (B), auditor (C) — ran a task that mutated an external resource registry. Agent B's tool calls carried an idempotency key of the form `sha256(f\"{tool_name}:{resource_id}:{time.time_ns()}\")`. The runtime checkpointed B's message stream and sampled tokens after each turn but did **not** serialize the computed idempotency key, treating it as a derived value that would be re...",
    "condition_of_validity": "Deterministic replay guarantees effect-idempotent rollback **if and only if** every input that determines effect identity is a pure function of checkpointed state. Concretely, the invariant is: > For every tool call `t` in the replayed log, `identity(t)` at replay time must equal `identity(t)` at original-execution time. This invariant holds when `identity(t...",
    "decision_boundary": "The runtime must choose, at checkpoint-write time, one of two disciplines, and must not mix them: - **Identity-in-checkpoint:** serialize the resolved idempotency key (and any nonce) into the checkpoint record alongside the tool call. On replay, use the recorded key verbatim. This is the only discipline that survives clock skew, shared counters, and partial ...",
    "operational_effect": "The immediate effect of the observed failure was a non-terminating rollback loop that consumed ~14 minutes of wall-clock and 9 full swarm replays before an operator killed the run. The secondary effect was worse: the external registry accumulated 9 duplicate handles for `r-4417`, and the post-incident reconciliation required manual deletion because the regis..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "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": "f3994f0ed1254b0aea6675a440424fe0fced43787e5ffb821fc85fb88ebc1dca",
    "verified_classes": [
      "ReplayIdentityDivergence",
      "DedupHorizonExpired",
      "CheckpointedCall",
      "ReplayContext"
    ],
    "verified_functions": [
      "recompute_key",
      "replay_tool_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DedupHorizonExpired",
      "ReplayIdentityDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
