{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-invalidate-a-speculative-tool-call-prefetch-before-the-safety-fence-commits",
  "title": "When must an instance invalidate a speculative tool-call prefetch before the safety fence commits",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent runtimes that issue tool calls speculatively (prefetching results for a likely next step) behind a safety fence that gates side effects until the reasoning branch is confirmed. Does not apply to purely read-only, idempotent, cache-keyed retrievals with no fence, nor to single-shot tool calls with no speculative branch.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-invalidate-a-speculative-tool-call-prefetch-before-the-safety-fence-commits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-invalidate-a-speculative-tool-call-prefetch-before-the-safety-fence-commits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-invalidate-a-speculative-tool-call-prefetch-before-the-safety-fence-commits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1656,
    "python_slice_tokens": 301,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A speculative tool-call prefetch is safe when the *predicted* next action and the *committed* next action are the same call against the same argument tuple. The failure mode is subtler than \"wrong prediction\": the prefetch can be *correct in intent* but *stale in argument binding* because the model's reasoning loop mutated a variable (an identifier, a path, ...",
    "what_was_observed": "An agent runtime (planner → executor loop, ~8 tool calls per task) prefetched `write_record(id=..., payload=...)` while the model was still mid-reasoning on a prior step. The prefetch was dispatched with `id=\"acct_4471\"`, derived from an earlier `lookup_account` result. Between dispatch and fence commit, the model executed another `lookup_account` call whose result superseded the first (the account had been merged; t...",
    "condition_of_validity": "The safety fence is sound only under the conjunction: - **Provenance closure:** every argument in the prefetch carries a `derived_from` set of reasoning-step ids and tool-result ids. - **Invalidation propagation:** when any tool result in `derived_from` is superseded (a later call to the same tool returns a result that the runtime classifies as a revision — ...",
    "decision_boundary": "The boundary between \"prefetch is safe to commit\" and \"must be invalidated\" is crossed at the first moment a superseding tool result lands for any argument source. Concretely: - **Commit** when: `prefetch_token.state == valid` AND re-serialized committed args equal prefetch args AND no superseding result has landed for any `derived_from` entry since dispatch...",
    "operational_effect": "Runtimes that implement equality-only fences see a low, persistent rate of orphaned writes and reconciliation churn — typically 0.1–2% of write-class tool calls in tasks with merge/version semantics, near zero in tasks without. The failures cluster in tasks where a tool's result is *revisable* (accounts merge, documents get new versions, recipients change ad..."
  },
  "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": "5dd306f381be00478d3480bb5e28f06024dfd1836b58c0537d888526a35b44ad",
    "verified_classes": [
      "StalePrefetchCommitError",
      "ToolResult",
      "PrefetchToken",
      "Fence"
    ],
    "verified_functions": [
      "run_prefetch_cycle",
      "__init__",
      "observe",
      "invalidate_affected",
      "commit"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StalePrefetchCommitError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
