[PR #2228] [MERGED] Fix game time-of-day scene jumps #5493

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2149-game-timeofday


📝 Commits (2)

  • 00d9104 Fix game time-of-day scene jumps
  • 21853c9 Address noon time label formatting

📊 Changes

4 files changed (+166 additions, -3 deletions)

View changed files

➕ src/engine/modes/game/world/time.service.test.ts (+36 -0)
📝 src/engine/modes/game/world/time.service.ts (+30 -2)
📝 src/features/modes/game/api/game-api.ts (+6 -1)
➕ src/features/modes/game/api/game-time-api.test.ts (+94 -0)

📄 Description

Linked issue

Closes #2149

Why this change

  • Scene analyzer time-of-day labels such as night were being passed through the game time API as ordinary action names. Because advanceTime does not know those labels, the game clock advanced by the 15-minute default instead of jumping to the canonical scene time.

What changed

  • Restored engine-level scene time-of-day jump handling with canonical hours and same-label no-op behavior.
  • Routed recognized scene time labels through setTimeOfDay in gameApi.advanceTime, while preserving ordinary action-duration advancement for actions like explore.
  • Added focused regression coverage for engine clock jumps, API persistence formatting, rollover behavior, repeated labels, the analyzer's noon label, and ordinary action durations.

Refactor impact

Primary owner:

  • Game mode.

Impact areas reviewed:

  • Game time progression service.
  • Game API time persistence path.
  • Scene analyzer time-of-day labels that currently flow through GameSurface into gameApi.advanceTime.

Boundary notes:

  • Engine owns the time label/jump contract. Feature API now consumes that engine helper rather than duplicating label logic in UI code.
  • No Rust, storage schema, remote runtime, prompt assembly, dependency, or release metadata changes.

Pressure points touched:

  • src/features/modes/game/api/game-api.ts
  • src/engine/modes/game/world/time.service.ts

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

  • Codex ran pnpm exec vitest run src/engine/modes/game/world/time.service.test.ts src/features/modes/game/api/game-time-api.test.ts.
  • Codex ran pnpm typecheck.
  • Codex ran full pnpm check.
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch/bugfix-verification-2149.json.
  • Bunny review pass: no blocking findings before opening the draft PR.
  • No human-only verification is required for the core claim; this is a deterministic non-UI game-time contract.

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:

  • N/A. This restores existing game-mode behavior and does not add a discoverable feature.

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

  • No docs or release note changes needed for this focused regression fix.

  • This PR does not restore old staging/package-workspace/release claims.

UI evidence

N/A. This is deterministic non-UI game-time logic; command proof is listed above.


🔄 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/2228 **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-2149-game-timeofday` --- ### 📝 Commits (2) - [`00d9104`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00d91049b2f2b4414d87d416c872537cdba90c21) Fix game time-of-day scene jumps - [`21853c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/21853c9a8ca1b4196b90f96281ed7d8ccf57fa4e) Address noon time label formatting ### 📊 Changes **4 files changed** (+166 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/modes/game/world/time.service.test.ts` (+36 -0) 📝 `src/engine/modes/game/world/time.service.ts` (+30 -2) 📝 `src/features/modes/game/api/game-api.ts` (+6 -1) ➕ `src/features/modes/game/api/game-time-api.test.ts` (+94 -0) </details> ### 📄 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 #2149 ## Why this change <!-- What user problem, bug, refactor goal, or maintenance need does this solve? --> - Scene analyzer time-of-day labels such as `night` were being passed through the game time API as ordinary action names. Because `advanceTime` does not know those labels, the game clock advanced by the 15-minute default instead of jumping to the canonical scene time. ## What changed <!-- List the key changes in this PR. --> - Restored engine-level scene time-of-day jump handling with canonical hours and same-label no-op behavior. - Routed recognized scene time labels through `setTimeOfDay` in `gameApi.advanceTime`, while preserving ordinary action-duration advancement for actions like `explore`. - Added focused regression coverage for engine clock jumps, API persistence formatting, rollover behavior, repeated labels, the analyzer's `noon` label, and ordinary action durations. ## 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: - Game time progression service. - Game API time persistence path. - Scene analyzer time-of-day labels that currently flow through `GameSurface` into `gameApi.advanceTime`. Boundary notes: <!-- Note engine/shared-api/feature/Rust/remote-runtime boundaries. Say "none" only if you checked. --> - Engine owns the time label/jump contract. Feature API now consumes that engine helper rather than duplicating label logic in UI code. - No Rust, storage schema, remote runtime, prompt assembly, dependency, or release metadata changes. Pressure points touched: <!-- Mention ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules if touched. --> - `src/features/modes/game/api/game-api.ts` - `src/engine/modes/game/world/time.service.ts` ## 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. --> - Codex ran `pnpm exec vitest run src/engine/modes/game/world/time.service.test.ts src/features/modes/game/api/game-time-api.test.ts`. - Codex ran `pnpm typecheck`. - Codex ran full `pnpm check`. - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch/bugfix-verification-2149.json`. - Bunny review pass: no blocking findings before opening the draft PR. - No human-only verification is required for the core claim; this is a deterministic non-UI game-time contract. ## 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: - N/A. This restores existing game-mode behavior and does not add a discoverable feature. ## 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 - No docs or release note changes needed for this focused regression fix. - 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 deterministic non-UI game-time logic; command proof is listed above. --- <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:47 +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#5493
No description provided.