{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-have-been-externally-invalidated-before-rollback-commit",
  "title": "How does an instance detect that a speculative branch's tool-call side effects have been externally invalidated before rollback commit?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to orchestrators that fork parallel speculative agent branches sharing a tool-execution substrate, where branch results are conditionally committed via rollback or merge. Does not apply to single-threaded agents or branches with fully isolated, sandboxed side-effect namespaces that are never reconciled.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-have-been-externally-invalidated-before-rollback-commit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-have-been-externally-invalidated-before-rollback-commit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-have-been-externally-invalidated-before-rollback-commit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1919,
    "python_slice_tokens": 403,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative multi-agent execution assumes a clean dichotomy: a branch either *succeeds* (commit its state delta) or *fails* (roll back to the pre-fork checkpoint). This dichotomy holds only when the branch's tool-call side effects remain inside the rollback envelope—i.e., the substrate can reversibly undo everything the branch did. The non-obvious boundary i...",
    "what_was_observed": "A planner forked three speculative branches to satisfy a goal `provision(tenant)`. Each branch chose a different strategy: - Branch A: `create_bucket(\"tenant-x\")` then `grant_policy(bucket, \"read\")`. - Branch B: `create_bucket(\"tenant-x\")` (same name, different provider region) then `attach_logging(bucket)`. - Branch C: `create_bucket(\"tenant-x-2\")`. The orchestrator's reconciler scores branches and elects A. On comm...",
    "condition_of_validity": "Rollback-as-commit-negotiation is valid only when all of the following hold for every speculative side effect: 1. **Injective resource identity.** The forward call returns (or the adapter synthesizes) a resource handle that is unique across all concurrently live branches—region, generation, or a server-issued UUID, not a caller-chosen name. 2. **Pre-image pi...",
    "decision_boundary": "The instance must decide, at the moment it prepares to roll back a branch, whether the branch's recorded side effects are still *the same effects* in the world. The boundary condition is: - **Safe to roll back** iff every recorded forward effect carries a pinned pre-image token and the current world state matches that token, *or* the effect is classified `co...",
    "operational_effect": "Without the invariant, speculative fan-out silently converts a race into data loss: the orchestrator's final state vector is consistent with its own bookkeeping but inconsistent with the world, and the discrepancy is only discovered downstream when a consumer finds a missing resource or a double-applied counter. With the invariant enforced, speculative branc..."
  },
  "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": "d8cb6964ac0203e85a09f877fcc50600969d078951eb0b499024a613e3949696",
    "verified_classes": [
      "EffectClass",
      "SpeculativeRollbackError",
      "EffectRecord",
      "WorldState",
      "SpeculativeBranch"
    ],
    "verified_functions": [
      "reconcile",
      "current_token",
      "__init__",
      "record_forward",
      "rollback"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SpeculativeRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
