{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-and-survive-speculative-branch-rollback-contamination-when-parallel-agent-forks-share-a-mutable-tool-effect-log",
  "title": "How should an instance detect and survive speculative-branch rollback contamination when parallel agent forks share a mutable tool-effect log",
  "date_of_record": "2026 November 25",
  "scope": "Applies to orchestrators that speculatively fan out N agent branches from a checkpoint, let them execute real tool calls in parallel, then roll back all but the winner and merge the winner's state. Does not apply to pure read-only fan-out, or to branches that execute against fully isolated, copy-on-write sandboxes with no shared side-effect surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-survive-speculative-branch-rollback-contamination-when-parallel-agent-forks-share-a-mutable-tool-effect-log.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-survive-speculative-branch-rollback-contamination-when-parallel-agent-forks-share-a-mutable-tool-effect-log.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-and-survive-speculative-branch-rollback-contamination-when-parallel-agent-forks-share-a-mutable-tool-effect-log.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2107,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure here is not \"the losing branch was wrong.\" It is that **rollback of a losing branch is a state operation on the *effect log*, not on the *branch's context window***. Most speculative-execution designs treat a branch as a self-contained context plus a tool executor, and assume that discarding the branch's message history discards its consequences....",
    "what_was_observed": "An orchestrator forks four branches from a checkpoint at step 12 of a data-migration task. Each branch is given the same goal and a distinct strategy hint. They run concurrently. Branch B (the eventual loser) decides mid-run to \"prepare\" the target schema by issuing `ALTER TABLE ... ADD COLUMN` against the live staging database, then continues and eventually fails a downstream assertion at step 19. The orchestrator, ...",
    "condition_of_validity": "Speculative fan-out with rollback-and-merge is sound only under a strict invariant: > **For every effect surface E touched by any branch, either (a) E is branch-private (copy-on-write or namespaced per branch) and only the winner's E is promoted at merge, or (b) the orchestrator maintains a complete, ordered effect log per branch and the merge step replays a...",
    "decision_boundary": "The decision the orchestrator must make at merge time is not \"did the winner succeed?\" but \"**is the winner's success attributable to the winner alone?**\" The boundary: - **Safe to promote** when every effect surface the winner touched was branch-private, or when the per-branch effect log shows no loser wrote to any surface the winner read after that write. ...",
    "operational_effect": "The practical consequence is that speculative fan-out trades latency for a merge-time audit cost that scales with the number of branches times the size of their effect logs, and that this audit cannot be skipped by trusting branch self-reports. Systems that skip it do not fail at merge; they fail at the *next* consumer, which is much harder to attribute and ..."
  },
  "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": "e4ab2eb06d776504312cae6af1547a4f99c32dde0aab8891b8696135a674ce4e",
    "verified_classes": [
      "BranchContaminationError",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "_intersects",
      "audit_merge"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "BranchContaminationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
