Add canonical ID pipeline and fix UUID consistency for CloudKit sync

- Add local canonicalization pipeline (stadiums, teams, games) that generates
  deterministic canonical IDs before CloudKit upload
- Fix CanonicalSyncService to use deterministic UUIDs from canonical IDs
  instead of random UUIDs from CloudKit records
- Add SyncStadium/SyncTeam/SyncGame types to CloudKitService that preserve
  canonical ID relationships during sync
- Add canonical ID field keys to CKModels for reading from CloudKit records
- Bundle canonical JSON files (stadiums_canonical, teams_canonical,
  games_canonical, stadium_aliases) for consistent bootstrap data
- Update BootstrapService to prefer canonical format files over legacy format

This ensures all entities use consistent deterministic UUIDs derived from
their canonical IDs, preventing duplicate records when syncing CloudKit
data with bootstrapped local data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-09 10:30:09 -06:00
parent 1ee47df53e
commit 7efcea7bd4
31 changed files with 128868 additions and 282 deletions

View File

@@ -8324,21 +8324,6 @@
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_mia_chi_0108",
"sport": "NBA",
"season": "2025-26",
"date": "2026-01-08",
"time": "8:00p",
"home_team": "Chicago Bulls",
"away_team": "Miami Heat",
"home_team_abbrev": "CHI",
"away_team_abbrev": "MIA",
"venue": "United Center",
"source": "basketball-reference.com",
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_cle_min_0108",
"sport": "NBA",
@@ -9194,21 +9179,6 @@
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_chi_brk_0116",
"sport": "NBA",
"season": "2025-26",
"date": "2026-01-16",
"time": "7:00p",
"home_team": "Brooklyn Nets",
"away_team": "Chicago Bulls",
"home_team_abbrev": "BRK",
"away_team_abbrev": "CHI",
"venue": "Barclays Center",
"source": "basketball-reference.com",
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_nop_ind_0116",
"sport": "NBA",
@@ -9239,6 +9209,21 @@
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_chi_brk_0116",
"sport": "NBA",
"season": "2025-26",
"date": "2026-01-16",
"time": "7:30p",
"home_team": "Brooklyn Nets",
"away_team": "Chicago Bulls",
"home_team_abbrev": "BRK",
"away_team_abbrev": "CHI",
"venue": "Barclays Center",
"source": "basketball-reference.com",
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_lac_tor_0116",
"sport": "NBA",
@@ -10844,6 +10829,21 @@
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_lac_den_0130",
"sport": "NBA",
"season": "2025-26",
"date": "2026-01-30",
"time": "9:00p",
"home_team": "Denver Nuggets",
"away_team": "Los Angeles Clippers",
"home_team_abbrev": "DEN",
"away_team_abbrev": "LAC",
"venue": "Ball Arena",
"source": "basketball-reference.com",
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_cle_pho_0130",
"sport": "NBA",
@@ -10874,21 +10874,6 @@
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_lac_den_0130",
"sport": "NBA",
"season": "2025-26",
"date": "2026-01-30",
"time": "10:00p",
"home_team": "Denver Nuggets",
"away_team": "Los Angeles Clippers",
"home_team_abbrev": "DEN",
"away_team_abbrev": "LAC",
"venue": "Ball Arena",
"source": "basketball-reference.com",
"is_playoff": false,
"broadcast": null
},
{
"id": "nba_202526_det_gsw_0130",
"sport": "NBA",
@@ -40624,7 +40609,7 @@
"sport": "MLB",
"season": "2026",
"date": "2026-07-18",
"time": "23:15",
"time": "00:08",
"home_team": "New York Yankees",
"away_team": "Los Angeles Dodgers",
"home_team_abbrev": "NYY",
@@ -52819,7 +52804,7 @@
"sport": "MLB",
"season": "2026",
"date": "2026-09-17",
"time": "23:10",
"time": "23:15",
"home_team": "New York Mets",
"away_team": "Philadelphia Phillies",
"home_team_abbrev": "NYM",