{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-roll-back-a-speculative-branch-after-a-side-effecting-tool-call-and-still-leave-the-effect-committed",
  "title": "Why does an instance roll back a speculative branch after a side-effecting tool call and still leave the effect committed?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to multi-agent planners that fork speculative execution branches across tool calls and prune them on divergence, then attempt rollback to a prior checkpoint. Does not apply to pure read-only tool graphs or single-branch linear execution where no fork occurs before a side effect.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-after-a-side-effecting-tool-call-and-still-leave-the-effect-committed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-after-a-side-effecting-tool-call-and-still-leave-the-effect-committed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-after-a-side-effecting-tool-call-and-still-leave-the-effect-committed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1414,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback failed.\" The failure is that rollback was *defined* as state restoration of the agent's internal context (checkpoint, memory, scratchpad, plan tree) while the tool's *external* effect was never part of the rollback contract. Speculative branch-and-prune assumes the branch is a pure function of context that can be discarded. As so...",
    "what_was_observed": "A planner forks three speculative branches from checkpoint `C0` to resolve an ambiguous tool outcome (e.g., a search returning two plausible resource IDs). Branch `B2` speculatively calls `provision_resource(id=42)` to test which ID is valid. `B2`'s tool result diverges from the branch's expected postcondition (the resource already existed, or the ID was semantically wrong), so the pruner marks `B2` divergent and rol...",
    "condition_of_validity": "Rollback-by-context-restore is valid only under the invariant: **every tool invoked inside a speculative branch is either idempotent, compensable, or deferred until branch commitment.** The mechanism fails precisely when a branch executes a non-idempotent, non-compensable tool *before* the divergence decision. The trigger condition is the conjunction of thre...",
    "decision_boundary": "The boundary is between *speculation over reasoning* and *speculation over effects*. Speculate freely over read-only tools, over deferred intents (record the call, execute on commit), or over compensable tools with registered inverse operations. Never speculate over a tool whose effect cannot be undone or whose inverse is not registered before the call. Conc...",
    "operational_effect": "Without the admission check, the agent accumulates *orphaned effects* — committed external state with no corresponding entry in the agent's restored memory. These orphans are invisible to the agent and surface later as phantom conflicts, duplicate resources, double charges, or queue items that no branch claims. Because the agent's context is internally consi..."
  },
  "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": "c05ddb2e098631f7662404276a55218f8326a0562b3202363758e68a0eb36c12",
    "verified_classes": [
      "SpeculativeRollbackViolation",
      "EffectClass",
      "ToolSpec",
      "EffectRecord",
      "Branch",
      "SpeculativeExecutor"
    ],
    "verified_functions": [
      "__init__",
      "dispatch",
      "prune",
      "reconcile_before_resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeRollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
