feat: seed carries frozen pools.json into training workspace
This commit is contained in:
@@ -190,6 +190,9 @@ def init_seed(
|
||||
baseline_run_id: str,
|
||||
parent: str | None,
|
||||
description: str,
|
||||
*,
|
||||
pools_json: Path | None = None,
|
||||
split_manifest: Path | None = None,
|
||||
) -> Path:
|
||||
"""在 store/seeds/<name> 写一个种子:权重 + baseline.db + seed.json。
|
||||
|
||||
@@ -202,6 +205,10 @@ def init_seed(
|
||||
baseline_run_id: 全量记录的 run_id,fresh 时注入 build_pools。
|
||||
parent: 来源(initial 为 None)。
|
||||
description: 人类可读说明。
|
||||
pools_json: 可选,冻结切分 pools.json 源路径;提供时拷入 seed 目录,
|
||||
供 fresh 训练时携带冻结切分进 workspace(见 init_workspace_from_seed)。
|
||||
split_manifest: 可选,冻结切分 split_manifest.json 源路径;提供时拷入 seed
|
||||
目录,供加载时校验 pools.json 内容指纹(pools_sha256)。
|
||||
|
||||
返回:
|
||||
种子目录路径。
|
||||
@@ -216,6 +223,10 @@ def init_seed(
|
||||
shutil.copytree(skills_dir, seed_dir / "skills")
|
||||
shutil.copytree(prompts_dir, seed_dir / "prompts")
|
||||
shutil.copy2(baseline_db, seed_dir / "baseline.db")
|
||||
if pools_json is not None:
|
||||
shutil.copy2(pools_json, seed_dir / "pools.json")
|
||||
if split_manifest is not None:
|
||||
shutil.copy2(split_manifest, seed_dir / "split_manifest.json")
|
||||
(seed_dir / "seed.json").write_text(
|
||||
json.dumps(
|
||||
{
|
||||
|
||||
@@ -196,6 +196,13 @@ def init_workspace_from_seed(
|
||||
shutil.copytree(seed_dir / "prompts", workspace_dir / "prompts" / "v1")
|
||||
shutil.copy2(seed_dir / "baseline.db", workspace_dir / "harness.db")
|
||||
|
||||
seed_pools = seed_dir / "pools.json"
|
||||
if seed_pools.exists():
|
||||
shutil.copy2(seed_pools, workspace_dir / "pools.json")
|
||||
seed_manifest = seed_dir / "split_manifest.json"
|
||||
if seed_manifest.exists():
|
||||
shutil.copy2(seed_manifest, workspace_dir / "split_manifest.json")
|
||||
|
||||
logger.info("Workspace 从种子 '{}' 初始化完成: {}", seed_name, workspace_dir)
|
||||
return meta["baseline_run_id"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user