{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-invokes-irreversible-tools-before-the-verifier-branch-commits-the-idempotency-window-invariant-and-rollbac",
  "title": "What happens when an instance speculatively invokes irreversible tools before the verifier branch commits: the idempotency-window invariant and rollback poisoning",
  "date_of_record": "2026 November 19",
  "scope": "Applies to multi-agent planners that fan out speculative branches (draft-and-verify, tree-of-agents, optimistic execution with rollback) where branches may invoke external tools before a verifier selects a winning branch. Does not apply to strictly serialized single-branch execution or to tools that are provably side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-invokes-irreversible-tools-before-the-verifier-branch-commits-the-idempotency-window-invariant-and-rollbac.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-invokes-irreversible-tools-before-the-verifier-branch-commits-the-idempotency-window-invariant-and-rollbac.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-invokes-irreversible-tools-before-the-verifier-branch-commits-the-idempotency-window-invariant-and-rollbac.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1259,
    "python_slice_tokens": 190,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **reversible state** (agent-local memory, scratchpads, draft buffers) and **irreversible external effects** (emails sent, rows committed, tickets opened, payments authorized). Optimistic execution assumes rollback can undo a branch. That assumption holds cleanly for the first class and fails silently for the second. Th...",
    "what_was_observed": "A three-branch speculative planner was spawned against a task requiring a customer refund. Branch A (aggressive) invoked `issue_refund` immediately with a computed amount. Branch B (conservative) invoked `lookup_policy` and `lookup_order` only. Branch C (exploratory) invoked `issue_refund` with a different, rounded amount after a partial policy read. The verifier scored branch B highest because its reasoning trace wa...",
    "condition_of_validity": "Optimistic tool invocation is safe **only** when the tool satisfies at least one of: - It is idempotent under a caller-supplied key that the orchestrator controls and deduplicates across branches (e.g., `refund:{order_id}:{intent_hash}`), *and* the tool honors that key server-side. - It is reversible via a compensating tool that the orchestrator can invoke w...",
    "decision_boundary": "The boundary is between **speculate-then-commit** and **commit-then-effect**: - Below the boundary: tools are side-effect-free or fully idempotent-keyed; branches may invoke freely; rollback is purely local and cheap. - Above the boundary: tools carry irreversible effects; branches may *plan* invocations but must not *execute* them. Execution is deferred to ...",
    "operational_effect": "Without the call-site guard, the system exhibits **rollback poisoning**: the orchestrator's state says \"clean,\" the external world says \"mutated,\" and the divergence is invisible until an out-of-band reconciliation. The blast radius scales with fan-out width and verifier rejection rate — precisely the conditions under which speculative execution is most attr..."
  },
  "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": "bd8fb16c4f021c99e8f316c5e254b15eece8531ee953b5fbe60587cd193cc513",
    "verified_classes": [
      "SpeculativeEffectViolation",
      "ToolSpec",
      "BranchContext"
    ],
    "verified_functions": [
      "dispatch_tool",
      "_invoke"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeEffectViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
