Custom test input during battles
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- docker-compose, javascript, nextjs, nodejs
- 领域
- backend, security, testing-qa
调研方向
Start with frontend/pages/battle.js and compare the custom-input flow in frontend/components/practice/ArenaPractice.js; trace the practice run endpoint's parsing and runner before adapting it for battles. Check docker-compose.judge0.yml for the real Judge0 setup, then run npm test and node scripts/check-boundary.js. Done means custom runs work across supported languages, validate parameter types and rate limits, and keep results private from the opponent without affecting submissions or ratings.
由索引模型根据 Issue 内容生成。
描述
Practice lets players run their code on their own input (customInput in frontend/components/practice/ArenaPractice.js). Battles do not, so in a battle the only way to check an edge case is to submit, which costs time and gives away nothing useful.
What to do
- Add a "Custom input" panel to the battle editor (
frontend/pages/battle.js) that runs the player's code on input they type, showing output, errors and runtime. - Reuse the practice run endpoint's parsing and runner rather than writing a second path.
- Validate the input against the problem's parameter types before sending it to Judge0, with a clear error on mismatch.
- Rate limit custom runs per player per battle (for example 1 every 3 seconds) so Judge0 is not flooded.
- Custom runs never count as submissions and never affect ratings or tie-breaks.
Things that must hold
- The opponent never sees custom input or its output.
- A custom run cannot be used to probe hidden tests: it returns only the player's own output, never an expected value.
Definition of done
- Works in all supported languages, checked against a real Judge0 (
docker-compose.judge0.yml). - Tests for type validation, rate limiting and the opponent not receiving the result.
npm testandnode scripts/check-boundary.jspass.
- 主要语言
- JavaScript
- 星标
- 0
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sennaicodes/codearena 的其他 Issue
-
Add issue and pull request templates可能重新可做 @franciscorodr26 于 28 天前认领,目前没有进行中的 PR。 未关闭documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100
sennaicodes/codearena#13 · 1 条评论 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 45/100
sennaicodes/codearena#34 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 35/100
sennaicodes/codearena#33 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 45/100
sennaicodes/codearena#32 ·
-
enhancement help wanted
难度 5/5 一周以上 新手友好度 38/100
sennaicodes/codearena#31 ·
查看 sennaicodes/codearena 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 87/100
OWASP/CheatSheetSeries#2905 ·
维护者通常 1 天内回复
-
desktop enhancement P2
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100
AllTheMods/ATM10-Aeronautics#159 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ComposioHQ/composio#5249 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
zilliztech/memsearch#838 ·
维护者通常 1 天内回复