Replays for code battles
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, nextjs, nodejs
- Domain
- full-stack
Research direction
Read frontend/pages/agent-replay/[id].js for the existing replay flow and backend/db.js for migration patterns; trace the code-update stream and battle-finish handling. Add a replay-log round-trip test that verifies byte-for-byte final code, route tests for private replay access, and run npm test plus node scripts/check-boundary.js; done means the design requirements and definition of done are met.
Written by the indexing model from the issue text.
Description
After a battle, players can see the final code, but not how either player got there. A replay that scrubs through both editors side by side is the best learning tool a battle site can offer: you see where the winner started, what they deleted, and when the tests went green.
Agent battles already have replays (frontend/pages/agent-replay/[id].js). Code battles do not. battles_history stores only the final winner_code and loser_code.
Design
- Record a compact edit log per player during the battle: timestamped diffs from the existing throttled
code-updatestream, plus each run and submit with its pass count. Do not store every keystroke. - Store it in a new table keyed by
battle_uuid, written once when the battle finishes. Add the migration inbackend/db.jsthe same way existing ones are added. - Cap the size per battle (for example 256 KB compressed) and degrade gracefully past it by keeping fewer snapshots.
- A replay page at
/replay/<battleId>with a shared timeline, play and pause, 1x/4x/16x speed, and markers for runs and submits. - Only the two players can see a replay by default. Either player can make it public. Public replays show on profiles.
- Delete edit logs after a configurable retention period (default 90 days), with a scheduled sweep.
Definition of done
- Replaying reconstructs the exact final code for both players (add a test that replays a recorded log and compares byte for byte).
- A three-minute battle produces a log under the cap, with numbers in the pull request.
- Privacy rules covered by route tests: non-players get 404 on private replays.
npm testandnode scripts/check-boundary.jspass.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sennaicodes/codearena
-
Add issue and pull request templatesMay be free again @franciscorodr26 claimed this 17 days ago, and no pull request is open. Opendocumentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
sennaicodes/codearena#13 · 1 comment ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 45/100
sennaicodes/codearena#34 ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 35/100
sennaicodes/codearena#33 ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 45/100
sennaicodes/codearena#32 ·
-
enhancement help wanted
Difficulty 5/5 Over a week Newbie friendliness 38/100
sennaicodes/codearena#31 ·
All issues in sennaicodes/codearena
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-webui/open-webui#33196 · 2 comments ·
Maintainers usually reply within 1 day
-
area: apple-music area: build-release bug effort: small priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ChristianTabor/Argon#32 ·
Maintainers usually reply within 1 day
-
0️⃣ phase/new
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100