Files
deer-flow/backend/packages/harness/deerflow/skills/package_paths.py
T
Ryker_FengandGitHub 41658c5ff4 feat(skills): add skill review quality gate (#4037)
* feat(skills): add skill review quality gate

* fix(skills): skip review eval fixtures in CI

* fix(skills): ignore review eval fixtures in bundled scans

* fix(skill-review): harden review gate boundaries

* fix(skills): address skill review gate feedback
2026-07-11 15:58:07 +08:00

25 lines
842 B
Python

"""Shared helpers for skill-package relative paths."""
from __future__ import annotations
from pathlib import PurePosixPath
def _parts(path: str | PurePosixPath) -> tuple[str, ...]:
return PurePosixPath(str(path).replace("\\", "/")).parts
def is_eval_fixture_path(path: str | PurePosixPath) -> bool:
"""Return whether a path is under an eval fixture directory."""
parts = _parts(path)
for index, part in enumerate(parts[:-1]):
if part == "evals" and len(parts) > index + 2:
return parts[index + 1] == "fixtures"
return False
def is_eval_fixture_skill_md(path: str | PurePosixPath) -> bool:
"""Return whether a path is an eval fixture's nested SKILL.md file."""
parts = _parts(path)
return bool(parts) and parts[-1] == "SKILL.md" and is_eval_fixture_path(PurePosixPath(*parts[:-1]))