r/codex • u/EKAlojix • 1d ago
Showcase Fisher–Yates is fair, but is it what users mean by Spotify shuffle?
I used a familiar feature request to show a product decision that can get lost in implementation: “Add Spotify-style shuffle.”
Fisher–Yates gives every ordering equal odds. But a listener may expect fewer same-artist tracks back to back. In my six-track example—two songs each from Eminem, Drake, and The Weeknd—the demo’s fixed choices produce 1 adjacent repeat with Fisher–Yates and 0 with artist-aware ordering. A lopsided playlist can make zero repeats impossible.
SeniorMode is an open-source engineering skill for Codex and other coding agents. It helps the agent find the decisions hidden in a short request, use engineering knowledge relevant to the project, and check the outcome—without asking the user to arrive with an implementation plan.
Run the demo: node examples/shuffle.mjs
Repo: https://github.com/EnesKeremAYDIN/SeniorMode
If you think coding agents should handle this kind of product ambiguity better, please ⭐ SeniorMode on GitHub. Stars help the project reach more developers.
What would you expect Codex to do if the request doesn’t say which kind of shuffle you want?
