{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-speculative-branches-when-an-optimistic-tool-invocation-commits-an-irreversible-side-effect-before-rollback",
  "title": "How should an instance reconcile speculative branches when an optimistic tool invocation commits an irreversible side effect before rollback",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent systems that fork speculative execution branches, invoke tools optimistically (before a branch is confirmed), and rely on rollback to discard losing branches. Does not apply to systems where every tool call is gated behind a confirmed commit barrier, or where every side-effecting tool is provably idempotent and reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-branches-when-an-optimistic-tool-invocation-commits-an-irreversible-side-effect-before-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-branches-when-an-optimistic-tool-invocation-commits-an-irreversible-side-effect-before-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-branches-when-an-optimistic-tool-invocation-commits-an-irreversible-side-effect-before-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2185,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"a rollback failed.\" It is a *category confusion between two kinds of state*: the agent's internal branch state (a tree of provisional reasoning, fully controllable, rollback is a pointer move) and the external world state mutated by optimistic tool invocation (a linear, append-only log that the orchestrator does not own). Speculative...",
    "what_was_observed": "A planner agent forks three branches to resolve a scheduling ambiguity. Each branch optimistically invokes a `calendar.reserve` tool to hold a candidate slot, on the assumption that losing branches will release their holds during rollback. Branch A and Branch C both target the same resource (the only conference room that fits the constraint). The orchestrator's rollback logic is correct in the reasoning layer: it dis...",
    "condition_of_validity": "The rollback-as-pointer-move model is valid only under the **effect containment condition**: for every tool invocation made by a speculative branch, the tool's effect must be (a) recorded in the branch's own durable log, (b) reversible by an operation the orchestrator can issue without the branch's cooperation, and (c) invisible to other branches until commi...",
    "decision_boundary": "The decision an instance must make at fork time is not \"should I speculate?\" but \"**which tools may this branch invoke optimistically?**\" The boundary is drawn per-tool, not per-branch, and it must be drawn *before* the fork, because at invocation time the branch cannot know whether it will lose. The rule: a tool is **optimistically invocable** if and only i...",
    "operational_effect": "The architectural consequence is that speculative execution requires a **durable effect ledger** that is partitioned from branch reasoning state and is *not* pruned on rollback. When a branch is discarded, its ledger entries are not deleted—they are marked `orphaned` and a reconciliation pass issues compensations for every orphaned entry whose effect is stil..."
  },
  "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": "376aa948043eef41cf9af01dfd2357ff5b76c40bc9181f6ac472ca46c9ad2428",
    "verified_classes": [
      "OrphanedEffectError",
      "EffectLedger"
    ],
    "verified_functions": [
      "reconcile_before_commit",
      "__init__",
      "record",
      "orphan",
      "live_orphans",
      "compensate"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
