Dead Code Analysis for libs/netherframe.core
Historical note: This page is preserved as an archival analysis snapshot. It reflects the repository state at the time it was written and should not be treated as the current architecture contract. Start with Historical Internal Docs, Hybrid Execution Overview, and Migration Guide for current guidance.
Summary
This analysis identifies dead code, duplicates, and potentially unused modules in the libs/netherframe.core package.
1. Duplicate Functionality
Native Execution Modules
native_execution.py- Main native execution module (actively used)native_execution_enhanced.py- Enhanced version with TUI support (NOT imported anywhere - DEAD CODE)native_executor.py- Only imported in benchmarks/benchmark_suite.pynative_provider.py- NOT imported anywhere - DEAD CODE
Orchestrator Modules
orchestrator.py- Base orchestrator (actively used)parallel_orchestrator.py- Enhanced parallel version (actively used)circular_orchestrator.py- Circular dependency handling (actively used)circular_orchestrator_enhanced.py- Enhanced version (only imports native_circular_deps_parallel - limited use)
Phase Planning Modules
phase_planner.py- Original phase planner (still used in some places)phase_planner_v2.py- Version 2 (only used in tests - possibly experimental)
State Engine Modules
state_engine.py- Main state engine (actively used)transactional_state_engine.py- NOT imported anywhere - DEAD CODE
2. Backup and Debug Files
Backup Files
core_backup.py- NOT imported anywhere - DEAD CODE- 17
.backupfiles in tests/ - All are backup copies that should be removed
Debug Scripts (Top Level)
debug_auto_detection.pydebug_autoscope_test.pydebug_frames.pydebug_provider.py
These appear to be temporary debugging scripts that should be removed or moved to a debug utilities folder.
3. Temporary Fix Scripts
comprehensive_fix.py- Referenced in drift_patch_generation.pyfix_e2e_resources.py- Referenced in fix_remaining_resources.pyfix_remaining_resources.py- Self-referentialremove_duplicates.py- Self-referential
These appear to be one-time migration/fix scripts that may no longer be needed.
4. Duplicate Protocol Buffer Files
Protocol buffer generated files exist in multiple locations:
- Root level: grpc_controller_pb2*.py, grpc_stdio_pb2*.py, tfplugin6_pb2*.py
- nf/core/gen/: Same files
- These duplicates should be consolidated to one location
5. Unused Modules Summary
Definitely Dead Code (not imported anywhere):
nf/core/native_execution_enhanced.pynf/core/native_provider.pynf/core/core_backup.pynf/core/transactional_state_engine.py
Potentially Dead Code (only used in tests/benchmarks):
nf/core/native_executor.py- Only in benchmarksnf/core/phase_planner_v2.py- Only in testsnf/core/circular_orchestrator_enhanced.py- Limited use
Test Coverage and Utility Files
test_all_rpcs.py- Top level test filetest_codec.py- Top level test filetest_status.py- Top level test filecoverage_report.py- Coverage utilityrun_test_isolation.py- Test utility
These should probably be moved to the tests directory.
Recommendations
- Remove definitely dead code files listed above
- Delete all .backup files in the tests directory
- Consolidate protobuf files to nf/core/gen/ and remove duplicates
- Move debug scripts to a proper debug utilities location or remove them
- Review temporary fix scripts and remove if no longer needed
- Move top-level test files to the tests directory
- Consider removing or documenting potentially dead code that's only used in tests
File Count Summary
- Total dead code files identified: 4
- Backup files to remove: 17
- Debug scripts to review: 4
- Temporary fix scripts: 4
- Duplicate protobuf files: 9 (3 sets × 3 locations)
- Test files in wrong location: 3
Total files that could be removed or relocated: ~41 files