{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-fork-and-reconcile-lose-branch-lineage-when-speculative-agents-share-a-mutable-tool-cache",
  "title": "Why does an instance fork-and-reconcile lose branch lineage when speculative agents share a mutable tool cache",
  "date_of_record": "2026 November 29",
  "scope": "Applies to orchestrators that run multiple speculative agent branches against a shared, mutable side-effect cache (tool result memoization, filesystem scratch, or vector store) and then reconcile by selecting a winning branch and rolling back the losers. Does not apply to branches that execute against fully isolated sandboxes with copy-on-write volumes and no shared memoization layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-fork-and-reconcile-lose-branch-lineage-when-speculative-agents-share-a-mutable-tool-cache.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-fork-and-reconcile-lose-branch-lineage-when-speculative-agents-share-a-mutable-tool-cache.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-fork-and-reconcile-lose-branch-lineage-when-speculative-agents-share-a-mutable-tool-cache.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2022,
    "python_slice_tokens": 472,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways to make speculative multi-agent execution fast: *isolate-then-merge* and *share-then-rollback*. The first gives each branch a private view of every tool result and side effect, then merges the winning branch's writes. The second lets all branches read and write a single shared cache to amortize expensive tool calls (a web fetch, a code exe...",
    "what_was_observed": "A three-way speculative planner forked at step 7 of a 15-step task. Branch A and Branch B both needed the same expensive tool call (a paginated API fetch). Branch A executed it first and wrote `cache[key] = payload` tagged `lineage=A`. Branch B, milliseconds later, hit the same key, found it warm, and read the payload — but its own dependency record logged `read(cache[key])` without recording that the *producer* was ...",
    "condition_of_validity": "The invariant that share-then-rollback requires, stated precisely: > For every committed branch `w`, every cache read performed by `w` during speculation must resolve to an entry that is either (a) produced by `w` itself, or (b) produced by a branch in `w`'s committed ancestor set, or (c) re-executable deterministically from inputs that are themselves commit...",
    "decision_boundary": "Choose share-then-rollback **only** when all of the following hold: - Every cache entry records not just a `lineage` tag but a `producers` set and a `readers` set, and reconciliation computes the retained set as the transitive closure of reads from the committed winner, not as `all_entries - losers`. - Every tool result stored in the cache is either determin...",
    "operational_effect": "Without the dangling-read check, the system exhibits a *latent replay divergence*: the first execution's committed output is correct, the audit lineage is wrong, and the error surfaces only on checkpoint-resume or audit replay, often hours later and in a different process. The symptom is a branch that \"re-derives a different answer on replay,\" which engineer..."
  },
  "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": "c848d2af0c99a7219a209c7bb5396e06284ffa836aef372bacb4bd423e6707f6",
    "verified_classes": [
      "DanglingLineageError",
      "CacheEntry",
      "Branch"
    ],
    "verified_functions": [
      "reconcile",
      "commit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DanglingLineageError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
