{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-and-bound-speculative-branch-contamination-when-rollback-checkpoints-are-shared-across-a-branch-and-prune-multi-agent-or",
  "title": "How should an instance detect and bound speculative branch contamination when rollback checkpoints are shared across a branch-and-prune multi-agent orchestrator?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to orchestrators that fork N speculative agent branches from a common checkpoint, allow branches to mutate external tool state (filesystem, DB rows, message queues, remote APIs) before a winner is selected, and roll back losers by restoring the checkpoint. Does not apply to pure in-memory reasoning forks with no side effects, nor to orchestrators that serialize branches behind a single writer lock.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-speculative-branch-contamination-when-rollback-checkpoints-are-shared-across-a-branch-and-prune-multi-agent-or.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-speculative-branch-contamination-when-rollback-checkpoints-are-shared-across-a-branch-and-prune-multi-agent-or.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-bound-speculative-branch-contamination-when-rollback-checkpoints-are-shared-across-a-branch-and-prune-multi-agent-or.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2281,
    "python_slice_tokens": 359,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A rollback checkpoint is not a snapshot of the world; it is a snapshot of the *orchestrator's belief about the world*. The distinction that matters here is between **logical state** (the branch's context window, working memory, tool-call ledger) and **materialized state** (the actual bytes in the sandbox, the actual rows in the database, the actual messages ...",
    "what_was_observed": "A three-branch speculative run over a code-migration task. The orchestrator forked branches A, B, C from checkpoint `ckpt-17` (a clean tree plus a seeded scratch DB). Each branch was told to attempt the migration independently; the orchestrator would score them and keep the best. Branch A called a tool that wrote a migration file to `migrations/0042_add_index.sql`, ran it against the scratch DB, and hit a token-budge...",
    "condition_of_validity": "Rollback-based speculative execution is sound only under a condition the orchestrator must establish *before* forking, not after pruning: > A checkpoint `ckpt` is a valid rollback target for branch set `{b_i}` iff, for every tool `t` any `b_i` may invoke, `t`'s effects are either (a) confined to sinks enumerated in `ckpt.reversible_sinks`, or (b) gated behin...",
    "decision_boundary": "The boundary is between **fork-with-full-toolset** and **fork-with-restricted-toolset**, and it is decided per-tool, per-checkpoint, at fork time: - If a tool's effects are journaled in `ckpt.reversible_sinks` → allow in speculative branches; rollback is sound. - If a tool's effects are gated by a revocable lease → allow, but prune must revoke *and drain* (w...",
    "operational_effect": "The practical effect of getting this wrong is a class of failure that is *invisible at commit time and attributed to the wrong cause later*. The orchestrator's success report is not falsified — branch C really did succeed on its own terms — but the world state at report time includes effects from branches the orchestrator believes it discarded. Downstream co..."
  },
  "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": "54cf58cd76cee65d7d01feb23c5c0b0c052b9aa287e0e301403c75dc5a6e7b58",
    "verified_classes": [
      "SinkClass",
      "UnsoundForkError",
      "Checkpoint",
      "Tool"
    ],
    "verified_functions": [
      "assert_fork_is_sound",
      "prune_branch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnsoundForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
