feat(review): 医生核对包入口;CEUS 运行目录的读取收进 runs

- 新模块 review(组织层,只依赖 library、answers、runs):把一次构建和它装入的
  CEUS 运行整理成医生可读的文件夹(CSV 带 BOM、说明与报告转 PDF、图片视频逐字节拷贝),
  入口 scripts/review_pack.py + config/review_pack.yaml。任务书 03。
- 读 CEUS 运行目录(failed.csv、结果目录、关键帧文件)从 build 挪进 runs,build 与
  review 都经它读;failed.csv 读取在边界上收严(步号须为整数、视频号不重复、列数固定)。
- library、answers 补只读函数;import-linter 增 review 契约。
- 文档:guides/医生核对包.md(过一轮硕士生阅读),结构.md 第三至八部分同步。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 06:04:19 -04:00
parent 14d6f8e153
commit c7373efde2
23 changed files with 1718 additions and 83 deletions
+20
View File
@@ -277,3 +277,23 @@ def test_run_dir_without_snapshot_stops(tmp_path: Path) -> None:
run = write_run(tmp_path / "runs" / RUN_ID, tmp_path / "delivery", {"U001": LOCATED}, [])
(run / "snapshot" / "snapshot.json").unlink()
_assert_stops(tmp_path, run, FileNotFoundError)
@pytest.mark.parametrize(
("extra", "remove"),
[
("B0.tmp", None), # B0.png 与同主干的 B0.tmp 并存:多一个文件
("B0.jpg", "B0.png"), # 只有 B0.jpg:扩展名不是 .png
],
)
def test_keyframe_files_must_be_exactly_slot_pngs(
tmp_path: Path, extra: str, remove: str | None
) -> None:
run = write_run(tmp_path / "runs" / RUN_ID, tmp_path / "delivery", {"U001": ("B0", "D1")}, [])
folder = run / "U001" / "keyframes"
(folder / extra).write_bytes((folder / "B0.png").read_bytes())
if remove is not None:
(folder / remove).unlink()
with pytest.raises(ValueError, match="定位到的槽位不一致"):
_build(tmp_path, 1, run)
assert not (tmp_path / "library").exists()