Repository navigation
refactor(control-plane): retire 19 effect runtime registrations with no caller - #7895
Conversation
…no caller No Python or TypeScript caller dispatches these 19 effect-runtime methods, so their registrations are removed (376 -> 357). The functions behind them stay where another production module still calls them. Four exports lose their last production caller and are deleted with their private decoders: evaluateTaskLeaseOwnerEligibility, governedCapabilitySettlementStatus, delegationTurnPlanDecision and the recordLocalAuthorityShadow tombstone. Their test cases now exercise the live shared helpers (leaseOwnerRejection, leaseOwnerConstraint) or the dispatcher's unsupported-method rejection. Handler tests assert every retired method name is rejected. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Signed-off-by: hhyykk <4408344+hhyykk@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | model=gpt-6.1-sol | provider=OpenAI | reasoning_effort=max | source=runtime_reported
动机 / Motivation
维护同一发布物内 Python 与 TypeScript 控制面调用链的开发者。此前注册表还暴露 19 个已无仓库调用方的叶子 RPC,四个专用导出也只被这些注册或测试使用。本次删除这些入口,让实际调用继续沿用已有完整事务。已验证的变化是注册项从 376 减至 357,当前调用链和租约资格规则保持一致,已删除入口统一拒绝。本次不移动事务权限、不改变租约、调度或审批规则,也不增加新能力和用户操作。已检查范围内没有待补实现;外部未承诺的直连 RPC 使用、其他平台安装及长程净收益不在本次结论中。
改动思路 / Approach
删除无调用入口和专用适配器,保留有进程内消费者的领域函数;统一 dispatcher 继续负责未知方法的拒绝,无需新增状态或兼容路由。本 PR 的边界是同一 source fingerprint 发布物内的无调用 RPC 清理;现有领域规则、provider IO 和用户旅程继续由原 owner 负责。实际仍被使用的领域函数不随入口一起删除,尤其是租约资格的优先级、cadence、planning inventory 与 monitor successor 规则。反向检查覆盖动态方法拼接:authority_core.py 的 todo.{operation}.decide 只生成保留的 terminal / mutation,不生成被删的 claim。旧发布物的 Python 通过包含源码、物理发布路径和解释器的 fingerprint 选择旧 daemon,不应把新发布物的注册表当作跨版本公用 RPC 服务。
具体改动 / Changes
本次按迁移前规范 docs/architecture/rfcs/typescript-control-plane-migration-v0.md,固定 revision 867615e2c3aa2a32516a71d46f11a20d6fcb3289 判断;PR 自己新增的 ledger 是待验证的实现说明。五个生产文件净删除 126 行,五个测试文件把规则断言留在仍被使用的 owner,并增加退役方法的真实 dispatcher 拒绝覆盖。
关键代码讲解
createEffectRuntimeHandlers:删除 19 个无调用叶子和四个专用适配器;其余仍被进程内使用的函数和 native 注册继续存在。dispatchEffectRuntimeMethod:未改变的公共拒绝 owner;查不到精确方法名就返回 unsupported_method,任何 handler 都不会执行。leaseOwnerRejection / leaseOwnerConstraint:保留 user_action、unknown owner、excluded agent 等资格优先级;测试改为直接验证真实领域入口,release 仍是受栅栏约束的清理。
RPC-OWNER:implemented。完整调用方扫描包含动态拼接,保留有调用者的 domain 函数;
RPC-FAILCLOSED:implemented。19 个名称经真实 managed transport 均拒绝,shadow 不创建存储;
RPC-DEPLOY:implemented。既有 fingerprint 以源码、物理发布物和解释器隔离版本。
对主干的风险 / Risks
最大风险是把“没有精确字符串”误当作“没有调用方”。本轮对所有 tracked 文件扫描完整名称和被删导出,再用 Python AST 收集变量、常量及 f-string 方法,并逐一检查相关生成范围。当前调用不依赖被删入口;没有据此承诺任意外部 socket 调用者不存在。现有 source fingerprint 的隔离边界也已读取,当前规则没有跨版本共用 daemon。
独立执行 90 个 TypeScript 用例、类型检查与标准 premerge,均为 PASS。公共 Python→managed daemon 路径验证全部 19 个名称为 unsupported_method,现有 fields 完整输出与 base 完全一致;恢复一个被删 handler 的临时突变被独立断言检出。shadow 测试通过真实 dispatcher 验证拒绝后存储为空。测试探针最初漏传既有 observed_at 必填字段,修正后双方同测通过;这是探针修正,没有当作产品缺陷。
兼容性上,shadow 专用退役诊断从 local_authority_shadow_retired 改为 unsupported_method,已明确披露;没有改变仍支持的 CLI 输入、领域状态、默认设置或用户确认步骤。作者披露的更宽套件旧失败和历史并发超时未独立重跑,保留为未知历史证据,不把聚焦结果说成全仓或所有平台合格。
语义与 CI 对齐
复用既有 lease constraint 与 Effect 错误 vocabulary,仅移除无消费者入口。精确方法拒绝和资格检查都是强制边界,未通过文案分类增加领域义务。当前 wait_for_ci=false,未查询 CI;其状态与本轮已验证的变更不变量分开。
我的整体评价 / Verdict
本轮 exact-scope change-quality receipt 为 PASS,覆盖当前未改动 head;它记录评审与校验,不授予合并权限。
当前 head 的有界清理达到所声明目标,APPROVE;删除比保留无消费者协议更合适,不需要借此重写整个领域模块。Long-horizon 为 not_applicable,没有把注册表缩短当作长程效果提升;user_experience 为 preserved,现有支持的 CLI 和用户路径不增加操作。已检查 Effect dispatcher、租约调用及 shadow 配置入口,本次没有页面、布局或交互控件改动。没有视觉改动需要验证;未将源码测试扩展为其他平台或已安装 Host 的资格。 审批不授予合并、dismissal 或安装权限,合并仍须独立 readiness。
English verdict: APPROVE — head 8f4fed0e11c5711e896733f5c9a22c2c54f53dec; 19 unused internal RPCs retire with current callers preserved; local focused tests, typecheck, premerge and public-transport counterfactuals pass.
Goal And Delivered Outcome
effect_runtime_result/request call sites, TS dispatch, examples, scripts and tests, including string-built method names) found 19 registrations that nothing dispatches. Each one is extra public RPC surface to keep compatible and review.unsupported_methodrejection. Four exports had no production caller except those registrations, so they are deleted too.loopx-project/loopx:main. No issue closure claimed.Author Declaration
Implemented against
effect_runtime_handlers.ts(for exampletodo.field_update.plan,todo.public_update.plan,todo.claim.decide,quota.automation_cadence.schedule,work_item.planning_inventory.*,task_lease.owner_eligibility,coordination.ownership_observation,coordination.local_authority.legacy_writer_fence.engage,scheduler.monitor_successor.plan)rgacross loopx, apps, packages, examples, scripts and teststests/control_plane_ts/effect_runtime_handlers.test.tsasserts all 19 names are unsupportedplanTodoFieldUpdate(public_update.ts),projectCadenceSchedule(scheduler/hint.ts),projectTodoPlanningInventory(action_portfolio.ts),planMonitorSuccessor(monitor_batch.ts)evaluateTaskLeaseOwnerEligibilityand its private decoders,governedCapabilitySettlementStatus,delegationTurnPlanDecision, therecordLocalAuthorityShadowtombstonergleaseOwnerRejection/leaseOwnerConstraint; the shadow retirement test now proves a stale record call is rejected through the dispatcher without creating storagetask_lease_eligibility.test.ts,local_authority_shadow.test.tscoordination.local_authority_shadow.recordmethod now getsunsupported_methodinstead of the tombstone'slocal_authority_shadow_retiredmessage. The TypeScript daemon and its Python callers come from the same checkout, and no in-tree caller sends this method.Migration economics receipt
Scope And Continuation
effect_runtime_handlers.ts. Whichever merges second needs a trivial rebase.Validation
staticpassednpm run typecheck:control-plane;git diff --check. Ruff is not applicable because no Python file changed.unitpassedunitpassedtests/control_plane/test_shadow_observation_retirement.py: 3 passed.integrationpassedcontrol-plane-integrated-canary-smoke.py: File and SQLite passed (an earlier run under concurrent test load exceeded the unchanged 60 s aggregate budget). Maintainability ratchet and interface-budget smokes passed.canarypassedloopx canary premerge --from-git-diff --git-diff-base origin/main: direct checks, 8/8 catalog canaries and risk-profile smokes passed; 0 manual holds.unitfailed (pre-existing)origin/main(867615e).Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).Merge requires explicit maintainer authorization (effect-runtime RPC surface under
loopx/**).