refactor(skills): dedupe file-listing + share user-modified predicate (follow-up to #48286) - #48293
Merged
kshitijk4poor merged 1 commit intoJun 18, 2026
Conversation
… trim diff contract Cleanup pass on the salvage (behavior-preserving): - diff_bundled_skill now uses the existing _skill_file_list() helper instead of reimplementing the rglob/is_file/relative_to file-set enumeration inline (twice). - Extract _is_tracked_user_modification(origin_hash, user_hash) and use it in BOTH the sync loop and list_user_modified_bundled_skills() so the 'kept user edit' rule can't drift between the two sites. - _read_text_for_diff -> _read_for_diff returns (bytes, text); the binary branch now compares the bytes it already read instead of re-reading both files from disk. - Drop the unused 'user_present' key from diff_bundled_skill's return contract (no consumer or test ever read it). - test_update_modified_notice: drop the brittle '>= 2 sites' count-floor so consolidating the two print paths into a shared helper stays a welcome refactor; keep the per-site 'count notice => discovery hint' invariant (still mutation-tested).
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…-diff-cleanup refactor(skills): dedupe file-listing + share user-modified predicate (follow-up to NousResearch#48286)
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…-diff-cleanup refactor(skills): dedupe file-listing + share user-modified predicate (follow-up to NousResearch#48286)
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…-diff-cleanup refactor(skills): dedupe file-listing + share user-modified predicate (follow-up to NousResearch#48286)
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…-diff-cleanup refactor(skills): dedupe file-listing + share user-modified predicate (follow-up to NousResearch#48286)
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…-diff-cleanup refactor(skills): dedupe file-listing + share user-modified predicate (follow-up to NousResearch#48286)
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.
Summary
Cleanup follow-up to #48286 (
hermes skills list-modified/diff), which merged before these refactors landed. All changes are behavior-preserving — a/simplify-codepass over the salvage diff surfaced four small wins:_skill_file_list()diff_bundled_skill()reimplemented therglob→is_file→relative_to().as_posix()file-set enumeration inline (twice — once per side). The module already has_skill_file_list()doing exactly that; nowset(_skill_file_list(dest))/set(_skill_file_list(bundled_src))._is_tracked_user_modification(origin_hash, user_hash)and use it in both the sync loop andlist_user_modified_bundled_skills()so the "kept user edit" rule (has origin hash AND hash differs) can't drift between the two sites — directly serves AGENTS.md "extend, don't duplicate"._read_text_for_diff→_read_for_diffreturns(bytes, text); the binary-compare branch now reuses the bytes it already read instead of re-reading both files from disk.user_presentkey fromdiff_bundled_skill()'s return dict (no consumer or test ever read it).test_update_modified_noticedropped its>= 2 sitescount-floor (which would fail a welcome consolidation of the two print paths into a shared helper) while keeping the per-site "count notice ⇒ discovery hint" invariant — still mutation-tested.Verification
tests/tools/test_skills_sync.py+test_skills_list_modified_diff.py+tests/hermes_cli/test_update_modified_notice.py— 66 passed.bool(origin_hash)check is redundant-but-harmless there).Follow-up to #48286.