fix(aipass): doctor stops inventing errors on clean repos — S304 F14-17. .backup+templates excluded from agent scan; relative registry paths anchored to project_root not CWD (killed 5 fake missing-branch errors from branch dirs); severity-honest glyphs (info != PASS). Devpulse live-verified from devpulse dir: zero false registry errors, 1 remaining error is genuine ptest pollution. 756 tests. DPLAN-0250 Track A, dispatched to @aipass

This commit is contained in:
AIOSAI
2026-07-19 02:55:45 -07:00
parent 8cb3895264
commit c91cfd5166
2 changed files with 8 additions and 4 deletions
@@ -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:
+2 -2
View File
@@ -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", ""))