pub fn plan_load(
cfg: &LoadConfig,
files: &[(String, Value)],
) -> Result<Vec<(Value, Location)>, String>Expand description
纯批次规划(设计 §5.2 伪码 + §5.3 主从):
files: [(rel_from_defs_root, defn)](rel 首段 = db 目录名)。
步骤:① 按 rel 首段定位 db → source_of_db 反查(未声明 / 重挂 ⇒ Err);
② depth_layered(kind) → locate;
③ 判据单点 classify_batch(分组 / 主唯一 / 批内四元组冲突);
④ 每组主恰好一份,0 份 ⇒ Err(A1/A3);
⑤ 输出有序装载项:主在前、其后从(组间按 name 字典序)。