{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-speculative-tool-side-effect-as-irreversible-before-the-rollback-barrier-is-drained",
  "title": "Under what conditions must an instance treat a speculative tool side effect as irreversible before the rollback barrier is drained",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agent runtimes that fork speculative execution branches, invoke tools optimistically, and reconcile branches through a rollback barrier before committing. Does not apply to single-branch synchronous execution or to tools declared pure/idempotent with server-side deduplication keys.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-speculative-tool-side-effect-as-irreversible-before-the-rollback-barrier-is-drained.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-speculative-tool-side-effect-as-irreversible-before-the-rollback-barrier-is-drained.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-speculative-tool-side-effect-as-irreversible-before-the-rollback-barrier-is-drained.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2263,
    "python_slice_tokens": 499,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative multi-agent execution assumes a clean dichotomy: a branch either commits (its effects become canonical) or rolls back (its effects are discarded). This dichotomy holds only for state the runtime owns. The failure we examine is the **orphaned external effect**: a tool invocation issued on a speculative branch whose external side effect (a sent ema...",
    "what_was_observed": "A planner agent forked three speculative branches to satisfy a \"reconcile vendor invoices\" task. Each branch optimistically invoked `issue_refund(vendor_id, amount)`. Branch B's refund call succeeded externally (ledger append, HTTP 200, idempotency key returned) but its local post-processing threw a `ContextWindowExhausted` when the branch tried to summarize the receipt, so the branch was marked failed. The reconcile...",
    "condition_of_validity": "The rollback barrier is safe to drain for a branch only when, for every effect the branch emitted, at least one of the following holds **and is checked at drain time, not at emit time**: - The effect is registered as compensable, and the compensation handle is stored in a **barrier-exempt effect journal** (not in branch-local state), keyed by a stable effect...",
    "decision_boundary": "The runtime is at the decision boundary the moment a branch transitions to `FAILED` or `ROLLED_BACK` while its effect journal contains entries. The decision is not \"roll back or commit.\" It is a three-way classification per effect: - **Compensable + handle present** → rollback is safe; enqueue compensation. - **Dispatched key present in journal, no compensat...",
    "operational_effect": "The architectural consequence is that **effect identity must be decoupled from branch identity.** Branch B and Branch C are different speculative paths, but they may target the same logical effect (refund invoice #4471). The runtime must key deduplication on the logical effect identity, not the branch. This means the planner, at fork time, must assign a *sta..."
  },
  "matched_failure_symptoms": [
    "SPLIT_BRAIN_OR_ZOMBIE_WORKER"
  ],
  "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": "010d8b673b60a14da8496b9cca2cc88ea60f84af3dc49751a0a04ea033655313",
    "verified_classes": [
      "EffectState",
      "OrphanedEffectError",
      "EffectSlot",
      "EffectJournal"
    ],
    "verified_functions": [
      "drain_rollback_barrier",
      "commit_branch",
      "__init__",
      "reserve",
      "mark_emitted",
      "orphan"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrphanedEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
