From 83ae18a17f06e85744f86c807bc35f281f344bfa Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 06:04:05 +0000 Subject: [PATCH] Night 1: docs/night/REPORT.md Co-Authored-By: Claude Opus 5.5 --- docs/night/REPORT.md | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 docs/night/REPORT.md diff --git a/docs/night/REPORT.md b/docs/night/REPORT.md new file mode 100644 index 0000000..7d8ca4d --- /dev/null +++ b/docs/night/REPORT.md @@ -0,0 +1,64 @@ +# 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 35 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 follows this branch, 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 (final shutdown notes in IOS.md) | + +## 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, mobile-ios shuts it down cleanly before 01:30 with its disk kept; confirmation is on #9. `docs/night/IOS.md` has 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. + +## 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. **`viewFor` and hidden information:** #38 fixed the opponent's queued-card count leaking during planning, with a test. The local UI's match log is built from the full state, so "Opponent: X fizzled" names a card from the opponent's hand. That's harmless against the local AI, but it has to change before hosted PvP uses the same view. +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 +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`. + +## 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:** build the UI log from `viewFor`, 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.