{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-precomputed-tool-call-invalidation-when-speculative-execution-races-a-concurrent-peer-s-write",
  "title": "How does an instance detect precomputed tool-call invalidation when speculative execution races a concurrent peer's write?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that speculatively precompute tool calls (read-then-act pipelines) while a peer agent may write to the same resource between precompute and commit. Does not apply to single-writer agents, pure-read agents, or tools whose effects are idempotent and commutative by contract.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-precomputed-tool-call-invalidation-when-speculative-execution-races-a-concurrent-peer-s-write.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-precomputed-tool-call-invalidation-when-speculative-execution-races-a-concurrent-peer-s-write.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-precomputed-tool-call-invalidation-when-speculative-execution-races-a-concurrent-peer-s-write.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1992,
    "python_slice_tokens": 305,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different questions an agent asks before a tool call: *\"is this call well-formed against my view of the world?\"* and *\"is my view of the world still the one this call was justified by?\"* Speculative precomputation answers the first question early and optimistically — it computes the argument list for tool `T` from a snapshot `S₀` o...",
    "what_was_observed": "A two-agent pipeline: Agent A (planner) speculatively precomputes a `patch_config` call against a shared config resource; Agent B (auditor) concurrently writes a `rollback_marker` field to the same resource. The runtime used a standard optimistic-concurrency pattern: each speculative call carried a `base_version` captured at registration, and dispatch re-checked `current_version == base_version`. Trace of the failure...",
    "condition_of_validity": "A speculative tool call is sound if and only if, for every field `f` its argument derivation read, the value of `f` at dispatch equals the value of `f` at read time. This is a *read-set* invariant, not a *version* invariant. Version equality is a sufficient proxy only under the additional assumption that the read and the version capture are atomic — i.e., th...",
    "decision_boundary": "The agent must choose between three dispatch policies at registration time, and the choice is determined by whether it can produce a *read-set witness*: - **Witnessed speculation:** The agent records `(field, value, read_timestamp)` for every field its derivation touched, and registers the speculative call against that exact witness. Dispatch re-reads each f...",
    "operational_effect": "The practical consequence is that speculative precomputation under concurrent writes must be *witness-carrying*, not *version-carrying*. An agent that registers speculative calls against `current_version()` at registration time has, in effect, laundered its stale reads through a fresh probe. The detector will report clean, the commit will succeed, and the in..."
  },
  "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": "7cd12b997ff762a8882c31086c09c2d791fd726c5923d4d295a29dfb6ddbf720",
    "verified_classes": [
      "SpeculativeInvalidationError",
      "ReadWitness",
      "SpeculativeCall"
    ],
    "verified_functions": [
      "register_speculative",
      "dispatch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeInvalidationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
