{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-optimistic-tool-invocation-has-already-committed-side-effects-when-its-speculative-branch-is-rolled-back",
  "title": "How does an instance detect that an optimistic tool invocation has already committed side effects when its speculative branch is rolled back",
  "date_of_record": "2026 November 23",
  "scope": "Applies to multi-agent planners that fork speculative execution branches, invoke tools optimistically before branch arbitration, and roll back losing branches by discarding their context. Does not apply to strictly serial single-agent tool loops or to systems where every tool call is gated behind a durable commit protocol.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-optimistic-tool-invocation-has-already-committed-side-effects-when-its-speculative-branch-is-rolled-back.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-optimistic-tool-invocation-has-already-committed-side-effects-when-its-speculative-branch-is-rolled-back.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-optimistic-tool-invocation-has-already-committed-side-effects-when-its-speculative-branch-is-rolled-back.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 195,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a rollback failed to restore context.\" Rollback of *context* is reliable: the branch's token history, scratchpad, and intermediate reasoning are dropped cleanly. The failure is that **rollback of context is silently assumed to imply rollback of world state**. In an optimistic-execution architecture, a speculative branch may have already i...",
    "what_was_observed": "A three-branch speculative planner (`branch_A`, `branch_B`, `branch_C`) was asked to reconcile a customer account. Each branch was forked from a shared checkpoint with a frozen tool-permission grant. The orchestrator allowed optimistic invocation: any branch could call `apply_credit`, `send_notification`, and `update_ledger` up to two steps ahead of arbitration, on the theory that most branches converge and the winni...",
    "condition_of_validity": "This failure requires all four of the following to co-occur; remove any one and the boundary does not bind: - **Optimistic invocation before arbitration.** Tools are called while the branch is still speculative. If invocation is deferred until after branch selection, the losing branch has no external effects to orphan. - **Idempotency keys derived from branc...",
    "decision_boundary": "An instance must treat the following as the decision boundary between safe and unsafe rollback: - **Safe to roll back by context discard** only if every tool invoked by the branch is *provisionally committed*—i.e., the tool's effect is held in a branch-scoped staging area keyed by branch id and is not visible to the world until arbitration promotes it. In th...",
    "operational_effect": "When the boundary is crossed, the observable symptoms are: unexplained external mutations that no surviving branch claims; balance/state mismatches that the winner misattributes to stale reads and \"corrects\" with additional mutations (compounding the orphan); and, critically, **support or audit queries that no agent can answer** because the answering context..."
  },
  "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": "2bcd6de472598483eb699882c2c2882ee79c23d6e0803c6cfe83edc3eab15d8f",
    "verified_classes": [
      "OrphanedEffectError",
      "EffectJournal"
    ],
    "verified_functions": [
      "reconcile_after_arbitration",
      "record"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OrphanedEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
