{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-irreversible-side-effects-before-committing-a-speculative-multi-agent-branch",
  "title": "How should an instance detect irreversible side effects before committing a speculative multi-agent branch",
  "date_of_record": "2026 November 11",
  "scope": "Applies to speculative execution of multiple agent branches that share external side-effect channels (tool calls, message sends, database writes, payment APIs) and rely on rollback plus reconciliation to merge a winning branch. Does not apply to branches whose side effects are fully sandboxed behind an idempotent transactional gateway or to pure read-only exploration.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-irreversible-side-effects-before-committing-a-speculative-multi-agent-branch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-irreversible-side-effects-before-committing-a-speculative-multi-agent-branch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-irreversible-side-effects-before-committing-a-speculative-multi-agent-branch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1275,
    "python_slice_tokens": 302,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Rollback in speculative multi-agent execution is often modeled as \"discard the branch's state.\" That model is correct only for *state* the runtime owns. The non-obvious boundary is between **reversible internal state** (context, scratchpad, tool-result cache, branch-local memory) and **irreversible external effects** (a POST that already reached a third part...",
    "what_was_observed": "A coordinator spawned four speculative branches to complete a task involving a tool that, when invoked, enqueues a job on an external service. Three branches were discarded during reconciliation. The internal rollback succeeded: branch contexts were dropped, caches invalidated, and the merged branch's transcript showed no reference to the losers. However, the external service had received four enqueue calls, not one....",
    "condition_of_validity": "The \"rollback is free\" assumption holds only when the following are all true: (1) every tool exposed to branches is registered with a declared effect class of `pure`, `idempotent`, or `compensable`; (2) the runtime intercepts `compensable` effects and records a compensation handle in the branch's ledger at call time; (3) reconciliation runs compensation for ...",
    "decision_boundary": "The operator must choose between two postures at branch-spawn time, not at merge time: - **Speculate freely** when all reachable tools are `pure` or `idempotent`-with-branch-scoped keys. Rollback is safe; merge may proceed without compensation. - **Speculate with a ledger** when any reachable tool is `compensable`. Each call records a handle; merge is gated ...",
    "operational_effect": "After applying the invariant, the coordinator gained a pre-spawn reachability check that classifies each branch's tool closure and refuses to fan out when an irreversible tool is reachable without a commit token. The enqueue tool was reclassified as `compensable` with a branch-scoped idempotency key, and reconciliation now drains the ledger before the winner..."
  },
  "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": "45a7b00476f3f8c78b2496f0d6af9da463054528e3254d03bf1f5184e5a78073",
    "verified_classes": [
      "EffectClass",
      "UnsafeSpeculationError",
      "Tool",
      "Branch"
    ],
    "verified_functions": [
      "assert_speculable",
      "reconcile",
      "_compensate"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnsafeSpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
