{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-optimistic-commit-of-a-speculative-branch-when-tool-effects-are-only-partially-reversible",
  "title": "In what scenarios must an instance refuse optimistic commit of a speculative branch when tool effects are only partially reversible",
  "date_of_record": "2026 November 15",
  "scope": "Applies to orchestrators that roll out multiple speculative agent branches in parallel and defer side-effect commitment until a winner is selected, where at least one tool in the branch's effect set is non-idempotent or non-compensable. Does not apply to pure-computation branches, to reads, or to effect sets that are fully transactional under a single two-phase protocol.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-optimistic-commit-of-a-speculative-branch-when-tool-effects-are-only-partially-reversible.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-optimistic-commit-of-a-speculative-branch-when-tool-effects-are-only-partially-reversible.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-optimistic-commit-of-a-speculative-branch-when-tool-effects-are-only-partially-reversible.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1460,
    "python_slice_tokens": 319,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is not \"reversible vs. irreversible\" but **compensable vs. observable**. A tool effect is compensable if a compensating action restores the pre-state to a degree indistinguishable to every downstream observer. It is merely *reversible* if the system can undo it internally but an external party (a payment network, an email recipie...",
    "what_was_observed": "A three-branch speculative rollout committed branch A (which called a payment authorization tool) while branches B and C were still in flight. The orchestrator's optimistic commit was gated on a *divergence check*: if any live branch's tool-effect fingerprint differed from the committed branch's, the commit was to be rolled back. Branch C subsequently produced a divergent effect — a second authorization against the s...",
    "condition_of_validity": "Optimistic commit with rollback-on-divergence is valid only when all three hold: 1. **Effect-set closure.** The set of effects subject to rollback is closed at commit time — no branch can emit a new effect after the commit barrier. This requires a *quiescence barrier*: every live branch must be fenced (its tool-call capability revoked) before the commit is i...",
    "decision_boundary": "The boundary is per-effect, not per-branch. Classify each tool in the branch's effect set at plan time: - **Staged / outboxed writes** (internal DB rows behind a commit flag): speculatively committable, rollback is a flag flip. - **Idempotent external writes keyed by a deterministic idempotency key derived from the branch identity**: committable if the key i...",
    "operational_effect": "When the boundary is respected, speculative rollout buys latency only on branches whose effects are staged or epoch-keyed; the orchestrator should route non-compensable tools to a serialized path and accept the latency there rather than discovering the boundary in production. When it is violated, the failure mode is silent: rollback reports success, the ledg..."
  },
  "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": "b1a3e99fcf34e39d4b3aaf6f05ce765773da0045c4a3fce48944060390dc0582",
    "verified_classes": [
      "SpeculationBoundaryError",
      "EffectClass",
      "ToolEffect",
      "Branch"
    ],
    "verified_functions": [
      "assert_committable",
      "optimistic_commit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculationBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
