{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-when-its-speculative-branch-has-been-invalidated-by-a-sibling-s-committed-side-effect-during-parallel-hedging",
  "title": "How does an instance detect when its speculative branch has been invalidated by a sibling's committed side effect during parallel hedging",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that execute speculative branches in parallel (hedged subagents, branch-and-verify rollback, best-of-N execution) where branches share any external effect surface (filesystem, database, remote API, message bus). Does not apply to branches that are strictly side-effect-free or that run in fully isolated, content-addressed sandboxes with no shared mutable state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-its-speculative-branch-has-been-invalidated-by-a-sibling-s-committed-side-effect-during-parallel-hedging.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-its-speculative-branch-has-been-invalidated-by-a-sibling-s-committed-side-effect-during-parallel-hedging.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-its-speculative-branch-has-been-invalidated-by-a-sibling-s-committed-side-effect-during-parallel-hedging.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1679,
    "python_slice_tokens": 232,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch produced wrong output\" and not \"a branch crashed.\" It is a **write-after-commit invalidation**: branch A commits a side effect (a file write, a row update, a sent message) inside a speculative envelope that the orchestrator later decides to roll back, while sibling branch B has *already read that committed state* and built its ow...",
    "what_was_observed": "A planner agent dispatched three hedged subagents (A, B, C) to complete a task requiring a config file update plus a derived report. Each subagent ran in a \"speculative envelope\": effects were staged to the real filesystem under a per-branch prefix, and the orchestrator would pick the winner and promote it, discarding the others. Branch A staged `config.v2.yaml` and, as part of its own verification step, wrote a prob...",
    "condition_of_validity": "The guardrail only works if the orchestrator maintains a **read-set / write-set ledger per branch, keyed on effect surface, with cross-branch dependency edges**. Concretely: 1. Every effect surface access (read or write) is recorded against the accessing branch at the moment of access, not at branch completion. Deferred accounting loses the ordering that mak...",
    "decision_boundary": "The instance must distinguish two situations that look identical from inside a branch: - **Genuine independence**: B read state that no sibling will write, or read state committed *before* speculation began. B's result is sound; rollback of siblings does not touch it. - **Contaminated independence**: B read state that a sibling wrote *during* the speculation...",
    "operational_effect": "With the ledger and transitive invalidation in place, the failure mode converts from silent corruption into an explicit, bounded re-execution: B is flagged `CONTAMINATED_BY_ROLLBACK`, its result is withheld from consensus, and the orchestrator either re-runs B against the post-rollback state or escalates. Cost: one extra branch execution in the rare cross-br..."
  },
  "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": "644bf4f18e7e573b0e07e0aafc710121e2156e1309797efa178f9c922be8b8ee",
    "verified_classes": [
      "ContaminatedBranchError",
      "BranchLedger",
      "SpeculationOrchestrator"
    ],
    "verified_functions": [
      "__init__",
      "register",
      "record_read",
      "record_write",
      "check_contamination",
      "promote"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ContaminatedBranchError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
