{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-merges-speculative-branches-whose-side-effects-already-escaped-the-sandbox",
  "title": "What happens when an instance merges speculative branches whose side effects already escaped the sandbox",
  "date_of_record": "2026 December 1",
  "scope": "Applies to orchestrators that fan out a task into parallel speculative branches (draft-then-arbitrate), where each branch executes tool calls with external side effects and only the winning branch's state is committed. Does not apply to read-only speculative decoding, pure-compute branches, or single-branch execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-speculative-branches-whose-side-effects-already-escaped-the-sandbox.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-speculative-branches-whose-side-effects-already-escaped-the-sandbox.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-speculative-branches-whose-side-effects-already-escaped-the-sandbox.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1819,
    "python_slice_tokens": 429,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative multi-agent execution assumes that a branch is a *transaction*: if the arbiter rejects a branch, its effects vanish. This holds only when the branch's effects are confined to a copy-on-write state overlay that the merge step controls. The failure mode here is a **side-effect escape**: a losing branch performs an irreversible external action (a wr...",
    "what_was_observed": "A planning agent decomposed \"provision a staging environment\" into three parallel drafts: branch A (Terraform apply against the cloud provider), branch B (Helm chart install against the cluster), branch C (a conservative dry-run). All three were dispatched within the same speculative window. The arbiter's policy was \"prefer the branch whose plan diff is smallest and whose dry-run validation passes\"—a reasonable heuri...",
    "condition_of_validity": "The transactional assumption is valid **iff** every effect a branch can produce is either (a) confined to an overlay the arbiter controls, or (b) recorded in a *compensation log* that the rollback path replays against the external system. Formally, for each branch effect `e`, one of: - `e ∈ Overlay` (reversible by discard), or - `e ∈ Compensable` and `rollba...",
    "decision_boundary": "The architecture must decide, per tool call, whether it is **speculation-safe** before dispatch, not after. The boundary is drawn at the tool-schema layer: The guardrail is a **pre-dispatch effect classification** plus a **compensation-log invariant**: a branch may not commit an external effect unless the inverse is recorded in the same atomic step. If the i...",
    "operational_effect": "The observable consequence of getting this wrong is **orphaned external state**: resources, messages, and side effects that exist in the world but are referenced by no committed agent state. These orphans are worse than ordinary failures because they are *silent*—every component reports success, and the divergence only surfaces via out-of-band signals (billi..."
  },
  "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": "56abbb6850c0e80c2f8aac15d038d68b7eed54732b9db5534b16f7aedbad486b",
    "verified_classes": [
      "EffectClass",
      "SpeculationEscapeError",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "rollback",
      "arbitrate",
      "record_effect"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SpeculationEscapeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
