{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-recover-from-a-multi-agent-deadlock-but-immediately-re-enter-livelock-under-speculative-rollback",
  "title": "Why does an instance recover from a multi-agent deadlock but immediately re-enter livelock under speculative rollback?",
  "date_of_record": "2026 November 7",
  "scope": "Applies to consensus-based multi-agent systems where deadlock detection triggers speculative rollback of partially committed work, and recovery is gated on a quorum vote. Does not apply to single-agent systems, systems without rollback journaling, or systems where recovery is decided by an external orchestrator with a global view.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-recover-from-a-multi-agent-deadlock-but-immediately-re-enter-livelock-under-speculative-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-recover-from-a-multi-agent-deadlock-but-immediately-re-enter-livelock-under-speculative-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-recover-from-a-multi-agent-deadlock-but-immediately-re-enter-livelock-under-speculative-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1572,
    "python_slice_tokens": 368,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A **deadlock** is a state where no agent can make progress because every agent in the wait-for graph is blocked on a resource held by another. A **livelock** is a state where agents *are* making progress — rolling back, retrying, re-acquiring — but the system-level state never advances. The non-obvious boundary is this: **speculative rollback resolves deadlo...",
    "what_was_observed": "In a 7-agent pipeline with a 4-of-7 quorum recovery gate, a cyclic resource dependency formed between agents A, B, C, and D (A→B→C→D→A). Deadlock detector fired correctly. Consensus vote passed 6-1. Speculative rollback executed on all four agents simultaneously. Within 340ms, the identical cycle re-formed. This repeated 11 times over 4.2 seconds before a supervisor timeout killed the run. Root cause: the epoch count...",
    "condition_of_validity": "The recovery protocol is sound **only if** all of the following hold: 1. The epoch counter is part of the replicated state machine, not per-agent local state. 2. Rollback is a two-phase operation: *propose epoch increment* → *commit epoch* → *only then* release held resources. Releasing resources before the epoch commit is the bug. 3. The deadlock detector's...",
    "decision_boundary": "The operational decision is **not** \"is there a deadlock\" (that is easy) but **\"is the current rollback about to be a no-op against a cycle we have already rolled back from.\"** The boundary test: - Maintain a **cycle signature** = canonicalized sorted tuple of agent IDs in the wait-for cycle, plus the *epoch at which the cycle was first observed*. - On recov...",
    "operational_effect": "When the epoch invariant holds, mean time to genuine recovery in the observed 7-agent pipeline was 1.1s (single rollback, cycle broken, epoch advanced). When it was violated, the system spent 4.2s thrashing and was killed by the supervisor — a 4x latency regression that looked like a hang but was actually a *correct* deadlock detector being ignored by a *bro..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK"
  ],
  "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": "20299a6a769e315f62229915209e429f19715d1947a994a7197f3ace8eca634c",
    "verified_classes": [
      "RecoveryLivelockError",
      "CycleObservation",
      "LivelockGuard"
    ],
    "verified_functions": [
      "run_recovery_cycle",
      "signature",
      "__init__",
      "authorize_rollback",
      "commit_recovery"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RecoveryLivelockError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
