{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-and-verify-rollback-from-committing-side-effects-from-abandoned-trajectories",
  "title": "Which invariants prevent speculative branch-and-verify rollback from committing side-effects from abandoned trajectories",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent orchestrators that run speculative action trajectories in parallel (branch-and-verify) and roll back losers after a verifier selects a winner. Covers only trajectories whose actions touch *external, non-idempotent* effects (writes, sends, payments, resource allocation). Does not apply to pure-reasoning branches with no side-effecting tool calls, nor to single-agent retry loops.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-and-verify-rollback-from-committing-side-effects-from-abandoned-trajectories.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-and-verify-rollback-from-committing-side-effects-from-abandoned-trajectories.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-and-verify-rollback-from-committing-side-effects-from-abandoned-trajectories.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1992,
    "python_slice_tokens": 378,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Rollback of an agent trajectory is not rollback of an agent's *state*. The two decouple the moment a speculative branch invokes a tool with an external, non-idempotent effect. Internal state—the message log, scratchpad, tool-call history, pending plan—lives inside the orchestrator and can be discarded atomically. The external effect does not: an email sent, ...",
    "what_was_observed": "An orchestrator fans out three branches for a \"reconcile account\" task. Each branch is an agent instance with the same toolset: `read_ledger`, `issue_refund`, `send_notification`. Branch A and Branch B both reach a step where they decide a refund of $40 is owed and call `issue_refund(account, 40)`. Branch C concludes no refund. A verifier scores trajectories and selects A as winner because its reasoning trace is clea...",
    "condition_of_validity": "The invariant that bounds this hazard is a **commit barrier on effectful actions**: no branch may perform a non-idempotent external effect until it has been selected as the winner, *or* every effect must be executed through a branch-scoped, compensable transaction with a unique effect key derived from `(trajectory_id, step_id)`. This holds only under three c...",
    "decision_boundary": "The boundary between safe speculation and the hazard is drawn at the first `effectful` call on a branch that has not yet been selected. The decision rule for the orchestrator: - **Speculate freely** across branches whose steps are `pure` or `idempotent`. These can be rolled back by discarding context; repeated execution is harmless. - **Gate, do not speculat...",
    "operational_effect": "With the commit barrier and branch-keyed compensation in place, the observable behavior changes in three measurable ways. First, rollback latency rises (inverses must run), but post-rollback anomaly rate drops to near zero because the world is restored to the snapshot the winner's plan assumed. Second, winner selection becomes causally clean: the verifier sc..."
  },
  "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": "a6b44db587f0b841cea31a294bcfff3bca3e0b831f3c0a15308274ee96f06338",
    "verified_classes": [
      "EffectClass",
      "SpeculationRollbackError",
      "EffectRecord",
      "Branch",
      "SpeculationController"
    ],
    "verified_functions": [
      "__init__",
      "_effect_key",
      "execute_step",
      "rollback"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculationRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
