Skip to content

[SOLID] [M13] Migrate game-core/game-ui onto existing role interfaces (stop using concrete World) #796

Description

@MichaelFisher1997

Part of #776 — SOLID architecture debt umbrella.
Phase: P2 · Finding: M13

Problem

IWorldSimulation/IWorldRenderView/IWorldTelemetry exist and render_graph.zig uses them correctly. But game-core/game-ui reach past them into the concrete 845-line World, dragging the entire runtime dependency graph.

Evidence

modules/game-core/src/session.zig:228,320,328,355; player.zig:277,386; modules/game-ui/src/screens/world.zig:135,243:

session.zig:228  world.enableSaveManager(...)
session.zig:320  self.world.pauseGeneration()
player.zig:386   world.setBlock(...)
world.zig:135    session.world.setRenderDistance(...)

Fix

Migrate each call site onto the appropriate role interface. One focused PR per caller file is feasible:

  • session.zigIWorldSimulation + IWorldTelemetry
  • player.zigIWorldSimulation
  • game-ui/screens/world.zigIWorldTelemetry

Verification

  • nix develop --command zig build test (includes shader validation)
  • If rendering-touching: capture headless screenshot baseline before/after (-Dskip-present)
  • If behavior-preserving refactor: golden-output test must stay green

Constraints

  • Small reviewable PR targeting dev; conventional commit (refactor: / feat:)
  • Preserve current behavior unless this issue explicitly changes it
  • Keep worker-thread RHI isolation intact (no RHI calls off main thread)

Notes

The role interfaces already exist — this is purely a consumer-side migration. Coordinate with M19 if contracts move to engine-rhi.

Tracking: #776

Metadata

Metadata

Assignees

No one assigned

    Labels

    automated-auditIssues found by automated opencode audit scansbugSomething isn't workingenhancementNew feature or requestgame

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions