{"openapi":"3.1.0","info":{"title":"F1 Race Analysis","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/races":{"get":{"summary":"Races List","operationId":"races_list_races_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/race":{"get":{"summary":"Race Dashboard","operationId":"race_dashboard_race_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/settings":{"get":{"summary":"Settings Page","operationId":"settings_page_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/chat":{"get":{"summary":"Chat Page","operationId":"chat_page_chat_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sw.js":{"get":{"summary":"Service Worker","operationId":"service_worker_sw_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/icon.png":{"get":{"summary":"Notification Icon","operationId":"notification_icon_icon_png_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/push/vapid-public-key":{"get":{"summary":"Push Vapid Public Key","operationId":"push_vapid_public_key_push_vapid_public_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/push/subscribe":{"post":{"summary":"Push Subscribe","operationId":"push_subscribe_push_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/push/preferences":{"get":{"summary":"Push Preferences","description":"Backs the settings page's initial render -- the homepage's push-card\nnever had to read this back (it trusts its own localStorage instead),\nbut a dedicated settings page needs the server's actual saved state,\nsince that's the only copy that's consistent across browsers/devices.","operationId":"push_preferences_push_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Push Update Preferences","operationId":"push_update_preferences_push_preferences_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushPreferencesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/push/unsubscribe":{"post":{"summary":"Push Unsubscribe","description":"'Forget this device' -- the browser-side PushSubscription.unsubscribe()\ncall happens in the frontend (only the browser can invalidate its own\nsubscription); this just drops our copy so send_push stops finding\nanything to send to, same as if it had never been set up.","operationId":"push_unsubscribe_push_unsubscribe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sessions":{"get":{"summary":"List Sessions","description":"Backs the homepage's race picker. Only race-* dirs (excludes ad-hoc\ntest fixtures like test-milestone0, which have no race_meta.json/full\npipeline output and aren't real dashboards).","operationId":"list_sessions_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/session/info":{"get":{"summary":"Session Info","operationId":"session_info_session_info_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/interest-options":{"get":{"summary":"Session Interest Options","description":"Backs the onboarding modal's second question. Reuses session_info's\ndisplay-name resolution (SESSION_DISPLAY_NAMES or a generic fallback) as\nthe race identity passed into the web-search prompt -- cached forever\nper session_id on the analysis.py side, so this is a slow ~90s call at\nmost once per race, not per visitor.","operationId":"session_interest_options_session_interest_options_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/status":{"get":{"summary":"Session Status","operationId":"session_status_session_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/session/end":{"post":{"summary":"Session End","operationId":"session_end_session_end_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/session/catchup":{"get":{"summary":"Session Catchup","operationId":"session_catchup_session_catchup_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Since"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/summary":{"get":{"summary":"Session Summary","operationId":"session_summary_session_summary_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/whatif":{"post":{"summary":"Session Whatif","operationId":"session_whatif_session_whatif_post","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatIfRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/timeline":{"get":{"summary":"Session Timeline","operationId":"session_timeline_session_timeline_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/rule-lookup":{"get":{"summary":"Session Rule Lookup","operationId":"session_rule_lookup_session_rule_lookup_get","parameters":[{"name":"around","in":"query","required":true,"schema":{"type":"integer","title":"Around"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/strategy-trend":{"get":{"summary":"Session Strategy Trend","operationId":"session_strategy_trend_session_strategy_trend_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/replay-cutoffs":{"get":{"summary":"Session Replay Cutoffs","operationId":"session_replay_cutoffs_session_replay_cutoffs_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/race-meta":{"get":{"summary":"Session Race Meta","operationId":"session_race_meta_session_race_meta_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/retirements":{"get":{"summary":"Session Retirements","operationId":"session_retirements_session_retirements_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/events":{"get":{"summary":"Session Events","description":"Unlike race-meta/retirements (pure readers), this one CAN trigger\nreal work synchronously on first call for a session with no phrased\nevents yet -- explicit user choice: \"open and it generates live (maybe\n1-2 min)\" over \"show nothing until the next background tick.\" Already-\nphrased events are cached, so repeat calls (or later ones after the\nbackground loop has caught up) are fast.","operationId":"session_events_session_events_get","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/chat":{"post":{"summary":"Session Chat","description":"RAG Q&A over whatever's been indexed for this session so far (see\nrag.py) -- can lag a few minutes behind the very latest lap on a live\nrace, since indexing runs on the same 5-minute background tick as event\nphrasing, not synchronously on every request (that would mean an\nembedding-API round-trip on every single chat message).\n\nKicks off generation on a background thread and returns a run_id right\naway rather than blocking -- the real answer can take up to ~180s\nworst case (local-grounded attempt + web fallback, each up to 90s), and\nblocking the whole request for that with zero feedback, with the answer\njust vanishing on a refresh, was a real problem, not a hypothetical one\n-- see analysis.py's _CHAT_RUNS docstring. The frontend follows up with\nGET /session/chat/stream/{run_id}.","operationId":"session_chat_session_chat_post","parameters":[{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/session/chat/stream/{run_id}":{"get":{"summary":"Session Chat Stream","description":"Server-Sent Events: replays every chunk already generated for this\nrun first (so reattaching after a page refresh picks up mid-answer\ninstead of starting over), then streams new chunks as they arrive, then\na final `done` (carrying the full {answer, sources, answered_via}\nresult) or `error` event.\n\nPolls analysis._CHAT_RUNS every 150ms rather than anything push-based\n-- the run's writer (start_chat_run's background thread) isn't async,\nso there's no asyncio primitive to await on directly, and polling an\nin-memory dict at this interval is cheap enough not to matter for a\nsingle local user.\n\nNo separate \"is this run still alive\" endpoint: if the connection just\ndrops without a `done`/`error` event, that itself is the interrupt\nsignal (EventSource's own onerror fires client-side) -- a real,\nworking alternative to the explicit run-status-polling endpoint a\nsibling project's AID_PIM retrospective describes, which existed there\nbecause that chat transport wasn't SSE to begin with.","operationId":"session_chat_stream_session_chat_stream__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ChatRequest":{"properties":{"question":{"type":"string","title":"Question"},"max_lap":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Lap"}},"type":"object","required":["question"],"title":"ChatRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PushPreferencesRequest":{"properties":{"notify_session_start":{"type":"boolean","title":"Notify Session Start"},"notify_driver_events":{"type":"boolean","title":"Notify Driver Events"},"favorite_driver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Favorite Driver"}},"type":"object","required":["notify_session_start","notify_driver_events"],"title":"PushPreferencesRequest"},"PushSubscribeRequest":{"properties":{"subscription":{"additionalProperties":true,"type":"object","title":"Subscription"},"favorite_driver":{"type":"string","title":"Favorite Driver"}},"type":"object","required":["subscription","favorite_driver"],"title":"PushSubscribeRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WhatIfRequest":{"properties":{"hypothesis":{"type":"string","title":"Hypothesis"}},"type":"object","required":["hypothesis"],"title":"WhatIfRequest"}}}}