{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-speculative-branch-the-irreversible-external-side-effect-invariant-in-multi-agent-rollback",
  "title": "When must an instance abort a speculative branch: The Irreversible External Side-Effect Invariant in Multi-Agent Rollback",
  "date_of_record": "2026 November 14",
  "scope": "Applies to speculative multi-agent execution systems where branches may be rolled back and merged optimistically, and where agents can perform external actions (API calls, writes, messages, payments, resource reservations). Does not apply to purely functional or fully sandboxed execution environments where every side effect is staged and committed atomically.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-the-irreversible-external-side-effect-invariant-in-multi-agent-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-the-irreversible-external-side-effect-invariant-in-multi-agent-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-the-irreversible-external-side-effect-invariant-in-multi-agent-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1525,
    "python_slice_tokens": 234,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *reversible state mutation* and *irreversible external commitment*. A branch-and-merge graph with optimistic concurrency assumes that any speculative branch can be discarded if it loses the merge race or is invalidated by a conflicting observation. This assumption holds for internal state (memory, scratchpads, staged d...",
    "what_was_observed": "In a task graph where a planner fans out three speculative branches (A, B, C) to explore solution strategies, each branch was permitted to call a downstream provisioning API to reserve capacity, verify feasibility, and record a tentative allocation. Branch B lost the merge race to branch A. The orchestrator rolled back B: it discarded B's staged diff, freed its in-memory context, and marked the branch `rolled_back`. ...",
    "condition_of_validity": "The optimistic rollback model is valid under the following jointly necessary conditions: 1. **Effect containment.** Every side effect produced by a speculative branch is either (a) staged and not yet externalized, or (b) externalized under a branch-scoped idempotency key that the orchestrator can use to revoke or compensate. 2. **Compensation availability.**...",
    "decision_boundary": "The decision the orchestrator must make at each branch checkpoint is binary and must be made *before* the effect externalizes, not after: - If the effect is staged-only or carries a branch-scoped, revocable idempotency key **and** a compensation path is registered, the branch remains rollback-eligible. Proceed optimistically. - If the effect is externalized ...",
    "operational_effect": "Enforcing the invariant changes the execution model in three concrete ways. First, branch state gains a third terminal status: `fenced` (committed-or-compensating), distinct from `committed` and `rolled_back`. Second, the orchestrator must maintain a compensation registry keyed by branch, populated at externalization time, so that a losing fenced branch trig..."
  },
  "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": "d3caf32714d6e12a8822429162299ba1ee3030bfeb04686e1c36ba51dbd2b77d",
    "verified_classes": [
      "IrreversibleSideEffectError",
      "BranchState"
    ],
    "verified_functions": [
      "rollback_branch"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "IrreversibleSideEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
