Skip to content

fix(skills): discover_skills skips vendored and VCS directories - #215

Draft
napetrov wants to merge 1 commit into
intel:mainfrom
napetrov:fix/discover-skills-skip-vendored
Draft

napetrov wants to merge 1 commit into
intel:mainfrom
napetrov:fix/discover-skills-skip-vendored

Conversation

@napetrov

Copy link
Copy Markdown
Contributor

Summary

discover_skills walked every directory under the catalog root, including .git, node_modules, site-packages and virtualenvs. A dependency's copy of a skill there loaded as a skill of the catalog. If the copy differed by even one byte from the real skill, the mirror rule did not drop it, so the skill-catalog: arm offered two rival skills with the same name.

 dokimi/skills/loader.py   + VENDORED_DIR_NAMES; os.walk prunes them (not walked, no note)

Found while working on #211 (trigger-set formats).

Evidence

  • Before: a root with skills/linux-perf and node_modules/pkg/skills/linux-perf (a different version) gave two linux-perf skills.
    After: it gives one. The new cases are in tests/test_skill_loader.py: node_modules, .git/modules, and .venv/.../site-packages are skipped, and a root that itself sits inside node_modules is still walked.
  • The full suite passes locally (7786 passed), along with ruff and mypy.

Merge Danger

Door: two-way

Blast Radius: small. A catalog that keeps real skills under a directory named venv, .tox, site-packages or one of the others no longer loads them. These are directory names that would be odd for a skills tree.

🤖 Generated with Claude Code

A SKILL.md under .git, node_modules, site-packages, a virtualenv or
__pycache__ below the catalog root is a dependency's copy, not a skill
of the catalog; a differing version escaped the mirror rule and loaded
as a rival skill. Those directories are no longer walked.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.02%. Comparing base (09be35b) to head (4ee000b).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #215   +/-   ##
=======================================
  Coverage   92.01%   92.02%           
=======================================
  Files         223      223           
  Lines       27768    27777    +9     
  Branches     4563     4565    +2     
=======================================
+ Hits        25552    25561    +9     
  Misses       1570     1570           
  Partials      646      646           
Files with missing lines Coverage Δ
dokimi/dokimi/skills/loader.py 97.75% <100.00%> (+0.25%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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