Quick Wins: Dead Code Cleanup¶
Date: 2026-03-22
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
Effort: #1 of 3 (tech debt series) Risk: None โ deletions only, no behavior changes
Problem¶
Three categories of dead weight identified in the architectural review:
logging/setup.pyandlogging/emojis.pyโ two no-op functions called frommain()on every invocation. The underlying Foundation module they depend on does not exist. The functions contain only commented-out code.config/sources.pyโFileConfigSource,EnvironmentConfigSource, andConfigSourceare defined but not used anywhere in the actual config loading path (WorkenvConfig.load()). They are exported fromconfig/__init__.pybut have no production callers.hub_cli.pyhardcoded version โversion="0.3.0"is hardcoded increate_cli(), drifting from the real version tracked in theVERSIONfile and read viawrknv.__version__(currently0.3.21).
Approach¶
Full delete. No stubs, no deprecation markers โ these are clearly dead with no future use indicated.
Changes¶
1. Delete logging/ module¶
Files to delete:
- src/wrknv/logging/setup.py
- src/wrknv/logging/emojis.py
- src/wrknv/logging/__init__.py
- tests/logging/__init__.py
- tests/logging/test_logging.py
Files to modify:
- src/wrknv/cli/hub_cli.py โ remove import of setup_wrknv_logging (line 273) and the call to it (line 275)
- tests/cli/test_hub_cli.py โ remove patch("wrknv.logging.setup.setup_wrknv_logging") from test_main_runs_cli_when_no_task (line 410) and test_main_returns_early_when_task_intercepted (line 429)
2. Delete config/sources.py¶
Files to delete:
- src/wrknv/config/sources.py
- tests/config/test_config_sources.py
- scripts/memray/memray_config_parsing_stress.py โ this script exercises FileConfigSource and EnvironmentConfigSource exclusively; it has no value once the sources module is gone
Files to modify:
- src/wrknv/config/__init__.py โ remove imports and __all__ entries for ConfigSource, FileConfigSource, EnvironmentConfigSource
3. Fix hardcoded version string¶
Files to modify:
- src/wrknv/cli/hub_cli.py โ import __version__ from wrknv and replace version="0.3.0" with version=__version__
4. Untrack mutants/ directory¶
The mutants/ directory is a generated mutmut artifact that was inadvertently committed. It contains stale copies of files being deleted and should not be tracked.
- Add
mutants/to.gitignore - Run
git rm -r --cached mutants/to untrack it
Acceptance Criteria¶
- All deleted files are gone with no remaining references (
grep -r "wrknv.logging\|config.sources\|FileConfigSource\|EnvironmentConfigSource" src/ tests/returns zero results) uv run python -m pytest tests/ -vpasses with no regressionsuv run ruff check src testspasses cleanwrknv --versionoutputs the correct version from theVERSIONfile (0.3.21)mutants/is absent fromgit ls-files