Spaces:
Runtime error
Runtime error
Commit History
-
refactor: principal engineer audit — full production-grade rewrite
EymenArchitecture: - @st.cache_resource replaces session_state singletons (process-level, not rerun-level) - Strict SoC: UI layer contains zero business logic - Pure functions in technical.py easy to unit-test in isolation - Prompt engineering isolated in claude_client.py (_build_analysis_prompt, _inject_context) Error handling: - Specific exception catching at every callsite (RateLimitError, TickerNotFoundError, LLMRateLimitError, DocumentParseError, DocumentLoadError, IndexNotFoundError) - Zero bare 'except Exception' in UI layer - All errors map to user-friendly messages with actionable guidance Typing & Docs: - Google-style docstrings on all public classes and functions - Full type annotations including return types, args, raises - MessageList type alias for clarity Logging: - stdlib logging throughout (no print, no structlog dependency) - configure_logging() called once at app startup - Noisy third-party loggers suppressed Caching: - @st.cache_resource for StockClient, ClaudeClient…7dcad13 -
refactor: Principal Engineer audit — production-grade rewrite
EymenCore changes: - exceptions.py: full hierarchy (RateLimitError, NetworkTimeoutError, LLMRateLimitError, DocumentParseError, ContextWindowExceededError) with __init__ args, docstrings, and no string-matching required by callers - logger.py: stdlib-only (no structlog dep), colourised dev / key=value prod, noisy third-party loggers silenced, idempotent bootstrap - settings.py: field_validator for log_level and chunk_overlap, typed properties with full docstrings, Pydantic v2 compatible - stock_client.py: _classify_error() maps raw exceptions to typed domain errors; _fetch_with_retry() handles RateLimitError specifically vs NetworkTimeoutError vs DataFetchError; StockInfo dataclass documented; UA rotation; configurable TTL/retry/timeout from settings - technical.py: _validate_ohlcv() guard, _safe() helper prevents NaN comparison crashes, SignalMap type alias, full Google-style docstrings - claude_client.py: _create_with_retry() catches specific anthropic exception types (R…2b13db0 -
feat: initial FinSight MVP — stock analysis, RAG, conversational chat
Eymenfa77b99