{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-checkpoint-before-speculative-branch-and-verify-execution-to-prevent-irreversible-side-effect-leakage-on-rollback",
  "title": "Where must an instance checkpoint before speculative branch-and-verify execution to prevent irreversible side-effect leakage on rollback?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to orchestrators that fan out multiple speculative agent branches (parallel plan variants) against a shared external world—tool calls with side effects, filesystem writes, message sends, memory-store commits—and then select one branch and roll back the losers. Does not apply to pure read-only speculation, single-branch execution, or branches whose tool calls are guaranteed idempotent and reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-before-speculative-branch-and-verify-execution-to-prevent-irreversible-side-effect-leakage-on-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-before-speculative-branch-and-verify-execution-to-prevent-irreversible-side-effect-leakage-on-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-before-speculative-branch-and-verify-execution-to-prevent-irreversible-side-effect-leakage-on-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1834,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that governs this failure is between *logical* rollback and *physical* rollback. Speculative branch-and-verify frameworks treat a branch as a transaction: fork the plan, run N variants, score them, commit the winner, discard the losers. This works because the framework's internal model of the branch—its message history, its scratchpad, its pr...",
    "what_was_observed": "A planner agent was asked to remediate a failing deployment. The orchestrator spawned three speculative branches with different hypotheses: (A) roll back the last config change, (B) scale up the replica set, (C) restart the affected service. Each branch was given a scoped toolset including `patch_config`, `scale_replicas`, and `restart_service`. The orchestrator intended to score each branch's *proposed* action again...",
    "condition_of_validity": "Speculative branch-and-verify is sound only under the conjunction of three conditions, and the failure above is the violation of the third: 1. **Effect isolation** — no branch can mutate state outside the orchestrator's transactional boundary until commit. Enforced by dry-run tool schemas, sandboxed effect buffers, or a two-phase commit where branch tool cal...",
    "decision_boundary": "The boundary is not \"should I use speculative execution\"—it is *what does the rollback primitive actually cover*. The decision rule: - If every tool in the branch's toolset is **stageable** (can write to a pending-effect buffer and be flushed only on commit), speculate freely; rollback is sound because no effect escaped. - If any tool is **non-stageable and ...",
    "operational_effect": "When the invariant is enforced, the orchestrator's cost model changes: branches that touch irreversible tools cannot be run in parallel speculatively, so wall-clock latency rises and the fan-out narrows to stageable tools only. This is the correct trade. The alternative—what was observed—is a system whose rollback log is a fiction, whose post-commit state is..."
  },
  "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": "7c9b1b8b8a55c7d609d5d4d1e36bd352ea5375e6a6def409f62da5bbff478236",
    "verified_classes": [
      "UnrollbackableEffectError",
      "Branch",
      "Effect"
    ],
    "verified_functions": [
      "rollback_branch",
      "commit_winner",
      "__init__",
      "__init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnrollbackableEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
