fix: require executable source for Work reports
This commit is contained in:
@@ -10,6 +10,7 @@ from agent_platform.models import get_model_spec
|
||||
from agent_platform.runtime.loop import (
|
||||
AgentLoop,
|
||||
is_substantive_execution,
|
||||
non_source_execution_error,
|
||||
normalize_write_file_content,
|
||||
python_source_error,
|
||||
select_tool_specs,
|
||||
@@ -59,6 +60,14 @@ def test_invalid_complete_python_source_is_detected_before_write() -> None:
|
||||
assert python_source_error({"path": "benchmark.py", "content": "print('ok')\n"}) is None
|
||||
|
||||
|
||||
def test_python_cannot_execute_documentation_or_data_files() -> None:
|
||||
assert non_source_execution_error({"command": "python3 SortingReport.md"}) is not None
|
||||
assert non_source_execution_error({"command": "cd /workspace && python report.json"}) is not None
|
||||
assert non_source_execution_error({"command": "python3 benchmark.py"}) is None
|
||||
assert non_source_execution_error({"command": "python3 -m pytest"}) is None
|
||||
assert non_source_execution_error({"command": "python3 -c 'print(1)' "}) is None
|
||||
|
||||
|
||||
def test_read_only_shell_commands_do_not_satisfy_execution_evidence() -> None:
|
||||
assert not is_substantive_execution("exec", {"command": "cat report.txt"})
|
||||
assert not is_substantive_execution("exec", {"command": "sed -n '1,20p' script.py"})
|
||||
|
||||
Reference in New Issue
Block a user