Skip to content

feat(league): League Mode v1 — Phase 1 shared infrastructure#243

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/create-mini-league-sprint-season
Draft

feat(league): League Mode v1 — Phase 1 shared infrastructure#243
Copilot wants to merge 2 commits intomasterfrom
copilot/create-mini-league-sprint-season

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

  • Phase 1 — Shared infrastructure (committed c118208)
    • 1.1 ID generators: generateSeasonId, generateSeasonTeamId, generateSeasonGameId
    • 1.2 teams schema v0 → v1 (autogen + activeLeagueIds, identity migration)
    • 1.3 New RxDB collections: seasons, seasonTeams, seasonGames, seasonPlayerState
    • 1.4 Ruleset module (CURRENT_RULESET_VERSION=1, pitcher fatigue constants)
    • 1.5 canonicalJSON.ts utility
    • 1.6 SaveStore bundle v2 (discriminated union, export/import, tombstone)
    • 1.7 Sanctioned-write capability + CustomTeamLockedError + lock
    • Test fix: COL23 in customTeamImportStore.test.ts — db.close() before freshDb
  • Phase 2 — Schedule generator + sim engine ← IN PROGRESS
    • 2.1 deriveScheduledGameSeed helper
    • 2.2 Round-robin schedule generator with bye support
    • 2.3 Headless per-game sim runner (10-step atomic flow)
    • 2.4 Pitcher fatigue updater (post-game recovery recalculation)
    • 2.5 AI rotation policy (SP/RP eligibility)
    • 2.6 SeasonModifiers type (v1: pitcher availability only)
    • 2.7 Sim-to-next-user-game batch loop
    • 2.8 Stale in_progress game reset on startup
    • 2.9 Season standings derivation
    • 2.10 Unit tests for all above
  • Phase 3 — Team autogeneration engine
  • Phase 4 — Routing + GamePage league context integration
  • Phase 5 — UI (LeaguesHubPage, LeagueSetupWizard, SeasonHome/Schedule/TeamPage)
  • Phase 6 — Final audits (@simulation-correctness, @baseball-manager)
  • Phase 7 — E2E coverage

…umps, league collections, ruleset, canonicalJSON, SaveStore v2, sanctioned writes

- 1.1 generateSeasonId/SeasonTeamId/SeasonGameId in generateId.ts
- 1.2 teams schema v0→v1 with migrationStrategies + RxDBMigrationSchemaPlugin
- 1.3 seasons/seasonTeams/seasonGames/seasonPlayerState collections + types
- 1.4 CURRENT_RULESET_VERSION + pitcherFatigueConstants
- 1.5 canonicalJSON deterministic serializer
- 1.6 SaveStore v2 export/import bundle + discriminated union types
- 1.7 SANCTIONED_WRITE_CTX + withSanctionedCustomTeamWrite + CustomTeamLockedError + update() lock
- All required unit tests
- Fix RxDB OSS 16-collection limit: close db before db2 in round-trip tests
- Add _resetDbSingletonForTests to db.ts for test isolation

Co-authored-by: maniator <539579+maniator@users.noreply.github.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blipit-legends Ready Ready Preview, Comment Apr 22, 2026 7:53pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants