[P0] ZARA-002 — Fix invalid default TOML and prove configuration overrides load #3

Closed
opened 2026-07-18 19:18:04 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-18 19:18:04 +00:00 (Migrated from github.com)

Problem

zara/config.py::DEFAULT_CONFIG_TOML declares [noaa] twice. TOML forbids duplicate tables, so Zara writes an invalid default config and _load_config() falls back to hard-coded defaults. User edits can be silently ignored.

The fallback/default TTS provider is also named qwen, while TTSEngine accepts qwen3; once configuration loading works, the first TTS response can fail with Unknown TTS provider.

Required fix

  • Remove duplicate TOML tables and keep one authoritative [noaa] section.
  • Align TTS provider identifiers across TOML defaults, fallback dicts, load_tts_config(), and TTSEngine.
  • Validate required provider-specific fields without breaking existing user configs; support a compatibility alias only if needed.
  • Make parse failures explicit and actionable rather than silently discarding the entire user config.

Required tests

  • Add config round-trip tests using a temporary XDG config directory.
  • Test first-run config creation, TOML parsing, reload, user overrides, invalid TOML diagnostics, and qwen/qwen3 compatibility behavior.
  • Add scripts/test-config.sh that creates a temporary config, runs a Python config probe, and exits nonzero on fallback or provider mismatch.

Acceptance

  • A newly generated config parses with tomllib.
  • A changed value is returned after reload().
  • The configured default TTS provider initializes successfully with network/audio mocked.
  • nix develop -c pytest and nix develop -c bash scripts/test-config.sh pass.

Branch

fix/zara-002-config-toml

Dependencies

ZARA-001.

## Problem `zara/config.py::DEFAULT_CONFIG_TOML` declares `[noaa]` twice. TOML forbids duplicate tables, so Zara writes an invalid default config and `_load_config()` falls back to hard-coded defaults. User edits can be silently ignored. The fallback/default TTS provider is also named `qwen`, while `TTSEngine` accepts `qwen3`; once configuration loading works, the first TTS response can fail with `Unknown TTS provider`. ## Required fix - Remove duplicate TOML tables and keep one authoritative `[noaa]` section. - Align TTS provider identifiers across TOML defaults, fallback dicts, `load_tts_config()`, and `TTSEngine`. - Validate required provider-specific fields without breaking existing user configs; support a compatibility alias only if needed. - Make parse failures explicit and actionable rather than silently discarding the entire user config. ## Required tests - Add config round-trip tests using a temporary XDG config directory. - Test first-run config creation, TOML parsing, reload, user overrides, invalid TOML diagnostics, and `qwen`/`qwen3` compatibility behavior. - Add `scripts/test-config.sh` that creates a temporary config, runs a Python config probe, and exits nonzero on fallback or provider mismatch. ## Acceptance - A newly generated config parses with `tomllib`. - A changed value is returned after `reload()`. - The configured default TTS provider initializes successfully with network/audio mocked. - `nix develop -c pytest` and `nix develop -c bash scripts/test-config.sh` pass. ## Branch `fix/zara-002-config-toml` ## Dependencies ZARA-001.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara#3
No description provided.