Repository navigation
fix(backup): bind canonical sources and configuration capture revisions - #6637
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…-owner-20261016 Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
… gaps Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…bytes Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…-owner-20261016 Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
精确 head:e79f26eccfcf36983103a61cdaa32fbbb03c0c90。持有完整备份、原工作区已经不可用的操作者,需要在既有设置入口读回正确源 Goal 的任务和历史。此前全局发现可能漏掉 canonical registry、完整 Goal 或独立 runtime;检查还可能误读共享 runtime 中的同名 Goal。另一个独立缺口是先复制 registry A、后编码配置 B,二者各自摘要都可通过。
独立探针包含两份不同 canonical source、File/SQLite 交叉组合及来源移走;每份任务/提交各自读回。
验收依据:docs/architecture/rfcs/complete-state-recovery-v0.md 的 First supported user outcome、Invariants 和 M2: declared capture profiles,以改动前 47d0f31482303ffa514a3e45cf34099ce275a069 为准;并已先读同版本 docs/reference/configuration-backup.md 的 M1、隐私和 publication/retry 契约。 本次交付是有用的 M1 源覆盖/惰性读回与新备份发布拒绝;M2 全量 owner closure、捕获 profile 和 M3 身份/会话/effect adoption 仍开放,不能把字节一致性解释为可继续执行。
改动思路
本次交付是有用的 M1 源覆盖/惰性读回与新备份发布拒绝。
复用 canonical registry codec、现有 source route、tar 实际复制字节见证和 TS recovery owner。Python 处理发现、文件和传输;TS 校验可选 v0 root binding 并决定历史可读性。双语 RFC 的 owner inventory 明确剩余跨 owner 间隔/依赖缺口,没有用新文档降低原 M2/M3 标准。
| 触发 | 当前结果 |
|---|---|
| 全局 registry 路由到独立 canonical runtime | 复制源 registry/完整 Goal/显式 runtime,按捕获位置读回 |
| 新备份 registry 复制字节与配置解码快照不同,含 A→B→A | 发布前拒绝,保留既有备份 |
| map 部分缺失、null、目录缺失或根为符号链接 | unknown,不能替换为共享同名 Goal |
| 整个新 map 不存在的历史归档 | 保留原历史读回及 held,不授予执行权 |
这是源码边界说明;执行证据见下文。
具体改动
已检查全部13路径。state_backup.py 删除重复 _registry_goals decoder,复用 source route,去重捕获独立 runtime,记录 goal_runtime_roots,并以 _configuration_source_witnesses 比较解码实际使用的不可变源快照与每份已映射普通 tar 副本;有界 migration 仍走原 witness 契约。configuration_backup.py 复用 decode_registry_snapshot,保持完整配置 envelope。state_recovery.ts 的 capturedRuntimeRoots/inspectGoal/auditOwners 只读取已捕获安全根;IO adapter 传递 manifest 事实。已删除过期 semantic IO exception;smoke、四类测试和三份文档对应更新。
独立探针包含两份不同 canonical source、File/SQLite 交叉组合及来源移走;每份任务/提交各自读回。另两例对真实 producer 在复制后改变 registry,并分别保持 B、或在配置读取后还原 A;都拒绝发布。相同探针在改动前分别漏原始 registry、或错误发布混合版本,确认能检出修复对象。
对主干的风险
独立运行 129项 Python、11项 TS,均通过且无 skip;另四个 source-loss/persistent/ABA 反例通过。原生 backup smoke、Ruff、control-plane tsc、semantic advisory 后完整 semantic 检查通过。打包 Chat 的真实 backend 与 Ego 浏览器完成文件对不匹配拒绝、改正后读回 canonical File 的1个任务/2次提交、历史报告读取及390px窄屏;原来源不存在,目标 registry 没有新增 Goal,冷读 audit 仍 held/无激活和执行权。
风险 canary 的5项直接检查通过,11项全部执行:10过、1项继承 DSH maintainability advisory;总 canary 仍失败于独立的 quality_stale_receipt,没有重签或放松收据。完整 maintainability 报告在基线/head 仅移除源目录后逐字段相同:同一 DSH 93 statements/51 decisions,无 magnitude regression。完整 docs-governance 仍有两处既有 TS RFC 日期标题失败,基线相同;改动的 RFC 原文保留及新增边界已独立核对。新全局发现可能复制更多私有源状态,dry-run 预先披露;未扩张隐式主机 runtime、public audit 或执行权限。未查询/等待 CI,未安装全局版本,未验证其他平台、服务型 provider 或持续运行。
我的整体评价
APPROVE;未发现当前有界 M1 改动的阻塞代码问题。 实际源定位、负向拒绝、旧归档兼容和界面恢复均有独立真实路径证据。面向下一步的重构检查已落实为删除重复 registry decoder、复用既有 route/typed owner;无需再建通用 restore coordinator。跨 owner 一致性、完整 inventory、身份接纳和继续运行保留在既有 M2/M3,不因此次批准被宣称完成。独立 quality/readiness 与维护者合并授权仍须各自满足;本次没有合并。
English verdict: APPROVE - e79f26eccfcf36983103a61cdaa32fbbb03c0c90; canonical source capture and inert readback are verified, with persistent/ABA registry mismatch refusal and legacy compatibility preserved. Independent129 Python+11 TS checks and4 counterfactual cases pass; packaged error-to-recovery reads the correct source after loss. Separate quality/readiness holds remain; no activation or merge is authorized.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
精确 head:a2c661a3e6bd41462ae1f6a2312ae1a97ddf6a6e。
受影响的是原来源已不可用、需要检查私有完整备份的操作者。此前可能漏掉 canonical 源,误读共享目录的同名 Goal,或发布原始配置 A 与随后解码配置 B 的混合备份;现在按捕获源读回,并在发布前拒绝相互矛盾的配置字节。真实打包界面先拒绝错误清单,更正后读回 canonical SQLite 的 2 个任务、3 次历史提交;保存的 machine 配置及未知扩展值也与原字节一致。本次只交付 M1 来源与惰性检查修复,不恢复执行,不授予会话、租约、effect 或安装权限。
先读验收框架再读实现:改动前 dfcb03e6d31361ab65d882e3294b9fdf92b39f6a 的 docs/architecture/rfcs/complete-state-recovery-v0.md,以及同版本 docs/reference/configuration-backup.md 的配置/完整归档、隐私、发布与重试契约。First supported user outcome、Invariants 和 M1: verify and readable inert audit 要求读回有用历史,同时把未知和运行权分开。M2 完整 owner closure、捕获 profile、M3 身份/会话/effect 采用及原入口继续工作仍开放。
改动思路
复用 canonical registry codec、source runtime route、配置 owner、既有 tar/SQLite 捕获见证和 TypeScript inert recovery owner。只改可读性标签不能补回遗漏源;只验证配置 envelope 的摘要也无法发现“原始 A/checkpoint B”。本 PR 在解码时保留实际字节,以保存的归档路由比较副本,避免事后再读 live path 的 A→B→A 漏洞。
| 触发 | 结果 |
|---|---|
| 全局 registry 指向外部 canonical 源 | 捕获原 registry、完整 Goal、显式 runtime;共享 root 去重 |
| registry/machine 的实际解码字节与任何映射副本不一致 | 发布前拒绝;确认不存在也不能与旧文件或保留链接并存 |
| 保存的 hardlink/symlink | 解析已保存 tar route 到普通文件见证,不能借 live 改向重选另一份字节 |
| 新 map 中缺 Goal、null、目录缺失、symlink 根 | unknown;不读取共享目录同名 Goal 代替 |
| 整个新 map 不存在的历史 v0 归档 | 保留原历史读回,仍 held/无执行权限 |
此表解释本 head 的源码边界,不是运行证据。Python 处理源读取、文件和传输;TS 继续决定安全绑定及历史可读状态。
具体改动
完整审查全部 14 路径,不继承旧 head 批准。state_backup.py 删除重复 _registry_goals decoder,复用源路由,去重捕获独立 runtime;私有 v0 清单增加可选 goal_runtime_roots。_configuration_source_witnesses 要求每个非空解码源有普通副本见证,并比较每份映射副本;确认 absence 与 tar 中存在的文件或链接冲突时同样拒绝。
configuration_backup.capture_configuration_backup 从不可变 registry 快照解码;machine_configuration.store.read_stored_machine_configuration 的可选 source_snapshots 分支把实际读取的原始 envelope 或确认不存在交给 full backup,普通调用路径保留。malformed、目录和 broken link 不降格为 absence。链接比较依赖保存的 tar metadata,覆盖改向及回退,而非 live path 的最终状态。
state_recovery.ts 的 capturedRuntimeRoots、inspectGoal、auditOwners 验证安全 included root 并使用既有 File/SQLite 只读 owner;IO adapter 仅传递已核验清单事实。删除对应过期 registry IO exception;三个 Python 测试模块、TS 合约、薄 smoke、指南和双语 RFC 同步。M2: declared capture profiles 的清单是来源定位和剩余工作说明,未降低 M2/M3、RPO/RTO 或真实 owner 采用门槛。
对主干的风险
独立运行 107 项直接 Python 回归、48 项相邻 cold-import/member-integrity/registered-source 回归及 11 项 TS 回归,全部通过,无 skip。最终同一独立 fixture 在 head 为 13 passed;不可变基线为 3 passed/10 failed。三个不变源 regular/hardlink/symlink 正例在两边都通过;十个旧缺口包括两个双源 File/SQLite 原来源丢失案例、registry 持续/回退变化,以及 machine 变更、删除、新建、回退和链接改向/回退时未拒绝发布。没有用新增元数据字段本身作为基线失败理由。
当前 frontend build 及真实 Chat backend 经 Ego 浏览器操作:从设置进入能力中心,选择完整归档;不匹配的清单拒绝,更正后检查结果为源 SQLite 的 2 个任务、3 次历史提交,共享同名 File store 的 4 个任务没有替代它。原来源已移走。独立冷读保存的 audit 再核对原 machine 字节、checkpoint 中未知扩展值、目标 registry 未新增恢复 Goal,以及 held/activation_eligible=false/execution_authority_granted=false。界面仍提示尚未启用及原 owner 的下一步;没有要求重填已知路径或追加人工确认。浏览器工具的 selector/不可见元素错误发生在验证观测阶段,修正后读取已有结果,没有重发备份操作或放宽断言。
Ruff、control-plane tsc、native backup smoke、语义 advisory 后的完整 semantic 检查通过。风险 canary 5 项直接、11 项选中检查全部执行,没有新增 blocking failure,保留 1 项既有 DSH advisory;总 gate 仍为 quality_stale_receipt。独立 base/head 完整 maintainability 报告仅去除根路径后逐字段相同:DSH 93 statements/51 decisions、1 unreviewed、0 magnitude regression。docs-governance 两边均因同两个旧 TS RFC 日期标题失败,完整诊断仅规范化 checkout 路径后相同。未修改这些限制,也未将作者的质量或打包报告冒充独立收据;未查询或等待 CI。
我的整体评价
APPROVE,未发现阻断性实现问题。 本 head 在原有 owner 中补齐 machine/absence/保存链接来源闭包,保持 config-only、历史 v0 和 bounded migration 的兼容边界;真实 packaged 错误恢复和来源丢失后读回均已执行。它是完整、有用且可回退的 M1 修复,不是完整灾难恢复资格。
面向下一步的重构检查结论:删除重复 registry decoder/过期 exception,并把原始配置见证留在实际解码 owner,已减少重复知识;再抽中央 capture coordinator 会扩大边界,当前不需要。M2/M3 和安装、Host/Lark、长期/复合容量资格仍由原计划承担;质量收据与精确 head 合并 readiness 仍须独立满足。本次没有 merge、admin bypass 或激活操作。
English verdict: APPROVE - a2c661a3e6bd41462ae1f6a2312ae1a97ddf6a6e; canonical source readback and complete configuration-byte/absence/saved-alias refusal are independently verified. 155 Python, 11 TS and 13 independent probes pass; the packaged mismatch-to-correction journey reads the original SQLite work after source loss. Quality, M2/M3 and activation gates remain separate; no merge performed.
Full backups could omit canonical sources or pair raw configuration from one capture with a checkpoint from another. Discover and bind the source-owned registry, full Goal and explicit runtime, then refuse contradictory configuration before publishing either output file.
The existing registry decoder and stored machine-configuration owner supply the exact decoded snapshots, including confirmed absence. Every mapped copy must agree; saved hardlink/symlink routes select their regular copied-byte witness. Changes, deletion, creation, repointing and A → B → A cannot be hidden by a later live reread. Self-contained aliases remain supported. The configuration envelope and v0 archive format remain unchanged; historical mixed archives stay readable and inert, and bounded migration retains its existing owner-witness contract.
The existing TypeScript recovery owner selects captured source runtimes rather than a shared same-name decoy. Python remains the filesystem/transport adapter. The paired RFC inventory and historical compatibility coverage absorb the useful part of superseded #6633.
Author validation at
a2c661a3e6bd41462ae1f6a2312ae1a97ddf6a6e, based ondfcb03e6d31361ab65d882e3294b9fdf92b39f6a:cqr_b5271b42dd378e6dd7eais valid. Native premerge passes 5 direct and 11 selected checks, with one inherited advisory. All original recovery RFC lines are preserved; local documentation links and the 14-path public/private scan pass.The existing dated TypeScript RFC heading and DSH complexity checks remain failed. Independent immutable base/head runs retain identical full diagnostics and fixture/environment digests; no checker, budget or frozen qualification was relaxed. Hosted CI is unobserved in this validation.
Independent review of this exact head is pending. Configuration-source byte agreement does not qualify the complete M2 owner closure, a cross-owner capture profile, M3 identity/effect adoption, installed Host support or sustained/default qualification. Lifecycle-only generic reads remain refused.