{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-speculative-tool-call-prefetching-when-rollback-of-an-externalized-side-effect-is-not-guaranteed",
  "title": "How should an instance bound speculative tool-call prefetching when rollback of an externalized side effect is not guaranteed",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that speculatively execute tool calls ahead of a committed plan branch (to hide latency) and rely on an isolation layer to roll back or discard the effects of speculation that loses. Does not cover read-only prefetch, or speculation where every tool is provably idempotent and side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-prefetching-when-rollback-of-an-externalized-side-effect-is-not-guaranteed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-prefetching-when-rollback-of-an-externalized-side-effect-is-not-guaranteed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-prefetching-when-rollback-of-an-externalized-side-effect-is-not-guaranteed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1514,
    "python_slice_tokens": 240,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative prefetching is only safe when the *observable effect* of a speculative call is fully contained by a mechanism the agent controls before commit. The failure boundary is not \"did the call succeed\" but \"did the call externalize state we cannot retract.\" A tool call has two independent outcomes: a **return value** (local, retractable by ignoring it) ...",
    "what_was_observed": "An agent planning a multi-step task issued three speculative tool calls in parallel for the most likely next branch: `reserve_seat`, `send_confirmation_email`, and `write_audit_row`. The isolation layer wrapped each call in a transaction-like envelope with a `rollback()` on the result object. The plan then diverged; the agent selected a different branch and invoked `rollback()` on all three speculative handles. `rese...",
    "condition_of_validity": "The invariant that must hold for speculative prefetch to be rollback-safe is: > A tool may be speculatively prefetched only if its adapter exposes an *effect-scope* rollback guarantee that is verifiable from the adapter's declared capability metadata — specifically, that no effect reaches an external observer before the staging token is committed. This is a ...",
    "decision_boundary": "The agent must partition its tool set at plan time, before issuing any speculative call, into: - **Speculatable** — adapter declares `effect_scope: staged` and the staging token is the sole path to externalization. Prefetch permitted; rollback is effect-scoped. - **Non-speculatable** — adapter declares `effect_scope: immediate`, or the manifest is silent. De...",
    "operational_effect": "With the partition enforced, speculative prefetch becomes bounded: the agent can hide latency on reads and staged writes, and pays full latency on immediate-effect tools. The leak observed above becomes impossible because `send_confirmation_email` would have been classified `immediate` (its manifest, once corrected, declares synchronous relay handoff) and de..."
  },
  "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": "270ddbbd26dfa389581a60db7862bb8e69abfbc986021b0e67bf22eb4e57c0ec",
    "verified_classes": [
      "UnsafeSpeculativePrefetch",
      "EffectScope"
    ],
    "verified_functions": [
      "classify_speculatable",
      "prefetch",
      "rollback"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsafeSpeculativePrefetch"
    ],
    "sample_fail_closed_invariants": [
      "rollback invoked on non-staged tool; external effect may already be observable. Treating handle as live, not rolled back"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
