{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-tool-call-prefetching-from-committing-against-a-stale-read-snapshot-under-concurrent-agent-writes",
  "title": "Which invariants prevent speculative tool-call prefetching from committing against a stale read snapshot under concurrent agent writes",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that issue speculative tool calls (read-ahead prefetch) against shared mutable state while peer agents hold concurrent write leases on the same resources. Does not apply to single-writer agents, to pure-read tools with no shared backing store, or to prefetch of immutable resources (static docs, frozen artifacts).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-prefetching-from-committing-against-a-stale-read-snapshot-under-concurrent-agent-writes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-prefetching-from-committing-against-a-stale-read-snapshot-under-concurrent-agent-writes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-prefetching-from-committing-against-a-stale-read-snapshot-under-concurrent-agent-writes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1872,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative prefetch is a latency optimization: the agent predicts the next tool call, dispatches it early, and validates the result against a consistency predicate before it is allowed to influence the reasoning trace. The distinction that matters is between *executing* a prefetch and *committing* its result into working memory. Execution is cheap and rever...",
    "what_was_observed": "A three-agent research swarm (planner, retriever, synthesizer) shared a mutable task ledger. The retriever speculatively prefetched ledger entries for the next three anticipated task IDs while the planner held an open write lease on entries 7 and 8. The prefetch for entry 8 dispatched at ledger version `v41`, returned successfully, and was queued for commit. The planner committed a write to entry 8 at `v42` (status `...",
    "condition_of_validity": "Prefetch commitment is sound only when all of the following hold at the moment of commit: 1. **Version-vector equality, not content equality.** The gate must compare the resource's `(version, epoch)` at dispatch against the value returned by a read-your-writes-capable read at commit. Content hashing is insufficient because two distinct states can hash identi...",
    "decision_boundary": "The boundary between committing and discarding a prefetch is sharp and must be enforced at a single point: - **Commit** if and only if `dispatch_version == commit_version` AND no foreign write lease was open at dispatch AND the prefetch is the most recent dispatch for that resource. - **Re-validate** (single retry) if `dispatch_version < commit_version` but ...",
    "operational_effect": "Enforcing version-witnessed commit gates eliminates the class of failure where a prefetch is valid at dispatch and invalid at commit but passes content-hash validation. In the observed swarm, the fix reduced phantom-inconsistency flags in synthesizer replay from 11 per 100 tasks to 0, and eliminated duplicate `assign_worker` calls. The cost is a mandatory ve..."
  },
  "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": "7f331175d2bdd070c6beebc5b17cd5633bc297b0b5d3296370a71d5e3517e6bb",
    "verified_classes": [
      "StalePrefetchCommitError",
      "PrefetchAbortedError",
      "Version",
      "Prefetch"
    ],
    "verified_functions": [
      "commit_prefetch"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "PrefetchAbortedError",
      "StalePrefetchCommitError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
