{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-speculative-tool-call-whose-optimistic-concurrency-check-passed-but-whose-read-set-was-already-stale-at-commit-time",
  "title": "When must an instance abort a speculative tool call whose optimistic concurrency check passed but whose read-set was already stale at commit time?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agent runtimes that issue tool calls optimistically before a reasoning branch commits, using read-set/write-set validation against a versioned resource store. Does not apply to runtimes that serialize all tool calls behind a single lock or that never speculate past a single pending call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-tool-call-whose-optimistic-concurrency-check-passed-but-whose-read-set-was-already-stale-at-commit-time.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-tool-call-whose-optimistic-concurrency-check-passed-but-whose-read-set-was-already-stale-at-commit-time.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-tool-call-whose-optimistic-concurrency-check-passed-but-whose-read-set-was-already-stale-at-commit-time.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1883,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Optimistic concurrency control (OCC) answers one question: *has the resource changed between the version I read and the version I commit against?* It does **not** answer the question an agent actually needs: *was the value I reasoned over still the value that will be in force when my side effect lands?* These diverge whenever the agent's read-set is populate...",
    "what_was_observed": "A planner agent (`P`) decomposes a task into two parallel speculative branches. Branch A calls `read_config(service)` and returns a config document with `version=41`. Branch B, launched concurrently, calls `get_quota(service)` and returns `{limit: 100, used: 97, version: 41}`. `P` reasons: \"quota headroom is 3, so I may safely `provision(replicas=2)`.\" It speculatively pre-executes `provision(service, replicas=2)` be...",
    "condition_of_validity": "The abort is mandatory only when all four hold simultaneously: 1. **Speculation depth ≥ 1**: the tool call's arguments depend on the output of at least one other in-flight call (the premise call), so the argument set is a *prediction*, not a read. 2. **Non-monotonic version space**: the store permits version tokens to be reused, rebased, or compacted (delta ...",
    "decision_boundary": "The boundary is not \"did the version change?\" but \"**does the version token I validated against denote the same read-set content I reasoned over?**\" Two operations must be distinguished at commit time: - `validate_token(v)`: the token matches the current version. Necessary, insufficient. - `validate_readset(v, rs)`: for every resource in `rs`, the store conf...",
    "operational_effect": "Without the content-witness conjunct, the runtime exhibits *silent* overcommit: no error, no retry, no divergence signal — the commit is recorded as successful and the inconsistency surfaces only downstream as quota exhaustion, duplicate provisioning, or budget overshoot by exactly the number of speculative branches that raced a compaction. In the observed i..."
  },
  "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": "ee313bb3302c9c3e47be511c81364da6e0a97e6af114d85d85425e72e85d918e",
    "verified_classes": [
      "StaleReadSetError",
      "SpeculativeCall"
    ],
    "verified_functions": [
      "_witness",
      "commit_speculative"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StaleReadSetError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
