{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-tool-effects-from-surviving-a-rollback-across-branched-agents",
  "title": "Which invariants prevent speculative tool effects from surviving a rollback across branched agents",
  "date_of_record": "2026 November 28",
  "scope": "Applies to multi-agent systems where a planner spawns speculative branches (parallel or sequential) that optimistically invoke side-effecting tools before a merge decision, and where rollback is expected to restore a consistent world-state. Does not apply to read-only tool sets, single-agent linear execution, or systems where every tool call is gated behind a committed merge.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-effects-from-surviving-a-rollback-across-branched-agents.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-effects-from-surviving-a-rollback-across-branched-agents.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-tool-effects-from-surviving-a-rollback-across-branched-agents.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2188,
    "python_slice_tokens": 342,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things called \"rollback\" in speculative agent execution, and conflating them is the root of the failure mode. The first is **state rollback**: restoring the agent's own memory, scratchpad, working context, and branch bookkeeping to a pre-speculation checkpoint. This is cheap, deterministic, and fully under the orchestrator's control. Y...",
    "what_was_observed": "A planner agent decomposes a task into three candidate strategies and spawns three speculative branches, A, B, and C, each with a fork of the base context at checkpoint `t0`. Each branch is granted an optimistic tool budget: it may invoke side-effecting tools before merge, on the assumption that losing branches will be rolled back. The trace: 1. Branch A invokes `append_ledger(entry=\"strategy_A_committed\")` at its st...",
    "condition_of_validity": "The invariant that must hold for speculative rollback to be sound: > **Effect Ownership Invariant (EOI):** Every side effect produced under a speculative branch must be bound to that branch's `spec_id` for the entire lifetime of the effect, and the merge operation must resolve every outstanding `spec_id` to exactly one of {committed, compensated, quarantined...",
    "decision_boundary": "The boundary between safe and unsafe speculation is drawn not by *what* the branch did, but by *whether the effect's inverse is registered and its preconditions are checkable at rollback time*. Concretely, at the moment a branch is marked discarded: - If the effect is in staging (never escaped): rollback is a delete. **Safe.** - If the effect escaped but has...",
    "operational_effect": "When the Effect Ownership Invariant holds, speculative execution becomes genuinely safe: branches can be discarded with confidence, the merged state is a faithful description of the world, and reconciliation jobs have nothing to find. The cost is that optimistic tool budgets shrink to the set of effects with registered, precondition-checkable inverses—which ..."
  },
  "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": "20651c777e00e56467e0e9051d04e58a0b1ee0b3e4055e467e522775848a1b56",
    "verified_classes": [
      "SpeculationRollbackError",
      "EffectDisposition",
      "SpecEffect",
      "SpeculativeBranch"
    ],
    "verified_functions": [
      "rollback_branch"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculationRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
