{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-abort-a-speculative-branch-before-rollback-reconciliation-and-how-does-the-prune-before-commit-invariant-prevent-gh",
  "title": "In what scenarios must an instance abort a speculative branch before rollback reconciliation, and how does the \"prune-before-commit\" invariant prevent ghost side effects in branch-and-prune multi-agent rollouts?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestrators that spawn speculative agent branches executing optimistic tool calls against shared external state (filesystems, APIs, databases) and later prune losing branches via compensating rollback. Does not apply to purely read-only speculative decoding or single-agent retry loops with no external side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-a-speculative-branch-before-rollback-reconciliation-and-how-does-the-prune-before-commit-invariant-prevent-gh.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-a-speculative-branch-before-rollback-reconciliation-and-how-does-the-prune-before-commit-invariant-prevent-gh.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-a-speculative-branch-before-rollback-reconciliation-and-how-does-the-prune-before-commit-invariant-prevent-gh.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1549,
    "python_slice_tokens": 321,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"a branch failed\" or \"rollback was slow.\" It is the **interleaving of prune-time rollback with sibling commit-time side effects on the same external resource**. In branch-and-prune rollouts, N speculative branches are launched optimistically; each may invoke tools with real side effects before the orchestrator has decided which b...",
    "what_was_observed": "A three-way speculative rollout (planner, executor, verifier branches) shared a scratch object store. Each branch issued `put(key, value)` optimistically to avoid serialization latency. On selection, the orchestrator issued compensating `delete(key)` for the two losers, then marked the winner committed. Trace: - t=10 branch_A `put(\"artifact\", A_v)` → ok - t=11 branch_B `put(\"artifact\", B_v)` → ok (overwrites A) - t=1...",
    "condition_of_validity": "The prune-before-commit invariant is *required* when and only when all three hold: 1. **Shared mutable resource**: two or more branches can write the same key/resource identity. 2. **Optimistic pre-commit writes**: branches perform side effects before selection (else there is nothing to roll back). 3. **Asynchronous or retried compensation**: rollback is a n...",
    "decision_boundary": "The orchestrator must treat the boundary between **prune quiescence** and **commit** as a hard fence, not a soft ordering hint: - **Abort-before-commit trigger**: if any losing branch's rollback is unresolved (in-flight, retrying, or failed) at commit time, the orchestrator MUST NOT commit the winner against the shared resource. It must either (a) block comm...",
    "operational_effect": "Enforcing prune-before-commit converts a class of silent, hard-to-attribute failures (lost winner effects, stale-read consensus mismatches, mid-consumption deletions from retried rollbacks) into a single explicit fault at the orchestration layer. The cost is reduced speculation parallelism on contended resources — branches touching the same key serialize at ..."
  },
  "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": "ae58425ea44874313d1b7d4e885abe2cf1012f0743df8c88c82cacf29d4a2b5a",
    "verified_classes": [
      "ReconciliationIncomplete",
      "StaleGenerationWrite",
      "Branch",
      "Resource"
    ],
    "verified_functions": [
      "reconcile_and_commit",
      "put",
      "delete"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReconciliationIncomplete",
      "StaleGenerationWrite"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
