fix: 统一输出文件目录结构 - Closes #3
CI / test (pull_request) Successful in 7s

- 新增 PROJECT_OUTPUT (项目根/output/),统一所有输出文件
- IR 中间产物 → output/ir/,最终交付物 → output/final/
- agent_poller.py 新增 pr-status/merge-pr/close-issue/lifecycle 命令
- DEV_AGENT.md 同步更新完整闭环流程
- 更新 conftest/test_sample 中的默认路径

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 14:38:37 +08:00
parent 9be264250a
commit 884848f15f
6 changed files with 219 additions and 54 deletions
+2 -6
View File
@@ -115,10 +115,7 @@ def ir_path(request) -> str:
path = (
request.config.getoption("--ir-path")
or os.environ.get("TEST_IR_PATH")
or str(
Path.home()
/ ".openclaw/workspace/skills/doc_parser_skill/output/ir_final.json"
)
or str(_PROJECT_ROOT / "output" / "final" / "ir_final.json")
)
if not os.path.exists(path):
pytest.skip(f"IR file not found: {path}")
@@ -139,8 +136,7 @@ def parsed_path(request) -> str | None:
request.config.getoption("--parsed-path")
or os.environ.get("TEST_PARSED_PATH")
or str(
_PROJECT_ROOT
/ "skills/ir_generation_skill/车机娱乐系统禁止功能文档_精简_updated.json"
_PROJECT_ROOT / "output" / "车机娱乐系统禁止功能文档_精简_updated.json"
)
)
if os.path.exists(path):
+22
View File
@@ -1,5 +1,6 @@
"""Unit tests for config.py pure functions."""
import os
import sys
from pathlib import Path
@@ -21,6 +22,10 @@ def test_set_input_file():
def test_config_constants_exist():
"""Verify all expected path constants are defined."""
assert config.BASE_DIR
assert config.PROJECT_ROOT
assert config.PROJECT_OUTPUT
assert config.IR_OUTPUT
assert config.FINAL_OUTPUT
assert config.OUTPUT_DIR
assert config.PROMPTS_DIR
assert config.TESTS_DIR
@@ -33,6 +38,23 @@ def test_config_constants_exist():
assert config.IR_AUDIT_REPORT_MD
def test_output_dir_is_under_project_root():
"""PROJECT_OUTPUT, IR_OUTPUT, FINAL_OUTPUT should all be under PROJECT_ROOT."""
assert config.PROJECT_OUTPUT.startswith(config.PROJECT_ROOT)
assert config.IR_OUTPUT.startswith(config.PROJECT_OUTPUT)
assert config.FINAL_OUTPUT.startswith(config.PROJECT_OUTPUT)
def test_output_dir_structure():
"""IR files should go to output/ir/, final deliverable to output/final/."""
assert config.IR_OUTPUT.endswith(os.path.join("output", "ir"))
assert config.FINAL_OUTPUT.endswith(os.path.join("output", "final"))
assert config.SEMANTIC_INDEX_JSON.startswith(config.IR_OUTPUT)
assert config.IR_FRAGMENTS_JSON.startswith(config.IR_OUTPUT)
assert config.IR_FINAL_JSON.startswith(config.FINAL_OUTPUT)
assert config.IR_AUDIT_REPORT_MD.startswith(config.FINAL_OUTPUT)
def test_ensemble_temperatures_count():
"""Should have exactly 3 ensemble temperatures."""
assert len(config.ENSEMBLE_TEMPERATURES) == 3
+1 -1
View File
@@ -83,7 +83,7 @@ def test_sample_ir_json_is_valid():
"""The sample IR JSON file should be valid JSON."""
sample_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
"skills", "ir_generation_skill",
"output",
"车机娱乐系统禁止功能文档_精简_updated.json"
)
if os.path.exists(sample_path):