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
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Changelog

## [1.0.0] - 2026-04-28

First stable public milestone for Mr. Baseball Dynasty.

### Launch Candidates

- LC-1, save health: safe save-load recovery dialog and corrupt-save export/delete/retry path. PR #64, `e17edba`.
- LC-2, guided start: first-ten-minute nudges for new saves without schema churn. PR #66, `1b51d2e`.
- LC-3, mobile survival: touch targets, portrait layout, viewport audit. PR #68, `cd1f975`.
- LC-4, stale-cache survival: service-worker update path and dead-chunk reload recovery. PR #65, `454076f`.
- LC-5, bundle cleanup: eliminated circular worker chunks. PR #67, `dd45da4`.
- LC-6, launch prep: README, changelog, landing copy, feedback path, version/meta prep. PR pending from `codex/launch-candidate-landing-feedback-lc6`.

### Narrative Depth Waves

- Wave 10: career capstone prose for awards, Hall of Fame, retirement, jersey legacy, farewell tours, and prospect/debut coverage. PR #63, `bc3b8e8`.
- Wave 9: weekly cadence moments: hot/cold streaks, closer weeks, bench clutch weeks, bullpen overwork. Schema v33. PR #62, `41eb26d`.
- Wave 8: player micro-arcs: injury returns, trade-deadline sparks, September call-ups. Schema v32. PR #61, `019a82d`.
- Wave 7: position-group narratives for rotations, bullpens, and lineups. Schema v31. PR #60, `46a24ae`.
- Wave 6: dynasty-marker moments: three-peats, era-ending collapses, perennial contenders. Schema v30. PR #59, `f8ae0b3`.
- Wave 5: player-arc signature moments: redemption, late-career peak, rookie breakout. Schema v29. PR #55, `6f14ee7`.
- Waves 3-4: expanded team identity, rivalry, milestone, nickname, and persisted-state fidelity work. Schemas v26-v27. PRs #46-#47.
- Waves 1-2: team identity and rivalry foundation, season identity moments, and dashboard surfacing. Schemas v23-v25. PRs #34, #42, #43.
- Waves 11-12 were deferred from v1 after the narrative freeze; v1.0.0 ships the stable Wave 10 narrative surface plus launch hardening.

### Dashboard And League Surface

- Career Retrospective, Season Story Reel, player arcs, Franchise Legacy, Chase Watch, Pennant Race, Award Race, and This Week in History shipped across PRs #37-#41, #54, #57, #58.
- Team identity moments moved from backend-only state into GM Career, dashboard, and filterable UI surfaces. PRs #32-#36.
- Mobile survival pass confirms 14 routes and 8 modal/sheet surfaces are touch-safe at 375x667, 360x640, and 414x896.

### Simulation And Systems

- Day One front-office hook shipped with AGM selection, org review, goals, budget, opening-day plan, development posture, crisis, and recap. PR #20 lineage, April 13 closeout.
- Living league systems shipped before v1: GM relationships, multi-round negotiation, multi-team trades, league events, relationship effects, scouting uncertainty, breakout/regression, playoff momentum.
- Trade deadline, arbitration, holdouts, finance calibration, schedule calibration, and reliability/calibration spines landed through PRs #23-#31.

### Save And Determinism

- Current save schema: v33.
- v1.0.0 does not bump schema.
- Save migrations remained additive through the launch cycle, with fixtures for each schema bump.
- Randomness remains centralized through seeded PRNG paths; launch work did not touch sim RNG.

### Verification State

- Launch baseline: `origin/main` `cd1f9753a9fd530deaf0544720430186850b9918`.
- Last known bundle ceilings after LC-5: worker raw 443 KB, gzip 143 KB.
- Final LC-6 verification gate is tracked in `apps/web/docs/lc6-launch-prep-audit.md`.

## Pre-1.0 Development Road

### April 2026 Rebuild Phases

- Phases 1-10: rebuilt the browser sim foundation, core league model, roster/economy loops, deterministic save/load, and first playable management surfaces.
- Phases 11-14: expanded front-office systems, trade/finance/scouting depth, relationship effects, and worker-backed UI routing.
- Phase 15: broadcast layer: game recaps, play-by-play, trade deadline theatre, draft buzz, ticker/news/consequence integration.
- Phase 16: war-room polish: visualizations, lineup tools, Recharts/dnd-kit surfaces, production recovery polish, PWA icons, README, and deploy readiness.
- Phase 18: public-facing app surface and MLB-proof rebrand: achievements, rivalries, owner intel, pulse, scenarios, original 32-team league identity.

### Hardening Before Launch

- Infra hardening added multi-year smoke gates and playtest narrative dumps. PR #48, `1c6d79d`.
- Branch protection was enabled after a red-CI merge cascade, requiring `Typecheck -> Test -> Build`.
- Bundle budget comments became the canonical journal for intentional ceiling changes.
- Durable handoffs moved launch work into isolated worktrees with slice-level verification.
85 changes: 47 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,69 @@
# Mr. Baseball Dynasty

A deep baseball franchise dynasty simulator. Build your front office, draft prospects, make trades, and pursue championships across decades.
Browser-based baseball franchise dynasty simulation. Build a front office, make baseball decisions, and watch a deterministic league history unfold across seasons.

**[PLAY NOW](https://kevinbigham.github.io/MBD/)**
**Play:** [kevinbigham.github.io/MBD](https://kevinbigham.github.io/MBD/)

---
## Screenshots

## What Is This?
![Save hub](apps/web/public/screenshots/landing-save-hub.jpg)

Mr. Baseball Dynasty (MBD) is a browser-based, single-player baseball management sim. You take over as GM of a franchise and guide it through seasons of roster moves, scouting, player development, trades, free agency, and postseason runs. Every decision ripples forward through a fully deterministic simulation engine.
![Dashboard desktop](apps/web/public/screenshots/dashboard-desktop.jpg)

### Features
![Pennant race board](apps/web/public/screenshots/pennant-race-board.jpg)

- **Full Season Simulation** -- Day-by-day sim with box scores, standings, and stat tracking
- **Scouting & Draft** -- Amateur draft, international free agents, scout assignments, prospect rankings
- **Player Development** -- Minor league system, development curves, attribute progression
- **Trade Engine** -- AI-driven trade proposals, counter-offers, deadline deals
- **Free Agency** -- Bidding, contract negotiations, salary cap management
- **GM Career Mode** -- Get hired, get fired, build a legacy across multiple franchises
- **History & Records** -- Hall of Fame, record books, season archives, dynasty cards
- **Press Room** -- Generated narratives, story arcs, press conferences
- **War Room Visualizations** -- Recharts-powered charts, radar plots, sparklines, drag-and-drop lineup builder
- **PWA Support** -- Install as an app on desktop or mobile, works offline
- **Deterministic Engine** -- Seeded RNG means every save produces identical results on replay
![Mobile dashboard](apps/web/public/screenshots/dashboard-mobile.jpg)

## What It Is

- A single-player franchise sim about roster building, player development, payroll pressure, scouting, trades, drafts, free agency, playoffs, and long-term consequences.
- A deterministic save-driven simulation: the same seed and same decisions produce the same league.
- A dynasty history machine: records, awards, rivalries, story reels, career retrospectives, and franchise memory accumulate over time.
- A local-first browser game using IndexedDB saves and a web-worker sim engine.

## What It Is Not

- Not an MLB-licensed product.
- Not fantasy sports, betting, packs, loot boxes, or pay-to-win.
- Not a twitch game. Most value comes from planning, simming, reading the league, and making tradeoffs.
- Not a finished forever-game. v1.0.0 is the first stable public milestone.

## How To Play

1. Open the live URL.
2. Start a new dynasty from the Save Hub.
3. Pick a club, choose Quick Start or Full Day One, and enter the front office.
4. Advance by day, week, or month.
5. Use the dashboard, roster, minors, draft, trade, finance, scouting, league, history, and press-room views to steer the franchise.
6. Follow the dynasty through seasons: standings, playoff races, player arcs, awards, records, and owner pressure all compound.

## Tech Stack

- **Frontend:** React 18, TypeScript (strict), Vite 6, Tailwind CSS
- **State:** Zustand stores, Dexie (IndexedDB) for saves
- **Simulation:** Pure TypeScript engine running in a Web Worker via Comlink
- **Visualization:** Recharts, @dnd-kit
- **Design:** Bloomberg Terminal aesthetic with custom design tokens
- **Testing:** Vitest (700+ tests across sim-core and web app)
- **Monorepo:** pnpm workspaces + Turborepo
TypeScript strict mode, React 18, Vite 6, Tailwind CSS, Zustand, Dexie, Comlink web workers, pure-rand, Zod contracts, Vitest, pnpm, and Turbo.

## Architecture
## Contributors

```
mr-baseball-dynasty/
apps/web/ React frontend (17 feature pages)
packages/sim-core/ Pure simulation engine (no DOM, no React)
packages/contracts/ Zod schemas shared between packages
packages/ui/ Shared UI component library
packages/design-tokens/ Color, typography, spacing tokens
Active code lives in `mr-baseball-dynasty/`.

```bash
npx pnpm install
npx pnpm verify
```

## Development
Focused gates used before release:

```bash
# Prerequisites: Node 20+, pnpm 9+
pnpm install
pnpm dev # Start dev server (apps/web)
pnpm test # Run all tests
pnpm build # Production build
cd packages/sim-core && npx pnpm typecheck && npx vitest run
cd ../contracts && npx pnpm typecheck && npx vitest run
cd ../../apps/web && npx pnpm typecheck && npx vitest run && npx vite build
```

Do not touch save schema without a version bump, migration, backwards-compat note, and fixture. Do not use `Math.random()` in sim code.

## License

Private project. All rights reserved.

## Credits

Built by Kevin Bigham with AI-assisted implementation across Codex and Claude Code sessions.
133 changes: 133 additions & 0 deletions apps/web/docs/lc6-launch-prep-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# LC-6 Launch Prep Audit

Baseline verified on 2026-04-28 from `origin/main`:

- `origin/main`: `cd1f9753a9fd530deaf0544720430186850b9918`
- Latest commits: `#68` LC-3 mobile survival, `#67` LC-5 circular worker chunk cleanup, `#66` LC-2 guided start.
- Save schema: `CURRENT_GAME_SNAPSHOT_VERSION = 33` in `packages/contracts/src/schemas/save.ts`.
- Schema bump required for LC-6: none.

## Audit Summary

### 1. Current Landing Route

- Root route `/` renders `SetupPage` via `apps/web/src/app/routes/index.tsx`.
- Route label is `Save Hub`; there is no separate `apps/web/src/features/landing/` module yet.
- Pre-save state: `SetupPage` shows "Welcome to Mr. Baseball Dynasty", "New Dynasty", and the five save slots. Empty slots say "Reserved for a fresh dynasty build."
- Post-save state: the same route lists saved dynasties with continue/delete/branch controls. If a game is initialized in memory, it also shows "Return to Dashboard".
- New saves route to `/onboarding`; existing saves route to `/dashboard`.

### 2. Current README State

- Last meaningful README update: `2026-04-10` (`1d7a9d5 feat: wire everything sweep`); original README added `2026-04-04`.
- Present sections: title, one-paragraph overview, Play Now link, feature list, tech stack, architecture, development commands, license.
- Missing for v1.0.0: screenshots, "what it is / what it is not" framing, concise play instructions, launch-candidate context, contributor verification command, credits.
- Current length is under 200 lines but still reads like an internal feature inventory.

### 3. Current CHANGELOG State

- `CHANGELOG.md` does not exist at repo root.
- Source of truth for phase/wave/LC history remains `.codex/MBD/changelog.md` and `.codex/MBD/status.md`; LC-6 will create a reader-facing root changelog.

### 4. Current Feedback Path

- No in-app feedback feature exists under `apps/web/src/features/feedback/`.
- No `feedback`, `mailto`, `supabase`, `createClient`, `VITE_SUPABASE`, or `SUPABASE` wiring was found in app source or repo config.
- LC-6 should ship the mailto fallback path unless Kevin separately adds Supabase configuration and a `feedback` table.
- Privacy baseline: no analytics or user identity collection exists for feedback today.

### 5. Version Strings

- Root `package.json`: `0.0.1`.
- `apps/web/package.json`: `0.0.1`.
- Displayed app footer/about copy: `Mr. Baseball Dynasty v0.0.1` in `apps/web/src/features/settings/routes/SettingsPage.tsx`.
- `apps/web/index.html` title/meta: "Mr. Baseball Dynasty" with pre-v1 descriptive copy and no `og:image`.
- Acceptance target: `1.0.0` in package metadata and `v1.0.0` in displayed UI copy.

### 6. Test Oracle

- Landing/save hub render and create/continue flows: `apps/web/src/features/setup/routes/SetupPage.test.tsx`.
- Route wiring for `/` and nested app routes: `apps/web/src/app/routes/index.test.tsx`.
- Settings render and interactions: `apps/web/src/features/settings/routes/SettingsPage.test.tsx`.
- Root app routing/error-boundary shell: `apps/web/src/app/App.test.tsx`.
- Existing tests do not cover feedback because no feedback flow exists yet.

## Slice Progress Ledger

- Slice 1, baseline audit: complete.
- Slice 2, screenshots: complete.
- Slice 3, README rewrite: complete.
- Slice 4, changelog: complete.
- Slice 5, feedback widget: complete.
- Slice 6, version bump and meta: complete.
- Slice 7, final verification: complete.

## Self-Critique Gate

- Schema bump? Expected none. Current schema is v33.
- RNG safety? No sim code touched. Feedback uses no RNG, `Math.random()`, or `Date.now()`.
- Save compatibility? No save shape changes.
- Tests run? Yes. See the final gate entries below.
- Files outside scope? `apps/web/docs/lc6-launch-prep-audit.md` is required by the LC-6 slice plan. `package.json` at repo root was also bumped to `1.0.0` because the pre-edit audit identified it as a version string and the acceptance gate requires version consistency.
- Version strings consistent? Yes: root `package.json`, `apps/web/package.json`, Settings About copy, and `apps/web/index.html` meta/title now show `1.0.0` / `v1.0.0`.
- Feedback widget privacy? Implemented as explicit user-entered fields only. Mailto body includes type, report body, and optional contact only when typed; no user agent, URL, email scraping, or device fingerprint is included.

## Test Results

- Not run for slice 1. Audit-only slice.
- Not run for slice 2. Screenshot-only slice.
- Not run for slice 3. README-only slice; visual inspection and `wc -l README.md` (`69`) passed.
- Not run for slice 4. Changelog-only slice; visual inspection and `wc -l CHANGELOG.md` (`68`) passed.
- `cd apps/web && npx vitest run src/features/feedback/__tests__/FeedbackForm.test.tsx src/features/settings/routes/SettingsPage.test.tsx` passed: 2 files, 11 tests.
- `cd apps/web && npx pnpm typecheck` passed.
- `cd apps/web && npx vitest run` passed: 98 files, 621 tests. Existing jsdom/Recharts and mocked-worker stderr warnings remain.
- `cd apps/web && npx vitest run src/features/setup/routes/SetupPage.test.tsx src/features/settings/routes/SettingsPage.test.tsx` passed: 2 files, 13 tests.
- `cd apps/web && npx pnpm typecheck` passed after the version/meta slice.
- `cd apps/web && npx vitest run` passed after the version/meta slice: 98 files, 621 tests. Existing jsdom/Recharts and mocked-worker stderr warnings remain.
- `cd apps/web && npx vite build` passed. Built `dist/index.html` contains the `v1.0.0` title, description, OG title, OG description, and `og:image`.
- `cd packages/sim-core && npx pnpm typecheck && npx vitest run` passed: 137 files, 1608 tests.
- `cd packages/contracts && npx pnpm typecheck && npx vitest run` passed: 1 file, 18 tests.
- `cd apps/web && npx pnpm typecheck && npx vitest run && npx vite build` passed: 98 files, 621 tests, production build emitted `dist/`.
- `cd apps/web && npx vitest run src/build/bundleBudget.test.ts` passed: 1 file, 1 test.
- `rg "CURRENT_GAME_SNAPSHOT_VERSION" packages/contracts/src/schemas/save.ts` confirms `CURRENT_GAME_SNAPSHOT_VERSION = 33`.

## Files Touched

- `apps/web/docs/lc6-launch-prep-audit.md`
- `apps/web/public/screenshots/career-retrospective.jpg`
- `apps/web/public/screenshots/dashboard-desktop.jpg`
- `apps/web/public/screenshots/dashboard-mobile.jpg`
- `apps/web/public/screenshots/landing-save-hub.jpg`
- `apps/web/public/screenshots/pennant-race-board.jpg`
- `apps/web/public/screenshots/season-story-reel.jpg`
- `README.md`
- `CHANGELOG.md`
- `apps/web/src/features/feedback/FeedbackButton.tsx`
- `apps/web/src/features/feedback/FeedbackForm.tsx`
- `apps/web/src/features/feedback/feedbackSubmit.ts`
- `apps/web/src/features/feedback/index.ts`
- `apps/web/src/features/feedback/__tests__/FeedbackForm.test.tsx`
- `apps/web/src/features/settings/routes/SettingsPage.tsx`
- `apps/web/src/features/settings/routes/SettingsPage.test.tsx`
- `apps/web/src/features/setup/routes/SetupPage.tsx`
- `apps/web/src/features/setup/routes/SetupPage.test.tsx`
- `apps/web/package.json`
- `package.json`
- `apps/web/index.html`

## Screenshot Notes

- Total screenshot payload: `364 KB`, below the `1.5 MB` budget.
- Live browser capture path: Vite dev server at `http://127.0.0.1:5173/MBD/`, Quick Start save, Marcus Chen AGM, real dashboard, real Pennant Race board, real Career Retrospective card, real mobile dashboard.
- The short generated save did not expose a Season Story Reel trigger, matching the LC-3 audit note that dashboard story modals were not available in the day-zero browser save. `season-story-reel.jpg` is a styled reference using the existing Season Story Reel test fixture copy and the live app stylesheet; no source files were changed to create it.

## v1.0.0 Readiness Checklist

- [x] README rewritten and screenshot links resolve.
- [x] CHANGELOG created with v1.0.0 launch narrative.
- [x] Feedback widget ships with mailto fallback or existing Supabase insert.
- [x] Version strings updated to `1.0.0` / `v1.0.0`.
- [x] Screenshots committed under 1.5 MB total.
- [x] Schema remains v33.
- [x] Bundle ceilings hold.
- [x] Full verification gate passes.
10 changes: 6 additions & 4 deletions apps/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0" />
<title>Mr. Baseball Dynasty</title>
<meta name="description" content="A deep baseball franchise dynasty simulator. Build your front office, draft prospects, make trades, and pursue championships across decades." />
<title>Mr. Baseball Dynasty v1.0.0</title>
<meta name="description" content="A browser-based baseball franchise dynasty sim for long saves, front-office decisions, and multi-season stories." />
<meta name="theme-color" content="#0B1020" />
<meta property="og:title" content="Mr. Baseball Dynasty" />
<meta property="og:description" content="A deep baseball franchise dynasty simulator. Build your front office, draft prospects, make trades, and pursue championships." />
<meta property="og:title" content="Mr. Baseball Dynasty v1.0.0" />
<meta property="og:description" content="Draft, trade, develop, spend, and manage a baseball dynasty across seasons." />
<meta property="og:image" content="https://kevinbigham.github.io/MBD/screenshots/dashboard-desktop.jpg" />
<meta property="og:image:alt" content="Mr. Baseball Dynasty dashboard screenshot" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://kevinbigham.github.io/MBD/" />
<link rel="icon" href="/MBD/icon.svg" type="image/svg+xml" />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mbd/web",
"version": "0.0.1",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/screenshots/dashboard-mobile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/screenshots/landing-save-hub.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/screenshots/season-story-reel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading