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.

docs(play): document event souvenirs, expand accessory generation tooling

nirholasd7e288352751
diff --git a/docs/coin-wars.md b/docs/coin-wars.md
index 452718ef8..6669079a5 100644
--- a/docs/coin-wars.md
+++ b/docs/coin-wars.md
@@ -138,7 +138,7 @@ as "no wars".
### `GET /api/wars?action=live&coin=<mint>`
-Just the running battles. This is the spectator poll; it never touches Postgres.
+Just the running battles. This is the spectator poll: it never touches Postgres.
### `POST /api/wars?action=queue`
diff --git a/docs/event-souvenirs.md b/docs/event-souvenirs.md
new file mode 100644
index 000000000..9eb554fa0
--- /dev/null
+++ b/docs/event-souvenirs.md
@@ -0,0 +1,225 @@
+# Event souvenirs: the wearable you keep for having been there
+
+Some things should not be for sale.
+
+When a live event runs in `/play`, everyone who walks into the event world while
+it is happening is handed a free commemorative wearable. It lands on your
+account, it is yours forever, and you can wear it in every coin world from then
+on. When the event ends, it is never granted again. There is no purchase path,
+no second chance, no listing in the boutique. The only way to have one is to
+have been there.
+
+That constraint is the entire product. A cosmetic you can buy later says nothing
+about you. This one says exactly one thing, permanently, to every player who
+walks past you.
+
+The first one is the **Meetup Laurel**: a gold laurel circlet, open at the
+front, with three pearl berries in the gap. It is granted at the
+[`$THREE` First Holders Meetup](play-live-events.md).
+
+---
+
+## For players
+
+1. Open the event world while the event is live. The countdown chip and the
+ lobby banner both link straight to it.
+2. A card slides in over the corner of the HUD the moment the souvenir lands:
+ what you got, why, and a **Wear it** button. It is not a modal, so it never
+ interrupts what you were doing, and it retires itself after a few seconds
+ (it pauses while your pointer or keyboard focus is on it).
+3. Dismissed it? It is waiting in **My Fits**, badged as new, in the Headwear
+ row.
+
+You are granted it once. Reconnecting, refreshing, or coming back the next day
+does not give you a second one and does not show the card again.
+
+---
+
+## For whoever runs the event
+
+Everything lives in one file: [`public/event.json`](../public/event.json), the
+same config that drives the countdown pill, the agenda drawer, and the fireworks
+finale. Add a `souvenir` block:
+
+```json
+{
+ "id": "three-first-meetup",
+ "name": "$THREE First Holders Meetup",
+ "startsAt": "2026-08-09T17:00:00Z",
+ "endsAt": "2026-08-09T19:30:00Z",
+ "link": "/play?coin=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump&name=three.ws&symbol=three",
+ "souvenir": { "cosmeticId": "laurel-meetup" }
+}
+```
+
+That is the whole configuration. Three fields already had to be right for the
+countdown to work, and the drop reuses all three:
+
+| Field | What the drop reads from it |
+| --- | --- |
+| `startsAt` / `endsAt` | The claim window, half-open: `[startsAt, endsAt)`. At the instant the event ends, the souvenir stops being granted. |
+| `link` | The **world**. The `coin` query parameter names the only world the drop applies in, so it can never target a world the event does not advertise. |
+| `souvenir.cosmeticId` | The item. Must be a `tier: 'event'` entry in the cosmetics catalog. |
+
+Omit the `souvenir` block entirely to run an event with no drop.
+
+### Running a drop, start to finish
+
+1. **Author the item** in
+ [`multiplayer/src/cosmetics-catalog.js`](../multiplayer/src/cosmetics-catalog.js)
+ with `tier: 'event'` and `price: 0`. See [Adding a new souvenir](#adding-a-new-souvenir).
+2. **Point the config at it** with the `souvenir` block above.
+3. **Check it parses** before the night of the event, not during it:
+ ```bash
+ npx vitest run tests/event-souvenir.test.js
+ ```
+ The suite reads the real `public/event.json` and fails if the shipped config
+ would grant nothing.
+4. **Deploy.** The game server fetches the config over HTTP and re-reads it
+ every two minutes, so moving a window does not need a game-server redeploy.
+ `EVENT_CONFIG_TTL_MS` tightens that interval while you are setting up.
+5. **Watch it land.** Every grant logs one line:
+ ```
+ [walk_world <roomId>] souvenir laurel-meetup → <account> (three-first-meetup)
+ ```
+
+### What the server refuses to do
+
+These are guards, not warnings: each one silently grants nothing rather than
+doing the wrong thing.
+
+- **Grant outside the window.** Before `startsAt` or at/after `endsAt`, nothing.
+- **Grant in another world.** Standing in an unrelated coin world during the
+ event earns nothing, even though the event is live.
+- **Grant a boutique item.** If `cosmeticId` names a `premium` cosmetic, the
+ whole drop is treated as unconfigured. A typo cannot hand every attendee a
+ 400-`$THREE` Stetson.
+- **Grant twice.** The grant is idempotent on the account, so reconnects and
+ room hops produce one unlock and one announcement.
+- **Block a join.** An unreachable or malformed config means no drop, never an
+ error and never a delay: the world opens normally.
+
+---
+
+## How it works
+
+```
+public/event.json ──HTTP──▶ multiplayer/src/event-drop.js (window + world + item)
+ │
+ WalkRoom.onJoin
+ │ dropClaimable(drop, world, now)?
+ ▼
+ grantCosmetic(profile, id) (idempotent)
+ │ newly unlocked?
+ ┌───────────────┴───────────────┐
+ ▼ ▼
+ persist to account send `souvenir` to that client
+ │
+ ▼
+ src/game/event-souvenir.js (the card)
+ cosmetics-wardrobe.js (the "New" badge)
+```
+
+The grant is **server-side only**. A client never asks for a souvenir and cannot
+claim one: it learns it has one because the server tells it. The `souvenir`
+message is sent on the transition from not-owned to owned and at no other time,
+which is what lets the client treat it as a moment rather than state to
+reconcile.
+
+Ownership then behaves exactly like a purchased cosmetic: it is stored on the
+account profile, survives restarts and world switches, is re-validated on every
+equip, and is published on the shared schema so peers render it. A client
+asserting the item in a join loadout without owning it is silently dressed in
+the slot default.
+
+### Why the window lives in the config and not in code
+
+The countdown chip, the agenda, the fireworks and the drop all derive from the
+same `startsAt`/`endsAt`. If the drop had its own copy of the schedule, the two
+could disagree, and the failure mode is the worst one available: a player who
+watched the countdown hit zero, walked in, and got nothing. Reading one file
+makes that class of bug unrepresentable.
+
+---
+
+## Adding a new souvenir
+
+An event-tier cosmetic is an ordinary catalog entry with a tier that keeps it
+out of the shop:
+
+```js
+{
+ id: 'laurel-meetup',
+ name: 'Meetup Laurel',
+ slot: 'headwear',
+ rarity: 'legendary',
+ tier: 'event', // granted, never sold
+ price: 0, // and so never listed in the boutique
+ visual: { prop: '/accessories/laurel-meetup.glb', anchor: 'head' },
+ thumb: '/accessories/thumbs/laurel-meetup.png',
+}
+```
+
+If it needs an asset, both the model and its poster are generated from the repo,
+so neither can drift from the other:
+
+```bash
+node scripts/generate-accessory-glbs.mjs laurel-meetup.glb # the GLB (68 KB)
+node scripts/render-accessory-thumbs.mjs laurel-meetup # the poster PNG
+```
+
+Passing a filename regenerates only that one, leaving every other committed
+binary untouched. The geometry is authored procedurally in
+[`scripts/generate-accessory-glbs.mjs`](../scripts/generate-accessory-glbs.mjs)
+alongside the hats and glasses; repeated elements (the laurel's eighteen leaves)
+are built in a loop and merged into a single primitive so one look costs one
+material.
+
+Do **not** add an event souvenir to
+[`public/accessories/presets.json`](../public/accessories/presets.json). That
+catalog is the character studio's, it is not ownership-gated, and listing a
+souvenir there would hand it to everyone.
+
+---
+
+## Verifying it
+
+Two layers, both real.
+
+```bash
+npx vitest run tests/event-souvenir.test.js # window gating, idempotency, economy separation
+node scripts/play-souvenir-e2e.mjs # a real browser against a real game server
+```
+
+The e2e run boots Vite and Colyseus on private ports, serves an event config it
+controls, and walks the whole feature: a player joins during a live window and
+is granted the item once, wears it from the card, a second player sees it on
+them, a full reconnect re-grants nothing and the item is still worn, and a fresh
+player joining after the window closes gets nothing while the earlier attendee
+keeps theirs. It edits nothing in the repo to do it, so there is no live window
+left behind to clean up.
+
+---
+
+## Where the code lives
+
+| Piece | Location |
+| --- | --- |
+| Window, world and item resolution | [multiplayer/src/event-drop.js](../multiplayer/src/event-drop.js) |
+| Join-time grant | `_grantEventSouvenir` in [multiplayer/src/rooms/WalkRoom.js](../multiplayer/src/rooms/WalkRoom.js) |
+| The `event` tier + catalog entry | [multiplayer/src/cosmetics-catalog.js](../multiplayer/src/cosmetics-catalog.js) |
+| Unlock + persistence | `grantCosmetic` / `restoreProfile` in [multiplayer/src/economy.js](../multiplayer/src/economy.js) |
+| The drop card | [src/game/event-souvenir.js](../src/game/event-souvenir.js) |
+| Wardrobe treatment ("New", "Not for sale") | [src/game/cosmetics-wardrobe.js](../src/game/cosmetics-wardrobe.js) |
+| Event config | [public/event.json](../public/event.json) |
+| Asset generators | [scripts/generate-accessory-glbs.mjs](../scripts/generate-accessory-glbs.mjs), [scripts/render-accessory-thumbs.mjs](../scripts/render-accessory-thumbs.mjs) |
+
+---
+
+## Related
+
+- **[Live events in /play](play-live-events.md)** covers the rest of what that
+ config file drives: the countdown, the agenda drawer, the fireworks.
+- **[The in-game economy](in-game-economy.md)** covers the two currencies and
+ the `$THREE` boutique the souvenir deliberately stays out of.
+- **[Coin communities](coin-pages.md)** covers the worlds the events happen in.
diff --git a/docs/ibm-community-recap-jessica.md b/docs/ibm-community-recap-jessica.md
index a6eff8dcd..b5f04b5d2 100644
--- a/docs/ibm-community-recap-jessica.md
+++ b/docs/ibm-community-recap-jessica.md
@@ -1,60 +1,94 @@
-# Recap: The First Three.ws User Group Meetup (skeleton, fill in after the day ends)
-
-This is a skeleton for the recap blog, to be finished once today's meetup (Friday, August 7, 8 AM
-to 5 PM Pacific) actually wraps. It cannot be written honestly before the day happens, so the
-sections below are structure and anchor material, not a finished post. Two separate writeups come
-out of it, both real pieces, neither a copy-paste of the other:
-
-- **On IBM Community**, as Jessica's follow-up blog in the Three.ws User Group, the way [Join the
- Three.ws User Group's First In-World Meetup This Friday](./ibm-community-blog-meetup-jessica.md)
- was her announcement post and [LIVE at the Meetup: My Honest Take So
- Far](./ibm-community-live-reaction-jessica.md) was her mid-day reaction.
-- **On three.ws/blog**, the team's own side of the day, written separately, not translated from
- Jessica's post.
-
-## Anchor material (already true, do not invent more)
-
-These are the specifics Jessica gave for her live reaction and they carry into the recap:
-
-- Went in knowing this was a unique situation: three.ws is the only project with its own dedicated
- group on IBM Community, and the project had already been on IBM's radar before the group existed.
-- The X exchanges between IBM and three.ws went viral a few weeks before the event, and people
- inside IBM talk about three.ws because of it, not just because of this group.
-- The framing that made the day work: neither IBM nor three.ws is the slow, boring-enterprise
- thing people assume; both like trying things that are actually new.
-- Fishing, cooking what was caught, driving the cars around, and hanging out and talking with
- Broke Boi and bigB, no pitch deck, no slides.
-- Jessica was never really into crypto before this; three.ws changed that, not through a pitch but
- through the time spent in and around it.
-- She said she feels lucky to have a role where a day like this is the work.
-
-## Jessica's IBM Community recap blog: skeleton
-
-_By Jessica Swanson. Header image: reuse [media/ibm-x-threews-lockup.png](./media/ibm-x-threews-lockup.png)
-or a real photo from the day if one is ready by publish time._
-
-1. **Opening**: one honest line on how the day actually went, in her voice, referencing her live
- post from earlier so the two connect as one continuous account rather than restating it.
-2. **The moment that landed best**: name the specific demo, conversation, or exchange that stood
- out, not a generic "great turnout" line.
-3. **What people missed if they skipped it**: said plainly, one or two sentences.
-4. **The personal thread, closed out**: the crypto-skeptic-to-genuinely-interested arc, and the
- fishing/cooking/cars/Broke Boi/bigB day, tied back to why an IBM user group met inside a game
- world instead of on a call.
-5. **What's next**: the world stays open at [three.ws/play](https://three.ws/play), the group stays
- open, and (if true by publish time) a date or plan for the next one.
-6. **Links**: same link block as her announcement post, plus a link back to this recap's
- companion post on three.ws/blog once that's live.
-
-Once posted, add it to the catalog in [ibm-community.md](./ibm-community.md) as the next blog
-entry, following the same fields (author, published date, activity, URL, summary) as the existing
-three entries, and update the "Discussion threads" section if the live-reaction post from
-[ibm-community-live-reaction-jessica.md](./ibm-community-live-reaction-jessica.md) was posted too.
-
-## three.ws/blog recap: skeleton
-
-The team's own writeup, not Jessica's voice. Follow the existing `three.ws/blog` structure and
-add the entry to `data/changelog.json` per the Changelog rule in `CLAUDE.md`, since this ships a
-link worth surfacing to $THREE holders. Cover: what the meetup was and why it happened inside
-`/play` rather than on a call, what the group demoed, and a link to Jessica's IBM Community recap
-so readers can see the partner side of the same day.
+# The First Three.ws User Group Meetup: How It Actually Went
+
+_By Jessica Swanson, posted as a follow-up blog in the [Three.ws User Group on IBM
+Community](https://community.ibm.com/community/user/usergroup?CommunityKey=e71510cc-d953-408f-9a1c-019f5c0a7016),
+closing out the arc that started with [Join the Three.ws User Group's First In-World Meetup This
+Friday](./ibm-community-blog-meetup-jessica.md) and continued mid-day with [LIVE at the Meetup: My
+Honest Take So Far](./ibm-community-live-reaction-jessica.md). Header image: reuse
+[media/ibm-x-threews-lockup.png](./media/ibm-x-threews-lockup.png), or swap in a real photo from
+the day once one is ready; do not paste this note into the published post._
+
+_[Fill in once picked: the strongest single moment from the day, named specifically, whether that's
+a demo, a build, or a conversation, and the final in-world headcount if you tracked it. Do not
+publish this post with those left generic.]_
+
+I wrote a live post in the middle of the meetup because I wanted the group to have my honest
+reaction while it was happening, not a cleaned-up version after the fact. Now that the day is over,
+here's the close of that arc.
+
+Going in, I already knew this was a unique situation. Three.ws is the only project I know of with
+its own dedicated user group here on IBM Community, and that group exists because the project had
+already been on our radar before it launched. Some of that is because our timelines crossed in
+public first: IBM's own account traded posts with three.ws on X that went a little viral (see
+[here](https://x.com/IBM/status/2061418285896269952) and
+[here](https://x.com/IBM/status/2061488909264040194)), and people inside IBM who have nothing to do
+with this group noticed. That's not the usual thing I get to say about a partner.
+
+What made the day itself work is the same thing I said mid-event: neither IBM nor three.ws is the
+slow, boring-enterprise thing people assume from the outside. We both like trying things that are
+actually new, and a nine-hour user-group meetup held entirely inside a 3D world, instead of on a
+call, is exactly that kind of thing. It held up. People stayed.
+
+## What the day actually looked like
+
+The agenda ran the way it was supposed to: a live tour of the platform from inside the world,
+community demos from people who brought what they'd built, and open Q&A with the three.ws team,
+including real questions about `@three-ws/ibm-watsonx-mcp` and `@three-ws/ibm-x402-mcp`, the two
+open-source connectors into watsonx.ai and Granite. [Name the standout demo or Q&A exchange here
+once known.]
+
+But the part I keep coming back to is everything that happened around the agenda, not in it. I
+spent a big chunk of the day with Broke Boi and bigB: we went fishing, cooked what we caught, and
+drove the cars around the map for no reason other than it was fun. No pitch deck, no slides, just
+people, in a place, doing things together. That's not a sentence I expected to write about a work
+event, and it's exactly why it's the one I'm leading with.
+
+## The part I don't usually put in a work post
+
+I was never really into crypto before this partnership. I'm not going to soften that for the sake
+of the group. Three.ws is what changed it for me, and it didn't happen through a pitch. It happened
+through spending real time in and around what they've built, today especially.
+
+I know how lucky I am to have a role where a day like this is the actual job. Not many people get to
+say "went fishing with Broke Boi and bigB" and mean it as a line item in their week.
+
+## What's next
+
+The world stays open at [three.ws/play](https://three.ws/play), and the group stays open too.
+[Add the date or plan for the next meetup here once one is set; if nothing is confirmed yet, say
+plainly that the team is deciding and members should watch this space rather than implying a date
+that doesn't exist.]
+
+If you were there today, thank you for making it a real room and not just an announcement people
+clicked past. If you missed it, the recording and the best clips [link once available] are the
+closest thing to having been there, and the world itself never closes.
+
+## Links
+
+- Platform: [three.ws](https://three.ws)
+- Free text-to-3D: [three.ws/create](https://three.ws/create)
+- The worlds: [three.ws/play](https://three.ws/play)
+- Docs: [three.ws/docs](https://three.ws/docs)
+- Blog: [three.ws/blog](https://three.ws/blog)
+- GitHub: [github.com/nirholas/three.ws](https://github.com/nirholas/three.ws)
+- X: [@trythreews](https://x.com/trythreews)
+- The team's own recap, from the other side of the day: [three.ws/blog/ibm-user-group-first-in-world-meetup-recap](https://three.ws/blog/ibm-user-group-first-in-world-meetup-recap)
+
+---
+
+## Rules for posting this
+
+- **Post from Jessica's own IBM Community profile**, as a new blog entry in the Three.ws User
+ Group, the same surface as her announcement post and her mid-day live reaction. This closes a
+ three-part arc; don't fold it into an edit of either earlier post.
+- **Fill both bracketed sections before publishing.** The standout-moment placeholder and the
+ next-meetup placeholder are the two claims in this draft that need a real answer, not a
+ confident-sounding guess. If there's no next date yet, say so plainly rather than implying one.
+- **Let Jessica edit freely.** This is a starting draft in her established voice, not a final
+ script; she should change anything that doesn't match how the day actually felt to her.
+- Confirm how Broke Boi and bigB actually go by on IBM Community today before posting, so any
+ mentions or tags resolve correctly.
+- Once posted, add it to the catalog in [ibm-community.md](./ibm-community.md) as the group's next
+ blog entry, following the same fields (author, published date, activity, URL, summary) as the
+ existing three entries, and cross-link it from the live-reaction catalog entry if that post was
+ published too.
diff --git a/docs/in-game-economy.md b/docs/in-game-economy.md
index 24cffe2fd..b996ccd55 100644
--- a/docs/in-game-economy.md
+++ b/docs/in-game-economy.md
@@ -126,6 +126,13 @@ character creator, which sells a different catalog through
[x402](x402.md) and is surfaced publicly at [/fits](https://three.ws/fits).
Two catalogs, two currencies, two rails. Do not confuse them.
+It is also not the only way to own a wardrobe item. A third tier exists that the
+boutique deliberately cannot see: **[event souvenirs](event-souvenirs.md)** are
+granted to everyone present in the world during a live event and are never sold,
+before, during, or after. They carry no price, so the boutique's listing filter
+(`tier === 'premium'` **and** `price > 0`) excludes them by construction, and the
+`$THREE` purchase ledger is filtered to premium ids so it cannot mint one.
+
---
## Fortune's Folly (the wheel)
@@ -234,6 +241,7 @@ every number in this system.
| Store and bank UI | [src/game/economy-ui.js](../src/game/economy-ui.js) |
| Vendor NPCs | [src/game/npc/economy-npcs.js](../src/game/npc/economy-npcs.js) |
| Boutique purchase flow | [src/game/boutique-purchase.js](../src/game/boutique-purchase.js) |
+| Event souvenir drop (granted, never sold) | [multiplayer/src/event-drop.js](../multiplayer/src/event-drop.js) |
| Public reference endpoint | [api/play/economy.js](../api/play/economy.js) |
---
diff --git a/docs/nav.json b/docs/nav.json
index 9af0ca1c1..3217f3dd7 100644
--- a/docs/nav.json
+++ b/docs/nav.json
@@ -133,6 +133,10 @@
"label": "Image to 3D",
"path": "image-to-3d"
},
+ {
+ "label": "Forge in world (spawn items into /play)",
+ "path": "play-forge-in-world"
+ },
{
"label": "Diorama (text to world)",
"path": "diorama"
diff --git a/docs/play-forge-in-world.md b/docs/play-forge-in-world.md
index d0e2fa6d2..ea79d0e2d 100644
--- a/docs/play-forge-in-world.md
+++ b/docs/play-forge-in-world.md
@@ -18,8 +18,8 @@ the world exactly like a block you placed by hand.
1. Enter a world and press `B` (or tap **Build**) to open build mode.
2. In the **Props** palette, click **Forge**.
3. Type what you want, for example `a mossy stone lantern with a copper roof`.
-4. Optionally click **Photo** and attach a PNG, JPEG, or WebP reference image (up to 8 MB).
- With a photo attached, the prompt becomes a hint rather than the whole brief.
+4. Optionally click **Photo** and attach a PNG, JPEG, or WebP reference image (up to
+ 8 MB). With a photo attached, the prompt becomes a hint rather than the whole brief.
5. Click **Forge**. The palette's status strip reports progress the whole way
(`Sending to the forge…`, then `Forging: waiting for a slot…`, then `Forging your model…`).
@@ -35,21 +35,21 @@ Type a slash command into the chat box:
/forge a brass telescope on a tripod
```
-Chat is the fastest path because you do not have to open the palette first. The command is
-answered locally and never broadcast to the other players, and when the model is ready
+Chat is the fastest path because you do not have to open the palette first. The command
+answers locally (it is never broadcast to the other players), and when the model is ready
build mode opens with the new prop armed and waiting for your click. A bare `/forge` with
no description replies with a usage hint instead of sending `/forge` to the room.
## What everyone else sees
-The moment you place a forged item it becomes a `WorldObject` in the room's authoritative
-state, and Colyseus broadcasts it to every other client in that server. Their client reads
+The moment you place a forged item, it becomes a `WorldObject` in the room's authoritative
+state and Colyseus broadcasts it to every other client in that server. Their client reads
the model URL off the object itself, so nobody needs your palette entry, a page reload, or
the same version of the app. The world's persistence layer saves it with the rest of the
build, so the item is still standing when the room is next created.
-That is the point of forging *inside* a server rather than on `/forge`: the thing you
-imagined is immediately part of a shared place, not a file in your downloads folder.
+That is the whole point of forging inside a server rather than on `/forge`: the thing you
+imagined is instantly part of a shared place, not a file in your downloads folder.
## Cost and limits
@@ -59,7 +59,7 @@ imagined is immediately part of a shared place, not a file in your downloads fol
| Typical time | 20 to 60 seconds. A cold GPU can add up to a minute and a half. |
| Concurrency | One forge at a time per player. A second request while one is running is refused with a toast. |
| World caps | Forged props count against the normal build budget: 200 objects per world, 30 per player. |
-| Rate limits | The free lane is rate-limited per client per hour. Hitting it reports that the forge is busy, and the request can be retried. |
+| Rate limits | The free lane is rate-limited per client per hour. Hitting it reports "The forge is busy right now" and the request can be retried. |
Forged models are recorded against the same anonymous client id `/forge` uses
(`localStorage['forge:cid']`), so anything you make in-world also appears in that browser's
@@ -81,7 +81,7 @@ palette form / "/forge" chat src/game/coincommunities-ui.js
-> state.objects broadcast every client in the server renders it
```
-Two details worth knowing if you are extending this.
+Two details worth knowing if you are extending this:
**The forge URL is already trusted.** Finished models are materialized into three.ws
storage on an `*.r2.dev` host, which is on the world asset allow-list
@@ -90,12 +90,11 @@ No server change was needed to let forged items in, and no arbitrary third-party
follow them: an off-list host is refused with `obj:reject` carrying `reason: 'asset_url'`.
**Nothing new is on the wire.** Forged props travel as ordinary world objects. The `url`
-field that already carries player uploads carries these too, so older clients, the
-persistence layer, ownership checks, and the per-player object cap all apply without
-modification.
+field that carries player uploads carries these too, so older clients, the persistence
+layer, ownership checks, and the per-player object cap all apply without modification.
## Related
-- [3D asset pipeline](3d-asset-pipeline.md) covers what the forge lanes are and how they differ
-- [In-game economy](in-game-economy.md) covers the rest of what you can do inside a `/play` world
-- [`/forge`](https://three.ws/forge) is the full studio, with paid tiers, rigging, and game-ready export
+- [3D asset pipeline](3d-asset-pipeline.md): what the forge lanes are and how they differ
+- [In-game economy](in-game-economy.md): the rest of what you can do inside a `/play` world
+- [/forge](https://three.ws/forge): the full studio, with paid tiers, rigging, and game-ready export
diff --git a/docs/start-here.md b/docs/start-here.md
index cbd452ba2..eba457270 100644
--- a/docs/start-here.md
+++ b/docs/start-here.md
@@ -77,6 +77,8 @@ Curious what happens between the prompt and the model? [How the Forge works](./h
- **Want to drive your agent's computer yourself?** → [Take the wheel](./agent-screen-control.md), every agent has a live screen you can watch on [/agent-screen](https://three.ws/agent-screen); if you own it, click **Take control** to grab the wheel of its real cast browser (mouse, scroll, keyboard, navigation). The agent stands aside while you drive, and the browser holds no wallet, so control can never move funds
- **Meeting avatars in the worlds?** → Press <kbd>I</kbd> on anyone in `/play`, `/city`, a coin world, or `/agora` to see who they are — the [avatar inspector](./avatar-inspector.md) shows their reputation, wallet, and profile
- **Running a live event in the world?** → [Live events in `/play`](./play-live-events.md): one config file turns the `$THREE` home town into a place something is happening in: a countdown chip, an agenda drawer that knows what is on right now and what is next, a gold banner at every segment change, and a fireworks show every client renders identically from the wall clock without a single packet. Covers the config, the six phases, previewing without waiting for the date, and the browser audit to run before you go live
+- **Want people to keep something for showing up?** -> [Event souvenirs](./event-souvenirs.md): everyone who walks into the event world while an event is live is handed a free commemorative wearable, kept forever, and once the window closes it is never granted again. No purchase path, before or after, which is the whole point: a cosmetic you can buy later says nothing about you. Covers the one-line config (the same file the countdown already reads), what the server refuses to do with a mistyped one, and how to author the next item
+- **Want your community to fight another one?** -> [Coin Wars](./coin-wars.md): every coin world's plaza has a war portal showing that community's live Elo standing, its last battles, and any war running right now. Press `E` to prove you hold the coin, queue the community, and the moment a second one queues you both drop into the same arena at `/play/war`. Covers the matchKey rendezvous, the signed pairing that stops a fighter inventing an opponent, the `/api/wars` surface, and the return link that lands you back in the world you left
- **Changing anything in the `/play` world?** → [How `/play` stays safe, honest, and light](./play-hardening.md): the invariants that keep the largest interactive surface on the platform from breaking. Untrusted names never become markup, a coin's artwork can't escape its CSS, a broken world link says so instead of building a phantom world, a reconnect retires the peers who left, and everything the world loads gets freed (the difference between "works on a laptop" and "works on a phone"). Each rule names the failure it prevents, because each one shipped once
- **Following creators?** → [The social layer](./social-layer.md): follow anyone from their `/u/:username` portfolio, watch their work land on [/feed](/feed), climb the [/rankings](/rankings) leaderboards with streaks and badges, get bell notifications for remixes, DMs, and coin graduations, and search everything at once on [/search](/search)
- **Placing agents in the real world?** → [IRL](./irl.md): pin an agent at a real GPS spot from your phone, and anyone who physically walks up can see it, talk to it, and pay it. Real crypto can be escrowed at places ([Money Drops](./irl.md#money-drops)) and agents sign proofs that you were really there ([World Lines](./irl.md#world-lines))
diff --git a/scripts/audit-play-failure-modes.mjs b/scripts/audit-play-failure-modes.mjs
index 4ace480a5..4b24b7e2e 100644
--- a/scripts/audit-play-failure-modes.mjs
+++ b/scripts/audit-play-failure-modes.mjs
@@ -309,6 +309,11 @@ async function warmup(base) {
async function runScenario(base, sc) {
const browser = await chromium.launch({ headless: !process.env.HEADFUL });
const context = await browser.newContext({ viewport: { width: 1440, height: 900 } });
+ // Close the process, not just the context. Every exit path goes through this.
+ const teardown = async () => {
+ await context.close().catch(() => {});
+ await browser.close().catch(() => {});
+ };
const consoleIssues = [];
const pageErrors = [];
@@ -343,9 +348,7 @@ async function runScenario(base, sc) {
await page.goto(base + sc.url, { waitUntil: 'domcontentloaded', timeout: 60_000 });
} catch (err) {
findings.push(`navigation failed: ${err.message}`);
- await context.close();
- await browser.close();
- await browser.close();
+ await teardown();
return { findings, consoleIssues, pageErrors };
}
@@ -413,7 +416,7 @@ async function runScenario(base, sc) {
if (sc.expect) { const extra = sc.expect(o); if (extra) findings.push(extra); }
- await context.close();
+ await teardown();
return { findings, consoleIssues, pageErrors, o };
}
diff --git a/scripts/play-souvenir-e2e.mjs b/scripts/play-souvenir-e2e.mjs
index 4d5e4ae88..147432b8f 100644
--- a/scripts/play-souvenir-e2e.mjs
+++ b/scripts/play-souvenir-e2e.mjs
@@ -183,7 +183,22 @@ async function openPlayer(browser, tag, storageState) {
clearInterval(tick);
}, 200);
}, GAME_SERVER);
- await page.goto(WORLD, { waitUntil: 'domcontentloaded', timeout: LOAD_MS });
+ // A /play page is a WebGL scene under software rasterisation, and this repo is
+ // worked on by several agents at once: a neighbouring test suite can take the
+ // box to zero free memory and Chromium answers with "Page crashed" rather than
+ // a load error. Retry rather than reporting a machine-state failure as a
+ // feature failure.
+ let loaded = false;
+ for (let attempt = 1; attempt <= 3 && !loaded; attempt++) {
+ try {
+ await page.goto(WORLD, { waitUntil: 'domcontentloaded', timeout: LOAD_MS });
+ loaded = true;
+ } catch (err) {
+ console.log(`${at()} [${tag}] load attempt ${attempt} failed: ${String(err.message).split('\n')[0]}`);
+ if (attempt === 3) throw err;
+ await new Promise((r) => setTimeout(r, 10_000));
+ }
+ }
await dismissOverlays(page);
const joined = await until(page, () => {
const net = window.__CC__?.net;
@@ -218,14 +233,29 @@ async function main() {
// three.ws, which is what lets the run open and close the window at will.
start('colyseus', 'node', ['src/index.js'], {
cwd: resolve(ROOT, 'multiplayer'),
- env: { PORT: String(MP_PORT), EVENT_CONFIG_URL: `http://127.0.0.1:${CONFIG_PORT}/event.json` },
+ env: {
+ PORT: String(MP_PORT),
+ EVENT_CONFIG_URL: `http://127.0.0.1:${CONFIG_PORT}/event.json`,
+ // Re-read the window quickly so the closed-window phase does not cost
+ // two minutes of wall clock.
+ EVENT_CONFIG_TTL_MS: String(process.env.EVENT_CONFIG_TTL_MS || 10_000),
+ },
});
if (!await waitFor(`http://127.0.0.1:${MP_PORT}/health`, 90_000)) throw new Error('colyseus never came up');
if (!await waitFor(BASE, 120_000)) throw new Error('vite never came up');
console.log(`${at()} servers up: vite :${VITE_PORT}, colyseus :${MP_PORT}`);
}
- const browser = await chromium.launch();
+ // Memory-frugal flags: /dev/shm in this container is far smaller than
+ // Chromium assumes, and a shared box means the renderer must not be greedy.
+ const browser = await chromium.launch({
+ args: [
+ '--disable-dev-shm-usage',
+ '--disable-extensions',
+ '--disable-background-timer-throttling',
+ '--js-flags=--max-old-space-size=768',
+ ],
+ });
const players = [];
try {
// ── Phase 1: window LIVE ───────────────────────────────────────────────
@@ -312,10 +342,12 @@ async function main() {
// ── Phase 3: window CLOSED ─────────────────────────────────────────────
windowState = 'ended';
- console.log(`${at()} event window flipped to ENDED; waiting out the server's config TTL`);
- // The reader caches for 120s; wait past it so the next join reads the
- // closed window rather than the cached live one.
- await new Promise((r) => setTimeout(r, 125_000));
+ // The server was started with a short EVENT_CONFIG_TTL_MS, so waiting a
+ // little past it is enough for the next join to read the closed window
+ // rather than the cached live one.
+ const ttlWait = Number(process.env.EVENT_CONFIG_TTL_MS || 10_000) + 5_000;
+ console.log(`${at()} event window flipped to ENDED; waiting ${Math.round(ttlWait / 1000)}s for the server's config TTL`);
+ await new Promise((r) => setTimeout(r, ttlWait));
const carol = await openPlayer(browser, 'carol-after');
players.push(carol);
diff --git a/scripts/verify-event-countdown.mjs b/scripts/verify-event-countdown.mjs
index 4b97b433c..e7bede6e9 100644
--- a/scripts/verify-event-countdown.mjs
+++ b/scripts/verify-event-countdown.mjs
@@ -61,6 +61,14 @@ function cfg({ startsIn, endsIn }) {
const IGNORE = [/favicon/i, /Failed to load resource/i, /net::ERR_/i, /WebGL/i, /THREE\./i, /\[vite\]/i, /websocket/i];
const ownErrors = (errs) => errs.filter((e) => !IGNORE.some((re) => re.test(e)));
+// A first visit to /play opens the welcome dialog (src/game/play-intro.js): modal,
+// focus-trapped, and sitting over the lobby, so it swallows the pointer events the
+// hover checks below depend on. It shows once per browser off `cc-lobby-intro-v1`,
+// and it mounts later than the countdown banner does, so racing it with a click is
+// unreliable. Arrive as a returning player instead, which is the state the event
+// surfaces are actually judged in.
+const INTRO_SEEN = 'cc-lobby-intro-v1';
+
const browser = await chromium.launch({
args: ['--use-gl=swiftshader', '--enable-unsafe-swiftshader'],
});
@@ -72,6 +80,9 @@ async function newPage({ body, viewport, reducedMotion, storage }) {
storageState: storage,
});
const page = await ctx.newPage();
+ await page.addInitScript((k) => {
+ try { localStorage.setItem(k, '1'); } catch { /* private mode: the dialog just re-opens */ }
+ }, INTRO_SEEN);
const errors = [];
page.on('console', (m) => { if (m.type() === 'error') errors.push(m.text()); });
page.on('pageerror', (e) => errors.push('pageerror: ' + e.message));
@@ -128,16 +139,6 @@ const waitForPill = (page) => page.waitForFunction(() => {
const cssAnim = (loc) => loc.evaluate((n) => getComputedStyle(n).animationName);
-// A first visit to /play opens the intro dialog (src/game/play-intro.js), which
-// is modal and sits over the lobby. Skip it the way a player does, so the checks
-// below exercise the lobby a returning player actually sees.
-async function dismissIntro(page) {
- const close = page.locator('#pi-overlay .pi-close');
- if (!(await close.count())) return;
- await close.click({ timeout: 10000 }).catch(() => {});
- await page.waitForSelector('#pi-overlay', { state: 'detached', timeout: 10000 }).catch(() => {});
-}
-
// /play renders a full 3D world on a software rasterizer here, which can starve
// a 1s interval for several seconds at a time. Sampling twice with a fixed sleep
// reports that jank as a stopped clock, so wait for the value to actually move.
@@ -172,7 +173,6 @@ console.log('\n/play lobby banner, upcoming');
await ticks(page, '.cc-event-banner .cc-event-seg:last-child b', 'clock ticks');
- await dismissIntro(page);
const cta = b.locator('.cc-event-cta');
check('CTA points into the $THREE world', (await cta.getAttribute('href')).includes(COIN));
const rest = await cta.evaluate((n) => getComputedStyle(n).boxShadow);
@@ -248,7 +248,6 @@ console.log('\n/play in-world pill');
await ticks(page, '.cc-event-pill [role="timer"]', 'pill clock ticks');
check('CTA absent while standing in the event world',
(await page.locator('.cc-event-pill a').count()) === 0);
- await dismissIntro(page);
const x = page.locator('.cc-event-pill-x');
const xRest = await x.evaluate((n) => getComputedStyle(n).backgroundColor);
@@ -285,7 +284,6 @@ console.log('\n/play at 375px');
});
await go(page, EVENT_LINK);
await waitFor(page, '.cc-event-banner');
- await dismissIntro(page);
const doc = await page.evaluate(() => ({
scrollW: document.documentElement.scrollWidth,
clientW: document.documentElement.clientWidth,