Repository navigation
Preserve Desktop runtime outputs when qualification fails - #9105
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.2-sol · OpenAI (runtime_reported, max)
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 打包取消会丢掉可恢复的上一归档
把已支持的默认契约作为对照输入,在候选替换归档后、替换身份前向隔离打包进程发送 SIGINT。KeyboardInterrupt 越过 OSError 恢复,旧身份和新归档留在输出目录,临时目录清理掉旧归档。 让发布恢复覆盖常规取消,并在恢复尚未成功时保留可重试的旧归档。根据身份已否提交决定恢复,避免中断恰在身份替换后时反向错配。 相关代码
动机 / Motivation
Desktop Main 和 Stable 打包会消费同一对 runtime-source.tar.gz 与 identity.json。 主干从完整包观察到 complete_turn 并拒绝,但此时前一归档已丢失,仅旧身份保留。 同样的完整包解包得到 4,691 个文件,包括按提交构建的 36 个前端交付文件。实际默认观察同为 complete_turn,候选拒绝后两个旧文件逐字节保留。 本次观察范围是打包输出和既有发布门,C1 默认资格仍由发布约定独立决定。
改动思路 / Approach
将 Git 归档、前端源验证、完整解包和默认观察放到候选暂存区,符合现有 Desktop 打包入口的职责。提交双文件还需要可恢复的边界。保留两个既有资源路径和共享默认契约校验,只在 Desktop 构建交付边界处理候选和失败恢复。成功对照重新计算了完整归档的摘要,并核对了归档内前端 manifest 和包版本。实际默认观察按原契约被拒绝。
具体改动 / Changes
精确 head 0d005abb244abc889e84c1d22f544f7360b07b58,diff base 8e9a28a866da06cc6fd63e78709910fe35dad564,2 个文件 +160/-22。逐项复核 提交源码资格、身份与产物绑定。验收约定
关键代码讲解
- 候选在真实默认拒绝前对旧归档和身份仅做读回。两份包都走到完整解包。源码
- 支持条件对照发布 5,081 个归档项,身份的提交、版本和摘要与归档一致。源码
- 现有测试注入 OSError,验证这一错误的回滚。源码
- 构建仍按 Git 提交归档,前端 manifest 包含该提交,前端输入摘要逐项对照提交树。归档重建与身份生成都在当前交付目录的同文件系统内完成。源码
对主干的风险 / Risks
31 项 Desktop unittest、34 项运行时快照 pytest、5 项直接及 2 项选中标准预合并检查通过。 macOS 跑过两侧完整解包和候选发布对照。发布成功对照只替换了契约观察返回值,候选实际默认仍被拒绝。签名 App 装包、Windows 及部署资格待验。
语义与 CI 对齐
相同构建入口的主干和候选返回完全相同的资格拒绝。候选修复拒绝前覆盖;发布阶段的中断在独立阳性控制后复现。
我的整体评价 / Verdict
保留资格优先的设计。请补发布中断恢复与读回,确保旧身份仍有效时上一归档可恢复。验收应包含身份提交前取消,以及恢复受阻后旧归档仍可供下一次构建使用。
English verdict: REQUEST_CHANGES. Full archives confirm that actual default-contract rejection preserves both prior outputs on this head. The supported control verifies archive identity. SIGINT before identity replacement deletes the prior archive, leaving a mismatched pair.
| try: | ||
| archive.replace(target_archive) | ||
| identity.replace(destination / identity.name) | ||
| except OSError: |
There was a problem hiding this comment.
归档替换后、身份替换前的 SIGINT 会抛出 KeyboardInterrupt。这里的 OSError 分支未接管,外层清理随即删除旧归档。请增加独立取消回归,并在身份已否提交可判定前保住旧归档。
Problem
The Desktop packager replaces its runtime archive before checking the archived default contract. When qualification rejects the candidate, the output directory can contain the new archive and the previous identity. A local build retry then starts with an inconsistent pair.
Change
Validation
8e9a28a866da.8e9a28a866daand candidate0d005abb244ain an isolated memory volume, with the frontend built at each revision. Each run began with the archive and identity extracted from the checksum-verified v2.3.0 macOS distribution. Both builds reached the same C1 contract refusal. Main replaced the previous archive and left its identity pointing to a different SHA-256. The candidate preserved both previous files byte for byte and cleaned its temporary output. Independent review is pending.