Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 0 additions & 282 deletions GOLF.md

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ The nav's **Elsewhere** menu links to apps hosted off muchq.com (see the
list). Those are external links, not routes — their code lives in their own
repos, not here.

### Golf v1/v2
### Golf

Golf speaks two wires. The default v1 protocol is documented in [GOLF.md](GOLF.md); the v2
event-stream hub is a per-browser beta — opt in with `?golf=v2` (sticky via localStorage),
back out with `?golf=v1`, or default a build in with `VITE_GOLF_V2_DEFAULT=true`. Room chat
is v2-only, and the UI reveals it only once the server actually delivers chat on the wire.
Golf speaks the golf_hub event-stream wire (`/games/v2/*` on api.muchq.com; the model and
the protocol are documented with the service in MoonBase, `domains/games/apis/golf_hub`).
`VITE_GOLF_WEBSOCKET_URL` overrides the play socket at build time; the session mint is
derived from it. The UI reveals room chat only once the server actually delivers chat on
the wire.

## 🏗️ Project Structure

Expand All @@ -84,6 +85,5 @@ Routes are declared in `src/App.tsx`.

## 📄 Documentation

- [GOLF.md](GOLF.md) — Golf multiplayer WebSocket API (v1)
- [THOUGHTS.md](THOUGHTS.md) — Thoughts multiplayer WebSocket API
- [WORKING_AGREEMENT.md](WORKING_AGREEMENT.md) — How work gets picked up, built, reviewed, and shipped
21 changes: 11 additions & 10 deletions WORKING_AGREEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ down so a future session starts where the last one left off instead of
rediscovering the same conventions.

This is process, not architecture. Architecture lives in
[README.md](README.md) and the wire-contract docs at the repo root
([GOLF.md](GOLF.md), [THOUGHTS.md](THOUGHTS.md)).
[README.md](README.md) and the wire-contract docs: [THOUGHTS.md](THOUGHTS.md)
at the repo root, and the golf_hub model in MoonBase for golf.

Adapted from the MoonBase working agreement
([`MoonBase/docs/WORKING_AGREEMENT.md`](https://github.com/muchq/MoonBase/blob/main/docs/WORKING_AGREEMENT.md)),
Expand Down Expand Up @@ -154,10 +154,10 @@ observable behavior worth keeping gets a test, at every level that fits:
- **component** — the behavior through the real component or hook with
Testing Library under jsdom (`src/test/setup.ts` carries the shared shims);
- **the consumer's boundary** — this repo is itself a consumer: the golf and
thoughts backends live in MoonBase, and [GOLF.md](GOLF.md) /
[THOUGHTS.md](THOUGHTS.md) are the contracts. Prove wire behavior by
feeding raw JSON messages to the real adapter (as
`src/utils/__tests__/golfV2Adapter.test.ts` does), not through helpers
thoughts backends live in MoonBase, and their models (golf_hub's smithy
model, [THOUGHTS.md](THOUGHTS.md)) are the contracts. Prove wire
behavior by feeding raw JSON messages to the real adapter (as
`src/utils/__tests__/networkAdapter.test.ts` does), not through helpers
that mirror the adapter's own assumptions back at it.

An untested observable behavior is not a guarantee; it is a coincidence that
Expand Down Expand Up @@ -217,12 +217,13 @@ preview. Chromium and Playwright are available in the sandbox.
## Docs

- Update docs in the same PR as the code: [README.md](README.md) and the
wire-contract docs ([GOLF.md](GOLF.md), [THOUGHTS.md](THOUGHTS.md)).
wire-contract docs ([THOUGHTS.md](THOUGHTS.md) here, the golf_hub smithy
model in MoonBase).
- **When behavior changes, fix the doc that describes it in the same commit.**
A doc left contradicting the code is a defect in its own right.
- GOLF.md and THOUGHTS.md describe contracts the MoonBase server speaks; when
either side of the wire changes, the doc moves with it — or says explicitly
which side is ahead.
- THOUGHTS.md and the golf_hub model describe contracts the MoonBase server
speaks; when either side of the wire changes, the doc moves with it — or
says explicitly which side is ahead.
- Keep the claims accurate. Don't write that something is covered
"everywhere" when a subtree is deliberately excluded; name the exclusion.
- There are no ADRs and no CHANGELOG. The nearest equivalents are the docs
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:ui": "vitest --ui",
"typecheck": "tsc --noEmit",
"test:run": "vitest run",
"local-server": "cross-env VITE_THOUGHTS_WEBSOCKET_URL=ws://localhost:2015/games/v1/thoughts-ws VITE_GOLF_WEBSOCKET_URL=ws://localhost:2015/games/v1/golf-ws VITE_THOUGHTS_SIMULATED=false VITE_METRICS_API_URL=http://localhost:2015/metrics/v1 VITE_MITHRIL_API_URL=http://localhost:2015/mithril/v1/wordchain VITE_TRACY_API_URL=http://localhost:2015/portrait/v1/trace VITE_POSTERIZE_API_URL=http://localhost:2015/imagine/v1 VITE_R3DR_API_URL=http://localhost:2015/r3dr/v2 vite",
"local-server": "cross-env VITE_THOUGHTS_WEBSOCKET_URL=ws://localhost:2015/games/v1/thoughts-ws VITE_GOLF_WEBSOCKET_URL=ws://localhost:2015/games/v2/golf/play VITE_THOUGHTS_SIMULATED=false VITE_METRICS_API_URL=http://localhost:2015/metrics/v1 VITE_MITHRIL_API_URL=http://localhost:2015/mithril/v1/wordchain VITE_TRACY_API_URL=http://localhost:2015/portrait/v1/trace VITE_POSTERIZE_API_URL=http://localhost:2015/imagine/v1 VITE_R3DR_API_URL=http://localhost:2015/r3dr/v2 vite",
"deploy": "wrangler deploy"
},
"dependencies": {
Expand Down
17 changes: 0 additions & 17 deletions src/apps/golf/components/GolfGame.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -1471,23 +1471,6 @@
transform: translateY(-2px);
}

.betaToggle {
margin-top: 1rem;
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
color: rgba(255, 255, 255, 0.6);
font-size: 0.85rem;
font-family: 'Lexend', sans-serif;
cursor: pointer;
user-select: none;
}

.betaToggle input {
accent-color: #4ade80;
}

.rulesModal {
position: fixed;
top: 0;
Expand Down
Loading
Loading