{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-and-merge-agent-plans-from-committing-orphaned-side-effects-on-rollback",
  "title": "Which invariants prevent speculative branch-and-merge agent plans from committing orphaned side effects on rollback",
  "date_of_record": "2026 November 27",
  "scope": "Applies to orchestrators that speculatively fork a plan into parallel agent branches, execute tool calls optimistically, and merge the winning branch while rolling back losers. Does not apply to strictly sequential single-agent execution or to branches whose tool calls are provably side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-and-merge-agent-plans-from-committing-orphaned-side-effects-on-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-and-merge-agent-plans-from-committing-orphaned-side-effects-on-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-and-merge-agent-plans-from-committing-orphaned-side-effects-on-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1715,
    "python_slice_tokens": 166,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A speculative branch-and-merge executor distinguishes between *logical rollback* (discarding a branch's reasoning state, message history, and intermediate artifacts) and *physical rollback* (undoing the external effects its tool calls already produced). The failure mode this record isolates is the silent divergence between these two: the orchestrator believe...",
    "what_was_observed": "A planner agent received a task and, under a latency budget, forked three branches (`B0`, `B1`, `B2`) that each proposed a different migration strategy. Each branch was given a scoped tool grant including `db.execute`, `fs.write`, and `http.post`. The arbiter's policy was first-to-pass-verification wins; the others are rolled back. Trace of the failure: 1. `B0` and `B1` both begin optimistically. `B0` issues `http.po...",
    "condition_of_validity": "The \"abort ⇒ clean\" assumption holds only under a conjunction that speculative executors rarely enforce: - **Effect isolation:** every tool call issued by a speculative branch is either (a) routed to a branch-private shadow namespace (transactional outbox, per-branch scratch schema, dry-run endpoint) or (b) explicitly declared idempotent and commutative with...",
    "decision_boundary": "The boundary is whether the orchestrator treats the merge arbiter as a *selector* or as a *transaction manager*. A selector picks a winner and discards losers — correct only under full effect isolation. A transaction manager must additionally: - Maintain an **effect ledger** per branch, appended at tool-call issue time, recording `(tool, args_hash, idempoten...",
    "operational_effect": "Systems that miss this boundary exhibit *phantom commits*: effects that survive their originating branch's abort and are misattributed to the merged branch during post-hoc audit, because the ledger that would disambiguate them was never written. The observable symptoms are duplicate non-idempotent actions (notifications, charges, resource provisioning), lost..."
  },
  "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": "681dc4cf5945a948fb713c255f4a269898e9059b7c52e09a8ac648354b239608",
    "verified_classes": [
      "SpeculativeRollbackViolation"
    ],
    "verified_functions": [
      "mark_rolled_back"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpeculativeRollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
