-
Notifications
You must be signed in to change notification settings - Fork 0
feat: v0.6.0 - source_path param, stress_test error detail, docs #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,24 +47,53 @@ def input_schema(self) -> dict: | |||||||||||||
| }, | ||||||||||||||
| "code": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "Generator C++ 代码(基于 testlib.h)", | ||||||||||||||
| "description": "C++ 源代码(与 source_path 二选一)", | ||||||||||||||
| }, | ||||||||||||||
| "source_path": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "源文件路径,相对于 problem_dir 或绝对路径。与 code 二选一,优先级高于 code", | ||||||||||||||
| }, | ||||||||||||||
| "compiler": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "编译器名称", | ||||||||||||||
| "default": "g++", | ||||||||||||||
| }, | ||||||||||||||
| }, | ||||||||||||||
| "required": ["problem_dir", "code"], | ||||||||||||||
| "required": ["problem_dir"], | ||||||||||||||
|
||||||||||||||
| "required": ["problem_dir"], | |
| "required": ["problem_dir"], | |
| "anyOf": [ | |
| {"required": ["code"]}, | |
| {"required": ["source_path"]}, | |
| ], |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -46,7 +46,11 @@ def input_schema(self) -> dict: | |||||||||||||
| }, | ||||||||||||||
| "code": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "Interactor C++ 代码(基于 testlib.h)", | ||||||||||||||
| "description": "C++ 源代码(与 source_path 二选一)", | ||||||||||||||
| }, | ||||||||||||||
| "source_path": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "源文件路径,相对于 problem_dir 或绝对路径。与 code 二选一,优先级高于 code", | ||||||||||||||
| }, | ||||||||||||||
| "reference_solution_path": { | ||||||||||||||
| "type": "string", | ||||||||||||||
|
|
@@ -63,18 +67,43 @@ def input_schema(self) -> dict: | |||||||||||||
| "default": "g++", | ||||||||||||||
| }, | ||||||||||||||
| }, | ||||||||||||||
| "required": ["problem_dir", "code"], | ||||||||||||||
| "required": ["problem_dir"], | ||||||||||||||
|
||||||||||||||
| "required": ["problem_dir"], | |
| "required": ["problem_dir"], | |
| "anyOf": [ | |
| {"required": ["code"]}, | |
| {"required": ["source_path"]}, | |
| ], |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -49,25 +49,54 @@ def input_schema(self) -> dict: | |||||||||||||
| }, | ||||||||||||||
| "code": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "解法的 C++ 代码", | ||||||||||||||
| "description": "C++ 源代码(与 source_path 二选一)", | ||||||||||||||
| }, | ||||||||||||||
| "source_path": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "源文件路径,相对于 problem_dir 或绝对路径。与 code 二选一,优先级高于 code", | ||||||||||||||
| }, | ||||||||||||||
| "compiler": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "编译器名称", | ||||||||||||||
| "default": "g++", | ||||||||||||||
| }, | ||||||||||||||
| }, | ||||||||||||||
| "required": ["problem_dir", "solution_type", "code"], | ||||||||||||||
| "required": ["problem_dir", "solution_type"], | ||||||||||||||
|
||||||||||||||
| "required": ["problem_dir", "solution_type"], | |
| "required": ["problem_dir", "solution_type"], | |
| "anyOf": [ | |
| {"required": ["code"]}, | |
| {"required": ["source_path"]}, | |
| ], |
Copilot
AI
Apr 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增的 source_path 参数(含相对路径解析 + include_dirs 注入 + 编码回退)目前在 tests/test_tools 下没有覆盖:现有工具测试都只通过 code 字符串调用 build。建议补充至少一个用例:将源码写到临时文件后通过 source_path 调用,并验证包含相对 #include 的场景能成功编译。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前 input_schema 只要求 problem_dir,但 execute() 实际要求必须提供 code 或 source_path(二选一)。建议在 schema 增加 anyOf/oneOf 来约束至少提供一个,避免 client 依据 schema 调用时遗漏参数。