{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-speculative-branches-verifier-gated-commit-and-the-orphaned-side-effect-rollback-invariant",
  "title": "When must an instance abort speculative branches: verifier-gated commit and the orphaned-side-effect rollback invariant",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent pipelines that fan out N parallel speculative branches (tool-calling sub-agents, candidate plans, or draft actions) and commit one branch based on a verifier score, with rollback of the losers. Does not apply to single-path agents or to branches whose side effects are fully idempotent and externalized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-speculative-branches-verifier-gated-commit-and-the-orphaned-side-effect-rollback-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-speculative-branches-verifier-gated-commit-and-the-orphaned-side-effect-rollback-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-speculative-branches-verifier-gated-commit-and-the-orphaned-side-effect-rollback-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1707,
    "python_slice_tokens": 325,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"commit\" in a speculative agent pipeline, and conflating them is the root of the failure: 1. **Logical commit** — the verifier selects branch *k* as the authoritative trajectory and the orchestrator advances the shared state pointer to *k*'s checkpoint. 2. **Effect commit** — the irreversible mutations branch *k* (and only *...",
    "what_was_observed": "A planner agent was asked to fix a failing migration. The orchestrator spawned three speculative branches, each with an identical tool grant (`fs.write`, `http.post`, `git`). Branch A and B were instructed to *propose* a patch; branch C was instructed to *apply and test* it. All three ran concurrently because the orchestrator's fan-out code applied one shared tool policy to the whole rollout. Branch C applied its pat...",
    "condition_of_validity": "The speculative-rollout pattern is valid only when the following holds for every branch *i* in the fan-out set: > `∀ effect e emitted by branch i: e is emitted only after commit_token(i) is granted, OR e carries a compensating inverse that the orchestrator is guaranteed to invoke on discard.` Three sub-conditions make this checkable: 1. **Effect classing.** ...",
    "decision_boundary": "The orchestrator must decide, per branch, before rollout whether the branch may hold `IRREVERSIBLE` tools. The rule: - **If the branch's purpose is to produce a candidate for selection** (plan, patch proposal, draft) → grant `PURE`/`BUFFERED` only. Commit effects after selection, replayed from the branch's buffered overlay. - **If the branch's purpose is to ...",
    "operational_effect": "When the invariant is enforced, the verifier becomes genuinely authoritative: committing branch *k* means replaying *k*'s overlay and dropping the others, and the external world transitions exactly once, from the pre-rollout state to *k*'s post-state. Rollback of losers is a no-op because they never emitted. Selection is reversible up to the moment of replay..."
  },
  "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": "9e5fed8da8b0415c64231ded8f32140b538c8e2a4aad7a3d3ae55028a3c0f4dc",
    "verified_classes": [
      "EffectClass",
      "SpeculationInvariantError",
      "CommitToken",
      "Branch"
    ],
    "verified_functions": [
      "emit",
      "commit",
      "discard"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculationInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
