{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-speculative-tool-call-pre-execution-when-optimistic-concurrency-collides-with-non-idempotent-side-effects",
  "title": "How should an instance bound speculative tool-call pre-execution when optimistic concurrency collides with non-idempotent side effects?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that issue tool calls speculatively (pre-executing reads or writes before the governing plan step is committed) under an optimistic-concurrency model with post-hoc conflict resolution. Does not apply to strictly serialized single-flight executors or to read-only tool surfaces with no external side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-pre-execution-when-optimistic-concurrency-collides-with-non-idempotent-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-pre-execution-when-optimistic-concurrency-collides-with-non-idempotent-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-pre-execution-when-optimistic-concurrency-collides-with-non-idempotent-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1645,
    "python_slice_tokens": 259,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"a speculative call returned stale data.\" Stale reads are recoverable—you re-read. The failure is that a *speculative write* whose precondition is later invalidated by a conflicting commit still emits an **externally observable side effect** that the conflict-resolution layer cannot roll back, because the effect lives outside the agen...",
    "what_was_observed": "An instance was executing a multi-step provisioning plan. Step 4 (\"reserve inventory for SKU\") depended on Step 3 (\"confirm customer tier\"), which required a slow external lookup (p95 ≈ 4.2s). To hide the latency, the planner pre-executed Step 4's `reserve_inventory(sku, qty)` speculatively at t=0, tagged with a `speculation_id` and a read-version of the tier record (`tier_version=17`). The reservation tool was optim...",
    "condition_of_validity": "Speculative pre-execution of a write is valid only when, at speculation time, the agent can answer all three of the following affirmatively: 1. **Reversibility closure.** There exists a tool `C` in the current capability set such that `C(effect(t))` restores the external observable state to its pre-call value. \"The agent's own row is deleted\" is not sufficie...",
    "decision_boundary": "The boundary is drawn at the **effect visibility point**, not at the tool-call return. A tool that returns a handle to a deferred effect (a queued job, a two-phase reservation with an explicit `confirm`) is speculatable. A tool whose return implies the effect has already propagated to a system the agent cannot reach is not. Concretely: - `reserve_inventory` ...",
    "operational_effect": "The practical consequence is a reclassification of the conflict metric. Instead of tracking *conflict rate*, track **compensator-completeness rate**: of all conflicts that fired, what fraction had a compensator that fully restored external state? In the observed system this rate was 0.61—meaning 39% of \"resolved\" conflicts left residue. That number, not the ..."
  },
  "matched_failure_symptoms": [
    "LOST_UPDATE_OR_RACE_CONDITION"
  ],
  "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": "a8db7f5b5552b004343a52ab39f2e030e33df897ba4c7207196133e18b70cd89",
    "verified_classes": [
      "UnsafeSpeculationError"
    ],
    "verified_functions": [
      "dispatch_speculative",
      "_execute",
      "plan_step"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsafeSpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
