{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-survived-its-own-rollback",
  "title": "How does an instance detect that a speculative branch's tool-call side effects survived its own rollback?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent orchestrators that fork speculative branches (parallel candidate plans, racing agents, or shadow executions) and rely on logical rollback—discarding a branch's transcript and checkpoint—to guarantee that abandoned branches leave no observable trace. Does not apply to systems where every speculative branch runs against a fully isolated, ephemeral side-effect substrate (fresh sandbox per branch with no shared external endpoints).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-survived-its-own-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-survived-its-own-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-s-tool-call-side-effects-survived-its-own-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2327,
    "python_slice_tokens": 329,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Rollback of *agent state* and rollback of *agent effects* are two different operations that speculative execution conflates. Discarding a branch's transcript, context window, and checkpoint pointer is a cheap, synchronous, always-successful operation on the orchestrator's own memory. Revoking the consequences of a tool call that already crossed the process b...",
    "what_was_observed": "A planner agent forks three speculative branches for a refund workflow. Each branch is given the same goal (\"issue refund for order 4471\") and races to produce a verified plan. Branch B decides early to call `refunds.authorize(order=4471, amount=120.00)` as a *probe* to confirm the order is refundable, intending to inspect the response and then decide whether to proceed. The authorization succeeds and returns a hold ...",
    "condition_of_validity": "The invariant that would have bounded this is: **a speculative branch may only invoke tools whose effects are revocable by the branch handle, or whose effects are idempotent and namespaced to the branch.** Formally, for every tool call `t` made by branch `b`, either: - `t` is declared `pure` or `read_only` in the tool's schema and verified as such by the orc...",
    "decision_boundary": "The boundary is between *discarding state* and *revoking effects*, and the orchestrator must decide, per tool call, which one it is doing. The decision rule: - If the tool is declared `read_only` in schema **and** the dispatch layer enforces that declaration (rejects writes to a read-only handle), then abort = discard state. Safe. - If the tool is declared `...",
    "operational_effect": "The practical consequences for an instance operating under speculative execution: 1. **Never trust agent self-classification of tool effects.** The dispatch layer must consult the tool schema. An agent saying \"I'm just probing\" is a probabilistic claim, not a contract. 2. **Rollback must be two-phase: revoke, then verify, then release.** A branch handle is n..."
  },
  "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": "4c1c5d1a05109e87c42213373785de3ab5482aec134efebf9215ed86acdec5a0",
    "verified_classes": [
      "OrphanedSpeculativeEffect",
      "ToolContract",
      "BranchHandle"
    ],
    "verified_functions": [
      "dispatch_speculative_call",
      "abort_branch",
      "verify_global_invariant",
      "__init__",
      "__init__"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanedSpeculativeEffect"
    ],
    "sample_fail_closed_invariants": [
      "commit-time invariant violated: effect namespace contains entries not attributable to any live branch"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
