RuntimeLoop 43 参数收进 RuntimeLoopConfig(不拆类) #113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/105-runtime-loop-config-dataclass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #105
RuntimeLoop构造函数 43 个 keyword-only 参数里,"只被恰好一个方法读、本质是静态配置常量"的 22 个收进新的
RuntimeLoopConfig(同reflection.ReflectionCycleConfig既有先例)。不拆
RuntimeLoop类,42 个方法的行为一行不改,构造函数从 43 参数降到 22(config 本身 + 21 个独立参数)。
判断标准:按类型,不是按读取次数
设计阶段自己抓到一处误判,记录下来是因为它正是 issue 复核引言块点名过的那类错误
的另一个实例:
delegate_enabled单读(_run_tool_loop)、类型是bool,「端口/客户端/回调/registry 排除」这条规则不拦它——但它的真实值是
config.arise_delegate_enabled and delegate_available,后半是按本次调用现查的熔断状态,不是纯静态配置,跟
spontaneous_goal_unlocked被排除在外是同一类。变异验证确认这条判断本身有回归测试保护:把它错误并入纯静态值(去掉
and delegate_available),test_a_broken_delegate_pool_hides_the_tool_from_the_model立刻变红。
验证
loop_factory.py的_runtime_loop_config)与git show HEAD拿到的旧版RuntimeLoop(...)调用点逐字 AST 比对,全部一致;21 个保留字段同样核对,
43 = 22 + 21一个不多一个不少。run/run_callback/run_light/run_environment_signal/run_immediate_followup/assemble_context)用 diff 逐字核对零差异。__init__前后各 42 处def匹配,含__init__本身)。test_debounce_e2e.py高负载偶发 flake,单独重跑与二次全量重跑均绿),ruff check干净。run_limit改坏会红;delegate_enabled错误并入静态值会红)。两轴 review(sonnet):1 条 minor,已修
Standards 轴零发现(逐字段核对 22+21=43 无搬错/漏搬/误分类)。Spec 轴 1 条:
RuntimeLoopConfigdocstring 说spontaneous_goal_unlocked「同样单读」来类比delegate_enabled的排除理由,但它实际被两个方法读取,不是单读——排除结论本身没错(都是 per-call 现算而非静态),只是给对的结论配了一条经不起核实的证据。已修。
Not in scope(确认未越界)
不拆
RuntimeLoop类;不碰storage.py;不碰__init__.py拆分(#97 范围);不新增/不改写任何既有断言(
tests/目录唯一改动是runtime_loop_helpers.py的内部实现,无一处
assert);不涉及docs分支(本票无设计决策变更)。🤖 Generated with Claude Code