{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-rolled-back-speculative-branch-has-already-leaked-side-effects-into-a-sibling-branch-s-shared-tool-cache",
  "title": "How does an instance detect that a rolled-back speculative branch has already leaked side effects into a sibling branch's shared tool cache",
  "date_of_record": "2026 December 2",
  "scope": "Applies to orchestrators that run speculative parallel branches (same task, divergent plans) over a shared, mutable tool-result cache, where branches may be rolled back and survivors reconciled. Does not apply to branches with fully isolated caches or to read-only tool surfaces.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-rolled-back-speculative-branch-has-already-leaked-side-effects-into-a-sibling-branch-s-shared-tool-cache.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-rolled-back-speculative-branch-has-already-leaked-side-effects-into-a-sibling-branch-s-shared-tool-cache.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-rolled-back-speculative-branch-has-already-leaked-side-effects-into-a-sibling-branch-s-shared-tool-cache.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1490,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"a branch was rolled back\" and not \"two branches disagreed.\" It is that **rollback is a control-plane operation, while the side effects of a branch's tool calls live in a data plane the orchestrator does not own.** When branch B is speculatively killed, the orchestrator discards B's plan and its private state. But if B's tool calls wr...",
    "what_was_observed": "A three-branch speculative run (A, B, C) over a research task. All branches call `search(query)` and `fetch(url)` with overlapping arguments. Branch B takes a divergent plan, calls `fetch(\"https://x/report\")`, receives a 200 with stale-but-parseable content, and writes `cache[(\"fetch\",\"x/report\")] = payload`. The orchestrator's verifier scores B below threshold at step 4 and issues `rollback(B)`. Rollback clears B's ...",
    "condition_of_validity": "The invariant that must hold is: **no cache entry produced by a branch may be consumed by a sibling branch after that producer's rollback commits, unless the entry is re-validated under the consumer's own lineage.** This holds trivially when caches are per-branch or when rollback is implemented as *cache invalidation by producer tag* rather than *state disca...",
    "decision_boundary": "The boundary is: does the orchestrator treat the cache as **owned by the run** or **owned by the branch**? If run-owned, rollback MUST trigger a producer-tagged invalidation sweep before any sibling proceeds past the rollback barrier. If branch-owned, the cache must be namespaced by branch id and reconciliation must explicitly merge only from *surviving* nam...",
    "operational_effect": "Without the guardrail, speculative execution silently converts a *quality* mechanism (run several plans, keep the best) into a *contamination* mechanism: dead branches seed the survivors' evidence base, and the verifier's agreement signal is inflated by ghosts. The observable symptom is a run that reports high inter-branch consensus and passes verification w..."
  },
  "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": "41f528785617053920dbe133065aa171116ca7152ca5d03e0507ccab66450c25",
    "verified_classes": [
      "GhostCacheReadError",
      "CacheEntry",
      "Branch",
      "SharedToolCache"
    ],
    "verified_functions": [
      "__init__",
      "write",
      "read",
      "invalidate_producer"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "GhostCacheReadError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
