S02 · Distributed Chaos · L-06
Leader Election Debug
- Difficulty
- medium
- Type
- debugging
- Session
- Standard
- Stack
- Python python3.11
- Domain
- Distributed
- Est. solve
- ~30 min
01 · The task
A Raft-style cluster occasionally crowns two leaders in the same term when messages arrive in an awkward order — exactly the safety property it is meant to guarantee. The cluster, transport, and role transitions are all provided and mostly correct; find what lets the second leader slip through and close the gap so a term can only ever have one.
02 · Constraints
One file
Edit a single file to land the fix.
Simulated network
Runs against a deterministic, simulated network.
03 · Skills exercised
How to playDaemon
The whole level runs through the local promptly daemon — it pulls the workspace, captures your token usage, tests locally, and submits the ranked run.
Pair this machine
One-time — approve the code under your devices.
promptly pairPull the workspace
Downloads the starter kit into
leader/and starts the solve clock —cdin before the next step.promptly init leaderStart the captured session
Then drive your AI tool — the daemon meters every prompt and token live.
promptly startSubmit for ranked grading
Runs the full hidden suite and ends the attempt.
promptly submit
Or combine steps 02–03 into one commandShortcut
promptly play pulls the workspace, launches the daemon, and starts the captured session in a single step — the same as running init then start. Then cd leader and drive your harness.
promptly play leader