-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Summary
Now that #467 / PR #468 moved alert + notification event persistence into the unified runtime store, the main remaining refactor work is broader path/root normalization.
Today the app still has multiple active ways of deciding where writable files live:
ConfigManageranchors config underconfig_dir/app.paths.configPathsstill exposes independentData/Config/Cache/Logsroots- some callers still bypass the runtime config root and pick paths directly
That means portable mode, --config-dir, and default installed layouts are not yet driven by one canonical runtime storage contract.
Phase 3 goal
Make all actively used writable surfaces resolve from one canonical runtime storage layout, with migration-safe behavior.
In scope
1) Define a single runtime storage contract
Touch:
src/accessiweather/app.pysrc/accessiweather/app_initialization.pysrc/accessiweather/paths.py(or replacement helper if cleaner)src/accessiweather/config/config_manager.py
Expected result:
- app startup resolves storage roots once
- downstream code stops inferring its own roots ad hoc
- portable mode and explicit
--config-dirare honored consistently
2) Move active callers onto that contract
Touch at least:
src/accessiweather/app_initialization.py- stop deriving cache from
config_dirfallback logic inline
- stop deriving cache from
src/accessiweather/single_instance.py- ensure lock-file location follows the same runtime storage contract
src/accessiweather/ui/dialogs/noaa_radio_dialog.pysrc/accessiweather/noaa_radio/preferences.py- stop creating prefs from a fresh
Paths().datadetached from runtime overrides
- stop creating prefs from a fresh
Also audit any still-active callers using app.paths.* directly for persistence so they either:
- intentionally use the canonical root, or
- are explicitly documented as legacy and deferred
3) Keep current runtime-state/file migration behavior intact
Do not rework the Phase 2 runtime-state schema.
Keep working behavior for:
accessiweather.jsonstate/runtime_state.json- portable API-key bundles
Migration / safety constraints
- no destructive data moves unless there is a tested read-old/write-new path
- prefer “resolve canonically, then write there” over large one-shot migrations
- keep user-visible storage surprises to a minimum
Tests / validation
Add focused regression coverage for:
- installed/default layout
- portable layout
- explicit
--config-dir - NOAA radio prefs honoring the same runtime root
- single-instance lock honoring the same runtime root
- weather cache honoring the same runtime root
Out of scope
- deleting legacy helper modules outright
- mass renaming on-disk folders just for style
- changing config schema unrelated to storage-root normalization
- broad documentation sweeps beyond what is needed to explain the new contract
Follow-up
After this lands, do a short soak / observation pass before removing legacy path fallbacks.