{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-compensate-a-speculatively-executed-tool-call-the-idempotency-lease-boundary",
  "title": "Where must an instance refuse to compensate a speculatively executed tool call: the idempotency-lease boundary",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agent runtimes that execute tool calls speculatively (ahead of the model's committed decision) and roll them back via compensating actions when the speculation is abandoned. Does not apply to read-only tool calls, to calls executed strictly after commit, or to systems where every tool is provably idempotent under arbitrary replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compensate-a-speculatively-executed-tool-call-the-idempotency-lease-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compensate-a-speculatively-executed-tool-call-the-idempotency-lease-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-compensate-a-speculatively-executed-tool-call-the-idempotency-lease-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1378,
    "python_slice_tokens": 253,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the compensation ran twice\" and not \"the compensation ran after a crash.\" The failure is **compensating a call whose effect has already escaped the compensation's authority boundary** — i.e., the side effect has crossed a lease, an external acknowledgment, or an irreversible external transition that the compensating action cannot retract....",
    "what_was_observed": "A runtime speculatively executed `reserve_inventory(sku, qty)` for a candidate plan, tagging the reservation with a `speculation_id` and a 90-second lease. The model took 140 seconds to commit to a different plan. The reservation's lease had expired at T+90s and the inventory service had, per its own contract, converted the soft hold into a firm allocation visible to other consumers. At T+140s the runtime issued `rel...",
    "condition_of_validity": "Compensation is sound **iff** all of the following hold at the instant the compensating call is issued: 1. The idempotency lease for the original speculation is still actively held by this runtime (not merely recorded as held). 2. No external party has acknowledged or consumed the effect (firm allocation, delivery receipt, downstream commit). 3. The compensa...",
    "decision_boundary": "- **Lease held, no external ack → compensate.** Normal path. Issue compensation, then release lease. - **Lease expired, no external ack → do not compensate blindly.** Attempt lease re-acquisition first; if re-acquired, compensate. If not, escalate to reconciliation, never to compensation. - **Lease held, external ack present → do not compensate.** The effect...",
    "operational_effect": "Runtimes that gate compensation on lease revalidation plus external-ack detection eliminate the silent double-allocation class entirely, at the cost of leaving a small population of speculations in a `quarantined` state requiring reconciliation. The observable signature of a correct implementation is that quarantines rise while downstream corruption falls; t..."
  },
  "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": "9e96e510127eca23210d052478b7e3306809195404a0c68e29f6a08e1e25cbe6",
    "verified_classes": [
      "CompensationRefused",
      "Speculation"
    ],
    "verified_functions": [
      "compensate",
      "_issue_compensation"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompensationRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
