Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/web/src/workers/sim.worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,20 @@ describe('sim worker narrative APIs', () => {
expect(wins.filter((winTotal) => winTotal < 81).length).toBeGreaterThanOrEqual(10);
});

it('keeps setup preview projections conservative instead of clustering at 97 wins', () => {
const workerApi = api as typeof api & MinorLeagueWorkerApi;
const wins = TEAMS.map((team) => parseProjectedWins(workerApi.getSetupPreview({
seed: 2124,
userTeamId: team.id,
difficulty: 'standard',
}).projectedRecord));

expect(Math.max(...wins)).toBeLessThanOrEqual(95);
expect(wins.filter((winTotal) => winTotal >= 95)).toHaveLength(1);
expect(wins.filter((winTotal) => winTotal >= 90).length).toBeLessThanOrEqual(6);
expect(wins.filter((winTotal) => winTotal >= 97)).toHaveLength(0);
});

it('initializes career mode and exposes the GM career ledger', () => {
startGameWithOptions({
seed: 919,
Expand Down
4 changes: 2 additions & 2 deletions packages/sim-core/src/onboarding/dayOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ interface DayOneTeamMetadata {

const REQUIRED_LINEUP_POSITIONS: readonly Position[] = ['C', '1B', '2B', '3B', 'SS', 'LF', 'CF', 'RF', 'DH'];
const LEAGUE_AVERAGE_WINS = 81;
const PROJECTED_WIN_MAX_SPREAD = 20;
const PROJECTED_WIN_CURVE_EXPONENT = 0.82;
const PROJECTED_WIN_MAX_SPREAD = 14;
const PROJECTED_WIN_CURVE_EXPONENT = 1.2;
const ROSTER_WIN_WEIGHTS = {
offense: 0.4,
rotation: 0.34,
Expand Down
10 changes: 10 additions & 0 deletions packages/sim-core/tests/dayOne.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ describe('day one helpers', () => {
expect(wins.filter((winTotal) => winTotal < 81).length).toBeGreaterThanOrEqual(10);
});

it('keeps setup projections conservative instead of assigning many elite records', () => {
const players = generateLeaguePlayers(new GameRNG(2124), TEAMS.map((team) => team.id));
const wins = TEAMS.map((team) => buildDayOneOrgReview(players, team.id).projectedWins);

expect(Math.max(...wins)).toBeLessThanOrEqual(95);
expect(wins.filter((winTotal) => winTotal >= 95)).toHaveLength(1);
expect(wins.filter((winTotal) => winTotal >= 90).length).toBeLessThanOrEqual(6);
expect(wins.filter((winTotal) => winTotal >= 97)).toHaveLength(0);
});

it('builds deterministic teaser copy from the same team and Day One choices', () => {
const context = {
teamId: 'hou',
Expand Down
Loading