✨ feat(llm): 引入基于完成度的 AI 提交指导与限流
- 新增 llm_guidance 策略层,根据源码、判题结果与通过率评估完成度分级 - llm-review.php 改为服务端缓冲上游输出,仅下发白名单分类的固定模板 - 新增 llm_review 与 llm_review_rate_limit 表,实现结果缓存与账户/提交两级限流 - ceinfo 模板渲染编译器标出的源码行号/列号,reinfo 仅向高完成度提交展示结构化 diff - download.php 按完成度授权测试点下载,封堵白卷提交套取隐藏用例 - judge_client 在 ACM 非比赛场景下记录已通过测试点数,前端可显示进度 - 附 llm_guidance_policy_test 单测覆盖空白卷、注释卷、隐藏 SPJ、OJ_FULL_DIFF 等关键路径
This commit is contained in:
@@ -3748,6 +3748,7 @@ int main(int argc, char **argv)
|
||||
|
||||
// read files and run
|
||||
double pass_rate = 0.0;
|
||||
int passed_test_count = 0;
|
||||
float mark=0;
|
||||
float total_mark=0,get_mark=0;
|
||||
int finalACflg = ACflg;
|
||||
@@ -3860,6 +3861,10 @@ int main(int argc, char **argv)
|
||||
judge_solution(ACflg, usedtime, time_lmt, spj, p_id, infile,
|
||||
outfile, userfile, PEflg, lang, work_dir, topmemory,
|
||||
mem_lmt, solution_id, num_of_test,&pass_rate);
|
||||
if (ACflg == OJ_AC)
|
||||
{
|
||||
++passed_test_count;
|
||||
}
|
||||
/*
|
||||
if(usedtime > time_lmt * 1000) { // 如果觉得的显示超时结果的计时过长,可以覆盖数据。
|
||||
usedtime = time_lmt * 1000;
|
||||
@@ -3968,6 +3973,10 @@ int main(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
if(ACflg==OJ_AC) pass_rate=1.0;
|
||||
// In ACM/non-OI mode expose prefix progress only for ordinary
|
||||
// practice submissions. Contest submissions keep the historical
|
||||
// all-or-nothing value so hidden test progress is not leaked.
|
||||
else if(cid==0 && num_of_test>0) pass_rate=(double)passed_test_count/num_of_test;
|
||||
else pass_rate=0.0;
|
||||
update_solution(solution_id, ACflg, usedtime, topmemory >> 10, sim,
|
||||
sim_s_id, pass_rate);
|
||||
|
||||
Reference in New Issue
Block a user