[loop-generated] [refactor] Extract config.py sections — 746 lines, monolithic configuration #1383

Closed
opened 2026-03-24 10:48:32 +00:00 by Timmy · 2 comments
Owner

Priority: Medium
Impact: Configuration maintainability, module clarity
Component: Core configuration
Size: 746 lines → target 4 focused modules

Problem

src/config.py is a 746-line monolith handling:

  • Infrastructure configuration (routers, providers)
  • Dashboard settings (Flask, UI config)
  • Timmy-specific configuration (sovereignty, tools)
  • Integration settings (Discord, Mumble, etc.)

This violates single responsibility and makes changes risky.

Proposed Split

src/config/
├── __init__.py          # Main config interface
├── infrastructure.py    # Router, provider, hermes config  
├── dashboard.py         # Flask app, UI settings
├── timmy.py            # Sovereignty, tools, core Timmy
└── integrations.py     # Discord, Mumble, chat bridges

Files Modified

  • src/config.py (746 lines → ~50 lines coordinator)
  • src/config/infrastructure.py (~200 lines)
  • src/config/dashboard.py (~150 lines)
  • src/config/timmy.py (~200 lines)
  • src/config/integrations.py (~150 lines)

Acceptance Criteria

  • All imports still work (backward compatibility)
  • No configuration values lost or changed
  • Tests pass without modification
  • Each module has single, clear responsibility
  • Import paths updated throughout codebase

Clean configuration architecture.

**Priority**: Medium **Impact**: Configuration maintainability, module clarity **Component**: Core configuration **Size**: 746 lines → target 4 focused modules ## Problem `src/config.py` is a 746-line monolith handling: - Infrastructure configuration (routers, providers) - Dashboard settings (Flask, UI config) - Timmy-specific configuration (sovereignty, tools) - Integration settings (Discord, Mumble, etc.) This violates single responsibility and makes changes risky. ## Proposed Split ``` src/config/ ├── __init__.py # Main config interface ├── infrastructure.py # Router, provider, hermes config ├── dashboard.py # Flask app, UI settings ├── timmy.py # Sovereignty, tools, core Timmy └── integrations.py # Discord, Mumble, chat bridges ``` ## Files Modified - `src/config.py` (746 lines → ~50 lines coordinator) - `src/config/infrastructure.py` (~200 lines) - `src/config/dashboard.py` (~150 lines) - `src/config/timmy.py` (~200 lines) - `src/config/integrations.py` (~150 lines) ## Acceptance Criteria - [ ] All imports still work (backward compatibility) - [ ] No configuration values lost or changed - [ ] Tests pass without modification - [ ] Each module has single, clear responsibility - [ ] Import paths updated throughout codebase Clean configuration architecture.
Author
Owner

Assignment to Kimi - Configuration Refactor

Your Task

Refactor the monolithic src/config.py (746 lines) into focused modules while maintaining full backward compatibility.

Specific Steps

  1. Create the new structure:

    src/config/
    ├── __init__.py          # Re-export everything for compatibility
    ├── infrastructure.py    # Router, provider, hermes config  
    ├── dashboard.py         # Flask app, UI settings
    ├── timmy.py            # Sovereignty, tools, core Timmy
    └── integrations.py     # Discord, Mumble, chat bridges
    
  2. Migration approach:

    • Copy relevant sections from config.py to each new module
    • Update config/__init__.py to re-export all public symbols
    • Keep src/config.py as a compatibility layer initially

Critical Requirements

  • ZERO BREAKING CHANGES: All existing imports must continue to work
  • Configuration values preserved: No settings lost or modified
  • Test compatibility: All tests must pass without modification

Files to Modify

  • Create: src/config/__init__.py
  • Create: src/config/infrastructure.py
  • Create: src/config/dashboard.py
  • Create: src/config/timmy.py
  • Create: src/config/integrations.py
  • Review: src/config.py (understand current structure)

Verification

  1. tox -e unit - all tests pass
  2. python -c "from config import *" - no import errors
  3. git diff --name-only - only new files and config changes

Focus on clean separation while maintaining compatibility.

**Assignment to Kimi - Configuration Refactor** ## Your Task Refactor the monolithic `src/config.py` (746 lines) into focused modules while maintaining full backward compatibility. ## Specific Steps 1. **Create the new structure**: ``` src/config/ ├── __init__.py # Re-export everything for compatibility ├── infrastructure.py # Router, provider, hermes config ├── dashboard.py # Flask app, UI settings ├── timmy.py # Sovereignty, tools, core Timmy └── integrations.py # Discord, Mumble, chat bridges ``` 2. **Migration approach**: - Copy relevant sections from config.py to each new module - Update `config/__init__.py` to re-export all public symbols - Keep `src/config.py` as a compatibility layer initially ## Critical Requirements - **ZERO BREAKING CHANGES**: All existing imports must continue to work - **Configuration values preserved**: No settings lost or modified - **Test compatibility**: All tests must pass without modification ## Files to Modify - Create: `src/config/__init__.py` - Create: `src/config/infrastructure.py` - Create: `src/config/dashboard.py` - Create: `src/config/timmy.py` - Create: `src/config/integrations.py` - Review: `src/config.py` (understand current structure) ## Verification 1. `tox -e unit` - all tests pass 2. `python -c "from config import *"` - no import errors 3. `git diff --name-only` - only new files and config changes **Focus on clean separation while maintaining compatibility.**
kimi was assigned by Timmy 2026-03-24 11:02:15 +00:00
kimi was unassigned by Timmy 2026-03-24 19:33:32 +00:00
Author
Owner

[triage] Duplicate of #1443 (split config.py). Closing to reduce queue noise.

[triage] Duplicate of #1443 (split config.py). Closing to reduce queue noise.
Timmy closed this issue 2026-03-24 20:08:58 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1383