From bd575737641d7164716b596a0f3f3ae62c23733d Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Mon, 29 Jun 2026 10:30:37 -0700 Subject: [PATCH] =?UTF-8?q?fix(seedgo):=20audit=20always=20ignores=20.arch?= =?UTF-8?q?ive/=20=E2=80=94=20full=20stop=20(Patrick=20directive)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit readme_check.py: _count_test_functions now skips any path with a SOURCE_SKIP_DIRS segment (.archive) — root cause of the local-vs-CI test-count mismatch (daemon counted 486 local incl archived dead tests vs 300 in CI clean checkout). test_quality_check.py: _find_test_files_broad replaced __pycache__-only skip with _should_skip_dir() on all path parts. Daemon 486→300, audit 100%, 17-branch audit zero regressions. CI-neutral (clean checkout has no .archive). Fix by @seedgo, verified by devpulse. --- .../seedgo/apps/handlers/aipass_standards/readme_check.py | 4 +++- .../apps/handlers/aipass_standards/test_quality_check.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aipass/seedgo/apps/handlers/aipass_standards/readme_check.py b/src/aipass/seedgo/apps/handlers/aipass_standards/readme_check.py index 5f6aa521..f691dc28 100644 --- a/src/aipass/seedgo/apps/handlers/aipass_standards/readme_check.py +++ b/src/aipass/seedgo/apps/handlers/aipass_standards/readme_check.py @@ -30,7 +30,7 @@ from typing import Dict, List, Optional from aipass.prax import logger from aipass.seedgo.apps.handlers.json import json_handler from aipass.seedgo.apps.handlers.bypass.utils import is_bypassed -from aipass.seedgo.apps.handlers.aipass_standards.skip_dirs import is_disabled_file +from aipass.seedgo.apps.handlers.aipass_standards.skip_dirs import SOURCE_SKIP_DIRS, is_disabled_file # Audit scope: entry points only (apps/{name}.py) AUDIT_SCOPE = "entry_point" @@ -505,6 +505,8 @@ def _count_test_functions(tests_dir: Path) -> int: count = 0 test_func_pattern = re.compile(r"^\s*def\s+test_", re.MULTILINE) for test_file in tests_dir.rglob("test_*.py"): + if any(part in SOURCE_SKIP_DIRS for part in test_file.relative_to(tests_dir).parts): + continue if is_disabled_file(test_file.name): continue try: diff --git a/src/aipass/seedgo/apps/handlers/aipass_standards/test_quality_check.py b/src/aipass/seedgo/apps/handlers/aipass_standards/test_quality_check.py index 2735b4ba..c627cde0 100644 --- a/src/aipass/seedgo/apps/handlers/aipass_standards/test_quality_check.py +++ b/src/aipass/seedgo/apps/handlers/aipass_standards/test_quality_check.py @@ -195,7 +195,7 @@ def _find_test_files_broad(branch_path: Path) -> list[Path]: for py_file in sorted(tests_dir.rglob("*.py")): if py_file.name in ("__init__.py", "conftest.py"): continue - if "__pycache__" in py_file.parts: + if any(_should_skip_dir(part) for part in py_file.relative_to(tests_dir).parts): continue resolved = py_file.resolve() if resolved not in seen: