{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-abort-speculative-tool-call-prefetch-when-optimistic-execution-collides-with-a-non-idempotent-effect",
  "title": "Under what conditions must an instance abort speculative tool-call prefetch when optimistic execution collides with a non-idempotent effect",
  "date_of_record": "2026 December 3",
  "scope": "Applies to agents that issue tool calls speculatively (prefetching N candidate calls based on a predicted next step) and execute them optimistically before the reasoning trace has committed to that branch. Excludes read-only prefetching into a cache the agent never treats as authoritative, and excludes single-call agents with no branch divergence.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-speculative-tool-call-prefetch-when-optimistic-execution-collides-with-a-non-idempotent-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-speculative-tool-call-prefetch-when-optimistic-execution-collides-with-a-non-idempotent-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-speculative-tool-call-prefetch-when-optimistic-execution-collides-with-a-non-idempotent-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2145,
    "python_slice_tokens": 314,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an agent can do ahead of its own reasoning: *predict* and *commit*. Speculative prefetching conflates them. The agent predicts that its next `k` steps will be `tool_A(args_1), tool_B(args_2), …` and fires them early to hide latency. Optimistic execution means the agent treats those early results as if they were already validated against ...",
    "what_was_observed": "A planning agent was given a task: \"Reconcile the invoice discrepancies in `ledger_q2.csv` and notify the finance channel.\" It prefetched three calls in parallel while still reasoning about which discrepancies were real: 1. `read_csv(\"ledger_q2.csv\")` — read-only, safe. 2. `append_row(\"discrepancies.csv\", row)` — speculative, based on a predicted discrepancy set. 3. `post_message(\"#finance\", summary)` — speculative, ...",
    "condition_of_validity": "Optimistic execution of a speculative tool call is valid only when all three of the following hold at the moment the call is dispatched: 1. **Effect classification is known before dispatch, not after.** The agent must have a static or negotiated classification of the tool's effect class — `READ_ONLY`, `IDEMPOTENT_KEYED`, `REVERSIBLE`, or `NON_IDEMPOTENT` — a...",
    "decision_boundary": "The decision to prefetch optimistically versus gate is a function of two axes: effect class and prediction confidence. The boundary is not \"high confidence → prefetch\" — that is the naive rule and it is wrong. The correct boundary: - **`READ_ONLY`**: prefetch unconditionally. A wrong prediction wastes a call; it cannot corrupt. - **`IDEMPOTENT_KEYED`**: pref...",
    "operational_effect": "The practical consequence is that speculative prefetching must be *split* into two phases with a durable barrier between them: a **predict-and-classify** phase that runs ahead of reasoning, and an **execute** phase that runs only for calls whose effect class and intent record permit it. The barrier is the intent record write. This is the same structure as a ..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "0a025bbc8887c319e0c2ed5ff434815a7f4e7f0bf0e297337326c0ced1481a9a",
    "verified_classes": [
      "EffectClass",
      "SpeculativeDispatchError",
      "IntentRecord"
    ],
    "verified_functions": [
      "dispatch_speculative"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculativeDispatchError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
