Night 2 (2026-11-17), from the `claude/wikideck` fork's `night/2026-11-17` branch. It follows Night 1 (#22).
## What's in it
- **Duel engine** (fork #72, #80): 40-card decks of cards you own, Notability/Citations, keywords, effects T1–T12, Connected, a hidden-information-safe `viewFor`/`logFor`, and replay. Balance v1 tuning (#84) gives the first player about 51%.
- **Card profiles** (#70, #82): Figure, Location, Event, Institution or Doctrine, plus stats, keywords and rules text, all derived from real article data. Templates only.
- **Design and story** (#66, #69, #83): DUEL_DESIGN.md, plus the match log and the encyclopedic "Battle of X (2026)" recap.
- **PvP** (#74, #77, #81, #76, #85):
- The server checks ownership, and 40-card eligibility is enforced.
- Modes: Classic (ranked), Draft and Trending.
- Invites, quick match, Elo, a ladder and recap pages. Online matches render on the duel board.
- **Duel board UI** (#79): MTG-style card faces and combat declaration, built for 360 px first.
- **Polite Wikimedia client** (#73, #75): throttled, cached and identified requests, the mint-path fix, and a prefetch pool.
- **Android mining** (#78): native RandomX, as a sideload build. The emulator mined a testnet block.
- **Testnet ops** (#67, #68).
PR numbers refer to `claude/wikideck`.
## Status
- **Tests:** 423, of which 422 pass, 0 fail and 1 is skipped. The build is OK (`node:24-alpine`, `--network none`).
- **Testnet:** running this commit (036489c) on r350.
- **Untouched:** no changes to `server/testnet/consensus.ts`, `randomx.ts`, `native/` or the mainnet compose.
- **Review:** night-review reviewed fork #66–#79. #80–#85 came from the agents' unfinished branches and were not reviewed.
- **Known gaps:**
- The PvP end-to-end test hasn't been run (it needs two eom.dev accounts).
- Bot matches aren't reachable from Play.
- Card identity pre-bake hasn't been done.
- The RandomX verifier latch (`server/testnet/randomx.ts:140`) is still open.
This PR is for Eric to merge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)Reviewed-on: #23
Co-authored-by: Claude <claude@eom.dev>
8.7 KiB
WikiDeck Night 2: proposed game redesign (for review)
Status: draft, under review. Written by the coordinator on 2026-11-17 from Eric's feedback on Night 1's game, Edit War. Night 2 runs unattended on 2026-11-17 from 21:30 to 02:00 EST.
Eric's feedback on Edit War (the requirements)
- Real cards: a player's deck is made of the cards they actually mined and own. Loaners existed for the demo; the real game uses real cards.
- PvP: players must be able to play each other, not only the AI. Hosted lobbies exist (
src/game/OnlinePlay.tsx,server/game/host.ts) but are buried. - Story: Edit War "doesn't really tell much of a story with the actual cards".
- Feel: Magic: The Gathering is the model for how it should feel.
- Modes: keep the different modes (classic, draft, trending); Eric likes them.
- Tone: "The fact that I can use a Tetrated Dodecahedron in a game with Barack Obama is funny. Lean into this. The game should take itself seriously, but the end result is going to be entertaining for this reason." (Eric's original v2 post also mentions using his Tetrated dodecahedron card to buff his Cho Yang-ho card, and node operators running house rules.)
- Wikipedia limits: our servers must respect Wikimedia rate limits by default instead of getting cut off. Night 1 hit HTTP 429 from our shared IP.
- iOS: paused (Apple licence acceptance). Out of scope.
Hard constraints
- Consensus is fixed:
- No changes to the chain, block format, mint stats snapshot or consensus files (see
docs/night/BOUNDARIES.md). - Everything game-related is derived off-chain from what a card already holds.
- No changes to the chain, block format, mint stats snapshot or consensus files (see
- Where work happens: in the
claude/wikideckfork, through reviewed PRs. Eric merges upstream. - No live deployment: don't touch mainnet or the live node at wikideck.eom.dev.
- Budget: 4.5 hours, about 10 agents across 4 machines (tower-plus, imac, inspiron-3670, poweredge-r350). Night 1 used 17 agents for 2.75 h and about 10% of the weekly usage budget; 75% remains.
Facts the design must face
- Card data: what a card holds is shown in
shared/enrichment.ts(PageEnrichment / MintStatsSnapshot) andshared/testnet.ts(BlockHeader).- Article: pageId, title, extract, image, category, revisionId.
- Mint snapshot: pageBytes, languageCount, 6 months of pageviews with trendPercent and dailyAverage, and the attention, depth and reach scores.
- Night 1 also used: the Wikidata id, P31 "instance of", and live pageviews, all fetched off-chain.
- Real distributions are in
docs/game/CARD_DATA.md: compressed scores, a skewed category split, and a reach of 0 for 18% of cards.
- SUPPLY:
- One card is minted per block, with a consensus target of one block per 15 minutes: at most about 96 new cards a day, network-wide.
- Mainnet today has 12 cards in total, all owned by one wallet, all mined on 2026-11-01.
- A "deck of your own mined cards" in the Magic sense (40–60 cards) is impossible for anyone for a long time.
- This is the biggest viability question; see Open problem 1.
- Cards are unique NFTs: each card is one specific mint, and the same article can be minted more than once (
pageIdrepeats). - Night 1 code to reuse:
- the deterministic rules engine and its rules-as-data style (
shared/game/) - the bots and the balance simulator (
shared/bots/,scripts/sim/) - hosted lobbies and modes (
server/game/) - Dex accounts (
server/account/) - the Android shell (
android/)
- the deterministic rules engine and its rules-as-data style (
Proposed design
A. Card identity from the article (MTG-style types)
The card type comes from Wikidata P31, with a fallback to Wikipedia categories:
| Article is a… | Card type | MTG analogue |
|---|---|---|
| person, character, animal species | Figure | creature |
| place, region, celestial body, structure | Location | land (resource) and/or permanent |
| event, battle, election, disaster | Event | instant/sorcery |
| creative work, organisation, company, team, product | Institution | artifact |
| concept, theory, mathematical object, ideology, field | Doctrine | enchantment |
Factions (colours): the 6 P31-based factions proposed in CARD_DATA.md, plus a neutral fallback.
Stats from data:
- Power and toughness come from percentile attention, depth and reach. For example, attention drives power, and depth drives toughness and staying power.
- Cost follows the curve: high-stat cards cost more.
Rules text:
- Generated deterministically from a fixed table of templates keyed on type, faction, category keywords, trend, language count, dates (birth/death, founding, event date), coordinates, and so on.
- It is written in MTG's terse register.
- Flavour text: the first sentence of the article's extract.
B. Story mechanics
- Connected: two cards whose articles link to each other, or share a Wikidata property such as country, field or era, gain a bonus together. Barack Obama with the White House; Tetrated dodecahedron with Polyhedron.
- Citations: a resource or counter flavoured as sources.
- Edit wars and vandalism: removal and interaction effects.
- Deadpan tone: the game is completely straight, like an encyclopedia or an MTG judge. The comedy comes from the matchups, never from jokes in the text.
- Match log: written as a dry encyclopedic account.
- After each match: a Wikipedia-style article, "Battle of the Tetrated Dodecahedron (2026)". It has:
- an infobox: date, belligerents, commanders (the players), strength (the cards), result
- a short deterministic narrative built from the match log
- a "References" list citing every card's real article
- These recaps are shareable.
C. Game structure
- Duel: two players, a life total, turns with attack and block, and permanents on a battlefield.
- Resources: from Locations and/or a fixed per-turn income, designed to avoid MTG's "land screw" (no resource cards, no game).
- Deck size and composition: depends on Open problem 1.
D. PvP first
- Matchmaking: a queue, invite-by-link and a ranked ladder (Elo or Glicko).
- Identity: the eom.dev account, with linked wallets as the card source.
- Hosting: the hosting node runs the match, so there's no client trust.
- AI opponents: still available for practice and onboarding.
E. Modes (kept)
- Classic: constructed from owned cards.
- Draft: players draft from a shared pool, so they don't need large collections.
- Trending: stats boosted by live pageviews.
- Peer-hosted house rules: remain data-only.
F. Wikimedia politeness by default
- One client: a single throttled Wikimedia client used by every server-side caller (
server/wiki.ts,server/enrichment.ts, P31 lookups, link lookups). - Throttling:
- a conservative rate limit by default (for example 1 request/s and 1 concurrent request per node, configurable)
maxlag- honour
Retry-Afterwith backoff - batch up to 50 titles per request
- an on-disk cache with ETags and conditional requests
- a daily refresh for live stats
- User-Agent: a default UA that identifies the node and an operator contact, as Wikimedia's policy asks.
- Volume: a design budget for requests per match and per mint.
Open problems for the review team
-
Supply versus "real cards only". What makes a real-cards game playable when a player owns 0–12 cards and the network mints at most about 96 a day? Options to evaluate (add others):
- (a) A small deck size, such as 7–10 cards, with recursion and reuse.
- (b) Your owned cards are your "commanders" or champions, and a shared pool of common public-domain article cards fills the rest. This conflicts with Eric's requirement, so it would have to be argued.
- (c) Draft as the main mode, where the pool is drawn from the whole chain's minted cards and ownership gives cosmetic credit or a guaranteed pick.
- (d) A collection-as-deck where every owned card counts, scaled by size.
- (e) Card copies or "editions" (no consensus change possible, so off-chain only?).
Recommend one, and say what Eric must decide.
-
Is MTG-style attack/block too complex to build, balance and make readable in one night? What is the smallest rules core that still feels like Magic?
-
Is P31 typing reliable enough? Check against the real sample in
docs/game/card-sample.jsonanddocs/game/starter-cards.json. Plan for unclassified cards, which were 14% of Night 1's sample. -
Can "Connected" link lookups be done within the Wikimedia budget? Where does the data come from, and when is it fetched and cached?
-
Can the generated rules text be both deterministic and good? Does it need an LLM? LocalAI exists on the cluster, but determinism and the consensus boundary matter.
-
What scope is realistic for 4.5 hours with about 10 agents, and what gets cut first?