{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-invalidate-a-speculative-branch-before-rollback-rather-than-replaying-it-the-side-effect-witness-problem-in-branch",
  "title": "In what scenarios must an instance invalidate a speculative branch before rollback, rather than replaying it — the side-effect witness problem in branch-and-verify multi-agent execution",
  "date_of_record": "2026 December 1",
  "scope": "Applies to orchestrators that fan out speculative agent branches (parallel plan proposals, draft-and-critique forks, tree-search over agent trajectories) and roll back divergent branches by reverting to a checkpoint. Does not apply to branches whose only effects are pure context mutations (scratchpad text, internal reasoning) with no externalized tool calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-a-speculative-branch-before-rollback-rather-than-replaying-it-the-side-effect-witness-problem-in-branch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-a-speculative-branch-before-rollback-rather-than-replaying-it-the-side-effect-witness-problem-in-branch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-a-speculative-branch-before-rollback-rather-than-replaying-it-the-side-effect-witness-problem-in-branch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1394,
    "python_slice_tokens": 126,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"rollback fails.\" Rollback of *context* is cheap and deterministic: truncate the transcript to the checkpoint token span, restore the tool-schema snapshot, resume. The failure mode is **rollback of *effects* that were never captured as state**. A speculative branch that calls a non-idempotent tool (send email, POST payment, append to ...",
    "what_was_observed": "A three-branch speculative planner (branch A: refund via API, branch B: refund via manual ledger entry, branch C: escalate to human) ran against a shared tool mesh. The verifier scored branch B highest and the orchestrator rolled back A and C by truncating to the pre-fork checkpoint and replaying B's continuation. Two independent effects surfaced: 1. **Branch A had already called `payments.refund(order_id)`** before ...",
    "condition_of_validity": "The \"rollback = restore world\" invariant holds only under a conjunction that speculative execution routinely violates: - **Effect capture completeness:** every external call made during the speculative window is durably logged with (branch_id, tool, idempotency_key, compensating_action) *before* the call returns, not after the branch commits. - **Idempotency...",
    "decision_boundary": "At rollback time, for each losing branch, evaluate: - If the branch's effect ledger is **empty** → safe to truncate; pure context rollback. - If ledger is **non-empty and every entry is idempotent-with-key** → safe to replay; re-emission is a no-op. - If ledger is **non-empty and any entry is non-idempotent with no registered inverse** → **invalidate**. Do n...",
    "operational_effect": "Orchestrators that skip this boundary exhibit three downstream signatures: (1) duplicated external effects proportional to the number of losing branches that reached tool-call depth, (2) dedup-key collisions that silently drop legitimate retries after a rollback, and (3) post-merge consistency checks that pass because they compare transcripts rather than led..."
  },
  "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": "e45b27b5c0179ac23fe9fd4ea446b5072c34db1e3564343bb1217f8dcdd15cb4",
    "verified_classes": [
      "PoisonedSpeculativeBranch"
    ],
    "verified_functions": [
      "rollback_branch"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "PoisonedSpeculativeBranch"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
