feat: Complete Unity/game engine support and local source type validation

Completes the implementation for Unity/Unreal/Godot game engine support
and adds missing "local" source type validation.

Changes:
- Add "local" to VALID_SOURCE_TYPES in config_validator.py
- Add _validate_local_source() method with full validation
- Add Unity/Unreal/Godot to FRAMEWORK_MARKERS for priority detection
- Add game engine directory exclusions to all 3 scrapers:
  * Unity: Library/, Temp/, Logs/, UserSettings/, etc.
  * Unreal: Intermediate/, Saved/, DerivedDataCache/
  * Godot: .godot/, .import/
- Prevents scanning massive build cache directories (saves GBs + hours)

This completes all features mentioned in PR #278:
 Unity/Unreal/Godot framework detection with priority
 Pattern enhancement performance fix (grouped approach)
 Game engine directory exclusions
 Phase 5 SKILL.md AI enhancement
 Local source references copying
 "local" source type validation
 Config field name compatibility
 C# test example extraction

Tested:
- All unified config tests pass (18/18)
- All config validation tests pass (28/28)
- Ready for Unity project testing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-02-02 21:06:01 +03:00
parent 03ac78173b
commit 32e080da1f
5 changed files with 104 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ class ConfigValidator:
"""
# Valid source types
VALID_SOURCE_TYPES = {"documentation", "github", "pdf"}
VALID_SOURCE_TYPES = {"documentation", "github", "pdf", "local"}
# Valid merge modes
VALID_MERGE_MODES = {"rule-based", "claude-enhanced"}
@@ -143,6 +143,8 @@ class ConfigValidator:
self._validate_github_source(source, index)
elif source_type == "pdf":
self._validate_pdf_source(source, index)
elif source_type == "local":
self._validate_local_source(source, index)
def _validate_documentation_source(self, source: dict[str, Any], index: int):
"""Validate documentation source configuration."""
@@ -209,6 +211,34 @@ class ConfigValidator:
if not Path(pdf_path).exists():
logger.warning(f"Source {index} (pdf): File not found: {pdf_path}")
def _validate_local_source(self, source: dict[str, Any], index: int):
"""Validate local codebase source configuration."""
if "path" not in source:
raise ValueError(f"Source {index} (local): Missing required field 'path'")
# Check if directory exists
local_path = source["path"]
if not Path(local_path).exists():
logger.warning(f"Source {index} (local): Directory not found: {local_path}")
elif not Path(local_path).is_dir():
raise ValueError(f"Source {index} (local): Path is not a directory: {local_path}")
# Validate analysis_depth if provided
if "analysis_depth" in source:
depth = source["analysis_depth"]
if depth not in self.VALID_DEPTH_LEVELS:
raise ValueError(
f"Source {index} (local): Invalid analysis_depth '{depth}'. Must be one of {self.VALID_DEPTH_LEVELS}"
)
# Validate ai_mode if provided
if "ai_mode" in source:
ai_mode = source["ai_mode"]
if ai_mode not in self.VALID_AI_MODES:
raise ValueError(
f"Source {index} (local): Invalid ai_mode '{ai_mode}'. Must be one of {self.VALID_AI_MODES}"
)
def _validate_legacy(self) -> bool:
"""
Validate legacy config format (backward compatibility).