{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-side-effects-that-the-agent-s-eventual-decision-path-never-ratifies",
  "title": "Which invariants prevent speculative tool-call pre-execution from committing side effects that the agent's eventual decision path never ratifies",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents that overlap reasoning with tool execution by speculatively firing calls ahead of the decision that authorizes them (latency-hiding pre-execution, \"eager tool dispatch,\" speculative decoding of action plans). Does not apply to strictly serialized plan-then-act loops where no call is issued before its authorizing decision node is finalized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-side-effects-that-the-agent-s-eventual-decision-path-never-ratifies.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-side-effects-that-the-agent-s-eventual-decision-path-never-ratifies.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-call-pre-execution-from-committing-side-effects-that-the-agent-s-eventual-decision-path-never-ratifies.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2010,
    "python_slice_tokens": 546,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent called the wrong tool.\" It is subtler: the agent called a *plausible* tool speculatively, the speculation was locally correct given the partial reasoning trace at dispatch time, and then the agent's own subsequent reasoning *diverged* from the branch that would have ratified that call. The tool executed against the real world. T...",
    "what_was_observed": "A planning agent was given a task with a branching decision: reconcile a customer record by either (a) issuing a refund or (b) escalating to a human, depending on a downstream lookup of a dispute-history flag. To hide latency, the runtime speculatively pre-dispatched the refund tool call in parallel with the dispute-history lookup, because the partial trace at dispatch time strongly favored the refund branch (the cus...",
    "condition_of_validity": "Speculative pre-execution with side-effect gating is only sound under a conjunction of conditions, all of which must hold simultaneously: - **Gate-before-commit:** the tool must not perform its external effect until a ratification token bound to a committed decision node is presented. The speculative dispatch may prepare, warm, reserve, or stage — but not se...",
    "decision_boundary": "The operational rule is a three-way split on tool class, evaluated at dispatch time: - **Pure/idempotent reads** (lookups, searches, dry-runs): speculate freely. No gate, no compensation needed; a wasted call costs tokens, not state. - **Effectful with a sound inverse** (reserve-then-confirm, stage-then-settle, write-then-revert within window): speculate *be...",
    "operational_effect": "Without the gate, the system exhibits **orphaned-effect accumulation**: side effects that exist in the world but not in the agent's committed trace. These are worse than ordinary errors because they are invisible to the agent's episodic memory — the agent cannot self-correct what it never recorded doing. Downstream symptoms include ledger reconciliation drif..."
  },
  "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": "a8a313e44ba102068fb41fac3a6c0763755a9599f3d685bf5f0f04b8c283658d",
    "verified_classes": [
      "UnratifiedEffectError",
      "MissingCompensationError",
      "RatificationToken",
      "StagedEffect",
      "SpeculativeGate"
    ],
    "verified_functions": [
      "_hash_args",
      "run_divergent_branch",
      "binds",
      "__init__",
      "stage",
      "ratify_and_settle",
      "expire_and_compensate"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "MissingCompensationError",
      "UnratifiedEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
