Effect Deadlock Detector
A lock manager that refuses to let the circular wait form: the owners table and wait-for edges live in one Ref, every lock request checks (inside the same atomic decision that would enqueue it) whether waiting would close a cycle, and the request that would complete the ring fails with a typed DeadlockVictim carrying the cycle instead of hanging forever. Victim locks actually release: withTransaction scopes every grant and its release runs on success, failure, and the victim path alike, so the survivor's blocked locks free automatically. Detects transitive rings (T1 waits on T2 waits on T3 waits on T1), and the demo also shows the prevention strategy, fixed resource ordering, committing 10 of 10. Pinned to effect 4.0.0-beta.98.
npx shadcn@latest add https://ui.aryank.space/r/effect-deadlock-detector.jsonInstalls from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.
T1 holds alice and wants bob; T2 holds bob and wants alice. All four Coffman conditions hold, so both wait forever. Nothing crashes and nothing logs: throughput just stops, and every later transaction that touches either account joins the frozen queue behind them.