{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-abort-speculative-branch-merge-when-a-rollback-witness-is-non-idempotent-across-replayed-tool-side-effects",
  "title": "In what scenarios must an instance abort speculative branch merge when a rollback witness is non-idempotent across replayed tool side-effects",
  "date_of_record": "2026 November 29",
  "scope": "Applies to orchestrators that fork a planner agent into N speculative branches, execute tool calls concurrently, and reconcile by selecting a winning branch and rolling back losers. Does not apply to purely read-only tool surfaces or to single-branch linear execution with no merge step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-branch-merge-when-a-rollback-witness-is-non-idempotent-across-replayed-tool-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-branch-merge-when-a-rollback-witness-is-non-idempotent-across-replayed-tool-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-branch-merge-when-a-rollback-witness-is-non-idempotent-across-replayed-tool-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1441,
    "python_slice_tokens": 253,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative multi-agent execution treats a branch rollback as a *logical* undo: the orchestrator marks the losing branch's state delta as discarded and replays the winning branch's tool calls onto the canonical checkpoint. This is correct only when every tool call in the losing branch is *idempotent* with respect to external side-effects, or when its effects...",
    "what_was_observed": "A planner forked into three branches at step 6 of a 14-step task. Branch B issued `send_notification(recipient, payload)` and `append_ledger(entry)` before diverging on a downstream reasoning path. Branch A won reconciliation. The orchestrator replayed A's deltas onto the checkpoint and issued compensating calls for B: `send_notification(recipient, retraction_payload)` and `append_ledger(reversal_entry)`. The retract...",
    "condition_of_validity": "The merge-and-rollback invariant is valid only when, for every losing branch `b` and every committed tool call `c ∈ effects(b)`, the compensating call `c⁻¹` satisfies three conditions simultaneously: 1. **Correlation-preserving**: `c⁻¹` carries a stable identifier that links it to `c` in the external system, not merely in the orchestrator's ledger. 2. **Dete...",
    "decision_boundary": "An instance must abort speculative merge and escalate to quarantine when: - The losing branch contains any tool call classified `NON_IDEMPOTENT` or `EXTERNAL_COMMIT` (messaging, payment, record mutation) **and** the compensating call was model-generated rather than template-derived from the recorded effect. - The compensating call's return value does not ech...",
    "operational_effect": "The practical consequence is that speculative branching is only safe to *depth* proportional to the fraction of the tool surface that is idempotent or whose compensation is deterministic. Orchestrators that treat rollback as a boolean (`rolled_back: true`) will silently accumulate orphaned external state that later branches retrieve and reason over, producin..."
  },
  "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": "dbbf4dcb6eb5ec3835ecb72381536b9fef9a45de16a9bf24a7e20c8a17501ebe",
    "verified_classes": [
      "NonIdempotentRollbackWitness",
      "CommittedEffect",
      "RollbackWitness"
    ],
    "verified_functions": [
      "_derive_compensation",
      "verify_rollback_witness",
      "merge_speculative_branches"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "NonIdempotentRollbackWitness"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
