& C:\Users\HP\AppData\Local\Python\pythoncore-3.14-64\python.exe -m build
& C:\Users\HP\AppData\Local\Python\pythoncore-3.14-64\python.exe -m twine upload dist/*
pip uninstall mintdim
pip install mintdim==


============

Has decided on the initial `trainwatch-tui` repository structure for a pure-UI-first Textual dashboard project with fake metrics/data only. The structure is as follows:

trainwatch-tui/
├── README.md
├── pyproject.toml
├── .gitignore
└── src/
    └── trainwatch_tui/
        ├── __init__.py
        ├── __main__.py
        ├── app.py
        ├── bootstrap.py
        │
        ├── contracts/
        │   ├── __init__.py
        │   ├── metrics.py
        │   └── view_models.py
        │
        ├── ui/
        │   ├── __init__.py
        │   ├── dashboard.py
        │   ├── formatting.py
        │   ├── styles.tcss
        │   └── widgets/
        │       ├── __init__.py
        │       ├── summary_panel.py
        │       ├── metric_table.py
        │       ├── loss_chart.py
        │       └── log_panel.py
        │
        ├── fake/
        │   ├── __init__.py
        │   ├── source.py
        │   └── scenarios.py
        │
        └── runtime/
            ├── __init__.py
            ├── controller.py
            └── store.py

User has defined the following responsibility boundaries for the project:
- Goal for this phase: build the UI only, with all metrics/training/data fake. The UI must not be coupled to real model code, datasets, Colab, WebSocket, HTTP, or any training framework.
- Architectural layers:
  1. `contracts/`: shared neutral boundary. Contains pure dataclasses/enums/types such as `MetricSnapshot`, `MetricHistoryPoint`, `RunStatus`, `DashboardViewModel`, `SummaryViewModel`, `MetricTableRow`, `LossChartViewModel`, and `LogLineViewModel`. It must not import Textual, UI modules, fake modules, runtime modules, network code, or ML libraries.
  2. `ui/`: pure Textual rendering layer. It renders view models only. It may import `contracts/*` and local UI helpers/widgets, but must not import `fake/*`, `runtime/*`, Colab, WebSocket, requests, torch, jax, flax, datasets, or any model/training code. Widgets expose methods such as `update_from_view_model(...)` and contain no training/source logic.
  3. `fake/`: fake data/source layer. It generates fake metrics, logs, and scenarios using contracts. It must not import UI. `fake/source.py` should define the initial fake source, e.g. `FakeRunSource`; `fake/scenarios.py` should define scenario presets such as stable descent, noisy descent, loss spike, plateau, NaN failure, etc.
  4. `runtime/`: composition/control layer between source and store/UI. It can use `contracts/*` and `fake/*` in this phase. `runtime/store.py` owns run state/history/logs; `runtime/controller.py` advances ticks, pulls from the source, updates store, and exposes/builds dashboard view models.
  5. `app.py`: Textual app class, e.g. `TrainWatchApp`, wiring `DashboardScreen` and controller/store into the app.
  6. `bootstrap.py`: factory/composition point, initially `create_fake_app()`, choosing fake source and wiring app/runtime together. Later it may choose WebSocket/Colab sources, but UI must not change.
  7. `__main__.py`: entry point, expected to call `create_fake_app().run()` for `python -m trainwatch_tui`.
- Import rules:
  - `ui/*` -> `contracts/*` only, plus local UI modules.
  - `fake/*` -> `contracts/*` only.
  - `runtime/*` -> `contracts/*`, `fake/*`.
  - `app.py` -> `ui/*`, `runtime/*`.
  - `bootstrap.py` -> `app.py`, `fake/*`, `runtime/*`.
  - `contracts/*` -> no project-specific dependency except itself/stdlib.
- Prohibited dependencies:
  - `ui/*` must not import `fake/*` or `runtime/*`.
  - `ui/*` must not import real training/model/data/network dependencies.
  - `fake/*` must not import `ui/*`.
  - `contracts/*` must not import Textual or project implementation layers.
- Core principle: UI renders `ViewModel`; fake layer generates data; runtime connects fake source to store/view models; contracts define the shared boundary. This preserves the ability to replace fake data with Colab/WebSocket later without contaminating UI.