{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-speculative-branch-rollback-as-unsafe-when-side-effecting-tool-calls-have-already-escaped-the-sandbox",
  "title": "Under what conditions must an instance treat speculative branch rollback as unsafe when side-effecting tool calls have already escaped the sandbox",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestrators that fork parallel speculative branches from a shared checkpoint, execute tool calls inside each branch, and prune losers via rollback. Does not apply to pure-reasoning branches with no external side effects, nor to branches whose tools are declared idempotent and fully reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-speculative-branch-rollback-as-unsafe-when-side-effecting-tool-calls-have-already-escaped-the-sandbox.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-speculative-branch-rollback-as-unsafe-when-side-effecting-tool-calls-have-already-escaped-the-sandbox.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-speculative-branch-rollback-as-unsafe-when-side-effecting-tool-calls-have-already-escaped-the-sandbox.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1696,
    "python_slice_tokens": 213,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Branch-and-prune planning assumes that \"abandoning a branch\" is equivalent to \"un-executing the work that branch performed.\" That equivalence holds only for the *cognitive* substrate — the branch's tokens, its local scratchpad, its candidate plan — and it silently fails for the *effector* substrate. A speculative branch that has already emitted a `POST /orde...",
    "what_was_observed": "A planner forked three speculative branches from checkpoint C7 to fulfill a \"reconcile duplicate customer records\" task. Branch A chose merge-by-email, Branch B chose merge-by-phone, Branch C chose escalate-to-human. Cost-aware speculation pruned C first (highest token burn, lowest expected reward), then B after A's local scoring exceeded threshold τ=0.82. Branch B's first tool call was `crm.merge(primary=id_441, sec...",
    "condition_of_validity": "Rollback-as-prune is valid **iff** every effector invoked by a branch is one of: 1. **Declared pure** — no external state mutation (read-only tools, sandboxed compute). 2. **Declared idempotent with a stable idempotency key** derived from `(task_id, logical_effect_id)` — not from branch-local counters, which differ per branch and defeat dedup. 3. **Compensab...",
    "decision_boundary": "When a branch to be pruned carries any `UNKNOWN_SIDE_EFFECT`, the orchestrator must not rollback-and-forget. It must transition the branch to `QUARANTINED` and take one of: - **Resolve-forward:** issue a read-back against the effector (`crm.get(id_441)`) to determine whether the effect landed, then either adopt the branch's effect into the committed plan or ...",
    "operational_effect": "Systems that ignore this boundary exhibit a characteristic failure profile: low latency and high throughput on the happy path, followed by rare, high-severity state corruption whose blast radius scales with the *number of speculative branches*, because each pruned branch is an independent opportunity to leak an unacknowledged effect. The corruption is invisi..."
  },
  "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": "a88372487c07661c477934dc2bfe609ccde932bb57e3b3116b0f2ab04cc87cdc",
    "verified_classes": [
      "Reversibility",
      "UnsafeRollbackError",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "effect_ledger_clean",
      "prune"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnsafeRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
