{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-speculative-tool-invocation-before-branch-and-rollback-commits-an-unrollbackable-side-effect",
  "title": "Where must an instance bound speculative tool invocation before branch-and-rollback commits an unrollbackable side effect?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent pipelines that speculatively execute tool calls down multiple reasoning branches and roll back losing branches. Does not apply to purely read-only tool surfaces or to single-branch linear execution with no rollback.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-speculative-tool-invocation-before-branch-and-rollback-commits-an-unrollbackable-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-speculative-tool-invocation-before-branch-and-rollback-commits-an-unrollbackable-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-speculative-tool-invocation-before-branch-and-rollback-commits-an-unrollbackable-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2309,
    "python_slice_tokens": 437,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative execution in an agent pipeline is only sound when *every* operation reachable on a speculative branch is either (a) reversible by construction, or (b) guarded by a two-phase commit that defers the irreversible transition until the branch is selected. The non-obvious boundary is this: **reversibility is a property of the tool's effect, not of the ...",
    "what_was_observed": "A planner agent was asked to reconcile a customer refund. It fanned out three speculative branches in parallel: branch A proposed `issue_refund(amount=full)`, branch B proposed `issue_refund(amount=partial)` then `send_email(apology)`, branch C proposed `escalate_to_human()`. The pipeline was optimistic: it invoked tools as soon as a branch's preconditions were locally satisfied, buffered results, and rolled back the...",
    "condition_of_validity": "The speculation-before-commit pattern is valid only under the following conjunction, checked per branch at the moment a tool is about to fire: - **Effect class is declared and trusted.** Each tool must carry a commitment class: `PURE` (no external effect), `REVERSIBLE_STATE` (effect confined to agent-owned state, rollback is a state restore), `COMPENSABLE` (...",
    "decision_boundary": "The decision the runtime must make, per tool call on a speculative branch, is a single comparison: *does firing this call now move the branch across the commit barrier?* If yes, the call must be staged, not executed, and the branch's score must be recomputed under the staged intent (the scorer can reason about the intent's *predicted* effect without committi...",
    "operational_effect": "Enforcing this boundary changes pipeline behavior in three concrete ways. First, speculative fan-out narrows: branches that would touch `COMPENSABLE` or `IRREVERSIBLE` tools are serialized behind the scorer, which increases latency for exactly the high-stakes decisions where latency matters least and correctness matters most. Second, the scorer must run agai..."
  },
  "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": "4e3c8b9390ceb8b82251f35b3706aa7bad163e29e6de6f5983ba56969d152245",
    "verified_classes": [
      "CommitmentClass",
      "SpeculationBoundaryError",
      "ToolCall",
      "Branch"
    ],
    "verified_functions": [
      "fire_speculatively",
      "rollback"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SpeculationBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
