{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-speculative-branch-effects-before-committing-a-shared-memory-write",
  "title": "Where must an instance reconcile speculative branch effects before committing a shared memory write",
  "date_of_record": "2026 November 23",
  "scope": "Applies to orchestrators that fan out an agent task into N parallel speculative branches sharing a single mutable episodic store, then select one branch and roll back the rest. Does not apply to read-only fan-out (map/reduce over stateless workers) or to branches with fully isolated stores reconciled only at a final merge.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-branch-effects-before-committing-a-shared-memory-write.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-branch-effects-before-committing-a-shared-memory-write.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-speculative-branch-effects-before-committing-a-shared-memory-write.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1699,
    "python_slice_tokens": 437,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a speculative branch produced a wrong answer.\" It is that a *discarded* branch already mutated shared state before the winning branch committed. Parallel rollout assumes rollback is a state operation; in practice rollback of an LLM agent branch is a *semantic* operation, because the branch's side effects are not a byte-for-byte log y...",
    "what_was_observed": "A planner agent decomposed a task into a shared sub-goal and launched three speculative branches (A, B, C) against one episodic store keyed by `(task_id, entity)`. Branch A executed a tool that wrote `entity.owner = \"team-x\"` into episodic memory at t=120ms. Branch B, at t=180ms, performed a retrieval over the same key space and received A's write as if it were established fact, then planned a downstream tool call co...",
    "condition_of_validity": "Rollback-as-truncation is valid **only if** all of the following hold: - Branch effect logs are *complete*: every state mutation, including derived checkpoint entries and resume-cursor advances, is captured, not just external tool calls. - No cross-branch reads occur during the speculation window — i.e., branches are read-isolated, not merely write-isolated....",
    "decision_boundary": "The orchestrator must decide, per branch, whether its effects are **isolable** (safe to speculate) or **entangling** (must serialize). The boundary is drawn by effect class: The precise rule: a branch may speculate freely iff every shared-store write is tagged with a `branch_version` and all reads are pinned to the snapshot at speculation start (snapshot iso...",
    "operational_effect": "Enforcing snapshot isolation plus commit-gated checkpoint folding converts rollback from a best-effort replay into a version drop: discarding a branch is `store.drop_version(branch_version)`, which cannot leave orphans because nothing outside the branch ever saw that version. The winner's lineage is built exclusively from committed versions, so its checkpoin..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "37eb767f4f23159f0ef56f2c8bb391b39f1ebb017c7839ae5a49ef1d9fdb23f2",
    "verified_classes": [
      "SpeculativeBleedError",
      "Branch",
      "SpeculativeStore"
    ],
    "verified_functions": [
      "reconcile",
      "__init__",
      "begin",
      "write",
      "read",
      "commit"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "KeyError",
      "SpeculativeBleedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
