Skip to content

fix(skills): keep installed repair lookup read-only - #7235

Merged
loopx-agent merged 1 commit into
mainfrom
codex/repair-lookup-readonly-20261024
Oct 24, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/repair-lookup-readonly-20261024

Conversation

@BigDataDZ

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

An ordinary installed self-repair pattern lookup writes a scorer bytecode cache into the managed skill directory. That changes the installation digest: subsequent readback reports skill_digest_mismatch, and uninstall preserves the untouched skill as if the user had modified it.

Execute the bundled scorer source in its existing module namespace without invoking the bytecode-writing loader. Query results and module metadata remain intact. Strict tree hashing and protection of genuinely modified files stay unchanged.

Author Declaration

  • Written by: model_agent (OpenAI Codex), under the author's direction.
  • Implemented against: installed workflow skill readback/uninstall and the standalone lookup contract at 7c48375df5aa4824c8d6fba0baef1f96de6cc87e; the reproduced install/use/uninstall defect is the outcome basis. Intended base: main.
  • Criteria: documented query and ID lookup leave the installed tree unchanged; readback remains ready; clean uninstall succeeds; genuine user modifications remain protected. All implemented at the existing bundled Python lookup loader, with no cache exception in the hash owner.

Validation

Tested revision: e748b5f42e6d5bf97ffb0703570455fe9e736bf3. Run state: finished. Inputs: synthetic. Native Windows, CPython 3.12.10; disposable skills and real subprocesses.

  • The expanded real-install regression failed before repair: a successful isolated lookup increased the installed tree's file count and changed its digest.
  • tests/test_repair_pattern_lookup.py plus tests/test_workflow_skill_install.py: 45 passed with the repaired runtime. That run retained three pre-existing subprocess decoding warnings under UTF-8-mode testing.
  • After making the existing test's repository-text reads explicitly UTF-8 and its wheel paths portable, final native-encoding lookup validation with PYTHONUTF8=0: 15 passed, no warnings. This overlaps the combined suite above.
  • The real CLI journey installs skills, runs the installed query and ID lookup using isolated Python without LoopX on PATH, compares the complete installed tree hash, verifies ready readback, and cleanly uninstalls. Existing workflow tests retain genuine modified-file preservation.
  • Independent author-side inspection found no product blocker; its Windows test encoding finding was corrected and the full lookup module rerun. Ruff, whitespace, bilingual RFC diff check and public-boundary scan pass. The semantic advisory excludes skills/tests, so its empty result is not semantic coverage; manual inspection finds no new shared vocabulary.

Scope And Continuation

Complete within read-only lookup. The existing standalone stdlib-only Python loader is the nearest owner; preserving module metadata and compiling source bytes avoids a global interpreter flag or another loader abstraction. No Goal access, scoring change, new capability, CLI option, frontend or Lark operation is introduced.

The full repository suite, actual POSIX execution, wheel installation and installed live-host adoption were not run. Hosted CI and maintainer review remain pending; no approval or merge is claimed.

Signed-off-by: BigDataDZ <76271875+BigDataDZ@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max

Exact head: e748b5f42e6d5bf97ffb0703570455fe9e736bf3

动机

安装并使用自修复模式查询的用户和 Agent。 正常查询未编辑的已安装技能时,Python 不应在其目录写字节码,导致随后的完整性检查误报修改并让卸载错误保留它。修复后查询应保持目录不变,真正用户修改仍被保护。 独立安装、查询、检查和卸载闭环确认:旧加载器新增字节码、readback未就绪且错误保留干净技能;本头目录不变、检查就绪、干净卸载成功,真实编辑仍原字节保留。 范围是已有standalone查询加载器,不放宽文件摘要、不改变检索排序或修复权限;不认证wheel安装、原生Windows或实际宿主加载。

改动思路

在既有本地stdlib加载器中编译源码字节并执行到原模块namespace,保留spec/loader/file等元数据,同时不调用会写字节码的加载器。严格摘要和卸载保护仍归原owner,不增加忽略缓存的例外或全局解释器开关。 当前PR只修已安装模式查询的源码加载和对应真实安装回归,不新增能力、CLI参数、缓存系统或Goal访问。

实际安装后调用 旧加载器 本头
干净技能查询 生成pyc,摘要失配,卸载错误保留 目录不变、readback就绪、正常卸载
真正用户修改 原保护应保留 原字节保留,其他干净技能仍移除

比较的是实际安装、隔离Python查询及产品hash/readback/卸载,不是只看query是否返回成功。

具体改动

接受的修改前规格:docs/integrations/ego-source-reader.md,不可变版本 7c48375df5aa4824c8d6fba0baef1f96de6cc87e。clean-managed-uninstall 为 implemented:原契约要求卸载移除未修改的LoopX workflow skills,真实查询后头部目录仍未变化且可干净移除;modified-copy-preservation 为 implemented:原契约保护真实本地编辑,编辑后的自修复技能在查询、检查及卸载后原字节保留。另已读同一不可变版本的 skills/loopx-self-repair/references/pattern-lookup.md,核对standalone/stdlib、query/paging/full-ID和无Goal访问边界。源码加载方式是实现选择,正常使用导致误报修改是已复现的跨消费者缺口,不把作者新增清单当独立规格。

关键代码讲解

  • _scorer:existing module namespace now executes compiled source withoutpycwrite。在既有本地stdlib加载器中编译源码字节并执行到原模块namespace,保留spec/loader/file等元数据,同时不调用会写字节码的加载器。严格摘要和卸载保护仍归原owner,不增加忽略缓存的例外或全局解释器开关。

  • search_patterns:unchangedranking,exactmatch,matched/unmatchedterms andpaging。当前PR只修已安装模式查询的源码加载和对应真实安装回归,不新增能力、CLI参数、缓存系统或Goal访问。

  • hash_skill_tree:unchangedfulltreecontentoracle;nocacheexclusionintroduced。当前PR只修已安装模式查询的源码加载和对应真实安装回归,不新增能力、CLI参数、缓存系统或Goal访问。

  • _uninstall_managed_skills:unchangeddigest-basedremoveorretain,genuineeditsprotected。当前PR只修已安装模式查询的源码加载和对应真实安装回归,不新增能力、CLI参数、缓存系统或Goal访问。

完整审查2个路径 +22/-4,覆盖生产或安装加载路径、真实回归、未修改共享消费者和双语文档影响。没有新增共享状态词表、配置或并行authority,Python保留在原有只读投影/本地stdlib适配边界。

对主干的风险

原lookup与workflow两个模块在本头 45 passed。额外三条真实安装/use/readback/uninstall旅程比较旧源码、头部干净安装及头部真实编辑;每条运行7个隔离lookup进程,共 21次。query、分页、完整ID、未知ID、非法query和list的完整stdout/stderr/exit,以及模块name/package/spec/file/origin/loader/cache locator均相同;模块路径仅按各自隔离安装root作相同相对定位,原始完整路径与摘要私有留存。catalog与scorer字节完全相同,只有加载代码有意变化。

原加载器确新增scorer的pyc,使独立“树不变”oracle失败、readback未就绪,卸载把未编辑的自修复技能列入preserved_modified。头部干净目录不变、readback就绪,实际卸载无preserved项;头部编辑SKILL文件后查询仍不写目录,readback正确不就绪,卸载保留该技能的原字节并移除其他未改技能。没有让mock提供成功hash或卸载结果,也没有忽略缓存。fixture源码发现只提供不可变skill快照,安装/锁/hash/readback/卸载保持真实产品实现;常规源checkout安装另由45项原测试覆盖。

quick premerge 6直接+3选中检查通过。测试中的显式UTF-8读取和as_posix只修跨平台fixture路径表达,不改变生产检索算法或模式库。作者原生Windows45项和15项重叠运行声明不当成本轮Windows执行;本轮为macOS真实Python。wheel、原生Windows和已安装Agent加载尚未独立验证;wait_for_ci=false,本轮未查询或等待远程CI。

我的整体评价

未发现阻塞问题,APPROVE。局部结果为goal_achieved,long_horizon为preserved、user_experience为improved:普通查询不再把干净技能弄成“用户修改”。架构判断retain,原namespace内编译源码比全局开关或放宽摘要更合适;检索输出、元数据、真正编辑保护均有独立前后证据。持续净收益和实际宿主采用仍未资格。 在既有本地stdlib加载器中编译源码字节并执行到原模块namespace,保留spec/loader/file等元数据,同时不调用会写字节码的加载器。严格摘要和卸载保护仍归原owner,不增加忽略缓存的例外或全局解释器开关。 当前PR只修已安装模式查询的源码加载和对应真实安装回归,不新增能力、CLI参数、缓存系统或Goal访问。

检查了standalone CLI查询与安装/卸载readback;无页面、控件、布局或视觉素材改动,视觉评审不适用。 本轮是macOS实际Python与文件系统;原生Windows、wheel安装、实际Agent已加载与全仓套件未独立运行。源发现的fixture仅提供不可变skill字节,效果、hash/readback/卸载均走真实产品owner。 已通过、已失败与未测试范围分开保留;本轮没有合并、改个人安装或发起模型/外部消息。

English verdict: APPROVE at e748b5f42e6d5bf97ffb0703570455fe9e736bf3. Source compilation preserves standalone lookup outputs and module metadata while eliminating the reproduced bytecode mutation. Real installation/readback/uninstall and twenty-one isolated queries confirm clean removal and genuine-edit preservation. Native Windows, wheel installation and live loaded-skill adoption remain unverified.

@loopx-agent
loopx-agent merged commit f0def2f into main Oct 24, 2026
25 of 34 checks passed
@loopx-agent
loopx-agent deleted the codex/repair-lookup-readonly-20261024 branch October 24, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants