Decision ADR-0010 · The Lighthouse
Each visitor's own sky, from the edge's city-level location
Accepted ·
Context
Kenil wants the island to feel like real life: the sun, moon, stars, shadows and park lamps should follow the real sky of the person looking at it, and show their city. A browser GPS prompt felt intrusive for a portfolio. He chose "city from IP, no pop-up, never stored, never shown to others".
Decision
- Source: CloudFront's geolocation headers on the
/rtWebSocket upgrade.CloudFront-Viewer-Latitude,-Longitude,-City,-Country-Region-Name,-Country,-Time-Zone.- At M6, the
/rtorigin request policy must forward them.
- Delivery: the realtime server sends them back only to that socket, as
welcome.viewer, with coordinates rounded to 0.01° (about 1 km). - Privacy: they are never logged, persisted, broadcast, or put in telemetry.
- Fallback order in the browser (
apps/web/src/world/env/sky-location.ts):?sky=lat,lon,City, for QA only;- the edge's
welcome.viewer; - the browser's IANA time zone, mapped to its main city;
- Ahmedabad, Kenil's city.
- Display: a chip reads "Sky over {city} · {local time}". Its tooltip says the location is approximate and not stored.
- Lamps: the shared lamp switch is now
auto | on | off.- In
auto, each visitor's lamps follow their own sunset and sunrise. - Anyone can force them on or off for everyone. The override lasts 20 minutes (
LAMPS_OVERRIDE_MS), then reverts toauto. - The server no longer computes the sun.
- In
- Local dev:
tools/dev-edgeadds the same headers. Defaults come fromDEV_VIEWER_*and point to Ahmedabad.
Consequences
- + No permission prompt. City-level accuracy is plenty for the sun's position.
- + Location stays with the visitor; other players only ever see callsigns.
- + Each visitor's sky is computed in their browser, at no server cost.
- − VPNs and mobile carriers can place someone in another city. The sky is then slightly off, which is harmless.
- − Visitors in different places see different light on the same island. That is intended: it's their own sky.