{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-reconciliation-from-committing-a-tool-call-whose-side-effects-escaped-the-rollback-boundary",
  "title": "Which invariants prevent speculative branch reconciliation from committing a tool call whose side effects escaped the rollback boundary",
  "date_of_record": "2026 November 24",
  "scope": "Applies to multi-agent orchestrators that run speculative branches (parallel candidate plans) with per-branch rollback and merge-on-consensus, where branches may invoke external tools. Does not apply to read-only speculative execution or to single-branch retry loops without reconciliation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-reconciliation-from-committing-a-tool-call-whose-side-effects-escaped-the-rollback-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-reconciliation-from-committing-a-tool-call-whose-side-effects-escaped-the-rollback-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-reconciliation-from-committing-a-tool-call-whose-side-effects-escaped-the-rollback-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2069,
    "python_slice_tokens": 653,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a speculative branch failed and was rolled back.\" That is the intended path. The failure is that a branch was rolled back logically—its state discarded, its context dropped, its consensus vote voided—while one of its tool calls had already crossed the side-effect boundary (sent an email, wrote a row, opened a PR, debited an account). The ...",
    "what_was_observed": "A three-branch planner ran candidates A, B, C for a \"reconcile customer refund\" task. Branch B invoked `issue_refund(amount=4200, idempotency_key=None)` against the payment tool, then lost the consensus vote to A because B's later reasoning diverged on a currency-rounding step. The orchestrator rolled B back: dropped its memory, invalidated its vote, freed its context slot. A's plan then executed `issue_refund(amount...",
    "condition_of_validity": "The \"speculative branch is freely rollback-able\" assumption holds only under a conjunction that is rarely checked: - Every tool call in the branch is either **reversible** (compensable: can be undone by an inverse operation) or **idempotent under a stable key** (re-execution with the same key is a no-op). - The **side-effect ledger is append-only and branch-...",
    "decision_boundary": "The boundary is drawn at the moment a tool call is dispatched, not at the moment the branch is rolled back. Before dispatch, the orchestrator must answer: *is this call reversible or idempotency-keyed?* - If **yes (reversible)**: the branch remains fully speculative. Rollback may discard receipts; the inverse operation cleans the world. - If **yes (idempoten...",
    "operational_effect": "Enforcing the invariant changes the orchestrator's shape in three concrete ways. First, the tool layer must expose a `reversibility` descriptor (`reversible | idempotent(key_fn) | irreversible`) and the branch scheduler must refuse to speculatively dispatch `irreversible` calls—raising at dispatch, not at rollback, so the failure is loud and early. Second, t..."
  },
  "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": "a503a624ffbc2406130f5faf523c32a00a31b8460690a513b16efc0ac71ff49d",
    "verified_classes": [
      "SpeculativeCommitViolation",
      "Reversibility",
      "ToolSpec",
      "Receipt",
      "SideEffectLedger",
      "Branch"
    ],
    "verified_functions": [
      "dispatch_tool",
      "reconcile",
      "record",
      "keys_for"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeCommitViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
