chore(engine): 删掉 validate 里已失效的 _model_value,补节点耗时方案与编排图

0.2.0 把模型收到图级 `models.executor / gate` 之后,validate 里那份按节点 key 取
模型值的 `_model_value` 已无调用方(全仓 grep 为 0),且它引用的 `os` 在本模块
从未 import,留着只是死代码。删掉后校验只剩 `models.model_of` 一条路径。

单测:`python3 -m unittest discover -s tests` → 46/46 OK。

同时纳入两份未跟踪资料:
- `.agents/plan/20261119-engine-node-duration.md`:给 decisions.jsonl 加
  startedAt / durationMs 的方案(poc 已在 stepper 单步模式先落地 0.2.1,字段名一致)
- `.images/l4-graph.png`:编排图截图
This commit is contained in:
ning-inspire
2026-11-20 10:33:59 +08:00
parent 584dac1322
commit 9f4df2c468
3 changed files with 94 additions and 11 deletions

View File

@@ -21,17 +21,6 @@ def extension_ids(graph: dict) -> set:
return found
def _model_value(graph: dict, node: dict) -> str:
key = node.get("model")
models = graph.get("models") or {}
if not key or key not in models:
return ""
spec = models[key]
if isinstance(spec, dict) and spec.get("env"):
return os.environ.get(str(spec["env"]), "")
return str(spec)
def validate(graph: dict) -> tuple:
"""返回 (errors, warnings)。errors 非空时图不能跑。"""
errors = []