v0.5.0 — CREW: roster with good/bad traits (#7) #14

Merged
kamilkrzywda merged 6 commits from crew-roster into master 2026-09-29 01:03:25 +02:00
Owner

Closes #7. Real crew roster — starting crew seeded on new game, members found during exploration join the ship.

  • DB: crew (name, role, trait_good, trait_bad, origin — "STARTING CREW" or ", ")
  • Gen: pure + seeded in lib/game/crew.ts — 16×22 name combos (unique on ship), 8 roles, 10 good + 10 bad trait pools; starting crew of 2–3 with unique roles
  • Exploration: ~18% of scans also yield a joining member (CREW_CHANCE constant, pinned by test); appended to the same per-planet rng stream so existing resource/part outcomes are byte-for-byte unchanged and everything stays deterministic per save+planet; no duplicate joins (one scan per body)
  • API: GET /api/crew; POST /api/explore responses now carry crewFound; OpenAPI updated in code
  • UI: CREW tab renders live roster cards — name + role, +good / −bad traits, ORIGIN line; refetch on tab open (Radix unmounts inactive tabs), no polling; placeholder crew removed for this tab only
  • Tests: unit 29→38 (crew gen shape/determinism, find lands with correct origin, never joins twice under known seed), e2e 10→11 (real cards show both traits; roster survives the mid-run container restart via deep-equality snapshot)

Local verification: tsc ✓, vitest 38/38 ✓, playwright --list ✓, next build clean (7 tab triggers present).

Closes #7. Real crew roster — starting crew seeded on new game, members found during exploration join the ship. - **DB:** `crew` (name, role, trait_good, trait_bad, origin — "STARTING CREW" or "<planet>, <system>") - **Gen:** pure + seeded in lib/game/crew.ts — 16×22 name combos (unique on ship), 8 roles, 10 good + 10 bad trait pools; starting crew of 2–3 with unique roles - **Exploration:** ~18% of scans also yield a joining member (CREW_CHANCE constant, pinned by test); appended to the same per-planet rng stream so existing resource/part outcomes are byte-for-byte unchanged and everything stays deterministic per save+planet; no duplicate joins (one scan per body) - **API:** `GET /api/crew`; POST /api/explore responses now carry `crewFound`; OpenAPI updated in code - **UI:** CREW tab renders live roster cards — name + role, +good / −bad traits, ORIGIN line; refetch on tab open (Radix unmounts inactive tabs), no polling; placeholder crew removed for this tab only - **Tests:** unit 29→38 (crew gen shape/determinism, find lands with correct origin, never joins twice under known seed), e2e 10→11 (real cards show both traits; roster survives the mid-run container restart via deep-equality snapshot) Local verification: tsc ✓, vitest 38/38 ✓, playwright --list ✓, next build clean (7 tab triggers present).
kamilkrzywda added 6 commits 2026-09-29 00:59:57 +02:00
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-09-29 01:03:23 +02:00
kamilkrzywda merged commit f5cba45b42 into master 2026-09-29 01:03:25 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/SpaceWanderer#14