Repository navigation
v0.57.2 — 修复独立审查发现的 5 个阻塞项
概述
独立审查线程回传 REQUEST_CHANGES,5 个阻塞项全部复现并修复。
最刺眼的一条:“注册成功”不等于“命令可用”。
1. workflow 组四个命令“注册成功但运行即崩”
clawd workflow --help 能列出 ralph / ralplan / team / autopilot,
但四个命令一执行就 ImportError —— 函数体引用的是从未存在的符号:
| 命令 | 原引用 | 真实 API |
|---|---|---|
ralph |
SwarmOrchestrator.execute_task()、RalphLedger |
SwarmEngine.run()、RalphProgressLedger |
team |
SwarmOrchestrator.coordinate_task() |
SwarmEngine.run() |
ralplan |
RalplanWorkflow.execute() |
RalplanEngine.run() |
autopilot |
from .workflow_commands import create_autopilot_pipeline_config(从自身模块导入从未定义的名字) |
workflow.pipeline_orchestrator |
四个命令体全部重写。ralph --verify 不再假装验证通过 —— 本项目验证阶段仍是桩,
命令会明确打印这一点。
新增 tests/cli/test_workflow_commands_wiring.py:用替身驱动命令体,
断言“不抛 ImportError/AttributeError、退出码正确、产物落盘”。
2. explore 只读引擎必然失败
导入不存在的 src.tools_runtime.tool_manager.create_readonly_tool_manager;
且 AgentEngine.__init__ 根本不接受 tool_manager(内部自建)。
改为构造期注入 APPROVAL_MODE=plan(真实只读门禁,拒绝一切 write/exec),
构造后还原;门禁未生效时显式告警。
3. catalog list/reload 运行即崩
manifest.py:111给SkillDefinition传了不存在的internal_required=TrueCatalogManifest.get_counts()从未存在
修复后实测:catalog list正常;catalog reload输出
“技能数 39(活跃 23)/ Agent 数 30(活跃 18)”。
4. 断点续跑从未生效(三处叠加)
run()先start_mode()(写 index=0)再can_resume()→ 永远读到 0_complete_pipeline("failed")写active=False+ phase"failed",
被can_resume()排除 → 失败后永不可恢复- 失败阶段写
index=i+1→ 恢复会跳过失败阶段
修复后恢复测试实测:calls s1=1, s2=2, s3=1(s1 不重跑、s2 重试、s3 首次执行)。
5. PipelineState 往返丢字段
save 写 pipeline_stages 但 load 不读回 → load→save 后 can_resume
由真变假;artifacts 两边都不处理。已补双向持久化 + artifacts JSON 归一化
(阶段把 ctx.cwd 放进 artifacts 时不再让整份状态写入失败)。
同时修复(审查的非阻塞项)
BudgetGuard跨轮状态泄漏:复用实例后第二次run()继承上轮
accumulated_cost/is_exhausted/start_time→ 新增reset_for_run()_resolved_dimensions在本次未配置维度时未清空create_pipeline(cwd=...)只影响阶段、不影响状态目录 → 对齐memory_server文档仍称“语义搜索”(实为子串匹配,score 恒 1.0)→ 如实修正types.py去重后残留 4 个孤立@dataclass;测试未使用 import
验证
pytest tests/ -q → 3050 passed / 0 failed
pytest tests/cli tests/workflow tests/core -q → 1080 passed
ruff --select F821,F811 → All checks passed
scripts/import_sweep.py → 0 缺陷(639 模块)
scripts/reachability.py → 429(与基线一致)
python -m src catalog list / reload → 正常
scripts/verify_html_report.py → 10 题全部通过(真实浏览器)
仍未闭合
覆盖率 ~20% · 死模块 135 · 静默吞异常 101 · CLI 启动剩余 ~20s · 验证阶段仍是桩。
🤖 Generated with Claude Code