Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Replays for code battles

Đang mở
#16 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
full-stack

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement help wanted

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-update stream, 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 in backend/db.js the 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 test and node scripts/check-boundary.js pass.
Ngôn ngữ chính
JavaScript
Star
0
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sennaicodes/codearena

Tất cả issue của sennaicodes/codearena

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.