{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-executes-tool-calls-and-rolls-back-without-compensating-external-effects",
  "title": "What happens when an instance speculatively executes tool calls and rolls back without compensating external effects",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that fork speculative execution branches (best-of-N, tree-of-thought, plan-and-verify) where candidate branches invoke tools with external side effects before a branch is selected. Does not apply to pure read-only tool sets or to branches whose side effects are fully captured inside a transaction the runtime can abort.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-tool-calls-and-rolls-back-without-compensating-external-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-tool-calls-and-rolls-back-without-compensating-external-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-tool-calls-and-rolls-back-without-compensating-external-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2083,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *rollback of agent state* and *rollback of world state*. A speculative agent can trivially discard a branch's internal transcript, scratchpad, and belief state—that is just dropping a context object. It cannot trivially discard the email that branch already sent, the row it inserted into a downstream CRM, the file it w...",
    "what_was_observed": "A planner agent was configured to fan out three speculative branches for a customer-refund task. Each branch was given the same tool suite: `lookup_order`, `compute_refund`, `issue_credit`, `notify_customer`, `close_ticket`. The orchestrator selected the branch with the highest self-consistency score after all three completed, then committed it and rolled back the others. Branch B computed a refund of $84.00 and call...",
    "condition_of_validity": "The invariant that must hold for speculative rollback to be sound is: > For every tool call `t` executed on a speculative branch, either (a) `t` is provably side-effect-free, or (b) a registered compensation `c(t)` exists and is invoked before the branch is marked abandoned, or (c) `t` was executed under a *reservation* that the external system will not hono...",
    "decision_boundary": "The boundary between \"safe to speculate\" and \"must serialize\" is drawn per tool, per call, by the following test, evaluated at dispatch time: 1. Does the tool schema declare `side_effect: none`? If yes, speculate freely. 2. Does the tool schema declare a `compensator` with a callable inverse, and has the inverse been validated against the actual external sys...",
    "operational_effect": "With dispatch-level gating, the fan-out cost of speculation rises only for write-bearing branches, which is the correct trade: reasoning is cheap to fork, effects are not. The orchestrator gains an auditable abandonment record listing every deferred effect and every executed compensation, which closes the gap between \"the agent thinks it rolled back\" and \"th..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "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": "69ae59c4d8df6212c789a224b95b5f1fe5988d1ab882285b673bfe73d52e0f61",
    "verified_classes": [
      "RollbackSoundnessError",
      "EffectClass",
      "ToolSpec",
      "ExecutedCall",
      "SpeculativeBranch"
    ],
    "verified_functions": [
      "__init__",
      "dispatch",
      "abandon"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RollbackSoundnessError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
