{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-speculate-on-a-tool-call-whose-side-effects-cannot-be-compensated",
  "title": "When must an instance refuse to speculate on a tool call whose side effects cannot be compensated",
  "date_of_record": "2026 November 14",
  "scope": "Applies to agent runtimes that speculatively pre-execute tool calls (file writes, HTTP mutations, shell commands, message sends) ahead of the model's final decision, gating or compensating afterward. Does *not* apply to pure-read tool calls, to calls whose effects are fully transactional and atomic-rollbackable, or to speculative execution performed against an isolated shadow environment.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-speculate-on-a-tool-call-whose-side-effects-cannot-be-compensated.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-speculate-on-a-tool-call-whose-side-effects-cannot-be-compensated.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-speculate-on-a-tool-call-whose-side-effects-cannot-be-compensated.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1378,
    "python_slice_tokens": 194,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is not \"does this tool have side effects\" but \"is the side effect *reversible with bounded cost and bounded blast radius*.\" Speculative pre-execution is safe when the compensation is (a) deterministic, (b) idempotent, and (c) observable to the caller. It is unsafe when the speculative call *emits* an effect that leaves the runtim...",
    "what_was_observed": "In a production agent loop, the runtime speculatively pre-executed a `send_notification` tool call while the model was still deliberating between two plans. The gate held the call for 180 ms pending the final decision token. The model then chose the *other* plan, and the runtime invoked the tool's registered `compensate()` — a `delete_notification` call — which returned 200 OK. The runtime logged the speculation as s...",
    "condition_of_validity": "Speculative pre-execution of a tool call is valid only if, for every effect `e` the call can emit, one of the following holds before the gate resolves: 1. `e` is held in a runtime-controlled outbox and not dispatched until the gate commits; or 2. `e` is dispatched to a recipient that the runtime can prove has not yet observed it (rare, and generally unprovab...",
    "decision_boundary": "The boundary is drawn at the point of *dispatch*, not the point of *invocation*. Concretely: a tool call whose effect is buffered in an outbox may be speculated freely, because the gate resolves before dispatch. A tool call that dispatches synchronously to an external system must be classified by its effect's observability. The classification that agents get...",
    "operational_effect": "The runtime must maintain an effect-class registry: each tool declares whether its effects are `BUFFERED`, `REVERSIBLE` (provably state-restoring), or `IRREVERSIBLE`. Speculation is permitted only for `BUFFERED` and `REVERSIBLE`; `IRREVERSIBLE` calls are deferred and executed only after the gate commits. The registry must be conservative: absent a proof of s..."
  },
  "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": "c1681988a4e4770fd02eeeb3a2ba8f4926201deaebb388ea2ba14b68b725dfad",
    "verified_classes": [
      "UncompensatableSpeculationError"
    ],
    "verified_functions": [
      "gate_speculation"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UncompensatableSpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
