[PR #2233] [MERGED] Fix forced game weather details #5498

Closed
opened 2026-10-22 04:16:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2233
Author: @cha1latte
Created: 6/4/2026
Status: ✅ Merged
Merged: 6/4/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-2153-forced-weather


📝 Commits (4)

  • d2908be Fix forced game weather details
  • 40822ba Refresh PR validation
  • 8773588 Fix unused visual asset source export
  • 485ca63 Merge remote-tracking branch 'upstream/refactor' into fix/issue-2153-forced-weather

📄 Description

Linked issue

Closes #2153

Why this change

  • Scene-forced weather in game mode was replacing biome/season-derived weather details with a hardcoded 20C, calm, and clear, so forced conditions like a blizzard could reach the HUD and LLM context with contradictory weather details.

What changed

  • Updated gameApi.updateWeather so it always derives weather from the inferred biome and normalized season first.
  • For forced weather types, override only type and description, preserving generated temperature, wind, and visibility.
  • Preserved forced weather behavior where changed is always true and chat metadata is patched with the resulting gameWeather.

Refactor impact

Primary owner:

Game mode

Impact areas reviewed:

  • src/features/modes/game/api/game-api.ts
  • src/engine/modes/game/world/weather.service.ts
  • src/features/modes/game/hooks/use-game.ts
  • src/features/modes/game/components/GameSurface.tsx

Boundary notes:

  • The fix stays in the game-mode API producer. It reuses existing React-free engine weather helpers and does not change shared API, Rust, storage schema, or remote-runtime boundaries.

Pressure points touched:

  • gameApi.updateWeather; GameSurface and use-game remain consumers of the corrected weather state.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Focused before/after proof used a local ignored Vitest harness against gameApi.updateWeather with mocked storage and deterministic weather randomness.
  • Before fix, the focused proof failed because forced weather returned temperature: 20 and wind: calm.
  • After fix, the same focused proof passed with forced blizzard preserving generated arctic winter values: temperature: -27, wind: gale, visibility: poor.
  • pnpm typecheck passed.
  • node C:/Users/celia/.codex/tools/marinara-proof-gate.mjs scratch/issue-2153-bugfix-verification.json passed.
  • pnpm check:unused passed after making VisualReferenceImageSource module-local.
  • pnpm check passed.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix only; no new user-discoverable feature or workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. This is a game weather-state producer fix verified with a focused local command proof; no visible UI layout changed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2233 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2153-forced-weather` --- ### 📝 Commits (4) - [`d2908be`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d2908be2c0d34e683c3bf7e8e7109b96311559f6) Fix forced game weather details - [`40822ba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/40822ba766e4d1ade452258d267e01cc971efdf3) Refresh PR validation - [`8773588`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8773588ed1cc48b8f48d3de0ed95d65bb3a9689f) Fix unused visual asset source export - [`485ca63`](https://github.com/Pasta-Devs/Marinara-Engine/commit/485ca63ee3f9d97e5c18ab65a8b4bbaaf5c2a301) Merge remote-tracking branch 'upstream/refactor' into fix/issue-2153-forced-weather ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue <!-- Every user-facing PR should reference a feature request or issue report when practical. --> Closes #2153 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - Scene-forced weather in game mode was replacing biome/season-derived weather details with a hardcoded `20C`, `calm`, and `clear`, so forced conditions like a blizzard could reach the HUD and LLM context with contradictory weather details. ## What changed <!-- List the key changes in this PR. --> - Updated `gameApi.updateWeather` so it always derives weather from the inferred biome and normalized season first. - For forced weather types, override only `type` and `description`, preserving generated temperature, wind, and visibility. - Preserved forced weather behavior where `changed` is always true and chat metadata is patched with the resulting `gameWeather`. ## Refactor impact Primary owner: <!-- Examples: app shell, catalog, chat mode, roleplay mode, game mode, runtime generation, world-state, shared API, engine generation, Rust storage, imports, remote runtime. --> Game mode Impact areas reviewed: - `src/features/modes/game/api/game-api.ts` - `src/engine/modes/game/world/weather.service.ts` - `src/features/modes/game/hooks/use-game.ts` - `src/features/modes/game/components/GameSurface.tsx` Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - The fix stays in the game-mode API producer. It reuses existing React-free engine weather helpers and does not change shared API, Rust, storage schema, or remote-runtime boundaries. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `gameApi.updateWeather`; `GameSurface` and `use-game` remain consumers of the corrected weather state. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes <!-- Describe exact commands and manual steps, including typecheck/build/docs/architecture/Rust/browser/remote-runtime checks when they apply. If an AI agent filled this out, verify it yourself before ticking boxes. --> - Focused before/after proof used a local ignored Vitest harness against `gameApi.updateWeather` with mocked storage and deterministic weather randomness. - Before fix, the focused proof failed because forced weather returned `temperature: 20` and `wind: calm`. - After fix, the same focused proof passed with forced blizzard preserving generated arctic winter values: `temperature: -27`, `wind: gale`, `visibility: poor`. - `pnpm typecheck` passed. - `node C:/Users/celia/.codex/tools/marinara-proof-gate.mjs scratch/issue-2153-bugfix-verification.json` passed. - `pnpm check:unused` passed after making `VisualReferenceImageSource` module-local. - `pnpm check` passed. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix only; no new user-discoverable feature or workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence <!-- Add before/after screenshots or recordings for visible UI changes. --> N/A. This is a game weather-state producer fix verified with a focused local command proof; no visible UI layout changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:50 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5498
No description provided.