Skip to content

fix: keep KNOWN_PROVIDERS in sync with PROVIDERS registry (#53) - #54

Merged
jayrav13 merged 1 commit into
mainfrom
worktree-fix-53-regenerate-demo-gifs
Apr 28, 2026
Merged

fix: keep KNOWN_PROVIDERS in sync with PROVIDERS registry (#53)#54
jayrav13 merged 1 commit into
mainfrom
worktree-fix-53-regenerate-demo-gifs

Conversation

@jayrav13

Copy link
Copy Markdown
Owner

Summary

Closes #53.

The "See it in action" GIF on https://jayravaliya.com/tenor-tui/ was rendering as a broken shell-error video because of a config-validation bug, not (just) a stale-asset issue.

Root cause: --provider fixture looked valid (argparse reads choices from PROVIDERS.keys()), but load_config() validated the resolved provider against a hardcoded KNOWN_PROVIDERS = {"yahoo", "tradier"} that had drifted when FixtureProvider was added. So tenortui --provider fixture exited with Configuration error: Unknown provider 'fixture', and that error is exactly what VHS captured into the demo GIFs.

Fix:

  • src/tenortui/config.py — derive KNOWN_PROVIDERS from PROVIDERS.keys() so the registry is the single source of truth.
  • tests/test_config.py — add a parametrized regression test that asserts every registered provider is accepted by load_config(provider_override=...), plus a guard that KNOWN_PROVIDERS matches PROVIDERS.keys().
  • tests/test_settings_screen.py — provider-cycle test now computes the expected next provider from KNOWN_PROVIDERS instead of hardcoding "tradier" (which was correct only when fixture was excluded).
  • docs/tapes/*.tape — added a comment to each tape documenting why --provider fixture is the right choice for recordings.
  • docs/site/docs/assets/demos/*.gif — all three demo GIFs re-recorded against the fixed code; they now show the working TUI instead of shell errors.
  • CHANGELOG.md — entry under [Unreleased] / Fixed.

Test plan

  • poetry run python -m pytest — 434 passed
  • poetry run ruff check src/ tests/ — clean
  • poetry run ruff format --check src/ tests/ — 56 files formatted
  • make docs-strict — builds clean
  • make demos — all 3 GIFs regenerated; spot-checked frames show TUI options chain rendering with fixture provider (not the previous shell-error capture)
  • Pre-commit + pre-push hooks both green
  • CI green on this PR

Notes / follow-ups

  • Settings-screen "default provider" cycle now includes fixture because it sorts via KNOWN_PROVIDERS. That's a minor UX wart (an end user pressing Enter on the default-provider row could land on the demo provider). Hiding internal-only providers from user-facing pickers is a reasonable separate ticket — kept it out of this PR to keep the diff focused on the bug.

Co-authored by Claude

…demo GIFs

`--provider fixture` was rejected at runtime even though argparse advertised
it as a valid choice. Argparse reads choices from `PROVIDERS.keys()`, but
`load_config` validated against a hardcoded `KNOWN_PROVIDERS = {"yahoo",
"tradier"}` that drifted when FixtureProvider was added. This made
`tenortui --provider fixture` fail with `Configuration error: Unknown
provider 'fixture'`, which is what got captured in the docs-site demo GIFs
— rendering them as broken-looking shell-error videos.

- Derive `KNOWN_PROVIDERS` from `PROVIDERS.keys()` so the registry is the
  single source of truth.
- Add a regression test that asserts every registered provider is accepted
  by `load_config(provider_override=...)`.
- Update settings-screen test to compute the next provider from
  `KNOWN_PROVIDERS` rather than hardcoding "tradier".
- Add comments to the three VHS tapes documenting why `--provider fixture`
  is the right choice (deterministic, offline, no API keys).
- Re-record `launch-and-search.gif`, `expiry-and-greeks.gif`, and
  `watchlist-flow.gif` so the docs site shows the working TUI.

Closes #53

Co-Authored-By: Claude <noreply@anthropic.com>
@jayrav13
jayrav13 merged commit 2500f46 into main Apr 28, 2026
6 checks passed
@jayrav13
jayrav13 deleted the worktree-fix-53-regenerate-demo-gifs branch April 28, 2026 03:21
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.

Docs site: 'See it in action' GIF on home page is broken (shows shell errors instead of app demo)

1 participant