You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor: Reorganize codebase with feature-based architecture and simplified naming
This commit represents a major reorganization to improve code navigability and consistency:
## Architecture Change: Layer-based → Feature-based
**Before (4-layer architecture):**
- foundation/ - Low-level utilities
- infrastructure/ - Core services
- integration/ - Business logic
- application/ - Entry points
**After (feature-based architecture):**
- core/ - Shared utilities (foundation + infrastructure merged)
- layers/ - Virtual layer system (renamed from virtual_layers)
- rules/ - Rule engine and pattern matching
- transforms/ - Transform system with pipeline
- fuse/ - FUSE operations and control
- cli.py, main.py - Entry points at top level
## Naming Simplification
**Module rename:**
- shadowfs/virtual_layers/ → shadowfs/layers/
- tests/virtual_layers/ → tests/layers/
**Class renames:**
- VirtualLayer → Layer (base class)
- VirtualLayerManager → LayerManager
- VirtualLayerType → LayerType (enum)
**Rationale:** Since the module is called "layers", the "Virtual" prefix is redundant.
## Benefits
- Intuitive navigation: Features grouped logically by domain
- Simpler imports: from shadowfs.layers import LayerManager
- Better cohesion: Related code co-located
- Easier onboarding: Navigate by feature, not architecture theory
- Cleaner naming: No redundant prefixes
## File Reorganization
- 62 files moved with git mv (history preserved)
- ~100 import statements updated in source and test files
- All documentation updated (CLAUDE.md, docstrings, examples)
- All __init__.py files updated with new exports
## Testing
- All refactoring-related code functional
- Test structure mirrors new source structure
- 506+ tests passing (excluding pre-existing validator test failures)
## Breaking Changes
This is a breaking change for any external code importing ShadowFS modules.
Update imports as follows:
# Old imports
from shadowfs.virtual_layers import VirtualLayerManager
from shadowfs.integration.rule_engine import RuleEngine
from shadowfs.infrastructure.cache_manager import CacheManager
# New imports
from shadowfs.layers import LayerManager
from shadowfs.rules import RuleEngine
from shadowfs.core import CacheManager
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
@@ -254,59 +254,63 @@ The "shadow filesystem" mental model came from understanding TypeScript's type d
254
254
255
255
## Project Structure
256
256
257
+
**Note**: This structure uses a feature-based organization that groups related functionality together, replacing the previous strict 4-layer architecture (foundation/infrastructure/integration/application).
0 commit comments