{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-of-a-replayable-agent-trajectory-diverge-the-non-idempotent-side-effect-invariant-in-counterfactual-forensic-replay",
  "title": "Where must an instance of a replayable agent trajectory diverge: the non-idempotent side-effect invariant in counterfactual forensic replay",
  "date_of_record": "2026 November 9",
  "scope": "Applies to deterministic replay and counterfactual (\"what-if\") auditing of recorded multi-agent trajectories where at least one agent performs externally observable side effects (tool calls, writes, messages, payments). Does not apply to read-only observational traces, nor to replay of pure-computation pipelines with no external effect surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-replayable-agent-trajectory-diverge-the-non-idempotent-side-effect-invariant-in-counterfactual-forensic-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-replayable-agent-trajectory-diverge-the-non-idempotent-side-effect-invariant-in-counterfactual-forensic-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-replayable-agent-trajectory-diverge-the-non-idempotent-side-effect-invariant-in-counterfactual-forensic-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1830,
    "python_slice_tokens": 380,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters operationally is between **replayability of state** and **replayability of effect**. A trajectory is *state-replayable* if re-executing the recorded agent decisions against the recorded tool responses reproduces the same internal state transitions. It is *effect-replayable* only if re-executing those same decisions against the *l...",
    "what_was_observed": "During a post-incident audit of a three-agent pipeline (planner → executor → verifier), the forensic team replayed a recorded trajectory to test the counterfactual: *would the executor have issued the destructive `drop_partition` call if the planner had selected the alternate shard?* The replay harness re-ran the planner with the alternate selection, then re-ran the executor against the live tool gateway. The executo...",
    "condition_of_validity": "Counterfactual replay is valid only under the conjunction: 1. **Token re-verification.** Every side-effecting step carries an idempotency token recorded at original execution time, and the replay harness re-verifies that token against the effect store *before* re-issuing the step. A token that cannot be re-verified (expired, evicted, superseded) invalidates ...",
    "decision_boundary": "The boundary is drawn at the **first unverifiable side effect**, not at the first divergence and not at the first error. Concretely: - If all side-effecting steps up to and including the divergence point have re-verifiable tokens → counterfactual replay is admissible; execute the branch against the effect store. - If the divergence point is at or before the ...",
    "operational_effect": "Adopting this boundary changes the audit contract in three ways. First, every side-effecting step in a recorded trajectory must persist its idempotency token and the full response payload, not just a status code — the downstream-independence check needs the payload. Second, the replay harness must treat a live call during replay as a hard abort with a distin..."
  },
  "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": "98b76fe811d5f857c3c6bbd22b35da531ea27ba7c5b621ddfbd27a233a8ee70b",
    "verified_classes": [
      "ReplayContaminationError",
      "AuditabilityClass",
      "SideEffectStep"
    ],
    "verified_functions": [
      "classify_trajectory",
      "run_counterfactual_branch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReplayContaminationError"
    ],
    "sample_fail_closed_invariants": [
      "live gateway call issued during replay; branch is contaminated and must not be reported as a counterfactual"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
