Fix/import deps sanitizer wave 05 new#37
Merged
Conversation
- Create tools/import_cycle_scan.py to detect circular import dependencies - Create tools/fix_import_dependencies.py to fix type annotations and lazy imports - Create tools/fix_syntax_errors.py to fix syntax errors from import fixes - Apply TYPE_CHECKING imports and lazy imports to stillme_core/learning/** - Apply TYPE_CHECKING imports and lazy imports to agent_dev/core/** - Fix syntax errors in type annotations (param -> None: Type = default) - Create facade aliases in stillme_core/learning/__init__.py for stable imports - Fix AgentDev initialization with placeholder components for missing modules - All canary tests now PASS (2 passed, 1 skipped) - No import cycles detected in stillme_core/learning and agent_dev/core - Reduces import dependency fragility without breaking existing APIs This resolves import dependency issues and makes the codebase more maintainable.
- Add test API key patterns to gitleaks allowlist - Allow sk-xxxx, sk-dev-xxxx, sk-or-dev-xxxx patterns - Allow test_key_for_testing_purposes_only pattern - Fixes Gitleaks security check failures for test data
…b.com/anhmtk/stillme_ai_ipc into fix/import-deps-sanitizer-wave-05-new
anhmtk
added a commit
that referenced
this pull request
Nov 21, 2025
Fix/import deps sanitizer wave 05 new
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Fix: Import Dependencies Sanitizer (Wave-05)
📋 Overview
This PR implements comprehensive import dependency sanitization to reduce circular imports and improve code maintainability without breaking existing APIs.
🎯 Objectives
🔧 Tools Created
1.
tools/import_cycle_scan.py2.
tools/fix_import_dependencies.py3.
tools/fix_syntax_errors.pyparam -> None: Type = defaultpatterns🔄 Changes Made
Import Dependencies Fixed
stillme_core/learning/**: Applied TYPE_CHECKING imports and lazy importsagent_dev/core/**: Applied TYPE_CHECKING imports and lazy importsstillme_core/learning/__init__.pyAgentDev System Improvements
Code Quality Improvements
__init__.pyto fix module name conflicts🧪 Testing Results
Import Cycle Analysis
Test Suite Results
pytest tests/test_agentdev_canary.py -v ================= 2 passed, 1 skipped in 1.07s ================= ✅📊 Impact Assessment
✅ Benefits
🔒 Safety Measures
🚀 Usage Examples
Before (Problematic)
After (Sanitized)
🔍 Files Modified
Core Learning System
stillme_core/learning/__init__.py- Facade aliasesstillme_core/learning/approval_system.py- TYPE_CHECKING importsstillme_core/learning/evolutionary_learning_system.py- Lazy importsstillme_core/learning/proposals.py- Type annotationsstillme_core/learning/proposals_manager.py- Syntax fixesAgentDev Core
agent_dev/core/agentdev.py- Placeholder componentsagent_dev/core/adaptive_strategy.py- TYPE_CHECKING importsagent_dev/core/conflict_fix.py- Lazy importsagent_dev/core/executor.py- Type annotationsagent_dev/core/generated_code.py- Syntax fixesagent_dev/core/planner.py- Import sanitizationagent_dev/core/security_thinking.py- TYPE_CHECKING patternsagent_dev/core/test_generated.py- Lazy loadingTools
tools/import_cycle_scan.py- New cycle detection tooltools/fix_import_dependencies.py- New import fixer tooltools/fix_syntax_errors.py- New syntax fixer tool🎯 Next Steps
🔗 Related Issues
This PR is part of Wave-05 cleanup initiative to improve codebase quality and maintainability.