Repository navigation
fix(recovery): restore captured checkpoint readback - #6693
loopx-agent wants to merge 1 commit into
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.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
APPROVE — 未发现阻塞问题。审查完整变更,head 96a01cf0ef0bc2b6a6bfc6c7b407af4748c214e5,base 04b929ac609881d1104308e184c980e7af853b45;以下结论来自独立执行。
动机
受影响的是原项目已不可用、需要从设置中检查完整备份的负责人。原先备份中的任务可读,却缺少保存时的存储检查点;修复后可看到备份原始版本与游标,来源之后的新提交不会替换该位置。已核验:来源丢失后的检查报告、现有详情与历史读回均保留捕获位置,隔离副本始终不获执行权限。此修复不实现受控重启、Agent 迁移、M2/M3 或已安装 App 的恢复资格。
改动思路
原归档 owner 已验证捕获版本和游标,直接投影即可;另查实时来源会改变历史事实并破坏离线恢复。本 PR 只恢复现有 M1 检查报告的 checkpoint 字段,不增加激活路径或新界面。归档 reader 先验证摘要、依赖、selector、完整事务前缀和封印,备份检查器再输出同一份已验证信息。原始来源无需在线,清单也不能自行宣布另一个 checkpoint。旧格式保留既有读取分支;报告的可读、仅历史、未知分类与 owner 下一步保持原规则。
动作比较:设置 → 能力中心 → 完整归档检查 → 选择归档及清单 → 一次验证 → 原有核对信息。结果仍明确显示 Goal 未启用;读取历史结果不重新验证或启动工作。
具体改动
依据 docs/reference/configuration-backup.md,spec_revision 04b929ac609881d1104308e184c980e7af853b45,在读实现前核对原合同。 同时按 Complete State Recovery 的 M1 判断;M2/M3 保持其独立验收。
| 合同条款 | 当前 head 的结论 |
|---|---|
| M1 | implemented:Inspect captured File/SQLite Goal and history after original sources become unavailable, without activation.;由下列真实路径验证。 |
| CAPTURED-POSITION | implemented:Readable components retain the captured provider_revision and cursor after complete head/history verification.;由下列真实路径验证。 |
| HISTORICAL-READBACK | implemented:Saved reports retain the recorded position; old reports without the fields remain unknown.;由下列真实路径验证。 |
关键代码讲解
- inspectAuthorityBackup:在依赖、selector、完整摘要、事务前缀与任务读模型验证后,补回保存时的 provider_revision 和 cursor;不会读取实时来源替代历史位置。
- withVerifiedAuthorityArchive:继续使用既有验证副本:头部版本、完整前缀、最终封印和预期哈希必须一致。清单即使声称真实的较新来源版本,也不能越过摘要一致性检查。
三个路径全部纳入:生产仅补回两个已有字段;既有 TypeScript provider 测试增加真实追加后源丢失和伪造后续版本;既有 Python CLI 测试把 capture 清单与原存储版本关联。字段不是从实时数据库或当前时钟补写,历史报告也不会被重算。
对主干的风险
主要风险是把后续提交或伪造清单当作原恢复位置。基线两种真实 source-loss CLI 场景均以缺少 provider_revision 失败;head 的 Python 81 项和 TypeScript 39 项全部通过,零跳过。真实追加期间的捕获仍固定在原前缀,随后移走来源,报告返回原 revision/cursor;把清单改成真实的较新版本也被 summary mismatch 拒绝。旧历史缺字段、损坏输入、目标占用和未知 owner 保留原保护。
Ego 操作当前构建的打包设置界面,接真实一次性 SQLite/HTTP/CLI:来源已不可达,检查后从现有核对信息读出原 checkpoint;后续检查损坏输入及历史重读。 工作区目录、会话和模型为合成边界;真实验收 owner、文件与数据库未被 mock。首次本地 canary 的“无 Git”样本因临时目录落在仓库内失败,基线同签名;移到仓库外的独立临时目录后整套通过,未删断言或放松预算。
标准 premerge 为 5 项直接检查+13 项选中检查,全部通过;另有生产 TS typecheck、Ruff、语义 advisory 后完整 smoke、公共边界扫描通过。按当前策略未查询 CI。
既有 P2 局限(非本 PR 引入,见 personal-workspace.css:617):390px 设置页的 capability 容器使用 overflow:hidden,长报告底部不能用滚轮展开;Tab 到后续历史按钮可把 checkpoint 带入视口。相关 CSS 与基线字节相同,本轮证明了键盘读回,没有证明完整的滚轮或触控体验。建议设置页 owner 让备份结果进入可滚动区域,并增加不依赖程序化 scrollIntoView 的窄屏滚轮回归;这项既有布局修复不作为当前归档字段修复的阻塞。
语义与 CI 对齐
复用既有归档摘要及 audit 字段,不新增共享状态词表、schema、权限或默认值。完整语义检查通过只提供有界静态证据,正确性另外由真实来源丢失和反伪造路径证明。
我的整体评价
对本次现有 M1 checkpoint 读回修复,结论为 goal_achieved;long_horizon 与 user_experience 均 improved。原归档 owner 已验证捕获版本和游标,直接投影即可;另查实时来源会改变历史事实并破坏离线恢复。本 PR 只恢复现有 M1 检查报告的 checkpoint 字段,不增加激活路径或新界面。未来扩展检查已做:直接复用验证摘要,无需增加 helper、配置开关或跨 owner 抽象。此修复不实现受控重启、Agent 迁移、M2/M3 或已安装 App 的恢复资格。 批准不等于合并授权;后续仍须对同一 head 读取 closeout 与 merge readiness。
English verdict: APPROVE - 96a01cf0ef0bc2b6a6bfc6c7b407af4748c214e5. The existing archive owner now projects the verified captured revision/cursor; real source-loss, later-append, forged-summary and packaged inspection checks passed without granting execution authority. A non-blocking pre-existing narrow settings scrolling limitation is documented; keyboard checkpoint readback passed. CI was not consulted; live-model/installed-App and merge authority remain separate.
Goal and delivered outcome
Full backup inspection reported a readable File/SQLite Goal but omitted its captured storage checkpoint after native authority exports were introduced. The existing real recovery test raised
KeyError: provider_revision, and the packaged Settings journey timed out waiting for the same value.inspectAuthorityBackupnow returns the original revision and cursor from the archive owner's verified summary. The existing decoder, CLI/Markdown, HTTP audit and Settings details consume those facts without a second lookup or frontend rule. Later source commits and a missing original source cannot move that checkpoint; saved historical audits remain unchanged.Author declaration
04b929ac609881d1104308e184c980e7af853b45.Scope and continuation
Complete within this repair's scope. Runtime change is one projection in the existing TypeScript owner, accompanied by focused extensions to existing provider and CLI regressions. No protocol vocabulary, schema version, provider selection, permission, default, migration, UI layout or configuration switch changes. The future-facing pass reuses the verified summary directly; no additional abstraction is needed.
Full hosted CI, installed-App adoption and the broader recovery/migration program retain their own qualification. This PR requests normal review; it does not claim merge authorization.
Validation
96a01cf0ef0bc2b6a6bfc6c7b407af4748c214e5.test_state_recovery.pyandtest_configuration_backup.py: 81 passed, no skips. Disposable real File/SQLite, Python 3.11.17 / SQLite 3.53.1; CLI/HTTP recovery after source loss, later writes and immutable saved audits.authority_backup,authority_archiveandstate_recoveryTS modules: 39 passed, no skips, Node 24.21.0. Actual interleaved append, missing source, forged summary and unchanged archive bytes.configuration-backupbrowser scenario passed separately for File and SQLite. Real isolated recovery backend, Chinese/English, keyboard, narrow viewport, damaged input and historical reload. Other workspace data uses the existing synthetic fixture.canary premerge --from-git-diff: 5 direct checks + 13 selected checks passed; zero failures, skips, timeouts, advisories or manual holds. Exact-head change-quality receipt valid; merge authority remains separate.An initial local bundle built before the runtime edit was rejected as stale, then rebuilt and verified before browser acceptance. The first standalone test typecheck omitted Node types under TypeScript 6; the corrected invocation passes. These setup failures are preserved and are not attributed to product success.
Frontend / visual evidence
The existing Settings → Capability Center → Configuration backup and recovery → Full archive inspection journey now displays the original checkpoint in its existing collapsed details, including historical readback. No additional owner input, navigation, confirmation or visible control was added. The current composition and first viewport are unchanged; screenshots use synthetic data. Lark has no affected entrypoint. The tested packaged checkout is a proposal, not an installed update.
Change type