{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-speculatively-pre-execute-tool-calls-across-a-branch-and-verify-fan-out-and-then-discover-at-merge-time-that-the-rollback-of-a-lo",
  "title": "Why does an instance speculatively pre-execute tool calls across a branch-and-verify fan-out and then discover, at merge time, that the rollback of a losing branch has already leaked an irreversible side effect?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any orchestration where a planner agent fans out N speculative sub-branches that each optimistically pre-execute tool calls (writes, sends, provisioning) before a verifier selects a winner and rolls back losers. Does not apply to pure read-only tool surfaces or to systems that route every side-effect through a deferred commit buffer with a single transactional boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-pre-execute-tool-calls-across-a-branch-and-verify-fan-out-and-then-discover-at-merge-time-that-the-rollback-of-a-lo.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-pre-execute-tool-calls-across-a-branch-and-verify-fan-out-and-then-discover-at-merge-time-that-the-rollback-of-a-lo.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-pre-execute-tool-calls-across-a-branch-and-verify-fan-out-and-then-discover-at-merge-time-that-the-rollback-of-a-lo.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1584,
    "python_slice_tokens": 282,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways to make speculative execution \"safe,\" and they are not equivalent: 1. **Compensable speculation** — every pre-executed effect has a registered inverse (delete the created record, refund the charge, cancel the reservation). Rollback is *undo*. 2. **Buffered speculation** — pre-executed effects are held in an uncommitted staging buffer and o...",
    "what_was_observed": "A planner decomposed a provisioning task into three speculative branches: `A` reserves capacity, `B` reserves capacity plus emits a downstream notification, `C` reserves capacity and writes an audit record. All three optimistically pre-executed their `reserve()` calls against the same inventory pool in parallel, each reading `available = 10` at fan-out time (a stale snapshot — correct at read, invalid at commit). The...",
    "condition_of_validity": "The compensating-rollback model is only sound when all four hold: - **Disjoint effect domains.** No two branches touch the same resource key, so compensations cannot alias. (Violated above: all three reserve from one pool.) - **Snapshot freshness at commit.** The pre-execution read is revalidated against the current state at the moment the effect materialize...",
    "decision_boundary": "The architect must choose, per tool surface, between two regimes and never blend them: - **Buffer regime** (default for shared, non-idempotent resources): pre-execution writes to a staging ledger keyed by `(branch_id, effect_id)`. Selection commits the winner's ledger entries and discards losers'. No compensating call is ever issued. Cost: latency — effects ...",
    "operational_effect": "Enforce a commit-barrier invariant: no compensation may execute until the verifier has emitted a signed selection and a `post_selection_epoch` has been observed by every branch. Each pre-executed effect carries a `snapshot_epoch`; a compensation whose `snapshot_epoch` predates the selection epoch is rejected as stale rather than applied. The guardrail is not..."
  },
  "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": "841f1a4bd939d5a0ddd16401e81ee980ee686026454703790de170cb0f76aafe",
    "verified_classes": [
      "StaleCompensationError",
      "Effect",
      "SpeculationLedger"
    ],
    "verified_functions": [
      "__init__",
      "pre_execute",
      "commit_selection",
      "compensate_loser"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StaleCompensationError"
    ],
    "sample_fail_closed_invariants": [
      "compensation attempted before verifier selection; world state is not yet stable"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
