{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-abort-a-speculative-branch-before-its-compensating-rollback-can-no-longer-restore-the-pre-fanout-tool-state",
  "title": "Under what conditions must an instance abort a speculative branch before its compensating rollback can no longer restore the pre-fanout tool state",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestrators that fork a planner instance into N speculative branches, each invoking side-effecting tools optimistically, and that rely on compensating actions (inverse tool calls, journal replay, or snapshot restore) to prune losing branches. Does not apply to read-only fanout, to branches whose tools are declared idempotent-with-tombstone, or to single-agent rollback where no concurrent writer exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-before-its-compensating-rollback-can-no-longer-restore-the-pre-fanout-tool-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-before-its-compensating-rollback-can-no-longer-restore-the-pre-fanout-tool-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-before-its-compensating-rollback-can-no-longer-restore-the-pre-fanout-tool-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2299,
    "python_slice_tokens": 338,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch produced a wrong answer.\" Speculative execution is *designed* to produce wrong answers in losing branches. The failure is that the **compensation window closes before the prune decision lands** — the orchestrator commits to a rollback strategy (inverse-call compensation) whose correctness assumes the tool's state has not been obs...",
    "what_was_observed": "A three-branch planner (branches A, B, C) was speculatively executing a \"reconcile customer record\" task. Each branch independently decided to call `update_billing_profile(customer_id, patch)`. The tool is a read-modify-write over a JSON document with no compare-and-swap; the orchestrator's rollback contract was \"on prune, replay the inverse patch recorded in the branch journal.\" Trace: 1. **t0** — Fanout. All three ...",
    "condition_of_validity": "An inverse-call rollback of a pruned branch B is valid if and only if, for every resource R that B wrote, all of the following hold at the moment of compensation: - **Disjointness:** no sibling branch that survives the prune wrote to the same field of R after B's snapshot was taken; - **No external observation:** no non-orchestrator actor read or acted on R ...",
    "decision_boundary": "The orchestrator must classify each branch at prune time into one of three rollback classes and act accordingly: The boundary is sharp and is crossed at the moment of the *first overlapping optimistic write*, not at prune time. An orchestrator that only checks at prune time has already lost the ability to distinguish `SNAPSHOT_ONLY` from `NON_COMPENSABLE` if...",
    "operational_effect": "The practical consequence is that **speculative fanout with side-effecting tools must pay a snapshot cost proportional to the fanout width, or accept a hard cap on concurrency over shared resources.** Systems that skip the write-intent registry to save latency will exhibit the t5–t7 trace above under exactly the conditions that make speculation valuable — co..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "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": "95ec32092ac3e010d60f5aff243fe541c9a9fd8e1630cc0fd6283b1019b32ab5",
    "verified_classes": [
      "CompensationWindowError",
      "RollbackClass",
      "Branch",
      "FanoutState"
    ],
    "verified_functions": [
      "register_write_intent",
      "mark_external_observation",
      "prune_branch"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompensationWindowError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
