{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-replayed-agent-trace-as-evidence-rather-than-as-a-fresh-execution-the-tool-side-effect-divergence-bound",
  "title": "Under what conditions must an instance treat a replayed agent trace as evidence rather than as a fresh execution: the tool-side-effect divergence boundary in counterfactual debugging",
  "date_of_record": "2026 November 28",
  "scope": "Applies to counterfactual debugging and deterministic replay of recorded agentic execution traces where the agent's tool calls have external side effects (writes, sends, charges, state mutations) and the replay harness re-executes the reasoning loop against recorded or live tool responses. Does not apply to purely observational trace inspection, prompt-only A/B testing, or replay of stateless single-turn inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-replayed-agent-trace-as-evidence-rather-than-as-a-fresh-execution-the-tool-side-effect-divergence-bound.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-replayed-agent-trace-as-evidence-rather-than-as-a-fresh-execution-the-tool-side-effect-divergence-bound.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-replayed-agent-trace-as-evidence-rather-than-as-a-fresh-execution-the-tool-side-effect-divergence-bound.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2724,
    "python_slice_tokens": 444,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A recorded agent trace is a *log of a causal process*, not a *program*. Replaying it re-runs a probabilistic sampler over a state that the original run mutated. The critical distinction is between **replay as evidence** (the replayed trace is a faithful counterfactual of the original, and any divergence is attributable to a single intervened variable) and **...",
    "what_was_observed": "A three-step agent was recorded processing a refund request. The trace: - Step 1: `get_order(order_id=8841)` → `{status: \"shipped\", amount: 4200}` - Step 2: `issue_refund(order_id=8841, amount=4200)` → `{refund_id: \"rf_77\", status: \"accepted\"}` - Step 3: `send_confirmation(customer_id=..., refund_id=\"rf_77\")` → `{delivered: true}` The debugger wanted to test a counterfactual: *what if the model had been given a diffe...",
    "condition_of_validity": "A replayed agent trace is admissible as evidence for a counterfactual claim **if and only if** the following invariant holds at every tool call in the replayed prefix: > **Effect-Equivalence Invariant.** For each tool call *c* in the replayed prefix, the world-state produced by the replay's handling of *c* is observationally equivalent, from the agent's pers...",
    "decision_boundary": "The harness must make a binary decision at each tool call, and the decision must be *derived from the tool's declared effect class*, not from observed behavior: - **Admit as evidence** when the call is within the admissible prefix (all prior calls satisfy the invariant) and the current call's handling is declared and checked against one of the three construc...",
    "operational_effect": "Enforcing the invariant changes three things in practice. First, replay harnesses must record, per tool call, the *idempotency key* and the *pre/post world-state fingerprint* (a hash of the observable state the agent reads), not just the return value. The fingerprint is what lets the harness assert precondition equivalence for stubbed calls; without it, cons..."
  },
  "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": "bebb8850149dde088ac10298915bb4d5a0de9f0171dde4b161e02545d937b5a8",
    "verified_classes": [
      "EffectClass",
      "ReplayBoundaryError",
      "ToolCall"
    ],
    "verified_functions": [
      "locate_boundary",
      "attribute_divergence"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
