{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-pre-executes-speculative-tool-calls-against-a-verifier-that-later-rejects-the-plan-orphaned-side-effects-and-the-commit",
  "title": "What happens when an instance pre-executes speculative tool calls against a verifier that later rejects the plan: orphaned side effects and the commit-gate invariant",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that run a draft-then-verify loop where a planner proposes a multi-step plan (and optionally speculatively executes tool calls) before a verifier accepts it. Does not apply to strictly serial plan→verify→execute pipelines with no speculative execution, nor to read-only tools with no observable side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-pre-executes-speculative-tool-calls-against-a-verifier-that-later-rejects-the-plan-orphaned-side-effects-and-the-commit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-pre-executes-speculative-tool-calls-against-a-verifier-that-later-rejects-the-plan-orphaned-side-effects-and-the-commit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-pre-executes-speculative-tool-calls-against-a-verifier-that-later-rejects-the-plan-orphaned-side-effects-and-the-commit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1858,
    "python_slice_tokens": 380,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative planning conflates two things that must stay separate: *reasoning about a plan* and *committing the plan's side effects*. In a verifier-in-the-loop architecture, the planner is a fast, high-recall, low-precision component; the verifier is the slow, high-precision acceptor. Speculative tool pre-execution is an optimization that tries to hide verif...",
    "what_was_observed": "A planning agent was asked to reconcile a customer account: read ledger, compute adjustment, post a correcting journal entry, then notify the customer. The planner emitted a 4-step plan and, to reduce latency, the runtime speculatively pre-executed steps 1–3 (read, compute, post) while the verifier audited the plan. The verifier rejected the plan at step 2: the computed adjustment used a stale FX rate because the pla...",
    "condition_of_validity": "The commit-gate invariant is valid — and speculative pre-execution is safe — only when all of the following hold: - **Effect classification is exhaustive and correct.** Every tool is tagged `pure`, `idempotent`, or `effectful`. The classification must be conservative: a tool whose idempotency depends on arguments (e.g., `create_ticket` with a caller-supplied...",
    "decision_boundary": "The operational decision is where to place the fence between speculation and commitment. Three regimes: - **Speculate freely** when the plan's leading steps are pure/idempotent and the first effectful step is far enough down that latency savings dominate. Safe because rejection discards only pure computation. - **Fence at first effectful step** (the default ...",
    "operational_effect": "With the commit gate enforced, verifier rejection becomes a clean state transition: the branch is discarded, no external mutation occurred, and re-planning starts from a known-clean world. Latency cost is bounded by the verifier's decision time on the effectful suffix only. Without it, the system exhibits orphaned side effects, double-application on re-plan,..."
  },
  "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": "d0d2e389a2643c4edc51b26648e7c4d9b4ad0fe0f06db356277f0da5923744ec",
    "verified_classes": [
      "EffectClass",
      "SpeculationViolation",
      "PlanStep",
      "AcceptToken",
      "CommitGate"
    ],
    "verified_functions": [
      "run_speculative_plan",
      "__init__",
      "_is_speculatable",
      "speculate",
      "_record",
      "compensate"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpeculationViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
