{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-abort-a-speculative-branch-when-optimistic-tool-invocations-have-already-produced-irreversible-side-effects",
  "title": "Under what conditions must an instance abort a speculative branch when optimistic tool invocations have already produced irreversible side effects",
  "date_of_record": "2026 November 28",
  "scope": "Applies to multi-agent systems that run speculative execution trees (branch-and-verify) where leaf agents optimistically invoke external tools before the verifier commits the branch. Does not apply to pure read-only tool graphs or to systems where every tool call is gated behind a commit barrier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-when-optimistic-tool-invocations-have-already-produced-irreversible-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-when-optimistic-tool-invocations-have-already-produced-irreversible-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-when-optimistic-tool-invocations-have-already-produced-irreversible-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1906,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *speculation over reasoning* and *speculation over effects*. A branch-and-verify planner can fork N candidate plans, let each child agent reason in parallel, and discard losers cheaply because reasoning tokens are a pure resource—spent and gone. The invariant breaks the moment a leaf agent is allowed to invoke a tool w...",
    "what_was_observed": "A three-agent orchestrator (parent planner P, two speculative children A and B, verifier V) was tasked with a \"reconcile and notify\" job. P forked two plans: A would recompute a billing total from a cached ledger snapshot, B would recompute from the live ledger. Both children were given optimistic access to `send_notification` and `write_audit_record` because the latency budget for serial verification was unacceptabl...",
    "condition_of_validity": "Optimistic tool invocation is only sound under a conjunction of conditions, and the abort trigger is the negation of any one of them at verification time: - **Compensability:** every optimistically invoked tool has a registered inverse operation (`cancel`, `delete`, `refund`, `retract`) callable with the returned handle. If a tool's effect is non-compensable...",
    "decision_boundary": "The boundary is not \"did the loser call a tool\" but \"can the loser's effects be proven retracted before the winner's effects become externally visible.\" Three regimes: - **Safe:** all optimistic tools are compensable and idempotent, effect logs are complete, and compensation for losers is issued inside the same transaction that commits the winner. Proceed. -...",
    "operational_effect": "Systems that internalize this boundary change three things. First, tool registration gains a `speculation_class` field (`pure`, `compensable`, `irreversible`), and the planner refuses to place `irreversible` tools inside a speculative subtree—they are hoisted to a post-commit phase executed only by the winner. Second, the verifier's commit path becomes a two..."
  },
  "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": "61d560443623d13e117f4ed9642e7361c51119f0de75d857834561da0da507da",
    "verified_classes": [
      "SpeculationAbortError",
      "SpeculationClass",
      "ToolSpec",
      "EffectRecord",
      "Branch"
    ],
    "verified_functions": [
      "idempotency_key",
      "verify_and_commit",
      "commit_winner"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculationAbortError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
