Direct trading from the dashboard is not an option in our system.
Trading page is now read-only monitoring (positions, orders, order book).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TypeScript 5.9 erasableSyntaxOnly rejects enum declarations in .ts
files (they emit runtime code). Switch protoc-gen-es from target=ts
to target=js+dts which generates .js runtime + .d.ts type declarations.
Also fix type mismatches in useApi.ts (OrderSide/OrderType enum types,
StartBacktestRequest field mapping) and MLDashboard signal defaulting.
Add web-dashboard network policy for MinIO egress + proxy ingress.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend (Rust):
- Create proto/auth.proto with Login and RefreshToken RPCs
- Implement AuthGrpcService in services/api with JWT issuance
- Register as unauthenticated service in main.rs (pre-auth)
- Update JWT issuer from foxhunt-api-gateway to foxhunt-api
Dashboard (TypeScript):
- Install @connectrpc/connect-web + @bufbuild/protobuf
- Generate TypeScript proto clients via buf (src/gen/)
- Create grpc.ts transport with JWT interceptor
- Rewrite all useApi hooks to typed gRPC calls
- Replace WebSocket with useGrpcStream server-streaming hooks
- Migrate all 6 pages + 6 components to grpc-web
- Delete api.ts, websocket.ts, useWebSocket.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wrap Model Cards, Ensemble Panel, Training Progress in ComponentErrorBoundary
- Wrap Configuration Form in ComponentErrorBoundary
- Prevents full-page crash if individual sections throw render errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add VALID_TOPICS whitelist to WS handler, reject unknown topic subscriptions
- Add per-connection rate limit (50 topic changes/min) and max 20 subscriptions
- Remove wildcard "*" subscription (security risk)
- Add tracing::info! audit logging to all 8 mutation handlers
- Add 30s AbortController timeout to frontend API calls
- Fix clippy: rename _claims → claims in handlers that now use it
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add validate_backtest(): strategy_name, symbols format, date range,
initial_capital checks with 6 unit tests
- Add model_type validation against known types (dqn, ppo, tft, mamba2)
with 1 integration test
- Add error banner to ConfigDashboard for failed config fetch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace all hardcoded hex colors in chart components with CSS custom
properties (getCssVar helper), making charts respect theme changes
- Add scope="col" to all table headers (PositionsTable, OrdersTable,
BacktestingDashboard trade list)
- Connect form labels to inputs via htmlFor/id pairs (OrderForm,
BacktestingDashboard)
- Add role="alert" to validation error messages
- Add aria-label to cancel button, progressbar role to backtest progress
- Add WsManager.reconnect() method with backoff reset
- Add Reconnect button to StatusBar when WS disconnected
- Add shimmer skeleton loading states to CandlestickChart and PnLChart
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add isTokenExpired() / getTokenExpiry() JWT helpers to auth.ts
- Pre-flight token expiry check in apiFetch (60s margin)
- Graceful 401 handling: set session_expired flag before redirect
- LoginPage shows "session expired" banner when flag is set
- OrdersTable cancel button: add pending state + inline error display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add X-Request-Id middleware with UUID v4 generation and header propagation
- Convert 6 dashboard routes to React.lazy() with Suspense for code splitting
- Add inline validation errors to OrderForm (symbol, quantity, price)
- Add date range + symbol validation to BacktestingDashboard form
- Fix !Send future issue: use .instrument(span) instead of span.entered()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix all 98 clippy warnings (0 remaining with -D warnings)
- Add 30s default gRPC timeout on all channels via Endpoint::timeout()
- Replace readiness probe is_some() with actual gRPC health check (returns 503 when degraded)
- Add responsive Tailwind breakpoints to all 5 dashboard pages
- Add ComponentErrorBoundary for crash-prone chart components
- Log JWT validation errors at debug level instead of silently discarding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Require JWT_SECRET >= 32 characters at startup (prevents weak secrets)
- Add SECURITY comment documenting auth.rs login as dev-only stub
- Add symbol input validation in OrderForm: uppercase, alphanumeric
with dots/hyphens/underscores, max 20 chars, visual error state
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Respond to WebSocket Ping frames with Pong for keepalive detection
- Refactor WS handler to share sender between broadcast and recv tasks
via Arc<Mutex> (required for pong responses from recv task)
- Add vite production build config: source maps, manual chunk splitting
for vendor/charts/query bundles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend:
- Fail fast on empty JWT_SECRET at startup
- Restrict CORS to explicit methods (GET/POST/PUT/DELETE/OPTIONS) and
headers (Authorization, Content-Type) instead of Any
- Add 1MB request body size limit (DefaultBodyLimit)
- Add gRPC status mappings: DeadlineExceeded->408, Cancelled->499,
AlreadyExists->409, ResourceExhausted->429, Unavailable->503
Frontend:
- Guard ErrorBoundary console.error behind import.meta.env.DEV
- Read VITE_API_URL and VITE_WS_URL from env vars with fallbacks
- Add max reconnect attempts (50) to WebSocket manager
- Tune React Query: staleTime 10s, refetchInterval 15s,
disable refetchOnWindowFocus to prevent thundering herd
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trading tests (7): auth gating, no-service 500, order body validation, cancel/account paths
Risk tests (5): auth gating, no-service 500, emergency stop body validation
Total: 61 tests (up from 49)
Also adds web-dashboard/.env.example for production deployment configuration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- EmergencyControls: aria-label on all buttons and confirmation input
- OrderForm: aria-label and aria-pressed on buy/sell toggle buttons
- DashboardLayout: aria-label on navigation
- StatusBar: aria-live on connection status, aria-hidden on decorative indicator dot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- api.ts: intercept 401 responses, clear tokens, redirect to /login
- websocket.ts: fix backoff ordering (increase before scheduling retry)
- All dashboards: add error banners with retry buttons when API queries fail
- MLDashboard: replace hardcoded regime data with WebSocket metrics stream
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Display logged-in username (from JWT sub claim) in status bar
- Add Sign Out button that clears tokens and disconnects WebSocket
- Fix useWebSocket hook with stable empty topics reference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ErrorBoundary: catches unhandled render errors, shows recovery UI
- ProtectedRoute: redirects to /login when not authenticated
- LoginPage: username/password form that calls /api/auth/login
- All dashboard routes now require authentication
- Login page redirects to /trading on success
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- ConfigDashboard: merge fetched API config over defaults instead of ignoring it
- TradingDashboard: wire OrderBook with market_data WebSocket topic
- BacktestingDashboard: wire active backtest status polling and trade results
- PerformanceDashboard: wire sortino_ratio from API, add to PerformanceMetrics type
- Remove unused Vite scaffold react.svg asset
- Set page title to "Foxhunt Trading System"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 5: Trading dashboard with candlestick chart (TradingView lightweight-charts v5),
order book, positions table, order form, and orders table with cancel support.
Phase 6: Risk dashboard with radial gauges (VaR, position utilization, drawdown),
drawdown chart, WebSocket-fed alerts panel, and emergency stop controls.
Phase 7: ML dashboard with model cards (DQN/PPO/TFT/Mamba2), ensemble voting
panel, regime state indicator, and training job progress tracking.
Phase 8: Performance dashboard with metric cards and P&L charts, backtesting
dashboard with strategy form and trade list, config dashboard with tabbed
category editor and audit log.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Vite + React 18 + TypeScript project with:
- Tailwind CSS for styling (dark theme, trading-focused color palette)
- React Router with 6 dashboard routes (Trading, Risk, ML, Performance,
Backtest, Config) and keyboard shortcuts (T/R/M/P/B/C)
- TanStack Query for data fetching with auto-refetch
- Shared lib layer: typed API client, WebSocket manager with auto-reconnect
and topic subscriptions, auth (JWT in localStorage)
- React hooks: useAuth, useApi (query/mutation wrappers), useWebSocket
- DashboardLayout with nav tabs and StatusBar (WS connection, auth status)
- Stub pages with placeholder component layouts matching design doc
Vite proxy configured to forward /api/* to gateway at localhost:3000.
TypeScript passes with zero errors, production build succeeds.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>