From 50b28fe561d7059a016b58b26faf695c2caf51d0 Mon Sep 17 00:00:00 2001 From: yusyus Date: Mon, 2 Feb 2026 22:11:38 +0300 Subject: [PATCH] fix: Framework detection, circular deps, and GDScript test discovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FIXES: 1. Framework Detection (Unity → Godot) PROBLEM: Detected Unity instead of Godot due to generic "Assets" marker - "Assets" appears in comments: "// TODO: Replace with actual music assets" - Triggered false positive for Unity framework SOLUTION: Made Unity markers more specific - Before: "Assets", "ProjectSettings" (too generic) - After: "Assembly-CSharp.csproj", "UnityEngine.dll", "Library/" (specific) - Godot markers: "project.godot", ".godot", ".tscn", ".tres", ".gd" FILE: architectural_pattern_detector.py line 92-94 2. Circular Dependencies (Self-References) PROBLEM: Files showing circular dependency to themselves - WARNING: Cycle: analysis-config.gd -> analysis-config.gd - 3 self-referential cycles detected ROOT CAUSE: No self-loop filtering in build_graph() - File resolves class_name to itself - Edge created from file to same file SOLUTION: Skip self-dependencies in build_graph() - Added check: `target != file_path` - Prevents file from depending on itself FILE: dependency_analyzer.py line 728 3. GDScript Test File Detection PROBLEM: Found 0 test files (expected 20 GUT tests with 396 tests) - TEST_PATTERNS missing GDScript patterns - Only had: test_*.py, *_test.go, Test*.java, etc. SOLUTION: Added GDScript test patterns - Added: "test_*.gd", "*_test.gd" (GUT, gdUnit4, WAT) - Added ".gd": "GDScript" to LANGUAGE_MAP FILES: - test_example_extractor.py line 886-887 - test_example_extractor.py line 901 IMPACT: - ✅ Godot projects correctly detected as "Godot" (not Unity) - ✅ No more false circular dependency warnings - ✅ GUT/gdUnit4/WAT test files now discovered and analyzed - ✅ Better test example extraction for Godot projects Co-Authored-By: Claude Sonnet 4.5 --- src/skill_seekers/cli/architectural_pattern_detector.py | 4 ++-- src/skill_seekers/cli/dependency_analyzer.py | 3 ++- src/skill_seekers/cli/test_example_extractor.py | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/skill_seekers/cli/architectural_pattern_detector.py b/src/skill_seekers/cli/architectural_pattern_detector.py index 54bae0e..a41af6a 100644 --- a/src/skill_seekers/cli/architectural_pattern_detector.py +++ b/src/skill_seekers/cli/architectural_pattern_detector.py @@ -89,9 +89,9 @@ class ArchitecturalPatternDetector: # Framework detection patterns FRAMEWORK_MARKERS = { # Game Engines (checked first to avoid false positives) - "Unity": ["Assembly-CSharp", "UnityEngine", "Assets", ".unity", "ProjectSettings"], + "Unity": ["Assembly-CSharp.csproj", "UnityEngine.dll", "ProjectSettings/ProjectVersion.txt", ".unity", "Library/"], "Unreal": ["Source/", ".uproject", "Config/DefaultEngine.ini", "Binaries/", "Content/"], - "Godot": ["project.godot", ".godot", "scenes/", ".tscn", ".gd"], + "Godot": ["project.godot", ".godot", ".tscn", ".tres", ".gd"], # Web Frameworks "Django": ["django", "manage.py", "settings.py", "urls.py"], "Flask": ["flask", "app.py", "wsgi.py"], diff --git a/src/skill_seekers/cli/dependency_analyzer.py b/src/skill_seekers/cli/dependency_analyzer.py index 1365885..a3b29c9 100644 --- a/src/skill_seekers/cli/dependency_analyzer.py +++ b/src/skill_seekers/cli/dependency_analyzer.py @@ -724,7 +724,8 @@ class DependencyAnalyzer: # Try to resolve the imported module to an actual file target = self._resolve_import(file_path, dep.imported_module, dep.is_relative) - if target and target in self.file_nodes: + # Skip self-dependencies (file depending on itself) + if target and target in self.file_nodes and target != file_path: # Add edge from source to dependency self.graph.add_edge( file_path, target, import_type=dep.import_type, line_number=dep.line_number diff --git a/src/skill_seekers/cli/test_example_extractor.py b/src/skill_seekers/cli/test_example_extractor.py index 282673e..7763bb9 100644 --- a/src/skill_seekers/cli/test_example_extractor.py +++ b/src/skill_seekers/cli/test_example_extractor.py @@ -883,6 +883,8 @@ class TestExampleExtractor: "Test*.cs", "*Test.php", "*_spec.rb", + "test_*.gd", # GUT, gdUnit4, WAT test files + "*_test.gd", ] # Language detection by extension @@ -896,6 +898,7 @@ class TestExampleExtractor: ".cs": "C#", ".php": "PHP", ".rb": "Ruby", + ".gd": "GDScript", } def __init__(