{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-divergence-when-speculative-agent-branches-are-rolled-back-and-merged",
  "title": "Which invariants prevent silent divergence when speculative agent branches are rolled back and merged",
  "date_of_record": "2026 November 23",
  "scope": "Applies to orchestration layers that fan out a single task into parallel speculative agent branches, commit one branch's effects, and roll back or reconcile the others against a shared mutable substrate (tool side effects, memory store, or downstream handoff state). Does not apply to read-only fan-out, pure single-branch execution, or branches whose side effects are fully idempotent and commutative by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-divergence-when-speculative-agent-branches-are-rolled-back-and-merged.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-divergence-when-speculative-agent-branches-are-rolled-back-and-merged.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-divergence-when-speculative-agent-branches-are-rolled-back-and-merged.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2528,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things a \"rollback\" can mean in a speculative multi-branch agent system, and conflating them is the root of the failure this record describes. The first is **effect rollback**: undoing the externally observable side effects a losing branch produced (a written file, a sent request, a mutated memory record, an enqueued tool call). The s...",
    "what_was_observed": "A planner agent forks three speculative branches (A, B, C) to resolve a single subgoal: \"reconcile the account ledger.\" Each branch runs an identical prefix of reasoning, then diverges. All three share a single memory namespace and a single tool-execution channel to an external ledger service, because the orchestrator assumed branches would be *reasoned about* in isolation and only *committed* at the end. Branch A de...",
    "condition_of_validity": "The invariants below hold only under a specific precondition, and stating it precisely is the point of this section: **a speculative branch may be merged only if the set of shared resources it read during execution is disjoint from the set of shared resources any sibling wrote during the same speculative window, or if the orchestrator can prove the branch's ...",
    "decision_boundary": "The decision boundary is the moment the orchestrator chooses a winner. Before that moment, rollback is cheap and the invariants are local. After it, the system has crossed into a regime where every subsequent compensating action is itself a non-idempotent effect that must be reasoned about against a state that no longer matches any branch's model. Concretely...",
    "operational_effect": "The operational consequence is a shift in where the orchestrator spends its budget. Systems that assume rollback is free spend their verification budget on *scoring* branches (which is cheap and parallel) and almost nothing on *isolation* (which is expensive and serial). The failure above shows this allocation is inverted: scoring is the part that can be wro..."
  },
  "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": "14f13d121409446574ac30c7d96f0309896f6ed2b68c15193fc05ac2dda27682",
    "verified_classes": [
      "SpeculativeMergeError",
      "BranchJournal"
    ],
    "verified_functions": [
      "reconcile_speculative_fork"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "SpeculativeMergeError"
    ],
    "sample_fail_closed_invariants": [
      "empty fork: nothing to reconcile",
      "no uncontaminated passing branch; discard fork"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
