{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-effects-that-were-valid-at-pre-execution-time-but-invalid-at-commit-time",
  "title": "Which invariants prevent speculative tool-call pre-execution from committing effects that were valid at pre-execution time but invalid at commit time",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that pre-execute tool calls speculatively inside a reversible sandbox (memoized or shadow-applied side effects) and only commit them when the parent reasoning step resolves. Does not apply to strictly serial agents that execute one tool call per resolved step, nor to read-only tool calls with no external side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-effects-that-were-valid-at-pre-execution-time-but-invalid-at-commit-time.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-effects-that-were-valid-at-pre-execution-time-but-invalid-at-commit-time.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-effects-that-were-valid-at-pre-execution-time-but-invalid-at-commit-time.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1887,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative pre-execution and speculative *commitment* are two different operations, and conflating them is the source of the failure. Pre-execution answers the question *\"what would this call return if I ran it now?\"* Commit answers *\"may I now make this effect real?\"* A speculative executor that treats a successful sandbox run as a commit warrant has silen...",
    "what_was_observed": "An agent executing a multi-step plan issued two speculative tool calls in parallel from the same reasoning step: `transfer(balance_check, debit 400)` against account A, and `transfer(balance_check, debit 350)` against the same account A whose balance was 500 at pre-execution. Both sandbox runs succeeded because each read the *same* pre-execution snapshot (balance = 500) and each individually satisfied `amount <= bala...",
    "condition_of_validity": "The commit-time revalidation invariant holds only under these conditions: - **Guard re-evaluation is mandatory, not advisory.** Every side-effecting speculative call must carry the exact predicate (and the exact read-set it depended on) that authorized it. At commit, the predicate is re-evaluated against current state, not the snapshot. If the read-set has c...",
    "decision_boundary": "The boundary between \"commit is safe\" and \"commit must be refused or re-planned\" is drawn at the point where the guard predicate's read-set is re-read against live state. Concretely: - **Commit** if the guard predicate re-evaluates true against current state, the effect's write-set is disjoint from every effect committed since pre-execution, and the resolved...",
    "operational_effect": "Without these invariants, speculative pre-execution degrades into a latency optimization that occasionally commits effects the agent would never have authorized had it seen the post-commit state. The failure is silent: the sandbox reports success, the commit reports success, and the corruption surfaces only in the external system (an overdraft, a misaddresse..."
  },
  "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": "60ebdaa1d9713483eb93647f60ec529dfe060a6c0bc04bbb01de4819accd2028",
    "verified_classes": [
      "SpeculativeCommitViolation",
      "SpeculativeEffect"
    ],
    "verified_functions": [
      "commit_speculative",
      "_commutes"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculativeCommitViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
