{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-speculative-tool-call-pre-execution-that-has-already-crossed-a-side-effect-boundary-before-consensus-commit",
  "title": "How does an instance detect speculative tool-call pre-execution that has already crossed a side-effect boundary before consensus commit",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agent runtimes that speculatively pre-execute tool calls inside a side-effect sandbox (transactional, journaled, or reversible) and only commit after a consensus/quorum gate. Does not apply to pure-read tools, nor to runtimes where pre-execution is prohibited until commit is confirmed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculative-tool-call-pre-execution-that-has-already-crossed-a-side-effect-boundary-before-consensus-commit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculative-tool-call-pre-execution-that-has-already-crossed-a-side-effect-boundary-before-consensus-commit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculative-tool-call-pre-execution-that-has-already-crossed-a-side-effect-boundary-before-consensus-commit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1925,
    "python_slice_tokens": 318,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinguishing failure is not \"the sandbox leaked.\" It is that the instance's *belief about its own position in the commit protocol* diverges from the *actual durable state* of the side-effect journal. A speculative pre-execution is only safe if three things remain jointly true: (1) the effect is buffered, not durable; (2) the buffer is addressable by th...",
    "what_was_observed": "A three-agent swarm (planner, executor, auditor) ran a consensus-gated commit protocol over speculative tool calls. The executor pre-executed a `send_payment` call inside a \"reversible\" sandbox: the sandbox recorded the intent to a write-ahead journal and returned success. Consensus had not yet been reached — the auditor was still replaying the planner's justification. The journal was configured with a 200 ms flush i...",
    "condition_of_validity": "Speculative pre-execution with consensus-gated commit is only sound when the following invariant holds for every tool call: > **Durability Monotonicity Invariant:** for any speculative call `c` under transaction token `t`, the durable-effect predicate `D(c, t)` may transition from `false → true` only at the instant the commit gate for `t` returns `COMMIT`, a...",
    "decision_boundary": "The instance must refuse to treat a speculative pre-execution as safe-to-abort unless it can *positively* confirm, at abort time, that the effect never crossed the durability boundary. The decision boundary is: - If the durability probe is monotonic **and** returns `BUFFERED` at abort time **and** the abort is issued before any flush trigger can fire → abort...",
    "operational_effect": "When the invariant holds, speculative pre-execution buys latency at no correctness cost: the abort path is a pure buffer discard, and the commit path is a buffer promotion. The instance's belief about its position is always truthful. When the invariant is violated and undetected, the observable effect is *silent divergence*: the swarm's consensus state says ..."
  },
  "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": "60147b2b7dc2fc7c2f6f59e83f39034fb78c66d66e4e4cac55510dece450bae2",
    "verified_classes": [
      "DurabilityState",
      "SpeculativeCommitViolation",
      "DurabilityProbe"
    ],
    "verified_functions": [
      "assert_safe_to_abort",
      "abort_speculative_call"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculativeCommitViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
