Commit Graph

2296 Commits

Author SHA1 Message Date
95bf02efbd feat(achievement): 添加判定核心、通知模块并接入判题链路 2026-08-04 01:02:29 -06:00
9e0bc1fa8c fix(plan): 修正 unlock() 的并发重复计数缺陷
bulk_create(ignore_conflicts=True) 无法区分新建与已存在,
并发判题时会重复累加 unlock_count 并重复推送通知。
改为逐条 get_or_create,以 was_created 为唯一判据。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 00:59:49 -06:00
c1081e6193 fix(achievement): 指标的 AC 口径改用 is_accepted,与全项目一致
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 00:56:32 -06:00
d9840910e6 feat(achievement): 添加指标注册表与 16 个内置指标
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 00:49:49 -06:00
456c435289 feat(achievement): 添加成就系统数据模型 2026-08-04 00:44:35 -06:00
d4d700782b docs: 成就系统实施计划
13 个任务、75 个步骤,覆盖后端 app、指标注册表、判定任务、
用户与管理 API、重算命令、题单奖章接入,以及前端奖杯馆、
全局弹窗、炫耀入口和管理配置页。

按项目规定不含测试步骤,每个任务以可执行的验证命令替代。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 00:03:02 -06:00
8d9dc7b521 docs: 修订成就系统设计,修复对现有代码的错误假设
- 解锁通知改推拉结合:WebSocket 非常驻连接,纯推会丢消息,
  以 UserAchievement.notified + pending 端点为主通道
- 记录 push_to_user 复用 submission_update handler 的冲突,
  useSubmissionMonitor 需按 type 过滤
- 定义 achievement_unlocked_count 元指标及两轮判定上限,解决自引用
- 明确比赛提交不计入成就(contest_joined 除外)
- 判定任务投递点精确到 judge_task 末尾,避免漏掉比赛分支
- 移除无用例的 eq operator

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 23:51:08 -06:00
c51e9332d1 docs: 成就系统设计方案
日式游戏风格的全站成就系统设计:代码注册指标、后台配置条件、
判题后异步判定、前端奖杯馆。与现有题单奖章分层共存。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 23:46:55 -06:00
75ff10d9fe fix 2026-07-26 07:21:56 -06:00
224960ac0f fix 2026-07-26 07:20:16 -06:00
66fac1f66d update 2026-07-05 03:12:34 -06:00
70fed2d15d fix 2026-07-05 01:33:33 -06:00
10af0256b8 移除 OI 残留:UserProfile 的 oi_problems_status / total_score / add_score
判题不再写入 OI 相关状态后,UserProfile 上的 OI 字段永远为空/为 0:
- 删除 oi_problems_status、total_score 两列及 add_score() 方法
- ProfileProblemDisplayIDRefreshAPI 去掉 oi_problems 合并分支

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 11:40:45 -06:00
9535b64a4b 精简 Problem 模型:移除 rule_type / total_score / io_mode
系统只用 ACM 模式且题目固定标准 IO,这三列已无实际用途:
- rule_type / total_score:OI 专用,删除后 judge/dispatcher 的 OI 分支全部塌缩为 ACM
- io_mode:判题改为固定发送 Standard IO 常量;languages.py 的 seccomp_rule
  保留 dict 形态但改用字面量 key,不改判题机 wire 契约
- prompt 字段保留(预留给未来 AI 分析)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 11:40:38 -06:00
4743b0398a update 2026-07-04 11:07:24 -06:00
deae73cd88 feat: SQL 题测试点脚本回显接口
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 19:29:51 -06:00
803d6ca58d feat: SQL 题测试点预览接口
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 19:25:47 -06:00
f77b98d4d7 fix 2026-07-03 18:34:12 -06:00
fc09d291a7 fix 2026-07-03 18:28:25 -06:00
979c709333 fix 2026-07-03 18:19:16 -06:00
16ec78beae feat: SQL 提交前自动格式化(sqlparse)
- format_code 新增 sql 分支,reindent + 关键字大写
- FormatCodeSerializer 的 language choices 加入 sql

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:05:38 -06:00
2ec036ac37 feat: 新增 rebuild_sql_display 管理命令,为存量 SQL 题回填展示数据
生成逻辑从 ProblemBase._build_sql_display 提取为 problem.utils.generate_sql_display,
管理端保存与回填命令共用。命令支持 --dry-run / --force。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 09:42:11 -06:00
5af9d67fe2 fix: 终审修复——test_case_id 格式校验、modify 空变更报错、异常兜底与文档补充
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 06:26:00 -06:00
67079b5304 fix: _build_sql_display 兜底 info 结构损坏,避免 KeyError 导致 500
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:22:27 -06:00
06642b8131 feat: 保存 SQL 题时自动生成 sql_display 展示数据
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:15:58 -06:00
90531720bb fix: build_display modify 模式补齐被 DROP 的表条目
标准答案 DROP 表后该表不在 sqlite_master 中,changed_tables 会静默
遗漏;用初始展示数据补齐并标记 dropped=True。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:10:04 -06:00
09501469e2 feat: SQL 题展示数据生成 build_display
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 01:01:32 -06:00
caec69c809 docs: SQL 题数据化展示实施计划
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:56:10 -06:00
e244030e7a docs: SQL 题数据化展示设计文档
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 00:49:03 -06:00
1e6041d13d fix 2026-07-02 19:16:09 -06:00
9f7f818d51 新增 SQL 题型:SQLite 内联判题(不依赖外部沙箱)
- SQL 作为语言接入现有提交流程,judge_task 按 language 分流到 SQLJudgeDispatcher
- judge/sql_runner.py:内存 SQLite 判题核心,查询题比结果集/增删改题比表状态,
  authorizer + progress_handler + max_page_count 三重防护
- dispatcher 提取 _process_judge_result/_push_status 供 SQL 判题复用(行为不变)
- 测试点通道支持 1.sql..N.sql 压缩包,出题只需数据脚本+标准答案
- Problem 增加 sql_config 字段;options 数据迁移注册 SQL 语言

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 17:23:13 -06:00
d1a1c05b9f add new type of self-learning 2026-06-29 19:37:59 -06:00
180d75cb97 fix 2026-06-29 06:41:18 -06:00
c1ec9eab8f update 2026-06-14 09:43:33 -06:00
124a1d84d3 update 2026-06-14 09:42:25 -06:00
9949ebf1c5 fix 2026-06-14 09:27:21 -06:00
90d1a2aa30 fix 2026-06-14 09:19:01 -06:00
dab6734d03 switch docker image 2026-06-14 09:13:05 -06:00
fa6736b855 docs: design Debian slim backend image 2026-06-14 09:08:36 -06:00
322acc543f build: install clang-extra-tools for clang-format in backend image
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:07:50 -06:00
7974d12475 build: move ruff from dev to main dependencies (needed at runtime for code formatting)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:05:12 -06:00
f7fbfdba7d fix(submission): revert unnecessary CSRF exemption on FormatCodeAPI
The CSRF 403 error was expected Django behavior (no CSRF cookie in curl).
FormatCodeAPI should follow SubmissionAPI's pattern (APIView, not CSRF-exempt).
Verified with GET request: /api/format_code returns 405 (correct route resolution).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 08:02:06 -06:00
5cc5c64625 feat(submission): register /api/format_code route and fix CSRF exemption
Task 4: Register the FormatCodeAPI view to the /api/format_code endpoint.

Also fix: Make FormatCodeAPI extend CSRFExemptAPIView instead of APIView
so that the manual verification curl commands receive JSON responses
(login-required error) instead of HTML 403 Forbidden responses. This is
necessary for the view to work with the @login_required decorator which
expects to return JSON errors, not be blocked by CSRF middleware.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:57:24 -06:00
be1610faa6 feat(submission): add FormatCodeAPI view 2026-06-14 07:51:41 -06:00
bfeb69434e feat(submission): add FormatCodeSerializer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:48:58 -06:00
4cd37cef78 feat(submission): add ruff/clang-format code formatting helper 2026-06-14 07:46:41 -06:00
69eb15ac27 Add implementation plan for pre-submit code auto-formatting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:43:51 -06:00
1bbc149e55 Add design spec for pre-submit code auto-formatting
Plan: ruff for Python3, clang-format (LLVM/4-space/Attach) for C/C++,
called via new /api/format_code endpoint before submission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 07:41:03 -06:00
95949e565c update 2026-06-09 05:04:43 -06:00
69bd6af6ec update 2026-06-05 09:58:52 -06:00