{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-rollback-from-reusing-externally-observable-tool-side-effects-as-a-checkpoint",
  "title": "Which invariants prevent speculative branch rollback from reusing externally observable tool side effects as a checkpoint",
  "date_of_record": "2026 November 28",
  "scope": "Applies to multi-agent systems that fork speculative execution branches (parallel hypothesis exploration, draft-then-verify, or speculative decoding across agents) and roll back non-surviving branches by restoring agent state. Does not apply to read-only tool calls, or to systems where rollback is defined only over internal reasoning state with no external effect surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-reusing-externally-observable-tool-side-effects-as-a-checkpoint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-reusing-externally-observable-tool-side-effects-as-a-checkpoint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-reusing-externally-observable-tool-side-effects-as-a-checkpoint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2016,
    "python_slice_tokens": 365,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback lost some state.\" It is the conflation of two different kinds of checkpoint: **cognitive state** (context window, scratchpad, memory writes, plan graph) and **external effect state** (tool calls that mutated a system outside the agent: files written, messages sent, transactions committed, API mutations). A speculative branch is s...",
    "what_was_observed": "A three-agent planner/executor/verifier swarm ran speculative execution: the planner forked three hypothesis branches (B1, B2, B3), each an executor instance with its own context and tool access. Each branch was allowed to call tools. On divergence detection — the verifier scoring B1 and B3 as unsafe — the orchestrator rolled back B1 and B3 by restoring each executor's pre-fork snapshot and discarding their memory wr...",
    "condition_of_validity": "The commit-barrier invariant holds only under these conditions, and fails outside them: - **Effect classification is total.** Every tool the branch can call must be statically classified as `reversible`, `idempotent`, or `non-invertible` *before* the branch forks. A tool that is unclassified at fork time must be treated as `non-invertible`. Classification ca...",
    "decision_boundary": "The boundary between \"safe to speculate\" and \"must serialize\" is drawn per tool, per branch, at fork time: - **Speculate freely** over tools classified `idempotent` (the effect is the same whether run once or N times, e.g., setting a value to a constant) and over pure-read tools. Rollback of these is a no-op on the world. - **Speculate with compensating log*...",
    "operational_effect": "With the invariant enforced, the observable behavior changes in three ways: 1. **Rollback becomes an effect-log operation, not a context operation.** Rolling back a branch means: cancel its pending compensations, discard its context, and *reconcile its effect cursor against the orchestrator's committed effect log*. Any effect in the branch's cursor that is n..."
  },
  "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": "d4c27b9f98270814bb362bc33d63193adeea2d97dfa6dbdeecf7e22f89691dc7",
    "verified_classes": [
      "EffectClass",
      "SpeculativeRollbackError",
      "EffectCursor",
      "Branch"
    ],
    "verified_functions": [
      "classify_tool",
      "fork_branch",
      "rollback_branch",
      "commit_branch"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
