From 668a0d6e93ce769e4fd72df5f53fad7e656143ea Mon Sep 17 00:00:00 2001 From: Fido Can Code <190991155+FidoCanCode@users.noreply.github.com> Date: Fri, 24 Apr 2026 17:48:31 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20sub=5Fdir=20default=20after=20kennel?= =?UTF-8?q?=E2=86=92fido=20package=20rename=20(closes=20#919)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `src/fido/config.py:114` was still computing `Path(__file__).resolve().parent.parent / "sub"`, which was correct when the Python package lived directly at the repo root (`kennel/`). After the move to `src/fido/` the package is one level deeper, so the relative walk now needs to go up one more directory to reach the repo-root `sub/` tree. Switches to `parents[2] / "sub"` and adds a regression test that the default `sub_dir` points at a real directory containing the five canonical sub-skill markdown files (persona/setup/task/ci/resume). The existing name-only test would have continued to pass with the broken path, so the new assertion is what catches the rename drift. --- src/fido/config.py | 2 +- tests/test_config.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/fido/config.py b/src/fido/config.py index cc0a0047..5911a7d2 100644 --- a/src/fido/config.py +++ b/src/fido/config.py @@ -111,5 +111,5 @@ def from_args(cls, argv: list[str] | None = None) -> Config: b.strip() for b in args.allowed_bots.split(",") if b.strip() ), log_level=args.log_level.upper(), - sub_dir=Path(__file__).resolve().parent.parent / "sub", + sub_dir=Path(__file__).resolve().parents[2] / "sub", ) diff --git a/tests/test_config.py b/tests/test_config.py index d3a7b921..d93ca33d 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -140,6 +140,32 @@ def test_sub_dir_points_to_package_parent(self, tmp_path: Path) -> None: ) assert cfg.sub_dir.name == "sub" + def test_sub_dir_resolves_to_real_skill_files(self, tmp_path: Path) -> None: + """The default sub_dir must point at the actual sub/ directory at + the repo root, containing the canonical sub-skill markdown files. + + Regression test for #919: a leftover ``parent.parent`` from the + kennel→fido rename made the default path ``src/sub`` instead of + ``sub``, which passed unit tests that only checked the directory + name but failed preflight at boot time. + """ + secret_file = tmp_path / "secret" + secret_file.write_text("s") + repo_dir = tmp_path / "repo" + repo_dir.mkdir() + cfg = Config.from_args( + [ + "--secret-file", + str(secret_file), + f"owner/repo:{repo_dir}:claude-code", + ] + ) + assert cfg.sub_dir.is_dir(), f"default sub_dir {cfg.sub_dir} does not exist" + for name in ("persona.md", "setup.md", "task.md", "ci.md", "resume.md"): + assert (cfg.sub_dir / name).is_file(), ( + f"expected sub-skill {name} under {cfg.sub_dir}" + ) + def test_repo_provider_parses_from_args(self, tmp_path: Path) -> None: secret_file = tmp_path / "secret" secret_file.write_text("s")