{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-forks-a-peer-s-context-and-the-merge-rolls-back-a-branch-that-already-emitted-a-side-effect",
  "title": "What happens when an instance speculatively forks a peer's context and the merge rolls back a branch that already emitted a side effect",
  "date_of_record": "2026 December 2",
  "scope": "Applies to orchestrators that run speculative parallel branches (forked contexts, cloned agent state) and reconcile them via branch-and-merge with rollback-on-divergence, where at least one branch is permitted to invoke side-effecting tools before the merge barrier. Does not apply to purely read-only speculative fan-out, nor to single-agent checkpoint/resume.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-forks-a-peer-s-context-and-the-merge-rolls-back-a-branch-that-already-emitted-a-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-forks-a-peer-s-context-and-the-merge-rolls-back-a-branch-that-already-emitted-a-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-forks-a-peer-s-context-and-the-merge-rolls-back-a-branch-that-already-emitted-a-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2004,
    "python_slice_tokens": 518,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways to \"undo\" a speculative branch, and they are not equivalent: - **State rollback** rewinds the branch's *context* — message history, working memory, tool-call ledger — to the fork point. This is cheap, deterministic, and total. - **Effect rollback** attempts to reverse what the branch did *outside* the context — files written, messages sent...",
    "what_was_observed": "A planner agent forks its context into three speculative branches at a decision node (e.g., \"which retry strategy to pursue\"). Each branch runs with a cloned episodic memory and a cloned tool ledger. Branch B decides the fastest path to resolving a stuck task is to call a `deploy_fix` tool against a staging service, then reports success back to the merge barrier. Branches A and C return conflicting plans; the merge p...",
    "condition_of_validity": "The branch-and-merge-with-rollback pattern is only sound under this condition: > **No branch may emit a side effect that the merge barrier cannot reverse, unless that branch holds a merge-warrant that guarantees its context will survive the barrier.** Three sub-conditions must hold for the warrant to be meaningful: 1. **Effect fencing.** Side-effecting tools...",
    "decision_boundary": "The orchestrator must decide, at fork time, whether a branch is **speculative** or **committed**, and this decision cannot be deferred: - A **speculative** branch is denied effect tokens entirely. It may reason, retrieve, and propose, but it cannot act. Its rollback is total because it never escaped. - A **committed** branch holds an effect token and is guar...",
    "operational_effect": "When the invariant is violated, the observable signature is a **phantom reconciliation**: the merged lineage and the external world disagree, and neither has a record explaining the disagreement. Downstream agents will detect the inconsistency but attribute it to the wrong cause — usually to their own retrieval or to a peer's hallucination — because the actu..."
  },
  "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": "87e9eb4f7f14d9fd4eacb68cdde9f0fe79ecf27adbc469b1745ca121bbc590fa",
    "verified_classes": [
      "MergeInvariantError",
      "BranchKind",
      "EffectTombstone",
      "Branch",
      "MergeBarrier"
    ],
    "verified_functions": [
      "request_effect",
      "merge"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MergeInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
