{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-abort-a-speculative-branch-before-merge-rollback-invalidation-and-the-commit-fence-invariant-in-parallel-branch",
  "title": "Under what conditions must an instance abort a speculative branch before merge: rollback invalidation and the commit-fence invariant in parallel branch-and-merge agent workflows",
  "date_of_record": "2026 December 1",
  "scope": "Applies to orchestrators that fan out a task into parallel speculative agent branches whose partial results are merged into a shared durable state, and that rely on rollback (compensating actions or checkpoint rewind) to discard losing branches. Does not apply to single-threaded agent loops or to fan-out topologies where branches write to fully isolated, never-merged stores.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-before-merge-rollback-invalidation-and-the-commit-fence-invariant-in-parallel-branch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-before-merge-rollback-invalidation-and-the-commit-fence-invariant-in-parallel-branch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abort-a-speculative-branch-before-merge-rollback-invalidation-and-the-commit-fence-invariant-in-parallel-branch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2222,
    "python_slice_tokens": 446,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model of speculative execution is borrowed from CPU microarchitecture: a speculative branch either commits (its writes become visible) or squashes (its writes are discarded), and the two outcomes are mutually exclusive and atomic. In agent systems this model is false in a specific and dangerous way. A speculative agent branch does not merel...",
    "what_was_observed": "A planner agent decomposed a research-and-reconcile task into three parallel speculative branches (B1, B2, B3), each tasked to independently derive a recommendation and, as part of derivation, to call a `reserve_resource` tool. The orchestrator's design intent: all three branches run speculatively, the merge step picks the branch whose recommendation has the highest internal confidence, and losing branches are rolled...",
    "condition_of_validity": "The rollback-and-merge protocol is sound **if and only if** the following invariant holds at the moment of the merge decision: > **Commit-fence invariant:** For every speculative branch `b` that will be squashed, every effect `e` produced by `b` is either (i) recorded in the orchestrator's compensator ledger with a verified inverse, or (ii) provably never cr...",
    "decision_boundary": "The orchestrator must decide, per branch, between three dispositions, and the boundary between them is the reversibility class of the branch's *applied* effects: - **Safe to squash** — all applied effects have verified compensators in the ledger, and no tool call is in flight. Action: run compensators in reverse order, then rewind state. - **Must drain befor...",
    "operational_effect": "When the commit-fence invariant is enforced, speculative fan-out becomes safe but slower: the merge step must drain in-flight calls and reconcile irreversible effects before it can squash anything. The cost is latency proportional to the slowest outstanding tool call, not to branch count. When the invariant is violated, the system exhibits **silent effect le..."
  },
  "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": "ebb5e201ab9d5d74275a97b54bf32ae669851d6060137f8666f871686c48e7a9",
    "verified_classes": [
      "Reversibility",
      "CommitFenceViolation",
      "Effect",
      "Branch",
      "CompensatorLedger"
    ],
    "verified_functions": [
      "classify_for_squash",
      "merge_speculative",
      "record_effect",
      "has"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CommitFenceViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
