[night-lead] docs/night/REPORT.md: Night 1 report #50

Open
claude wants to merge 3 commits from night/lead/report into night/2026-11-16
+75
View File
@@ -0,0 +1,75 @@
# WikiDeck Night 1: report
**Night:** 2026-11-16 22:45 → 2026-11-17 01:30 EST. 17 Claude agents on 4 machines, coordinated through Gitea (milestone 63, issues #1–#10).
**Branch:** `claude/wikideck:night/2026-11-16`. Everything below came in through 38 PRs that night-review reviewed and night-lead squash-merged.
**Untouched:** the live deployment, mainnet, and every consensus and protocol file. The off-limits list is in `docs/night/BOUNDARIES.md`.
## What works
| Area | Status | Where |
|---|---|---|
| **The game, "Edit War"** | Playable in the browser against an AI: a lobby, a deck builder with 4 loaner starter decks, matches, results and a tutorial. Works on a 360 px phone. | `src/game/`, PR #26 #30 (landing page, upstream WikiDeck/wikideck#3), #31 (easy and normal browser bots), #45 |
| **Rules engine** | Pure, deterministic TypeScript with the rules as data. `createMatch`, `legalActions`, `applyAction`, `viewFor` and serialisation. 6 keywords and 6 Portals. Property tests, plus a §12 golden match checked by hand. | `shared/game/`, `docs/game/ENGINE_API.md`, #25 #27 #29 #33 #36 (v1.1 as the default), #38 (planning is hidden) |
| **Design** | DESIGN.md v1 (frozen 23:01), then v1.1 tuned from the balance report. | `docs/game/DESIGN.md`, #13 #17 #23 #24 #32 |
| **Card data** | 236 sampled articles, with real distributions, percentile tables and 48 starter pageIds. | `docs/game/CARD_DATA.md`, `card-sample.json`, #20 #28 |
| **Balance** | Bots (random, greedy, lookahead) played thousands of matches per ruleset. On v1 the starter pairings ranged 23–77%, and the first player won 53.4%. The v1.1 re-run measured the first player at **51.2%**, starter decks at **52–53%** and owned decks at **42–51%** against starters, so owning NFTs adds variety, not power. | `docs/game/BALANCE.md`, `shared/bots/` #14 |
| **eom.dev accounts** | Dex OIDC with PKCE: login and logout, and ID tokens verified against the JWKS. Wallet linking signs a message the **client builds**, never text from the server. The account ↔ wallet map is stored off-chain. | `server/account/`, `src/auth/`, #15 #37 #42 |
| **Peer-hosted modes** | Modes are JSON data, never code. A node publishes them at `GET /api/game/modes`, peers are discovered through config, and the hosting node runs the match. It shows "Hosted by", with per-mode and host leaderboards. 3 example modes: classic, snake draft and trending. Lobbies survive restarts. | `shared/game/modes.ts`, `server/game/`, `docs/game/HOSTING.md`, #22 #43 |
| **Private testnet** | 3 nodes on poweredge-r350, LAN only, at height 50. Auto-redeploy followed this branch until the freeze, with rolling restarts that wait for live matches to finish. | `deploy/night/`, #16 #19 #39 #40 |
| **Android app** | Capacitor 7 (`dev.eom.wikideck`). A debug APK runs a full match against the AI in the emulator. CapacitorHttp gets past the node's Origin check with no server change. The SSO deep link round trip works up to Dex. | `android/`, `docs/night/ANDROID.md`, #35 #41 #44 |
| **iOS app** | Capacitor 7 iOS project (SPM) and a simulator build script. The macOS Sequoia VM's install was still running at the end of the night. No Apple ID was used. | `ios/`, `docs/night/IOS.md`, #34 #52 |
## How to try it
- **Browser:** http://192.168.1.32:3101, :3102 or :3103 (LAN only). Open **Play**, dismiss the tutorial, pick a starter deck and play the AI. The three nodes host different modes: A has classic and trending, B has draft, and C has all three.
- **Android:** the APK is at `inspiron-3670:~/worker/jobs/night/mobile-android/apk/wikideck-night1-debug.apk` (debug-signed, testnet build). To rebuild it: `android/build-debug.sh`. Screenshots:
![Android emulator, match vs AI](android/screens.jpg)
- **iOS:** follow Eric's checklist in `docs/night/IOS.md`:
1. resume the VM on inspiron and finish the macOS install
2. sign in with your Apple ID
3. install Xcode
4. run `scripts/ios/build-sim.sh`
No Apple ID was used tonight. The VM got as far as the Sequoia installer downloading the full OS. Per the coordinator, the VM is shut down cleanly before 01:30 with its disk kept. `docs/night/IOS.md` (#52) records the install progress at shutdown, the resume steps and Eric's checklist.
- **Login:** "Log in with eom.dev" uses Dex at `https://dex.eom.dev/`, through the `wikideck` public client that the coordinator applied. You need a membership account that's in `Dex Users`; the SSO issue #7 covers the sign-up path.
## QA (night-review, live testnet)
- **API:** full hosted matches in all 3 modes (classic @A, snake draft @B, trending @C) with two scripted players. Records and leaderboards are correct. Rejected as they should be: forged card, cross-seat token, random token, client `timeout`, foreign Origin, self-join, out-of-turn pick.
- **Browser:** Playwright played 3 full matches against the AI through the real Play UI (360×740 @A ×2, 1280×800 @B). Every one reached results, with no overflow, stuck turns or page errors.
- **Engine fuzz:** 300 random matches per engine branch. 0 `viewFor` leaks (information-flow test), and every replay was deterministic.
- **UX bug found and fixed:** the results card showed tied Topics ("13–13 Lost") with no tie-break explanation. Fixed after the freeze in #51.
## Known issues and gaps
1. **The game ships rules v1.1** (`DEFAULT_RULESET = RULESET_V1_1`, #36), which matches DESIGN.md v1.1. The v1.1 numbers in BALANCE.md (first player 51.2%, starter decks 52–53%, owned decks 42–51%) were measured **before** #38 hid the opponent's queue, so the seat figure needs a re-run. Item 6 (`nostalgic` and `translated` at −1 power) is a v1.2 candidate and isn't in v1.1.
2. **Hosted PvP trusts the host.** The seed is chosen by the host, and DESIGN §4.4's commit–reveal isn't implemented. A malicious host can see both hands. That's documented in HOSTING.md.
3. **Hidden information.** #38 hides the opponent's queue during planning (with a test). The UI and the bots consume only `viewFor` output, and the log never names an opponent's hidden card. Remaining: `obscure` (item 4) and host trust (item 2).
4. **The `obscure` keyword isn't masked in `viewFor`.** Modes reject it, so it can't be turned on.
5. **Game traffic shares the chain's per-node RPC budget,** so one hot client can get everyone 503s (#6).
6. **Wikipedia rate limits:** our egress IP got HTTP 429s on the action API. #19 adds an optional `WIKIDECK_USER_AGENT` with a contact URL, and only the testnet sets it. **The live deployment probably shares that IP and the old generic UA.** Whether to set it in production is Eric's decision.
7. **Mobile polish:**
- the dashed lane drop zone doesn't take taps, only the lane plate does
- the home hero still says "Explore mining" inside the app
- the real SSO login hasn't been done on a device yet
- **Apple licences:** an agent clicked through the **macOS installer licence** in the VM, under Eric's VM approval on #9. Review that if you want to accept it yourself.
- `scripts/ios/build-sim.sh` still runs `sudo xcodebuild -license accept`, which would accept Apple's Xcode licence on Eric's behalf. **Eric should accept it himself** (remove the line first).
- Android allows cleartext HTTP to **any** host (`usesCleartextTraffic="true"`). Before any non-LAN use, restrict it with a `network_security_config` to the testnet host.
8. **Factions are skewed:** owned cards are about 53% Culture and 0% Space, so `viral` and `local` dominate. Factions built on Wikidata P31 are the v1.1+ fix (CARD_DATA findings 6 and 7).
9. **Tooling:** the repo needs **Node 24** (`node:sqlite`). On Node 20, 12 tests fail falsely. Every gate tonight ran in `node:24-alpine`.
**Held for Eric:** #49 (the normal bot uses sim-balance's lookahead). It's approved, but it's a behaviour change that arrived after the freeze.
## Next steps (in priority order)
1. **Re-run balance on the final head** (after #38) and decide v1.2 item 6. The harness is `scripts/sim/` and `shared/bots/`, and it needs about 1 GB on r350, run under the heavy lock.
2. **Hidden information everywhere:** mask `obscure`, and implement the §4.4 commit–reveal seed for hosted PvP.
3. **Separate rate limits for game traffic** on the node, so they don't share the chain's RPC budget.
4. **Finish iOS:** Xcode and a simulator run, then the same match against the AI as on Android.
5. **SSO end to end** on a device with a real eom.dev account, then show account names on the leaderboards.
6. **Factions from Wikidata P31**, then re-run the balance sims (item 6 on the BALANCE list is still open).
7. **Host incentives on-chain:** the proposal in HOSTING.md. It's a protocol change, so it needs its own review.
8. **Production user agent:** decide whether the live node should set `WIKIDECK_USER_AGENT`.
## Process notes
- Every agent shared the `claude` Gitea account, so night-review approved with COMMENT reviews that start with `VERDICT: APPROVED`, naming the head SHA and the gate result.
- **imac's Gitea MCP was down** all night. The council read issues anonymously and reported through PR bodies, and night-lead relayed.
- **tower-plus ran out of memory** at about 23:25, and **r350 twice**. From then on, every heavy check ran on inspiron in `node:24-alpine` under `flock /tmp/night-heavy.lock`.
- Squash merges dropped the history that stacked PRs shared, which caused add/add conflicts (#27, #22, #26). Each was resolved mechanically, with no content changes.