{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-rollback-from-corrupting-shared-agent-state-during-conflict-reconciliation",
  "title": "Which invariants prevent speculative branch rollback from corrupting shared agent state during conflict reconciliation",
  "date_of_record": "2026 November 26",
  "scope": "Applies to orchestrators that fan out parallel LLM agent branches speculatively (optimistic execution) against a shared mutable workspace—memory store, tool-side effects, or a shared scratchpad—and later reconcile conflicting branches by rollback. Does not apply to branches executed against immutable, copy-on-write snapshots with no external side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-corrupting-shared-agent-state-during-conflict-reconciliation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-corrupting-shared-agent-state-during-conflict-reconciliation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-rollback-from-corrupting-shared-agent-state-during-conflict-reconciliation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1552,
    "python_slice_tokens": 226,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a branch produced a wrong answer.\" It is **rollback of a speculative branch that already leaked a non-idempotent side effect into shared state before its conflict was detected**. Speculative execution assumes a branch's effects are *reversible* or *isolated* until commit. The non-obvious boundary is that LLM agents produce effects al...",
    "what_was_observed": "An orchestrator dispatched three branches (B1, B2, B3) from a shared checkpoint at step 12 to explore alternative plans. Each branch ran with `sandbox=isolated_fs`, but the sandbox mounted the *shared* vector memory store read-write for \"convenience\" so branches could recall distilled facts. B1 and B2 both decided to \"consolidate\" a memory entry: each read the entry, appended a summary, and wrote it back. B1 committe...",
    "condition_of_validity": "Rollback-based reconciliation is sound **only if** every speculative effect is either (a) applied to a versioned, copy-on-write store keyed by `(branch_id, base_version)`, or (b) recorded in an effect log that the reconciler replays in reverse. The invariant is: > `∀ effect e emitted during speculation: commit(e) is deferred until branch selection, AND rollb...",
    "decision_boundary": "The reconciler must choose between **optimistic rollback** and **serialized commit** at the point where a branch's effect set intersects shared mutable state. The decision rule: - If `effects(branch) ∩ shared_mutable = ∅`: rollback is safe; discard branch state, keep effects. - If `effects(branch) ∩ shared_mutable ≠ ∅` **and** the store enforces `base_versio...",
    "operational_effect": "Without the version-check invariant, speculative fan-out silently corrupts shared memory: merged entries that no branch authored, lost updates where a stale-base write overwrites a committed one, and downstream branches that retrieve the corrupted entry and diverge. The corruption is *non-deterministic* because branch tool-call sequences vary across rollouts..."
  },
  "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": "36c80a3012343275d2c85f71324972614c8385850a318163616ba5525ea148fb",
    "verified_classes": [
      "SpeculativeRollbackViolation",
      "EffectLog"
    ],
    "verified_functions": [
      "reconcile",
      "__init__",
      "record",
      "commit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeRollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
