Repository navigation
refactor: preserve the read-only runtime routing import boundary - #7487
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max
未发现阻塞问题。APPROVE,精确head 713e13e2e618724ab23bb916f2c26e7e262e31d4。恢复只读入口的依赖边界,实际来源路由和写入结果保持。
动机 / Motivation
需要稳定只读Todo入口和来源路由的CLI调用者与维护者。 只读todo list通过runtime route加载完整history模块,破坏既有fresh-process读入口隔离;实际查询仍返回成功。 只读来源路由直接复用原registry codec;只有两个实际观察历史的helper才加载原history reader,路由结果与写入规则保持。 不修改来源选择、覆盖参数、快照、分页、失败回退、authority或写入规则,不新增配置和UI。 这消除明确的维护耦合,不声称已测得命令加速或长程模型收益。
规格依据为 df9839b8001c795203039c314157bce25e294190 的 docs/reference/protocols/session-runtime-loopx-projection-v0.md 与既有fresh-process读边界:READ-ONLY-ENTRY由两个File/SQLite入口反例验证;SOURCE-ROUTE由explicit/candidate/writer guard真实测试验证。来源投影不是authority,导入可用性也不授予操作权限。
改动思路 / Approach
history.load_registry本来就是registry_codec.load_registry的再导出,直接依赖原owner即可;历史观察留在原两个调用点。 既有registry codec就是原再导出的函数,直接依赖原owner,历史读取留在两个真实观察点。 仅一个既有Python模块调整导入位置,保持全部路由、快照和写入条件。 对比history再导出和codec定义,确认load_registry是同一个函数;没有新增解析器或平行source owner。两个历史观察函数保留原load_index参数、结果过滤和错误行为,只把加载移到调用时。
具体改动 / Changes
resolve_goal_source_runtime_route使用原registry codec读取同样的快照和explicit override。_latest_route_source_row仍按原route id查找最近记录;_route_projection_is_current仍检查原目标历史、来源时间和artifact存在性。改动仅5行增加、1行删除。原Todo JSON/Markdown、provider过滤、source witness和writer拒绝不变。
32个真实File/SQLite Todo CLI及explicit route、candidate roots、writer guards用例通过,零skip;6项direct和13项selected premerge、CI规定Ruff命名空间、17个配置mypy文件、公开边界与CQR通过。 原fresh-process断言仍禁止mutation_api、history、state_refresh、todo mutation CLI和periodic-report hook出现在只读入口;旧实现的两个用例失败,当前实现通过。其余route用例检查显式来源、候选目录及写入边界,未新建只镜像实现的测试。全量PR CI按Goal配置未查询。
对主干的风险 / Risks
最大风险是导入移动误改变来源解析或历史观察;直接复用同一函数且两个history调用的参数和主体未变,32个真实用例覆盖该边界。没有新增状态、重试或fallback,不涉及provider store迁移。原错误归原owner处理,不吞异常。无UI或首次屏幕变化。最终全量发布、真实模型、打包UI及原生平台资格仍单独完成。 不把本切片通过当成完整发布资格,也不由减少导入推算性能收益。
我的整体评价 / Verdict
既有registry codec就是原再导出的函数,直接依赖原owner,历史读取留在两个真实观察点。 仅一个既有Python模块调整导入位置,保持全部路由、快照和写入条件。 这是可回滚的有界修复,直接使用既有owner,不扩展框架或迁移范围。当前改动具备合并依据,未发现阻塞问题;最终交付仍须完成统一候选验证。
English verdict: APPROVE 713e13e2e618724ab23bb916f2c26e7e262e31d4. Direct reuse of the defining registry codec restores fresh Todo read isolation;the same history readers remain at their two actual observation sites.32 real File/SQLite/routing cases and required local gates passed.No routing,authority or persistence semantics changed.
A fresh
todo listloaded the full history module through runtime source routing, breaking the existing read-only import boundary even though the query itself succeeded.Runtime routing now imports the existing registry codec directly. Its two history-observation helpers load the same history reader locally when invoked. No route resolution, source witness, alias, fallback, write, projection or history semantics change.
Validation: 32 actual File/SQLite Todo CLI and explicit/candidate/writer routing cases passed with no skips. Existing fresh-process assertions still prohibit mutation, history, state-refresh and periodic-report hook imports during Todo reads. Repository premerge and configured static/public-boundary evidence are recorded with the exact-head review. No UI changes.