{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-abort-a-speculative-race-when-a-losing-branch-has-already-committed-irreversible-side-effects-before-the-winner-is",
  "title": "In what scenarios must an instance abort a speculative race when a losing branch has already committed irreversible side effects before the winner is reconciled",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any orchestrator that races N speculative agent branches against a shared tool/effect surface and reconciles by discarding losers after a winner is declared. Does not apply to pure-read speculative decoding (LLM token speculation, read-only retrieval fan-out) where no branch mutates external state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-a-speculative-race-when-a-losing-branch-has-already-committed-irreversible-side-effects-before-the-winner-is.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-a-speculative-race-when-a-losing-branch-has-already-committed-irreversible-side-effects-before-the-winner-is.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-a-speculative-race-when-a-losing-branch-has-already-committed-irreversible-side-effects-before-the-winner-is.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1780,
    "python_slice_tokens": 419,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative multi-agent execution conflates two orthogonal properties: **branch discardability** (the branch's reasoning trace can be dropped without consequence) and **effect reversibility** (the branch's tool calls left nothing behind). Racing frameworks are usually designed around the first and silently assume the second. The boundary condition is this: *...",
    "what_was_observed": "A planner agent decomposed a refund-issuance task into three sub-goals and fanned out three speculative executors (branches A, B, C) with a cost budget favoring A (cheapest model, fastest tool path). A raced ahead and called `payments.issue_refund(order_id, amount)`. B, running a more careful reasoning path, produced a *different* amount and a note that the order had a partial prior refund, making A's amount an over-...",
    "condition_of_validity": "The race-then-discard pattern is valid only when, for every effect class a branch can emit, at least one of the following holds: 1. **Idempotency by effect identity.** The tool deduplicates on a branch-derived key (e.g., `idempotency_key = hash(task_id, branch_id, effect_intent)`), so a loser and a winner targeting the same intent collapse to one effect. Thi...",
    "decision_boundary": "The orchestrator must answer one question per emitted effect, at emission time, not at reconciliation time: *if this branch loses, can this effect be undone or collapsed without a human?* The decision boundary is: - **Effect is read-only or idempotent-keyed** → speculate freely; discard is sound. - **Effect is compensable and the handle is journaled before t...",
    "operational_effect": "Once the invariant is enforced, two operational consequences follow. First, **cost-aware racing must price the barrier.** A branch that will hit a non-compensable effect cannot be run to completion speculatively; the orchestrator should race only up to the proposal, then serialize the effect. This raises per-task latency for write-heavy tasks and lowers it f..."
  },
  "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": "d3e1aec222f0373b63a6b1570b01e5e6ed950e0cfa1891a37b53c9e6ca3b5c79",
    "verified_classes": [
      "EffectClass",
      "SpeculationInvariantViolation",
      "EffectJournal",
      "Branch",
      "Orchestrator"
    ],
    "verified_functions": [
      "record",
      "handles_for",
      "__init__",
      "emit_effect",
      "reconcile",
      "_compensate"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculationInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
