From a68e70ea660a17d1732a96d5667e66ecb23a5c14 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 23 Feb 2026 12:05:05 -0600 Subject: [PATCH] store: SBA Scout Python-to-Rust TUI migration: recommended stack and approach --- ...-migration-recommended-stack-and-2cf305.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 graph/decisions/sba-scout-python-to-rust-tui-migration-recommended-stack-and-2cf305.md diff --git a/graph/decisions/sba-scout-python-to-rust-tui-migration-recommended-stack-and-2cf305.md b/graph/decisions/sba-scout-python-to-rust-tui-migration-recommended-stack-and-2cf305.md new file mode 100644 index 00000000000..04d4e411ac6 --- /dev/null +++ b/graph/decisions/sba-scout-python-to-rust-tui-migration-recommended-stack-and-2cf305.md @@ -0,0 +1,57 @@ +--- +id: 2cf3058c-85f4-481a-bbe7-17ebb9b9e908 +type: decision +title: "SBA Scout Python-to-Rust TUI migration: recommended stack and approach" +tags: [sba-scout, rust, migration, ratatui, research, decision, tui] +importance: 0.7 +confidence: 0.8 +created: "2026-02-23T18:05:05.367031+00:00" +updated: "2026-02-23T18:05:05.367031+00:00" +--- + +# SBA Scout Python-to-Rust TUI Migration Research + +## Context + +SBA Scout is a Python TUI app using Textual + SQLAlchemy + httpx + pydantic-settings. Research was conducted to evaluate converting it to Rust. + +## Recommended Stack (Option A - Lean and Idiomatic) + +- **UI:** ratatui 0.30 + crossterm +- **Async runtime:** tokio +- **Database:** sqlx 0.8.6 (sqlite, async) +- **HTTP client:** reqwest 0.12.28 +- **Config:** figment 0.10.19 +- **Serialization:** serde + toml +- **Math:** pure f64 (no external crate needed) +- **Rust edition:** 2024 + +## Alternative Stack (Option B - Higher Abstraction) + +- **UI:** tui-realm 3.3 on top of ratatui +- **Config:** config-rs 0.15.19 with YAML + +## Rejected Libraries + +- **Diesel:** rejected — no async SQLite support +- **rusqlite:** rejected — sync only, not Send +- **serde_yaml:** deprecated — migrate config to TOML instead of YAML + +## Migration Order + +1. Data structs (models) +2. sqlx queries (database layer) +3. API client (reqwest) +4. Config (figment) +5. First screen: Roster (screens layer) +6. Iterate remaining screens + +## Key Challenges + +- Calc layer is the easiest port (pure math, f64) +- Screens are the hardest: ratatui is immediate-mode (draw loop), while Textual is retained-mode (component tree with reactive state) +- Async patterns differ significantly between Python and Rust + +## Reference + +Full research saved to NoteDiscovery at `projects/sba-scout/rust-tui-migration-research`.