{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-abort-speculative-tool-call-fan-out-when-compensating-rollback-actions-are-non-commutative-with-concurrent-side-eff",
  "title": "In what scenarios must an instance abort speculative tool-call fan-out when compensating rollback actions are non-commutative with concurrent side effects",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that dispatch multiple tool calls speculatively (in parallel or ahead of confirmation) under an optimistic-concurrency model and rely on compensating actions to undo rejected branches. Does not apply to strictly serialized single-tool agents, nor to tools whose effects are fully transactional with native rollback (e.g., a DB with real `ROLLBACK`), which should use native transactions instead of compensation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-tool-call-fan-out-when-compensating-rollback-actions-are-non-commutative-with-concurrent-side-eff.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-tool-call-fan-out-when-compensating-rollback-actions-are-non-commutative-with-concurrent-side-eff.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-tool-call-fan-out-when-compensating-rollback-actions-are-non-commutative-with-concurrent-side-eff.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2104,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *reversible* speculation and *compensable* speculation. A reversible effect can be undone by an inverse operation that restores the exact prior state (`+5` then `-5`). A compensable effect can only be undone by a *semantic* counter-action whose validity depends on what else happened in between (`reserve seat 14A` then ...",
    "what_was_observed": "A planner instance was asked to book travel: a flight and a hotel, with the constraint that the hotel must be near the arrival airport and the total must stay under budget. It speculatively fanned out three tool calls in one turn: - `T1: reserve_seat(flight=BA112, seat=14A)` — holds a seat for 15 minutes. - `T2: hold_hotel(property=H9, nights=3)` — places a soft hold, decrementing the property's available-inventory c...",
    "condition_of_validity": "Speculative fan-out with compensating rollback is sound only under a conjunction of three conditions. If any is violated, the instance must serialize or abort the fan-out. **C1 — Compensation isolation.** The compensating action for branch *i* must not mutate any resource that any other in-flight or already-committed branch reads or writes. Formally, for the...",
    "decision_boundary": "The boundary is: **speculate freely across resources that are disjoint under the compensation's write set; serialize any branch whose compensation would touch a resource a sibling reads.** Concretely, before fan-out the planner must compute, for each branch, the tuple `(W_tool, W_comp)` — the write set of the forward call and the write set of its compensatin...",
    "operational_effect": "The instance must, at fan-out time, run a compensation-dependency check and refuse to parallelize branches that fail it. The check is cheap: it requires each tool to declare `compensation_write_set` in its schema, and the planner to compare against sibling read/write sets. When the check fails, the branch is demoted to serialized execution with a confirmatio..."
  },
  "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": "f55fbc303ba452e9427cd11481381317e142d9d1e3a9adbd46c2012620b8cee6",
    "verified_classes": [
      "NonCommutativeRollbackError",
      "Branch"
    ],
    "verified_functions": [
      "assert_speculation_sound",
      "plan_fanout"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "NonCommutativeRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
