Skip to content

The agent that grows with you

fix(profiles): a stray dotfile no longer turns an owned category into a root

kshitijk4poor4db79e9fcba6
diff --git a/hermes_cli/profile_distribution.py b/hermes_cli/profile_distribution.py
index c5ec11f5785..51128fab99c 100644
--- a/hermes_cli/profile_distribution.py
+++ b/hermes_cli/profile_distribution.py
@@ -442,9 +442,12 @@ def _refuse_symlink(path: Path) -> None:
def _is_container(path: Path) -> bool:
- """A shipped directory holding no files other than its DESCRIPTION.md (a skills
- category) is a container of roots, not a root itself; a skill dir always holds SKILL.md."""
- return path.is_dir() and not any(p.is_file() and p.name != "DESCRIPTION.md" for p in path.iterdir())
+ """A shipped directory holding no files other than its DESCRIPTION.md and dotfiles
+ (``.DS_Store``, ``.gitkeep``) is a container of roots (a skills category), not a root
+ itself; a skill dir always holds SKILL.md."""
+ return path.is_dir() and not any(
+ p.is_file() and p.name != "DESCRIPTION.md" and not p.name.startswith(".") for p in path.iterdir()
+ )
def _merge_dir(src: Path, dest: Path, rel: Tuple[str, ...]) -> None:
diff --git a/tests/hermes_cli/test_profile_distribution.py b/tests/hermes_cli/test_profile_distribution.py
index 862574fca13..9c9dd70221f 100644
--- a/tests/hermes_cli/test_profile_distribution.py
+++ b/tests/hermes_cli/test_profile_distribution.py
@@ -472,6 +472,7 @@ class TestUpdate:
(staged / "skills" / "research" / "web-search").mkdir(parents=True)
(staged / "skills" / "research" / "web-search" / "SKILL.md").write_text("author skill\n", encoding="utf-8")
(staged / "skills" / "research" / "DESCRIPTION.md").write_text("research skills\n", encoding="utf-8")
+ (staged / "skills" / "research" / ".DS_Store").write_bytes(b"\0") # stray dotfile a macOS author ships
return staged, install_distribution(str(staged), name=name)
def test_an_owned_category_keeps_skills_the_installer_added_to_it(self, profile_env):