feat: seed carries frozen pools.json into training workspace
This commit is contained in:
@@ -243,6 +243,24 @@ class TestInitSeed:
|
||||
with pytest.raises(FileExistsError, match="种子已存在"):
|
||||
init_seed(store, "dup", skills_dir, prompts_dir, baseline_db, "r1", None, "second")
|
||||
|
||||
def test_init_seed_carries_pools(self, tmp_path):
|
||||
"""提供 pools_json/split_manifest 时拷入 seed 目录。"""
|
||||
from app.harness.store import init_seed
|
||||
|
||||
store = tmp_path / "store"
|
||||
skills = tmp_path / "sk"; skills.mkdir(); (skills / "s.md").write_text("x")
|
||||
prompts = tmp_path / "pr"; prompts.mkdir(); (prompts / "p.md").write_text("y")
|
||||
db = tmp_path / "b.db"; db.write_text("db")
|
||||
pools = tmp_path / "pools.json"; pools.write_text('{"split_mode":"global"}')
|
||||
manifest = tmp_path / "split_manifest.json"; manifest.write_text('{"pools_sha256":"a"}')
|
||||
|
||||
seed_dir = init_seed(
|
||||
store, "s1", skills, prompts, db, "infer_adhoc", None, "d",
|
||||
pools_json=pools, split_manifest=manifest,
|
||||
)
|
||||
assert (seed_dir / "pools.json").exists()
|
||||
assert (seed_dir / "split_manifest.json").exists()
|
||||
|
||||
|
||||
class TestListSeeds:
|
||||
"""list_seeds 列出所有种子。"""
|
||||
|
||||
@@ -183,6 +183,23 @@ def test_init_workspace_from_seed_missing_questions(store_dir: Path, workspace_d
|
||||
assert not workspace_dir.exists()
|
||||
|
||||
|
||||
def test_init_workspace_from_seed_carries_pools(store_dir: Path, workspace_dir: Path) -> None:
|
||||
"""seed 目录含 pools.json/split_manifest.json 时拷入 workspace。"""
|
||||
# store_dir fixture 已构造 seed "initial";补冻结产物到 seed 目录再初始化 workspace。
|
||||
seed_dir = store_dir / "seeds" / "initial"
|
||||
(seed_dir / "pools.json").write_text('{"split_mode":"global"}')
|
||||
(seed_dir / "split_manifest.json").write_text('{"pools_sha256":"a"}')
|
||||
|
||||
init_workspace_from_seed(
|
||||
workspace_dir,
|
||||
store_dir,
|
||||
seed_name="initial",
|
||||
questions="benchmarks/Video-MME",
|
||||
)
|
||||
assert (workspace_dir / "pools.json").exists()
|
||||
assert (workspace_dir / "split_manifest.json").exists()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# load_manifest
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user