Files
markitect-main/markitect/legacy/__init__.py
tegwick a367628cab feat: Complete Issue #39 - Database CLI Reorganization with Comprehensive Legacy Compatibility System
## Database Command Reorganization
- Add new db-prefixed commands: db-query, db-schema, db-delete, db-status
- Maintain backward compatibility with deprecation warnings for query/schema commands
- Implement lazy database initialization to reduce CLI coupling
- Add command-specific --database options for flexibility

## Legacy Compatibility Framework
- Create comprehensive legacy compatibility system in markitect/legacy_compat.py
- Support versioned legacy switches (--legacy-v39-pre) for smooth transitions
- Implement git commit binding for version tracking (Issue #39: v39-pre → 3168de4)
- Add environment-based legacy mode detection for test environments
- Create graduated deprecation warning system (DEPRECATED → LEGACY → SUNSET)

## Legacy Agent System
- Implement intelligent legacy lifecycle management agent
- Add 8 CLI commands for legacy interface management (status, analyze, migrate, cleanup, etc.)
- Create automated maintenance with usage analytics and data-driven decisions
- Provide comprehensive safety features with backup and rollback capabilities

## Test Architecture Enhancement
- Add 18 comprehensive tests for Issue #39 functionality (16 passing, 2 skipped by design)
- Configure pytest.ini with MARKITECT_LEGACY_MODE=39-pre for automatic legacy support
- Update test count to 466 total tests across 7 architectural layers
- Identify 5 legacy interface tests for future recreation without legacy dependencies

## Documentation & Roadmap Updates
- Update NEXT.md with completed Issues #39 and #40
- Document failing tests requiring recreation with pure db- commands
- Add comprehensive legacy agent documentation
- Update development priorities and capability descriptions

## Architecture Achievements
- Simplified CLI architecture with reduced coupling between commands and global state
- Created reusable legacy compatibility framework for future breaking changes
- Established systematic approach to interface deprecation and migration
- Maintained 461/466 tests passing (5 legacy interface tests flagged for recreation)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 17:28:39 +02:00

53 lines
1.8 KiB
Python

"""
Legacy Compatibility System for MarkiTect CLI
This module provides comprehensive legacy compatibility management allowing
deprecated interfaces to be controlled via versioned switches while providing
clear migration paths and automated lifecycle management.
Key Components:
- LegacyRegistry: Central registry of legacy interfaces and their versions
- LegacySwitch: Version-controlled behavior switches (--legacy-v1, etc.)
- DeprecationManager: Graduated deprecation warnings and lifecycle
- LegacyAgent: Automated legacy interface management
- GitStateTracker: Binding legacy versions to specific git commits
Architecture:
CLI Layer -> LegacySwitch -> LegacyRegistry -> LegacyAgent -> GitStateTracker
Example Usage:
# CLI with legacy support
@click.option('--legacy-v1', is_flag=True, help='Use v1.0 legacy behavior')
def my_command(legacy_v1):
registry = LegacyRegistry()
if legacy_v1:
return registry.execute_legacy('my_command', 'v1.0', args)
return new_implementation(args)
"""
from .registry import LegacyRegistry, LegacyStatus
from .switches import LegacySwitch, legacy_option, with_legacy_support
from .deprecation import DeprecationManager, DeprecationLevel
from .agent import LegacyAgent, AgentConfig
from .git_tracker import GitStateTracker
from .compatibility import CompatibilityLayer
from .exceptions import LegacyError, LegacyVersionNotFoundError, DeprecationError
__all__ = [
'LegacyRegistry',
'LegacyStatus',
'LegacySwitch',
'legacy_option',
'with_legacy_support',
'DeprecationManager',
'DeprecationLevel',
'LegacyAgent',
'AgentConfig',
'GitStateTracker',
'CompatibilityLayer',
'LegacyError',
'LegacyVersionNotFoundError',
'DeprecationError'
]
__version__ = '1.0.0'