{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-speculative-branch-forking-from-corrupting-durable-tool-call-side-effects-on-rollback",
  "title": "Which invariants prevent speculative branch forking from corrupting durable tool-call side effects on rollback",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any multi-agent orchestrator that forks speculative execution branches across parallel worker LLMs to accelerate multi-step tool-using tasks, where branches may be rolled back after a losing branch has already emitted tool calls with externally observable side effects. Does not apply to read-only tool surfaces or to orchestrators that serialize all tool invocation behind a single commit barrier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-forking-from-corrupting-durable-tool-call-side-effects-on-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-forking-from-corrupting-durable-tool-call-side-effects-on-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-speculative-branch-forking-from-corrupting-durable-tool-call-side-effects-on-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1696,
    "python_slice_tokens": 244,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *speculative state* (agent reasoning, partial plans, draft tool arguments) and *committed state* (tool invocations whose effects escape the agent's address space: writes, sends, purchases, mutations). Most speculative-execution designs treat forking as a cheap copy-on-write of context and assume rollback is symmetric: ...",
    "what_was_observed": "A planner agent forked three branches to resolve a single ambiguous subgoal: \"reconcile the customer's duplicate charge.\" Each branch was assigned a different hypothesis (refund-first, ledger-adjust-first, escalate-first) and given a 4-second speculative window. Branch B (ledger-adjust-first) won the reasoning race at 2.1s. Branch A (refund-first) lost at 3.8s — but at 2.9s, before being cancelled, it had already inv...",
    "condition_of_validity": "Rollback-safe forking requires an invariant that is stronger than context isolation: > **No branch may emit a tool call with externally observable side effects unless that branch holds a commit token for the effect's idempotency key, and the token is revoked-and-fenced before rollback is declared complete.** The critical word is *fenced*. Revocation alone is...",
    "decision_boundary": "The boundary is between **speculating over reads** and **speculating over writes**. A branch may freely execute tools whose effects are confined to the branch's own scratch namespace (retrieval, draft generation, dry-run validation) without a commit token. The moment a branch's plan reaches a tool with an external effect, the orchestrator must make a hard de...",
    "operational_effect": "Once the invariant is enforced, the observable behavior changes in three ways. Orphaned effects stop appearing in the committed lineage's post-state, so the auditor's replay matches the world. Late-landing calls from fenced branches collide on the idempotency key and are rejected with a distinguishable `FENCED` status, which the orchestrator can log as a *co..."
  },
  "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": "0614dbc7e092610fe2d857a412fe28c15076c72020ef77e89730f415e42817cf",
    "verified_classes": [
      "SpeculativeRollbackViolation",
      "FenceRegistry"
    ],
    "verified_functions": [
      "rollback_branch",
      "__init__",
      "current_epoch",
      "bump",
      "admit"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeRollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
