Production changes:
- TravelEstimator: remove 300mi fallback, return nil on missing coords
- TripPlanningEngine: add warnings array, empty sports warning, inverted
date range rejection, must-stop filter, segment validation gate
- GameDAGRouter: add routePreference parameter with preference-aware
bucket ordering and sorting in selectDiverseRoutes()
- ScenarioA-E: pass routePreference through to GameDAGRouter
- ScenarioA: track games with missing stadium data
- ScenarioE: add region filtering for home games
- TravelSegment: add requiresOvernightStop and travelDays() helpers
Test changes:
- GameDAGRouterTests: +252 lines for route preference verification
- TripPlanningEngineTests: +153 lines for segment validation, date range,
empty sports
- ScenarioEPlannerTests: +119 lines for region filter tests
- TravelEstimatorTests: remove obsolete fallback distance tests
- ItineraryBuilderTests: update nil-coords test expectation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The hardening pass incorrectly changed Game.gameDate to use UTC, which
broke timezone-dependent departure date calculations in ScenarioDPlanner.
Also widened the DAG router test's same-day game gap to account for the
new 3-hour game duration in canTransition.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminate redundant 0-mile travel segments when start/end city matches
the first/last game stop city, and fail early when no games exist at
endpoint cities within the selected date range.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Planning engine fixes (from adversarial code review):
- Bug #1: sortByLeisure tie-breaking uses totalDrivingHours
- Bug #2: allDates/calculateRestDays guard-let-break prevents infinite loop
- Bug #3: same-day trip no longer rejected (>= in dateRange guard)
- Bug #4: ScenarioD rationale shows game count not stop count
- Bug #5: ScenarioD departureDate advanced to next day after last game
- Bug #6: ScenarioC date range boundary uses <= instead of <
- Bug #7: DrivingConstraints clamps maxHoursPerDriverPerDay via max(1.0,...)
- Bug #8: effectiveTripDuration uses inclusive day counting (+1)
- Bug #9: TripWizardViewModel validates endDate >= startDate
- Bug #10: allDates() uses min/max instead of first/last for robustness
- Bug #12: arrivalBeforeGameStart accounts for game end time at departure
- Bug #15: ScenarioBPlanner replaces force unwraps with safe unwrapping
Tests: 16 regression test suites + updated existing test expectations
Marketing: Remotion canvas set to 886x1920 for App Store preview spec
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add TravelInfo initializers and city normalization helpers to fix repeat
city-pair disambiguation. Improve drag-and-drop reordering with segment
index tracking and source-row-aware zone calculation. Enhance all five
scenario planners with better next-day departure handling and travel
segment placement. Add comprehensive tests across all planners.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove Scripts/ directory (scraper no longer needed)
- Add themed background documentation to CLAUDE.md
- Add .gitignore for marketing-videos to prevent node_modules tracking
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two bugs fixed in "By Games" trip planning mode:
1. Calendar navigation: DateRangePicker now navigates to the selected
game's month when startDate changes externally, instead of staying
on the current month.
2. Date range calculation: Fixed race condition where date range was
calculated before games were loaded. Now updateDateRangeForSelectedGames()
is called after loadSummaryGames() completes.
3. Bonus games: planTrip() now uses the UI-selected 7-day date range
instead of overriding it with just the anchor game dates. This allows
ScenarioBPlanner to find additional games within the trip window.
Added regression tests to verify gameFirst mode includes bonus games.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This refactor fixes the achievement system by using stable canonical string
IDs (e.g., "stadium_mlb_fenway_park") instead of random UUIDs. This ensures
stadium mappings for achievements are consistent across app launches and
CloudKit sync operations.
Changes:
- Stadium, Team, Game: id property changed from UUID to String
- Trip, TripStop, TripPreferences: updated to use String IDs for games/stadiums
- CKModels: removed UUID parsing, use canonical IDs directly
- AchievementEngine: now matches against canonical stadium IDs
- All test files updated to use String IDs instead of UUID()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Lock all maps to North America (no pan/zoom) in ProgressMapView and TripDetailView
- Sort saved trips by most cities (stops count)
- Filter cross-country trips to top 2 by stops on home screen
- Use LocationSearchSheet for Follow Team home location (consistent with must-stop)
- Initialize DateRangePicker to show selected dates on appear
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a new planning mode that lets users follow a team's schedule
(home + away games) and builds multi-city routes accordingly.
Key changes:
- New ScenarioDPlanner with team filtering and route generation
- Team picker UI with sport grouping and search
- Fix TravelEstimator 5-day limit (was 2-day) for cross-country routes
- Fix DateInterval end boundary to include games on last day
- Comprehensive test suite covering edge cases:
- Multi-city routes with adequate/insufficient time
- Optimal game selection per city for feasibility
- 5-day driving segment limits
- Multiple driver scenarios
Enables trips like Houston → Chicago → Anaheim following the Astros.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement comprehensive test infrastructure and all 124 tests across 11 phases:
- Phase 0: Test infrastructure (fixtures, mocks, helpers)
- Phases 1-10: Core planning engine tests (previously implemented)
- Phase 11: Edge case omnibus (11 new tests)
- Data edge cases: nil stadiums, malformed dates, invalid coordinates
- Boundary conditions: driving limits, radius boundaries
- Time zone cases: cross-timezone games, DST transitions
Reorganize test structure under Planning/ directory with proper organization.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>