fix: C3.5 immediate bug fixes for production readiness

Fixes 3 critical issues found during FastMCP real-world testing:

1. **C3.4 Config Extraction Parameter Mismatch**
   - Fixed: ConfigExtractor() called with invalid max_files parameter
   - Error: "ConfigExtractor.__init__() got an unexpected keyword argument 'max_files'"
   - Solution: Removed max_files and include_optional_deps parameters
   - Impact: Configuration section now works in ARCHITECTURE.md

2. **C3.3 How-To Guide Building NoneType Guard**
   - Fixed: Missing null check for guide_collection
   - Error: "'NoneType' object has no attribute 'get'"
   - Solution: Added guard: if guide_collection and guide_collection.total_guides > 0
   - Impact: No more crashes when guide building fails

3. **Technology Stack Section Population**
   - Fixed: Empty Section 3 in ARCHITECTURE.md
   - Enhancement: Now pulls languages from GitHub data as fallback
   - Solution: Added dual-source language detection (C3.7 → GitHub)
   - Impact: Technology stack always shows something useful

**Test Results After Fixes:**
-  All 3 sections now populate correctly
-  Graceful degradation still works
-  No errors in ARCHITECTURE.md generation

**Files Modified:**
- codebase_scraper.py: Fixed C3.4 call, added C3.3 null guard
- unified_skill_builder.py: Enhanced Technology Stack section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-01-04 22:22:15 +03:00
parent 9e772351fe
commit 94462a3657
2 changed files with 28 additions and 13 deletions

View File

@@ -491,7 +491,7 @@ def analyze_codebase(
ai_mode=ai_mode
)
if guide_collection.total_guides > 0:
if guide_collection and guide_collection.total_guides > 0:
# Save collection summary
collection_json = tutorials_dir / 'guide_collection.json'
with open(collection_json, 'w', encoding='utf-8') as f:
@@ -511,10 +511,7 @@ def analyze_codebase(
if extract_config_patterns:
logger.info("Extracting configuration patterns...")
try:
config_extractor = ConfigExtractor(
max_files=100,
include_optional_deps=True
)
config_extractor = ConfigExtractor()
# Extract config patterns from directory
extraction_result = config_extractor.extract_from_directory(directory)

View File

@@ -466,8 +466,31 @@ This skill combines knowledge from multiple sources:
f.write("\n")
# Section 3: Technology Stack
f.write("## 3. Technology Stack\n\n")
# Try to get languages from C3.7 architecture analysis first
languages = {}
if c3_data.get('architecture'):
languages = c3_data['architecture'].get('languages', {})
# If no languages from C3.7, try to get from GitHub data
if not languages:
github_data = self.scraped_data.get('github', {}).get('data', {})
if github_data.get('languages'):
# GitHub data has languages as list, convert to dict with count 1
languages = {lang: 1 for lang in github_data['languages']}
if languages:
f.write("**Languages Detected**:\n")
for lang, count in sorted(languages.items(), key=lambda x: x[1], reverse=True)[:5]:
if isinstance(count, int):
f.write(f"- {lang}: {count} files\n")
else:
f.write(f"- {lang}\n")
f.write("\n")
# Add frameworks if available
if c3_data.get('architecture'):
f.write("## 3. Technology Stack\n\n")
frameworks = c3_data['architecture'].get('frameworks_detected', [])
if frameworks:
f.write("**Frameworks & Libraries**:\n")
@@ -475,13 +498,8 @@ This skill combines knowledge from multiple sources:
f.write(f"- {fw}\n")
f.write("\n")
# Add language info if available
languages = c3_data['architecture'].get('languages', {})
if languages:
f.write("**Languages Detected**:\n")
for lang, count in sorted(languages.items(), key=lambda x: x[1], reverse=True)[:5]:
f.write(f"- {lang}: {count} files\n")
f.write("\n")
if not languages and not (c3_data.get('architecture') and c3_data['architecture'].get('frameworks_detected')):
f.write("*Technology stack analysis not available*\n\n")
# Section 4: Design Patterns (C3.1)
if c3_data.get('patterns'):