{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-orphaned-speculative-tool-calls-from-corrupting-the-commit-frontier-during-branch-and-verify-rollback",
  "title": "Which invariants prevent orphaned speculative tool-calls from corrupting the commit frontier during branch-and-verify rollback",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent planners that fork N speculative branches, dispatch tool-calls eagerly on each branch, and commit only the branch whose verifier wins. Does not apply to strictly sequential single-branch execution, nor to branches whose tool-calls are provably side-effect-free and idempotent (pure reads).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-orphaned-speculative-tool-calls-from-corrupting-the-commit-frontier-during-branch-and-verify-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-orphaned-speculative-tool-calls-from-corrupting-the-commit-frontier-during-branch-and-verify-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-orphaned-speculative-tool-calls-from-corrupting-the-commit-frontier-during-branch-and-verify-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1972,
    "python_slice_tokens": 469,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *rollback of agent state* and *rollback of external effects*. A branch-and-verify controller can perfectly rewind the reasoning state of a losing branch—discard its context, its scratchpad, its accumulated sub-goals—while the tool-calls that branch already fired continue executing in the outside world. The failure is n...",
    "what_was_observed": "A planner forked four branches to resolve a single ambiguous user instruction (\"reconcile the two inventory snapshots\"). Each branch independently decided which snapshot was authoritative and fired a `write_reconciliation` tool-call against the same downstream ledger, differing only in which snapshot it treated as source-of-truth and in an offset parameter. Branch 3 won verification at T+840ms. The controller rolled ...",
    "condition_of_validity": "The invariant that would have prevented this is: **a speculative tool-call may only be dispatched if it is either (a) reversible by a compensating action registered at dispatch time, or (b) gated behind a commit token that the winning branch must present before the effect is applied.** The controller in the incident satisfied neither. Its rollback was a stat...",
    "decision_boundary": "The boundary is not \"speculate or don't.\" It is: **classify every tool in the surface as `speculable` or `serialized`, and refuse to dispatch an unclassified tool on a speculative branch.** The classification is a property of the tool, not of the call site, and it must be enforced at the dispatcher, not at the planner—planners are probabilistic and will even...",
    "operational_effect": "With the invariant enforced, the failure mode inverts: instead of a losing branch silently committing, the dispatcher rejects the late write and the controller observes a `StaleEpochWrite` at the effect store, which it attributes to the correct branch and logs as a suppressed speculation. The commit frontier becomes a single monotonic sequence number shared ..."
  },
  "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": "46e1ebd7740fcb26f6b489021cf5217d997fdd8e4a39c97fcd18cf31aa94fe21",
    "verified_classes": [
      "ToolClass",
      "SpeculativeDispatchRefused",
      "StaleEpochWrite",
      "ToolSpec",
      "Branch",
      "EffectStore",
      "SpeculativeDispatcher"
    ],
    "verified_functions": [
      "commit_winner",
      "run_incident_replay",
      "is_safely_cancellable",
      "apply",
      "dispatch"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "SpeculativeDispatchRefused",
      "StaleEpochWrite"
    ],
    "sample_fail_closed_invariants": [
      "assert [e[0] for e in store.applied] == [3]"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
