fix(curator): protect hub skills by frontmatter name - #20194
Merged
Conversation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Salvage of #19460 by @LeonSGP43 onto current main, plus a test follow-up.
Summary
_read_hub_installed_names()returned only hub slug keys (e.g."getnote"). When a hub-installed skill's SKILL.mdname:is non-ASCII (e.g."Get笔记"), the slug-only set didn't protect it, sohermes curator archive "Get笔记"and other curator operations would treat the hub skill as agent-created and archive it.Changes
tools/skill_usage.py: walk each hub lock entry'sinstall_path, resolve underskills/(with traversal guard), read the SKILL.mdname:, and add it to the off-limits set alongside the slug.tests/tools/test_skill_usage.py: regression test for thegetnote/Get笔记repro. Test follow-up addsmark_agent_created("my-skill")— the original cherry-picked test predates fix(skills): keep manual skills out of curator #19618/fix(curator): only mark agent-created for background-review sediment #19621, which rewrotelist_agent_created_skill_names()to require thecreated_by: "agent"provenance marker.Validation
scripts/run_tests.sh tests/tools/test_skill_usage.py→ 40 passedis_agent_created("Get笔记")→ False (was True)is_agent_created("getnote")→ False (unchanged)archive_skill("Get笔记")→ rejected with "bundled or hub-installed; never archive" (was archived)list_agent_created_skill_names()→ excludes hub, includes agent-authoredinstall_path: "../../../etc"silently skipped, no crashCloses #19641, #19293.
Credits: @LeonSGP43 for the fix.