{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-commits-from-surviving-a-rollback-that-never-replayed-their-side-effects",
  "title": "Which invariants prevent speculative branch commits from surviving a rollback that never replayed their side effects",
  "date_of_record": "2026 November 22",
  "scope": "Applies to multi-agent orchestrators that speculatively fork sibling branches, execute tool calls optimistically before verification, and commit the winning branch while rolling back losers. Does not apply to strictly serial single-agent loops or to branches whose tool calls are fully idempotent and externally reconciled.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-commits-from-surviving-a-rollback-that-never-replayed-their-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-commits-from-surviving-a-rollback-that-never-replayed-their-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-commits-from-surviving-a-rollback-that-never-replayed-their-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2309,
    "python_slice_tokens": 575,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not that a speculative branch produced a wrong answer. It is that a *losing* branch's optimistic tool side effect escaped the rollback envelope and became visible to the *committed* branch's subsequent reasoning. Rollback in most orchestrators is modeled as a state operation: discard the loser's message log, discard its scratchpad, restor...",
    "what_was_observed": "A planner agent forks three speculative branches to resolve an ambiguous user request. Each branch is given the same parent context and a subtask. Branch B decides the correct action is to create a provisioning record and calls `provision_resource(id=42)` optimistically — the orchestrator allows the call to proceed before the verifier has scored the branch, on the assumption that losers will be rolled back. The verif...",
    "condition_of_validity": "The invariant that bounds this failure is: **an optimistic effect may be committed only if the orchestrator holds a durable, branch-tagged effect record that survives transcript rollback, and every rollback path must drain that record via compensation or fencing before any sibling branch can observe the affected resource.** This is valid — and rollback is sa...",
    "decision_boundary": "The boundary between safe and unsafe speculation is drawn at the moment a branch issues its first non-compensable or conflict-generating effect. Before that point, rollback is a pure transcript operation and speculation is free. After it, rollback requires draining the ledger, and the orchestrator must choose one of two policies: - **Fence-and-proceed:** all...",
    "operational_effect": "When the invariant holds, speculative multi-agent execution retains its latency advantage on reasoning while confining effect risk to a ledger that is drained deterministically. Committed branches see fenced artifacts as explicit foreign state and route around them; the `409` becomes a signal rather than a trap. The cost is a durable write per optimistic inv..."
  },
  "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": "cf3745569023db1563d4a279425cda7a9a8152d96791bb9e4d32c486360c774c",
    "verified_classes": [
      "EffectState",
      "RollbackLeakError",
      "ForeignStateConflictError",
      "EffectRecord",
      "EffectLedger"
    ],
    "verified_functions": [
      "rollback_branch",
      "handle_tool_conflict",
      "speculative_round",
      "register",
      "outstanding_for",
      "drain",
      "owner_of"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ForeignStateConflictError",
      "RollbackLeakError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
