python-worker
星标1
分支0
更新时间2026年4月4日 17:30
Python module worker for quality benchmark refactoring — implements modules, tests, and scripts
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
Python module worker for quality benchmark refactoring — implements modules, tests, and scripts
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | python-worker |
| description | Python module worker for quality benchmark refactoring — implements modules, tests, and scripts |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Features involving Python module creation/modification, test writing, script updates, and infrastructure work for the quality benchmarks system. This includes:
None — all work is done with standard file editing and shell execution tools.
mission.md for overall context and .factory/library/architecture.md for system design.AGENTS.md for boundaries and conventions.mtb/quality_benchmarks/__init__.py and related modules.tests/test_quality_benchmarks.py to understand existing test patterns.scripts/.uv run pytest tests/<test_file>.py -v --tb=shorttests/ following existing naming convention (test_<module>.py).@dataclass for data classes (match EvalProblem style)_ prefix for internal helper functionseval_problems.py must re-export everything it currently exportsEvalProblem must have defaults__init__.py and eval_problems.py to maintain backward compatibility.uv run pytest tests/<test_file>.py -v --tb=shortuv run pytest tests/ --ignore=tests/quality_benchmarks --ignore=tests/llm_benchmarks --ignore=tests/system -v --tb=short -quv run pytest tests/test_quality_benchmarks.py -v --tb=shortuv run black mtb/ tests/ scripts/uv run python -c "from mtb.quality_benchmarks.<module> import <key_export>; print('OK')"uv run python -c "from mtb.quality_benchmarks import EVAL_PROBLEMS, HARD_EVAL_PROBLEMS, EXPERT_EVAL_PROBLEMS, TOOL_CALLING_PROBLEMS; print(len(EVAL_PROBLEMS), len(HARD_EVAL_PROBLEMS), len(EXPERT_EVAL_PROBLEMS), len(TOOL_CALLING_PROBLEMS))"--help flaguv run python scripts/update_readme_table.py --dry-run 2>&1 | head -30{
"salientSummary": "Built the code execution sandbox module (mtb/quality_benchmarks/sandbox.py) with subprocess-based execution, timeout enforcement, temp file cleanup, and markdown fence stripping. Wrote 22 tests covering valid execution, timeout, errors, cleanup, and concurrent calls. All tests pass (22/22), existing quality benchmark tests unaffected (184/184 pass).",
"whatWasImplemented": "Created sandbox.py with SandboxResult dataclass and execute_code() function. Supports configurable timeout (default 10s), captures stdout/stderr/exit_code, strips markdown code fences, cleans up temp files on success/failure/timeout. Thread-safe for concurrent use.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{"command": "uv run pytest tests/test_sandbox.py -v --tb=short", "exitCode": 0, "observation": "22 passed in 12.3s (timeout tests take ~10s each)"},
{"command": "uv run pytest tests/test_quality_benchmarks.py -v --tb=short", "exitCode": 0, "observation": "184 passed, no regressions"},
{"command": "uv run pytest tests/ --ignore=tests/quality_benchmarks --ignore=tests/llm_benchmarks --ignore=tests/system -v --tb=short -q", "exitCode": 0, "observation": "297 passed, 1 skipped"},
{"command": "uv run black mtb/ tests/ scripts/", "exitCode": 0, "observation": "All files formatted"},
{"command": "uv run python -c \"from mtb.quality_benchmarks.sandbox import execute_code, SandboxResult; print('OK')\"", "exitCode": 0, "observation": "Import successful"}
],
"interactiveChecks": []
},
"tests": {
"added": [
{"file": "tests/test_sandbox.py", "cases": [
{"name": "test_valid_code_stdout", "verifies": "Valid code produces captured stdout"},
{"name": "test_timeout_default", "verifies": "10s timeout kills long-running code"},
{"name": "test_timeout_custom", "verifies": "Custom timeout value respected"},
{"name": "test_syntax_error", "verifies": "Syntax errors reported cleanly"},
{"name": "test_runtime_errors", "verifies": "Runtime errors (TypeError, NameError, etc.) reported"},
{"name": "test_temp_cleanup", "verifies": "Temp files cleaned up in all scenarios"},
{"name": "test_concurrent_calls", "verifies": "Parallel sandbox calls don't interfere"}
]}
]
},
"discoveredIssues": []
}