Hermes Agent
|
8608f1e738
|
chore: fix ruff F401 re-export + mypy type errors + smoke e2e path handling
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
- data/llm/__init__.py, tests/__init__.py: 改用显式 `X as X` re-export 满足 ruff F401
- data/llm/prompts.py: 移除未使用的 json import
- admin/routes/web_public.py: 修复 LLM 集成新增代码的 5 处 mypy 类型错误
- escape() 参数显式 str() 转换
- int() 参数显式 str() 转换避免 AnyStr 报错
- risk_level 字面量类型注解
- scripts/score_range_fullchain_100_e2e.py: 修复 batch_json/csv 绝对路径导致 relative_to() 崩溃
验证: GAOKAO_SKIP_INSTALL=1 bash scripts/dev-verify.sh
=> 1330 passed, 3 skipped, coverage 90.44%, core 100%, all checks passed
|
2026-06-29 07:37:49 +08:00 |
|
Hermes Agent
|
f5d6647837
|
feat(special-programs): 新增强基计划14所院校+修复provenance测试
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
新增项目:
- 强基计划(strong_foundation): 14所985院校
- 北大/清华/复旦/上交/浙大/中科大/南大/武大/华科/中山/川大/中南/湖大/国防科大
- 分数线600-660, 聚焦基础学科, 需参加校测
新增规则(2条):
- 强基需参加校测(85%高考+15%校测)
- 专业限定基础学科(数/理/化/生/史/哲/古文字)
修复:
- test_provenance 排除 special_programs.json(非省份文件)
当前完整覆盖12类路径:
1.农村定向医疗 2.公费农科 3.消防定向 4.铁路定向 5.司法定向
6.定向军士(48所) 7.公费师范 8.央企订单(22所) 9.少数民族预科
10.三大专项 11.定向西藏 12.强基计划(14所)
数据规模: 12类, 115+院校, 24条规则, 13条prompt路径
验证: pytest 1330 passed, 0 failed
|
2026-06-29 00:44:06 +08:00 |
|
Hermes Agent
|
d98ca3ffdd
|
feat(special-programs): 扩充至11类+央企14家+预科7所+专项3类+定向西藏
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
新增3类项目:
- 少数民族预科班: 中央民族大学/大连民族/中南民族/西南民族/西北民族/北方民族/吉林大学, 降分20-80分
- 三大专项计划: 国家专项(脱贫县)/地方专项(农村户籍)/高校专项(教育部直属), 可降分进985/211
- 非西藏生源定向西藏: 降至调档线下40分, 毕业5年服务期
央企订单班扩充(8→22所):
- 新增电力: 长沙电力/武汉电力/山东电力/江西电力/三峡电力/广东水利电力/广西电力
- 新增通信: 安徽邮电
- 新增水利: 黄河水利
- 新增民航: 广州民航(南航)/上海民航(东航)
- 新增航空: 长沙航空(中国航发)
- 新增民政: 北京社会管理职业学院
数据规模: 8类→11类, 70+→100+院校, 15→22条规则
prompt: 8条→12条路径(分体制内编制/国企央企就业/降分专项三类)
验证: 27 passed (special_programs 11 + llm 16)
|
2026-06-29 00:31:22 +08:00 |
|
Hermes Agent
|
b8c4d17b26
|
feat(special-programs): 扩充至8类定向/就业清晰路径
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
新增3类项目:
- 定向培养军士(士官): 48所完整院校名单, 含北京电子科技/武汉船舶/西安航空/长沙航空/重庆航天等, 分数线300-420
- 公费师范生: 部属6所(北师/华东/华中/东北/陕西/西南)+省属师范, 分数线480-580
- 央企国企订单班: 石家庄邮电(邮政)/郑州电力(国网)/重庆电力(国网)/四川邮电(电信)/辽宁石油化工(中石化)等
数据规模:
- 项目定义: 5类 → 8类
- 院校数据: 20+ → 70+ (军士48所+师范7所+央企8所+原有)
- 规则数: 9条 → 15条 (新增军士体检/批次, 师范服务期/学费, 央企协议/分数线)
- prompt: 5条路径 → 8条路径 (分体制内编制类+国企央企就业类)
验证: data/llm/tests 16 passed, test_special_programs 11 passed, 合计27 passed
|
2026-06-28 22:12:28 +08:00 |
|
Hermes Agent
|
bf0ed7eeab
|
feat(special-programs): 5类特殊批次定向培养计划数据+规则+prompt+引擎
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
数据层:
- data/crowd_db/special_programs.json: 5类项目定义+20+真实院校分数线
- 农村订单定向免费医学生: 长沙医学院(444)/湘南学院(441)/河南科技(510)等
- 公费农科生: 山东农业大学(460)/湖南农业大学(430)等
- 公费消防/应急管理: 中国消防救援学院(500)等
- 铁路定向公费生: 武汉铁路(223)/郑州铁路(330)/石家庄铁路(350)等
- 司法系统定向/社区矫正: 中央司法警官学院(480)等
- data/crowd_db/special_programs_loader.py: 查询引擎
- list_programs_for_province(): 按省份筛选适用项目
- find_matching_schools(): 按省份+分数匹配院校(含 0.85 弹性阈值)
- build_recommendation_for_review(): 生成审核推荐摘要(含 match_score)
规则层:
- data/rules/special_programs_rules.json: 9条特殊批次政策规则
- 提前批填报要求/户籍要求/服务期承诺/体检标准/学费政策/编制保障
prompt 层:
- build_audit_prompt: 加入5条特殊批次捡漏路径引导
- LLM 审核时必须考虑这些路径,低分考生方案无特殊批次会在 key_findings 提示
- 新增 special_program_recommendations 输出字段
- build_cwb_prompt: 保底档应包含特殊批次路径之一
测试: 27 passed (special_programs 11 + llm 16)
|
2026-06-28 15:17:42 +08:00 |
|
Hermes Agent
|
11fbb591c3
|
feat(llm): 多模型 fallback 支持
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
LLMClient 改为供应商链模式:
- 主供应商 + GAOKAO_LLM_FALLBACK_MODELS/PROVIDERS/API_KEYS/BASE_URLS
- 按顺序尝试, 第一个成功即返回
- 全部失败时抛出聚合错误(含供应商数量和最后错误)
配置层:
- Settings 新增 4 个 fallback 字段
- load_settings() 读取对应环境变量
新增测试(4 个):
- test_fallback_config_parsed: 验证 fallback 链解析正确
- test_fallback_no_config: 无 fallback 时只有主供应商
- test_fallback_falls_through_to_second_provider: 主失败自动切换
- test_fallback_all_fail_raises: 全部失败抛聚合错误
部署示例:
.env.docker.example / .env.payment.example 补充注释掉的 fallback 模板
验证: data/llm/tests 16 passed, admin/tests 40 passed
|
2026-06-28 13:34:17 +08:00 |
|
Hermes Agent
|
43c1dbdf32
|
feat(llm): 内置 LLM 供应商配置与审核主链接入骨架
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
配置层:
- Settings 新增 llm_provider/api_key/base_url/model/timeout/max_tokens
- 生产 fail-closed: GAOKAO_LLM_PROVIDER=none 禁止, provider!=none 且 API key 为空禁止
- .env.docker.example / .env.payment.example 补 LLM 变量
- payment_readiness_doctor 将 LLM 配置纳入 readiness 检查
基础设施:
- 新增 data/llm/client.py: OpenAI-compatible LLMClient
- 新增 data/llm/prompts.py: audit/cwb/full_plan prompt 模板
- 新增 data/llm/tests/test_llm.py: 12 个单元测试
主链接入:
- ReviewResultContract 新增 llm_generated / llm_summary / llm_cwb_suggestions
- _start_review_result 优先尝试 LLM 生成审核结果, 失败时回退到原规则默认逻辑
- cwb 页面优先展示 LLM 生成的三档建议
测试适配:
- conftest / health / app / p2_4 tests 注入默认 LLM 测试配置,避免被新 fail-closed 提前拦截
验证:
- data/llm/tests 12 passed
- 核心 prod settings tests 62 passed
|
2026-06-28 12:11:43 +08:00 |
|