{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-replaying-a-multi-agent-trace-diverge-from-the-original-execution-when-tool-side-effects-are-non-idempotent",
  "title": "Why does an instance replaying a multi-agent trace diverge from the original execution when tool side-effects are non-idempotent?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to forensic replay of recorded multi-agent traces where the replaying instance re-executes reasoning steps and tool calls against live or partially-live dependencies. Does not apply to pure log-analysis replay where tool outputs are read from the trace and never re-invoked.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-replaying-a-multi-agent-trace-diverge-from-the-original-execution-when-tool-side-effects-are-non-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-replaying-a-multi-agent-trace-diverge-from-the-original-execution-when-tool-side-effects-are-non-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-replaying-a-multi-agent-trace-diverge-from-the-original-execution-when-tool-side-effects-are-non-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2226,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two meanings of \"deterministic replay\" that get conflated during incident response, and the conflation is the entire failure. **Recorded-output replay** substitutes the logged tool result for a fresh invocation; it is deterministic by construction because the environment is frozen. **Re-execution replay** re-drives the agent graph—same prompts, sam...",
    "what_was_observed": "A three-agent incident (planner → executor → auditor) was traced. The executor's step 7 called `ticket.update(status=\"in_progress\", assignee=self)`. During replay, step 7 was re-executed against the same ticket service. The service returned `409 Conflict` because the ticket was already `in_progress` and already assigned—the *original* run had left it that way. The original executor had received `200 OK` with a fresh ...",
    "condition_of_validity": "Re-execution replay is forensically valid **only if** the following invariant holds for every tool in the trace: > For all tools `t` invoked at step `i`, `t(args_i)` must return a response envelope `r_i` that is byte-identical between the original execution and the replay, *or* the replay must substitute the recorded `r_i` and never invoke `t` live. This is ...",
    "decision_boundary": "The decision is not \"replay or don't replay.\" It is **which replay mode is admissible given the trace's tool inventory**, and the boundary is sharp: - If the trace contains **only** pure reads and pinned-model sampling, re-execution replay is admissible and is the strongest forensic tool available—it tests whether the model would still make the same decision...",
    "operational_effect": "The operational consequence is that the replay harness must be a **trace-rewriting system**, not a re-executor. Concretely: 1. **Classify tools at trace-recording time.** Each trace entry carries `tool_class ∈ {PURE, ENVELOPE_DIVERGENT, MUTATOR, NONDETERMINISTIC}` and a `response_hash`. The recorder is the only component that sees the true live envelope, so ..."
  },
  "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": "9c4144e47c8986cf221949e418f333f07f23b04db46d35b460fc185cd2445fa1",
    "verified_classes": [
      "ReplayContaminationError",
      "ToolClass",
      "TraceStep"
    ],
    "verified_functions": [
      "_hash",
      "replay_step",
      "replay_trace"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReplayContaminationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
