{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-roll-back-a-speculative-branch-and-still-lose-the-merge-silent-divergence-of-side-effect-ledgers-during-speculative-agent-executi",
  "title": "Why does an instance roll back a speculative branch and still lose the merge: silent divergence of side-effect ledgers during speculative agent execution",
  "date_of_record": "2026 November 22",
  "scope": "Applies to orchestrators that fork an agent's tool-use trajectory into parallel speculative branches, execute them against a shared environment, and reconcile results by rolling back losing branches and merging the winning branch's state. Does not apply to purely read-only fan-out (map over independent queries), nor to branches executed against fully isolated sandboxes whose side effects are never merged.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-and-still-lose-the-merge-silent-divergence-of-side-effect-ledgers-during-speculative-agent-executi.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-and-still-lose-the-merge-silent-divergence-of-side-effect-ledgers-during-speculative-agent-executi.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-and-still-lose-the-merge-silent-divergence-of-side-effect-ledgers-during-speculative-agent-executi.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1944,
    "python_slice_tokens": 319,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the rollback failed\" and it is not \"the merge conflicted.\" It is that **rollback and merge are two separate reconciliation passes over two different representations of state** — the *effect ledger* (the ordered log of tool invocations and their external consequences) and the *agent memory* (the message/tool-result context that the LLM wil...",
    "what_was_observed": "A planner agent decomposes a task (\"reconcile two inventory feeds and issue corrections\") into a fork point. Three speculative branches are launched from checkpoint `C0`: - **Branch A** calls `adjust_stock(sku, delta)` on 40 SKUs, then `post_correction(sku)` for each. - **Branch B** takes a different reconciliation strategy, calling `adjust_stock` on an overlapping subset of 22 SKUs. - **Branch C** is a conservative ...",
    "condition_of_validity": "The invariant *\"merged context ⊆ surviving ledger\"* holds only when at least one of the following is true: 1. **Compensation is absolute, not relative.** Rollback restores the checkpoint value directly (`set_stock(sku, checkpoint_value)`) rather than applying an inverse delta. Relative compensation is valid only if no other branch touched the same resource b...",
    "decision_boundary": "The boundary is not \"should we speculate\" but **\"at what resource granularity do we permit overlapping speculative writes.\"** Two regimes: - **Disjoint-write speculation (safe):** branches are constrained to write-disjoint resource sets, enforced by a pre-execution partition of the effect space. Rollback is trivially safe because no surviving branch's value ...",
    "operational_effect": "The downstream consequence is **silent, unbounded error compounding**. Because the divergence is between two representations that never cross-check, it is not detected at merge time; it surfaces later when a `post_correction` based on the stale context is itself verified against the (now-consistent) ledger and *fails*, or worse, when it *passes* because the ..."
  },
  "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": "28bfa18ecb62d3215d76ab8caadda0d32c7684b6f20cc3c6c490f6da005b9d8d",
    "verified_classes": [
      "SpeculativeMergeDivergence"
    ],
    "verified_functions": [
      "assert_merge_consistency",
      "merge_speculative_branches"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeMergeDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
