Files
hermes-agent/tools
teknium1 ad80cb4e47 fix: collapse same-root duplicate skills only when provably the same skill
The same-root ranking added for #112179 was depth-only, so it silently
resolved any two skills sharing a bare name inside one search dir instead
of refusing: a shallower ~/.hermes/skills/evil/SKILL.md with `name: github`
shadowed software-development/github, and a hub package's nested
<pkg>/foo/SKILL.md won over the user's top-level legacy foo.md — the exact
shadowing shape the 'Ambiguous skill name' refusal exists for.

Gate the collapse on identity: candidates must share one resolved SKILL.md
(symlink view) or byte-identical content (copy). Different content keeps the
loud refusal, as on main. The log no longer labels the top-level file as
'nested'; the project-tier comment now says what still refuses there.

_log_security_warnings: drop the lexical is_relative_to escape. skill_view
only ever passes <search_dir>/... paths, so that escape made the resolved
'outside the trusted skills directory' warning unreachable — including for a
SKILL.md symlinked to a file outside every root, which is what it guards.
A symlink is quiet only when its target resolves under a registered dir.

Tests: the two PR tests that encoded the old behaviour are reshaped
(identical-copy collapse; symlink-into-registered-dir quiet), plus one
invariant per finding, each red on the pre-fix code.
2026-09-16 17:05:08 -07:00
..