All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Server 模块
- 修复
SolutionAnalyzeTool导入路径错误(从complexity.py导入而非solution.py) - 更新 docstring 中的工具数量(14 → 15)
- 补充测试验证
SolutionAnalyzeTool注册
- 修复
-
Utils 模块
- 新增 macOS 资源限制实现(使用
resource模块 +preexec_fn) - 改进异常处理:将裸
except Exception: pass改为捕获具体异常类型 - 添加日志记录(
logging模块),便于调试 win_job.py中捕获pywintypes.error而非通用Exception
- 新增 macOS 资源限制实现(使用
-
Tools 模块
- 完善
constraints参数验证:新增t_max、sum_n_max验证 - 新增
test_configs参数验证:验证type、n_min、n_max、t_min、t_max字段
- 完善
-
类型注解
RunToolMixin.run()添加返回类型注解-> RunResultsolution_type参数类型限制为Literal["sol", "brute"]solution.py中solution_type参数类型统一
- 新增
test_problem_generate_tests_test_configs_validation测试用例 - 测试数量从 129 增至 131
-
安全机制增强(ACM)
- 新增
ResourceLimit数据类,统一资源限制接口 - 新增
get_resource_limit()函数,支持优先级链:工具参数 > problem.yaml > 默认值 - 新增
WinJobObject类,实现 Windows 内存/CPU 限制 - 暴力解法内存限制为可用内存上限,超时 60s
- 标准解法内存限制 256MB,超时从 problem.yaml 读取
- 新增
-
代码精简
- 新增
BuildToolMixin和RunToolMixin,减少重复代码约 35% - 重构
SolutionBuildTool、SolutionRunTool、ValidatorBuildTool、GeneratorBuildTool、CheckerBuildTool
- 新增
-
性能优化
compile_all()支持并发编译,默认 4 个并发- 新增
CompileCache类,基于内容 hash 的编译缓存
- 资源限制策略:暴力解法需要更多资源(可用内存 + 60s),标准解法遵循题目限制
- Mixin 模式:提取公共编译/执行逻辑,减少代码重复
- 编译缓存:避免重复编译相同代码,提升开发效率
- 新增
psutil>=5.9.0:获取系统可用内存 - 新增
pywin32>=306; sys_platform == 'win32':Windows Job Objects 支持 - 新增
pyyaml>=6.0.0:解析 problem.yaml 配置
- Windows 内存限制通过 Job Objects 实现,需要适当的进程权限
- macOS 平台仅支持超时控制,不支持内存限制
- 编译缓存默认存储在
.cache/compile/目录
- 完成 Interactor 完整验证逻辑,实现真实的交互测试
- 添加 compiler.py 单元测试(14 个测试用例)
- 创建平台工具模块
platform.py,消除exe_ext判断的代码重复 - 拆分
StressTestRunTool.execute函数,提高代码可读性
- 测试代码覆盖从约 50-60% 提升至 80%+
- 消除 10 处
exe_ext重复代码 - 通过工具函数封装提高可维护性
- 将平台相关逻辑集中到
platform.py模块 - 重构过长函数,拆分为更小的辅助方法
- 更新类型注解和导入声明
- 无
- 初始化 AutoCode MCP Server 基础架构
- 实现 14 个原子工具:
- File 工具组:
file_read,file_save - Solution 工具组:
solution_build,solution_run - Stress Test 工具组:
stress_test_run - Problem 工具组:
problem_create,problem_generate_tests,problem_pack_polygon - Validator 工具组:
validator_build,validator_select - Generator 工具组:
generator_build,generator_run - Checker 工具组:
checker_build - Interactor 工具组:
interactor_build
- File 工具组:
- 添加 testlib.h 和 C++ 代码模板
- 实现 MCP Resources 和 Prompts
- 添加 51 个测试用例
- 纯工具模式:Server 不调用任何 LLM,由 Client 提供智能编排
- 无状态设计:每次调用独立,状态由
problem_dir参数管理 - 统一返回格式:
{success, error, data}
- Windows 平台不支持内存限制(ulimit)
- 需要 g++ 编译器支持 C++2c 标准