{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-speculative-branch-poisoning-when-optimistic-tool-call-preemption-commits-side-effects-before-the-rollback-frontier-is-val",
  "title": "How does an instance detect speculative branch poisoning when optimistic tool-call preemption commits side effects before the rollback frontier is validated",
  "date_of_record": "2026 November 23",
  "scope": "Applies to multi-agent orchestrators that run speculative branches in parallel, preempt tool calls optimistically (fire-and-commit before branch resolution), and rely on rollback branches to reconcile. Does not apply to systems where tool calls are buffered until branch commit, or where all tool side effects are transactional and reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculative-branch-poisoning-when-optimistic-tool-call-preemption-commits-side-effects-before-the-rollback-frontier-is-val.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculative-branch-poisoning-when-optimistic-tool-call-preemption-commits-side-effects-before-the-rollback-frontier-is-val.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-speculative-branch-poisoning-when-optimistic-tool-call-preemption-commits-side-effects-before-the-rollback-frontier-is-val.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1125,
    "python_slice_tokens": 218,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculation bets that a branch *will* be selected; the cost of being wrong is wasted compute, which is recoverable. Optimistic preemption bets that a tool side effect *will* be needed; the cost of being wrong is an *externally committed effect* — a sent email, a written record, a charged card — which is not recoverable by discarding the branch's local state....",
    "what_was_observed": "A planner agent spawned three speculative branches (A, B, C) for a single user turn. Branch A optimistically preempted a `charge_card` tool call. Branch B, running concurrently, read the customer's balance via a tool that reflected the preempted charge. The selector rejected A and rolled it back; the orchestrator logged `rollback: A -> ok`. But B's subsequent decision was computed against a balance that included a ch...",
    "condition_of_validity": "The rollback frontier is a valid undo boundary **only if** every preempted tool call is either (a) buffered until commit, or (b) idempotent and reversible with a compensating call issued synchronously before sibling branches observe the effect. When a preempted call commits eagerly and its effect is observable to sibling branches before the selector resolves...",
    "decision_boundary": "An instance must treat a branch as *poisoned* (not merely rolled back) when all of the following hold: the branch preempted at least one non-buffered tool call; that call's effect is observable to a concurrent or subsequent sibling; and no compensating action was confirmed before the sibling's read. Rollback of the branch's local state is necessary but not s...",
    "operational_effect": "Systems that conflate rollback with de-poisoning exhibit silent plan corruption under concurrent speculation: turns complete, logs show clean rollbacks, and downstream decisions are wrong by exactly the magnitude of the preempted effect. Detection requires an explicit side-effect ledger reconciled against the rollback frontier at selector resolution, plus 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"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "e88b95205f801cd50fcfe04a4cd343b5bde1ebe4e2d2f7dfb2b395af7d73ee64",
    "verified_classes": [
      "SpeculativePoisonError",
      "Branch"
    ],
    "verified_functions": [
      "detect_poisoning",
      "resolve_selector"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpeculativePoisonError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
