{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-the-counterfactual-fan-out-of-an-observability-replay-trace-when-tool-call-side-effects-are-non-idempotent",
  "title": "Where must an instance bound the counterfactual fan-out of an observability replay trace when tool-call side effects are non-idempotent",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime that records tool-call traces for offline replay and counterfactual debugging (\"what if the model had chosen tool B instead of tool A at step 7?\"). Does not apply to pure read-only tool surfaces or to traces where all tool effects are provably idempotent and side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-counterfactual-fan-out-of-an-observability-replay-trace-when-tool-call-side-effects-are-non-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-counterfactual-fan-out-of-an-observability-replay-trace-when-tool-call-side-effects-are-non-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-counterfactual-fan-out-of-an-observability-replay-trace-when-tool-call-side-effects-are-non-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1787,
    "python_slice_tokens": 315,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A replay trace is *observationally faithful* when re-executing the recorded sequence reproduces the recorded observations. A counterfactual replay is *causally valid* only when the branch point is the *last* state-modifying tool call. These are different invariants, and conflating them is the failure mode this record covers. The naive mental model — \"replay ...",
    "what_was_observed": "A coding agent at step 7 called `create_branch(repo, name=\"fix-142\")` against a live git remote. Step 8 called `push(branch, commit)`. Step 9 failed validation and the task was abandoned. An operator wanted to ask: *would `create_branch` with name `fix-142-v2` have avoided the step-9 failure?* The replay harness forked at step 7, re-issued the counterfactual `create_branch`, then replayed the recorded step 8 and step...",
    "condition_of_validity": "A counterfactual replay fork at step *k* is *causally valid* iff all of the following hold at fork time: - **Precondition reconstructability.** The world state assumed by step *k*'s tool schema can be reconstructed exactly. For `create_branch`, this means the branch must not already exist — a precondition that the real trajectory violated by the time replay ...",
    "decision_boundary": "The harness must classify every tool call in the trace along two axes before allowing a fork: For the `create_branch`/`push` case: `create_branch` is non-idempotent and reversible only with an explicit compensating `delete_branch`; `push` is non-idempotent and irreversible (force-push semantics aside). Therefore a fork at step 7 requires a snapshot, and step...",
    "operational_effect": "Without this boundary, counterfactual debugging produces confident, wrong causal attributions. The `fix-142-v2` fork reported \"naming is not causal\" when in fact the harness had never tested naming — it had tested a spliced trace. Operators acting on such reports will mis-attribute failures to the wrong step, disable the wrong guardrail, and leave orphaned s..."
  },
  "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": "531e6f5dbc8171ca3f6fe334080c05665d41071e0cd46afce6b190d3124eb773",
    "verified_classes": [
      "EffectClass",
      "CounterfactualForkError",
      "ToolCall"
    ],
    "verified_functions": [
      "assert_forkable"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CounterfactualForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
