Repository navigation
fix(skills): harden duplicate skill retirement paths, deduplicate manifest reads, and eliminate Any - #9427
fix(skills): harden duplicate skill retirement paths, deduplicate manifest reads, and eliminate Any#9427hhyykk wants to merge 2 commits into
Conversation
…ifest reads, and eliminate Any Signed-off-by: Codex <codex@openai.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
[P2] 清单更新后,退役仍沿用旧的目标安装证明
在隔离目录中让目标安装清单在一次退役预览内换代。新清单只认证第一项,基线保留第二项,候选仍把第二项列入 would_retire。两份源技能都保留,未执行删除。 第 228 行把首次读取的当前清单复用到之后所有候选。工作流安装器释放目标安装锁后才调用退役,缓存没有覆盖发布新清单的边界。 让清单发布和退役共用现有安装锁,或在决定保留或删除前验证快照代际,观察到清单变化时重读或保留现有副本。保留 facade 的零清单读取快路径。 对应源码
动机 / Motivation
同一个主机能发现两处 skills 目录,安装器需要去重,同时保留仍然可用的替代副本。 基线逐项检查完整技能的目标清单,因此每项决策会看到当时已发布的安装证明。 稳定清单的计划一致。换代时基线保留本轮缺少安装证明的副本,候选仍计划退役。 本轮核对安装清单、预览决定及两处可用副本。 适用依据
改动思路 / Approach
代码仍由既有文件所有者读取清单和两处技能树,识别命令 facade、已管理的完整技能和回读摘要,然后才输出计划或退役。 修复应落在现有清单读写和退役决定之间。 降低 IO 的快照方案要和当前安装代际绑定。 可用原子清单的单次快照降低读取,但要用同一提交边界保证之后的判断有效。给候选层叠加另一个独立清单所有者会增加冲突。 以调用真实安装路径的可用副本和结果回读为验收。稳定输入的 IO 数量不足以验证安装和退役重叠。
具体改动 / Changes
本轮精确 head b296c125c129a1c58039cef9146e5957338027fa。当前评审包基线 3347302d17195fc63fdb916f96fdd18fc00f0ebf,完整差异与源码验证以实际共同祖先 3347302d17195fc63fdb916f96fdd18fc00f0ebf 为准。新增测试覆盖同一清单的 IO 合并、路径拒绝和类型度量。本次另检验清单代际改变,原测试使用稳定清单。
- 稳定清单退役。本 PR 给替代路径增加守卫,收敛候选的重复查找和 facade 读入。稳定目标下,单次读取复用对照保持原退役计划。
- 换代后保留副本。退役完整技能前,资格应基于与替代副本对应的当前安装清单。
关键代码讲解
整份变更新增 184 行、删除 41 行,范围为技能安装回读和其 reconcile 测试。返回字典类型收窄,外层回执字段保持不变。 候选枚举保留排序并用集合去重。替代目录与主文件检查阻止危险路径。facade 分类保持单次读取。完整技能的分支首次加载目标清单,后续候选继续拿同一清单和实际目录哈希比较。安装器在释放目标锁之后才进入这个分支。
对主干的风险 / Risks
PASS。在相同的两份普通技能和不变清单上,基线和候选都只计划退役两项。两侧现有副本均未修改。 源码 premerge 6 项直接检查、8 项所选检查均通过。 技能发现、工作流安装、doctor 及宿主入口相关测试 140 通过、2 跳过。
FAIL。在隔离目录中让目标安装清单在一次退役预览内换代。新清单只认证第一项,基线保留第二项,候选仍把第二项列入 would_retire。两份源技能都保留,未执行删除。 以同一隔离树做稳定和换代对照,检查当前清单、基线与候选的计划及源文件保留。
语义与 CI 对齐
读取次数减少可保留。当前还缺少把该快照生命周期与安装代际关联的前置条件。 实测涵盖 macOS 上的隔离技能树、真实清单 writer 与预览。换代顺序由测试控制,未在安装中的用户 profile 执行删除,未查询远端 CI。
我的整体评价 / Verdict
请求修改。本 PR 给替代路径增加守卫,收敛候选的重复查找和 facade 读入。稳定目标下,单次读取复用对照保持原退役计划。 让清单发布和退役共用现有安装锁,或在决定保留或删除前验证快照代际,观察到清单变化时重读或保留现有副本。保留 facade 的零清单读取快路径。
English verdict: REQUEST_CHANGES at b296c12. The lazy manifest cache can keep scheduling a skill for retirement after a newer installation manifest no longer verifies its replacement.
|
Hi @hhyykk, the DCO If the log confirms a missing |
Goal And Delivered Outcome
Anytyping cleanup.loopx/skill_install_readback.pypreviously carried 14Anyannotations, re-read and re-parsedtarget/.loopx-skill-install.jsonon every non-facade candidate iteration insideretire_duplicate_managed_skills, readcandidate/SKILL.mdtwice per candidate for facade marker checks, deduplicatedcandidate_dirsvia linear list scans, and did not guard againsttarget/<skill>ortarget/<skill>/SKILL.mdsymlinking or resolving insidealternate/<skill>beforeshutil.rmtree(candidate).Nrich managed duplicate skills readtarget/.loopx-skill-install.jsonNtimes and read eachcandidate/SKILL.mdtwice during facade checks; a symlinked replacement resolving intoalternate/<skill>could delete the underlying copy;module_metrics("loopx/skill_install_readback.py")["any_count"]was14.target/.loopx-skill-install.jsonis lazily read at most once on the first non-facade replacement (0reads when all candidates are command facades), eachSKILL.mdis read once for facade classification, candidates whosetarget,replacement, orreplacement/SKILL.mdare symlinks or resolve intocandidateare safely skipped and preserved, andany_count/dict_any_countare0undermypy --strict. Proven bytests/test_skill_discovery_reconciliation.py.main.Author Declaration
Implemented against
loopx/skill_install_readback.pyatorigin/mainare the basis.Anyannotations inskill_install_readbackwhile preserving public return contractsloopx/skill_install_readback.pymypy --strict loopx/skill_install_readback.pyandtest_skill_install_readback_has_no_any_annotationsretire_duplicate_managed_skills,_read_target_skill_manifestinloopx/skill_install_readback.pytest_retirement_reads_target_manifest_lazily_onceintests/test_skill_discovery_reconciliation.pytarget,replacement, orreplacement/SKILL.mdis a symlink or resolves insidecandidate_replacement_paths_are_safeinloopx/skill_install_readback.pytest_retirement_skips_replacement_that_resolves_into_candidateintests/test_skill_discovery_reconciliation.pyany_count == 0anddict_any_count == 0, ranruff,mypy --strict, focused reconciliation and installation pytest suites, semantic vocabulary drift checks,loopx checkpublic-boundary scan,check_rfc_bilingual.py, andloopx canary premerge.Scope And Continuation
loopx/skill_install_readback.pyandtests/test_skill_discovery_reconciliation.py).Validation
b296c125c129a1c58039cef9146e5957338027fafinishedsynthetic,public_fixturestaticpassedruff check loopx/skill_install_readback.py tests/test_skill_discovery_reconciliation.py,mypy --strict loopx/skill_install_readback.py,module_metrics(any_count=0,dict_any_count=0),loopx checkpublic-boundary scan, andscripts/check_rfc_bilingual.py --base origin/main --head HEAD.unitpassedpytest -q tests/test_skill_discovery_reconciliation.py(21 passed), verifying lazy single-read manifest loading, single-read facade detection, symlink/nested-target preservation, and zero-Anymetrics.integrationpassedpytest -q tests/test_workflow_skill_install.py tests/test_doctor_install_freshness.py tests/test_install_source_git_provenance.py tests/test_project_skill_cli.py tests/test_ark_managed_agent_host.py tests/architecture/test_managed_slash_command_marker_owner.pyandloopx canary premerge --from-git-diff --git-diff-base origin/main.See validation disclosure guidance.
Frontend / Visual Evidence
nonenoneType of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
.loopx/,.codex/goals/, and liveACTIVE_GOAL_STATE.md).python3 scripts/check_rfc_bilingual.py --base origin/main --head HEADpasses, or no paired RFC changed.none.Signed-off-bytrailer (git commit -s).