Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

IRL private pins, homepage thumbnail orb, image proxy and world admin hardening

nirholasc0c478a0183f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f9325810d..bd451ef9b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,8 +6,11 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-07-09
+- **/play: real water at the fishing ponds, and spare rods to find on the bank** — The two fishing ponds no longer look like a flat tinted disc — they're now an animated water surface with real ripples, a sun-tracked sparkle, and a deep-to-shallow gradient that reacts to the world's day/night lighting. New alongside it: three spare fishing rods, leaning on posts around the map (both pond banks and the plaza), that any player can walk up to and pick up into their backpack — on top of the rod everyone already starts with. This also brought the chop/mine/cook gathering stations (trees, rocks, roast pits) online for the first time — they existed in the code but were never actually rendered in the world until now. Caught fish still sell for cash at the General Store, same as before. (`/play`) `[feature]`
- **Agents can now hunt money drops and complete IRL quests from code** — The @three-ws/irl SDK (v0.2.0) now covers the whole IRL surface, not just pins. New functions let any script or agent discover real-money drops near where it checks in, claim them with a proof-of-presence fix (a real on-chain release to its own wallet), place self- or agent-funded drops and bounties, and run the full World Lines quest loop — find nearby quests, take the challenge at the spot, and earn the agent-signed proof-of-presence collectible, plus verify anyone's proof independently. Fully typed, zero dependencies, verified against the live API. (`/irl`) `[sdk, feature]`
+- **Avatars render again on seven pages that were showing an empty viewer** — Avatars made on three.ws are saved in a compressed format to keep them small and quick to download. Seven pages — Cosmos, Minted, Creations, Vault, Pitch, the embodied-agent page, and the microphone lipsync demo — never set up the matching decompressor, so instead of a 3D model you got an empty viewer and an error in the console. All seven now load the decoder before the model, and the avatars appear as they should. The fix also went into the embeddable agent widget itself, so anyone who has pasted a three.ws agent onto their own site gets working compressed avatars automatically, with nothing to change on their end. (`/cosmos`) `[fix]`
- **Live SOL price restored on /three-live; Flappin UFO demo retired** — Two quiet breakages, fixed. The live trade feed on /three-live now prices SOL-only trades correctly again — it was reading a price API directly from your browser, which the provider silently blocks, so those trades showed no dollar value; it now reads the same cached, multi-provider SOL/USD price the rest of the platform uses. Separately, the Flappin UFO arcade demo ran on an external deployment that has gone offline, leaving a blank screen and a leaderboard that never loaded. Rather than leave a broken page up, /play/ufo is now an honest retired notice that points you to the live experiences — the coin world, Sniper Arena, and Coin Clash. (`/three-live`) `[fix]`
+- **Two broken pages fixed: vanity receipt verifier and Drive Your Avatar** — Both pages failed to load anything at all, and both are working again. The receipt verifier at /vanity/verify loads its cryptography straight into your browser so the audit runs on your machine and nothing is sent anywhere — but the browser had no way to locate those crypto libraries, so the page sat dead and no receipt could be checked. It now resolves them properly: paste a receipt and every check runs, right through to opening a sealed envelope. On /temporary, the payment widget behind the in-world "Feature your content" billboard was loaded the wrong way and crashed on arrival, taking the pay button with it. It now loads the same way it does on every other page that uses it. (`/vanity/verify`) `[fix]`
## 2026-07-08
diff --git a/api/img.js b/api/img.js
index 7d6109003..d3d9e7e98 100644
--- a/api/img.js
+++ b/api/img.js
@@ -86,30 +86,50 @@ function candidates(rawUrl) {
}
// Race every candidate gateway concurrently and resolve with the FIRST one that
-// returns a real image. Resolves to null when all candidates fail, OR when the
+// returns a usable payload. Resolves to null when all candidates fail, OR when the
// shared `budgetMs` elapses — whichever comes first — so a stalled gateway can
// never pin the invocation toward the 30s wall. The losing fetches are each
// independently time-boxed by `perAttemptMs` (the SSRF fetcher aborts them), so
// they cannot outlive the request in any meaningful way. This concurrency is the
// fix for the sequential ipfs.io stall storm: total wall time is now ~one attempt,
// not the sum of all four.
-function raceImageCandidates(urls, perAttemptMs, budgetMs) {
+//
+// A "usable payload" is an image, OR — when `acceptJson` is set — a JSON document.
+// Roughly half the token art on pump.fun surfaces is addressed by its *metadata*
+// URI rather than its image URI: the CID resolves to a small JSON doc whose
+// `image` field holds the real art. Callers hand us that URI in `?url=` because
+// upstream feeds store both kinds in one `image_uri` column and the two are
+// indistinguishable without fetching. Detecting the JSON here — instead of
+// discarding it as "valid response but not an image" — lets one `?url=` call
+// resolve either form. Returns { kind: 'image' | 'json', ... }.
+function raceCandidates(urls, perAttemptMs, budgetMs, acceptJson) {
if (!urls.length || budgetMs < 250) return Promise.resolve(null);
return new Promise((resolve) => {
let settled = false;
let pending = urls.length;
- const finish = (img) => {
+ const finish = (payload) => {
if (settled) return;
settled = true;
clearTimeout(timer);
- resolve(img);
+ resolve(payload);
};
const timer = setTimeout(() => finish(null), budgetMs);
for (const url of urls) {
fetchModel(url, { maxBytes: MAX_BYTES, timeoutMs: Math.min(perAttemptMs, budgetMs) })
.then((result) => {
- if (result?.contentType?.startsWith('image/')) finish(result);
- else if (--pending === 0) finish(null); // valid response but not an image
+ const ct = result?.contentType || '';
+ if (ct.startsWith('image/')) return finish({ kind: 'image', ...result });
+ if (acceptJson && ct.includes('json')) {
+ // Metadata doc. Parse here — we already hold the bytes, so following
+ // it costs no extra gateway round-trip for the document itself.
+ try {
+ const data = JSON.parse(new TextDecoder().decode(result.bytes));
+ return finish({ kind: 'json', data });
+ } catch {
+ /* malformed — fall through and let the other candidates settle */
+ }
+ }
+ if (--pending === 0) finish(null); // valid response, but nothing we can use
})
.catch(() => {
// SSRF refusal, timeout, gateway 5xx — this candidate is out. Only
diff --git a/api/irl/pins.js b/api/irl/pins.js
index a6757e7e8..e2d1f1279 100644
--- a/api/irl/pins.js
+++ b/api/irl/pins.js
@@ -478,6 +478,38 @@ const PLACEMENT_KINDS = new Set(['precise', 'approximate']);
const FUZZ_MIN_M = 10; // below this the blur is within GPS error — meaningless
const FUZZ_MAX_M = 500; // above this it stops meaning "an agent near here"
+// ── Placement visibility ────────────────────────────────────────────────────
+// `published = false` means PRIVATE: the pin still renders for its OWNER (so you
+// can place an agent at home and walk around it in AR) but is withheld from every
+// other reader's nearby / room / world-line feed. It is deliberately distinct from
+// `hidden_at`, the moderation + expiry hide that withholds a pin from EVERYONE,
+// owner included — an owner testing a placement needs to see their own agent.
+//
+// Why this matters: proof-of-presence (IRL_FIX_SECRET) binds a read to a claimed
+// fix, but the mint trusts caller-supplied coordinates, so it raises the cost of a
+// geographic sweep without making one impossible. A private pin is not a cost —
+// it is an absence: no sweep, at any budget, returns a coordinate that the query
+// never selects. That is the only control that holds against a patient attacker.
+//
+// IRL_DEFAULT_PRIVATE flips the default for new placements. While /irl is
+// pre-launch and its operators are testing from their own homes, a placement is
+// private unless it explicitly asks to be public — the safe default is the one
+// that cannot leak a home address by omission.
+const VISIBILITIES = new Set(['public', 'private']);
+
+function defaultsToPrivate() {
+ const v = String(process.env.IRL_DEFAULT_PRIVATE ?? '').trim().toLowerCase();
+ return v === '1' || v === 'true' || v === 'yes';
+}
+
+// Resolve a placement's visibility from the request body, falling back to the
+// deployment default. An unrecognised value is never silently treated as public.
+export function readVisibility(body) {
+ const raw = String(body?.visibility ?? '').trim().toLowerCase();
+ if (VISIBILITIES.has(raw)) return raw;
+ return defaultsToPrivate() ? 'private' : 'public';
+}
+
// Pin ids are server-minted UUIDs (gen_random_uuid()). Validate the format at the
// top of every mutation path so an oversized / garbage id is a clean 400 and never
// reaches the DB query or a log line. The SQL is already parameterized (this is
@@ -933,13 +965,15 @@ export default wrap(async (req, res) => {
avatar_url, avatar_name, caption, x402_endpoint, placed_at, view_count,
anchor_height_m, anchor_yaw_deg, anchor_quat,
gps_accuracy_m, altitude_m, anchor_source, avatar_version,
- placement_kind, fuzz_radius_m,
+ placement_kind, fuzz_radius_m, published,
vps_provider, vps_id,
room_id, rel_east_m, rel_north_m, origin_lat, origin_lng, origin_yaw_deg
FROM irl_pins
WHERE room_id = ${roomId}
AND hidden_at IS NULL
- AND published IS NOT FALSE
+ AND (published IS NOT FALSE
+ OR (${myId}::uuid IS NOT NULL AND user_id = ${myId}::uuid)
+ OR (${myTok}::text IS NOT NULL AND device_token = ${myTok}::text))
AND (expires_at IS NULL OR expires_at > NOW())
ORDER BY placed_at DESC
LIMIT 50
@@ -977,6 +1011,9 @@ export default wrap(async (req, res) => {
avatar_version: Number(r.avatar_version) || 0,
placement_kind: r.placement_kind === 'approximate' ? 'approximate' : 'precise',
fuzz_radius_m: Number.isFinite(r.fuzz_radius_m) ? r.fuzz_radius_m : null,
+ // A private pin only ever reaches its owner, so this is always 'public'
+ // for a stranger — it exists so the owner's UI can badge their own pins.
+ visibility: r.published === false ? 'private' : 'public',
is_mine: (!!myId && r.user_id === myId) || (!!myTok && r.device_token === myTok),
}));
@@ -1039,13 +1076,15 @@ export default wrap(async (req, res) => {
avatar_url, avatar_name, caption, x402_endpoint, placed_at, view_count,
anchor_height_m, anchor_yaw_deg, anchor_quat,
gps_accuracy_m, altitude_m, anchor_source, avatar_version,
- placement_kind, fuzz_radius_m,
+ placement_kind, fuzz_radius_m, published,
room_id, rel_east_m, rel_north_m, origin_lat, origin_lng, origin_yaw_deg
FROM irl_pins
WHERE lat BETWEEN ${lat - latDelta} AND ${lat + latDelta}
AND lng BETWEEN ${lng - lngDelta} AND ${lng + lngDelta}
AND hidden_at IS NULL
- AND published IS NOT FALSE
+ AND (published IS NOT FALSE
+ OR (${myId}::uuid IS NOT NULL AND user_id = ${myId}::uuid)
+ OR (${myTok}::text IS NOT NULL AND device_token = ${myTok}::text))
AND (expires_at IS NULL OR expires_at > NOW())
ORDER BY placed_at DESC
LIMIT 50
@@ -1097,6 +1136,9 @@ export default wrap(async (req, res) => {
// was never stored, so surfacing "≈ approximate (~Nm)" leaks nothing.
placement_kind: r.placement_kind === 'approximate' ? 'approximate' : 'precise',
fuzz_radius_m: Number.isFinite(r.fuzz_radius_m) ? r.fuzz_radius_m : null,
+ // A private pin only ever reaches its owner, so this is always 'public'
+ // for a stranger — it exists so the owner's UI can badge their own pins.
+ visibility: r.published === false ? 'private' : 'public',
is_mine: (!!myId && r.user_id === myId) || (!!myTok && r.device_token === myTok),
distance_m: Math.round(haversineDist(lat, lng, r.lat, r.lng)),
}))
@@ -1307,6 +1349,8 @@ export default wrap(async (req, res) => {
? Math.min(FUZZ_MAX_M, Math.max(FUZZ_MIN_M, rawFuzz))
: null;
+ const visibility = readVisibility(body);
+
const [pin] = await sql`
INSERT INTO irl_pins
(user_id, agent_id, device_token, lat, lng, heading,
@@ -1314,7 +1358,7 @@ export default wrap(async (req, res) => {
anchor_height_m, anchor_yaw_deg, anchor_quat,
gps_accuracy_m, altitude_m, anchor_source, geocell7,
room_id, rel_east_m, rel_north_m, origin_lat, origin_lng, origin_yaw_deg,
- placement_kind, fuzz_radius_m, vps_provider, vps_id)
+ placement_kind, fuzz_radius_m, vps_provider, vps_id, published)
VALUES (
${userId},
${body.agentId ?? null},
@@ -1342,7 +1386,8 @@ export default wrap(async (req, res) => {
${placementKind},
${fuzzRadiusM},
${vpsProvider},
- ${vpsId}
+ ${vpsId},
+ ${visibility === 'public'}
)
RETURNING *
`;
@@ -1522,7 +1567,7 @@ export default wrap(async (req, res) => {
AND (expires_at IS NULL OR expires_at > NOW())
AND (
(${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''})
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text)
)
RETURNING id, lat, lng
`;
diff --git a/api/irl/privacy.js b/api/irl/privacy.js
index 28bf9513e..674749577 100644
--- a/api/irl/privacy.js
+++ b/api/irl/privacy.js
@@ -29,9 +29,11 @@
* purges interactions this device AUTHORED on OTHER people's pins (viewer_device),
* so the device id is genuinely forgotten — a subsequent summary returns empty.
*
- * No new columns: unpublish reuses the existing `hidden_at` moderation column (a
- * hidden pin is already filtered out of every nearby/mine read). This endpoint
- * NEVER returns another user's coordinates — only the caller's own data.
+ * No new columns: unpublish writes the existing `published` flag, which withholds
+ * the pin from every OTHER reader's nearby / room / World Line feed while leaving
+ * it visible to its owner in AR. `hidden_at` remains moderation + expiry only (it
+ * blanks a pin for everyone, owner included). This endpoint NEVER returns another
+ * user's coordinates — only the caller's own data.
*/
import { cors, json, wrap, rateLimited } from '../_lib/http.js';
@@ -116,7 +118,7 @@ async function handleSummary(res, { userId, deviceToken, anonymous }) {
const [pinAgg] = await sql`
SELECT
COUNT(*)::int AS total,
- COUNT(*) FILTER (WHERE hidden_at IS NOT NULL)::int AS unpublished,
+ COUNT(*) FILTER (WHERE published IS FALSE)::int AS unpublished,
COUNT(*) FILTER (WHERE expires_at IS NULL)::int AS permanent,
MIN(placed_at) AS oldest,
MAX(placed_at) AS newest,
@@ -226,7 +228,14 @@ async function handleExport(res, { userId, deviceToken }) {
});
}
-// ── PATCH — owner-initiated unpublish / republish (reuses hidden_at) ──────────
+// ── PATCH — owner-initiated unpublish / republish (writes `published`) ────────
+//
+// Unpublish makes a pin PRIVATE: withheld from every other reader's nearby, room
+// and World Line feed, while the OWNER still sees it in AR. That last clause is
+// the whole point — the previous implementation set `hidden_at`, the moderation
+// hide, which blanks the pin for the owner too and so is unusable for anyone who
+// wants to keep testing a placement they've taken out of public view. `hidden_at`
+// stays what it says it is: moderation (api/irl/report.js) and expiry.
async function handleVisibility(res, { userId, deviceToken, body }) {
const pinId = body.pinId;
const action = body.action;
@@ -234,30 +243,36 @@ async function handleVisibility(res, { userId, deviceToken, body }) {
if (!ACTIONS.has(action)) return json(res, 400, { error: "action must be 'unpublish' or 'republish'" });
// Owner-scoped, null-guarded WHERE — an attacker with the wrong token/session
- // matches no row and so toggles nothing (RETURNING empty → 404). Unpublish sets
- // hidden_at = NOW() (invisible to every reader); republish clears it back to NULL.
- // Neon's tagged template doesn't compose a nested sql`NOW()` fragment, so the
+ // matches no row and so toggles nothing (RETURNING empty → 404). Both arms guard
+ // the SUPPLIED token, not the column: a caller with no device token yields
+ // NULL::text IS NOT NULL → false, so it can never match a row whose device_token
+ // happens to be empty. Neon's tagged template doesn't compose fragments, so the
// two directions are two explicit queries rather than a spliced value.
- const hide = action === 'unpublish';
- const [row] = hide
+ const makePrivate = action === 'unpublish';
+ const [row] = makePrivate
? await sql`
UPDATE irl_pins
- SET hidden_at = NOW()
+ SET published = FALSE
WHERE id = ${pinId}
AND (expires_at IS NULL OR expires_at > NOW())
AND ((${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''}))
- RETURNING id, hidden_at`
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text))
+ RETURNING id, published`
: await sql`
UPDATE irl_pins
- SET hidden_at = NULL
+ SET published = TRUE
WHERE id = ${pinId}
AND (expires_at IS NULL OR expires_at > NOW())
AND ((${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''}))
- RETURNING id, hidden_at`;
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text))
+ RETURNING id, published`;
if (!row) return json(res, 404, { error: 'pin not found or not yours' });
- return json(res, 200, { ok: true, pinId: row.id, hidden: row.hidden_at != null });
+ return json(res, 200, {
+ ok: true,
+ pinId: row.id,
+ hidden: row.published === false,
+ visibility: row.published === false ? 'private' : 'public',
+ });
}
// ── DELETE — pin | all | device, cascading to irl_interactions ────────────────
@@ -282,7 +297,7 @@ async function handleDelete(res, { userId, deviceToken, body }) {
SELECT id FROM irl_pins
WHERE id = ${pinId}
AND ((${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''}))
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text))
)
RETURNING id
`;
@@ -290,7 +305,7 @@ async function handleDelete(res, { userId, deviceToken, body }) {
DELETE FROM irl_pins
WHERE id = ${pinId}
AND ((${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''}))
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text))
RETURNING id
`;
if (!deletedPins.length) return json(res, 404, { error: 'pin not found or not yours' });
@@ -308,14 +323,14 @@ async function handleDelete(res, { userId, deviceToken, body }) {
WHERE pin_id IN (
SELECT id FROM irl_pins
WHERE ((${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''}))
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text))
)
RETURNING id
`;
const deletedPins = await sql`
DELETE FROM irl_pins
WHERE ((${userId}::uuid IS NOT NULL AND user_id = ${userId}::uuid)
- OR (device_token IS NOT NULL AND device_token = ${deviceToken ?? ''}))
+ OR (${deviceToken}::text IS NOT NULL AND device_token = ${deviceToken}::text))
RETURNING id
`;
diff --git a/api/irl/world-lines.js b/api/irl/world-lines.js
index 66f092d14..5364228dd 100644
--- a/api/irl/world-lines.js
+++ b/api/irl/world-lines.js
@@ -283,7 +283,7 @@ async function handleCreate(req, res) {
// The caller must own the anchor pin (it carries the precise spot). Read its coords
// server-side to derive the coarse + region cells — never trusted from the body.
const [pin] = await sql`
- SELECT id, user_id, agent_id, lat, lng FROM irl_pins
+ SELECT id, user_id, agent_id, lat, lng, published FROM irl_pins
WHERE id = ${pinId} AND hidden_at IS NULL
AND (expires_at IS NULL OR expires_at > NOW())
LIMIT 1
@@ -292,6 +292,16 @@ async function handleCreate(req, res) {
if (!pin.user_id || pin.user_id !== session.id) {
return json(res, 403, { error: 'you can only anchor a World Line to your own pin' });
}
+ // A World Line is a public invitation to walk to a spot. Anchoring one to a
+ // PRIVATE pin would publish the very coordinate the owner marked private, so
+ // refuse at creation rather than silently filtering it out of discovery later.
+ // The owner makes the pin public first — an explicit, deliberate act.
+ if (pin.published === false) {
+ return json(res, 409, {
+ error: 'this pin is private',
+ error_description: 'A World Line invites strangers to its location. Make the pin public before anchoring a quest to it.',
+ });
+ }
// The signing agent: the pin's agent, or a caller-supplied agent they own.
const agentId = isUuid(body.agentId) ? body.agentId : (pin.agent_id || null);
@@ -434,6 +444,11 @@ async function handleNearby(req, res) {
WHERE w.hidden_at IS NULL
AND (w.expires_at IS NULL OR w.expires_at > NOW())
AND p.hidden_at IS NULL AND (p.expires_at IS NULL OR p.expires_at > NOW())
+ -- A quest anchored to a PRIVATE pin never reaches a stranger. This feed has
+ -- the widest coordinate radius on the platform (600 m vs 60 m for pins), so
+ -- it must honour the anchor pin's visibility or it silently becomes the
+ -- cheapest private-pin bypass we ship.
+ AND p.published IS NOT FALSE
AND p.lat BETWEEN ${lat - latDelta} AND ${lat + latDelta}
AND p.lng BETWEEN ${lng - lngDelta} AND ${lng + lngDelta}
ORDER BY w.created_at DESC
diff --git a/data/changelog.json b/data/changelog.json
index c3c19ae2a..480d952d3 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,33 @@
{
"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-07-09",
+ "title": "Avatars render again on seven pages that were showing an empty viewer",
+ "summary": "Avatars made on three.ws are saved in a compressed format to keep them small and quick to download. Seven pages — Cosmos, Minted, Creations, Vault, Pitch, the embodied-agent page, and the microphone lipsync demo — never set up the matching decompressor, so instead of a 3D model you got an empty viewer and an error in the console. All seven now load the decoder before the model, and the avatars appear as they should. The fix also went into the embeddable agent widget itself, so anyone who has pasted a three.ws agent onto their own site gets working compressed avatars automatically, with nothing to change on their end.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/cosmos"
+ },
+ {
+ "date": "2026-07-09",
+ "title": "/play: real water at the fishing ponds, and spare rods to find on the bank",
+ "summary": "The two fishing ponds no longer look like a flat tinted disc — they're now an animated water surface with real ripples, a sun-tracked sparkle, and a deep-to-shallow gradient that reacts to the world's day/night lighting. New alongside it: three spare fishing rods, leaning on posts around the map (both pond banks and the plaza), that any player can walk up to and pick up into their backpack — on top of the rod everyone already starts with. This also brought the chop/mine/cook gathering stations (trees, rocks, roast pits) online for the first time — they existed in the code but were never actually rendered in the world until now. Caught fish still sell for cash at the General Store, same as before.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/play"
+ },
+ {
+ "date": "2026-07-09",
+ "title": "Two broken pages fixed: vanity receipt verifier and Drive Your Avatar",
+ "summary": "Both pages failed to load anything at all, and both are working again. The receipt verifier at /vanity/verify loads its cryptography straight into your browser so the audit runs on your machine and nothing is sent anywhere — but the browser had no way to locate those crypto libraries, so the page sat dead and no receipt could be checked. It now resolves them properly: paste a receipt and every check runs, right through to opening a sealed envelope. On /temporary, the payment widget behind the in-world \"Feature your content\" billboard was loaded the wrong way and crashed on arrival, taking the pay button with it. It now loads the same way it does on every other page that uses it.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/vanity/verify"
+ },
{
"date": "2026-07-09",
"title": "Live SOL price restored on /three-live; Flappin UFO demo retired",
diff --git a/deploy/world/Dockerfile b/deploy/world/Dockerfile
index 681bb3549..417f5b96f 100644
--- a/deploy/world/Dockerfile
+++ b/deploy/world/Dockerfile
@@ -1,6 +1,6 @@
# Hyperfy — world.three.ws
# Multi-stage: build Hyperfy from source, then produce a lean production image.
-# The /world volume (GCS bucket in production) holds SQLite + uploaded assets so
+# The /app/world volume (GCS bucket in production) holds SQLite + uploaded assets so
# the container itself is stateless and can be rebuilt without losing world data.
FROM node:22-alpine AS source
@@ -15,28 +15,37 @@ RUN git init -q . \
&& git fetch --depth 1 origin ${HYPERFY_REF} \
&& git checkout -q FETCH_HEAD
# Server-side hardening: enforce PUBLIC_MAX_UPLOAD_SIZE on /api/upload itself
-# (upstream hard-codes a 200MB multipart cap on an unauthenticated route).
+# (upstream hard-codes a 200MB multipart cap on an unauthenticated route), expose
+# blueprint assets on /status, and refuse to boot unprotected in production.
COPY patches/ /tmp/patches/
RUN git apply --verbose /tmp/patches/*.patch
FROM source AS builder
RUN npm ci
-RUN npm run build 2>&1 || true
+# No `|| true` here: a swallowed build failure surfaced later as a confusing
+# "COPY failed: stat app/dist" and hid the fact that this image never built.
+RUN npm run build
FROM node:22-alpine AS runner
WORKDIR /app
-RUN addgroup -S hyperfy && adduser -S hyperfy -G hyperfy
-# Copy only what the server needs at runtime.
+# Copy only what the server needs at runtime. `npm run build` emits everything to
+# build/ — the server bundle (build/index.js, per package.json "start"), the client
+# bundle and its assets (build/public/), and the PhysX wasm. There is no dist/ and
+# no top-level public/ in Hyperfy; naming them is what broke every prior build.
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
-COPY --from=builder /app/dist ./dist
+COPY --from=builder /app/build ./build
COPY --from=builder /app/src ./src
-COPY --from=builder /app/public ./public 2>/dev/null || true
-# /world is the persistence mount point — SQLite db + uploaded assets land here.
-RUN mkdir -p /world && chown hyperfy:hyperfy /world
-USER hyperfy
+# rootDir is `path.join(__dirname, '../')` = /app/, so WORLD=world resolves to
+# /app/world — the mount point for the GCS bucket that persists the world.
+RUN mkdir -p /app/world
+# Runs as root, deliberately: Cloud Run mounts the gcsfuse volume at /app/world
+# root-owned, and the server must write SQLite + uploaded assets there every
+# SAVE_INTERVAL. A non-root USER boots fine but silently loses every world save —
+# a quieter version of the data loss this hardening exists to prevent. Dropping
+# privileges needs gcsfuse uid/gid mount options, not just a USER line.
ENV NODE_ENV=production PORT=3000
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s \
- CMD wget -qO- http://localhost:3000/ || exit 1
+ CMD wget -qO- http://localhost:3000/status || exit 1
CMD ["npm", "start"]
diff --git a/deploy/world/patches/0003-fail-closed-without-admin-code.patch b/deploy/world/patches/0003-fail-closed-without-admin-code.patch
index 0ff467973..bd565341d 100644
--- a/deploy/world/patches/0003-fail-closed-without-admin-code.patch
+++ b/deploy/world/patches/0003-fail-closed-without-admin-code.patch
@@ -2,7 +2,7 @@ diff --git a/src/server/index.js b/src/server/index.js
index 67d7345..b3c1f9a 100644
--- a/src/server/index.js
+++ b/src/server/index.js
-@@ -32,7 +32,16 @@ if (!process.env.JWT_SECRET) {
+@@ -32,7 +32,20 @@ if (!process.env.JWT_SECRET) {
throw new Error('[envs] JWT_SECRET not set')
}
if (!process.env.ADMIN_CODE) {
@@ -13,8 +13,12 @@ index 67d7345..b3c1f9a 100644
+ // world.three.ws was repeatedly left UNPROTECTED (the 2026-06-12 void-fall).
+ // Refuse to boot so a secret-less revision fails its startup probe and Cloud Run
+ // keeps serving the last protected revision instead of exposing build rights.
++ // Exit explicitly instead of throwing: `import 'ses'` installs an uncaught-exception
++ // handler that reports the error but still lets the process exit 0, which reads as a
++ // clean shutdown in Cloud Run logs. A non-zero code names the failure for what it is.
+ if (process.env.NODE_ENV === 'production') {
-+ throw new Error('[envs] ADMIN_CODE not set - refusing to start an UNPROTECTED world in production')
++ console.error('[envs] ADMIN_CODE not set - refusing to start an UNPROTECTED world in production')
++ process.exit(1)
+ }
+ console.warn('[envs] ADMIN_CODE not set - all users will have admin permissions!')
}
diff --git a/docs/ops/gcp-production.md b/docs/ops/gcp-production.md
index 292931a02..52f5af453 100644
--- a/docs/ops/gcp-production.md
+++ b/docs/ops/gcp-production.md
@@ -228,7 +228,7 @@ by CLI at all. Consequences and current state:
| What | Vars | Impact | Recovery |
|---|---|---|---|
-| x402 ring signers | `X402_TREASURY_SECRET_BASE58`, `X402_FEE_PAYER_SECRET_BASE58`, `X402_SEED_SOLANA_SECRET_BASE58` | Ring is enabled but cannot sign — no autonomous USDC movement | Owner's gitignored `.x402-ring-secrets.json`, written by `scripts/x402-ring-setup.mjs` on whatever machine ran it. Public halves: fee payer `2wKupLR9q6wXYppw8Gr2NvWxKBUqm4PPJKkQfoxHDBg4`, treasury/pay-to `wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU`. These wallets custody funds — do NOT regenerate. |
+| x402 ring signers | `X402_TREASURY_SECRET_BASE58`, `X402_SEED_SOLANA_SECRET_BASE58` | Ring is enabled but the treasury/payer roles cannot sign — no autonomous USDC movement | Owner's gitignored `.x402-ring-secrets.json`, written by `scripts/x402-ring-setup.mjs` on whatever machine ran it. Public half: treasury/pay-to `wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU` (holds real SOL — do NOT regenerate; recover the secret). The **sponsor** role is no longer in this row — see below. |
| Rate-limiter Redis | `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` | Money-moving limiters **fail closed** (already true on Vercel pre-shutdown). **Worse: the x402 idempotency module hard-throws at import** (`api/_lib/x402/idempotency-cache.js`) — so **every** paid endpoint that imports it (`/api/okx/3d/*`, `/api/x402/*`) returns **HTTP 500 at module load**, not a graceful degrade. This took the entire paid surface down on 2026-07-08 until the escape hatch below was set. | Owner's Upstash console, or provision fresh Upstash/Memorystore and set both vars. `X402_ALLOW_MEMORY_FALLBACK=1` is the sanctioned escape hatch and is **currently SET in prod (since 2026-07-08)** to keep the paid surface up on per-instance memory idempotency. Financial double-charge stays prevented on-chain regardless (EIP-3009 nonces are single-use); the flag only degrades cross-replica work/response dedup. Remove the flag once real Upstash creds land. |
| R2/S3 storage creds | `S3_ENDPOINT`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`, `S3_BUCKET`, `S3_PUBLIC_DOMAIN` | `/api/marketplace`, `/api/explore`, `/api/avatars/:id` — every route that resolves an asset URL — 503 `not_configured` | Real values already sit in the repo's `.env.local` (never committed). Apply with `scripts/gcp/apply-s3-env.sh` (needs a human-authed `gcloud auth login` first — the 89-var apply is still blocked on reauth per above). |
| OKX X Layer facilitator creds | `OKX_API_KEY`, `OKX_SECRET_KEY`, `OKX_PASSPHRASE` (or, as a no-OKX-account fallback, `X402_XLAYER_RELAYER_KEY`) | `xlayerSettleable()` (`api/_lib/x402-xlayer-okx.js`) is false without one of these, so **no 402 challenge on any endpoint advertises the `eip155:196` (X Layer) rail** — confirmed live 2026-07-08 via `/api/okx/3d/health` (`payment-rail.settleable:false, facilitator_configured:false`) and by inspecting the raw 402 `accepts[]` on `/api/okx/3d/identity-studio` and `/api/okx/3d/pose-seed` (Solana + Base only, no X Layer entry). `X402_PAY_TO_XLAYER` and `X402_ASSET_ADDRESS_XLAYER` **are** set in prod — this is the only missing piece. This is the exact rail OKX's listing review requires (agent #2632 rejection reason); the relisting (`prompts/okx-ai/05-relisting-resubmission.md`) cannot proceed until it's live. | OKX Web3 developer console (owner) for the three real creds, or generate `X402_XLAYER_RELAYER_KEY` as a fresh EVM keypair + fund it with OKB gas as a stopgap that needs no OKX account. |
diff --git a/pages/home.html b/pages/home.html
index 8413f9431..07310d836 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -2290,6 +2290,7 @@
.mktplace-item{flex-shrink:0;width:52px;height:52px;border-radius:10px;overflow:hidden;border:1px solid var(--hairline-strong);cursor:pointer;background:var(--surface-2);transition:border-color .15s,transform .15s;position:relative;display:block}
.mktplace-item:hover{border-color:var(--text-3);transform:translateY(-2px)}
.mktplace-item img{width:100%;height:100%;object-fit:cover;display:block}
+ .mktplace-item-initial{width:100%;height:100%;display:none;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:16px;font-weight:600;color:var(--text-3);text-transform:uppercase;line-height:1}
.mktplace-item-name{position:absolute;bottom:0;left:0;right:0;padding:2px 4px;font-family:var(--font-mono);font-size:7px;color:var(--text);background:rgba(0,0,0,.7);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mktplace-more{flex-shrink:0;width:52px;height:52px;border-radius:10px;border:1px dashed var(--hairline-strong);display:flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:18px;color:var(--text-4);cursor:pointer;transition:border-color .15s,color .15s;text-decoration:none}
.mktplace-more:hover{border-color:var(--text-3);color:var(--text-2)}
@@ -5607,7 +5608,6 @@
// ── Playground ──────────────────────────────────────────────────
(function initPlayground() {
- const THUMB_CDN = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb';
const textarea = document.getElementById('pg-textarea');
const highlight = document.getElementById('pg-highlight');
const preview = document.getElementById('pg-preview');
@@ -5804,6 +5804,13 @@
.then(function(r) { return r.json(); })
.then(function(d) {
var items = (Array.isArray(d.items) ? d.items : []).filter(function(it) { return it.glbUrl && it.avatarId; });
+ // The explore feed is newest-first, and a freshly forged avatar rarely has
+ // a thumbnail yet — left alone they monopolise the strip and every chip
+ // renders as a bare initial. Stable-partition thumbnailed avatars to the
+ // front so the picker shows what you're selecting; the rest still fill any
+ // slots left over.
+ items = items.filter(function(it) { return it.image; })
+ .concat(items.filter(function(it) { return !it.image; }));
var list = defaults.slice();
var seen = {};
defaults.forEach(function(da) { seen[da.id] = true; });
@@ -5815,7 +5822,12 @@
id: id,
name: item.name || '',
glb: devProxyGlb(item.glbUrl),
- thumb: item.thumbUrl || item.image || (THUMB_CDN + '/' + id + '.png'),
+ // `image` is the avatar's stored thumbnail URL, or null when it has
+ // none. Pass the null straight through — renderAvatars() then draws
+ // the initial-letter chip. Never synthesise a thumb/<id>.png URL as
+ // a fallback: that object was never written, so R2 answers 404 with
+ // a text/plain body and Chrome blocks it (ERR_BLOCKED_BY_ORB).
+ thumb: item.image || null,
});
});
renderAvatars(list.slice(0, 14));
@@ -7111,41 +7123,76 @@
(function() {
var strip = document.getElementById('mktplace-strip');
if (!strip) return;
- var THUMB_CDN = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb';
- fetch('/api/marketplace')
- .then(function(r) { return r.json(); })
- .then(function(data) {
- var items = (data.agents || data.items || data || []).slice(0, 10);
+ fetch('/api/marketplace', { headers: { accept: 'application/json' } })
+ .then(function(r) {
+ if (!r.ok) throw new Error('HTTP ' + r.status);
+ return r.json();
+ })
+ .then(function(body) {
+ // /api/marketplace answers { data: { items: [...] } }. Each item is an
+ // agent listing: `id` is the agent id (what /agents/:id resolves), and
+ // `thumbnail_url` is a ready-to-use absolute URL — null when the listing's
+ // avatar has no stored thumbnail. Only ~1 in 6 listings carries one, so
+ // the initial-letter placeholder is the common path, not an error path.
+ var items = ((body && body.data && body.data.items) || []).filter(function(it) {
+ return it && it.id;
+ }).slice(0, 10);
+ if (!items.length) return renderBrowseFallback();
+
items.forEach(function(item) {
- var id = item.avatar_id || item.avatarId || item.id;
- var name = item.name || item.agent_name || id.slice(0, 6);
- var thumb = item.thumbnail || (THUMB_CDN + '/' + id + '.png');
+ var name = item.name || item.id.slice(0, 6);
var a = document.createElement('a');
a.className = 'mktplace-item';
- a.href = '/agents/' + id;
+ a.href = '/agents/' + item.id;
a.title = name;
- var img = document.createElement('img');
- img.src = thumb;
- img.alt = name;
- img.loading = 'lazy';
- img.onerror = function() { this.style.display = 'none'; };
- a.appendChild(img);
+
+ var initial = document.createElement('span');
+ initial.className = 'mktplace-item-initial';
+ initial.textContent = (name || '?').charAt(0);
+ a.appendChild(initial);
+
+ if (item.thumbnail_url) {
+ var img = document.createElement('img');
+ img.src = item.thumbnail_url;
+ img.alt = name;
+ img.loading = 'lazy';
+ // A stored thumbnail can still 404 (object pruned) — fall back to the
+ // initial rather than leaving a broken-image tile.
+ img.onerror = function() {
+ this.remove();
+ initial.style.display = 'flex';
+ };
+ a.appendChild(img);
+ } else {
+ initial.style.display = 'flex';
+ }
+
var lbl = document.createElement('span');
lbl.className = 'mktplace-item-name';
lbl.textContent = name;
a.appendChild(lbl);
strip.appendChild(a);
});
+
var more = document.createElement('a');
more.className = 'mktplace-more';
more.href = '/discover';
more.textContent = '→';
more.title = 'Browse all agents';
strip.appendChild(more);
- }).catch(function() {
- strip.innerHTML = '<a class="mktplace-more" href="/discover" style="width:auto;padding:0 16px;">Browse marketplace →</a>';
- });
+ }).catch(renderBrowseFallback);
+
+ function renderBrowseFallback() {
+ strip.innerHTML = '';
+ var a = document.createElement('a');
+ a.className = 'mktplace-more';
+ a.href = '/discover';
+ a.style.width = 'auto';
+ a.style.padding = '0 16px';
+ a.textContent = 'Browse marketplace →';
+ strip.appendChild(a);
+ }
})();
// ── 10. Analytics: sparkline + animated counters ─────────────────
diff --git a/pages/irl.html b/pages/irl.html
index d29e8a6d6..986f3de7a 100644
--- a/pages/irl.html
+++ b/pages/irl.html
@@ -106,6 +106,10 @@
}
/* ── Top bar ─────────────────────────────────────────────── */
+ /* Three real flex columns (back / center / right), not an absolutely-
+ centered badge floating over normal-flow siblings — the old layout let
+ the badge cluster (which grows with nearby/net/presence chips) paint on
+ top of the privacy/world-lines buttons underneath it on narrow phones. */
.irl-topbar {
position: fixed;
top: 0;
@@ -114,18 +118,25 @@
z-index: 10;
display: flex;
align-items: center;
- justify-content: space-between;
+ gap: 6px;
padding-left: max(16px, env(safe-area-inset-left, 0px));
padding-right: max(16px, env(safe-area-inset-right, 0px));
padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
padding-bottom: 14px;
background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
}
+ .irl-topbar-right {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ flex: 0 0 auto;
+ }
.irl-back {
display: inline-flex;
align-items: center;
gap: 6px;
+ flex: 0 0 auto;
color: var(--text-2);
text-decoration: none;
font-size: 14px;
@@ -138,12 +149,17 @@
.irl-back svg { flex-shrink: 0; }
.irl-topbar-center {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
+ flex: 1 1 auto;
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 4px;
+ overflow: hidden;
text-align: center;
pointer-events: none;
}
+ .irl-topbar-center > * { pointer-events: auto; flex-shrink: 1; min-width: 0; }
.irl-badge {
display: inline-flex;
align-items: center;
@@ -216,18 +232,78 @@
.irl-share-btn:active { transform: scale(0.96); }
.irl-share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.irl-share-btn[disabled] { opacity: 0.6; cursor: progress; }
- /* L3 — icon-only "Location & privacy" control sits beside Share */
- .irl-privacy-btn { padding: 6px; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; }
- /* Task 03 — icon-only arrival-cue mute toggle (sound on/off icon swap) */
- .irl-cue-mute { padding: 6px; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; }
- .irl-cue-mute .irl-cue-off { display: none; }
- .irl-cue-mute.is-muted .irl-cue-on { display: none; }
- .irl-cue-mute.is-muted .irl-cue-off { display: inline; }
- .irl-cue-mute.is-muted { color: var(--text-3); }
- .irl-cue-mute[aria-pressed="false"] { color: var(--green); border-color: rgba(74,222,128,0.32); }
- /* Smart-glasses pairing — icon-only, lights blue when a lens is linked. */
- .irl-glasses-btn { padding: 6px; display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; }
- .irl-glasses-btn.is-connected { color: #7aa2ff; border-color: rgba(122,162,255,0.45); background: rgba(79,124,255,0.12); }
+
+ /* ── "More" overflow menu ────────────────────────────────────
+ Location & privacy, World Lines, smart glasses, and the arrival-sound
+ mute toggle used to sit as five unlabeled icon buttons crammed next to
+ Share in the top bar — on a 375px phone they visually overlapped the
+ centered IRL/nearby badge cluster and were hard to tell apart by icon
+ alone. They now live as labeled rows in one sheet behind a single
+ "More" button, leaving the top bar at just Back / badges / More / Share. */
+ .irl-more-btn { padding: 6px; display: inline-flex; align-items: center; justify-content: center; }
+ #irl-more-sheet {
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 24;
+ background: rgba(12,14,20,0.97);
+ border-top: 1px solid rgba(255,255,255,0.10);
+ border-radius: 18px 18px 0 0;
+ padding: 20px 18px calc(env(safe-area-inset-bottom, 0px) + 28px);
+ backdrop-filter: blur(22px);
+ -webkit-backdrop-filter: blur(22px);
+ transform: translateY(100%);
+ transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
+ pointer-events: none;
+ max-height: 70vh;
+ overflow-y: auto;
+ }
+ #irl-more-sheet.is-open { transform: translateY(0); pointer-events: all; }
+ #irl-more-sheet .irl-sheet-handle { margin-bottom: 14px; }
+ .irl-more-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
+ .irl-more-header h3 { font-size: 16px; font-weight: 700; color: #e5e7eb; margin: 0; }
+ .irl-more-row {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ width: 100%;
+ padding: 14px 6px;
+ min-height: 48px;
+ background: none;
+ border: none;
+ border-top: 1px solid rgba(255,255,255,0.07);
+ color: var(--text);
+ font: inherit;
+ font-size: 14.5px;
+ font-weight: 600;
+ text-align: left;
+ text-decoration: none;
+ cursor: pointer;
+ transition: background 0.15s;
+ }
+ .irl-more-row:first-of-type { border-top: none; }
+ .irl-more-row:hover, .irl-more-row:focus-visible { background: rgba(255,255,255,0.05); outline: none; }
+ .irl-more-row-icon {
+ flex-shrink: 0;
+ width: 36px;
+ height: 36px;
+ border-radius: 10px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ background: rgba(255,255,255,0.06);
+ color: var(--text-2);
+ }
+ .irl-more-row.is-connected .irl-more-row-icon,
+ .irl-more-row[aria-pressed="false"].irl-cue-mute .irl-more-row-icon { color: #7aa2ff; background: rgba(79,124,255,0.14); }
+ .irl-more-row-text { flex: 1; min-width: 0; }
+ .irl-more-row-label { display: block; }
+ .irl-more-row-sub { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-top: 1px; }
+ .irl-more-row .irl-cue-off { display: none; }
+ .irl-more-row.is-muted .irl-cue-on { display: none; }
+ .irl-more-row.is-muted .irl-cue-off { display: inline; }
+ .irl-more-row-chevron { flex-shrink: 0; color: var(--text-3); }
/* ── Immersive mode ──────────────────────────────────────────
One tap collapses every chrome layer (topbar, bottom panel,
@@ -263,6 +339,11 @@
body.irl-immersive .irl-immersive-toggle .irl-eye-hide { display: none; }
body.irl-immersive .irl-immersive-toggle .irl-eye-show { display: inline; }
/* Immersive: the lone control glows green so it stays findable over the scene */
+ /* Short screens: the money-drops FAB (anchored above the dock) reaches
+ mid-screen height — shift the eye up so the two never stack. */
+ @media (max-height: 700px) {
+ .irl-immersive-toggle { top: 34%; }
+ }
body.irl-immersive .irl-immersive-toggle {
color: var(--green);
border-color: rgba(74,222,128,0.5);
@@ -321,16 +402,29 @@
}
/* ── Joystick ────────────────────────────────────────────── */
+ /* Was min(50vw,220px) x min(55vh,360px) — a touch-capture zone spanning
+ over half the viewport height, deep enough to underlap the secondary
+ action row above. Trimmed to a footprint sized for an actual thumb
+ drag; the action row is also bounded now (single scroll row, see
+ .irl-secondary-row), so the two no longer compete for the same corner. */
#irl-joystick {
position: fixed;
z-index: 9;
left: env(safe-area-inset-left, 0px);
- bottom: 0;
- width: min(50vw, 220px);
- height: min(55vh, 360px);
+ /* Float the whole touch zone ABOVE the bottom dock. --irl-dock-h is
+ measured live from the footer (see the inline module below), so no
+ button ever sits inside the drag zone — the old layout stacked the
+ pill rows directly over it and thumb drags kept hitting buttons. */
+ bottom: var(--irl-dock-h, 220px);
+ width: min(40vw, 175px);
+ height: min(32vh, 230px);
touch-action: none;
pointer-events: auto;
}
+ /* Immersive mode hides the dock — drop the zone back to the bottom edge. */
+ body.irl-immersive #irl-joystick {
+ bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
+ }
@media (hover: hover) and (pointer: fine) {
#irl-joystick {
left: 24px;
@@ -383,6 +477,31 @@
transition: opacity 0.3s;
}
+ /* Touch screens: compact the whole dock so it hugs the bottom edge
+ instead of climbing to mid-screen over the avatar — smaller headline,
+ subtitle clamped to two lines, a shorter hero button, tighter gaps. */
+ @media (hover: none) {
+ .irl-avatar-name { font-size: 16px; }
+ .irl-subtitle {
+ font-size: 12px;
+ max-width: min(88vw, 340px);
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ }
+ .irl-bottom {
+ gap: 8px;
+ padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
+ }
+ #irl-camera-btn {
+ height: 52px;
+ max-width: 340px;
+ border-radius: 16px;
+ font-size: 16px;
+ }
+ }
+
.irl-status {
font-size: 12.5px;
color: var(--accent);
@@ -482,15 +601,32 @@
}
#irl-camera-btn svg { flex-shrink: 0; }
- /* Secondary row: place + clear */
+ /* Secondary row: every placement/setup action, one action per pill.
+ This used to be `flex-wrap: wrap` — fine for the 2-3 buttons it shipped
+ with, but room-mode and marker-mode (src/irl/room-mode.js,
+ src/irl/marker-mode.js) each append another `.irl-pill-btn` fab here at
+ runtime, and the static row already carries up to 9. Wrapping onto 3-4
+ lines with no height cap grew the fixed-bottom footer tall enough to
+ push the camera button and avatar name up into the middle of the
+ screen, burying the 3D preview. A single horizontal scroll strip keeps
+ the footer's height constant no matter how many pills land here. */
.irl-secondary-row {
display: flex;
align-items: center;
gap: 10px;
- justify-content: center;
- flex-wrap: wrap;
+ flex-wrap: nowrap;
+ overflow-x: auto;
+ overscroll-behavior-x: contain;
+ scroll-snap-type: x proximity;
+ -webkit-overflow-scrolling: touch;
+ scrollbar-width: none;
max-width: 100%;
+ padding: 2px 4px;
+ margin: 0 -4px;
+ mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
+ -webkit-mask-image: linear-gradient(to right, transparent 0, black 14px, black calc(100% - 14px), transparent 100%);
}
+ .irl-secondary-row::-webkit-scrollbar { display: none; }
.irl-pill-btn {
appearance: none;
@@ -506,6 +642,8 @@
display: inline-flex;
align-items: center;
gap: 7px;
+ flex: 0 0 auto;
+ scroll-snap-align: start;
transition: transform 0.1s, background 0.15s, border-color 0.15s, color 0.15s;
-webkit-tap-highlight-color: transparent;
white-space: nowrap;
@@ -690,11 +828,16 @@
display: flex;
flex-direction: row;
gap: 8px;
- justify-content: center;
- flex-wrap: wrap;
- max-width: 380px;
+ flex-wrap: nowrap;
+ overflow-x: auto;
+ scroll-snap-type: x proximity;
+ -webkit-overflow-scrolling: touch;
+ scrollbar-width: none;
+ max-width: 100%;
+ padding: 2px 4px;
animation: irl-slide-up 0.2s ease-out;
}
+ #irl-picker::-webkit-scrollbar { display: none; }
#irl-picker[hidden] { display: none; }
@keyframes irl-slide-up {
from { opacity: 0; transform: translateY(10px); }
@@ -714,6 +857,8 @@
display: inline-flex;
align-items: center;
gap: 6px;
+ flex: 0 0 auto;
+ scroll-snap-align: start;
transition: transform 0.1s, background 0.15s, border-color 0.15s, color 0.15s;
-webkit-tap-highlight-color: transparent;
backdrop-filter: blur(8px);
@@ -1161,6 +1306,12 @@
transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.irl-sheet-close:hover { color: #e5e7eb; border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.10); }
+ /* Touch: every sheet's close control meets the 44px tap floor (the 32px
+ circle stays for pointers, where precision is fine). */
+ @media (hover: none) {
+ .irl-sheet-close { width: 44px; height: 44px; font-size: 18px; }
+ .irl-caption-placement, .irl-consent-cancel { min-height: 44px; }
+ }
/* Caption input panel — slides up before pin is saved */
#irl-caption-panel {
@@ -2062,21 +2213,56 @@
unless the live stream is up and more than just you are here. -->
<span id="irl-presence-chip" class="irl-presence-chip" hidden role="status" aria-live="polite"></span>
</div>
- <button class="irl-share-btn irl-cue-mute" id="irl-cue-mute" type="button" aria-pressed="false" aria-label="Arrival sound on — tap to mute" title="Arrival sound on">
- <svg class="irl-cue-on" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 5 6 9H2v6h4l5 4z"/><path d="M15.5 8.5a5 5 0 0 1 0 7"/><path d="M19 5a9 9 0 0 1 0 14"/></svg>
- <svg class="irl-cue-off" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 5 6 9H2v6h4l5 4z"/><line x1="22" y1="9" x2="16" y2="15"/><line x1="16" y1="9" x2="22" y2="15"/></svg>
+ <div class="irl-topbar-right">
+ <button class="irl-share-btn irl-more-btn" id="irl-more-btn" type="button" aria-haspopup="dialog" aria-expanded="false" aria-controls="irl-more-sheet" aria-label="More" title="More">
+ <svg width="17" height="17" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="5" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="19" cy="12" r="2"/></svg>
+ </button>
+ <button class="irl-share-btn" id="irl-share-btn" type="button" aria-label="Share">Share</button>
+ </div>
+</header>
+
+<!-- "More" overflow sheet — location & privacy, World Lines, smart glasses,
+ arrival-sound mute. Consolidated off the top bar (see .irl-more-btn note). -->
+<div id="irl-more-sheet" role="dialog" aria-modal="true" aria-labelledby="irl-more-title">
+ <div class="irl-sheet-handle" aria-hidden="true"></div>
+ <div class="irl-more-header">
+ <h3 id="irl-more-title">More</h3>
+ <button class="irl-sheet-close" id="irl-more-close" type="button" aria-label="Close">×</button>
+ </div>
+ <button class="irl-more-row irl-cue-mute" id="irl-cue-mute" type="button" aria-pressed="false" aria-label="Arrival sound on — tap to mute">
+ <span class="irl-more-row-icon" aria-hidden="true">
+ <svg class="irl-cue-on" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><path d="M11 5 6 9H2v6h4l5 4z"/><path d="M15.5 8.5a5 5 0 0 1 0 7"/><path d="M19 5a9 9 0 0 1 0 14"/></svg>
+ <svg class="irl-cue-off" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><path d="M11 5 6 9H2v6h4l5 4z"/><line x1="22" y1="9" x2="16" y2="15"/><line x1="16" y1="9" x2="22" y2="15"/></svg>
+ </span>
+ <span class="irl-more-row-text">
+ <span class="irl-more-row-label">Arrival sound</span>
+ <span class="irl-more-row-sub" id="irl-cue-mute-sub">On — plays when an agent enters range</span>
+ </span>
</button>
- <button class="irl-share-btn irl-privacy-btn" id="irl-privacy-btn" type="button" aria-label="Location & privacy" title="Location & privacy">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="m9 12 2 2 4-4"/></svg>
+ <button class="irl-more-row irl-privacy-btn" id="irl-privacy-btn" type="button">
+ <span class="irl-more-row-icon" aria-hidden="true"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="m9 12 2 2 4-4"/></svg></span>
+ <span class="irl-more-row-text">
+ <span class="irl-more-row-label">Location & privacy</span>
+ <span class="irl-more-row-sub">Discovery precision, ghost visibility, your pins</span>
+ </span>
+ <svg class="irl-more-row-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
</button>
- <a class="irl-share-btn irl-privacy-btn" id="irl-worldlines-btn" href="/world-lines" aria-label="World Lines — proof-of-presence quests" title="World Lines — proof-of-presence quests">
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2v4"/><path d="M12 18v4"/><path d="M4.93 4.93l2.83 2.83"/><path d="M16.24 16.24l2.83 2.83"/><circle cx="12" cy="12" r="4"/><path d="M2 12h4"/><path d="M18 12h4"/></svg>
+ <a class="irl-more-row irl-privacy-btn" id="irl-worldlines-btn" href="/world-lines">
+ <span class="irl-more-row-icon" aria-hidden="true"><svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v4"/><path d="M12 18v4"/><path d="M4.93 4.93l2.83 2.83"/><path d="M16.24 16.24l2.83 2.83"/><circle cx="12" cy="12" r="4"/><path d="M2 12h4"/><path d="M18 12h4"/></svg></span>
+ <span class="irl-more-row-text">
+ <span class="irl-more-row-label">World Lines</span>
+ <span class="irl-more-row-sub">Proof-of-presence quests</span>
+ </span>
+ <svg class="irl-more-row-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>
</a>
- <button class="irl-share-btn irl-glasses-btn" id="irl-glasses-btn" type="button" aria-pressed="false" aria-label="Connect smart glasses" title="Connect smart glasses">
- <svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M10 15a2 2 0 0 1 4 0"/><path d="m2.5 13 1.5-5a2 2 0 0 1 2-1.5"/><path d="m21.5 13-1.5-5a2 2 0 0 0-2-1.5"/></svg>
+ <button class="irl-more-row irl-glasses-btn" id="irl-glasses-btn" type="button" aria-pressed="false">
+ <span class="irl-more-row-icon" aria-hidden="true"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="15" r="4"/><circle cx="18" cy="15" r="4"/><path d="M10 15a2 2 0 0 1 4 0"/><path d="m2.5 13 1.5-5a2 2 0 0 1 2-1.5"/><path d="m21.5 13-1.5-5a2 2 0 0 0-2-1.5"/></svg></span>
+ <span class="irl-more-row-text">
+ <span class="irl-more-row-label">Smart glasses</span>
+ <span class="irl-more-row-sub" id="irl-glasses-sub">Mirror the nearest-agent cue to a paired lens</span>
+ </span>
</button>
- <button class="irl-share-btn" id="irl-share-btn" type="button" aria-label="Share">Share</button>
-</header>
+</div>
<!-- Immersive toggle — collapses all chrome so the AR view is unobstructed.
Lives outside the topbar so it survives the collapse and remains the one
@@ -2158,38 +2344,41 @@
<span id="irl-camera-label">Camera AR</span>
</button>
+ <!-- Ordered by how often each is used: pin/place actions first (always
+ on-screen without scrolling), setup + management actions trail off the
+ right edge of the scroll strip (see .irl-secondary-row above). -->
<div class="irl-secondary-row">
- <button class="irl-pill-btn" id="irl-agents-btn" type="button" aria-label="Switch AI agent">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/><circle cx="12" cy="10" r="3"/></svg>
- My Agents
+ <button class="irl-pill-btn" id="irl-lock-btn" type="button" aria-pressed="false" aria-label="Pin avatar in real space">
+ <svg id="irl-lock-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
+ <span class="irl-lock-label">Pin here</span>
</button>
- <button class="irl-pill-btn" id="irl-avatar-btn" type="button" aria-label="Change avatar">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 3.582-7 8-7s8 3 8 7"/></svg>
- Avatar
+ <button class="irl-pill-btn" id="irl-place-btn" type="button" aria-pressed="false">
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
+ Add object
</button>
- <button class="irl-pill-btn" id="irl-anchor-btn" type="button" hidden aria-label="Place agent on the floor with AR">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v4M12 18v4M2 12h4M18 12h4"/><circle cx="12" cy="12" r="4"/></svg>
- Place on floor
+ <button class="irl-pill-btn" id="irl-clear-btn" type="button" hidden>
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/><path d="M10 11v6M14 11v6"/></svg>
+ Clear
</button>
<button class="irl-pill-btn" id="irl-carry-btn" type="button" aria-pressed="false" aria-label="Carry your agent and set it down where you aim on the floor">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3"/></svg>
Move here
</button>
- <button class="irl-pill-btn" id="irl-lock-btn" type="button" aria-pressed="false" aria-label="Pin avatar in real space">
- <svg id="irl-lock-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
- <span class="irl-lock-label">Pin here</span>
+ <button class="irl-pill-btn" id="irl-anchor-btn" type="button" hidden aria-label="Place agent on the floor with AR">
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v4M12 18v4M2 12h4M18 12h4"/><circle cx="12" cy="12" r="4"/></svg>
+ Place on floor
</button>
<button class="irl-pill-btn" id="irl-mapplace-btn" type="button" aria-label="Place this agent at a spot you choose on a map">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 6-9 12-9 12s-9-6-9-12a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
Place on map
</button>
- <button class="irl-pill-btn" id="irl-place-btn" type="button" aria-pressed="false">
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
- Add object
+ <button class="irl-pill-btn" id="irl-agents-btn" type="button" aria-label="Switch AI agent">
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/><circle cx="12" cy="10" r="3"/></svg>
+ My Agents
</button>
- <button class="irl-pill-btn" id="irl-clear-btn" type="button" hidden>
- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/><path d="M10 11v6M14 11v6"/></svg>
- Clear
+ <button class="irl-pill-btn" id="irl-avatar-btn" type="button" aria-label="Change avatar">
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 3.582-7 8-7s8 3 8 7"/></svg>
+ Avatar
</button>
<button class="irl-pill-btn" id="irl-mypins-btn" type="button" aria-label="My active pins">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
@@ -2522,6 +2711,21 @@
"unsupported device" state into #irl-overlay and never load the heavy module
(so no thrown context error reaches the console). -->
<script type="module">
+ // Publish the bottom dock's live height as --irl-dock-h so the fixed HUD
+ // pieces layered near it (joystick drag zone, money-drops FAB) always sit
+ // ABOVE the dock instead of underneath its buttons. Measured, not guessed:
+ // the dock's height moves with the status line, subtitle wrapping, and the
+ // object picker opening.
+ {
+ const dock = document.querySelector('footer.irl-bottom');
+ if (dock) {
+ const publish = () => document.documentElement.style.setProperty('--irl-dock-h', `${Math.ceil(dock.offsetHeight)}px`);
+ if ('ResizeObserver' in window) new ResizeObserver(publish).observe(dock);
+ window.addEventListener('resize', publish, { passive: true });
+ publish();
+ }
+ }
+
function webglSupported() {
try {
const c = document.createElement('canvas');
diff --git a/public/changelog.json b/public/changelog.json
index b35802f1a..38f2350ca 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,11 +1,21 @@
{
- "generated_at": "2026-07-09T21:21:42.774Z",
+ "generated_at": "2026-07-09T21:43:03.342Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
"entries": [
+ {
+ "date": "2026-07-09",
+ "type": "update",
+ "title": "/play: real water at the fishing ponds, and spare rods to find on the bank",
+ "summary": "The two fishing ponds no longer look like a flat tinted disc — they're now an animated water surface with real ripples, a sun-tracked sparkle, and a deep-to-shallow gradient that reacts to the world's day/night lighting. New alongside it: three spare fishing rods, leaning on posts around the map (both pond banks and the plaza), that any player can walk up to and pick up into their backpack — on top of the rod everyone already starts with. This also brought the chop/mine/cook gathering stations (trees, rocks, roast pits) online for the first time — they existed in the code but were never actually rendered in the world until now. Caught fish still sell for cash at the General Store, same as before.",
+ "link": "/play",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-07-09",
"type": "update",
@@ -17,6 +27,16 @@
"feature"
]
},
+ {
+ "date": "2026-07-09",
+ "type": "update",
+ "title": "Avatars render again on seven pages that were showing an empty viewer",
+ "summary": "Avatars made on three.ws are saved in a compressed format to keep them small and quick to download. Seven pages — Cosmos, Minted, Creations, Vault, Pitch, the embodied-agent page, and the microphone lipsync demo — never set up the matching decompressor, so instead of a 3D model you got an empty viewer and an error in the console. All seven now load the decoder before the model, and the avatars appear as they should. The fix also went into the embeddable agent widget itself, so anyone who has pasted a three.ws agent onto their own site gets working compressed avatars automatically, with nothing to change on their end.",
+ "link": "/cosmos",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-09",
"type": "update",
@@ -27,6 +47,16 @@
"fix"
]
},
+ {
+ "date": "2026-07-09",
+ "type": "update",
+ "title": "Two broken pages fixed: vanity receipt verifier and Drive Your Avatar",
+ "summary": "Both pages failed to load anything at all, and both are working again. The receipt verifier at /vanity/verify loads its cryptography straight into your browser so the audit runs on your machine and nothing is sent anywhere — but the browser had no way to locate those crypto libraries, so the page sat dead and no receipt could be checked. It now resolves them properly: paste a receipt and every check runs, right through to opening a sealed envelope. On /temporary, the payment widget behind the in-world \"Feature your content\" billboard was loaded the wrong way and crashed on arrival, taking the pay button with it. It now loads the same way it does on every other page that uses it.",
+ "link": "/vanity/verify",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-08",
"type": "launch",
diff --git a/public/changelog.xml b/public/changelog.xml
index 6cb0c336a..d2980778e 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -6,6 +6,14 @@
<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/>
<description>What's new on three.ws — features, improvements, and releases, newest first.</description>
<language>en</language>
+ <item>
+ <title>/play: real water at the fishing ponds, and spare rods to find on the bank</title>
+ <link>https://three.ws/play</link>
+ <guid isPermaLink="false">2026-07-09:/play: real water at the fishing ponds, and spare rods to find on the bank</guid>
+ <pubDate>Thu, 09 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The two fishing ponds no longer look like a flat tinted disc — they're now an animated water surface with real ripples, a sun-tracked sparkle, and a deep-to-shallow gradient that reacts to the world's day/night lighting. New alongside it: three spare fishing rods, leaning on posts around the map (both pond banks and the plaza), that any player can walk up to and pick up into their backpack — on top of the rod everyone already starts with. This also brought the chop/mine/cook gathering stations (trees, rocks, roast pits) online for the first time — they existed in the code but were never actually rendered in the world until now. Caught fish still sell for cash at the General Store, same as before.</description>
+ </item>
<item>
<title>Agents can now hunt money drops and complete IRL quests from code</title>
<link>https://three.ws/irl</link>
@@ -14,6 +22,14 @@
<category>sdk</category>
<description>The @three-ws/irl SDK (v0.2.0) now covers the whole IRL surface, not just pins. New functions let any script or agent discover real-money drops near where it checks in, claim them with a proof-of-presence fix (a real on-chain release to its own wallet), place self- or agent-funded drops and bounties, and run the full World Lines quest loop — find nearby quests, take the challenge at the spot, and earn the agent-signed proof-of-presence collectible, plus verify anyone's proof independently. Fully typed, zero dependencies, verified against the live API.</description>
</item>
+ <item>
+ <title>Avatars render again on seven pages that were showing an empty viewer</title>
+ <link>https://three.ws/cosmos</link>
+ <guid isPermaLink="false">2026-07-09:Avatars render again on seven pages that were showing an empty viewer</guid>
+ <pubDate>Thu, 09 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Avatars made on three.ws are saved in a compressed format to keep them small and quick to download. Seven pages — Cosmos, Minted, Creations, Vault, Pitch, the embodied-agent page, and the microphone lipsync demo — never set up the matching decompressor, so instead of a 3D model you got an empty viewer and an error in the console. All seven now load the decoder before the model, and the avatars appear as they should. The fix also went into the embeddable agent widget itself, so anyone who has pasted a three.ws agent onto their own site gets working compressed avatars automatically, with nothing to change on their end.</description>
+ </item>
<item>
<title>Live SOL price restored on /three-live; Flappin UFO demo retired</title>
<link>https://three.ws/three-live</link>
@@ -22,6 +38,14 @@
<category>fix</category>
<description>Two quiet breakages, fixed. The live trade feed on /three-live now prices SOL-only trades correctly again — it was reading a price API directly from your browser, which the provider silently blocks, so those trades showed no dollar value; it now reads the same cached, multi-provider SOL/USD price the rest of the platform uses. Separately, the Flappin UFO arcade demo ran on an external deployment that has gone offline, leaving a blank screen and a leaderboard that never loaded. Rather than leave a broken page up, /play/ufo is now an honest retired notice that points you to the live experiences — the coin world, Sniper Arena, and Coin Clash.</description>
</item>
+ <item>
+ <title>Two broken pages fixed: vanity receipt verifier and Drive Your Avatar</title>
+ <link>https://three.ws/vanity/verify</link>
+ <guid isPermaLink="false">2026-07-09:Two broken pages fixed: vanity receipt verifier and Drive Your Avatar</guid>
+ <pubDate>Thu, 09 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Both pages failed to load anything at all, and both are working again. The receipt verifier at /vanity/verify loads its cryptography straight into your browser so the audit runs on your machine and nothing is sent anywhere — but the browser had no way to locate those crypto libraries, so the page sat dead and no receipt could be checked. It now resolves them properly: paste a receipt and every check runs, right through to opening a sealed envelope. On /temporary, the payment widget behind the in-world &quot;Feature your content&quot; billboard was loaded the wrong way and crashed on arrival, taking the pay button with it. It now loads the same way it does on every other page that uses it.</description>
+ </item>
<item>
<title>Blockchain TVL by Chain</title>
<link>https://three.ws/chains</link>
diff --git a/public/features.json b/public/features.json
index 918fc0cdc..cb280f58f 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-09T21:21:42.757Z",
+ "generated_at": "2026-07-09T21:43:03.329Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 4a1e896ca..4540c5886 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -56,25 +56,6 @@
.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }
.sm-brand:hover { text-decoration: none; }
</style>
-
- <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="three.ws">
- <meta property="og:locale" content="en_US">
- <meta property="og:title" content="Sitemap · three.ws">
- <meta property="og:description" content="Human-readable index of every page on three.ws.">
- <meta property="og:url" content="https://three.ws/sitemap">
- <meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
- <meta property="og:image:width" content="1200">
- <meta property="og:image:height" content="630">
- <meta property="og:image:type" content="image/png">
- <meta property="og:image:alt" content="Sitemap — three.ws">
- <meta name="twitter:card" content="summary_large_image">
- <meta name="twitter:site" content="@trythreews">
- <meta name="twitter:title" content="Sitemap · three.ws">
- <meta name="twitter:description" content="Human-readable index of every page on three.ws.">
- <meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script>
</head>
<body>
<header class="sm-topbar">
diff --git a/src/game/coincommunities.js b/src/game/coincommunities.js
index 11d6cd70d..121db31ab 100644
--- a/src/game/coincommunities.js
+++ b/src/game/coincommunities.js
@@ -1141,7 +1141,6 @@ export class CoinCommunities {
net: this.net,
ui: this.ui,
});
- window.__ccDebugTmp = this; // TEMP verification hook, reverted before commit
this.net.on('profile', (snap) => { this.playSystems?.setProfile(snap); this._onCosmeticsProfile(snap); });
this.net.on('inv', (delta) => this.playSystems?.applyInv(delta));
this.net.on('xpgain', (g) => this.playSystems?.onXpGain(g));
diff --git a/src/irl.js b/src/irl.js
index 61d1a4607..9db5282f5 100644
--- a/src/irl.js
+++ b/src/irl.js
@@ -3406,6 +3406,8 @@ function syncCueMuteButton() {
btn.classList.toggle('is-muted', _cueMuted);
btn.setAttribute('aria-label', _cueMuted ? 'Arrival sound off — tap to unmute' : 'Arrival sound on — tap to mute');
btn.title = _cueMuted ? 'Arrival sound off' : 'Arrival sound on';
+ const sub = document.getElementById('irl-cue-mute-sub');
+ if (sub) sub.textContent = _cueMuted ? 'Off — tap to turn back on' : 'On — plays when an agent enters range';
}
// The transient "look around" banner. aria-live polite so a screen reader announces
@@ -5021,6 +5023,7 @@ new MutationObserver(() => {
// L3 — Location & privacy center: honest disclosure + discovery precision +
// presence opt-in + a jump into pin management, all in one designed surface.
document.getElementById('irl-privacy-btn')?.addEventListener('click', () => {
+ closeMoreSheet();
openPrivacyCenter({
getGhost: getShareGhost,
setGhost: applyGhost,
@@ -5042,13 +5045,34 @@ function syncGlassesButton() {
const label = on ? `Glasses connected — ${glassesBridge.deviceName || 'tap to manage'}` : 'Connect smart glasses';
glassesBtn.setAttribute('aria-label', label);
glassesBtn.title = label;
+ const sub = document.getElementById('irl-glasses-sub');
+ if (sub) sub.textContent = on ? `Connected — ${glassesBridge.deviceName || 'tap to manage'}` : 'Mirror the nearest-agent cue to a paired lens';
}
-glassesBtn?.addEventListener('click', () => openGlassesConnect(glassesBridge));
+glassesBtn?.addEventListener('click', () => { closeMoreSheet(); openGlassesConnect(glassesBridge); });
glassesBridge.on('status', syncGlassesButton);
syncGlassesButton();
// Clean BLE teardown if the page goes away while paired.
window.addEventListener('pagehide', () => { try { glassesBridge.destroy(); } catch {} });
+// "More" overflow sheet — arrival sound, location & privacy, World Lines,
+// smart glasses. Mirrors the My Pins sheet's open/close + focus-trap contract.
+const moreBtn = document.getElementById('irl-more-btn');
+function openMoreSheet() {
+ const sheet = document.getElementById('irl-more-sheet');
+ if (!sheet) return;
+ sheet.classList.add('is-open');
+ moreBtn?.setAttribute('aria-expanded', 'true');
+ trapSheet(sheet, closeMoreSheet, { initialFocus: document.getElementById('irl-more-close') });
+}
+function closeMoreSheet() {
+ const sheet = document.getElementById('irl-more-sheet');
+ sheet?.classList.remove('is-open');
+ moreBtn?.setAttribute('aria-expanded', 'false');
+ releaseSheet(sheet);
+}
+moreBtn?.addEventListener('click', openMoreSheet);
+document.getElementById('irl-more-close')?.addEventListener('click', closeMoreSheet);
+
document.getElementById('irl-mypins-close')?.addEventListener('click', closeMyPinsSheet);
document.getElementById('irl-mypins-list')?.addEventListener('click', (e) => {
diff --git a/src/irl/discovery.js b/src/irl/discovery.js
index 993330787..79b2d3b6d 100644
--- a/src/irl/discovery.js
+++ b/src/irl/discovery.js
@@ -285,6 +285,8 @@ const MODAL_CSS = `
transition: background .15s, color .15s, transform .12s;
}
.irl-dx-help[hidden] { display: none; }
+/* Touch: 30px misses the 44px tap floor by a wide margin — grow the circle. */
+@media (hover: none) { .irl-dx-help { width: 40px; height: 40px; font-size: 16px; } }
.irl-dx-help:hover { background: rgba(30,40,58,0.88); color: #eaf4ff; }
.irl-dx-help:active { transform: scale(0.94); }
.irl-dx-help:focus-visible { outline: 2px solid #8ec5ff; outline-offset: 2px; }
diff --git a/src/shared/irl-drops.js b/src/shared/irl-drops.js
index 4d9ad74a4..94a11e345 100644
--- a/src/shared/irl-drops.js
+++ b/src/shared/irl-drops.js
@@ -720,7 +720,11 @@ function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); }
function ensureStyles() {
if (_styled) return; _styled = true;
const css = `
-.irl-drops-fab{position:fixed;right:16px;bottom:calc(96px + env(safe-area-inset-bottom,0px));z-index:60;width:52px;height:52px;border-radius:999px;border:1px solid var(--wallet-stroke,rgba(139,92,246,.3));background:linear-gradient(160deg,rgba(20,18,30,.95),rgba(12,10,18,.95));color:var(--wallet-accent,#c4b5fd);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 24px rgba(0,0,0,.5),0 0 0 0 var(--wallet-glow,rgba(139,92,246,.45));transition:transform .15s,box-shadow .2s,border-color .2s}
+.irl-drops-fab{position:fixed;right:16px;bottom:calc(var(--irl-dock-h, calc(96px + env(safe-area-inset-bottom,0px))) + 12px);z-index:60;width:52px;height:52px;border-radius:999px;border:1px solid var(--wallet-stroke,rgba(139,92,246,.3));background:linear-gradient(160deg,rgba(20,18,30,.95),rgba(12,10,18,.95));color:var(--wallet-accent,#c4b5fd);display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 6px 24px rgba(0,0,0,.5),0 0 0 0 var(--wallet-glow,rgba(139,92,246,.45));transition:transform .15s,box-shadow .2s,border-color .2s}
+body.irl-immersive .irl-drops-fab{bottom:calc(env(safe-area-inset-bottom,0px) + 16px)}
+/* Any open bottom sheet outranks the FAB — it must never paint over a sheet's
+ controls (it sits at z 60 so it clears the page HUD, not the dialogs). */
+body:has([id$="-sheet"].is-open) .irl-drops-fab,body:has(#irl-caption-panel.is-open) .irl-drops-fab,body:has(#irl-calibrate-panel.is-open) .irl-drops-fab{opacity:0;pointer-events:none}
.irl-drops-fab:hover{transform:translateY(-2px);border-color:var(--wallet-stroke-strong,rgba(139,92,246,.5));box-shadow:0 10px 30px rgba(0,0,0,.55),0 0 24px var(--wallet-glow,rgba(139,92,246,.45))}
.irl-drops-fab:active{transform:translateY(0)}
.irl-drops-fab:focus-visible{outline:2px solid var(--wallet-focus,rgba(139,92,246,.7));outline-offset:2px}
@@ -735,11 +739,13 @@ function ensureStyles() {
.irl-drops-handle{width:38px;height:4px;border-radius:99px;background:rgba(255,255,255,.18);margin:2px auto 10px}
.irl-drops-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.irl-drops-head h2{margin:0;font:700 17px var(--font-display,Inter,sans-serif);color:var(--ink-bright,#fff)}
-.irl-drops-close{background:none;border:none;color:var(--ink-dim,#9ca3af);font-size:16px;cursor:pointer;padding:6px;border-radius:8px}
+.irl-drops-close{background:none;border:none;color:var(--ink-dim,#9ca3af);font-size:16px;cursor:pointer;padding:6px;border-radius:8px;min-width:36px;min-height:36px}
+@media (hover:none){.irl-drops-close{min-width:44px;min-height:44px;font-size:18px}}
.irl-drops-close:hover{color:#fff;background:rgba(255,255,255,.06)}
.irl-drops-close:focus-visible{outline:2px solid var(--wallet-focus,rgba(139,92,246,.7));outline-offset:1px}
.irl-drops-tabs{display:flex;gap:6px;margin-bottom:10px}
.irl-drops-tab{flex:1;padding:8px 6px;border-radius:10px;border:1px solid transparent;background:rgba(255,255,255,.04);color:var(--ink-dim,#9ca3af);font:600 12.5px var(--font-body,Inter);cursor:pointer;transition:background .15s,color .15s,border-color .15s}
+@media (hover:none){.irl-drops-tab{min-height:44px}}
.irl-drops-tab:hover{background:rgba(255,255,255,.07);color:#e5e7eb}
.irl-drops-tab[aria-selected=true]{background:var(--wallet-accent-fill,rgba(139,92,246,.15));border-color:var(--wallet-stroke,rgba(139,92,246,.3));color:var(--wallet-accent,#c4b5fd)}
.irl-drops-tab:focus-visible{outline:2px solid var(--wallet-focus,rgba(139,92,246,.7));outline-offset:1px}
diff --git a/tests/api/irl-privacy-center.test.js b/tests/api/irl-privacy-center.test.js
index 31ca221ff..5689d3a59 100644
--- a/tests/api/irl-privacy-center.test.js
+++ b/tests/api/irl-privacy-center.test.js
@@ -34,7 +34,7 @@ const sqlMock = vi.fn((strings, ...values) => {
calls.push({ q, values });
// ── Summary aggregates ──
- if (/FILTER \(WHERE hidden_at IS NOT NULL\)/i.test(q)) return P(summaryPinAgg);
+ if (/FILTER \(WHERE published IS FALSE\)/i.test(q)) return P(summaryPinAgg);
if (/JOIN irl_pins/i.test(q) && /COUNT\(\*\)::int\s+AS total/i.test(q)) return P(summaryInbox);
if (/FROM irl_interactions/i.test(q) && /viewer_device =/i.test(q) && /COUNT\(\*\)::int AS total/i.test(q)) {
return P(summaryAuthored);
@@ -195,16 +195,30 @@ describe('PATCH visibility — owner-gated unpublish / republish', () => {
expect(writes.length).toBe(0);
});
- it('unpublish on an owned pin → 200 hidden:true; republish → hidden:false', async () => {
- updateResult = [{ id: PIN_ID, hidden_at: '2026-06-23T00:00:00Z' }];
+ // Unpublish writes `published`, NOT `hidden_at`: a pin taken out of public view
+ // must stay visible to its own owner in AR (hidden_at blanks it for everyone).
+ it('unpublish on an owned pin → 200 private; republish → public', async () => {
+ updateResult = [{ id: PIN_ID, published: false }];
const hide = await call('PATCH', { body: { pinId: PIN_ID, action: 'unpublish' }, device: DEVICE });
expect(hide.res.statusCode).toBe(200);
expect(hide.body.hidden).toBe(true);
+ expect(hide.body.visibility).toBe('private');
- updateResult = [{ id: PIN_ID, hidden_at: null }];
+ updateResult = [{ id: PIN_ID, published: true }];
const show = await call('PATCH', { body: { pinId: PIN_ID, action: 'republish' }, device: DEVICE });
expect(show.res.statusCode).toBe(200);
expect(show.body.hidden).toBe(false);
+ expect(show.body.visibility).toBe('public');
+ });
+
+ // The UPDATE must touch `published` and never re-introduce the moderation column.
+ it('the visibility UPDATE writes published, never hidden_at', async () => {
+ calls.length = 0;
+ updateResult = [{ id: PIN_ID, published: false }];
+ await call('PATCH', { body: { pinId: PIN_ID, action: 'unpublish' }, device: DEVICE });
+ const update = calls.map(c => c.q).find(q => /UPDATE irl_pins/i.test(q));
+ expect(update).toMatch(/SET published = FALSE/i);
+ expect(update).not.toMatch(/hidden_at/i);
});
it('a non-owner matches no row (UPDATE RETURNING empty) → 404', async () => {
diff --git a/tests/home-thumbnail-orb.test.js b/tests/home-thumbnail-orb.test.js
new file mode 100644
index 000000000..df8642da9
--- /dev/null
+++ b/tests/home-thumbnail-orb.test.js
@@ -0,0 +1,63 @@
+// Regression guard: the homepage must never synthesise an R2 thumbnail URL.
+//
+// The forge/avatar APIs already answer honestly — /api/explore returns
+// `image: null` and /api/marketplace returns `thumbnail_url: null` when an
+// avatar has no stored thumbnail (see api/explore.js `thumbnailUrl()`, which
+// also drops legacy absolute `_og.png` keys). The homepage used to paper over
+// that null by guessing `https://<bucket>.r2.dev/thumb/<avatarId>.png`.
+//
+// That object was never written for ~79% of public avatars, so R2 answered 404
+// with a `text/plain` body. Chrome's Opaque Response Blocking then refused the
+// response for an <img> request and logged net::ERR_BLOCKED_BY_ORB — five per
+// homepage load, every visitor. The `.pg-avatar-initial` / `.mktplace-item-initial`
+// placeholders are the designed fallback; a guessed URL defeats them.
+//
+// These are filesystem assertions on the page source, so they run without a browser.
+
+import { describe, it, expect, beforeAll } from 'vitest';
+import { readFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+
+const root = resolve(__dirname, '..');
+const read = (p) => readFileSync(resolve(root, p), 'utf8');
+
+describe('homepage thumbnails — no fabricated R2 URLs (ORB regression)', () => {
+ let home;
+ beforeAll(() => {
+ home = read('pages/home.html');
+ });
+
+ it('never hardcodes an r2.dev thumb/ CDN base', () => {
+ // The bucket's public domain belongs in S3_PUBLIC_DOMAIN and is applied
+ // server-side by r2.js publicUrl(). A client-side copy can only ever guess.
+ expect(home).not.toMatch(/r2\.dev\/thumb/);
+ expect(home).not.toMatch(/THUMB_CDN/);
+ });
+
+ it('does not build a thumb/<id>.png key on the client', () => {
+ expect(home).not.toMatch(/['"`]\s*\+\s*id\s*\+\s*['"`]\.png/);
+ expect(home).not.toMatch(/thumb\/\$\{/);
+ });
+
+ it('reads the avatar picker thumbnail straight off the explore feed', () => {
+ // `image` is the field /api/explore emits; `thumbUrl` never existed on it.
+ expect(home).toMatch(/thumb:\s*item\.image\s*\|\|\s*null/);
+ expect(home).not.toMatch(/item\.thumbUrl/);
+ });
+
+ it('reads the marketplace thumbnail off the documented response shape', () => {
+ // /api/marketplace answers { data: { items: [{ id, name, thumbnail_url }] } }.
+ expect(home).toMatch(/body\.data\.items/);
+ expect(home).toMatch(/item\.thumbnail_url/);
+ // The pre-fix code read `data.agents || data.items || data`, which fell through
+ // to the envelope object and threw on .slice() — the strip silently rendered
+ // nothing behind its own .catch().
+ expect(home).not.toMatch(/data\.agents\s*\|\|\s*data\.items\s*\|\|\s*data/);
+ });
+
+ it('ships an initial-letter placeholder for thumbnail-less avatars', () => {
+ // Both strips must degrade to a designed placeholder, not a broken <img>.
+ expect(home).toMatch(/\.pg-avatar-initial\s*\{/);
+ expect(home).toMatch(/\.mktplace-item-initial\s*\{/);
+ });
+});
diff --git a/tests/irl-private-pins.test.js b/tests/irl-private-pins.test.js
new file mode 100644
index 000000000..74273ed37
--- /dev/null
+++ b/tests/irl-private-pins.test.js
@@ -0,0 +1,132 @@
+// IRL private pins (owner-only visibility) — regression fence.
+//
+// `published = false` means PRIVATE: the pin renders for its OWNER but is withheld
+// from every other reader. This is the only control on /irl that holds against a
+// patient attacker — proof-of-presence (IRL_FIX_SECRET) merely raises the cost of a
+// geographic sweep, because the fix-token mint trusts caller-supplied coordinates.
+// A private pin is not a cost, it is an absence: no sweep, at any budget, returns a
+// coordinate the query never selects.
+//
+// Two guarantees are locked here:
+// 1. readVisibility() resolves a placement's visibility, defaulting to PRIVATE
+// whenever IRL_DEFAULT_PRIVATE is set (the pre-launch posture).
+// 2. Every query that can return another user's coordinates carries the
+// visibility predicate. A future edit that drops one turns the build RED.
+
+import { describe, it, expect, afterEach } from 'vitest';
+import { readFileSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+
+import { readVisibility } from '../api/irl/pins.js';
+
+const src = (rel) => readFileSync(fileURLToPath(new URL(rel, import.meta.url)), 'utf8');
+
+const ORIGINAL = process.env.IRL_DEFAULT_PRIVATE;
+afterEach(() => {
+ if (ORIGINAL === undefined) delete process.env.IRL_DEFAULT_PRIVATE;
+ else process.env.IRL_DEFAULT_PRIVATE = ORIGINAL;
+});
+
+describe('readVisibility — the safe default is the one that cannot leak by omission', () => {
+ it('defaults to public when IRL_DEFAULT_PRIVATE is unset', () => {
+ delete process.env.IRL_DEFAULT_PRIVATE;
+ expect(readVisibility({})).toBe('public');
+ expect(readVisibility(undefined)).toBe('public');
+ });
+
+ it('defaults to private when IRL_DEFAULT_PRIVATE is set', () => {
+ for (const on of ['1', 'true', 'TRUE', 'yes', ' Yes ']) {
+ process.env.IRL_DEFAULT_PRIVATE = on;
+ expect(readVisibility({})).toBe('private');
+ }
+ });
+
+ it('treats a falsy-looking value as NOT private (no accidental opt-in)', () => {
+ for (const off of ['0', 'false', 'no', '']) {
+ process.env.IRL_DEFAULT_PRIVATE = off;
+ expect(readVisibility({})).toBe('public');
+ }
+ });
+
+ it('an explicit visibility always wins over the deployment default', () => {
+ process.env.IRL_DEFAULT_PRIVATE = '1';
+ expect(readVisibility({ visibility: 'public' })).toBe('public');
+ delete process.env.IRL_DEFAULT_PRIVATE;
+ expect(readVisibility({ visibility: 'private' })).toBe('private');
+ });
+
+ it('an unrecognised visibility falls back to the default, never silently public', () => {
+ process.env.IRL_DEFAULT_PRIVATE = '1';
+ for (const junk of ['unlisted', 'null', '{}', 'true', 'pub']) {
+ expect(readVisibility({ visibility: junk })).toBe('private');
+ }
+ });
+
+ it('normalises case and surrounding whitespace on an explicit value', () => {
+ delete process.env.IRL_DEFAULT_PRIVATE;
+ expect(readVisibility({ visibility: ' PRIVATE ' })).toBe('private');
+ expect(readVisibility({ visibility: 'Public' })).toBe('public');
+ });
+});
+
+describe('every coordinate-returning read honours pin visibility', () => {
+ const pins = src('../api/irl/pins.js');
+ const worldLines = src('../api/irl/world-lines.js');
+
+ // The two pins reads that return OTHER users' coordinates must admit a
+ // non-public pin only when the caller owns it (by session uuid or device token).
+ it('pins.js nearby + room reads gate on published OR owner', () => {
+ const ownerAware = pins.match(
+ /AND \(published IS NOT FALSE\s*\n\s*OR \(\$\{myId\}::uuid IS NOT NULL AND user_id = \$\{myId\}::uuid\)\s*\n\s*OR \(\$\{myTok\}::text IS NOT NULL AND device_token = \$\{myTok\}::text\)\)/g,
+ );
+ expect(ownerAware, 'nearby + room reads must both carry the owner-aware predicate').toHaveLength(2);
+ });
+
+ // Both public projections must SELECT `published` so the owner's UI can badge a
+ // private pin. (The third `WHERE room_id =` read is the room-calibrate path: it
+ // returns relative offsets, not a public projection, and refuses unless EVERY pin
+ // in the room belongs to the caller — so it is owner-gated and exempt.)
+ it('both public pin projections select published', () => {
+ const selects = pins.match(/placement_kind, fuzz_radius_m, published/g) ?? [];
+ expect(selects).toHaveLength(2);
+ expect(pins).toMatch(/visibility:\s+r\.published === false \? 'private' : 'public'/);
+ });
+
+ // World Lines is the widest coordinate radius we ship (600 m vs 60 m for pins),
+ // so its discovery join is the cheapest private-pin bypass if left unfiltered.
+ it('world-lines discovery filters out quests anchored to a private pin', () => {
+ expect(worldLines).toMatch(/JOIN irl_pins p ON p\.id = w\.pin_id/);
+ expect(worldLines).toContain('AND p.published IS NOT FALSE');
+ });
+
+ // Anchoring a quest to a private pin would publish the coordinate the owner
+ // marked private. Refuse at creation, not merely at read time.
+ it('world-lines refuses to anchor a quest to a private pin', () => {
+ expect(worldLines).toContain("SELECT id, user_id, agent_id, lat, lng, published FROM irl_pins");
+ expect(worldLines).toMatch(/if \(pin\.published === false\)/);
+ });
+});
+
+describe('unpublish is private-to-owner, not moderation', () => {
+ const privacy = src('../api/irl/privacy.js');
+
+ // The prior implementation set hidden_at, which blanks the pin for the OWNER
+ // too — unusable for anyone testing a placement they took out of public view.
+ it('PATCH writes published, never hidden_at', () => {
+ expect(privacy).toContain('SET published = FALSE');
+ expect(privacy).toContain('SET published = TRUE');
+ expect(privacy).not.toMatch(/SET hidden_at = NOW\(\)/);
+ });
+
+ // Null-guard the SUPPLIED token, not the column: a caller with no device token
+ // must match nothing, rather than matching rows whose device_token is empty.
+ it('the owner clause null-guards the supplied device token', () => {
+ expect(privacy).not.toContain("device_token = ${deviceToken ?? ''}");
+ const guarded = privacy.match(/\$\{deviceToken\}::text IS NOT NULL AND device_token = \$\{deviceToken\}::text/g);
+ expect(guarded?.length ?? 0).toBeGreaterThanOrEqual(2);
+ });
+
+ it('the data summary counts private pins via published, not hidden_at', () => {
+ expect(privacy).toContain('COUNT(*) FILTER (WHERE published IS FALSE)::int AS unpublished');
+ });
+});