fix(skills): prefer GitHub repo skill for owner/repo installs - #52499
fix(skills): prefer GitHub repo skill for owner/repo installs#52499addelh wants to merge 2 commits into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting a current resolver gap: on current main, hermes_cli/skills_hub.py:126-151 walks sources in order, while tools/skills_hub.py:638-640 makes a bare owner/repo impossible for GitHubSource to fetch directly.
Problems
hermes_cli/skills_hub.py:142matches every two-segment identifier, not only unqualified GitHub repositories. This includes explicit source-qualified forms such asofficial/<skill>.tools/skills_hub.py:4066-4077registersofficialas a source, but the new preflight would query GitHub forofficial/<skill>first, contradicting the docstring's claim that explicit registry identifiers are unchanged. It also creates avoidable GitHub API/rate-limit work and can change source selection if a matching GitHub repository exists.
Suggested changes
- Exempt configured source prefixes from the bare-GitHub resolver and add a regression test proving
official/<skill>bypasses_get_repo_treeand resolves through its intended source.
Automated hermes-sweeper review.
| GitHub repo, while leaving short names and explicit registry identifiers | ||
| unchanged. | ||
| """ | ||
| if not _GITHUB_REPO_IDENTIFIER_RE.match(identifier): |
There was a problem hiding this comment.
This also matches explicit source-qualified identifiers such as official/<skill> and clawhub/<skill>. Since the preflight runs before the normal router, those installs now probe GitHub first and can be hijacked by a matching GitHub repository. Exclude registered source prefixes here and add a regression test for official/<skill>.
There was a problem hiding this comment.
Fixed in 81c2cbf13. The bare owner/repo preflight now skips any identifier whose first segment matches a registered source ID, so explicit routes such as official/<skill> and clawhub/<skill> stay with the normal source router. Added a regression test that asserts official/<skill> never calls GitHub _get_repo_tree and resolves through the official source. Rebased onto current main; focused resolver tests pass (6 passed) and Ruff/diff checks are clean.
81c2cbf to
212dbf6
Compare
|
Rebased onto current The rebase preserves upstream's junction-install fix from
Validation:
|
212dbf6 to
5967978
Compare
|
Rebased onto current Validation on exact clean head
The contributor branch was safely force-updated with an explicit fresh lease. |
Summary
Fixes source resolution for bare GitHub repo skill installs such as:
When the user passes an explicit
owner/repoidentifier, Hermes should first inspect that GitHub repository and install its canonical runtime skill when it can be resolved unambiguously. Before this change, the resolver walked registries in order and could fetch a stale registry alias before the current GitHub repo, even though the user typed a GitHub-shaped identifier.What changed
owner/repoidentifiers, inspect the GitHub repo tree and resolve to:*/SKILL.mdif there is exactly one, or-skill/-skillssuffix stripping.skills/<name>/SKILL.md.Investigation details
This came from debugging
mvanhorn/last30days-skillon a live Hermes install.Current upstream Last30Days has scanner-ignore PRs merged:
mvanhorn/last30days-skill#526— addsskills/last30days/.skillignoremvanhorn/last30days-skill#656— adds/expands repo-root.skillignoreThose PRs reduce dev/docs/test noise, but they explicitly do not make the skill installable under Hermes' current community-skill policy. PR #656's body still reports:
There was also a separate resolver problem: running the creator-documented install command fetched from
ClawHubSourceinstead of the current GitHub runtime skill.Before this patch, programmatic resolution of
mvanhorn/last30days-skillproduced:After this patch, the same identifier resolves to the GitHub runtime skill:
Important caveat: this PR fixes the stale-source/alias-shadowing bug only. Last30Days direct install is still blocked by the scanner after resolving to the correct GitHub skill because required runtime files and
SKILL.mdstill trigger dangerous findings under current policy:So this is not claiming to make Last30Days install successfully by itself. It makes Hermes fetch the right package before the scanner makes its decision, which is necessary for the scanner-ignore work in skill repos to matter.
Tests