fix(race-hub): consume canonical weekend context for #75 review

Address PR #82 review blockers: drop the competing /weekend
default_analysis_session resolver, land bare /race-hub via
/api/v1/weekend-context, derive Live/preparing/partial/unavailable from
authoritative context with a moving clock, hide Local Coverage behind
Diagnostics, isolate the future-session fixture from the shared seed,
and strengthen return-to-Weekend context coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-12 18:49:10 -04:00
parent 7c98489b91
commit 5d5987cc7e
26 changed files with 766 additions and 424 deletions

View File

@@ -30,11 +30,6 @@ func main() {
const meetingKey = 1229
const fullSessionKey = 9472
const coreOnlySessionKey = 9000
// A far-future session inside the same Monaco meeting so bare /race-hub never
// lands on it (default_analysis_session picks the completed race) yet an
// explicit deep link renders the dedicated pre-session view. Kept in the same
// meeting so the Command Center's focus selection is unaffected.
const futureSessionKey = 9600
if err := seedMeeting(st, meetingKey); err != nil {
fail(err)
@@ -64,10 +59,6 @@ func main() {
fail(err)
}
if err := seedFutureSession(st, futureSessionKey, meetingKey); err != nil {
fail(err)
}
fmt.Printf("seeded e2e db at %s\n", *dbPath)
}
@@ -93,28 +84,20 @@ func seedMeeting(st *store.Store, meetingKey int) error {
}
func seedSession(st *store.Store, sessionKey, meetingKey int, name string) error {
start, end := "2025-05-25T13:00:00+00:00", "2025-05-25T15:00:00+00:00"
// Core-only is an earlier weekend session so Weekend Context's
// default_analysis_session prefers the later full Race.
if name == "Core Only" {
start, end = "2025-05-24T13:00:00+00:00", "2025-05-24T15:00:00+00:00"
}
return st.UpsertSession(store.Session{
SessionKey: sessionKey,
MeetingKey: meetingKey,
SessionName: name,
SessionType: "Race",
CircuitKey: 10,
DateStart: "2025-05-25T13:00:00+00:00",
DateEnd: "2025-05-25T15:00:00+00:00",
})
}
func seedFutureSession(st *store.Store, sessionKey, meetingKey int) error {
// Far-future date so this session is always "upcoming" relative to the wall
// clock and renders the pre-session view on an explicit deep link.
return st.UpsertSession(store.Session{
SessionKey: sessionKey,
MeetingKey: meetingKey,
SessionName: "Future Sprint",
SessionType: "Race",
CircuitKey: 10,
DateStart: "2099-05-25T13:00:00+00:00",
DateEnd: "2099-05-25T15:00:00+00:00",
DateStart: start,
DateEnd: end,
})
}