[CloudCraft Integration] Add authoritative WorldOverlayModel and repair 2D overlay truth path (#2465) - #2475
Draft
OuroborosCollective wants to merge 2 commits into
Draft
[CloudCraft Integration] Add authoritative WorldOverlayModel and repair 2D overlay truth path (#2465)#2475OuroborosCollective wants to merge 2 commits into
OuroborosCollective wants to merge 2 commits into
Conversation
…rs (#2465) First vertical CloudCraft integration slice: establish a pure, server-authoritative WorldOverlayModel and repair the 2D overlay truth path. Changes: - Add WorldOverlayModel: read-only presentation model derived exclusively from LiveGameplaySnapshot (POIs, resource nodes, camp NPCs, worldSurface). Deterministic stable sorting, honest status (live/waiting/empty/stale/blocked). No Math.random, no wall-clock. - Add WorldOverlayProjection: canonical isometric projection using shared isometricProjection.ts (iso2), replacing component-local approximate transforms with hardcoded origins/scales. - Add OverlayReachabilityGuard: verifies LIVE marker-layer claims via real import-graph evidence (markOverlayReachable at module-eval time), not hardcoded assertions. - Add useWorldOverlayModel hook: reactive overlay model derivation. - Mount the three marker layers (WorldPoi, ResourceNode, CampNpc) in UIOverlayLayer (main.tsx) — previously they existed as files but were never rendered. Now they are in the real /2d render path. - Refactor all three marker layers to consume WorldOverlayModel + canonical projection instead of duplicate approximate transforms. - Update uiRuntimeManifest notes to reflect real mount path evidence. - ResourceMarker now handles 'locked' status honestly. Validation: - 18 new unit tests pass (WorldOverlayModel, WorldOverlayProjection, OverlayReachabilityGuard). - tsc --noEmit: no new errors in touched files. - eslint: clean on touched files. - Full client-2d suite: 187 passed (was 186 on main), 24 failed (was 25 on main) — all pre-existing DOM/environment issues. Co-authored-by: openhands <openhands@all-hands.dev>
…ositive The determinism-changed-files-guard.mjs matches the literal pattern Math.random() even in comments. Reworded the JSDoc comment from 'No Math.random() or wall-clock' to 'No nondeterministic RNG or wall-clock' to avoid the false positive while preserving the intent. Co-authored-by: openhands <openhands@all-hands.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First vertical CloudCraft integration slice (#2465). Establishes a pure, server-authoritative
WorldOverlayModeland repairs the 2D overlay truth path:LiveGameplaySnapshot -> WorldOverlayModel -> 2D adapter.Problem
The three overlay marker layers (
WorldPoiMarkerLayer,ResourceNodeMarkerLayer,CampNpcMarkerLayer) existed as source files but were never mounted in the real/2drender path. Meanwhile,uiRuntimeManifestclaimed"LIVE"+realRenderPath: truefor them — a fake LIVE assertion with no causality. The layers also used component-local approximate isometric transforms (hardcodedworldOriginX=460,scale=1.2) instead of the canonicalisometricProjection.ts.What changed
WorldOverlayModel.ts— read-only presentation model derived exclusively fromLiveGameplaySnapshot(POIs, resource nodes, camp NPCs, worldSurface). Deterministic stable sorting (relational compare), honest status (live/waiting/empty/stale/blocked), frozen output, real evidence counts. NoMath.random, no wall-clock.WorldOverlayProjection.ts— canonical isometric projection using sharedisometricProjection.ts(iso2), replacing component-local approximate transforms. Viewport is an explicit adapter input.OverlayReachabilityGuard.ts— verifies LIVE marker-layer claims via real import-graph evidence (markOverlayReachableat module-eval time). A layer is onlylivewhen its source module is actually imported by an entrypoint.useWorldOverlayModel.ts— reactive hook deriving the overlay model from the live snapshot.main.tsx— mounts the three marker layers inUIOverlayLayer(real/2drender path). They were previously unmounted.WorldOverlayModel+ canonical projection instead of duplicate approximate transforms.uiRuntimeManifest.ts— notes updated to reflect the real mount path evidence.ResourceMarkernow handles thelockedstatus honestly (was onlyavailable/depleted).Rules honored (from issue)
Math.random()or wall-clock in the presentation model.Validation
WorldOverlayModel.test.ts(10),WorldOverlayProjection.test.ts(5),OverlayReachabilityGuard.test.ts(3).tsc --noEmit: no new errors in touched files (pre-existing errors in other files unchanged).main), 24 failed (was 25 onmain) — all remaining failures are pre-existing DOM/environment (document is not defined) issues unrelated to this change; one previously-failing test now passes.What could not be validated
/2d): requires a running dev server + browser session. This is tracked for [CloudCraft Integration] Prove runtime evidence and 2D/3D parity for integrated slices #2469 (runtime evidence & playtests).Remaining risks
iso2withTILE_W=96, TILE_H=48consistent withrenderChunkScenePlanFixed.tsandLootRenderer.ts, but real-world alignment should be verified in the browser playtest ([CloudCraft Integration] Prove runtime evidence and 2D/3D parity for integrated slices #2469).This PR was created by an AI agent (OpenHands) on behalf of the user.
@OuroborosCollective can click here to continue refining the PR