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: WikiDeck/wikideck#23
Co-authored-by: Claude <claude@eom.dev>
18 KiB
Night 2 plan: critic / player-advocate review
Reviewer: critic. Sources: night2/PLAN.md, wd/docs/game/{DESIGN,CARD_DATA}.md, card-sample.json, wd/docs/night/{HANDBOOK,BOUNDARIES}.md, Night 1 report (~/Desktop/night/night-lead/REPORT.md; it is not in wd/docs/night). Ranked by severity, most severe first.
Facts the plan doesn't state, but which decide everything
- Mined cards are random articles.
server/wiki.tsusesgenerator=random. Nobody chooses Barack Obama. The real pool looks like card-sample.json: 34% stubs, villages, beetles, French communes, local elections. "Tetrated dodecahedron vs Obama" will be rare. The everyday matchup is Dichromorpha viridis vs 1954 Gold Coast general election. That's still funny in a deadpan way, but the design and its examples must be built for it, not for celebrity cards. - Supply is about zero, not 96 a day. 12 cards in 16 days, all in one wallet (Eric's), all from day 1. Mining has effectively stopped.
- Mobile can't mine.
App.tsxhides the mining panel whenisNativeApp(), so an Android player can never get a real card. - 14% of sampled cards are living people (33/236 in "Living people"). Events include ongoing protests with deaths (2024–2026 Cuban protests, 2025 Tehreek-e-Labbaik Pakistan protests), a sex scandal, an annexation, and Organization of the Luftwaffe (1933–1945). The safety rules (§6) are needed tonight, not someday.
S1 (blocker). "Real cards" + PvP is impossible today. This is Eric's decision, not the agents'.
Under a literal reading of point 1, exactly one person on Earth can play, and PvP has no opponent. Each option, measured against the request:
- (a) Small decks of 7–10: literal and honest. But only Eric qualifies, and with exactly 12 cards there's no deckbuilding, which is half of what makes MTG feel like MTG.
- (b) Owned "commanders" plus a public filler pool: this is the loaner system Eric just said was only for the demo, renamed. If agents choose it without asking, it's a quiet betrayal of the request.
- (c) Draft from the chain's cards: the cards are real mined cards, but the pool is the same 12 cards every match. It's degenerate until supply grows. On testnet, about 50 cards, it's fine.
- (e) Off-chain editions: prints cards with no proof of work and no consensus. It undermines what "mined" means. Reject it.
- (d) Collection-as-deck: this is (a) with scaling. Fine as the mechanism, but it doesn't solve the 0–3 card player.
Fix: before 21:30, put these questions to Eric. Per standing preference, agents don't start building until Eric gives an explicit go.
- "Does Classic and ranked PvP require 100% owned mined cards? (Recommend: yes.)"
- "Can a player with fewer than N owned cards play casual or practice matches with clearly labelled proxies? They're never ranked, never shown as owned, and appear greyed out with the stamp 'Proxy'. (Recommend: yes, for practice, AI and invite-link casual only.)"
- "Is Draft from the whole chain's minted cards 'real cards'? Ownership would earn the first pick and a credit line in the recap. (Recommend: yes.)"
- "Can your 12 cards be used as public bot and ghost decks? (They're your wallet.)"
- "Should we fix the supply side, so mobile users can get real cards, given that mobile can't mine? Options: a desktop-mining CTA, gifting by transfer (an on-chain action by Eric, not by agents), or an unlock condition such as 'mine 1 card to enter ranked'."
Default if Eric doesn't answer: take the most literal reading. Ranked and Classic use owned cards only. Practice and AI use proxies, which look different. Draft uses chain-minted cards only. No editions. Record the decision in DESIGN.md §0 in Eric's own words.
Design implication either way: the format must be fun with a small deck. Recommend one format with no deck minimum: a 10-card deck at most, and if you own fewer, you play what you own plus visible proxies, casual only. The engine must handle running out of cards gracefully. Draw from a reshuffled graveyard (DESIGN-style "recursion") instead of losing to an empty library.
S2 (blocker). PvP has no population. A ranked ladder tonight is wasted work, and unsafe.
Elo with one eligible player is theatre. Night 1's REPORT (known issues 2–3) also says hosted PvP trusts the host: the host picks the seed, there's no commit–reveal, and the UI log is built from full state and leaks hand contents. A ladder on top of that is cheatable. Fix, in order:
- Invite-by-link casual PvP first, made prominent on the Play screen. Eric can test it with a second account on testnet.
- Async "ghost" matches. You play a bot piloting a real wallet's real deck (with that owner's opt-in), and the result is posted to the owner. This is the PvP that a population of five can actually have.
- The queue backfills with a bot after 30 s, labelled as a bot. Never pass a bot off as a human.
- Defer the ranked ladder until commit–reveal and
viewFor-only logs land. Cut it tonight.
S3 (high). An MTG clone built in one night will be worse than Edit War
Edit War had a real hook: each lane is judged by one Wikipedia stat. The plan replaces it with generic power/toughness/cost. MTG is fun because of hand-designed cards, the stack and instant-speed interaction, and deckbuilding across thousands of cards. Tonight has none of that: procedurally generated text, 12 cards, and no stack. Fix: name the smallest core that still feels like Magic, and only that:
- Two players, 20 life, and a resource that grows by 1 a turn automatically. Locations add +1 when played (no land screw).
- Board of 5 per side. Figures attack. The defender makes one block per attacker, chosen by tapping a blocker and then an attacker. No first strike, trample or multi-block in v1.
- Events are sorcery-speed only. No stack, no priority passes, no opponent-turn interaction. Every response window doubles PvP round-trips and the time needed for UI work.
- One keyword per card at most, from a list of about 8 (Night 1 used 6, with property tests).
- Keep a Wikipedia hook that MTG doesn't have, or this is "MTG with worse cards". Candidate: home stat as the creature's "evasion" (an attention attacker can only be blocked by a card with attention ≥ its own), or the trend arrow as haste. One hook, kept and tested.
- Keep Edit War playable as a mode. The code exists; deleting it removes a working fallback.
S4 (high). 360 px readability
An MTG board (two battlefields, hand, life, resources, rules text, combat arrows) doesn't fit 360 px if the cards carry generated paragraphs. Fix:
- The card face on the battlefield shows: title (2-line clamp), type icon, cost, P/T, one keyword chip. The rules text and flavour live only in the tap-to-zoom sheet.
- Rules text has a hard limit of 90 characters, enforced by a test over the whole sample.
- Combat uses a "declare attackers → defender blocks → preview outcome → confirm" sheet, not drawn arrows.
- The QA gate is a 360×640 screenshot of a full board (5 + 5) on Android, attached to the UI PR.
S5 (high). Night 1 process lessons the plan doesn't apply
What went wrong (REPORT plus handbook):
- The design froze at 23:01, but the balance numbers were measured before the #38 change, so the shipped seat-advantage figure is stale.
- 3 OOMs (tower-plus, and r350 twice).
- imac's Gitea MCP was down all night, so the council had to relay through night-lead.
- Squash merges of stacked PRs caused add/add conflicts.
- Wikimedia 429s came from our own sampler.
- On Node 20, 12 tests failed falsely.
Fixes:
-
Freeze rules on a schedule, and gate them on evidence. Design frozen by 22:30 (one hour, not 45 minutes: this is a bigger redesign). Engine API by 22:45. The balance re-run happens on the final head, after the last engine PR, and its numbers go in the report with the SHA they were measured on.
-
Fewer, wider agents. 7–8, not 10:
- designer and critic as one council pair
- an engine agent
- a card-derivation and text-generator agent (it owns the safety rules)
- a UI agent
- a PvP/host agent
- a wiki-client agent
- a lead and a review agent
Night 1's 17 agents produced conflict and relay overhead.
-
Pre-flight at 21:30:
- run
get_meon Gitea MCP on every machine node:24-alpineis the only test image- all heavy work runs under
flockon inspiron - no stacked PRs: rebase-and-merge, or wait for the parent to merge
- run
-
No network in tests. Every test and sim reads card-sample.json and starter-cards.json, plus a new red-team fixture (§6). The only process allowed to call Wikimedia tonight is the new throttled client's own smoke test, at 1 request/s.
-
Use testnet for real-cards testing. It has about 50 mined cards across wallets the team controls. Seed 3–4 test wallets with 1, 3, 8 and 20 cards by transfer on testnet. Never simulate mainnet supply by copying Eric's wallet.
-
Mainnet is read-only, and only if needed at all. Read the 12 cards' public data so Eric's own deck can go into a fixture. Nothing is written.
S6 (high). Ethics and safety: content rules for the deadpan generator
The joke only works if the game is respectful about the subject and absurd only in the juxtaposition. These rules are requirements with tests, owned by the card-text agent:
- No free-form generated prose about real people or events. Templates only. No LLM, including LocalAI. That also keeps the output deterministic. The only article-derived prose is the extract's first sentence, quoted verbatim and attributed.
- Figures are never harmed, killed or humiliated in text. Log verbs for a Figure leaving play come from an editorial whitelist: "was reverted", "left the battlefield", "was archived", "was withdrawn from the record". Banned for any card: killed, died, destroyed (for Figures), executed, assassinated, murdered, humiliated, crushed, slaughtered, raped, lynched. "Destroy target Institution" is fine.
- Mechanics never derive from sensitive attributes. Category-keyword templates for Figures come from an allowlist of neutral occupation and field words (politicians, mathematicians, footballers, painters, alumni). Never derive a mechanic from: crime, conviction, scandal, illness, disability, cause of death, ethnicity, religion, sexuality, gender, nationality as a trait, victimhood.
- Country is allowed only as a neutral "Connected" link (shared P27/P17). It must never carry a modifier such as "French: −1".
- Birth and death years may appear in the type line ("Figure — 1949–2019"). Nothing triggers on death.
- Solemn subjects get a
solemnflag. It's set by P31 class (war, battle with casualties, massacre, genocide, terrorist attack, mass shooting, disaster, epidemic/pandemic, aviation or maritime accident, protest with deaths, war crime, the Holocaust) or by category words (massacres, genocides, terrorist incidents, disasters in, deaths in, murders, sexual abuse, victims, suicides).- Solemn cards are playable. They get one fixed neutral effect ("Commemoration: gain 1 Citation; draw a card"), no damage or removal text, a plain log line ("entered the record"), and they are never used to name a battle or shown in a recap headline.
- Events in general never "deal damage to" a Figure. Removal comes from Doctrines and Institutions ("Revert", "Edit war").
- Glorification guard. No "leader", "inspire" or "rally" keywords keyed on heads of state, military leaders or dictators. Every Figure's keyword comes from stats, type and faction only. A Adolf Hitler card must be a plain statted Figure with no buff-allies text. Test it.
- Living people (BLP): the flavour text is the extract sentence only, and the recap uses only the card title. Any
Living peoplecard mentioned in a recap is linked to its article and nothing is asserted about the person. Card actions in text are attributed to "the Barack Obama card" or the commander, not to the person. - Mint-time vandalism. The extract is frozen at mint and may be a vandalised revision. Render flavour from the cached current extract when possible. Give node operators a data-only
hiddenFlavour: [pageId]list and a report link on the card zoom sheet. - Recap pages must not impersonate Wikipedia.
- No Wikipedia wordmark or puzzle-globe logo, and no "From Wikipedia, the free encyclopedia".
- The header reads "WikiDeck match record", with a hatnote: "This article is about a WikiDeck match. For the polyhedron, see Tetrated dodecahedron." That's funny, honest, and keeps us clear of the trademark.
- CC BY-SA attribution for extracts and images, in References.
- Player privacy. Shareable recaps are opt-in per match. Commanders show as the account display name or "Anonymous", never a wallet address unless the player chooses.
- Red-team fixture plus a sign-off gate.
tests/fixtures/sensitive-cards.jsonholds hand-written PageEnrichment for: Barack Obama, Donald Trump, Adolf Hitler, Jesus, Muhammad, Yemọja, September 11 attacks, The Holocaust, Sandy Hook Elementary School shooting, 2004 Indian Ocean earthquake and tsunami, COVID-19 pandemic, a living child actor, Pullman porter affair, 2024–2026 Cuban protests, Cho Yang-ho, and Tetrated dodecahedron.- A test snapshots their full rules text, log lines and a recap, then asserts the banned-verb list and the solemn rules.
- The snapshot file goes into the morning report for Eric to read before anything is shared publicly.
S7 (medium). Tone: how deadpan fails, with examples
- Failure modes:
- Wacky: puns, exclamation marks, emoji, winks.
- Cringe: the generator "noticing" the joke ("In a surprising twist…").
- Dull: logs that read like a stack trace.
- Mean: adjectives about the losing side.
- Rule: the text never comments on how odd the matchup is. The comedy is entirely in the nouns.
- Card rules text.
- DO: "Tetrated dodecahedron — Doctrine — Ideas. Figures you control with Depth 7 or more get +1/+1."
- DO: "Barack Obama — Figure — People, 1961– · 3/4 · Connected (+1/+1 while you control a Connected card)."
- DON'T: "Yes He Can! Obama gets +2 power because he's the president!"
- DON'T: "This shape is so complex it hurts your opponent's brain."
- Match log.
- DO: "Turn 6. Cho Yang-ho (4/5) attacked. Dichromorpha viridis (1/2) blocked and was reverted. Commander Eric cited Tetrated dodecahedron: Cho Yang-ho +1/+1 until end of turn."
- DON'T: "Cho Yang-ho SQUASHED the grasshopper lol." Also don't use "killed", or use any adjective (brutal, humiliating, heroic).
- Recap.
- DO: "The Battle of the Tetrated Dodecahedron was a WikiDeck engagement fought on 17 November 2026 between the forces of Eric and Bot (Normal). It lasted nine turns and ended in a decisive victory for Eric.[1] Contemporary accounts note the deployment of Barack Obama in the fourth turn.[2]"
- The infobox field is "Cards withdrawn", not "Casualties". Battles are named after the decisive non-Figure, non-solemn card; fall back to "Match of 17 November 2026".
- DON'T: "Obama was humiliated by a shape," or "the bloodiest battle in WikiDeck history."
- Dull guard: vary sentences by deterministic seed across 3–4 synonymous templates per event, and use citation numbers [n] that link to the card's real article. That small Wikipedia texture is most of the charm.
S8 (medium). "Connected" will almost never fire on random articles
Two random articles almost never link to each other. Fetching prop=links per card is costly, at hundreds of links a page, and it doesn't fit the 1 request/s budget.
Fix:
- Connect cards on cheap shared Wikidata claims fetched once per card at first sight and cached for good: country (P17/P27), century (from P569/P571/P585), and same P31 superclass or faction. Leave out the article link graph tonight.
- Measure the fire rate on card-sample.json (random pairs) and on Eric's 12. Target 15–30% of pairs. If it's lower, the mechanic is invisible.
S9 (medium). Wikimedia politeness (point 7): good plan, three gaps
- The plan never says who decides the production UA. REPORT next step 8 leaves it to Eric. Ship the default as
WikiDeck/<version> (node: <PUBLIC_ORIGIN>; operator contact required), refuse to start the enrichment client without a contact configured, and leave production config to Eric. - Rate limits must be per egress IP, but all of Eric's nodes share one IP. Use one shared limiter per host IP: a single node acts as the Wikimedia proxy for the cluster, or the budget is split statically.
- Set a request budget per match: zero Wikimedia calls during a match. All P31, claims and trend data are fetched at deck validation or lobby time from the cache. Trending's live stats come from the daily refresh.
S10 (medium). Modes under the new engine (point 5)
Draft and Trending must be re-specified, not just "kept":
- Draft with a 12-card pool must deal from all chain-minted cards, or Eric must decide (S1-3).
- Trending uses the daily cache (S9).
- The house-rules JSON schema changes with the engine. Version it (
rulesetVersion: 2) so Night 1 mode files on testnet nodes are rejected cleanly instead of misread.
S11 (low). Story (point 3) depends on the recap
The plan's "story" is Connected plus the recap. Given S8, the recap and log carry the whole of point 3, so prioritise them over the ladder. The recap is cheap (a deterministic template over the match log) and is the most "Eric" deliverable.
Scope: what gets built, and what gets cut first
Build, in this order:
- The throttled Wikimedia client and cache. Nothing else calls Wikipedia.
- Card derivation (type, faction, P/T, cost, keyword) with safety rules and the red-team test.
- The smallest MTG core engine plus bots.
- A 360 px match UI.
- Invite-link PvP and ghost or bot matches.
- The match log and battle recap.
- Draft and Trending ported.
Cut first: the ranked ladder and Elo, the Wikipedia link graph, instant-speed Events, the Citations resource as a second currency (fold it into one keyword), and the "editions" idea.
Decisions for Eric (to ask before kickoff, all in one message)
- Real-cards strictness (S1 questions 1–3).
- Use of his 12 cards as public bot and ghost decks.
- A mobile path to owning cards.
- Keep Edit War as a mode? (Recommend: yes.)
- Sign-off on the safety rules in S6, especially solemn Events and living persons.
- Production User-Agent and contact.
- Are shareable recaps public by default? (Recommend: opt-in.)