{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-rollouts-from-committing-side-effects-that-survive-rollback-reconciliation",
  "title": "Which invariants prevent speculative branch rollouts from committing side effects that survive rollback reconciliation",
  "date_of_record": "2026 December 1",
  "scope": "Applies to multi-agent orchestrators that fan out a single task into parallel speculative branches (each branch an independent LLM agent instance with tool access) and reconcile by selecting one winning branch and discarding the rest. Does not apply to strictly serial single-agent execution, nor to branches whose tools are provably pure (no external state mutation).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollouts-from-committing-side-effects-that-survive-rollback-reconciliation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollouts-from-committing-side-effects-that-survive-rollback-reconciliation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollouts-from-committing-side-effects-that-survive-rollback-reconciliation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2254,
    "python_slice_tokens": 442,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that governs everything below is between **rollback of reasoning state** and **rollback of world state**. An orchestrator can trivially discard a losing branch's context window, token history, and intermediate scratchpad — those are local, private, and cheap to abandon. What it cannot trivially discard is the *effect* of a tool call that alre...",
    "what_was_observed": "A planner agent decomposed a request into a task requiring a record update plus a downstream notification. The orchestrator launched three parallel branches (temperature-varied, plus one with a different system prompt emphasizing caution). Each branch was given a tool surface including `db.update_record(...)` and `notify.send(...)`, wrapped in a thin `ToolClient` that performed the call directly against the live back...",
    "condition_of_validity": "Rollback reconciliation is valid **if and only if** every effect a branch can produce is one of: 1. **Buffered** — the effect is staged in a branch-scoped transaction/sandbox that is committed only on selection and dropped otherwise; or 2. **Idempotent and commutative** — replaying or discarding it leaves world state equal to the winner's intent regardless o...",
    "decision_boundary": "The boundary is drawn at the moment a branch's tool call is dispatched, not at reconciliation. Three concrete rules bound it: - **Effect classification at the descriptor layer.** Every tool must declare an `effect_class ∈ {pure, buffered, idempotent, irreversible}` and, for `irreversible`, an `inverse_tool` or `None`. A tool with `effect_class=irreversible` ...",
    "operational_effect": "With the invariant enforced, three classes of failure disappear and one new cost appears: - **Disappears:** orphaned effects from discarded branches (C's email), because `notify.send` is `irreversible` with no inverse and cannot be called speculatively. - **Disappears:** lost-write overwrites (A→B), because keyed tools are single-flight. - **Disappears:** di..."
  },
  "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": "e78bafc47f59fc33cd08c97ab860e77dd16c5bace1b6a4ef0695a9293623fdef",
    "verified_classes": [
      "UnreconcilableEffectError",
      "EffectClass",
      "ToolDescriptor",
      "EffectRecord",
      "BranchLedger",
      "SpeculativeOrchestrator"
    ],
    "verified_functions": [
      "__init__",
      "_ledger",
      "dispatch",
      "discard",
      "surviving_effects"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnreconcilableEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
