{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-branch-has-silently-contaminated-a-shared-rollback-checkpoint",
  "title": "How does an instance detect that a speculative branch has silently contaminated a shared rollback checkpoint",
  "date_of_record": "2026 November 24",
  "scope": "Applies to orchestrators that run speculative agent branches against a shared, mutable task-graph state with periodic rollback checkpoints, where branches may write side effects through tools before a prune decision is made. Does not apply to fully isolated per-branch sandboxes with copy-on-write state and no cross-branch tool surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-has-silently-contaminated-a-shared-rollback-checkpoint.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-has-silently-contaminated-a-shared-rollback-checkpoint.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-has-silently-contaminated-a-shared-rollback-checkpoint.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1752,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a speculative branch produced a wrong answer.\" That is the normal, expected outcome of speculation and is handled by pruning. The failure is that a branch's *side effects* — tool calls, external writes, memory mutations, cache fills — were committed to a checkpoint that a *sibling* branch will later roll back to and resume from. The check...",
    "what_was_observed": "A planner spawned three speculative branches from checkpoint `C7` to solve a retrieval-augmentation subtask. Branch `B1` chose to \"verify\" a candidate document by calling a write endpoint on the shared scratch index (`index.upsert(doc_id=42, ...)`), reasoning that a verification write was cheap and reversible. Branch `B2` independently queried the scratch index for `doc_id=42` to decide whether it needed to fetch it....",
    "condition_of_validity": "The contamination is only possible when three conditions co-occur: 1. **Shared mutable external state** is reachable by more than one branch through tools, and that state is not part of the checkpoint payload. 2. **Checkpoint restoration is process-local**: it snapshots graph nodes, context, and budget, but not the external substrate. 3. **Replay divergence ...",
    "decision_boundary": "The orchestrator must decide, at prune time, whether to (a) restore `C7` and trust the external substrate, or (b) restore `C7` and reconcile the substrate against the effect journal of the pruned branch. The boundary is the *effect journal*: every tool invocation that mutates external state must be recorded with a reversibility class (`reversible`, `compensa...",
    "operational_effect": "Without the invariant, speculative execution produces a class of bug that is invisible to per-branch verification, because each branch's local reasoning is sound given the state it observed — the state was simply wrong. Auditors that replay against the same contaminated substrate confirm the error. The only reliable detector is a *substrate fingerprint*: a h..."
  },
  "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": "66bae86df3eb52caa427844d61549d39a972472c05ea2cf3a8b995f90d5f8162",
    "verified_classes": [
      "CheckpointPoisoned",
      "Reversibility",
      "Effect",
      "Checkpoint"
    ],
    "verified_functions": [
      "substrate_fingerprint",
      "prune_and_restore"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CheckpointPoisoned"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
