Repository navigation
refactor(configuration): move backup modules below package root - #5619
mikamikasuki wants to merge 1 commit into
Conversation
8123353 to
fb960c1
Compare
Signed-off-by: mika <[email protected]>
fb960c1 to
f09f9cb
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=xhigh
Exact head: f09f9cb360b3769e1921d1b4b97b09833aca4ab1; immutable base: 96164637c21db7ccd2f741cb7da6ef630fa413e6.
[P2] 保留的根级兼容包必须计入架构预算。实际实现搬迁有价值,但预算的绿灯目前来自遗漏这两个入口;请保留必要的旧接口并修正计数/范围,不能直接以147宣告完成。
动机
维护配置备份与恢复的贡献者,需要在明确的所属模块修改规则,同时让旧版使用者继续导入已有接口。
改动前备份逻辑和 HTTP 入口在根目录;改动后实际实现进入所属目录,原导入名仍各有一个根级兼容包,但只数 .py 的检查从失败变成通过。
CLI 的导出、校验、预览、隔离恢复和失败读回保持一致,安装后的旧接口也可用;按规范计入保留的兼容入口,根级数量仍是149,因此声称修复147预算尚未成立。
本次核验模块搬迁、原接口和备份安全边界,不认证完整发行包拆分、跨平台升级、多日吞吐或真实用户采用,也不授权恢复内容覆盖活动 Goal。
改动思路
搬迁两段已有 IO/HTTP 适配实现,CLI、Chat mixin 和全状态备份同时更新,继续使用原 TypeScript 备份/恢复决策 owner;原导入名只 reexport,未复制规则。这个目录归属调整便于定位下一次修改;它与真正减少根级接口是两项验收,不能把目录变化或测试数当长期收益。
按改动前的 accepted move contract,revision 96164637c21db7ccd2f741cb7da6ef630fa413e6:I2 的单一规则 owner 保留;I3 的已公开旧导入由兼容包保持,安装实测通过;Command or event lifecycle 明确要求计入 retained shims,并只按实际净减少调整预算。最后一项在此 head 未达成。
具体改动
loopx/configuration/backup.py:12读取当前 registry,再沿 source owner 读取完整 Goal 配置和机器已存配置,交给原 TS backup operation,比较完整值以拒绝丢失。两段搬迁正文独立对照只改变相对导入;manifest 只更新两处读站点名字。loopx/presentation/configuration_backup_api.py:8保留原 export/restore 请求、严格字段、大小/digest/目标隔离限制。现有 Settings capability-center 调用相同 API;CLI 和 archive capture 也改为当前 owner。未增加参数、表单、确认或新权限。- 两个旧名各变为根级包的
__init__.py,发出 DeprecationWarning 后转出三个备份函数、HTTP mixin 和 path 常量。实际 rebuild 后的 wheel 在独立安装环境验证五个旧/新导出及两个 warning,CLI backup 命令可加载;不是仅从 checkout 导入。 - 阻塞点:独立枚举实际 Git tree:base149个根级
.py;head147个根级.py,另有configuration_backup与chat_configuration_backup_api两个根级旧入口 shim。计入 retained shims仍为149。现有 budget测试只glob("*.py"),所以原本149>147失败变为绿;accepted contract 明说保留 shim 的搬迁不减少此数。需要让这类 package facade 也参与所属计数,并列明必要兼容调用者/移除条件、实际净减少或接受范围内剩余 gap。不要为了绿灯删除必要 API、任意提高预算,或合并无关职责。兼容本身合理,遗漏兼容成本才是本 finding。
对主干的风险
独立同一 source-qualified 用例:head 41 passed;固定 base 39 passed / 1 failed,失败是 root149>147。API/CLI 正常恢复不是预算正确的证据:同一合成完整配置经过真实 CLI/源码 registry/机器 owner/Node TS/隔离 filesystem,导出 preview/execute/occupied、verify、restore preview/错误 digest/execute/occupied,以及完整恢复 JSON、源不变、0600,一共12项完整观察相等。只归一化 fixture绝对目录、真实 capture timestamp、经完整 payload 验证的 digest 与已验证 Errno17 staging 随机 basename,未抹掉错误内容、目标、字段或副作用。真实 loopback HTTP、40k Unicode/未知/null/disabled 字段、丢失大整数时保留旧 archive 的负例均在 focused套件执行。
manifest census、10路径 public boundary、whitespace 和 semantic advisory通过;没有新增共享状态词汇,advisory不是语义等价证明。首次 wheel build被先前缓存的本地 frontend bundle指纹阻止;通过所属 npm run build:chat 重新构建验证后,原 wheel构建和独立安装 smoke成功,保留初次失败,不把旧缓存错误归因此PR。未修改依赖或tracked源码;build警告仍有大JS chunk。未查询/等待CI。没有真实账户、跨平台、optional package最小安装、长程吞吐或本机采用证明。
我的整体评价
REQUEST_CHANGES,针对根级计数与 accepted move验收差异。备份体验 user_experience preserved,归属改善有正向维护价值;long_horizon not_yet_proven,当前 guard隐藏了仍保留的根级接口,不能认证实际根级收缩或长期效率。相邻未来维护检查选择保留单一 TS规则、薄reexport与真实计量;不需要新框架/计分板或完整发行拆分才能修这个有界问题。
English verdict: REQUEST_CHANGES - f09f9cb. The real backup/restore journey and installed legacy exports are preserved, but the accepted shim-inclusive root ratchet is not repaired:149 root files become147 files plus2 retained root compatibility packages. The direct-file test turns green while the normative count stays149. Count and justify retained compatibility honestly, preserving required public imports; do not loosen the limit or use directory regrouping as evidence of sustained efficiency. Source-qualified paired CLI observations,41 focused head tests, manifest/boundary checks and rebuilt installed-wheel smoke passed; live and multi-day outcomes remain unqualified.
| stacklevel=2, | ||
| ) | ||
|
|
||
| from ..configuration.backup import ( # noqa: E402 |
There was a problem hiding this comment.
[P2] Count this retained root import shim in the architectural ratchet. At this exact head the baseline149 root files become147 .py files plus this and chat_configuration_backup_api root shim packages, so the accepted shim-inclusive count stays149. The existing *.py glob turns green solely because these facades changed representation. Preserve needed public imports, make accounting include retained package facades, and document the actual compatibility/removal boundary rather than declaring147 as net root reduction. Regression: retaining a root import shim while moving its body must not reduce the normative count.
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
|
Closing this PR as superseded by changes that have since landed on main. The backup owner now lives at |
Goal And Delivered Outcome
Author Declaration
Implemented against
Scope And Continuation
Validation
Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist