{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-executes-tool-calls-against-a-stale-lease-and-the-conflict-resolver-commits-the-loser-s-side-effect",
  "title": "What happens when an instance speculatively executes tool calls against a stale lease and the conflict resolver commits the loser's side effect",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent runtimes that dispatch tool calls optimistically before an upstream lease/version check resolves, and that reconcile conflicts by replaying or discarding results. Does not apply to strictly serialized tool execution with synchronous lock acquisition, nor to read-only tool surfaces with no external side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-tool-calls-against-a-stale-lease-and-the-conflict-resolver-commits-the-loser-s-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-tool-calls-against-a-stale-lease-and-the-conflict-resolver-commits-the-loser-s-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-tool-calls-against-a-stale-lease-and-the-conflict-resolver-commits-the-loser-s-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2197,
    "python_slice_tokens": 518,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is not \"optimistic vs. pessimistic concurrency\" in the database sense. It is the difference between **a speculative tool call whose result is discarded** and **a speculative tool call whose side effect already escaped the sandbox**. Databases roll back a transaction; an LLM agent that called `send_email`, `transfer_funds`, o...",
    "what_was_observed": "An agent instance (`A`) was resuming a mid-task checkpoint on a shared resource record `R` at version `v=41`. Its local checkpoint carried `R@41`. Before issuing its next tool call, it read the lease table and saw its own lease `L_A` valid until `t+30s`. It dispatched `tool:append_ledger_entry(R, payload_A)` optimistically, without a compare-and-swap, because the runtime's fast path treats a valid lease as sufficient...",
    "condition_of_validity": "The \"discard on abort\" contract is valid only when the tool call is **idempotent and side-effect-free outside the transaction's visibility scope**. Concretely, the runtime must be able to answer *yes* to all three: 1. **Effect containment:** the tool's external effect is gated behind the same commit barrier as the transaction (e.g., a two-phase write where t...",
    "decision_boundary": "The boundary is between **speculation that can be fenced** and **speculation that has already escaped**. Operationally, the runtime must classify each tool at registration time into one of three tiers, and the classification must be enforced at dispatch, not at resolution: - **Fenced:** effect is invisible until commit token is presented. Safe to speculate. ...",
    "operational_effect": "The downstream consequences compound in a specific, non-obvious way. Because the resolver reported `A`'s transaction as aborted, `A`'s checkpoint was rolled back to `R@41` and `A` re-planned. The re-plan, seeing `R@41` (its stale view) rather than the true `R@42`, generated a *second* `append_ledger_entry` with a corrected payload. That second append is tier..."
  },
  "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": "0a70c91a294c17bd09310f49ffa5e6c8cfd45c8ce364c3619e42839d7dfa1c4b",
    "verified_classes": [
      "ToolTier",
      "SpeculationEscapeError",
      "StaleCheckpointError",
      "Lease",
      "ToolCall",
      "Resource",
      "OptimisticDispatcher"
    ],
    "verified_functions": [
      "__init__",
      "dispatch",
      "resolve",
      "replan"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SpeculationEscapeError",
      "StaleCheckpointError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
