diff --git a/src/aipass/aipass/apps/handlers/structure_scan/structure_scanner.py b/src/aipass/aipass/apps/handlers/structure_scan/structure_scanner.py index be1b2092..7685e165 100644 --- a/src/aipass/aipass/apps/handlers/structure_scan/structure_scanner.py +++ b/src/aipass/aipass/apps/handlers/structure_scan/structure_scanner.py @@ -93,7 +93,7 @@ def find_project_root(start: Path) -> Optional[Path]: # ============================================================================= -_SCAN_SKIP_DIRS = {".archive", ".venv", ".git", "__pycache__", "node_modules", ".chroma"} +_SCAN_SKIP_DIRS = {".archive", ".backup", ".venv", ".git", "__pycache__", "node_modules", ".chroma", "templates"} def scan_agents(project_root: Path) -> List[AgentInfo]: @@ -286,12 +286,15 @@ def detect_pollution(agents: List[AgentInfo]) -> List[PollutionHit]: def check_registry_consistency( registry_path: Path, agents: List[AgentInfo], + project_root: Optional[Path] = None, ) -> List[RegistryIssue]: """Validate that registry branches[].path entries match actual filesystem. Returns: List of RegistryIssue for each problem found. """ + anchor = (project_root or registry_path.parent).resolve() + try: data = json.loads(registry_path.read_text(encoding="utf-8")) except (json.JSONDecodeError, OSError) as exc: @@ -309,7 +312,8 @@ def check_registry_consistency( issues.append(RegistryIssue(name, "", "missing")) continue - reg_path = Path(path_str).resolve() + p = Path(path_str) + reg_path = p.resolve() if p.is_absolute() else (anchor / p).resolve() if not reg_path.exists(): issues.append(RegistryIssue(name, path_str, "missing")) elif str(reg_path) not in agent_paths: diff --git a/src/aipass/aipass/apps/modules/doctor.py b/src/aipass/aipass/apps/modules/doctor.py index b74ff049..260669a0 100644 --- a/src/aipass/aipass/apps/modules/doctor.py +++ b/src/aipass/aipass/apps/modules/doctor.py @@ -670,7 +670,7 @@ def _check_structure() -> List[CheckResult]: # Registry consistency reg_path = _discover_registry(start_path=project_root) if reg_path and reg_path.exists(): - reg_issues = check_registry_consistency(reg_path, agents) + reg_issues = check_registry_consistency(reg_path, agents, project_root=project_root) if reg_issues: for issue in reg_issues: glyph = GLYPH_FAIL if issue.problem == "missing" else GLYPH_WARN @@ -686,7 +686,7 @@ def _check_structure() -> List[CheckResult]: root_hits = check_root_artifacts(project_root) if root_hits: for hit in root_hits: - glyph = GLYPH_WARN if hit.severity == "warn" else GLYPH_PASS + glyph = GLYPH_PASS if hit.severity == "pass" else GLYPH_WARN results.append(CheckResult(f"root: {hit.name}", glyph, hit.description, "")) else: results.append(CheckResult("root artifacts", GLYPH_PASS, "none misplaced", ""))