Skip to content

wip: config overhaul #2711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

wip: config overhaul #2711

wants to merge 1 commit into from

Conversation

yaugenst-flex
Copy link
Collaborator

@yaugenst-flex yaugenst-flex commented Aug 1, 2025

graph TB
    %% Subtle, modern palette
    classDef api fill:#e0e7ff,stroke:#6366f1,stroke-width:2px,color:#312e81
    classDef core fill:#d1fae5,stroke:#34d399,stroke-width:2px,color:#064e3b
    classDef data fill:#fed7aa,stroke:#fb923c,stroke-width:2px,color:#7c2d12
    classDef ext fill:#e5e7eb,stroke:#9ca3af,stroke-width:2px,color:#374151
    classDef validate fill:#fecaca,stroke:#f87171,stroke-width:2px,color:#7f1d1d

    User((User))
    
    subgraph API["API Layer"]
        Legacy[Legacy Wrapper]:::api
        Config[Tidy3DConfig]:::api
        Proxies[Proxy Layer]:::api
    end
    
    subgraph Core["Core Layer"]
        Factory["Factory<br/>Validates all changes"]:::validate
        Service[Service<br/>Side Effects]:::core
        Repository[Repository<br/>Persistence]:::core
    end
    
    subgraph Data["Data Layer (Immutable)"]
        Sections["Config Sections<br/>(Pydantic Models)"]:::data
        State["Runtime State<br/>(Immutable)"]:::data
    end
    
    subgraph External["External"]
        direction TB
        Dynaconf[Dynaconf]:::ext
        Sources["TOML Files<br/>+<br/>Environment Variables"]:::ext
    end
    
    %% User access
    User -->|"td.config.x.y"| Legacy
    Legacy -->|"wraps"| Config
    
    %% Read path
    Config -->|"access"| Proxies
    Proxies -->|"get"| Factory
    Factory -->|"load"| State
    
    %% Write path
    Proxies -.->|"set"| Factory
    Factory ==>|"validate &<br/>create new"| Sections
    Sections ==>|"immutable<br/>update"| State
    
    %% Side effects
    Factory -->|"notify"| Service
    Service -->|"apply"| State
    
    %% Persistence
    Config -->|"save()"| Repository
    Repository --> Dynaconf
    Dynaconf --> Sources
    
    %% Initialization
    Sources -.->|"startup"| Dynaconf
    Dynaconf -.->|"load"| Repository
    Repository -.->|"init"| State
Loading

@yaugenst-flex yaugenst-flex self-assigned this Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant