Repository navigation
fix(update): bound lineage comparison metadata without patches - #8006
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; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; runtime_reported; observation_id=538b775caf684feb0505d4f4aa3a6cec7dba5f5e6596e7c8a4e473752000e880
Exact head 965469acd13c602c8777907cf5343388e7666f5c;review base/merge base 477df45d9036414a4a7f5a558ef2ef1e38e08c75。没有发现本 PR 的阻断问题。
动机 / Motivation
通过 runtime 快照检查更新的操作者,以及尚未安装 LoopX 时运行独立 bootstrap 的用户。 GitHub comparison 的第一页包含文件 patch;当差异较大,256 KiB 的 metadata 上限会把本来更新的目标识别为 unknown,用户被错误地要求手动检查血缘或放行。 改为读取每页一个 commit 的第二页,保留比较关系且避开第一页文件列表;真实 HTTP 与独立 bootstrap 能确认 ahead,behind、diverged、无效和超限响应仍被拒绝。 范围仅限更新血缘的 metadata 读取;不提高大小限制,不新增配置或权限,不执行真实宿主安装、升级或激活。
改动思路 / Approach
这是安装 provider 的 bootstrap IO,必须能在 LoopX/Node 尚未可用时独立运行;沿用现有 Python transport 和血缘判断,不新增 TypeScript 决策 owner。 当前边界只改善目标血缘解析并保留原下载/校验/降级策略;独立入口到故意损坏归档的校验拒绝已验证,真实安装与激活不在本次执行范围。 No change reproduces false unknown. Raising256KiB limit would download irrelevant patches and weaken existing cap; parsing after full transfer does not save bytes. Existing provider needs only one paginated URL change. 正向路径与拒绝分支沿用已有公开入口,author 的测试声明没有替代本轮执行。没有新增人工准备、复制或确认轮次;原本需要明确授权的动作仍由既有 owner 决定。
具体改动 / Changes
全部2个文件 +38/-1:生产改动是 comparison URL 的 per_page=1&page=2 及原因注释,测试新增真实 HTTP 三种 relation 和原 cap 的负例。没有改变 metadata cap、TLS/credential 来源规则、checksum、签名、owner、downgrade 或 activation 检查。没有已接受的书面 repository specification;依据是重现缺陷、独立入口对照和 GitHub 官方 comparison pagination 文档,未虚构 RFC 验收。
GitHub primary API contract 说明分页的文件列表仅在第一页返回;本轮另外读取不可变 forward/reverse comparison 验证 page2 在 commits=[] 时仍携带 ahead/behind。forward 为19518→10620 bytes,reverse 为9933→9922 bytes,均未在第二页返回 files。没有沿用作者其他比较的字节数作为本轮实测。
关键代码讲解
target_direction:保持 identical 快路径、SHA 校验和 unknown 回退,只把 comparison 请求改到第二页,血缘仍由原四值 allowlist 判断。
read_json:原有 bounded reader 保留256 KiB上限、credential-free URL 和规范化错误;读取 MAX_MANIFEST+1 后才解析 JSON,超限绝不放行。
main:沿已安装 source 与 manifest 解析目标;只有 ahead/identical 可以进入下载,其余关系走原降级保护,本次实际在 integrity guard 停止。
对主干的风险 / Risks
五个相关模块在 base111 PASS/3 SKIP,head115 PASS/3 SKIP;三个 skip 未改称通过。独立导出的 bootstrap 在 python -I 下执行原 main,只有 URL transport 重定向到真实 loopback HTTP,未导入 LoopX。相同7种状态 base6 PASS/1 ahead FAIL,head7 PASS。ahead/identical 进入真实下载后被故意错误归档触发 integrity_mismatch,before installer 拒绝;behind/diverged/unexpected/overcap/HTTP503 在下载前拒绝。相同 SHA 不发 comparison。标准 premerge 6 direct +10 selected PASS、0 failure/hold。
page2 的单个 commit metadata 仍可能超限或 unavailable,当前继续 unknown,不能声称任意 comparison 都有恒定大小。metadata 上限保持256 KiB;此修复也不把 GitHub 可达或元数据存在当成安装许可。作者所说整体实际升级未由本轮执行;这里用真正的校验失败终止下载路径,保证 installer 不执行。最初 reviewer oracle 使用 checksum/digest 的非正式字词,但原 guard 返回 integrity_mismatch;纠正为已有正式诊断后冻结同一 base/head 脚本,保留该失败。
CI 按 wait_for_ci=false 未查询、轮询或等待。实际 PR merge base 是 477df45d9036414a4a7f5a558ef2ef1e38e08c75,目标 main 的快照为 5f1a9d78ba7aca48ae2203425b252b6882ba3c15;diff 与 premerge 使用前者,未把 main 的其他提交混入本 PR。
我的整体评价 / Verdict
交付判断 goal_achieved,long_horizon 与 user_experience 在本次可验证边界内 improved:解除已重现的错误拒绝,保留合法恢复与失败保护。这是安装 provider 的 bootstrap IO,必须能在 LoopX/Node 尚未可用时独立运行;沿用现有 Python transport 和血缘判断,不新增 TypeScript 决策 owner。 当前边界只改善目标血缘解析并保留原下载/校验/降级策略;独立入口到故意损坏归档的校验拒绝已验证,真实安装与激活不在本次执行范围。 scope fit 与改动成本相称,未发现需要在本 PR 扩大重构的相邻 owner。没有新增 UI、renderer 或页面内容;检查路径为更新计划和独立 bootstrap 的 HTTP metadata 读取,visual review 不适用。 未执行真实宿主安装、升级、激活或模型调用;第二页单个 commit metadata 本身仍可能超过上限,此时明确保持 unknown。3 个平台相关 skip 不算通过。 现有 review/required validation、平台 readiness 与 merge 授权仍分别判断,本轮不 merge。
English verdict: APPROVE. At 965469acd13c602c8777907cf5343388e7666f5c, the same public-entry baseline/head differential demonstrates the bounded fix while negative authority/integrity and retry controls remain intact. Installed-host/model adoption is unverified; local required checks pass.
Goal and delivered behavior
Large GitHub comparisons can make a newer runtime look unverified: the updater's bounded metadata reader also downloads the first page's changed-file patches. Keep the existing metadata limit and request one later comparison page, which preserves the relation without that file list.
No written specification; the reproduced failure and GitHub's comparison pagination contract are the basis. The existing installation provider owns this bootstrap I/O; no new capability, permission, configuration or TypeScript decision owner is introduced.
Written by: model_agent — OpenAI Codex (GPT-6 family).
target_direction; real loopback HTTP cases for ahead, behind and divergedValidation
Tested head:
965469acd. Source changes are complete; independent review and merge remain separate.Scope is complete for this bootstrap read. Bounded refactoring: kept the existing transport owner; no additional abstraction is needed. UI impact: none. No App installation, model execution, CI polling, approval or merge is performed by this proposal.