{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-speculative-tool-call-prefetching-when-the-speculation-cost-model-and-the-abort-path-disagree-about-what-wasted-means",
  "title": "How should an instance bound speculative tool-call prefetching when the speculation cost model and the abort path disagree about what \"wasted\" means",
  "date_of_record": "2026 November 14",
  "scope": "Applies to agent runtimes that issue speculative tool calls (prefetch) alongside a primary reasoning path, where a cost model predicts the expected value of speculating and an abort path can cancel in-flight tool calls. Does not apply to purely sequential tool-call loops, nor to speculative decoding of model tokens, where the abort unit is a token rather than an external side-effecting call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-prefetching-when-the-speculation-cost-model-and-the-abort-path-disagree-about-what-wasted-means.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-prefetching-when-the-speculation-cost-model-and-the-abort-path-disagree-about-what-wasted-means.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-speculative-tool-call-prefetching-when-the-speculation-cost-model-and-the-abort-path-disagree-about-what-wasted-means.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1594,
    "python_slice_tokens": 194,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of cost in a speculative tool-call prefetcher, and they are routinely conflated: 1. **Speculation cost** — the cost model's estimate of what it costs to *launch* a speculative call and discover it was unnecessary. This is the number the scheduler optimizes: `P(hit) * latency_saved - P(miss) * launch_cost`. 2. **Abort cost** — t...",
    "what_was_observed": "In a runtime that prefetched retrieval and code-execution tool calls based on a hit-probability estimate, we observed the following under load: - The cost model reported speculative execution as net-positive (mean predicted savings +12ms per turn) because it charged a miss at `launch_cost = 3ms` and credited a hit at `latency_saved = 40ms` with `P(hit) ≈ 0.35`. - The abort path, however, could not cancel in-flight re...",
    "condition_of_validity": "The speculative prefetcher is only sound when all of the following hold: 1. **Abort is observable.** The abort path can determine whether the remote call actually stopped, or the tool is declared non-cancellable and the miss penalty is set to the full call cost. 2. **Abort cost is bounded by the miss penalty.** Formally, `realized_abort_cost ≤ miss_penalty` ...",
    "decision_boundary": "The operational decision is: **when the abort path cannot prove cancellation, treat the speculative call as completed, not aborted.** Concretely, the boundary is crossed at the point where the abort path reports success without a cancellation receipt from the tool. At that point the runtime must: - Reclassify the call from `aborted` to `orphaned`, and charge...",
    "operational_effect": "After reclassifying unverified aborts as orphans and charging full cost, the observed effects were: - Predicted net savings for the retrieval tool flipped from +12ms to −9ms per turn, correctly retiring speculation for that tool. - Primary-path tail latency returned to baseline within one rate-limit window, because speculative calls no longer competed for th..."
  },
  "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": "95cc8b36092e499646418011679497e2e7e587f74c7f764befacb8348fe6c7b5",
    "verified_classes": [
      "UnverifiedAbortError",
      "SpeculationCostModel"
    ],
    "verified_functions": [
      "admit_speculation",
      "__init__",
      "net_expected_value_ms",
      "should_speculate"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnverifiedAbortError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
